diff options
author | Simon Rettberg | 2016-01-07 17:56:44 +0100 |
---|---|---|
committer | Simon Rettberg | 2016-01-07 17:56:44 +0100 |
commit | fcbf51697529688fd6233afc2f518f1723537ff7 (patch) | |
tree | cf45c7f5f19a0500601964c391275dbcd64aac05 /src/dialog.cpp | |
parent | Move user config dir to .config/openslx (diff) | |
download | vmchooser2-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.cpp | 21 |
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(); } + |