summaryrefslogtreecommitdiffstats
path: root/src/dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dialog.cpp')
-rw-r--r--src/dialog.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/dialog.cpp b/src/dialog.cpp
index 87eae8e..c7a85e0 100644
--- a/src/dialog.cpp
+++ b/src/dialog.cpp
@@ -353,16 +353,8 @@ void Dialog::setTheme() {
ui->label_r->setStyleSheet(label_r_style);
}
+
void Dialog::onCenterTimer() {
- if (!autoStartEntry_.isEmpty()) {
- if (this->selectSessionByUuid(autoStartEntry_) || this->selectSession(autoStartEntry_)) {
- this->on_treeView_doubleClicked(ui->treeView->selectionModel()->currentIndex());
- } else {
- QMessageBox::critical(this, "Autostart", QString::fromUtf8("Konnte %1 nicht starten.").arg(autoStartEntry_));
- }
- autoStartEntry_.clear();
- return;
- }
// center dialog on primary screen
QRect desktopRect = QApplication::desktop()->availableGeometry(this);
QPoint center = desktopRect.center();
@@ -418,11 +410,14 @@ void Dialog::addSessionsAfterDownload(QNetworkReply* reply) {
this->addStatusString(STR_NO_ITEMS);
}
+ checkAutostart();
+
// select last-session
selectPreviousSession();
userInteracted_ = true;
}
+
void Dialog::mousePressEvent(QMouseEvent * event) {
QDialog::mousePressEvent(event);
userInteracted_ = true;
@@ -793,3 +788,14 @@ bool Dialog::eventFilter(QObject*, QEvent *event) {
}
return false;
}
+void Dialog::checkAutostart() {
+ if (!autoStartEntry_.isEmpty()) {
+ if (this->selectSessionByUuid(autoStartEntry_) || this->selectSession(autoStartEntry_)) {
+ this->on_treeView_doubleClicked(ui->treeView->selectionModel()->currentIndex());
+ } else {
+ QMessageBox::critical(this, "Autostart", QString::fromUtf8("Konnte %1 nicht starten.").arg(autoStartEntry_));
+ }
+ autoStartEntry_.clear();
+ return;
+ }
+}