From 1f4fd0fcb3ee7e38bfab2ca8613683a0186738d4 Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 1 Sep 2015 20:16:04 +0100 Subject: Added UI function to get PGP passphrase --- src/ui/core.c | 26 +++++++++++++++++++++++--- src/ui/ui.h | 1 + 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'src/ui') diff --git a/src/ui/core.c b/src/ui/core.c index 9ee8b9a5..da18ddbf 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -2101,9 +2101,29 @@ ui_win_unread(int index) char * ui_ask_password(void) { - status_bar_get_password(); - status_bar_update_virtual(); - return inp_get_password(); + status_bar_get_password(); + status_bar_update_virtual(); + return inp_get_password(); +} + +char * +ui_ask_pgp_passphrase(const char *hint, int prev_fail) +{ + ProfWin *current = wins_get_current(); + + if (prev_fail) { + win_print(current, '!', 0, NULL, 0, 0, NULL, "Incorrect passphrase"); + } + + if (hint) { + win_vprint(current, '!', 0, NULL, 0, 0, NULL, "Enter PGP key passphrase for %s", hint); + } else { + win_print(current, '!', 0, NULL, 0, 0, NULL, "Enter PGP key passphrase"); + } + + status_bar_get_password(); + status_bar_update_virtual(); + return inp_get_password(); } void diff --git a/src/ui/ui.h b/src/ui/ui.h index e47cbddd..27395048 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -102,6 +102,7 @@ win_type_t ui_win_type(int index); void ui_close_win(int index); int ui_win_unread(int index); char * ui_ask_password(void); +char * ui_ask_pgp_passphrase(const char *hint, int prev_fail); void ui_handle_stanza(const char * const msg); -- cgit 1.4.1-2-gfad0 .cc.html?h=hlt&id=f8badcdc0ce3b6d7dba5932f85f4bc529bcab128'>blame commit diff stats
path: root/html/072scenario_screen.cc.html
blob: 5100c44cec158f1164703e900a04fca57cfe7dc2 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12