mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-20 07:58:44 +00:00
Changed: Settings dialog
This commit is contained in:
parent
47e31b913e
commit
31008adfaf
5 changed files with 64 additions and 5 deletions
|
@ -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();
|
||||
|
|
|
@ -42,6 +42,7 @@ public slots:
|
|||
void onConfigureClicked();
|
||||
|
||||
void onProfiles();
|
||||
void onSettings();
|
||||
void onUninstall();
|
||||
void onQuit();
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
|
@ -118,7 +118,7 @@ p, li { white-space: pre-wrap; }
|
|||
<string>&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>&Profiles</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDirectories">
|
||||
<action name="actionSettings">
|
||||
<property name="text">
|
||||
<string>&Directories</string>
|
||||
<string>&Settings</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionQuit">
|
||||
|
|
Loading…
Reference in a new issue