[tor-commits] [arm/release] Replacing quit confirmation to use the popup util

atagar at torproject.org atagar at torproject.org
Sun Jul 17 06:08:20 UTC 2011


commit 9ddfb9127a41991428736d98ef075cd77817eda4
Author: Damian Johnson <atagar at torproject.org>
Date:   Thu May 12 21:13:01 2011 -0700

    Replacing quit confirmation to use the popup util
---
 src/cli/controller.py |   21 +++------------------
 1 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/src/cli/controller.py b/src/cli/controller.py
index 1189781..6c26d81 100644
--- a/src/cli/controller.py
+++ b/src/cli/controller.py
@@ -686,24 +686,9 @@ def drawTorMonitor(stdscr, startTime, loggedEvents, isBlindMode):
       
       # provides prompt to confirm that arm should exit
       if CONFIRM_QUIT:
-        panel.CURSES_LOCK.acquire()
-        try:
-          setPauseState(panels, isPaused, page, True)
-          
-          # provides prompt
-          panels["control"].setMsg("Are you sure (q again to confirm)?", curses.A_BOLD)
-          panels["control"].redraw(True)
-          
-          curses.cbreak()
-          confirmationKey = stdscr.getch()
-          quitConfirmed = confirmationKey in (ord('q'), ord('Q'))
-          curses.halfdelay(REFRESH_RATE * 10)
-          
-          if not quitConfirmed:
-            panels["control"].setMsg(CTL_PAUSED if isPaused else CTL_HELP)
-          setPauseState(panels, isPaused, page)
-        finally:
-          panel.CURSES_LOCK.release()
+        msg = "Are you sure (q again to confirm)?"
+        confirmationKey = popups.showMsg(msg, attr = curses.A_BOLD)
+        quitConfirmed = confirmationKey in (ord('q'), ord('Q'))
       
       if quitConfirmed:
         # quits arm





More information about the tor-commits mailing list