mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Check themes
attribute exists before using it
Click "Restore default icons" before icon themes loaded will cause an error.
This commit is contained in:
parent
cc58f2eda7
commit
cfd24b8ff7
@ -730,6 +730,8 @@ class ChooseThemeWidget(QWidget):
|
||||
return default_theme()
|
||||
|
||||
def set_current_theme(self, name):
|
||||
if not hasattr(self, "themes"):
|
||||
return False
|
||||
for i, t in enumerate(self.themes):
|
||||
if t.get('name') == name:
|
||||
self.theme_list.setCurrentRow(i, QItemSelectionModel.SelectionFlag.SelectCurrent | QItemSelectionModel.SelectionFlag.Clear)
|
||||
|
Loading…
x
Reference in New Issue
Block a user