From: Armaan Bhojwani Date: Mon, 1 Feb 2021 15:11:20 +0000 (-0500) Subject: Change menu text based on how the menu was opened X-Git-Tag: v0.5.0~10 X-Git-Url: https://git.armaanb.net/?p=lightcards.git;a=commitdiff_plain;h=06e79831c8149c91605bf5ac28d89aac99c81389 Change menu text based on how the menu was opened --- diff --git a/lightcards/display.py b/lightcards/display.py index a2a97c3..9ed12e2 100644 --- a/lightcards/display.py +++ b/lightcards/display.py @@ -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