From cee43e05df3e66970f9f056e387c133bfbb9c54a Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 14 May 2016 18:51:33 +0200 Subject: [PATCH] Changed: Play button --- .../client/ryzom_installer/src/mainwindow.cpp | 29 +++++++++++++++++++ .../client/ryzom_installer/src/mainwindow.h | 3 ++ 2 files changed, 32 insertions(+) diff --git a/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp b/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp index b1e7952be..452d78237 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp @@ -22,6 +22,7 @@ #include "profilesdialog.h" #include "configfile.h" #include "config.h" +#include "profilesmodel.h" #include "seven_zip.h" @@ -70,6 +71,9 @@ CMainWindow::CMainWindow():QMainWindow(), m_archive(NULL), m_statusLabel(NULL) connect(actionProfiles, SIGNAL(triggered()), SLOT(onProfiles())); + connect(playButton, SIGNAL(clicked()), SLOT(onPlayClicked())); + connect(configureButton, SIGNAL(clicked()), SLOT(onConfigureClicked())); + connect(actionAboutQt, SIGNAL(triggered()), SLOT(onAboutQt())); connect(actionAbout, SIGNAL(triggered()), SLOT(onAbout())); @@ -170,6 +174,8 @@ void CMainWindow::displayConfigurationsChoices() { downloadFrame->setVisible(false); configurationFrame->setVisible(true); + + profilesComboBox->setModel(new CProfilesModel(this)); } void CMainWindow::showEvent(QShowEvent *e) @@ -214,6 +220,28 @@ void CMainWindow::onStopClicked() } } +void CMainWindow::onPlayClicked() +{ + int profileIndex = profilesComboBox->currentIndex(); + + if (profileIndex < 0) return; + + CProfile profile = CConfigFile::getInstance()->getProfile(profileIndex); + + if (profile.executable.isEmpty()) return; + + QStringList arguments; + arguments << "-p"; + arguments << QString::number(profileIndex); + arguments << profile.arguments; + + bool started = QProcess::startDetached(profile.executable, arguments); +} + +void CMainWindow::onConfigureClicked() +{ +} + void CMainWindow::onProfiles() { CProfilesDialog dialog; @@ -391,6 +419,7 @@ void CMainWindow::onExtractSuccess(qint64 total) resumeButton->setVisible(false); stopButton->setVisible(false); +} processNextStep(); } diff --git a/code/ryzom/tools/client/ryzom_installer/src/mainwindow.h b/code/ryzom/tools/client/ryzom_installer/src/mainwindow.h index 7e03f9a80..707d7efcf 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/mainwindow.h +++ b/code/ryzom/tools/client/ryzom_installer/src/mainwindow.h @@ -41,6 +41,9 @@ public slots: void onResumeClicked(); void onStopClicked(); + void onPlayClicked(); + void onConfigureClicked(); + void onProfiles(); void onAbout(); void onAboutQt();