summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/command_line_options.cpp4
-rw-r--r--src/dialog.cpp1
-rw-r--r--src/globals.cpp1
-rw-r--r--src/globals.h1
-rw-r--r--src/main.cpp4
5 files changed, 11 insertions, 0 deletions
diff --git a/src/command_line_options.cpp b/src/command_line_options.cpp
index 22c5475..818bc06 100644
--- a/src/command_line_options.cpp
+++ b/src/command_line_options.cpp
@@ -20,6 +20,7 @@ CommandLineOptions::CommandLineOptions(int argc, char * const argv[]) {
{"locations", required_argument, NULL, 'l'},
{"pool", required_argument, NULL, 'P'},
{"pvs", no_argument, NULL, 'p'},
+ {"pvs-checked", no_argument, NULL, 'pvck'},
{"runscript", no_argument, NULL, 'S'},
{"size", required_argument, NULL, 's'},
{"tab", required_argument, NULL, 'T'},
@@ -73,6 +74,9 @@ CommandLineOptions::CommandLineOptions(int argc, char * const argv[]) {
case 'p':
options.insert("pvs", "pvs");
break;
+ case 'pvck':
+ options.insert("pvs-checked", "pvs-checked");
+ break;
case 'P':
options.insert("pool", optarg);
break;
diff --git a/src/dialog.cpp b/src/dialog.cpp
index 2fa629a..a7c86e4 100644
--- a/src/dialog.cpp
+++ b/src/dialog.cpp
@@ -67,6 +67,7 @@ Dialog::Dialog(int defaultTab, bool examMode, QWidget *parent)
*/
ui->PVS_checkbox->setVisible(g_pvsEnabled);
+ ui->PVS_checkbox->setChecked(g_pvsChecked);
if (examMode_) {
ui->tabButtonLocal->setEnabled(false);
diff --git a/src/globals.cpp b/src/globals.cpp
index f3404cc..698589d 100644
--- a/src/globals.cpp
+++ b/src/globals.cpp
@@ -20,6 +20,7 @@ const QString previousSessionFile(userPath + "/vmchooser2.ini");
bool debugMode = false;
bool g_pvsEnabled = false;
+bool g_pvsChecked = false;
int g_autoQuitSeconds = 0;
bool g_allowVmEdit = false;
diff --git a/src/globals.h b/src/globals.h
index 5acd561..d5248dc 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -24,6 +24,7 @@ class Session;
extern bool debugMode;
extern bool g_pvsEnabled;
+extern bool g_pvsChecked;
extern int g_autoQuitSeconds;
extern bool g_allowVmEdit;
diff --git a/src/main.cpp b/src/main.cpp
index aa4eb30..31bd20e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -50,6 +50,7 @@ int main(int argc, char *argv[]) {
" -t, --theme theme\n"
" --template-mode how to treat template entries (IGNORE or BUMP)\n"
" -p, --pvs show pvs options\n"
+ " --pvs-checked check pvs box by default\n"
" -D, --debug print debug information\n"
" -v, --version print version and exit\n"
" -h, --help print usage information and exit\n"
@@ -271,6 +272,9 @@ int main(int argc, char *argv[]) {
if (cmdOptions.contains("pvs")) {
g_pvsEnabled = true;
}
+ if (cmdOptions.contains("pvs-checked")) {
+ g_pvsChecked = true;
+ }
if (cmdOptions.contains("autoquit")) {
bool ok = false;