summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorSimon Rettberg2017-01-19 12:22:44 +0100
committerSimon Rettberg2017-01-19 12:22:44 +0100
commit2f567778f71a1c6dcfdaa7831d7642e4c45c5c7b (patch)
tree2799810ae313be9cee6e2e7fe55de9cf05a934f0 /src/main.cpp
parentUpdate translations (diff)
downloadvmchooser2-2f567778f71a1c6dcfdaa7831d7642e4c45c5c7b.tar.gz
vmchooser2-2f567778f71a1c6dcfdaa7831d7642e4c45c5c7b.tar.xz
vmchooser2-2f567778f71a1c6dcfdaa7831d7642e4c45c5c7b.zip
Add "admin mode" (edit vm)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp69
1 files changed, 37 insertions, 32 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 74cee75..2f1dfab 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -34,27 +34,29 @@ int main(int argc, char *argv[]) {
std::string usage(
a.translate("Console", "Usage: vmchooser [ OPTIONS ]\n\n"
- " -b --base base directory where VM images are accessible\n"
- " -d, --default name of default session\n"
- " -c, --config alternative config file\n"
- " -l, --locations location id(s), space separated\n"
- " --location-mode how to treat entries for this location (IGNORE, BUMP or EXCLUSIVE)\n"
- " --exam-mode enable exam mode\n"
- " -P, --pool one or more pool names to display (comma separated)\n"
- " -f, --file direct boot .desktop file\n"
- " -x, --xpath path of X Session .desktop files\n"
- " -u, --url url of vmware .xml file\n"
- " -s, --size window size <width>x<height>\n"
- " -t, --theme theme\n"
- " --template-mode how to treat template entries (IGNORE or BUMP)\n"
- " -p, --pvs show pvs options\n"
- " -D, --debug print debug information\n"
- " -v, --version print version and exit\n"
- " -h, --help print usage information and exit\n"
- " -S, --runscript change path to run-virt.sh\n"
- " -T --tab default tab (0=xsession, 1=my vms, 2=all vms)\n"
- " --no-vtx Host doesn't support VT-x/AMD-V (mark 64bit guests)\n"
- " --start-uuid start lecture with the given uuid\n"
+ " --allow-vm-edit show the 'edit this vm' checkbox\n"
+ " --autoquit [secs] automatically exit if no selection is made after secs seconds\n"
+ " -b --base base directory where VM images are accessible\n"
+ " -d, --default name of default session\n"
+ " -c, --config alternative config file\n"
+ " -l, --locations location id(s), space separated\n"
+ " --location-mode how to treat entries for this location (IGNORE, BUMP or EXCLUSIVE)\n"
+ " --exam-mode enable exam mode\n"
+ " -P, --pool one or more pool names to display (comma separated)\n"
+ " -f, --file direct boot .desktop file\n"
+ " -x, --xpath path of X Session .desktop files\n"
+ " -u, --url url of vmware .xml file\n"
+ " -s, --size window size <width>x<height>\n"
+ " -t, --theme theme\n"
+ " --template-mode how to treat template entries (IGNORE or BUMP)\n"
+ " -p, --pvs show pvs options\n"
+ " -D, --debug print debug information\n"
+ " -v, --version print version and exit\n"
+ " -h, --help print usage information and exit\n"
+ " -S, --runscript change path to run-virt.sh\n"
+ " -T --tab default tab (0=xsession, 1=my vms, 2=all vms)\n"
+ " --no-vtx Host doesn't support VT-x/AMD-V (mark 64bit guests)\n"
+ " --start-uuid start lecture with the given uuid\n"
"\nFILE can be a vmware .xml or an X .desktop file\n").toUtf8().data());
if (cmdOptions.contains("error")) {
@@ -266,6 +268,20 @@ int main(int argc, char *argv[]) {
g_noVtx = true;
}
+ if (cmdOptions.contains("pvs")) {
+ pvsEnabled = true;
+ }
+
+ if (cmdOptions.contains("autoquit")) {
+ bool ok = false;
+ g_autoQuitSeconds = cmdOptions.value("autoquit").toInt(&ok, 10);
+ if (!ok) {
+ g_autoQuitSeconds = 0;
+ }
+ }
+
+ g_allowVmEdit = cmdOptions.contains("allow-vm-edit");
+
/* read session files */
QList<Session*> xsessions(XSession::readSessions(xSessionPath));
@@ -296,17 +312,6 @@ int main(int argc, char *argv[]) {
w.setTheme();
w.setWindowFlags(Qt::FramelessWindowHint);
- if (cmdOptions.contains("pvs")) {
- pvsEnabled = true;
- }
-
- if (cmdOptions.contains("autoquit")) {
- bool ok = false;
- g_autoQuitSeconds = cmdOptions.value("autoquit").toInt(&ok, 10);
- if (!ok) {
- g_autoQuitSeconds = 0;
- }
- }
QRect desktopRect = QApplication::desktop()->availableGeometry(&w);
if (size == "fullscreen") {