Skip to content

Commit

Permalink
Merge branch 'guiOutputPathFix'
Browse files Browse the repository at this point in the history
  • Loading branch information
nwagenbrenner committed Dec 13, 2024
2 parents d4a6d88 + bc78344 commit 51119b7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
15 changes: 13 additions & 2 deletions src/gui/mainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2324,8 +2324,19 @@ int mainWindow::solve()

std::string outputDir = tree->solve->outputDirectory().toStdString();
if( outputDir == "" ) {
// This should never happen, so if it does, fix it.
throw( "no output directory specified in solve page" );
// This should never happen, so if it does, fix it.
progressDialog->cancel();
progressDialog->hide();
QMessageBox::critical(
this, tr("Failure."),
tr("no output directory specified in solve page"),
QMessageBox::Ok | QMessageBox::Default);
disconnect(progressDialog, SIGNAL(canceled()), this,
SLOT(cancelSolve()));
setCursor(Qt::ArrowCursor);
tree->weather->checkForModelData();
delete army;
return false;
}

//fill in the values
Expand Down
7 changes: 5 additions & 2 deletions src/gui/solvePage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,12 @@ void solvePage::setOutputDir(QString dir) {
}

void solvePage::chooseOutputDir() {
QString start = QFileInfo( outputDirLineEdit->text() ).absolutePath();
QString dir = QFileDialog::getExistingDirectory( this,
tr("Open Output Directory"), start, QFileDialog::ShowDirsOnly );
tr("Open Output Directory"), outputDirLineEdit->text(), QFileDialog::ShowDirsOnly );
if( dir == "" )
{
dir = outputDirLineEdit->text();
}
outputDirLineEdit->setText( dir );
}

Expand Down

0 comments on commit 51119b7

Please sign in to comment.