Preserve selected add-ons

This commit is contained in:
Glutanimate 2019-02-23 10:10:05 +01:00
parent 15a83df126
commit 195ca93cfe

View File

@ -458,15 +458,15 @@ class AddonsDialog(QDialog):
self.addons = [(self.annotatedName(d), d) for d in mgr.allAddons()] self.addons = [(self.annotatedName(d), d) for d in mgr.allAddons()]
self.addons.sort() self.addons.sort()
selected = set(self.selectedAddons())
addonList.clear() addonList.clear()
for name, dir in self.addons: for name, dir in self.addons:
item = QListWidgetItem(name, addonList) item = QListWidgetItem(name, addonList)
if not mgr.isEnabled(dir): if not mgr.isEnabled(dir):
item.setForeground(Qt.gray) item.setForeground(Qt.gray)
if dir in selected:
if self.addons: item.setSelected(True)
addonList.setCurrentRow(0)
addonList.repaint() addonList.repaint()