Changed: New button for default location

This commit is contained in:
kervala 2016-09-29 16:54:50 +02:00
parent 8f5dbd9157
commit 25ec3e3a8f
6 changed files with 44 additions and 8 deletions

View file

@ -49,9 +49,8 @@ CInstallDialog::CInstallDialog():QDialog()
updateAnotherLocationText(); updateAnotherLocationText();
m_dstDirectory = CConfigFile::getNewInstallationDirectory(); // update default destination
onDestinationDefaultButtonClicked();
updateDestinationText();
// check whether OS architecture is 32 or 64 bits // check whether OS architecture is 32 or 64 bits
if (CConfigFile::has64bitsOS()) if (CConfigFile::has64bitsOS())
@ -71,6 +70,7 @@ CInstallDialog::CInstallDialog():QDialog()
destinationGroupBox->setTitle(tr("Files will be installed to (requires %1):").arg(qBytesToHumanReadable(server.dataUncompressedSize))); destinationGroupBox->setTitle(tr("Files will be installed to (requires %1):").arg(qBytesToHumanReadable(server.dataUncompressedSize)));
connect(anotherLocationBrowseButton, SIGNAL(clicked()), SLOT(onAnotherLocationBrowseButtonClicked())); connect(anotherLocationBrowseButton, SIGNAL(clicked()), SLOT(onAnotherLocationBrowseButtonClicked()));
connect(destinationDefaultButton, SIGNAL(clicked()), SLOT(onDestinationDefaultButtonClicked()));
connect(destinationBrowseButton, SIGNAL(clicked()), SLOT(onDestinationBrowseButtonClicked())); connect(destinationBrowseButton, SIGNAL(clicked()), SLOT(onDestinationBrowseButtonClicked()));
// TODO: if found a folder with initial data, get its total size and check if at least that size is free on the disk // TODO: if found a folder with initial data, get its total size and check if at least that size is free on the disk
@ -117,6 +117,13 @@ void CInstallDialog::onAnotherLocationBrowseButtonClicked()
updateAnotherLocationText(); updateAnotherLocationText();
} }
void CInstallDialog::onDestinationDefaultButtonClicked()
{
m_dstDirectory = CConfigFile::getNewInstallationDirectory();
updateDestinationText();
}
void CInstallDialog::onDestinationBrowseButtonClicked() void CInstallDialog::onDestinationBrowseButtonClicked()
{ {
QString directory = QFileDialog::getExistingDirectory(this, tr("Please choose directory to install Ryzom in")); QString directory = QFileDialog::getExistingDirectory(this, tr("Please choose directory to install Ryzom in"));

View file

@ -36,6 +36,7 @@ public:
private slots: private slots:
void onShowAdvancedParameters(int state); void onShowAdvancedParameters(int state);
void onAnotherLocationBrowseButtonClicked(); void onAnotherLocationBrowseButtonClicked();
void onDestinationDefaultButtonClicked();
void onDestinationBrowseButtonClicked(); void onDestinationBrowseButtonClicked();
void accept(); void accept();

View file

@ -46,9 +46,8 @@ CMigrateDialog::CMigrateDialog():QDialog()
} }
} }
m_dstDirectory = CConfigFile::getNewInstallationDirectory(); // update default destination
onDestinationDefaultButtonClicked();
updateDestinationText();
// check whether OS architecture is 32 or 64 bits // check whether OS architecture is 32 or 64 bits
if (CConfigFile::has64bitsOS()) if (CConfigFile::has64bitsOS())
@ -66,6 +65,7 @@ CMigrateDialog::CMigrateDialog():QDialog()
destinationGroupBox->setTitle(tr("Files will be installed to (requires %1):").arg(qBytesToHumanReadable(server.dataUncompressedSize))); destinationGroupBox->setTitle(tr("Files will be installed to (requires %1):").arg(qBytesToHumanReadable(server.dataUncompressedSize)));
connect(destinationDefaultButton, SIGNAL(clicked()), SLOT(onDestinationDefaultButtonClicked()));
connect(destinationBrowseButton, SIGNAL(clicked()), SLOT(onDestinationBrowseButtonClicked())); connect(destinationBrowseButton, SIGNAL(clicked()), SLOT(onDestinationBrowseButtonClicked()));
connect(continueButton, SIGNAL(clicked()), SLOT(accept())); connect(continueButton, SIGNAL(clicked()), SLOT(accept()));
connect(quitButton, SIGNAL(clicked()), SLOT(reject())); connect(quitButton, SIGNAL(clicked()), SLOT(reject()));
@ -91,6 +91,13 @@ void CMigrateDialog::onShowAdvancedParameters(int state)
adjustSize(); adjustSize();
} }
void CMigrateDialog::onDestinationDefaultButtonClicked()
{
m_dstDirectory = CConfigFile::getNewInstallationDirectory();
updateDestinationText();
}
void CMigrateDialog::onDestinationBrowseButtonClicked() void CMigrateDialog::onDestinationBrowseButtonClicked()
{ {
QString directory = QFileDialog::getExistingDirectory(this, tr("Please choose directory to install Ryzom in")); QString directory = QFileDialog::getExistingDirectory(this, tr("Please choose directory to install Ryzom in"));

View file

@ -35,6 +35,7 @@ public:
private slots: private slots:
void onShowAdvancedParameters(int state); void onShowAdvancedParameters(int state);
void onDestinationDefaultButtonClicked();
void onDestinationBrowseButtonClicked(); void onDestinationBrowseButtonClicked();
void accept(); void accept();

View file

@ -146,7 +146,7 @@ Just follow the different steps and make your choice between the options presen
<property name="title"> <property name="title">
<string>Files will be installed to (requires 10 GiB):</string> <string>Files will be installed to (requires 10 GiB):</string>
</property> </property>
<layout class="QHBoxLayout" name="destinationLayout" stretch="1,0"> <layout class="QHBoxLayout" name="destinationLayout" stretch="1,0,0">
<item> <item>
<widget class="QLabel" name="destinationLabel"> <widget class="QLabel" name="destinationLabel">
<property name="text"> <property name="text">
@ -154,6 +154,13 @@ Just follow the different steps and make your choice between the options presen
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="destinationDefaultButton">
<property name="text">
<string>Default</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="destinationBrowseButton"> <widget class="QPushButton" name="destinationBrowseButton">
<property name="text"> <property name="text">
@ -206,10 +213,12 @@ Just follow the different steps and make your choice between the options presen
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>advancedCheckBox</tabstop>
<tabstop>oldDirectoryRadioButton</tabstop> <tabstop>oldDirectoryRadioButton</tabstop>
<tabstop>anotherLocationRadioButton</tabstop> <tabstop>anotherLocationRadioButton</tabstop>
<tabstop>anotherLocationBrowseButton</tabstop> <tabstop>anotherLocationBrowseButton</tabstop>
<tabstop>internetRadioButton</tabstop> <tabstop>internetRadioButton</tabstop>
<tabstop>destinationDefaultButton</tabstop>
<tabstop>destinationBrowseButton</tabstop> <tabstop>destinationBrowseButton</tabstop>
<tabstop>clientArch64RadioButton</tabstop> <tabstop>clientArch64RadioButton</tabstop>
<tabstop>clientArch32RadioButton</tabstop> <tabstop>clientArch32RadioButton</tabstop>

View file

@ -93,7 +93,7 @@ Just press Continue button and follow the different steps until everything is do
<property name="title"> <property name="title">
<string>Files will be installed to (requires 10 GiB):</string> <string>Files will be installed to (requires 10 GiB):</string>
</property> </property>
<layout class="QHBoxLayout" name="destinationLayout" stretch="1,0"> <layout class="QHBoxLayout" name="destinationLayout" stretch="1,0,0">
<item> <item>
<widget class="QLabel" name="destinationLabel"> <widget class="QLabel" name="destinationLabel">
<property name="text"> <property name="text">
@ -101,6 +101,13 @@ Just press Continue button and follow the different steps until everything is do
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="destinationDefaultButton">
<property name="text">
<string>Default</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="destinationBrowseButton"> <widget class="QPushButton" name="destinationBrowseButton">
<property name="text"> <property name="text">
@ -174,9 +181,13 @@ Just press Continue button and follow the different steps until everything is do
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>advancedCheckBox</tabstop>
<tabstop>destinationDefaultButton</tabstop>
<tabstop>destinationBrowseButton</tabstop> <tabstop>destinationBrowseButton</tabstop>
<tabstop>clientArch64RadioButton</tabstop> <tabstop>clientArch64RadioButton</tabstop>
<tabstop>clientArch32RadioButton</tabstop> <tabstop>clientArch32RadioButton</tabstop>
<tabstop>continueButton</tabstop>
<tabstop>quitButton</tabstop>
</tabstops> </tabstops>
<resources/> <resources/>
<connections/> <connections/>