From ba58cdd295945c79d395535f7f6cdce5ee02e41b Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 12 Jun 2016 15:41:35 +0200 Subject: [PATCH] Changed: Settings dialog --HG-- branch : develop --- .../client/ryzom_installer/src/mainwindow.cpp | 27 +++++++++++++++++ .../client/ryzom_installer/src/mainwindow.h | 1 + .../ryzom_installer/src/settingsdialog.cpp | 30 ++++++++++++++++++- .../ryzom_installer/src/settingsdialog.h | 5 +++- .../client/ryzom_installer/ui/mainwindow.ui | 6 ++-- 5 files changed, 64 insertions(+), 5 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp b/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp index bcb7cad68..a69426ffa 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp @@ -41,6 +41,7 @@ CMainWindow::CMainWindow():QMainWindow() connect(m_downloader, SIGNAL(htmlPageContent(QString)), SLOT(onHtmlPageContent(QString))); connect(actionProfiles, SIGNAL(triggered()), SLOT(onProfiles())); + connect(actionSettings, SIGNAL(triggered()), SLOT(onSettings())); connect(actionUninstall, SIGNAL(triggered()), SLOT(onUninstall())); connect(actionQuit, SIGNAL(triggered()), SLOT(onQuit())); @@ -161,6 +162,32 @@ void CMainWindow::onProfiles() } } +void CMainWindow::onSettings() +{ + bool updated = false; + + { + CSettingsDialog dialog(this); + + if (dialog.exec()) + { + updated = true; + } + } + + if (updated) + { +// COperationDialog dialog(this); + +// dialog.setOperation(COperationDialog::OperationUpdateProfiles); + +// if (!dialog.exec()) +// { + // aborted +// } + } +} + void CMainWindow::onUninstall() { CConfigFile *config = CConfigFile::getInstance(); diff --git a/code/ryzom/tools/client/ryzom_installer/src/mainwindow.h b/code/ryzom/tools/client/ryzom_installer/src/mainwindow.h index e52d47cb1..aca37c3f3 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/mainwindow.h +++ b/code/ryzom/tools/client/ryzom_installer/src/mainwindow.h @@ -42,6 +42,7 @@ public slots: void onConfigureClicked(); void onProfiles(); + void onSettings(); void onUninstall(); void onQuit(); diff --git a/code/ryzom/tools/client/ryzom_installer/src/settingsdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/settingsdialog.cpp index a919bc2c7..7ffe515f5 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/settingsdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/settingsdialog.cpp @@ -16,14 +16,31 @@ #include "stdpch.h" #include "settingsdialog.h" +#include "configfile.h" #ifdef DEBUG_NEW #define new DEBUG_NEW #endif -CSettingsDialog::CSettingsDialog():QDialog() +CSettingsDialog::CSettingsDialog(QWidget *parent):QDialog(parent) { setupUi(this); + + CConfigFile *config = CConfigFile::getInstance(); + + // only 64 bits OS can switch between 32 and 64 bits + use64bitsClientsCheckBox->setEnabled(config->has64bitsOS()); + + // read value from config + use64bitsClientsCheckBox->setChecked(config->use64BitsClient()); + + connect(installationDirectoryButton, SIGNAL(clicked()), SLOT(onInstallationDirectoryButtonClicked())); + + // resize layout depending on content and constraints + adjustSize(); + + // fix height because to left bitmap + setFixedHeight(height()); } CSettingsDialog::~CSettingsDialog() @@ -36,3 +53,14 @@ void CSettingsDialog::accept() QDialog::accept(); } + +void CSettingsDialog::onInstallationDirectoryButtonClicked() +{ + QString directory = QFileDialog::getExistingDirectory(this, tr("Please choose directory where to install Ryzom")); + + if (directory.isEmpty()) return; + +// m_dstDirectory = directory; + +// updateDestinationText(); +} diff --git a/code/ryzom/tools/client/ryzom_installer/src/settingsdialog.h b/code/ryzom/tools/client/ryzom_installer/src/settingsdialog.h index 1e20532f6..285a6417b 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/settingsdialog.h +++ b/code/ryzom/tools/client/ryzom_installer/src/settingsdialog.h @@ -30,9 +30,12 @@ class CSettingsDialog : public QDialog, public Ui::SettingsDialog Q_OBJECT public: - CSettingsDialog(); + CSettingsDialog(QWidget *parent = NULL); virtual ~CSettingsDialog(); +public slots: + void onInstallationDirectoryButtonClicked(); + private slots: void accept(); }; diff --git a/code/ryzom/tools/client/ryzom_installer/ui/mainwindow.ui b/code/ryzom/tools/client/ryzom_installer/ui/mainwindow.ui index 4fd935e41..cfb2b7a79 100644 --- a/code/ryzom/tools/client/ryzom_installer/ui/mainwindow.ui +++ b/code/ryzom/tools/client/ryzom_installer/ui/mainwindow.ui @@ -118,7 +118,7 @@ p, li { white-space: pre-wrap; } &Settings - + @@ -148,9 +148,9 @@ p, li { white-space: pre-wrap; } &Profiles - + - &Directories + &Settings