From e5ba01fd417d90c174b80552fa009363348a753f Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 18 Jun 2016 19:49:26 +0200 Subject: [PATCH] Changed: Display client version on the same line as filename and add a Default button to use default client --- .../ryzom_installer/src/profilesdialog.cpp | 14 ++++++- .../ryzom_installer/src/profilesdialog.h | 1 + .../ryzom_installer/ui/profilesdialog.ui | 39 ++++++++----------- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp index 85c176219..cbfcacaf8 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp @@ -31,6 +31,7 @@ CProfilesDialog::CProfilesDialog(QWidget *parent):QDialog(parent), m_currentProf connect(addButton, SIGNAL(clicked()), SLOT(onAddProfile())); connect(deleteButton, SIGNAL(clicked()), SLOT(onDeleteProfile())); connect(profilesListView, SIGNAL(clicked(QModelIndex)), SLOT(onProfileClicked(QModelIndex))); + connect(executableDefaultButton, SIGNAL(clicked()), SLOT(onExecutableDefaultClicked())); connect(executableBrowseButton, SIGNAL(clicked()), SLOT(onExecutableBrowseClicked())); connect(directoryButton, SIGNAL(clicked()), SLOT(onProfileDirectoryClicked())); @@ -241,10 +242,21 @@ void CProfilesDialog::updateExecutableVersion(int index) if (reg.indexIn(versionString) > -1) { - executableVersionLabel->setText(reg.cap(2)); + executablePathLabel->setText(QString("%1 (%2)").arg(QFileInfo(executable).fileName()).arg(reg.cap(2))); } } +void CProfilesDialog::onExecutableDefaultClicked() +{ + if (m_currentProfileIndex < 0) return; + + CProfile &profile = m_model->getProfiles()[m_currentProfileIndex]; + + profile.executable.clear(); + + updateExecutableVersion(m_currentProfileIndex); +} + void CProfilesDialog::onExecutableBrowseClicked() { if (m_currentProfileIndex < 0) return; diff --git a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.h b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.h index 268525fd6..9f364f4ae 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.h +++ b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.h @@ -51,6 +51,7 @@ private slots: void updateExecutableVersion(int index); + void onExecutableDefaultClicked(); void onExecutableBrowseClicked(); private: diff --git a/code/ryzom/tools/client/ryzom_installer/ui/profilesdialog.ui b/code/ryzom/tools/client/ryzom_installer/ui/profilesdialog.ui index c0c12bab2..670845482 100644 --- a/code/ryzom/tools/client/ryzom_installer/ui/profilesdialog.ui +++ b/code/ryzom/tools/client/ryzom_installer/ui/profilesdialog.ui @@ -7,7 +7,7 @@ 0 0 583 - 348 + 329 @@ -119,7 +119,7 @@ - + @@ -127,6 +127,13 @@ + + + + Default + + + @@ -137,37 +144,23 @@ - - - Client version: - - - - - - - FV 3.0.0 - - - - Arguments: - + - + Comments: - + @@ -177,14 +170,14 @@ - + Directory: - + @@ -202,14 +195,14 @@ - + Create shortcuts: - +