summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2004-09-09 21:41:54 +0000
committerSebastien Helleu <flashcode@flashtux.org>2004-09-09 21:41:54 +0000
commit1484e17ce1b85526457176688d6f093d91955ee7 (patch)
tree5b8b36b53400ce74cd60fd4667bc7e6f516c6312 /src/gui
parent9759d72d3d98377469c6560ec9ec49defccf2727 (diff)
downloadweechat-1484e17ce1b85526457176688d6f093d91955ee7.zip
DCC not auto accepted (depending on config), "~" replaced by home in dcc download dir, suffix displayed in filename received (if file is renamed), highlight for DCC buffer
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/curses/gui-display.c32
-rw-r--r--src/gui/gui.h1
2 files changed, 31 insertions, 2 deletions
diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c
index 0c1fdcab5..b978bb38d 100644
--- a/src/gui/curses/gui-display.c
+++ b/src/gui/curses/gui-display.c
@@ -604,6 +604,9 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
gui_window_set_color (ptr_win->win_chat, COLOR_WIN_CHAT);
mvwprintw (ptr_win->win_chat, i, 0, " %-16s %s",
ptr_dcc->nick, ptr_dcc->filename);
+ if (ptr_dcc->filename_suffix > 0)
+ wprintw (ptr_win->win_chat, " (.%d)",
+ ptr_dcc->filename_suffix);
gui_window_set_color (ptr_win->win_chat, COLOR_WIN_CHAT);
mvwprintw (ptr_win->win_chat, i + 1, 0, " %s ",
(ptr_dcc->type == DCC_FILE_RECV) ?
@@ -1008,8 +1011,12 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
COLOR_WIN_STATUS_DATA_HIGHLIGHT);
break;
}
- wprintw (ptr_win->win_status, "%d",
- ptr_hotlist->buffer->number);
+ if (ptr_hotlist->buffer->dcc)
+ wprintw (ptr_win->win_status, "%d/DCC",
+ ptr_hotlist->buffer->number);
+ else
+ wprintw (ptr_win->win_status, "%d",
+ ptr_hotlist->buffer->number);
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS);
if (ptr_hotlist->next_hotlist)
@@ -1341,6 +1348,27 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
}
/*
+ * gui_get_dcc_buffer: get pointer to DCC buffer (DCC buffer created if not existing)
+ */
+
+t_gui_buffer *
+gui_get_dcc_buffer ()
+{
+ t_gui_buffer *ptr_buffer;
+
+ /* check if dcc buffer exists */
+ for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
+ {
+ if (BUFFER_IS_DCC (ptr_buffer))
+ break;
+ }
+ if (ptr_buffer)
+ return ptr_buffer;
+ else
+ return gui_buffer_new (gui_current_window, NULL, NULL, 1, 0);
+}
+
+/*
* gui_switch_to_dcc_buffer: switch to dcc buffer (create it if it does not exist)
*/
diff --git a/src/gui/gui.h b/src/gui/gui.h
index 4f44ba8d8..aca1d2620 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -263,6 +263,7 @@ extern void gui_draw_buffer_infobar (t_gui_buffer *, int);
extern void gui_draw_buffer_input (t_gui_buffer *, int);
extern void gui_redraw_buffer (t_gui_buffer *);
extern void gui_switch_to_buffer (t_gui_window *, t_gui_buffer *);
+extern t_gui_buffer *gui_get_dcc_buffer ();
extern void gui_switch_to_dcc_buffer ();
extern void gui_switch_to_previous_buffer (t_gui_window *);
extern void gui_switch_to_next_buffer (t_gui_window *);