Skip to content

Commit

Permalink
Fix strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ping committed Aug 7, 2023
1 parent 536e5e2 commit 27eeba5
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions calibre-plugin/dialog/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,26 @@ def search_results_view_selection_model_selectionchanged(self):
),
)
if not LibbyClient.can_borrow(card):
card_action.setToolTip("Card is out of loan limits")
card_action.setToolTip(
"\n".join(
[
site["__library"]["name"],
_("This card is out of loans."),
]
)
)
card_action.setEnabled(False)
continue

if self.search_model.has_loan(media["id"], card["cardId"]):
card_action.setToolTip("Loan already exists")
card_action.setToolTip(
"\n".join(
[
site["__library"]["name"],
_("You already have a loan for this title."),
]
)
)
card_action.setEnabled(False)
continue

Expand Down Expand Up @@ -312,11 +326,25 @@ def search_results_view_selection_model_selectionchanged(self):
),
)
if not LibbyClient.can_place_hold(card):
card_action.setToolTip("Card is out of hold limits")
card_action.setToolTip(
"\n".join(
[
site["__library"]["name"],
_("This card is out of holds."),
]
)
)
card_action.setEnabled(False)
continue
if self.search_model.has_hold(media["id"], card["cardId"]):
card_action.setToolTip("Hold already exists")
card_action.setToolTip(
"\n".join(
[
site["__library"]["name"],
_("You already have a hold for this title."),
]
)
)
card_action.setEnabled(False)
continue

Expand Down

0 comments on commit 27eeba5

Please sign in to comment.