Changed: Configure button action

This commit is contained in:
kervala 2016-05-18 09:53:36 +02:00
parent 3e7011ca14
commit 3cb8242055

View file

@ -98,6 +98,25 @@ void CMainWindow::onPlayClicked()
void CMainWindow::onConfigureClicked() void CMainWindow::onConfigureClicked()
{ {
int profileIndex = profilesComboBox->currentIndex();
if (profileIndex < 0) return;
CProfile profile = CConfigFile::getInstance()->getProfile(profileIndex);
if (profile.server.isEmpty()) return;
CServer server = CConfigFile::getInstance()->getServer(profile.server);
if (server.configurationFilename.isEmpty()) return;
QStringList arguments;
arguments << "-p";
arguments << QString::number(profileIndex);
bool started = QProcess::startDetached(server.configurationFilename, arguments);
CConfigFile::getInstance()->setDefaultProfileIndex(profileIndex);
} }
void CMainWindow::onProfiles() void CMainWindow::onProfiles()