mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
fix(scanpopup): preserve old group selection after editDictionaries
dialog
This commit is contained in:
parent
a1b10b6956
commit
933c8aea58
|
@ -307,9 +307,15 @@ void ScanPopup::refresh() {
|
|||
// it, we disconnect it while we're clearing and filling back groups.
|
||||
disconnect( ui.groupList, &GroupComboBox::currentIndexChanged,
|
||||
this, &ScanPopup::currentGroupChanged );
|
||||
|
||||
auto OldGroupID = ui.groupList->getCurrentGroup();
|
||||
|
||||
// repopulate
|
||||
ui.groupList->clear();
|
||||
ui.groupList->fill(groups);
|
||||
ui.groupList->setCurrentGroup(0); // user edited group list, force reset to default
|
||||
ui.groupList->fill( groups );
|
||||
|
||||
ui.groupList->setCurrentGroup( OldGroupID ); // This does nothing if OldGroupID doesn't exist;
|
||||
|
||||
ui.groupList->setVisible(!cfg.groups.empty());
|
||||
|
||||
updateDictionaryBar();
|
||||
|
|
Loading…
Reference in a new issue