From f7da0bc178992873765e3a85648ef5a8da8e1d0e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 17 Mar 2015 09:20:36 +0530 Subject: [PATCH] Add an env var to force calibre to use its native style plugin --- manual/customize.rst | 1 + src/calibre/gui2/__init__.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/manual/customize.rst b/manual/customize.rst index 07c9bc2039..041cc875ad 100644 --- a/manual/customize.rst +++ b/manual/customize.rst @@ -30,6 +30,7 @@ Environment variables * ``CALIBRE_OVERRIDE_LANG`` - Used to force the language used by the interface (ISO 639 language code) * ``CALIBRE_NO_NATIVE_FILEDIALOGS`` - Causes calibre to not use native file dialogs for selecting files/directories. Set it to 1 to enable. * ``CALIBRE_NO_NATIVE_MENUBAR`` - Causes calibre to not create a native (global) menu on Ubuntu Unity and similar linux desktop environments. The menu is instead placed inside the window, as traditional. + * ``CALIBRE_IGNORE_SYSTEM_THEME`` - Causes calibre to ignore any system Qt style plugins and use its builtin style plugin instead. Useful to workaround crashes caused by the system Qt plugin being incompatible with the version of Qt shipped with calibre. * ``SYSFS_PATH`` - Use if sysfs is mounted somewhere other than /sys * ``http_proxy`` - Used on linux to specify an HTTP proxy diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index fd68a08246..329df37617 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -990,7 +990,8 @@ class Application(QApplication): if not depth_ok: prints('Color depth is less than 32 bits disabling modern look') - self.using_calibre_style = force_calibre_style or (depth_ok and gprefs['ui_style'] != 'system') + self.using_calibre_style = force_calibre_style or 'CALIBRE_IGNORE_SYSTEM_THEME' in os.environ or ( + depth_ok and gprefs['ui_style'] != 'system') if self.using_calibre_style: self.load_calibre_style()