GH-2592 Autoselect newly created instances
This commit is contained in:
parent
ce12f1a734
commit
306b98edac
4 changed files with 12 additions and 0 deletions
|
@ -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 ¤t, const QModelIndex &
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::instanceAdded(QString id)
|
||||
{
|
||||
setSelectedInstanceById(id);
|
||||
}
|
||||
|
||||
void MainWindow::instanceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
|
||||
{
|
||||
auto current = view->selectionModel()->currentIndex();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue