From 2f567778f71a1c6dcfdaa7831d7642e4c45c5c7b Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 19 Jan 2017 12:22:44 +0100 Subject: Add "admin mode" (edit vm) --- src/dialog.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/dialog.cpp') 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); -- cgit v1.2.3-55-g7522