Skip to content

Commit

Permalink
Properly handles Cancel from engine/rocket browser dialog boxes.
Browse files Browse the repository at this point in the history
  • Loading branch information
duganchen committed Aug 22, 2016
1 parent 0ad7098 commit d5cb3bd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
5 changes: 4 additions & 1 deletion configs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
void RocketLauncher2::on_button_loadConfigExt_clicked()
{
QString settingsDir = QFileDialog::getOpenFileName(this,"Choose where you wish to save the configuration.", QString(),"Rocket Files (*.rocket)");
loadExtConfig(settingsDir);
if (settingsDir != NULL)
{
loadExtConfig(settingsDir);
}
}

void RocketLauncher2::initConfigs()
Expand Down
6 changes: 5 additions & 1 deletion enginesetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ void RocketLauncher2::on_listbox_engines_clicked(const QModelIndex &index)

void RocketLauncher2::on_button_addCustEng_clicked()
{
enginelist->addDefaultEngine(QFileDialog::getOpenFileName(this, "Locate executable."));
QString engine = QFileDialog::getOpenFileName(this, "Locate executable.");
if (engine != NULL)
{
enginelist->addDefaultEngine(engine);
}
}

void RocketLauncher2::on_input_selEngName_returnPressed()
Expand Down
13 changes: 8 additions & 5 deletions rocketlauncher2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,14 @@ void RocketLauncher2::on_pushButton_3_clicked() //RUN

void RocketLauncher2::on_pushButton_2_clicked() //Select Engine
{
QFileInfo file = QFileInfo(QFileDialog::getOpenFileName(this,tr("Locate engine executable")));
QString result = enginelist->addEngine(file);

if (result == "Error")
QMessageBox::information(this,"Error","Something went wrong, no engine added.");
QString engine = QFileDialog::getOpenFileName(this,tr("Locate engine executable"));
if (engine != NULL)
{
QFileInfo file = QFileInfo(engine);
QString result = enginelist->addEngine(file);
if (result == "Error")
QMessageBox::information(this,"Error","Something went wrong, no engine added.");
}
}

void RocketLauncher2::on_combo_Engines_currentIndexChanged(int index)
Expand Down

0 comments on commit d5cb3bd

Please sign in to comment.