mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
OS X: Workaround for Qt 5 regression that causes any errors during startup to be hidden behind the splash screen. Fixes #1473017 [Splash screen covers menu in OS X](https://bugs.launchpad.net/calibre/+bug/1473017)
This commit is contained in:
parent
b4f18732b8
commit
9474a3ecef
@ -229,11 +229,13 @@ class GuiRunner(QObject):
|
|||||||
self.app.file_event_hook = add_filesystem_book
|
self.app.file_event_hook = add_filesystem_book
|
||||||
|
|
||||||
def choose_dir(self, initial_dir):
|
def choose_dir(self, initial_dir):
|
||||||
|
self.hide_splash_screen()
|
||||||
return choose_dir(self.splash_screen, 'choose calibre library',
|
return choose_dir(self.splash_screen, 'choose calibre library',
|
||||||
_('Choose a location for your new calibre e-book library'),
|
_('Choose a location for your new calibre e-book library'),
|
||||||
default_dir=initial_dir)
|
default_dir=initial_dir)
|
||||||
|
|
||||||
def show_error(self, title, msg, det_msg=''):
|
def show_error(self, title, msg, det_msg=''):
|
||||||
|
self.hide_splash_screen()
|
||||||
with self.app:
|
with self.app:
|
||||||
error_dialog(self.splash_screen, title, msg, det_msg=det_msg, show=True)
|
error_dialog(self.splash_screen, title, msg, det_msg=det_msg, show=True)
|
||||||
|
|
||||||
@ -279,6 +281,7 @@ class GuiRunner(QObject):
|
|||||||
db = LibraryDatabase(self.library_path)
|
db = LibraryDatabase(self.library_path)
|
||||||
except apsw.Error:
|
except apsw.Error:
|
||||||
with self.app:
|
with self.app:
|
||||||
|
self.hide_splash_screen()
|
||||||
repair = question_dialog(self.splash_screen, _('Corrupted database'),
|
repair = question_dialog(self.splash_screen, _('Corrupted database'),
|
||||||
_('The library database at %s appears to be corrupted. Do '
|
_('The library database at %s appears to be corrupted. Do '
|
||||||
'you want calibre to try and rebuild it automatically? '
|
'you want calibre to try and rebuild it automatically? '
|
||||||
@ -303,6 +306,11 @@ class GuiRunner(QObject):
|
|||||||
self.splash_screen.show()
|
self.splash_screen.show()
|
||||||
self.splash_screen.show_message(_('Starting %s: Loading books...') % __appname__)
|
self.splash_screen.show_message(_('Starting %s: Loading books...') % __appname__)
|
||||||
|
|
||||||
|
def hide_splash_screen(self):
|
||||||
|
if self.splash_screen is not None:
|
||||||
|
self.splash_screen.hide()
|
||||||
|
self.splash_screen = None
|
||||||
|
|
||||||
def initialize(self, *args):
|
def initialize(self, *args):
|
||||||
if gprefs['show_splash_screen'] and not self.opts.start_in_tray:
|
if gprefs['show_splash_screen'] and not self.opts.start_in_tray:
|
||||||
self.show_splash_screen()
|
self.show_splash_screen()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user