diff --git a/GUI/View/Instrument/InstrumentLibraryEditor.cpp b/GUI/View/Instrument/InstrumentLibraryEditor.cpp index 751e19ae02ed7fc6b6eb3a7991426f37b68b4c62..7f9ae3d2441ea3660dbafde9544c9e0192587b0a 100644 --- a/GUI/View/Instrument/InstrumentLibraryEditor.cpp +++ b/GUI/View/Instrument/InstrumentLibraryEditor.cpp @@ -97,7 +97,7 @@ InstrumentLibraryEditor::InstrumentLibraryEditor(QWidget* parent, // ensure a current item when widget is shown GUI::Style::setResizable(this); - appSettings->loadWindowSizeAndPos(this); + appSettings->loadWindowSizeAndPos(this); applySplitterPos(); // unfix m_treeView width only on manual resize @@ -148,6 +148,10 @@ InstrumentItem* InstrumentLibraryEditor::execChoose() &InstrumentLibraryEditor::onCurrentChangedForChoose); onCurrentChangedForChoose(); + // select the first instrument + QModelIndex index = m_treeModel->indexForItem(m_instrumentLibrary->instrumentItems().first()); + m_treeView->setCurrentIndex(index); + if (exec() == QDialog::Accepted) return m_chosenItem;