mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Show home page if opening book fails
This commit is contained in:
parent
09b93eb8be
commit
5e6623bcda
@ -261,6 +261,7 @@ class EbookViewer(MainWindow):
|
|||||||
error_dialog(self, _('Loading book failed'), _(
|
error_dialog(self, _('Loading book failed'), _(
|
||||||
'Failed to open the book at {0}. Click "Show details" for more info.').format(data['pathtoebook']),
|
'Failed to open the book at {0}. Click "Show details" for more info.').format(data['pathtoebook']),
|
||||||
det_msg=data['tb'], show=True)
|
det_msg=data['tb'], show=True)
|
||||||
|
self.web_view.show_home_page()
|
||||||
return
|
return
|
||||||
set_book_path(data['base'], data['pathtoebook'])
|
set_book_path(data['base'], data['pathtoebook'])
|
||||||
self.current_book_data = data
|
self.current_book_data = data
|
||||||
|
@ -211,6 +211,7 @@ class ViewerBridge(Bridge):
|
|||||||
goto_cfi = to_js()
|
goto_cfi = to_js()
|
||||||
full_screen_state_changed = to_js()
|
full_screen_state_changed = to_js()
|
||||||
get_current_cfi = to_js()
|
get_current_cfi = to_js()
|
||||||
|
show_home_page = to_js()
|
||||||
|
|
||||||
|
|
||||||
def apply_font_settings(page_or_view):
|
def apply_font_settings(page_or_view):
|
||||||
@ -470,3 +471,6 @@ class WebView(RestartingWebEngineView):
|
|||||||
|
|
||||||
def get_current_cfi(self, callback):
|
def get_current_cfi(self, callback):
|
||||||
self.do_callback('get_current_cfi', callback)
|
self.do_callback('get_current_cfi', callback)
|
||||||
|
|
||||||
|
def show_home_page(self):
|
||||||
|
self.execute_when_ready('show_home_page')
|
||||||
|
@ -198,6 +198,11 @@ def create_view(prefs, all_font_families, field_metadata):
|
|||||||
view.overlay.open_book(False)
|
view.overlay.open_book(False)
|
||||||
|
|
||||||
|
|
||||||
|
@from_python
|
||||||
|
def show_home_page():
|
||||||
|
view.overlay.open_book(False)
|
||||||
|
|
||||||
|
|
||||||
@from_python
|
@from_python
|
||||||
def show_preparing_message(msg):
|
def show_preparing_message(msg):
|
||||||
view.show_loading_message(msg)
|
view.show_loading_message(msg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user