about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-09-22 21:42:05 +0100
committerJames Booth <boothj5@gmail.com>2015-09-22 21:42:05 +0100
commit9414ad268d79ba3d0e75ef5fbe0e379c4462893d (patch)
treef588f8375cc70c89b5ce352e33f834985aa79a5a /src/ui
parent74151e6419a606c25b6ea9ad2eed05679f6e8fd9 (diff)
downloadprofani-tty-9414ad268d79ba3d0e75ef5fbe0e379c4462893d.tar.gz
Prompt user to allow or deny untrusted TLS certificates
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/core.c7
-rw-r--r--src/ui/inputwin.c16
-rw-r--r--src/ui/inputwin.h1
-rw-r--r--src/ui/ui.h1
4 files changed, 25 insertions, 0 deletions
diff --git a/src/ui/core.c b/src/ui/core.c
index 5735f462..9f7ffcd7 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -2107,6 +2107,13 @@ ui_ask_password(void)
 }
 
 char *
+ui_get_line(void)
+{
+    status_bar_update_virtual();
+    return inp_get_line();
+}
+
+char *
 ui_ask_pgp_passphrase(const char *hint, int prev_fail)
 {
     ProfWin *current = wins_get_current();
diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c
index 9b4eddfb..5ab2c281 100644
--- a/src/ui/inputwin.c
+++ b/src/ui/inputwin.c
@@ -225,6 +225,21 @@ inp_close(void)
     rl_callback_handler_remove();
 }
 
+char *
+inp_get_line(void)
+{
+    werase(inp_win);
+    wmove(inp_win, 0, 0);
+    _inp_win_update_virtual();
+    doupdate();
+    char *line = NULL;
+    while (!line) {
+        line = inp_readline();
+    }
+    status_bar_clear();
+    return line;
+}
+
 char*
 inp_get_password(void)
 {
@@ -275,6 +290,7 @@ _inp_write(char *line, int offset)
     _inp_win_handle_scroll();
 
     _inp_win_update_virtual();
+    doupdate();
 }
 
 static int
diff --git a/src/ui/inputwin.h b/src/ui/inputwin.h
index f49a6a76..4f732e67 100644
--- a/src/ui/inputwin.h
+++ b/src/ui/inputwin.h
@@ -47,5 +47,6 @@ void inp_win_clear(void);
 void inp_win_resize(void);
 void inp_put_back(void);
 char* inp_get_password(void);
+char * inp_get_line(void);
 
 #endif
diff --git a/src/ui/ui.h b/src/ui/ui.h
index 27395048..07cccd20 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_get_line(void);
 char * ui_ask_pgp_passphrase(const char *hint, int prev_fail);
 
 void ui_handle_stanza(const char * const msg);