From: Armaan Bhojwani Date: Sat, 13 Feb 2021 17:41:16 +0000 (-0500) Subject: Implement confirm_quit config option X-Git-Tag: v0.7.0~35 X-Git-Url: https://git.armaanb.net/?p=lightcards.git;a=commitdiff_plain;h=09c73b643843b6f88e09de0765b8ea1b84910099 Implement confirm_quit config option --- diff --git a/lightcards/display.py b/lightcards/display.py index cb52c8d..386058f 100644 --- a/lightcards/display.py +++ b/lightcards/display.py @@ -50,14 +50,14 @@ class Quit: (mlines, mcols) = self.outer.win.getmaxyx() self.win.mvwin(int(mlines / 2) - 3, int(mcols / 2) - 10) self.panel.show() - - while True: - key = self.win.getkey() - if key == "y": - break - elif key == "n": - self.panel.hide() - self.outer.get_key() + if self.outer.config["confirm_quit"]: + while True: + key = self.win.getkey() + if key == "y": + break + elif key == "n": + self.panel.hide() + self.outer.get_key() class Help: