From 0d690f3225fe9a718f928e6f662b8f72d4b1430e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 17 May 2017 20:37:40 +0530 Subject: [PATCH] Prevent use of system Qt style on linux as it causes hangs/crashes --- src/calibre/gui2/__init__.py | 4 ++++ src/calibre/gui2/preferences/look_feel.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index 3c1a11eadd..ae545533f4 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -1077,6 +1077,10 @@ class Application(QApplication): def setup_styles(self, force_calibre_style): self.using_calibre_style = force_calibre_style or 'CALIBRE_IGNORE_SYSTEM_THEME' in os.environ or ( gprefs['ui_style'] != 'system') + if not iswindows and not isosx: + # Force calibre style on linux as the system style causes + # crashes/hangs in Qt + self.using_calibre_style = True if self.using_calibre_style: self.load_calibre_style() diff --git a/src/calibre/gui2/preferences/look_feel.py b/src/calibre/gui2/preferences/look_feel.py index a3eae5b21f..66ff475383 100644 --- a/src/calibre/gui2/preferences/look_feel.py +++ b/src/calibre/gui2/preferences/look_feel.py @@ -20,7 +20,7 @@ from PyQt5.Qt import ( from calibre import human_readable from calibre.ebooks.metadata.book.render import DEFAULT_AUTHOR_LINK -from calibre.constants import isosx +from calibre.constants import isosx, iswindows from calibre.ebooks.metadata.sources.prefs import msprefs from calibre.gui2 import default_author_link from calibre.gui2.dialogs.template_dialog import TemplateDialog @@ -325,6 +325,10 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): def genesis(self, gui): self.gui = gui + if not isosx and not iswindows: + self.label_widget_style.setVisible(False) + self.opt_ui_style.setVisible(False) + db = gui.library_view.model().db r = self.register