diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | TODO | 3 | ||||
-rw-r--r-- | configure.in | 21 | ||||
-rw-r--r-- | src/common/Makefile.am | 4 | ||||
-rw-r--r-- | src/gui/curses/gui-display.c | 15 | ||||
-rw-r--r-- | src/gui/gui-common.c | 1 | ||||
-rw-r--r-- | src/gui/gui.h | 2 | ||||
-rw-r--r-- | src/irc/irc-nick.c | 36 | ||||
-rw-r--r-- | src/irc/irc-recv.c | 11 | ||||
-rw-r--r-- | weechat/ChangeLog | 10 | ||||
-rw-r--r-- | weechat/TODO | 3 | ||||
-rw-r--r-- | weechat/configure.in | 21 | ||||
-rw-r--r-- | weechat/src/common/Makefile.am | 4 | ||||
-rw-r--r-- | weechat/src/gui/curses/gui-display.c | 15 | ||||
-rw-r--r-- | weechat/src/gui/gui-common.c | 1 | ||||
-rw-r--r-- | weechat/src/gui/gui.h | 2 | ||||
-rw-r--r-- | weechat/src/irc/irc-nick.c | 36 | ||||
-rw-r--r-- | weechat/src/irc/irc-recv.c | 11 |
18 files changed, 122 insertions, 84 deletions
@@ -1,13 +1,19 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2004-07-01 +ChangeLog - 2004-07-03 Version 0.0.7 (under dev!): - * windows management (split terminal horizontally/vertically) + * windows management improved: buffers ordered by number, split terminal + horizontally/vertically + * unique color for each nick (based on nickname) + * action messages are now considered as messages, not crappy joins/parts * fixed display bug when nicklist is displayed at bottom of screen * added history limit (text buffer & commands) + * replaced --enable-debug with --with-debug option for ./configure, which is + now integer: 1 = compiler debug flag, 2 = same 1 with verbose debug messages + in WeeChat (default: 0 = no debug) Version 0.0.6 (2004-06-05): * improved channel highlight (priority to message vs join/part) @@ -1,7 +1,7 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -TODO - 2004-07-01 +TODO - 2004-07-03 Legend: # done @@ -22,6 +22,7 @@ v0.0.7: * Interface: + split terminal in multiple windows (horizontally/vertically) + + hotlist (channels with activity) and auto-jump to channels + internationalization (traduce WeeChat in many languages) * Configuration: diff --git a/configure.in b/configure.in index 9b2abeea1..48b23d652 100644 --- a/configure.in +++ b/configure.in @@ -59,7 +59,7 @@ AC_ARG_ENABLE(curses, [ --disable-curses Turn off Curses interface (defa AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=yes,enable_gtk=no) AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=yes,enable_qt=no) AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=yes,enable_perl=no) -AC_ARG_ENABLE(debug, [ --enable-debug Turn on debugging messages (default=no)],enable_debug=yes,enable_debug=no) +AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0) enable_plugins="no" enable_python="no" @@ -108,13 +108,16 @@ fi AC_SUBST(PLUGINS_LIBS) -if test "x$enable_debug" = "xyes" ; then - AC_DEFINE(DEBUG) +if test "x$debug" = "x1" || test "x$debug" = "x2" ; then CFLAGS="-Wall -W -pipe -O2 -g" else CFLAGS="-Wall -W -pipe -O2" fi +if test "x$debug" = "x2" ; then + AC_DEFINE(DEBUG) +fi + AC_OUTPUT([Makefile src/Makefile src/common/Makefile @@ -146,6 +149,15 @@ if test "x$listgui" = "x" ; then AC_MSG_ERROR([No interface specified... Please specify at least Curses, Gtk or Qt.]) fi +msg_debug_compiler="No" +msg_debug_verbose="No" +if test "x$debug" = "x1" || test "x$debug" = "x2" ; then + msg_debug_compiler="Yes" +fi +if test "x$debug" = "x2" ; then + msg_debug_verbose="Yes" +fi + echo echo Interfaces.................... :$listgui echo @@ -154,7 +166,8 @@ echo Build with Perl support....... : $enable_perl echo Build with Python support..... : $enable_python echo Build with Ruby support....... : $enable_ruby echo -echo Print debugging messages...... : $enable_debug +echo Compile with debug info....... : $msg_debug_compiler +echo Print debugging messages...... : $msg_debug_verbose echo eval eval echo WeeChat will be installed in $bindir. echo diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 0f8531847..7ef59d69a 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -28,4 +28,6 @@ lib_weechat_main_a_SOURCES = weechat.c \ weeconfig.c \ weeconfig.h \ history.c \ - history.h + history.h \ + hotlist.c \ + hotlist.h diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c index 5aadb6c38..e9ca77e21 100644 --- a/src/gui/curses/gui-display.c +++ b/src/gui/curses/gui-display.c @@ -840,11 +840,11 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase) COLOR_WIN_STATUS); } if (SERVER(ptr_buffer)->is_connected) - wprintw (ptr_win->win_status, "[%s] ", - SERVER(ptr_buffer)->name); + wprintw (ptr_win->win_status, "%d:[%s] ", + ptr_buffer->number, SERVER(ptr_buffer)->name); else - wprintw (ptr_win->win_status, "(%s) ", - SERVER(ptr_buffer)->name); + wprintw (ptr_win->win_status, "%d:(%s) ", + ptr_buffer->number, SERVER(ptr_buffer)->name); } if (SERVER(ptr_buffer) && CHANNEL(ptr_buffer)) { @@ -880,7 +880,9 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase) gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS); } - wprintw (ptr_win->win_status, "%s", CHANNEL(ptr_buffer)->name); + wprintw (ptr_win->win_status, "%d:%s", + ptr_buffer->number, + CHANNEL(ptr_buffer)->name); if (ptr_win->buffer == CHANNEL(ptr_buffer)->buffer) { /* display channel modes */ @@ -914,7 +916,8 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase) if (!SERVER(ptr_buffer)) { gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS); - wprintw (ptr_win->win_status, _("[not connected] ")); + wprintw (ptr_win->win_status, _("%d:[not connected] "), + ptr_buffer->number); } } diff --git a/src/gui/gui-common.c b/src/gui/gui-common.c index 19fa076e0..864096918 100644 --- a/src/gui/gui-common.c +++ b/src/gui/gui-common.c @@ -145,6 +145,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int switch_to if ((new_buffer = (t_gui_buffer *)(malloc (sizeof (t_gui_buffer))))) { new_buffer->num_displayed = 0; + new_buffer->number = (gui_buffers) ? last_gui_buffer->number + 1 : 1; /* assign server and channel to buffer */ SERVER(new_buffer) = server; diff --git a/src/gui/gui.h b/src/gui/gui.h index b7d45930e..6203e2238 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -127,6 +127,8 @@ struct t_gui_buffer { int num_displayed; /* number of windows displaying buffer */ + int number; /* buffer number (for jump/switch) */ + /* server/channel */ void *server; /* buffer's server */ void *channel; /* buffer's channel */ diff --git a/src/irc/irc-nick.c b/src/irc/irc-nick.c index b553b7904..3c90c4ef6 100644 --- a/src/irc/irc-nick.c +++ b/src/irc/irc-nick.c @@ -37,34 +37,18 @@ */ int -nick_find_color (t_irc_channel *channel) +nick_find_color (t_irc_channel *channel, t_irc_nick *nick) { - int i, color_less_used, min_used; - int count_used[COLOR_WIN_NICK_NUMBER]; - t_irc_nick *ptr_nick; - - /* initialize array for counting usage of color */ - for (i = 0; i < COLOR_WIN_NICK_NUMBER; i++) - count_used[i] = 0; - - /* summarize each color usage */ - for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick) - count_used[ptr_nick->color - COLOR_WIN_NICK_FIRST]++; + int i, color; - /* look for color less used on channel */ - color_less_used = -1; - min_used = INT_MAX; - for (i = 0; i < COLOR_WIN_NICK_NUMBER; i++) + color = 0; + for (i = 0; i < strlen(nick->nick); i++) { - if (count_used[i] < min_used) - { - color_less_used = i; - min_used = count_used[i]; - } + color += (int)(nick->nick[i]); } + color = (color % COLOR_WIN_NICK_NUMBER); - return (color_less_used < 0) ? - COLOR_WIN_NICK_FIRST : COLOR_WIN_NICK_FIRST + color_less_used; + return COLOR_WIN_NICK_FIRST + color; } /* @@ -195,7 +179,7 @@ nick_new (t_irc_channel *channel, char *nick_name, if (strcasecmp (new_nick->nick, SERVER(channel->buffer)->nick) == 0) new_nick->color = COLOR_WIN_NICK_SELF; else - new_nick->color = nick_find_color (channel); + new_nick->color = nick_find_color (channel, new_nick); nick_insert_sorted (channel, new_nick); @@ -235,6 +219,10 @@ nick_change (t_irc_channel *channel, t_irc_nick *nick, char *new_nick) if (nick->nick) free (nick->nick); nick->nick = strdup (new_nick); + if (strcasecmp (nick->nick, SERVER(channel->buffer)->nick) == 0) + nick->color = COLOR_WIN_NICK_SELF; + else + nick->color = nick_find_color (channel, nick); /* insert again nick into sorted list */ nick_resort (channel, nick); diff --git a/src/irc/irc-recv.c b/src/irc/irc-recv.c index 99817174a..ae4326a2a 100644 --- a/src/irc/irc-recv.c +++ b/src/irc/irc-recv.c @@ -944,8 +944,10 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments) irc_display_prefix (ptr_channel->buffer, PREFIX_ACTION_ME); if (strstr (pos, server->nick)) { - gui_printf_color (ptr_channel->buffer, - COLOR_WIN_CHAT_HIGHLIGHT, "%s", host); + gui_printf_color_type (ptr_channel->buffer, + MSG_TYPE_MSG, + COLOR_WIN_CHAT_HIGHLIGHT, + "%s", host); if ( (cfg_look_infobar_delay_highlight > 0) && (ptr_channel->buffer != gui_current_window->buffer) ) gui_infobar_printf (cfg_look_infobar_delay_highlight, @@ -955,8 +957,9 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments) host, pos); } else - gui_printf_color (ptr_channel->buffer, - COLOR_WIN_CHAT_NICK, "%s", host); + gui_printf_color_type (ptr_channel->buffer, + MSG_TYPE_MSG, + COLOR_WIN_CHAT_NICK, "%s", host); gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT, " %s\n", pos); } diff --git a/weechat/ChangeLog b/weechat/ChangeLog index 2bc0d6b0c..f23c60e7b 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -1,13 +1,19 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2004-07-01 +ChangeLog - 2004-07-03 Version 0.0.7 (under dev!): - * windows management (split terminal horizontally/vertically) + * windows management improved: buffers ordered by number, split terminal + horizontally/vertically + * unique color for each nick (based on nickname) + * action messages are now considered as messages, not crappy joins/parts * fixed display bug when nicklist is displayed at bottom of screen * added history limit (text buffer & commands) + * replaced --enable-debug with --with-debug option for ./configure, which is + now integer: 1 = compiler debug flag, 2 = same 1 with verbose debug messages + in WeeChat (default: 0 = no debug) Version 0.0.6 (2004-06-05): * improved channel highlight (priority to message vs join/part) diff --git a/weechat/TODO b/weechat/TODO index 4975cb845..65f0628e4 100644 --- a/weechat/TODO +++ b/weechat/TODO @@ -1,7 +1,7 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -TODO - 2004-07-01 +TODO - 2004-07-03 Legend: # done @@ -22,6 +22,7 @@ v0.0.7: * Interface: + split terminal in multiple windows (horizontally/vertically) + + hotlist (channels with activity) and auto-jump to channels + internationalization (traduce WeeChat in many languages) * Configuration: diff --git a/weechat/configure.in b/weechat/configure.in index 9b2abeea1..48b23d652 100644 --- a/weechat/configure.in +++ b/weechat/configure.in @@ -59,7 +59,7 @@ AC_ARG_ENABLE(curses, [ --disable-curses Turn off Curses interface (defa AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=yes,enable_gtk=no) AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=yes,enable_qt=no) AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=yes,enable_perl=no) -AC_ARG_ENABLE(debug, [ --enable-debug Turn on debugging messages (default=no)],enable_debug=yes,enable_debug=no) +AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0) enable_plugins="no" enable_python="no" @@ -108,13 +108,16 @@ fi AC_SUBST(PLUGINS_LIBS) -if test "x$enable_debug" = "xyes" ; then - AC_DEFINE(DEBUG) +if test "x$debug" = "x1" || test "x$debug" = "x2" ; then CFLAGS="-Wall -W -pipe -O2 -g" else CFLAGS="-Wall -W -pipe -O2" fi +if test "x$debug" = "x2" ; then + AC_DEFINE(DEBUG) +fi + AC_OUTPUT([Makefile src/Makefile src/common/Makefile @@ -146,6 +149,15 @@ if test "x$listgui" = "x" ; then AC_MSG_ERROR([No interface specified... Please specify at least Curses, Gtk or Qt.]) fi +msg_debug_compiler="No" +msg_debug_verbose="No" +if test "x$debug" = "x1" || test "x$debug" = "x2" ; then + msg_debug_compiler="Yes" +fi +if test "x$debug" = "x2" ; then + msg_debug_verbose="Yes" +fi + echo echo Interfaces.................... :$listgui echo @@ -154,7 +166,8 @@ echo Build with Perl support....... : $enable_perl echo Build with Python support..... : $enable_python echo Build with Ruby support....... : $enable_ruby echo -echo Print debugging messages...... : $enable_debug +echo Compile with debug info....... : $msg_debug_compiler +echo Print debugging messages...... : $msg_debug_verbose echo eval eval echo WeeChat will be installed in $bindir. echo diff --git a/weechat/src/common/Makefile.am b/weechat/src/common/Makefile.am index 0f8531847..7ef59d69a 100644 --- a/weechat/src/common/Makefile.am +++ b/weechat/src/common/Makefile.am @@ -28,4 +28,6 @@ lib_weechat_main_a_SOURCES = weechat.c \ weeconfig.c \ weeconfig.h \ history.c \ - history.h + history.h \ + hotlist.c \ + hotlist.h diff --git a/weechat/src/gui/curses/gui-display.c b/weechat/src/gui/curses/gui-display.c index 5aadb6c38..e9ca77e21 100644 --- a/weechat/src/gui/curses/gui-display.c +++ b/weechat/src/gui/curses/gui-display.c @@ -840,11 +840,11 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase) COLOR_WIN_STATUS); } if (SERVER(ptr_buffer)->is_connected) - wprintw (ptr_win->win_status, "[%s] ", - SERVER(ptr_buffer)->name); + wprintw (ptr_win->win_status, "%d:[%s] ", + ptr_buffer->number, SERVER(ptr_buffer)->name); else - wprintw (ptr_win->win_status, "(%s) ", - SERVER(ptr_buffer)->name); + wprintw (ptr_win->win_status, "%d:(%s) ", + ptr_buffer->number, SERVER(ptr_buffer)->name); } if (SERVER(ptr_buffer) && CHANNEL(ptr_buffer)) { @@ -880,7 +880,9 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase) gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS); } - wprintw (ptr_win->win_status, "%s", CHANNEL(ptr_buffer)->name); + wprintw (ptr_win->win_status, "%d:%s", + ptr_buffer->number, + CHANNEL(ptr_buffer)->name); if (ptr_win->buffer == CHANNEL(ptr_buffer)->buffer) { /* display channel modes */ @@ -914,7 +916,8 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase) if (!SERVER(ptr_buffer)) { gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS); - wprintw (ptr_win->win_status, _("[not connected] ")); + wprintw (ptr_win->win_status, _("%d:[not connected] "), + ptr_buffer->number); } } diff --git a/weechat/src/gui/gui-common.c b/weechat/src/gui/gui-common.c index 19fa076e0..864096918 100644 --- a/weechat/src/gui/gui-common.c +++ b/weechat/src/gui/gui-common.c @@ -145,6 +145,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int switch_to if ((new_buffer = (t_gui_buffer *)(malloc (sizeof (t_gui_buffer))))) { new_buffer->num_displayed = 0; + new_buffer->number = (gui_buffers) ? last_gui_buffer->number + 1 : 1; /* assign server and channel to buffer */ SERVER(new_buffer) = server; diff --git a/weechat/src/gui/gui.h b/weechat/src/gui/gui.h index b7d45930e..6203e2238 100644 --- a/weechat/src/gui/gui.h +++ b/weechat/src/gui/gui.h @@ -127,6 +127,8 @@ struct t_gui_buffer { int num_displayed; /* number of windows displaying buffer */ + int number; /* buffer number (for jump/switch) */ + /* server/channel */ void *server; /* buffer's server */ void *channel; /* buffer's channel */ diff --git a/weechat/src/irc/irc-nick.c b/weechat/src/irc/irc-nick.c index b553b7904..3c90c4ef6 100644 --- a/weechat/src/irc/irc-nick.c +++ b/weechat/src/irc/irc-nick.c @@ -37,34 +37,18 @@ */ int -nick_find_color (t_irc_channel *channel) +nick_find_color (t_irc_channel *channel, t_irc_nick *nick) { - int i, color_less_used, min_used; - int count_used[COLOR_WIN_NICK_NUMBER]; - t_irc_nick *ptr_nick; - - /* initialize array for counting usage of color */ - for (i = 0; i < COLOR_WIN_NICK_NUMBER; i++) - count_used[i] = 0; - - /* summarize each color usage */ - for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick) - count_used[ptr_nick->color - COLOR_WIN_NICK_FIRST]++; + int i, color; - /* look for color less used on channel */ - color_less_used = -1; - min_used = INT_MAX; - for (i = 0; i < COLOR_WIN_NICK_NUMBER; i++) + color = 0; + for (i = 0; i < strlen(nick->nick); i++) { - if (count_used[i] < min_used) - { - color_less_used = i; - min_used = count_used[i]; - } + color += (int)(nick->nick[i]); } + color = (color % COLOR_WIN_NICK_NUMBER); - return (color_less_used < 0) ? - COLOR_WIN_NICK_FIRST : COLOR_WIN_NICK_FIRST + color_less_used; + return COLOR_WIN_NICK_FIRST + color; } /* @@ -195,7 +179,7 @@ nick_new (t_irc_channel *channel, char *nick_name, if (strcasecmp (new_nick->nick, SERVER(channel->buffer)->nick) == 0) new_nick->color = COLOR_WIN_NICK_SELF; else - new_nick->color = nick_find_color (channel); + new_nick->color = nick_find_color (channel, new_nick); nick_insert_sorted (channel, new_nick); @@ -235,6 +219,10 @@ nick_change (t_irc_channel *channel, t_irc_nick *nick, char *new_nick) if (nick->nick) free (nick->nick); nick->nick = strdup (new_nick); + if (strcasecmp (nick->nick, SERVER(channel->buffer)->nick) == 0) + nick->color = COLOR_WIN_NICK_SELF; + else + nick->color = nick_find_color (channel, nick); /* insert again nick into sorted list */ nick_resort (channel, nick); diff --git a/weechat/src/irc/irc-recv.c b/weechat/src/irc/irc-recv.c index 99817174a..ae4326a2a 100644 --- a/weechat/src/irc/irc-recv.c +++ b/weechat/src/irc/irc-recv.c @@ -944,8 +944,10 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments) irc_display_prefix (ptr_channel->buffer, PREFIX_ACTION_ME); if (strstr (pos, server->nick)) { - gui_printf_color (ptr_channel->buffer, - COLOR_WIN_CHAT_HIGHLIGHT, "%s", host); + gui_printf_color_type (ptr_channel->buffer, + MSG_TYPE_MSG, + COLOR_WIN_CHAT_HIGHLIGHT, + "%s", host); if ( (cfg_look_infobar_delay_highlight > 0) && (ptr_channel->buffer != gui_current_window->buffer) ) gui_infobar_printf (cfg_look_infobar_delay_highlight, @@ -955,8 +957,9 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments) host, pos); } else - gui_printf_color (ptr_channel->buffer, - COLOR_WIN_CHAT_NICK, "%s", host); + gui_printf_color_type (ptr_channel->buffer, + MSG_TYPE_MSG, + COLOR_WIN_CHAT_NICK, "%s", host); gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT, " %s\n", pos); } |