Changed: Settings dialog
This commit is contained in:
parent
83254b26be
commit
3428e46103
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(m_downloader, SIGNAL(htmlPageContent(QString)), SLOT(onHtmlPageContent(QString)));
|
||||||
|
|
||||||
connect(actionProfiles, SIGNAL(triggered()), SLOT(onProfiles()));
|
connect(actionProfiles, SIGNAL(triggered()), SLOT(onProfiles()));
|
||||||
|
connect(actionSettings, SIGNAL(triggered()), SLOT(onSettings()));
|
||||||
connect(actionUninstall, SIGNAL(triggered()), SLOT(onUninstall()));
|
connect(actionUninstall, SIGNAL(triggered()), SLOT(onUninstall()));
|
||||||
connect(actionQuit, SIGNAL(triggered()), SLOT(onQuit()));
|
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()
|
void CMainWindow::onUninstall()
|
||||||
{
|
{
|
||||||
CConfigFile *config = CConfigFile::getInstance();
|
CConfigFile *config = CConfigFile::getInstance();
|
||||||
|
|
|
@ -42,6 +42,7 @@ public slots:
|
||||||
void onConfigureClicked();
|
void onConfigureClicked();
|
||||||
|
|
||||||
void onProfiles();
|
void onProfiles();
|
||||||
|
void onSettings();
|
||||||
void onUninstall();
|
void onUninstall();
|
||||||
void onQuit();
|
void onQuit();
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,31 @@
|
||||||
|
|
||||||
#include "stdpch.h"
|
#include "stdpch.h"
|
||||||
#include "settingsdialog.h"
|
#include "settingsdialog.h"
|
||||||
|
#include "configfile.h"
|
||||||
|
|
||||||
#ifdef DEBUG_NEW
|
#ifdef DEBUG_NEW
|
||||||
#define new DEBUG_NEW
|
#define new DEBUG_NEW
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CSettingsDialog::CSettingsDialog():QDialog()
|
CSettingsDialog::CSettingsDialog(QWidget *parent):QDialog(parent)
|
||||||
{
|
{
|
||||||
setupUi(this);
|
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()
|
CSettingsDialog::~CSettingsDialog()
|
||||||
|
@ -36,3 +53,14 @@ void CSettingsDialog::accept()
|
||||||
|
|
||||||
QDialog::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
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CSettingsDialog();
|
CSettingsDialog(QWidget *parent = NULL);
|
||||||
virtual ~CSettingsDialog();
|
virtual ~CSettingsDialog();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void onInstallationDirectoryButtonClicked();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void accept();
|
void accept();
|
||||||
};
|
};
|
||||||
|
|
|
@ -118,7 +118,7 @@ p, li { white-space: pre-wrap; }
|
||||||
<string>&Settings</string>
|
<string>&Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actionProfiles"/>
|
<addaction name="actionProfiles"/>
|
||||||
<addaction name="actionDirectories"/>
|
<addaction name="actionSettings"/>
|
||||||
<addaction name="actionUninstall"/>
|
<addaction name="actionUninstall"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionQuit"/>
|
<addaction name="actionQuit"/>
|
||||||
|
@ -148,9 +148,9 @@ p, li { white-space: pre-wrap; }
|
||||||
<string>&Profiles</string>
|
<string>&Profiles</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionDirectories">
|
<action name="actionSettings">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Directories</string>
|
<string>&Settings</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionQuit">
|
<action name="actionQuit">
|
||||||
|
|
Loading…
Reference in a new issue