diff --git a/calibre-plugin/dialogs.py b/calibre-plugin/dialogs.py index 7bf93a77..233cd688 100644 --- a/calibre-plugin/dialogs.py +++ b/calibre-plugin/dialogs.py @@ -1532,7 +1532,8 @@ class ViewLog(SizePersistedDialog): error_msg=error_msg[:200]+" ..." label = QLabel('%s: %s'%(lineno, error_msg)) label.setWordWrap(True) - if QApplication.instance().is_dark_theme: + if( hasattr(QApplication.instance(),'is_dark_theme') + and QApplication.instance().is_dark_theme ): label.setStyleSheet("QLabel { margin-left: 2em; color : aqua; } QLabel:hover { color: red; }"); else: label.setStyleSheet("QLabel { margin-left: 2em; color : blue; } QLabel:hover { color: red; }"); diff --git a/calibre-plugin/inihighlighter.py b/calibre-plugin/inihighlighter.py index f2f21b05..d00e21a6 100644 --- a/calibre-plugin/inihighlighter.py +++ b/calibre-plugin/inihighlighter.py @@ -42,7 +42,8 @@ class IniHighlighter(QSyntaxHighlighter): 'comments':Qt.darkYellow } try: - if QApplication.instance().is_dark_theme: + if( hasattr(QApplication.instance(),'is_dark_theme') + and QApplication.instance().is_dark_theme ): colors = { 'knownentries':Qt.green, 'errors':Qt.red,