summaryrefslogtreecommitdiff
path: root/src/gui/curses/gui-display.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2004-09-16 20:01:56 +0000
committerSebastien Helleu <flashcode@flashtux.org>2004-09-16 20:01:56 +0000
commitc65666181290f0a4285893cf1c2d95be3eb8132e (patch)
treee5cbddc4db6fc70b0d8291cfc5c71d7e350db9cb /src/gui/curses/gui-display.c
parent6753591f86633f09e7397d166e14f4986a08b1e9 (diff)
downloadweechat-c65666181290f0a4285893cf1c2d95be3eb8132e.zip
Added DCC control keys (Accept, Cancel, Remove, Close DCC view)
Diffstat (limited to 'src/gui/curses/gui-display.c')
-rw-r--r--src/gui/curses/gui-display.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c
index 15b229040..e57b7ba44 100644
--- a/src/gui/curses/gui-display.c
+++ b/src/gui/curses/gui-display.c
@@ -1134,6 +1134,7 @@ gui_draw_buffer_input (t_gui_buffer *buffer, int erase)
char format[32];
char *ptr_nickname;
int input_width;
+ t_dcc *dcc_selected;
if (!gui_ok)
return;
@@ -1202,8 +1203,44 @@ gui_draw_buffer_input (t_gui_buffer *buffer, int erase)
{
if (buffer->dcc)
{
- snprintf (format, 32, "%%-%ds", input_width);
- mvwprintw (ptr_win->win_input, 0, 0, format, "");
+ dcc_selected = (ptr_win->dcc_selected) ? (t_dcc *) ptr_win->dcc_selected : dcc_list;
+ if (dcc_selected)
+ {
+ switch (dcc_selected->status)
+ {
+ case DCC_WAITING:
+ if ((dcc_selected->type == DCC_CHAT_RECV)
+ || (dcc_selected->type == DCC_FILE_RECV))
+ {
+ mvwprintw (ptr_win->win_input, 0, 0,
+ _(" [A] Accept"));
+ wprintw (ptr_win->win_input, _(" [C] Cancel"));
+ wprintw (ptr_win->win_input, _(" [Q] Close DCC view"));
+ }
+ else
+ {
+ mvwprintw (ptr_win->win_input, 0, 0,
+ _(" [C] Cancel"));
+ wprintw (ptr_win->win_input, _(" [Q] Close DCC view"));
+ }
+ break;
+ case DCC_CONNECTING:
+ case DCC_ACTIVE:
+ mvwprintw (ptr_win->win_input, 0, 0,
+ _(" [C] Cancel"));
+ wprintw (ptr_win->win_input, _(" [Q] Close DCC view"));
+ break;
+ case DCC_DONE:
+ case DCC_FAILED:
+ case DCC_ABORTED:
+ mvwprintw (ptr_win->win_input, 0, 0,
+ _(" [R] Remove"));
+ wprintw (ptr_win->win_input, _(" [Q] Close DCC view"));
+ break;
+ }
+ }
+ else
+ mvwprintw (ptr_win->win_input, 0, 0, _(" [Q] Close DCC view"));
wclrtoeol (ptr_win->win_input);
if (ptr_win == gui_current_window)
move (ptr_win->win_y + ptr_win->win_height - 1,