summaryrefslogtreecommitdiffstats
path: root/src/dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dialog.cpp')
-rw-r--r--src/dialog.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/dialog.cpp b/src/dialog.cpp
index 9dba767..8766981 100644
--- a/src/dialog.cpp
+++ b/src/dialog.cpp
@@ -20,7 +20,7 @@
#include "vsession.h"
#include "choosersettings.h"
-Dialog::Dialog(int defaultTab, bool allowNative, QWidget *parent)
+Dialog::Dialog(int defaultTab, bool examMode, QWidget *parent)
: QDialog(parent), ui(new Ui::Dialog) {
model_[0] = new SessionTreeModel(parent);
model_[1] = new SessionTreeModel(parent);
@@ -30,6 +30,7 @@ Dialog::Dialog(int defaultTab, bool allowNative, QWidget *parent)
qDebug() << "Default tab: " << defaultTab;
userInteracted_ = false;
genericExpandedOnce_ = false;
+ examMode_ = examMode;
ui->setupUi(this);
@@ -64,12 +65,12 @@ Dialog::Dialog(int defaultTab, bool allowNative, QWidget *parent)
this, SLOT(treeView_selectionChanged(const QModelIndex&, const QModelIndex&)));
*/
- if (allowNative) {
- this->onTabButtonChanged(TAB_NATIVE);
- this->selectPreviousSession();
- } else {
+ if (examMode_) {
ui->tabButtonLocal->setEnabled(false);
this->onTabButtonChanged(TAB_ALL_VMS);
+ } else {
+ this->onTabButtonChanged(TAB_NATIVE);
+ this->selectPreviousSession();
}
//activeTab_ = 2;
//ui->tabButtonAllClasses->setChecked(true);
@@ -180,6 +181,8 @@ void Dialog::addItems(const QList<Session*>& entries, int tab) {
if (tab < 0 || tab > 2) {
return;
}
+ if (examMode_ && tab == TAB_NATIVE)
+ return;
this->model_[tab]->addItems(entries);
tabs_[tab]->setEnabled(this->model_[tab]->rowCount() != 0);
if (tab == activeTab_) {