diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2005-09-07 10:14:07 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2005-09-07 10:14:07 +0000 |
commit | 5881048405b1c4a2da0e34a38dac7f1a1a5bff72 (patch) | |
tree | 216212f3a00c66291e3f3da760b9278315b8f76a | |
parent | c517253a72336b2c5470d5320ecf4fa44384cd16 (diff) | |
download | weechat-5881048405b1c4a2da0e34a38dac7f1a1a5bff72.zip |
Fixed DCC display bug (now decodes strings according to charset)
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/gui/curses/gui-display.c | 30 | ||||
-rw-r--r-- | weechat/ChangeLog | 3 | ||||
-rw-r--r-- | weechat/src/gui/curses/gui-display.c | 30 |
4 files changed, 48 insertions, 18 deletions
@@ -1,10 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2005-09-04 +ChangeLog - 2005-09-07 Version 0.1.5 (under dev!): + * fixed DCC display bug (now decodes string according to charset) * added /ignore and /unignore commands * fixed bug with strings comparison (str[n]casecmp) and some locales (like turkish), now using ASCII comparison (thanks to roktas) diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c index df68c45d2..fd3a64ce0 100644 --- a/src/gui/curses/gui-display.c +++ b/src/gui/curses/gui-display.c @@ -691,7 +691,7 @@ 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], date[128]; + char format[32], date[128], *buf; struct tm *date_tmp; if (!gui_ok) @@ -728,11 +728,16 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase) gui_window_set_color (ptr_win->win_chat, (ptr_dcc == dcc_selected) ? COLOR_DCC_SELECTED : COLOR_WIN_CHAT); - mvwprintw (ptr_win->win_chat, i, 0, "%s %-16s %s", + mvwprintw (ptr_win->win_chat, i, 0, "%s %-16s ", (ptr_dcc == dcc_selected) ? "***" : " ", - ptr_dcc->nick, - (DCC_IS_CHAT(ptr_dcc->type)) ? - _(ptr_dcc->filename) : ptr_dcc->filename); + ptr_dcc->nick); + buf = weechat_convert_encoding (cfg_look_charset_decode, + (cfg_look_charset_internal && cfg_look_charset_internal[0]) ? + cfg_look_charset_internal : local_charset, + (DCC_IS_CHAT(ptr_dcc->type)) ? + _(ptr_dcc->filename) : ptr_dcc->filename); + wprintw (ptr_win->win_chat, "%s", buf); + free (buf); if (DCC_IS_FILE(ptr_dcc->type)) { if (ptr_dcc->filename_suffix > 0) @@ -749,8 +754,12 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase) (DCC_IS_RECV(ptr_dcc->type)) ? "-->>" : "<<--"); gui_window_set_color (ptr_win->win_chat, COLOR_DCC_WAITING + ptr_dcc->status); - wprintw (ptr_win->win_chat, "%-10s", - _(dcc_status_string[ptr_dcc->status])); + buf = weechat_convert_encoding (cfg_look_charset_decode, + (cfg_look_charset_internal && cfg_look_charset_internal[0]) ? + cfg_look_charset_internal : local_charset, + _(dcc_status_string[ptr_dcc->status])); + wprintw (ptr_win->win_chat, "%-10s", buf); + free (buf); /* other infos */ gui_window_set_color (ptr_win->win_chat, @@ -796,9 +805,14 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase) else num_unit = 3; sprintf (format, " (%s %%s/s)", unit_format[num_unit]); + buf = weechat_convert_encoding (cfg_look_charset_decode, + (cfg_look_charset_internal && cfg_look_charset_internal[0]) ? + cfg_look_charset_internal : local_charset, + unit_name[num_unit]); wprintw (ptr_win->win_chat, format, ((long double) ptr_dcc->bytes_per_sec) / ((long double)(unit_divide[num_unit])), - unit_name[num_unit]); + buf); + free (buf); } else { diff --git a/weechat/ChangeLog b/weechat/ChangeLog index e58374ef6..82215de43 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -1,10 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2005-09-04 +ChangeLog - 2005-09-07 Version 0.1.5 (under dev!): + * fixed DCC display bug (now decodes string according to charset) * added /ignore and /unignore commands * fixed bug with strings comparison (str[n]casecmp) and some locales (like turkish), now using ASCII comparison (thanks to roktas) diff --git a/weechat/src/gui/curses/gui-display.c b/weechat/src/gui/curses/gui-display.c index df68c45d2..fd3a64ce0 100644 --- a/weechat/src/gui/curses/gui-display.c +++ b/weechat/src/gui/curses/gui-display.c @@ -691,7 +691,7 @@ 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], date[128]; + char format[32], date[128], *buf; struct tm *date_tmp; if (!gui_ok) @@ -728,11 +728,16 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase) gui_window_set_color (ptr_win->win_chat, (ptr_dcc == dcc_selected) ? COLOR_DCC_SELECTED : COLOR_WIN_CHAT); - mvwprintw (ptr_win->win_chat, i, 0, "%s %-16s %s", + mvwprintw (ptr_win->win_chat, i, 0, "%s %-16s ", (ptr_dcc == dcc_selected) ? "***" : " ", - ptr_dcc->nick, - (DCC_IS_CHAT(ptr_dcc->type)) ? - _(ptr_dcc->filename) : ptr_dcc->filename); + ptr_dcc->nick); + buf = weechat_convert_encoding (cfg_look_charset_decode, + (cfg_look_charset_internal && cfg_look_charset_internal[0]) ? + cfg_look_charset_internal : local_charset, + (DCC_IS_CHAT(ptr_dcc->type)) ? + _(ptr_dcc->filename) : ptr_dcc->filename); + wprintw (ptr_win->win_chat, "%s", buf); + free (buf); if (DCC_IS_FILE(ptr_dcc->type)) { if (ptr_dcc->filename_suffix > 0) @@ -749,8 +754,12 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase) (DCC_IS_RECV(ptr_dcc->type)) ? "-->>" : "<<--"); gui_window_set_color (ptr_win->win_chat, COLOR_DCC_WAITING + ptr_dcc->status); - wprintw (ptr_win->win_chat, "%-10s", - _(dcc_status_string[ptr_dcc->status])); + buf = weechat_convert_encoding (cfg_look_charset_decode, + (cfg_look_charset_internal && cfg_look_charset_internal[0]) ? + cfg_look_charset_internal : local_charset, + _(dcc_status_string[ptr_dcc->status])); + wprintw (ptr_win->win_chat, "%-10s", buf); + free (buf); /* other infos */ gui_window_set_color (ptr_win->win_chat, @@ -796,9 +805,14 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase) else num_unit = 3; sprintf (format, " (%s %%s/s)", unit_format[num_unit]); + buf = weechat_convert_encoding (cfg_look_charset_decode, + (cfg_look_charset_internal && cfg_look_charset_internal[0]) ? + cfg_look_charset_internal : local_charset, + unit_name[num_unit]); wprintw (ptr_win->win_chat, format, ((long double) ptr_dcc->bytes_per_sec) / ((long double)(unit_divide[num_unit])), - unit_name[num_unit]); + buf); + free (buf); } else { |