Skip to content

Commit

Permalink
Fixed a minor bug where the title of a dialog is not consistant with …
Browse files Browse the repository at this point in the history
…the rest of the applicatin.
  • Loading branch information
mush42 committed Jan 19, 2022
1 parent 4df1092 commit 9d798a3
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions bookworm/bookshelf/viewer_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,18 @@ def onOpenBookshelf(self, event):
run_subcommand_in_a_new_process(["bookshelf",])

def onAddDocumentToLocalBookshelf(self, event):
try:
self.view.reader.document.get_file_system_path()
except DocumentIOError:
wx.MessageBox(
_("You can not add this document to Bookshelf.\nThe document should exist locally in your computer."),
_("Can not add document"),
style=wx.ICON_WARNING
)
return
dialog = EditDocumentClassificationDialog(
self.view,
_("Document Category and Tags")
_("Reading list and collections")
)
with dialog:
retval = dialog.ShowModal()
Expand All @@ -96,16 +105,8 @@ def onAddDocumentToLocalBookshelf(self, event):

@call_threaded
def _on_reader_loaded(self, sender):
try:
sender.document.get_file_system_path()
has_file_system_path = True
except DocumentIOError:
has_file_system_path = False
wx.CallAfter(
self.Enable,
StatefulBookshelfMenuIds.add_current_book_to_shelf,
all([
not Document.select().where(Document.uri == sender.document.uri).count(),
has_file_system_path
]),
not Document.select().where(Document.uri == sender.document.uri).count()
)

0 comments on commit 9d798a3

Please sign in to comment.