changeset 526:ba5807ebff88

Make it possible to quit when entering username/passwd.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 05 Jun 2012 23:59:34 +0300
parents 6bba73050739
children 436e86afa70a
files main.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/main.c	Tue Jun 05 23:52:10 2012 +0300
+++ b/main.c	Tue Jun 05 23:59:34 2012 +0300
@@ -1462,6 +1462,12 @@
     case KEY_ENTER:
         editState->done = TRUE;
         break;
+
+    case 0x03: // ^C = quit
+    case KEY_F(9): // F9 = Quit
+        printMsg(currWin, "Quitting per user request (%d/0x%x).\n", c, c);
+        editState->exitProg = TRUE;
+        break;
     
     default:
         return FALSE;
@@ -1655,11 +1661,15 @@
 
             printMsg(NULL, "Enter your NN username ...\n");
             optUserName = nnwin_prompt_requester(FALSE, &editState, processUserPrompt, updateUserPrompt);
+            if (editState.exitProg)
+                goto err_exit;
 
             editState.mask = TRUE;
             printMsg(NULL, "Enter your NN password ...\n");
             optPassword = nnwin_prompt_requester(TRUE, &editState, processUserPrompt, updateUserPrompt);
             editState.mask = FALSE;
+            if (editState.exitProg)
+                goto err_exit;
         }
     }