mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Do not popup an error message if the user tries to use the mouse wheel to scroll before a document is loaded. Fixes #903449 (exception raised in ebook-viewer)
This commit is contained in:
parent
f567ee214c
commit
f40f41a889
@ -758,11 +758,12 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
|
|||||||
self.set_page_number(frac)
|
self.set_page_number(frac)
|
||||||
|
|
||||||
def next_document(self):
|
def next_document(self):
|
||||||
if self.current_index < len(self.iterator.spine) - 1:
|
if (hasattr(self, 'current_index') and self.current_index <
|
||||||
|
len(self.iterator.spine) - 1):
|
||||||
self.load_path(self.iterator.spine[self.current_index+1])
|
self.load_path(self.iterator.spine[self.current_index+1])
|
||||||
|
|
||||||
def previous_document(self):
|
def previous_document(self):
|
||||||
if self.current_index > 0:
|
if hasattr(self, 'current_index') and self.current_index > 0:
|
||||||
self.load_path(self.iterator.spine[self.current_index-1], pos=1.0)
|
self.load_path(self.iterator.spine[self.current_index-1], pos=1.0)
|
||||||
|
|
||||||
def keyPressEvent(self, event):
|
def keyPressEvent(self, event):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user