From 5afa09417540bf3ed2987717d6ac12417ef34394 Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Sun, 16 Feb 2020 14:56:49 -0500 Subject: [PATCH] ui: Add message about remaining pairings to pairing window when receiver has limited pairings --- lib/solaar/ui/pair_window.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/solaar/ui/pair_window.py b/lib/solaar/ui/pair_window.py index 62958b8e..915631f6 100644 --- a/lib/solaar/ui/pair_window.py +++ b/lib/solaar/ui/pair_window.py @@ -201,9 +201,14 @@ def create(receiver): assistant.set_resizable(False) assistant.set_role('pair-device') + page_text = _("If the device is already turned on, turn if off and on again.") + if receiver.remaining_pairings(): + page_text += _("\n\nThis receiver has %d pairing(s) remaining.")%receiver.remaining_pairings() + page_text += _("\nCancelling at this point will not use up a pairing.") + page_intro = _create_page(assistant, Gtk.AssistantPageType.PROGRESS, _("Turn on the device you want to pair."), 'preferences-desktop-peripherals', - _("If the device is already turned on,\nturn if off and on again.")) + page_text) spinner = Gtk.Spinner() spinner.set_visible(True) page_intro.pack_end(spinner, True, True, 24)