about summary refs log tree commit diff stats
path: root/src/ui/core.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-09-01 20:16:04 +0100
committerJames Booth <boothj5@gmail.com>2015-09-01 20:16:04 +0100
commit1f4fd0fcb3ee7e38bfab2ca8613683a0186738d4 (patch)
tree53cdd1c5908dcd7bb3d937abf92b4dbb006a3fb1 /src/ui/core.c
parentdd346eefc4f633db2047694ce49ef91314e5a5b4 (diff)
downloadprofani-tty-1f4fd0fcb3ee7e38bfab2ca8613683a0186738d4.tar.gz
Added UI function to get PGP passphrase
Diffstat (limited to 'src/ui/core.c')
-rw-r--r--src/ui/core.c26
1 files changed, 23 insertions, 3 deletions
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