summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/dialog.cpp11
-rw-r--r--src/dialog.h2
-rw-r--r--src/main.cpp2
3 files changed, 10 insertions, 5 deletions
diff --git a/src/dialog.cpp b/src/dialog.cpp
index 5fa990c..9dba767 100644
--- a/src/dialog.cpp
+++ b/src/dialog.cpp
@@ -20,7 +20,7 @@
#include "vsession.h"
#include "choosersettings.h"
-Dialog::Dialog(int defaultTab, QWidget *parent)
+Dialog::Dialog(int defaultTab, bool allowNative, QWidget *parent)
: QDialog(parent), ui(new Ui::Dialog) {
model_[0] = new SessionTreeModel(parent);
model_[1] = new SessionTreeModel(parent);
@@ -64,8 +64,13 @@ Dialog::Dialog(int defaultTab, QWidget *parent)
this, SLOT(treeView_selectionChanged(const QModelIndex&, const QModelIndex&)));
*/
- this->onTabButtonChanged(0);
- this->selectPreviousSession();
+ if (allowNative) {
+ this->onTabButtonChanged(TAB_NATIVE);
+ this->selectPreviousSession();
+ } else {
+ ui->tabButtonLocal->setEnabled(false);
+ this->onTabButtonChanged(TAB_ALL_VMS);
+ }
//activeTab_ = 2;
//ui->tabButtonAllClasses->setChecked(true);
diff --git a/src/dialog.h b/src/dialog.h
index 552020d..342a988 100644
--- a/src/dialog.h
+++ b/src/dialog.h
@@ -30,7 +30,7 @@ class Dialog : public QDialog {
static const int TAB_ALL_VMS = 2;
static const int TAB_COUNT = 3;
public: // Public methods
- explicit Dialog(int defaultTab = -1, QWidget *parent = 0);
+ explicit Dialog(int defaultTab = -1, bool allowNative = true, QWidget *parent = 0);
~Dialog();
void addItems(const QList<Session*>&, int tab);
void addStatusString(const int status);
diff --git a/src/main.cpp b/src/main.cpp
index 3cf589f..e451e1a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -257,7 +257,7 @@ int main(int argc, char *argv[]) {
/* read session files */
QList<Session*> xsessions(XSession::readSessions(xSessionPath));
- Dialog w(defaultTab);
+ Dialog w(defaultTab, !cmdOptions.contains("exam-mode"));
/* DOWNLOAD VSESSIONS */
HttpXmlDownloader httpxmldownloader;