Changed: Play button

This commit is contained in:
kervala 2016-05-14 18:51:33 +02:00
parent 1743cb1759
commit 6370c08da5
2 changed files with 32 additions and 0 deletions

View file

@ -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();
}

View file

@ -41,6 +41,9 @@ public slots:
void onResumeClicked();
void onStopClicked();
void onPlayClicked();
void onConfigureClicked();
void onProfiles();
void onAbout();
void onAboutQt();