Changed: Rename all WizardDialog to Dialog (not really a wizard)

This commit is contained in:
kervala 2016-06-12 15:40:38 +02:00
parent 4adf6fe993
commit 83254b26be
15 changed files with 69 additions and 68 deletions

View file

@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdpch.h" #include "stdpch.h"
#include "installwizarddialog.h" #include "installdialog.h"
#include "configfile.h" #include "configfile.h"
#include "utils.h" #include "utils.h"
@ -26,7 +26,7 @@
#define new DEBUG_NEW #define new DEBUG_NEW
#endif #endif
CInstallWizardDialog::CInstallWizardDialog():QDialog() CInstallDialog::CInstallDialog():QDialog()
{ {
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
@ -82,18 +82,18 @@ CInstallWizardDialog::CInstallWizardDialog():QDialog()
connect(advancedCheckBox, SIGNAL(stateChanged(int)), SLOT(onShowAdvancedParameters(int))); connect(advancedCheckBox, SIGNAL(stateChanged(int)), SLOT(onShowAdvancedParameters(int)));
} }
CInstallWizardDialog::~CInstallWizardDialog() CInstallDialog::~CInstallDialog()
{ {
} }
void CInstallWizardDialog::onShowAdvancedParameters(int state) void CInstallDialog::onShowAdvancedParameters(int state)
{ {
advancedFrame->setVisible(state != Qt::Unchecked); advancedFrame->setVisible(state != Qt::Unchecked);
adjustSize(); adjustSize();
} }
void CInstallWizardDialog::onAnotherLocationBrowseButtonClicked() void CInstallDialog::onAnotherLocationBrowseButtonClicked()
{ {
QString directory; QString directory;
@ -116,7 +116,7 @@ void CInstallWizardDialog::onAnotherLocationBrowseButtonClicked()
updateAnotherLocationText(); updateAnotherLocationText();
} }
void CInstallWizardDialog::onDestinationBrowseButtonClicked() void CInstallDialog::onDestinationBrowseButtonClicked()
{ {
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"));
@ -127,17 +127,17 @@ void CInstallWizardDialog::onDestinationBrowseButtonClicked()
updateDestinationText(); updateDestinationText();
} }
void CInstallWizardDialog::updateAnotherLocationText() void CInstallDialog::updateAnotherLocationText()
{ {
anotherLocationRadioButton->setText(tr("Another location: %1").arg(m_anotherDirectory.isEmpty() ? tr("Undefined"):m_anotherDirectory)); anotherLocationRadioButton->setText(tr("Another location: %1").arg(m_anotherDirectory.isEmpty() ? tr("Undefined"):m_anotherDirectory));
} }
void CInstallWizardDialog::updateDestinationText() void CInstallDialog::updateDestinationText()
{ {
destinationLabel->setText(m_dstDirectory); destinationLabel->setText(m_dstDirectory);
} }
void CInstallWizardDialog::accept() void CInstallDialog::accept()
{ {
// check free disk space // check free disk space
qint64 freeSpace = NLMISC::CSystemInfo::availableHDSpace(m_dstDirectory.toUtf8().constData()); qint64 freeSpace = NLMISC::CSystemInfo::availableHDSpace(m_dstDirectory.toUtf8().constData());

View file

@ -14,10 +14,10 @@
// You should have received a copy of the GNU Affero General Public License // 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/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef INSTALLWIZARDDIALOG_H #ifndef INSTALLDIALOG_H
#define INSTALLWIZARDDIALOG_H #define INSTALLDIALOG_H
#include "ui_installwizard.h" #include "ui_installdialog.h"
/** /**
* Wizard displayed at first launch, that asks user to choose source and destination directories. * Wizard displayed at first launch, that asks user to choose source and destination directories.
@ -25,13 +25,13 @@
* \author Cedric 'Kervala' OCHS * \author Cedric 'Kervala' OCHS
* \date 2016 * \date 2016
*/ */
class CInstallWizardDialog : public QDialog, public Ui::InstallWizardDialog class CInstallDialog : public QDialog, public Ui::InstallDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
CInstallWizardDialog(); CInstallDialog();
virtual ~CInstallWizardDialog(); virtual ~CInstallDialog();
private slots: private slots:
void onShowAdvancedParameters(int state); void onShowAdvancedParameters(int state);

View file

@ -17,9 +17,9 @@
#include "stdpch.h" #include "stdpch.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "configfile.h" #include "configfile.h"
#include "migratewizarddialog.h" #include "migratedialog.h"
#include "installwizarddialog.h" #include "installdialog.h"
#include "uninstallwizarddialog.h" #include "uninstalldialog.h"
#include "operationdialog.h" #include "operationdialog.h"
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
@ -120,7 +120,7 @@ int main(int argc, char *argv[])
// show uninstall wizard dialog if not in silent mode // show uninstall wizard dialog if not in silent mode
if (!parser.isSet(silentOption)) if (!parser.isSet(silentOption))
{ {
CUninstallWizardDialog dialog; CUninstallDialog dialog;
dialog.setSelectedComponents(components); dialog.setSelectedComponents(components);
@ -142,7 +142,7 @@ int main(int argc, char *argv[])
if (step == CConfigFile::ShowMigrateWizard) if (step == CConfigFile::ShowMigrateWizard)
{ {
CMigrateWizardDialog dialog; CMigrateDialog dialog;
if (!dialog.exec()) return 1; if (!dialog.exec()) return 1;
@ -150,7 +150,7 @@ int main(int argc, char *argv[])
} }
else if (step == CConfigFile::ShowInstallWizard) else if (step == CConfigFile::ShowInstallWizard)
{ {
CInstallWizardDialog dialog; CInstallDialog dialog;
if (!dialog.exec()) return 1; if (!dialog.exec()) return 1;

View file

@ -18,7 +18,8 @@
#include "mainwindow.h" #include "mainwindow.h"
#include "downloader.h" #include "downloader.h"
#include "profilesdialog.h" #include "profilesdialog.h"
#include "uninstallwizarddialog.h" #include "settingsdialog.h"
#include "uninstalldialog.h"
#include "operationdialog.h" #include "operationdialog.h"
#include "configfile.h" #include "configfile.h"
#include "config.h" #include "config.h"
@ -173,7 +174,7 @@ void CMainWindow::onUninstall()
} }
{ {
CUninstallWizardDialog dialog(this); CUninstallDialog dialog(this);
dialog.setSelectedComponents(components); dialog.setSelectedComponents(components);

View file

@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdpch.h" #include "stdpch.h"
#include "migratewizarddialog.h" #include "migratedialog.h"
#include "configfile.h" #include "configfile.h"
#include "utils.h" #include "utils.h"
@ -26,7 +26,7 @@
#define new DEBUG_NEW #define new DEBUG_NEW
#endif #endif
CMigrateWizardDialog::CMigrateWizardDialog():QDialog() CMigrateDialog::CMigrateDialog():QDialog()
{ {
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
@ -79,18 +79,18 @@ CMigrateWizardDialog::CMigrateWizardDialog():QDialog()
connect(advancedCheckBox, SIGNAL(stateChanged(int)), SLOT(onShowAdvancedParameters(int))); connect(advancedCheckBox, SIGNAL(stateChanged(int)), SLOT(onShowAdvancedParameters(int)));
} }
CMigrateWizardDialog::~CMigrateWizardDialog() CMigrateDialog::~CMigrateDialog()
{ {
} }
void CMigrateWizardDialog::onShowAdvancedParameters(int state) void CMigrateDialog::onShowAdvancedParameters(int state)
{ {
advancedFrame->setVisible(state != Qt::Unchecked); advancedFrame->setVisible(state != Qt::Unchecked);
adjustSize(); adjustSize();
} }
void CMigrateWizardDialog::onDestinationBrowseButtonClicked() void CMigrateDialog::onDestinationBrowseButtonClicked()
{ {
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"));
@ -101,12 +101,12 @@ void CMigrateWizardDialog::onDestinationBrowseButtonClicked()
updateDestinationText(); updateDestinationText();
} }
void CMigrateWizardDialog::updateDestinationText() void CMigrateDialog::updateDestinationText()
{ {
destinationLabel->setText(m_dstDirectory); destinationLabel->setText(m_dstDirectory);
} }
void CMigrateWizardDialog::accept() void CMigrateDialog::accept()
{ {
// check free disk space // check free disk space
qint64 freeSpace = NLMISC::CSystemInfo::availableHDSpace(m_dstDirectory.toUtf8().constData()); qint64 freeSpace = NLMISC::CSystemInfo::availableHDSpace(m_dstDirectory.toUtf8().constData());

View file

@ -14,10 +14,10 @@
// You should have received a copy of the GNU Affero General Public License // 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/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef MIGRATEWIZARDDIALOG_H #ifndef MIGRATEDIALOG_H
#define MIGRATEWIZARDDIALOG_H #define MIGRATEDIALOG_H
#include "ui_migratewizard.h" #include "ui_migratedialog.h"
/** /**
* Wizard displayed at first launch, that asks user to choose source and destination directories. * Wizard displayed at first launch, that asks user to choose source and destination directories.
@ -25,13 +25,13 @@
* \author Cedric 'Kervala' OCHS * \author Cedric 'Kervala' OCHS
* \date 2016 * \date 2016
*/ */
class CMigrateWizardDialog : public QDialog, public Ui::MigrateWizardDialog class CMigrateDialog : public QDialog, public Ui::MigrateDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
CMigrateWizardDialog(); CMigrateDialog();
virtual ~CMigrateWizardDialog(); virtual ~CMigrateDialog();
private slots: private slots:
void onShowAdvancedParameters(int state); void onShowAdvancedParameters(int state);

View file

@ -17,7 +17,7 @@
#ifndef PROFILESDIALOG_H #ifndef PROFILESDIALOG_H
#define PROFILESDIALOG_H #define PROFILESDIALOG_H
#include "ui_profiles.h" #include "ui_profilesdialog.h"
class CProfilesModel; class CProfilesModel;
class CServersModel; class CServersModel;

View file

@ -17,7 +17,7 @@
#ifndef SETTINGSDIALOG_H #ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H #define SETTINGSDIALOG_H
#include "ui_settings.h" #include "ui_settingsdialog.h"
/** /**
* Settings dialog * Settings dialog

View file

@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdpch.h" #include "stdpch.h"
#include "uninstallwizarddialog.h" #include "uninstalldialog.h"
#include "configfile.h" #include "configfile.h"
#include "utils.h" #include "utils.h"
@ -26,7 +26,7 @@
#define new DEBUG_NEW #define new DEBUG_NEW
#endif #endif
CUninstallWizardDialog::CUninstallWizardDialog(QWidget *parent):QDialog(parent), m_installerIndex(-1) CUninstallDialog::CUninstallDialog(QWidget *parent):QDialog(parent), m_installerIndex(-1)
{ {
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
@ -102,19 +102,19 @@ CUninstallWizardDialog::CUninstallWizardDialog(QWidget *parent):QDialog(parent),
connect(this, SIGNAL(updateLayout()), SLOT(onUpdateLayout())); connect(this, SIGNAL(updateLayout()), SLOT(onUpdateLayout()));
} }
CUninstallWizardDialog::~CUninstallWizardDialog() CUninstallDialog::~CUninstallDialog()
{ {
} }
void CUninstallWizardDialog::showEvent(QShowEvent *event) void CUninstallDialog::showEvent(QShowEvent *event)
{ {
QDialog::showEvent(event); QDialog::showEvent(event);
// update size of all components sizes in a thread to not block interface // update size of all components sizes in a thread to not block interface
QtConcurrent::run(this, &CUninstallWizardDialog::updateSizes); QtConcurrent::run(this, &CUninstallDialog::updateSizes);
} }
void CUninstallWizardDialog::setSelectedComponents(const SUninstallComponents &components) void CUninstallDialog::setSelectedComponents(const SUninstallComponents &components)
{ {
QStandardItemModel *model = qobject_cast<QStandardItemModel*>(componentsTreeView->model()); QStandardItemModel *model = qobject_cast<QStandardItemModel*>(componentsTreeView->model());
if (model == NULL) return; if (model == NULL) return;
@ -150,7 +150,7 @@ void CUninstallWizardDialog::setSelectedComponents(const SUninstallComponents &c
if (item) item->setCheckState(components.installer ? Qt::Checked : Qt::Unchecked); if (item) item->setCheckState(components.installer ? Qt::Checked : Qt::Unchecked);
} }
SUninstallComponents CUninstallWizardDialog::getSelectedCompenents() const SUninstallComponents CUninstallDialog::getSelectedCompenents() const
{ {
SUninstallComponents res; SUninstallComponents res;
@ -190,17 +190,17 @@ SUninstallComponents CUninstallWizardDialog::getSelectedCompenents() const
return res; return res;
} }
void CUninstallWizardDialog::accept() void CUninstallDialog::accept()
{ {
QDialog::accept(); QDialog::accept();
} }
void CUninstallWizardDialog::onItemChanged(QStandardItem * /* item */) void CUninstallDialog::onItemChanged(QStandardItem * /* item */)
{ {
updateButtons(); updateButtons();
} }
void CUninstallWizardDialog::onUpdateSize(int row, const QString &text) void CUninstallDialog::onUpdateSize(int row, const QString &text)
{ {
QStandardItemModel *model = qobject_cast<QStandardItemModel*>(componentsTreeView->model()); QStandardItemModel *model = qobject_cast<QStandardItemModel*>(componentsTreeView->model());
if (model == NULL) return; if (model == NULL) return;
@ -210,14 +210,14 @@ void CUninstallWizardDialog::onUpdateSize(int row, const QString &text)
model->setItem(row, 1, item); model->setItem(row, 1, item);
} }
void CUninstallWizardDialog::onUpdateLayout() void CUninstallDialog::onUpdateLayout()
{ {
componentsTreeView->resizeColumnToContents(1); componentsTreeView->resizeColumnToContents(1);
updateButtons(); updateButtons();
} }
void CUninstallWizardDialog::updateSizes() void CUninstallDialog::updateSizes()
{ {
CConfigFile *config = CConfigFile::getInstance(); CConfigFile *config = CConfigFile::getInstance();
@ -252,7 +252,7 @@ void CUninstallWizardDialog::updateSizes()
emit updateLayout(); emit updateLayout();
} }
void CUninstallWizardDialog::updateButtons() void CUninstallDialog::updateButtons()
{ {
QStandardItemModel *model = qobject_cast<QStandardItemModel*>(componentsTreeView->model()); QStandardItemModel *model = qobject_cast<QStandardItemModel*>(componentsTreeView->model());
if (model == NULL) return; if (model == NULL) return;

View file

@ -14,10 +14,10 @@
// You should have received a copy of the GNU Affero General Public License // 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/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef UNINSTALLWIZARDDIALOG_H #ifndef UNINSTALLDIALOG_H
#define UNINSTALLWIZARDDIALOG_H #define UNINSTALLDIALOG_H
#include "ui_uninstallwizard.h" #include "ui_uninstalldialog.h"
#include "operation.h" #include "operation.h"
/** /**
@ -27,13 +27,13 @@
* \author Cedric 'Kervala' OCHS * \author Cedric 'Kervala' OCHS
* \date 2016 * \date 2016
*/ */
class CUninstallWizardDialog : public QDialog, public Ui::UninstallWizardDialog class CUninstallDialog : public QDialog, public Ui::UninstallDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
CUninstallWizardDialog(QWidget *parent = NULL); CUninstallDialog(QWidget *parent = NULL);
virtual ~CUninstallWizardDialog(); virtual ~CUninstallDialog();
void setSelectedComponents(const SUninstallComponents &components); void setSelectedComponents(const SUninstallComponents &components);
SUninstallComponents getSelectedCompenents() const; SUninstallComponents getSelectedCompenents() const;

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>InstallWizardDialog</class> <class>InstallDialog</class>
<widget class="QDialog" name="InstallWizardDialog"> <widget class="QDialog" name="InstallDialog">
<property name="windowModality"> <property name="windowModality">
<enum>Qt::ApplicationModal</enum> <enum>Qt::ApplicationModal</enum>
</property> </property>
@ -219,7 +219,7 @@ Just follow the different steps and make your choice between the different propo
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>accepted()</signal> <signal>accepted()</signal>
<receiver>InstallWizardDialog</receiver> <receiver>InstallDialog</receiver>
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
@ -235,7 +235,7 @@ Just follow the different steps and make your choice between the different propo
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>rejected()</signal> <signal>rejected()</signal>
<receiver>InstallWizardDialog</receiver> <receiver>InstallDialog</receiver>
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>MigrateWizardDialog</class> <class>MigrateDialog</class>
<widget class="QDialog" name="MigrateWizardDialog"> <widget class="QDialog" name="MigrateDialog">
<property name="windowModality"> <property name="windowModality">
<enum>Qt::ApplicationModal</enum> <enum>Qt::ApplicationModal</enum>
</property> </property>

View file

@ -24,7 +24,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QComboBox" name="comboBox"/> <widget class="QComboBox" name="languageComboBox"/>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
@ -34,7 +34,7 @@
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QPushButton" name="pushButton"> <widget class="QPushButton" name="installationDirectoryButton">
<property name="text"> <property name="text">
<string>Browse...</string> <string>Browse...</string>
</property> </property>
@ -55,7 +55,7 @@
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
<widget class="QCheckBox" name="checkBox"> <widget class="QCheckBox" name="use64bitsClientsCheckBox">
<property name="text"> <property name="text">
<string>Use 64 bits client</string> <string>Use 64 bits client</string>
</property> </property>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>UninstallWizardDialog</class> <class>UninstallDialog</class>
<widget class="QDialog" name="UninstallWizardDialog"> <widget class="QDialog" name="UninstallDialog">
<property name="windowModality"> <property name="windowModality">
<enum>Qt::ApplicationModal</enum> <enum>Qt::ApplicationModal</enum>
</property> </property>