summaryrefslogtreecommitdiffstats
path: root/src/dialog.cpp
diff options
context:
space:
mode:
authorChristian Klinger2016-08-03 10:45:09 +0200
committerChristian Klinger2016-08-03 10:45:09 +0200
commit6705b6d670ce859d1d22c4ed748f71ac6fb2d5a6 (patch)
tree2aac9b02b5cf1f81340153c8a21de92bc6c630e9 /src/dialog.cpp
parentadded --start-uuid parameter. (diff)
downloadvmchooser2-6705b6d670ce859d1d22c4ed748f71ac6fb2d5a6.tar.gz
vmchooser2-6705b6d670ce859d1d22c4ed748f71ac6fb2d5a6.tar.xz
vmchooser2-6705b6d670ce859d1d22c4ed748f71ac6fb2d5a6.zip
check for autostart when download is finished
and not after a fixed time of 1 second.
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;
+ }
+}