mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
Better error message when trying to print book with no book open
This commit is contained in:
parent
929879dc10
commit
7837389034
@ -428,6 +428,9 @@ class EbookViewer(MainWindow):
|
|||||||
error_dialog(self, title, msg, det_msg=details or None, show=True)
|
error_dialog(self, title, msg, det_msg=details or None, show=True)
|
||||||
|
|
||||||
def print_book(self):
|
def print_book(self):
|
||||||
|
if not hasattr(set_book_path, 'pathtoebook'):
|
||||||
|
error_dialog(self, _('Cannot print book'), _(
|
||||||
|
'No book is currently open'), show=True)
|
||||||
from .printing import print_book
|
from .printing import print_book
|
||||||
print_book(set_book_path.pathtoebook, book_title=self.current_book_data['metadata']['title'], parent=self)
|
print_book(set_book_path.pathtoebook, book_title=self.current_book_data['metadata']['title'], parent=self)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user