2016-02-25 20:19:27 +00:00
|
|
|
// 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"
|
2016-06-12 13:41:35 +00:00
|
|
|
#include "configfile.h"
|
2016-02-25 20:19:27 +00:00
|
|
|
|
|
|
|
#ifdef DEBUG_NEW
|
|
|
|
#define new DEBUG_NEW
|
|
|
|
#endif
|
|
|
|
|
2016-06-12 13:41:35 +00:00
|
|
|
CSettingsDialog::CSettingsDialog(QWidget *parent):QDialog(parent)
|
2016-02-25 20:19:27 +00:00
|
|
|
{
|
|
|
|
setupUi(this);
|
2016-06-12 13:41:35 +00:00
|
|
|
|
|
|
|
CConfigFile *config = CConfigFile::getInstance();
|
|
|
|
|
2016-08-06 18:10:31 +00:00
|
|
|
m_installationDirectory = config->getInstallationDirectory();
|
|
|
|
|
|
|
|
updateInstallationDirectoryLabel();
|
|
|
|
|
2016-06-12 13:41:35 +00:00
|
|
|
// 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());
|
2016-02-25 20:19:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CSettingsDialog::~CSettingsDialog()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-08-06 18:10:31 +00:00
|
|
|
QString CSettingsDialog::getInstallationDirectory() const
|
|
|
|
{
|
|
|
|
return m_installationDirectory;
|
|
|
|
}
|
|
|
|
|
2016-02-25 20:19:27 +00:00
|
|
|
void CSettingsDialog::accept()
|
|
|
|
{
|
|
|
|
// TODO: add save code
|
|
|
|
|
|
|
|
QDialog::accept();
|
|
|
|
}
|
2016-06-12 13:41:35 +00:00
|
|
|
|
|
|
|
void CSettingsDialog::onInstallationDirectoryButtonClicked()
|
|
|
|
{
|
2016-08-06 18:10:31 +00:00
|
|
|
QString directory = QFileDialog::getExistingDirectory(this, tr("Please choose directory where to install Ryzom"), m_installationDirectory);
|
2016-06-12 13:41:35 +00:00
|
|
|
|
|
|
|
if (directory.isEmpty()) return;
|
|
|
|
|
2016-08-06 18:10:31 +00:00
|
|
|
m_installationDirectory = directory;
|
|
|
|
|
|
|
|
updateInstallationDirectoryLabel();
|
|
|
|
}
|
2016-06-12 13:41:35 +00:00
|
|
|
|
2016-08-06 18:10:31 +00:00
|
|
|
void CSettingsDialog::updateInstallationDirectoryLabel()
|
|
|
|
{
|
|
|
|
installationDirectoryLabel->setText(m_installationDirectory);
|
2016-06-12 13:41:35 +00:00
|
|
|
}
|