summaryrefslogtreecommitdiffstats
path: root/src/dialog.cpp
diff options
context:
space:
mode:
authorSimon Rettberg2016-01-07 17:56:44 +0100
committerSimon Rettberg2016-01-07 17:56:44 +0100
commitfcbf51697529688fd6233afc2f518f1723537ff7 (patch)
treecf45c7f5f19a0500601964c391275dbcd64aac05 /src/dialog.cpp
parentMove user config dir to .config/openslx (diff)
downloadvmchooser2-fcbf51697529688fd6233afc2f518f1723537ff7.tar.gz
vmchooser2-fcbf51697529688fd6233afc2f518f1723537ff7.tar.xz
vmchooser2-fcbf51697529688fd6233afc2f518f1723537ff7.zip
Fix selection of last session if session was a VM
Diffstat (limited to 'src/dialog.cpp')
-rw-r--r--src/dialog.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/dialog.cpp b/src/dialog.cpp
index 4179afd..fdf3d78 100644
--- a/src/dialog.cpp
+++ b/src/dialog.cpp
@@ -284,7 +284,6 @@ void Dialog::setTheme() {
backgroundColor.prepend("\\1").append("\\2");
label_l_style.replace(QRegExp("(.*background-color:)#[^;]*(;.*)"), backgroundColor);
label_r_style.replace(QRegExp("(.*background-color:)#[^;]*(;.*)"), backgroundColor);
- //qDebug() << label_r_style << label_l_style;
ui->label_l->setStyleSheet(label_l_style);
ui->label_r->setStyleSheet(label_r_style);
}
@@ -359,7 +358,8 @@ void Dialog::addSessionsAfterDownload(QNetworkReply* reply) {
userInteracted_ = true;
}
-void Dialog::on_treeView_clicked(const QModelIndex&) {
+void Dialog::mousePressEvent(QMouseEvent * event) {
+ QDialog::mousePressEvent(event);
userInteracted_ = true;
}
@@ -370,9 +370,7 @@ void Dialog::treeView_selectionChanged(const QModelIndex& current, const QModelI
const Session* s(item->session());
if (!s) {
- if (debugMode) {
- qDebug() << "invalid selection";
- }
+ qDebug() << "invalid selection";
// no valid session has been selected, do nothing
return;
}
@@ -453,10 +451,13 @@ void Dialog::onTabButtonChanged(int tab) {
ui->treeView->selectionModel()->setCurrentIndex(ui->treeView->model()->index(0, 0, ui->treeView->rootIndex()), QItemSelectionModel::Select);
}
+void Dialog::on_filterEdit_textEdited() {
+ userInteracted_ = true;
+}
+
void Dialog::on_filterEdit_textChanged() {
if (activeTab_ < 0 || activeTab_ >= TAB_COUNT) return;
SessionTreeModel *newModel = NULL;
- userInteracted_ = true;
// filter the current model
if (!ui->filterEdit->text().isEmpty() && ui->filterEdit->text().replace(" ", "").length() > 2) {
@@ -634,7 +635,9 @@ void Dialog::keyPressEvent(QKeyEvent* event) {
}
void Dialog::iconDownloaded(const QUrl& url, const QIcon&) {
- qDebug() << "Icon downloaded... (" << url << ")";
- // TODO: Check which model(s) contain an entry with this icon
- model_[2]->updateView();
+ qDebug() << "Icon downloaded... (" << url << ")";
+ // TODO: Check which model(s) contain an entry with this icon
+ model_[TAB_MY_COURSES]->updateView();
+ model_[TAB_ALL_VMS]->updateView();
}
+