Prevent use of system Qt style on linux as it causes hangs/crashes

This commit is contained in:
Kovid Goyal 2017-05-17 20:37:40 +05:30
parent a22b5e10fe
commit 0d690f3225
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 9 additions and 1 deletions

View File

@ -1077,6 +1077,10 @@ class Application(QApplication):
def setup_styles(self, force_calibre_style): def setup_styles(self, force_calibre_style):
self.using_calibre_style = force_calibre_style or 'CALIBRE_IGNORE_SYSTEM_THEME' in os.environ or ( self.using_calibre_style = force_calibre_style or 'CALIBRE_IGNORE_SYSTEM_THEME' in os.environ or (
gprefs['ui_style'] != 'system') 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: if self.using_calibre_style:
self.load_calibre_style() self.load_calibre_style()

View File

@ -20,7 +20,7 @@ from PyQt5.Qt import (
from calibre import human_readable from calibre import human_readable
from calibre.ebooks.metadata.book.render import DEFAULT_AUTHOR_LINK 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.ebooks.metadata.sources.prefs import msprefs
from calibre.gui2 import default_author_link from calibre.gui2 import default_author_link
from calibre.gui2.dialogs.template_dialog import TemplateDialog from calibre.gui2.dialogs.template_dialog import TemplateDialog
@ -325,6 +325,10 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
def genesis(self, gui): def genesis(self, gui):
self.gui = 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 db = gui.library_view.model().db
r = self.register r = self.register