From fd861467b66bc3407cbf3adf36aebc6f7124af91 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 6 Aug 2016 20:10:31 +0200 Subject: [PATCH] Changed: Display directories in Settings, see #279 --HG-- branch : develop --- .../ryzom_installer/src/settingsdialog.cpp | 20 ++++++-- .../ryzom_installer/src/settingsdialog.h | 7 +++ .../ryzom_installer/ui/settingsdialog.ui | 50 ++++++++++++------- 3 files changed, 56 insertions(+), 21 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/settingsdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/settingsdialog.cpp index 7ffe515f5..53090b592 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/settingsdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/settingsdialog.cpp @@ -28,6 +28,10 @@ CSettingsDialog::CSettingsDialog(QWidget *parent):QDialog(parent) CConfigFile *config = CConfigFile::getInstance(); + m_installationDirectory = config->getInstallationDirectory(); + + updateInstallationDirectoryLabel(); + // only 64 bits OS can switch between 32 and 64 bits use64bitsClientsCheckBox->setEnabled(config->has64bitsOS()); @@ -47,6 +51,11 @@ CSettingsDialog::~CSettingsDialog() { } +QString CSettingsDialog::getInstallationDirectory() const +{ + return m_installationDirectory; +} + void CSettingsDialog::accept() { // TODO: add save code @@ -56,11 +65,16 @@ void CSettingsDialog::accept() void CSettingsDialog::onInstallationDirectoryButtonClicked() { - QString directory = QFileDialog::getExistingDirectory(this, tr("Please choose directory where to install Ryzom")); + QString directory = QFileDialog::getExistingDirectory(this, tr("Please choose directory where to install Ryzom"), m_installationDirectory); if (directory.isEmpty()) return; -// m_dstDirectory = directory; + m_installationDirectory = directory; + + updateInstallationDirectoryLabel(); +} -// updateDestinationText(); +void CSettingsDialog::updateInstallationDirectoryLabel() +{ + installationDirectoryLabel->setText(m_installationDirectory); } diff --git a/code/ryzom/tools/client/ryzom_installer/src/settingsdialog.h b/code/ryzom/tools/client/ryzom_installer/src/settingsdialog.h index 285a6417b..c2b3d69c8 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/settingsdialog.h +++ b/code/ryzom/tools/client/ryzom_installer/src/settingsdialog.h @@ -33,11 +33,18 @@ public: CSettingsDialog(QWidget *parent = NULL); virtual ~CSettingsDialog(); + QString getInstallationDirectory() const; + public slots: void onInstallationDirectoryButtonClicked(); private slots: void accept(); + +private: + void updateInstallationDirectoryLabel(); + + QString m_installationDirectory; }; #endif diff --git a/code/ryzom/tools/client/ryzom_installer/ui/settingsdialog.ui b/code/ryzom/tools/client/ryzom_installer/ui/settingsdialog.ui index 4887ced56..11f91f7d4 100644 --- a/code/ryzom/tools/client/ryzom_installer/ui/settingsdialog.ui +++ b/code/ryzom/tools/client/ryzom_installer/ui/settingsdialog.ui @@ -6,7 +6,7 @@ 0 0 - 400 + 428 150 @@ -15,25 +15,36 @@ - + + + + + Use 64 bits client + + + + + + + Base location of Ryzom files: + + + - + Language - - - - - + + - Base location of Ryzom files: %1 + Browse... - + Browse... @@ -41,26 +52,29 @@ - + - Location of source Ryzom files: %1 + Location of source Ryzom files: - - + + - Browse... + D:\Ryzom - - + + - Use 64 bits client + E:\Ryzom + + +