comparison main.c @ 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 a9a81db93c74
children f0bca971170b
comparison
equal deleted inserted replaced
525:6bba73050739 526:ba5807ebff88
1460 switch (c) 1460 switch (c)
1461 { 1461 {
1462 case KEY_ENTER: 1462 case KEY_ENTER:
1463 editState->done = TRUE; 1463 editState->done = TRUE;
1464 break; 1464 break;
1465
1466 case 0x03: // ^C = quit
1467 case KEY_F(9): // F9 = Quit
1468 printMsg(currWin, "Quitting per user request (%d/0x%x).\n", c, c);
1469 editState->exitProg = TRUE;
1470 break;
1465 1471
1466 default: 1472 default:
1467 return FALSE; 1473 return FALSE;
1468 } 1474 }
1469 1475
1653 printMsg(NULL, "Please enter your NN login credentials.\n"); 1659 printMsg(NULL, "Please enter your NN login credentials.\n");
1654 printMsg(NULL, "You can avoid doing this every time by issuing '/save' after logging in.\n"); 1660 printMsg(NULL, "You can avoid doing this every time by issuing '/save' after logging in.\n");
1655 1661
1656 printMsg(NULL, "Enter your NN username ...\n"); 1662 printMsg(NULL, "Enter your NN username ...\n");
1657 optUserName = nnwin_prompt_requester(FALSE, &editState, processUserPrompt, updateUserPrompt); 1663 optUserName = nnwin_prompt_requester(FALSE, &editState, processUserPrompt, updateUserPrompt);
1664 if (editState.exitProg)
1665 goto err_exit;
1658 1666
1659 editState.mask = TRUE; 1667 editState.mask = TRUE;
1660 printMsg(NULL, "Enter your NN password ...\n"); 1668 printMsg(NULL, "Enter your NN password ...\n");
1661 optPassword = nnwin_prompt_requester(TRUE, &editState, processUserPrompt, updateUserPrompt); 1669 optPassword = nnwin_prompt_requester(TRUE, &editState, processUserPrompt, updateUserPrompt);
1662 editState.mask = FALSE; 1670 editState.mask = FALSE;
1671 if (editState.exitProg)
1672 goto err_exit;
1663 } 1673 }
1664 } 1674 }
1665 1675
1666 if (optUserName == NULL || optPassword == NULL) 1676 if (optUserName == NULL || optPassword == NULL)
1667 { 1677 {