diff options
Diffstat (limited to 'src/dialog.cpp')
-rw-r--r-- | src/dialog.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dialog.cpp b/src/dialog.cpp index a0b9a47..d87753a 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -133,6 +133,10 @@ void Dialog::on_treeView_doubleClicked(const QModelIndex& index) if (s == nullptr) // no valid session has been selected, do nothing return; + // Check preconditions. The method might show error messages and return false + if (!s->canRun(true)) + return; + // These two are up here in case run-virt cares... if (Config::isSet(Config::PVS)) { if (ui->PVS_checkbox->isChecked()) { @@ -203,7 +207,7 @@ void Dialog::on_treeView_doubleClicked(const QModelIndex& index) centerTimer_->stop(); // Stop the auto-center/auto-quit timer, so we don't kill the session :> setVisible(false); } else { - QMessageBox::warning( + QMessageBox::critical( this, trUtf8("vmchooser"), trUtf8("Vmchooser failed to run the selected session!")); } @@ -232,6 +236,8 @@ void Dialog::addItems(const QList<Session*>& entries, int tab) { || prev.contains(it->shortDescription())) { matches.append(it); } + // Also check for validity + it->checkCanRun(); } if (!matches.isEmpty()) { addItems(matches, TAB_RECENT_COURSES); |