summaryrefslogtreecommitdiffstats
path: root/application/MainWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'application/MainWindow.cpp')
-rw-r--r--application/MainWindow.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
index bec57c0d..ca98130e 100644
--- a/application/MainWindow.cpp
+++ b/application/MainWindow.cpp
@@ -702,6 +702,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
// model reset -> selection is invalid. All the instance pointers are wrong.
connect(MMC->instances().get(), &InstanceList::dataIsInvalid, this, &MainWindow::selectionBad);
+ // handle newly added instances
+ connect(MMC->instances().get(), &InstanceList::instanceAdded, this, &MainWindow::instanceAdded);
+
// When the global settings page closes, we want to know about it and update our state
connect(MMC, &MultiMC::globalSettingsClosed, this, &MainWindow::globalSettingsClosed);
@@ -1836,6 +1839,11 @@ void MainWindow::instanceChanged(const QModelIndex &current, const QModelIndex &
}
}
+void MainWindow::instanceAdded(QString id)
+{
+ setSelectedInstanceById(id);
+}
+
void MainWindow::instanceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
{
auto current = view->selectionModel()->currentIndex();