summaryrefslogtreecommitdiffstats
path: root/src/dialog.cpp
diff options
context:
space:
mode:
authorSimon Rettberg2019-07-09 11:33:27 +0200
committerSimon Rettberg2019-07-09 11:33:27 +0200
commit947133905679e19196663bd9923fd063ae4d5b85 (patch)
tree4edc66c64853ce58fbab49e85c547e4e0dea5070 /src/dialog.cpp
parentvsession.*: Use QStringLiteral for most C-Strings (diff)
downloadvmchooser2-947133905679e19196663bd9923fd063ae4d5b85.tar.gz
vmchooser2-947133905679e19196663bd9923fd063ae4d5b85.tar.xz
vmchooser2-947133905679e19196663bd9923fd063ae4d5b85.zip
Gray out and warn about VMs with missing hypervisor
Diffstat (limited to 'src/dialog.cpp')
-rw-r--r--src/dialog.cpp8
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);