From 89331d303117288edf07f628a9c5c454be4bfdb4 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Wed, 24 Nov 2021 00:41:37 +0100 Subject: Add a parameter allowing the edit checkbox to be checked by default --- src/config.cpp | 1 + src/config.h | 1 + src/dialog.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/src/config.cpp b/src/config.cpp index 0d4a72d..56775ec 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -42,6 +42,7 @@ struct ConfigOption const ConfigOption* const Config::ALLOW_SCREENSAVER_DISABLE = new ConfigOption("", "allow-screensaver-disable", "allow-screensaver-disable", "", "", "Show checkbox to disable the screen saver for this session"); const ConfigOption* const Config::ALLOW_VM_EDIT = new ConfigOption("", "allow-vm-edit", "allow-vm-edit", "", "", "Show edit checkbox for VMs/lectures where meta data allows editing"); +const ConfigOption* const Config::ALLOW_VM_EDIT_CHECKED = new ConfigOption("", "allow-vm-edit-checked", "allow-vm-edit-checked", "", "", "Edit checkbox is selected by default"); const ConfigOption* const Config::AUTOQUIT = new ConfigOption("", "autoquit", "autoquit", "seconds", "120", "Time after which vmchooser will quit if no user interaction is detected"); const ConfigOption* const Config::BASEDIR = new ConfigOption("b", "base", "base", "path", "/mnt/vmstore", "Base directory where vm meta data is relative to"); const ConfigOption* const Config::CONFIG = new ConfigOption("c", "config", "", "path", CONFIG_FILE_GLOBAL, "Path to global config file"); diff --git a/src/config.h b/src/config.h index 011e82a..3536549 100644 --- a/src/config.h +++ b/src/config.h @@ -10,6 +10,7 @@ class Config public: static const ConfigOption* const ALLOW_SCREENSAVER_DISABLE; static const ConfigOption* const ALLOW_VM_EDIT; + static const ConfigOption* const ALLOW_VM_EDIT_CHECKED; static const ConfigOption* const AUTOQUIT; static const ConfigOption* const BASEDIR; static const ConfigOption* const CONFIG; diff --git a/src/dialog.cpp b/src/dialog.cpp index 94b271c..a402e03 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -96,6 +96,7 @@ Dialog::Dialog(QWidget *parent) } ui->chkAdminMode->setVisible(Config::isSet(Config::ALLOW_VM_EDIT)); + ui->chkAdminMode->setChecked(Config::isSet(Config::ALLOW_VM_EDIT_CHECKED)); ui->chkAdminMode->setEnabled(false); ui->btnScreenSetup->setVisible(isProcessRunning("beamergui")); -- cgit v1.2.3-55-g7522