summaryrefslogtreecommitdiffstats
path: root/src/dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dialog.cpp')
-rw-r--r--src/dialog.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/dialog.cpp b/src/dialog.cpp
index 56860f2..a0b9a47 100644
--- a/src/dialog.cpp
+++ b/src/dialog.cpp
@@ -29,9 +29,6 @@ static bool isProcessRunning(const QString &binary);
Dialog::Dialog(QWidget *parent)
: QDialog(parent), ui(new Ui::Dialog) {
- // Make sure a window manager is running, so any modals or other popups work properly
- WindowManager::ensureRunning();
-
model_[TAB_NATIVE] = new SessionTreeModel(parent);
model_[TAB_RECENT_COURSES] = new SessionTreeModel(parent, true);
model_[TAB_ALL_VMS] = new SessionTreeModel(parent);
@@ -732,7 +729,7 @@ void Dialog::onTabButtonChanged(int tab) {
}
// Update pressed status of buttons
- for (int i = 0; i < 3; ++i) {
+ for (int i = 0; i < TAB_COUNT; ++i) {
tabs_[i]->setChecked(tab == i);
}
@@ -871,6 +868,7 @@ void Dialog::selectFirstElement() {
QModelIndex newIndex = QModelIndex(model_[activeTab_]->index(0, 0, section));
ui->treeView->selectionModel()->setCurrentIndex(newIndex, QItemSelectionModel::Select);
+
ui->treeView->setFocus();
}
@@ -917,6 +915,15 @@ void Dialog::checkAutostart() {
}
}
+void Dialog::showEvent(QShowEvent *e)
+{
+ QDialog::showEvent(e);
+ // Make sure a window manager is running, so any modals or other popups work properly
+ QTimer::singleShot(10, []() {
+ WindowManager::ensureRunning();
+ });
+}
+
static bool isProcessRunning(const QString &binary)
{
bool full = binary.contains('/');