From f870d03613feb45905e58a857b74ef37a214c489 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 30 Mar 2017 13:35:29 +0200 Subject: Implement --pvs option --- src/dialog.cpp | 12 ++++++++---- src/globals.cpp | 2 +- src/globals.h | 2 +- src/main.cpp | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/dialog.cpp b/src/dialog.cpp index 6d245bb..8c316b5 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -66,6 +66,8 @@ Dialog::Dialog(int defaultTab, bool examMode, QWidget *parent) this, SLOT(treeView_selectionChanged(const QModelIndex&, const QModelIndex&))); */ + ui->PVS_checkbox->setVisible(g_pvsEnabled); + if (examMode_) { ui->tabButtonLocal->setEnabled(false); this->onTabButtonChanged(TAB_ALL_VMS); @@ -121,10 +123,12 @@ void Dialog::on_treeView_doubleClicked(const QModelIndex& index) return; // These two are up here in case run-virt cares... - if (ui->PVS_checkbox->isChecked()) { - setenv("PVS_AUTO_CONNECT", "TRUE", 1); - } else { - setenv("PVS_AUTO_CONNECT", "FALSE", 1); + if (g_pvsEnabled) { + if (ui->PVS_checkbox->isChecked()) { + setenv("PVS_AUTO_CONNECT", "TRUE", 1); + } else { + setenv("PVS_AUTO_CONNECT", "FALSE", 1); + } } if (g_allowVmEdit && ui->chkAdminMode->isChecked()) { setenv("VMCHOOSER_ADMIN_MODE", "TRUE", 1); diff --git a/src/globals.cpp b/src/globals.cpp index 1531e67..f3404cc 100644 --- a/src/globals.cpp +++ b/src/globals.cpp @@ -19,7 +19,7 @@ const QString userConfFile(userPath + "/vmchooser.conf"); const QString previousSessionFile(userPath + "/vmchooser2.ini"); bool debugMode = false; -bool pvsEnabled = false; +bool g_pvsEnabled = false; int g_autoQuitSeconds = 0; bool g_allowVmEdit = false; diff --git a/src/globals.h b/src/globals.h index 8b592ac..5acd561 100644 --- a/src/globals.h +++ b/src/globals.h @@ -23,7 +23,7 @@ class QString; class Session; extern bool debugMode; -extern bool pvsEnabled; +extern bool g_pvsEnabled; extern int g_autoQuitSeconds; extern bool g_allowVmEdit; diff --git a/src/main.cpp b/src/main.cpp index 971e9c7..aa4eb30 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -269,7 +269,7 @@ int main(int argc, char *argv[]) { } if (cmdOptions.contains("pvs")) { - pvsEnabled = true; + g_pvsEnabled = true; } if (cmdOptions.contains("autoquit")) { -- cgit v1.2.3-55-g7522