Changed: Settings dialog

This commit is contained in:
kervala 2016-06-12 15:41:35 +02:00
parent 47e31b913e
commit 31008adfaf
5 changed files with 64 additions and 5 deletions

View file

@ -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();

View file

@ -42,6 +42,7 @@ public slots:
void onConfigureClicked();
void onProfiles();
void onSettings();
void onUninstall();
void onQuit();

View file

@ -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();
}

View file

@ -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();
};

View file

@ -118,7 +118,7 @@ p, li { white-space: pre-wrap; }
<string>&amp;Settings</string>
</property>
<addaction name="actionProfiles"/>
<addaction name="actionDirectories"/>
<addaction name="actionSettings"/>
<addaction name="actionUninstall"/>
<addaction name="separator"/>
<addaction name="actionQuit"/>
@ -148,9 +148,9 @@ p, li { white-space: pre-wrap; }
<string>&amp;Profiles</string>
</property>
</action>
<action name="actionDirectories">
<action name="actionSettings">
<property name="text">
<string>&amp;Directories</string>
<string>&amp;Settings</string>
</property>
</action>
<action name="actionQuit">