mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -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()
|
return default_theme()
|
||||||
|
|
||||||
def set_current_theme(self, name):
|
def set_current_theme(self, name):
|
||||||
|
if not hasattr(self, "themes"):
|
||||||
|
return False
|
||||||
for i, t in enumerate(self.themes):
|
for i, t in enumerate(self.themes):
|
||||||
if t.get('name') == name:
|
if t.get('name') == name:
|
||||||
self.theme_list.setCurrentRow(i, QItemSelectionModel.SelectionFlag.SelectCurrent | QItemSelectionModel.SelectionFlag.Clear)
|
self.theme_list.setCurrentRow(i, QItemSelectionModel.SelectionFlag.SelectCurrent | QItemSelectionModel.SelectionFlag.Clear)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user