Changed: Display directories in Settings, see #279

--HG--
branch : develop
feature/pipeline-tools
kervala 8 years ago
parent 388cb6445a
commit fd861467b6

@ -28,6 +28,10 @@ CSettingsDialog::CSettingsDialog(QWidget *parent):QDialog(parent)
CConfigFile *config = CConfigFile::getInstance(); CConfigFile *config = CConfigFile::getInstance();
m_installationDirectory = config->getInstallationDirectory();
updateInstallationDirectoryLabel();
// only 64 bits OS can switch between 32 and 64 bits // only 64 bits OS can switch between 32 and 64 bits
use64bitsClientsCheckBox->setEnabled(config->has64bitsOS()); use64bitsClientsCheckBox->setEnabled(config->has64bitsOS());
@ -47,6 +51,11 @@ CSettingsDialog::~CSettingsDialog()
{ {
} }
QString CSettingsDialog::getInstallationDirectory() const
{
return m_installationDirectory;
}
void CSettingsDialog::accept() void CSettingsDialog::accept()
{ {
// TODO: add save code // TODO: add save code
@ -56,11 +65,16 @@ void CSettingsDialog::accept()
void CSettingsDialog::onInstallationDirectoryButtonClicked() void CSettingsDialog::onInstallationDirectoryButtonClicked()
{ {
QString directory = QFileDialog::getExistingDirectory(this, tr("Please choose directory where to install Ryzom")); QString directory = QFileDialog::getExistingDirectory(this, tr("Please choose directory where to install Ryzom"), m_installationDirectory);
if (directory.isEmpty()) return; if (directory.isEmpty()) return;
// m_dstDirectory = directory; m_installationDirectory = directory;
updateInstallationDirectoryLabel();
}
// updateDestinationText(); void CSettingsDialog::updateInstallationDirectoryLabel()
{
installationDirectoryLabel->setText(m_installationDirectory);
} }

@ -33,11 +33,18 @@ public:
CSettingsDialog(QWidget *parent = NULL); CSettingsDialog(QWidget *parent = NULL);
virtual ~CSettingsDialog(); virtual ~CSettingsDialog();
QString getInstallationDirectory() const;
public slots: public slots:
void onInstallationDirectoryButtonClicked(); void onInstallationDirectoryButtonClicked();
private slots: private slots:
void accept(); void accept();
private:
void updateInstallationDirectoryLabel();
QString m_installationDirectory;
}; };
#endif #endif

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>428</width>
<height>150</height> <height>150</height>
</rect> </rect>
</property> </property>
@ -15,25 +15,36 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QFormLayout" name="formLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="3" column="0">
<widget class="QCheckBox" name="use64bitsClientsCheckBox">
<property name="text">
<string>Use 64 bits client</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="installationDirectoryLabelTitle">
<property name="text">
<string>Base location of Ryzom files:</string>
</property>
</widget>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="languageLabel">
<property name="text"> <property name="text">
<string>Language</string> <string>Language</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="2" column="2">
<widget class="QComboBox" name="languageComboBox"/> <widget class="QPushButton" name="oldDirectoryButton">
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Base location of Ryzom files: %1</string> <string>Browse...</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="2">
<widget class="QPushButton" name="installationDirectoryButton"> <widget class="QPushButton" name="installationDirectoryButton">
<property name="text"> <property name="text">
<string>Browse...</string> <string>Browse...</string>
@ -41,26 +52,29 @@
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="oldDirectoryLabelTitle">
<property name="text"> <property name="text">
<string>Location of source Ryzom files: %1</string> <string>Location of source Ryzom files:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="1" column="1">
<widget class="QPushButton" name="pushButton_2"> <widget class="QLabel" name="installationDirectoryLabel">
<property name="text"> <property name="text">
<string>Browse...</string> <string>D:\Ryzom</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="2" column="1">
<widget class="QCheckBox" name="use64bitsClientsCheckBox"> <widget class="QLabel" name="oldDirectoryLabel">
<property name="text"> <property name="text">
<string>Use 64 bits client</string> <string>E:\Ryzom</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2">
<widget class="QComboBox" name="languageComboBox"/>
</item>
</layout> </layout>
</item> </item>
<item> <item>

Loading…
Cancel
Save