summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2005-02-27 10:08:45 +0000
committerSebastien Helleu <flashcode@flashtux.org>2005-02-27 10:08:45 +0000
commit4d4d697b1790d6ffc4e00fbe9450ea5bcec3ac9b (patch)
treed57faeea8bd27cc1fa4c5d25773e9db53d41e867 /src/gui
parent3686d92cb5aa0676601f2e8ee6a2cea74e215bbd (diff)
downloadweechat-4d4d697b1790d6ffc4e00fbe9450ea5bcec3ac9b.zip
Added date/time for DCC CHAT on DCC buffer
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/curses/gui-display.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c
index 26481f740..e3c956e09 100644
--- a/src/gui/curses/gui-display.c
+++ b/src/gui/curses/gui-display.c
@@ -675,7 +675,8 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
char *unit_format[] = { "%.0Lf", "%.1Lf", "%.02Lf", "%.02Lf" };
long unit_divide[] = { 1, 1024, 1024*1024, 1024*1024,1024 };
int num_unit;
- char format[32];
+ char format[32], date[128];
+ struct tm *date_tmp;
if (!gui_ok)
return;
@@ -736,11 +737,11 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
_(dcc_status_string[ptr_dcc->status]));
/* other infos */
+ gui_window_set_color (ptr_win->win_chat,
+ (ptr_dcc == dcc_selected) ?
+ COLOR_DCC_SELECTED : COLOR_WIN_CHAT);
if (DCC_IS_FILE(ptr_dcc->type))
{
- gui_window_set_color (ptr_win->win_chat,
- (ptr_dcc == dcc_selected) ?
- COLOR_DCC_SELECTED : COLOR_WIN_CHAT);
wprintw (ptr_win->win_chat, " [");
if (ptr_dcc->size == 0)
num_bars = 10;
@@ -770,9 +771,13 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
unit_name[num_unit],
((long double) ptr_dcc->size) / ((long double)(unit_divide[num_unit])),
unit_name[num_unit]);
+ wclrtoeol (ptr_win->win_chat);
}
else
{
+ date_tmp = localtime (&(ptr_dcc->start_time));
+ strftime (date, sizeof (date) - 1, "%a, %d %b %Y %H:%M:%S", date_tmp);
+ wprintw (ptr_win->win_chat, " %s", date);
wclrtoeol (ptr_win->win_chat);
}