summaryrefslogtreecommitdiffstats
path: root/src/dialog.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/dialog.cpp
parentUpdate translations (diff)
downloadvmchooser2-2f567778f71a1c6dcfdaa7831d7642e4c45c5c7b.tar.gz
vmchooser2-2f567778f71a1c6dcfdaa7831d7642e4c45c5c7b.tar.xz
vmchooser2-2f567778f71a1c6dcfdaa7831d7642e4c45c5c7b.zip
Add "admin mode" (edit vm)
Diffstat (limited to 'src/dialog.cpp')
-rw-r--r--src/dialog.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/dialog.cpp b/src/dialog.cpp
index 105d476..6d245bb 100644
--- a/src/dialog.cpp
+++ b/src/dialog.cpp
@@ -81,6 +81,7 @@ Dialog::Dialog(int defaultTab, bool examMode, QWidget *parent)
//activeTab_ = 2;
//ui->tabButtonAllClasses->setChecked(true);
+ ui->chkAdminMode->setVisible(g_allowVmEdit);
// TODO: Implement bug report dialog :)
ui->buttonBugReport->setEnabled(false);
@@ -119,15 +120,24 @@ void Dialog::on_treeView_doubleClicked(const QModelIndex& index)
if (s == NULL) // no valid session has been selected, do nothing
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_allowVmEdit && ui->chkAdminMode->isChecked()) {
+ setenv("VMCHOOSER_ADMIN_MODE", "TRUE", 1);
+ } else {
+ setenv("VMCHOOSER_ADMIN_MODE", "FALSE", 1);
+ }
+
+ // Run session
if (s->run()) {
- // Run session start script
+ // Run session start script if the session could be initialized successfully
if (QFile::exists(sessionStartScript)) {
// Use the current environment variables and add the necessary
// information for the startUpScipt.
- if (ui->PVS_checkbox->isChecked())
- setenv("PVS_AUTO_CONNECT", "TRUE", 1);
- else
- setenv("PVS_AUTO_CONNECT", "FALSE", 1);
// export session information to the environment of the process to be exec'ed
setenv("SESSION_NAME", s->shortDescription().toUtf8(), 1);
setenv("SESSION_UUID", s->uuid().toUtf8(), 1);