mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-22 00:48:44 +00:00
3bf24e05f1
--HG-- branch : develop
80 lines
2.2 KiB
C++
80 lines
2.2 KiB
C++
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
|
// Copyright (C) 2010 Winch Gate Property Limited
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Affero General Public License as
|
|
// published by the Free Software Foundation, either version 3 of the
|
|
// License, or (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU Affero General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#include "stdpch.h"
|
|
#include "settingsdialog.h"
|
|
#include "configfile.h"
|
|
|
|
#ifdef DEBUG_NEW
|
|
#define new DEBUG_NEW
|
|
#endif
|
|
|
|
CSettingsDialog::CSettingsDialog(QWidget *parent):QDialog(parent)
|
|
{
|
|
setupUi(this);
|
|
|
|
CConfigFile *config = CConfigFile::getInstance();
|
|
|
|
m_installationDirectory = config->getInstallationDirectory();
|
|
|
|
updateInstallationDirectoryLabel();
|
|
|
|
// 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()
|
|
{
|
|
}
|
|
|
|
QString CSettingsDialog::getInstallationDirectory() const
|
|
{
|
|
return m_installationDirectory;
|
|
}
|
|
|
|
void CSettingsDialog::accept()
|
|
{
|
|
// TODO: add save code
|
|
|
|
QDialog::accept();
|
|
}
|
|
|
|
void CSettingsDialog::onInstallationDirectoryButtonClicked()
|
|
{
|
|
QString directory = QFileDialog::getExistingDirectory(this, tr("Please choose directory to install Ryzom in"), m_installationDirectory);
|
|
|
|
if (directory.isEmpty()) return;
|
|
|
|
m_installationDirectory = directory;
|
|
|
|
updateInstallationDirectoryLabel();
|
|
}
|
|
|
|
void CSettingsDialog::updateInstallationDirectoryLabel()
|
|
{
|
|
installationDirectoryLabel->setText(m_installationDirectory);
|
|
}
|