summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Rettberg2017-03-30 13:35:29 +0200
committerSimon Rettberg2017-03-30 13:35:29 +0200
commitf870d03613feb45905e58a857b74ef37a214c489 (patch)
treeb42bedb7fd677fba57a173cca2c1fd45fe866082 /src
parentRemove stupid crap (diff)
downloadvmchooser2-f870d03613feb45905e58a857b74ef37a214c489.tar.gz
vmchooser2-f870d03613feb45905e58a857b74ef37a214c489.tar.xz
vmchooser2-f870d03613feb45905e58a857b74ef37a214c489.zip
Implement --pvs option
Diffstat (limited to 'src')
-rw-r--r--src/dialog.cpp12
-rw-r--r--src/globals.cpp2
-rw-r--r--src/globals.h2
-rw-r--r--src/main.cpp2
4 files changed, 11 insertions, 7 deletions
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")) {