mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 00:54:53 -07:00
refactor: remove ReleaseChannel keeping track of its own indexes (#5366)
This commit is contained in:
parent
c8d49b5bf9
commit
25d21a3da6
7 changed files with 13 additions and 18 deletions
|
|
@ -174,8 +174,9 @@ GeneralSettingsPage::GeneralSettingsPage()
|
|||
GeneralSettingsPage::retranslateUi();
|
||||
|
||||
// connect the ReleaseChannel combo box only after the entries are inserted in retranslateUi
|
||||
connect(&updateReleaseChannelBox, SIGNAL(currentIndexChanged(int)), &settings, SLOT(setUpdateReleaseChannel(int)));
|
||||
updateReleaseChannelBox.setCurrentIndex(settings.getUpdateReleaseChannel()->getIndex());
|
||||
connect(&updateReleaseChannelBox, SIGNAL(currentIndexChanged(int)), &settings,
|
||||
SLOT(setUpdateReleaseChannelIndex(int)));
|
||||
updateReleaseChannelBox.setCurrentIndex(settings.getUpdateReleaseChannelIndex());
|
||||
|
||||
setLayout(mainLayout);
|
||||
}
|
||||
|
|
@ -309,7 +310,7 @@ void GeneralSettingsPage::retranslateUi()
|
|||
int oldIndex = updateReleaseChannelBox.currentIndex();
|
||||
updateReleaseChannelBox.clear();
|
||||
for (ReleaseChannel *chan : settings.getUpdateReleaseChannels()) {
|
||||
updateReleaseChannelBox.insertItem(chan->getIndex(), tr(chan->getName().toUtf8()));
|
||||
updateReleaseChannelBox.addItem(tr(chan->getName().toUtf8()));
|
||||
}
|
||||
updateReleaseChannelBox.setCurrentIndex(oldIndex);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue