]> git.armaanb.net Git - lightcards.git/commitdiff
Change menu text based on how the menu was opened
authorArmaan Bhojwani <me@armaanb.net>
Mon, 1 Feb 2021 15:11:20 +0000 (10:11 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Mon, 1 Feb 2021 15:11:20 +0000 (10:11 -0500)
lightcards/display.py

index a2a97c3c2e1284e886daac3015c2200f6338de23..9ed12e2e41548b29f8e5526ddd0702222caaf828 100644 (file)
@@ -124,12 +124,16 @@ class Display():
                 self.obj.setIdx(0)
                 self.get_key()
 
-    def disp_menu(self, keygrab=True):
+    def disp_menu(self, keygrab=True, quit=False):
         """
         Display a menu once the end of the deck has been reached, offering
         multiple options on how to continue.
         """
 
+        quit_text = "[q]: back"
+        if quit:
+            quit_text = "[q]: quit"
+
         self.win.addstr("LIGHTCARDS MENU", curses.color_pair(1) +
                         curses.A_BOLD)
         self.win.hline(1, 0, curses.ACS_HLINE, 15)
@@ -141,7 +145,7 @@ class Display():
                         "[d]: star all\n" +
                         "[s]: update stack to include starred only\n\n" +
                         "[r]: restart\n" +
-                        "[q]: back")
+                        quit_text)
 
         if keygrab:
             self.menu_grab()
@@ -162,7 +166,7 @@ class Display():
         self.win.clear()
         (mlines, mcols) = self.win.getmaxyx()
         if self.obj.getIdx() == len(self.stack):
-            self.disp_menu()
+            self.disp_menu(quit=True)
         else:
             # If on the back of the card, show the content of the front side in
             # the header