Added /buffer command, jump to buffer by number (alt-digit), actions now ok in private buffers
parent
9e6938bdf7
commit
f02ba717a0
|
@ -1,12 +1,13 @@
|
|||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2004-07-03
|
||||
ChangeLog - 2004-07-04
|
||||
|
||||
|
||||
Version 0.0.7 (under dev!):
|
||||
* buffers ordered by number, auto-switch to active buffers (alt-a)
|
||||
* split terminal horizontally/vertically
|
||||
* /buffer command added, buffers ordered by number, auto-jump to active
|
||||
buffers (alt-a), jump to buffers by number (alt-number)
|
||||
* /window command added, 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
|
||||
|
|
17
TODO
17
TODO
|
@ -1,7 +1,7 @@
|
|||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
TODO - 2004-07-03
|
||||
TODO - 2004-07-04
|
||||
|
||||
Legend:
|
||||
# done
|
||||
|
@ -21,8 +21,12 @@ v0.0.7:
|
|||
+ "/dcc" command (for chat and sending/receiving files)
|
||||
|
||||
* Interface:
|
||||
+ split terminal in multiple windows (horizontally/vertically)
|
||||
+ hotlist (channels with activity) and auto-switch to channels
|
||||
+ "/buffer" command, buffers ordered by number, auto-jump to active
|
||||
buffers (alt-a), jump to buffers by number (alt-number)
|
||||
+ "/window" command, split terminal in multiple windows
|
||||
(horizontally/vertically)
|
||||
# forget some old lines that were displayed long time ago (now all is saved,
|
||||
if WeeChat is running for long time, a lot of memory is used!)
|
||||
+ internationalization (traduce WeeChat in many languages)
|
||||
|
||||
* Configuration:
|
||||
|
@ -63,10 +67,7 @@ Future versions:
|
|||
+ Gtk GUI
|
||||
- color for nicks (except own nick) when nick colors are disabled
|
||||
- interpret special chars in messages (color & bold for example)
|
||||
- many channel windows in one window/term (window split)
|
||||
- add lag indicator
|
||||
- forget some old lines that were displayed long time ago (now all is saved,
|
||||
if WeeChat is running for long time, a lot of memory is used!)
|
||||
- improve completion (for example complete command parameters when possible)
|
||||
- understand incomplete commands if unambigous (for example: /he for /help is ok)
|
||||
- tab key with empty command line should switch to next window (like F7)
|
||||
|
@ -79,10 +80,6 @@ Future versions:
|
|||
- SSL support
|
||||
- IPv6 protocol implementation
|
||||
|
||||
* Configuration:
|
||||
- load config file after GUI (so init values by default (colors, ...) before
|
||||
loading config)
|
||||
|
||||
* Plugins:
|
||||
- Python plugin
|
||||
- "/python load" and "/python unload" commands to (un)load Python scripts
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
@title WeeChat - User guide
|
||||
@subtitle Fast, light and extensible IRC client
|
||||
@subtitle Documentation for WeeChat v0.0.6 - June, 12 2004
|
||||
@subtitle Documentation for WeeChat v0.0.7 - July, 04 2004
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
|
@ -343,12 +343,12 @@ Type: color (Curses or Gtk color), default value: 'default'@*
|
|||
@item col_status
|
||||
Color for status bar@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_status_active
|
||||
Color for active window (status bar)@*
|
||||
Type: color (Curses or Gtk color), default value: 'yellow'@*
|
||||
@item col_status_data_msg
|
||||
Color for window with new messages (status bar)@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightred'@*
|
||||
@item col_status_highlight
|
||||
Color for window with highlight (status bar)@*
|
||||
Type: color (Curses or Gtk color), default value: 'yellow'@*
|
||||
@item col_status_data_other
|
||||
Color for window with new data (not messages) (status bar)@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
|
||||
|
@ -572,14 +572,23 @@ Execute command or send message@*
|
|||
Call again last commands/messages@*
|
||||
@*
|
||||
@item PageUp / PageDown
|
||||
Show window history@*
|
||||
Show buffer history@*
|
||||
@*
|
||||
@item F6 / F7
|
||||
Switch to previous / next window@*
|
||||
Switch to previous / next buffer@*
|
||||
@*
|
||||
@item F8
|
||||
Switch to next window@*
|
||||
@*
|
||||
@item Alt + left arrow / Alt + right arrow
|
||||
Same as F6 / F7@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Switch to next buffer with activity (with priority: highlight, message, other)@*
|
||||
@*
|
||||
@item Alt + digit (1-9)
|
||||
Switch to buffer by number@*
|
||||
@*
|
||||
@item F10
|
||||
Remove last infobar message@*
|
||||
@*
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
@title WeeChat - Guide utilisateur
|
||||
@subtitle Client IRC rapide, l@'eger et extensible
|
||||
@subtitle Documentation pour WeeChat v0.0.6 - 12 juin 2004
|
||||
@subtitle Documentation pour WeeChat v0.0.7 - 04 juillet 2004
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
|
@ -343,12 +343,12 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
|
|||
@item col_status
|
||||
Couleur pour la barre de statut@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_status_active
|
||||
Couleur pour la fen@^etre active (barre de statut)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
|
||||
@item col_status_data_msg
|
||||
Couleur pour une fen@^etre avec de nouvelles infos (barre de statut)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightred'@*
|
||||
@item col_status_highlight
|
||||
Color for window with highlight (status bar)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
|
||||
@item col_status_data_other
|
||||
Couleur pour une fen@^etre avec des nouvelles donn@'ees (pas des infos) (barre de statut)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
|
||||
|
@ -572,14 +572,23 @@ Ex@'ecuter la commande ou envoyer le message@*
|
|||
Rappeler les derni@`eres commandes/messages@*
|
||||
@*
|
||||
@item PageUp / PageDown
|
||||
Afficher l'historique de la fen@^etre@*
|
||||
Afficher l'historique du tampon@*
|
||||
@*
|
||||
@item F6 / F7
|
||||
Aller @`a la fen@^etre pr@'ec@'edente / suivante@*
|
||||
Aller au tampon pr@'ec@'edent@*
|
||||
@*
|
||||
@item F8
|
||||
Aller @`a la fen@^etre suivante@*
|
||||
@*
|
||||
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
|
||||
Identique @`a F6 / F7@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Sauter au tampon avec activit@'e (avec priorit@'e: highlight, message, autre)@*
|
||||
@*
|
||||
@item Alt + chiffre (1-9)
|
||||
Sauter au tampon avec ce num@'ero@*
|
||||
@*
|
||||
@item F10
|
||||
Effacer le dernier message de la barre d'infos@*
|
||||
@*
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
@title WeeChat - Guia do Utilizador
|
||||
@subtitle Cliente de IRC rapido, leve e extencivel
|
||||
@subtitle Documenta@,{c}@~ao do WeeChat v0.0.6 - 12 de Junho de 2004
|
||||
@subtitle Documenta@,{c}@~ao do WeeChat v0.0.7 - 04 de Julho de 2004
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
|
@ -277,6 +277,12 @@ Ir para a janela anterior/seguinte@*
|
|||
@item Alt + Seta da esquerda / Alt + Seta da direita
|
||||
Identico a F6 / F7@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Comute ao amortecedor seguinte com atividade (com prioridade: destaque, mensagem, outra)@*
|
||||
@*
|
||||
@item Alt + d@'igito (1-9)
|
||||
Comute ao amortecedor pelo n@'umero@*
|
||||
@*
|
||||
@item F10
|
||||
Apagar a @'ultima mensagem da barra do info@*
|
||||
@*
|
||||
|
|
430
po/weechat.pot
430
po/weechat.pot
File diff suppressed because it is too large
Load Diff
|
@ -43,6 +43,13 @@ t_weechat_command weechat_commands[] =
|
|||
N_("alias_name: name of alias\ncommand: command name (WeeChat "
|
||||
"or IRC command, without first '/')\n" "arguments: arguments for command"),
|
||||
0, MAX_ARGS, NULL, weechat_cmd_alias },
|
||||
{ "buffer", N_("manage buffers"),
|
||||
N_("[action | number]"),
|
||||
N_("action: action to do:\n"
|
||||
" move move buffer in the list (may be relative, for example -1)\n"
|
||||
" list list opened buffers (no parameter implies this list)\n"
|
||||
"number: jump to buffer by number"),
|
||||
0, MAX_ARGS, weechat_cmd_buffer, NULL },
|
||||
{ "clear", N_("clear window(s)"),
|
||||
N_("[-all]"),
|
||||
N_("-all: clear all windows"),
|
||||
|
@ -77,7 +84,7 @@ t_weechat_command weechat_commands[] =
|
|||
"nick2: alternate nick for server\n"
|
||||
"nick3: second alternate nick for server\n"
|
||||
"username: user name\n"
|
||||
"realname: real name of user\n"),
|
||||
"realname: real name of user"),
|
||||
0, MAX_ARGS, weechat_cmd_server, NULL },
|
||||
{ "save", N_("save config to disk"),
|
||||
N_("[file]"), N_("file: filename for writing config"),
|
||||
|
@ -818,6 +825,49 @@ weechat_cmd_alias (char *arguments)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_buffer: manage buffers
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_cmd_buffer (int argc, char **argv)
|
||||
{
|
||||
int number;
|
||||
char *error;
|
||||
|
||||
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
|
||||
{
|
||||
/* list opened bufferss */
|
||||
gui_printf (NULL, "buffer list -- NOT DEVELOPED!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcasecmp (argv[0], "move") == 0)
|
||||
{
|
||||
/* move buffer to another number in the list */
|
||||
gui_printf (NULL, "buffer move -- NOT DEVELOPED!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
number = strtol (argv[0], &error, 10);
|
||||
if (error)
|
||||
{
|
||||
gui_printf (NULL, _("%s incorrect buffer number\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
}
|
||||
if (!gui_switch_to_buffer_by_number (gui_current_window, number))
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s buffer \"%s\" not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[0], "buffer");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_clear: display or create alias
|
||||
*/
|
||||
|
@ -1495,7 +1545,7 @@ weechat_cmd_set (char *arguments)
|
|||
if (ptr_option->handler_change == NULL)
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s option '%s' can not be changed while WeeChat is running\n"),
|
||||
_("%s option \"%s\" can not be changed while WeeChat is running\n"),
|
||||
WEECHAT_ERROR, option);
|
||||
}
|
||||
else
|
||||
|
@ -1507,13 +1557,13 @@ weechat_cmd_set (char *arguments)
|
|||
gui_printf (NULL, " %s = %s\n", option, value);
|
||||
}
|
||||
else
|
||||
gui_printf (NULL, _("%s incorrect value for option '%s'\n"),
|
||||
gui_printf (NULL, _("%s incorrect value for option \"%s\"\n"),
|
||||
WEECHAT_ERROR, option);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf (NULL, _("%s config option '%s' not found\n"),
|
||||
gui_printf (NULL, _("%s config option \"%s\" not found\n"),
|
||||
WEECHAT_ERROR, option);
|
||||
}
|
||||
}
|
||||
|
@ -1583,15 +1633,15 @@ weechat_cmd_set (char *arguments)
|
|||
if (number_found == 0)
|
||||
{
|
||||
if (value)
|
||||
gui_printf (NULL, _("No config option found with '%s'\n"),
|
||||
gui_printf (NULL, _("No config option found with \"%s\"\n"),
|
||||
value);
|
||||
else
|
||||
gui_printf (NULL, _("No config option found with '%s'\n"));
|
||||
gui_printf (NULL, _("No config option found with \"%s\"\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value)
|
||||
gui_printf (NULL, _("%d config option(s) found with '%s'\n"),
|
||||
gui_printf (NULL, _("%d config option(s) found with \"%s\"\n"),
|
||||
number_found, value);
|
||||
else
|
||||
gui_printf (NULL, _("%d config option(s) found\n"),
|
||||
|
@ -1635,9 +1685,6 @@ weechat_cmd_unalias (char *arguments)
|
|||
int
|
||||
weechat_cmd_window (int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
t_irc_server server, *ptr_server, *server_found, *new_server;
|
||||
|
||||
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
|
||||
{
|
||||
/* list opened windows */
|
||||
|
@ -1656,7 +1703,11 @@ weechat_cmd_window (int argc, char **argv)
|
|||
gui_window_split_vertic (gui_current_window);
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s unknown option for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "window");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,6 +67,7 @@ extern t_weechat_alias *alias_new (char *, char *);
|
|||
extern int exec_weechat_command (t_irc_server *, char *);
|
||||
extern void user_command (t_irc_server *, char *);
|
||||
extern int weechat_cmd_alias (char *);
|
||||
extern int weechat_cmd_buffer (int, char **);
|
||||
extern int weechat_cmd_clear (int, char **);
|
||||
extern int weechat_cmd_connect (int, char **);
|
||||
extern int weechat_cmd_disconnect (int, char **);
|
||||
|
|
|
@ -482,8 +482,8 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int stop_at_end)
|
|||
|
||||
/* insert spaces for align text under time/nick */
|
||||
if ((window->win_chat_cursor_x == 0) &&
|
||||
(ptr_message->type != MSG_TYPE_TIME) &&
|
||||
(ptr_message->type != MSG_TYPE_NICK) &&
|
||||
(!(ptr_message->type & MSG_TYPE_TIME)) &&
|
||||
(!(ptr_message->type & MSG_TYPE_NICK)) &&
|
||||
(line->length_align > 0) &&
|
||||
/* TODO: modify arbitraty value for non aligning messages on time/nick? */
|
||||
(line->length_align < (window->win_chat_width - 5)))
|
||||
|
@ -805,12 +805,17 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
|||
wrefresh (ptr_win->win_status);
|
||||
}
|
||||
wmove (ptr_win->win_status, 0, 0);
|
||||
|
||||
/* display number of buffers */
|
||||
gui_window_set_color (ptr_win->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (ptr_win->win_status, "[%d] ",
|
||||
(last_gui_buffer) ? last_gui_buffer->number : 0);
|
||||
|
||||
/* display current server */
|
||||
if (SERVER(ptr_win->buffer) && SERVER(ptr_win->buffer)->name)
|
||||
{
|
||||
gui_window_set_color (ptr_win->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (ptr_win->win_status, "[%s] ", SERVER(ptr_win->buffer)->name);
|
||||
}
|
||||
|
||||
if (SERVER(ptr_win->buffer) && !CHANNEL(ptr_win->buffer))
|
||||
{
|
||||
gui_window_set_color (ptr_win->win_status,
|
||||
|
@ -870,7 +875,7 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
|||
if (hotlist)
|
||||
{
|
||||
gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS);
|
||||
wprintw (ptr_win->win_status, _("Act: "));
|
||||
wprintw (ptr_win->win_status, _("[Act: "));
|
||||
for (ptr_hotlist = hotlist; ptr_hotlist;
|
||||
ptr_hotlist = ptr_hotlist->next_hotlist)
|
||||
{
|
||||
|
@ -896,6 +901,9 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
|||
if (ptr_hotlist->next_hotlist)
|
||||
wprintw (ptr_win->win_status, ",");
|
||||
}
|
||||
gui_window_set_color (ptr_win->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (ptr_win->win_status, "]");
|
||||
}
|
||||
|
||||
/* display "-MORE-" if last line is not displayed */
|
||||
|
@ -1215,7 +1223,6 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
|
|||
window->win_status = newwin (1, window->win_width, window->win_y + window->win_height - 2, window->win_x);
|
||||
|
||||
buffer->num_displayed++;
|
||||
buffer->unread_data = 0;
|
||||
|
||||
hotlist_remove_buffer (buffer);
|
||||
}
|
||||
|
@ -1301,8 +1308,6 @@ gui_move_page_down (t_gui_window *window)
|
|||
window->sub_lines -= window->win_chat_height - 1;
|
||||
if (window->sub_lines < 0)
|
||||
window->sub_lines = 0;
|
||||
if (window->sub_lines == 0)
|
||||
window->buffer->unread_data = 0;
|
||||
gui_draw_buffer_chat (window->buffer, 0);
|
||||
gui_draw_buffer_status (window->buffer, 0);
|
||||
}
|
||||
|
@ -1344,7 +1349,7 @@ gui_curses_resize_handler ()
|
|||
}
|
||||
|
||||
/*
|
||||
* gui_view_init_subviews: init subviews for a WeeChat view
|
||||
* gui_window_init_subviews: init subviews for a WeeChat window
|
||||
*/
|
||||
|
||||
void
|
||||
|
@ -1661,9 +1666,11 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
|
|||
buffer->last_line->last_message->message = strdup (message);
|
||||
length = strlen (message);
|
||||
buffer->last_line->length += length;
|
||||
if (type == MSG_TYPE_MSG)
|
||||
if (type & MSG_TYPE_MSG)
|
||||
buffer->last_line->line_with_message = 1;
|
||||
if ((type == MSG_TYPE_TIME) || (type == MSG_TYPE_NICK))
|
||||
if (type & MSG_TYPE_HIGHLIGHT)
|
||||
buffer->last_line->line_with_highlight = 1;
|
||||
if ((type & MSG_TYPE_TIME) || (type & MSG_TYPE_NICK))
|
||||
buffer->last_line->length_align += length;
|
||||
if (pos)
|
||||
{
|
||||
|
@ -1677,14 +1684,12 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
|
|||
/*else
|
||||
gui_display_line (buffer, buffer->last_line, 1);*/
|
||||
}
|
||||
if ((buffer->num_displayed == 0) || (gui_current_window->sub_lines > 0))
|
||||
if (buffer->num_displayed == 0)
|
||||
{
|
||||
if (buffer->unread_data < 1 + buffer->last_line->line_with_message)
|
||||
{
|
||||
buffer->unread_data = 1 + buffer->last_line->line_with_message;
|
||||
hotlist_add (buffer->last_line->line_with_message, buffer);
|
||||
gui_draw_buffer_status (buffer, 1);
|
||||
}
|
||||
hotlist_add (buffer->last_line->line_with_message +
|
||||
buffer->last_line->line_with_highlight,
|
||||
buffer);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -299,6 +299,8 @@ gui_read_keyb ()
|
|||
case KEY_ESCAPE:
|
||||
if ((key = getch()) != ERR)
|
||||
{
|
||||
/*gui_printf (gui_current_window->buffer,
|
||||
"[Debug] key pressed = %d, as octal: %o\n", key, key);*/
|
||||
switch (key)
|
||||
{
|
||||
case KEY_LEFT:
|
||||
|
@ -327,6 +329,18 @@ gui_read_keyb ()
|
|||
}
|
||||
}
|
||||
break;
|
||||
/* Alt-number */
|
||||
case 49: /* Alt-1 */
|
||||
case 50: /* Alt-2 */
|
||||
case 51: /* Alt-3 */
|
||||
case 52: /* Alt-4 */
|
||||
case 53: /* Alt-5 */
|
||||
case 54: /* Alt-6 */
|
||||
case 55: /* Alt-7 */
|
||||
case 56: /* Alt-8 */
|
||||
case 57: /* Alt-9 */
|
||||
gui_switch_to_buffer_by_number (gui_current_window, key - 48);
|
||||
break;
|
||||
/* Alt-A */
|
||||
case 'a':
|
||||
case 'A':
|
||||
|
|
|
@ -145,7 +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;
|
||||
new_buffer->number = (last_gui_buffer) ? last_gui_buffer->number + 1 : 1;
|
||||
|
||||
/* assign server and channel to buffer */
|
||||
SERVER(new_buffer) = server;
|
||||
|
@ -157,21 +157,19 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int switch_to
|
|||
CHANNEL(new_buffer)->buffer = new_buffer;
|
||||
|
||||
if (!window->buffer)
|
||||
{
|
||||
window->buffer = new_buffer;
|
||||
window->first_line_displayed = 1;
|
||||
window->sub_lines = 0;
|
||||
|
||||
gui_calculate_pos_size (window);
|
||||
|
||||
/* init buffers */
|
||||
gui_window_init_subwindows (window);
|
||||
window->first_line_displayed = 1;
|
||||
window->sub_lines = 0;
|
||||
gui_calculate_pos_size (window);
|
||||
gui_window_init_subwindows (window);
|
||||
}
|
||||
|
||||
/* init lines */
|
||||
new_buffer->lines = NULL;
|
||||
new_buffer->last_line = NULL;
|
||||
new_buffer->num_lines = 0;
|
||||
new_buffer->line_complete = 1;
|
||||
new_buffer->unread_data = 0;
|
||||
|
||||
/* init input buffer */
|
||||
new_buffer->input_buffer_alloc = INPUT_BUFFER_BLOCK_SIZE;
|
||||
|
@ -242,7 +240,6 @@ gui_buffer_clear (t_gui_buffer *buffer)
|
|||
buffer->last_line = NULL;
|
||||
buffer->num_lines = 0;
|
||||
buffer->line_complete = 1;
|
||||
buffer->unread_data = 0;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
|
@ -407,6 +404,7 @@ gui_new_line (t_gui_buffer *buffer)
|
|||
new_line->length = 0;
|
||||
new_line->length_align = 0;
|
||||
new_line->line_with_message = 0;
|
||||
new_line->line_with_highlight = 0;
|
||||
new_line->messages = NULL;
|
||||
new_line->last_message = NULL;
|
||||
if (!buffer->lines)
|
||||
|
@ -624,3 +622,31 @@ gui_buffer_insert_string (t_gui_buffer *buffer, char *string, int pos)
|
|||
/* insert new string */
|
||||
strncpy (buffer->input_buffer + pos, string, length);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_buffer_by_number: switch to another buffer with number
|
||||
*/
|
||||
|
||||
t_gui_buffer *
|
||||
gui_switch_to_buffer_by_number (t_gui_window *window, int number)
|
||||
{
|
||||
t_gui_buffer *ptr_buffer;
|
||||
|
||||
/* buffer is currently displayed ? */
|
||||
if (number == window->buffer->number)
|
||||
return window->buffer;
|
||||
|
||||
/* search for buffer in the list */
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
if ((ptr_buffer != window->buffer) && (number == ptr_buffer->number))
|
||||
{
|
||||
gui_switch_to_buffer (window, ptr_buffer);
|
||||
gui_redraw_buffer (window->buffer);
|
||||
return ptr_buffer;
|
||||
}
|
||||
}
|
||||
|
||||
/* buffer not found */
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -66,10 +66,11 @@
|
|||
#define BUFFER_IS_CHANNEL(buffer) (CHANNEL(buffer) && (CHANNEL(buffer)->type == CHAT_CHANNEL))
|
||||
#define BUFFER_IS_PRIVATE(buffer) (CHANNEL(buffer) && (CHANNEL(buffer)->type == CHAT_PRIVATE))
|
||||
|
||||
#define MSG_TYPE_TIME 0
|
||||
#define MSG_TYPE_NICK 1
|
||||
#define MSG_TYPE_INFO 2
|
||||
#define MSG_TYPE_MSG 3
|
||||
#define MSG_TYPE_TIME 1
|
||||
#define MSG_TYPE_NICK 2
|
||||
#define MSG_TYPE_INFO 4
|
||||
#define MSG_TYPE_MSG 8
|
||||
#define MSG_TYPE_HIGHLIGHT 16
|
||||
|
||||
#define gui_printf_color(buffer, color, fmt, argz...) \
|
||||
gui_printf_color_type(buffer, MSG_TYPE_INFO, color, fmt, ##argz)
|
||||
|
@ -95,6 +96,7 @@ struct t_gui_line
|
|||
int length; /* length of the line (in char) */
|
||||
int length_align; /* alignment length (time or time/nick) */
|
||||
int line_with_message; /* line contains a message from a user? */
|
||||
int line_with_highlight; /* line contains highlight */
|
||||
t_gui_message *messages; /* messages for the line */
|
||||
t_gui_message *last_message; /* last message of the line */
|
||||
t_gui_line *prev_line; /* link to previous line */
|
||||
|
@ -138,7 +140,6 @@ struct t_gui_buffer
|
|||
t_gui_line *last_line; /* last line of chat window */
|
||||
int num_lines; /* number of lines in the window */
|
||||
int line_complete; /* current line complete ? (\n ending) */
|
||||
int unread_data; /* highlight windows with unread data */
|
||||
|
||||
/* inupt buffer */
|
||||
char *input_buffer; /* input buffer */
|
||||
|
@ -235,6 +236,7 @@ extern void gui_delete_previous_word (t_gui_buffer *);
|
|||
extern void gui_move_previous_word (t_gui_buffer *);
|
||||
extern void gui_move_next_word (t_gui_buffer *);
|
||||
extern void gui_buffer_insert_string (t_gui_buffer *, char *, int);
|
||||
extern t_gui_buffer *gui_switch_to_buffer_by_number (t_gui_window *, int);
|
||||
/* GUI dependant functions */
|
||||
extern int gui_assign_color (int *, char *);
|
||||
extern int gui_get_color_by_name (char *);
|
||||
|
|
|
@ -945,10 +945,11 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
|||
if (strstr (pos, server->nick))
|
||||
{
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
MSG_TYPE_MSG | MSG_TYPE_HIGHLIGHT,
|
||||
COLOR_WIN_CHAT_HIGHLIGHT,
|
||||
"%s", host);
|
||||
if ( (cfg_look_infobar_delay_highlight > 0)
|
||||
if ( (cfg_look_infobar)
|
||||
&& (cfg_look_infobar_delay_highlight > 0)
|
||||
&& (ptr_channel->buffer != gui_current_window->buffer) )
|
||||
gui_infobar_printf (cfg_look_infobar_delay_highlight,
|
||||
COLOR_WIN_INFOBAR_HIGHLIGHT,
|
||||
|
@ -971,8 +972,10 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
|||
if (strstr (pos, server->nick))
|
||||
{
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick,
|
||||
MSG_TYPE_NICK, 1, -1, 0);
|
||||
if ( (cfg_look_infobar_delay_highlight > 0)
|
||||
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
|
||||
1, -1, 0);
|
||||
if ( (cfg_look_infobar)
|
||||
&& (cfg_look_infobar_delay_highlight > 0)
|
||||
&& (ptr_channel->buffer != gui_current_window->buffer) )
|
||||
gui_infobar_printf (cfg_look_infobar_delay_highlight,
|
||||
COLOR_WIN_INFOBAR_HIGHLIGHT,
|
||||
|
@ -1157,38 +1160,67 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
|||
}
|
||||
}
|
||||
if (!ptr_channel->topic)
|
||||
{
|
||||
ptr_channel->topic = strdup (host2);
|
||||
gui_draw_buffer_title (ptr_channel->buffer, 1);
|
||||
}
|
||||
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "<");
|
||||
if (strstr (pos, server->nick))
|
||||
if (strncmp (pos, "\01ACTION ", 8) == 0)
|
||||
{
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
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,
|
||||
COLOR_WIN_INFOBAR_HIGHLIGHT,
|
||||
_("Private %s> %s"),
|
||||
host, pos);
|
||||
pos += 8;
|
||||
pos2 = strchr (pos, '\01');
|
||||
if (pos2)
|
||||
pos2[0] = '\0';
|
||||
irc_display_prefix (ptr_channel->buffer, PREFIX_ACTION_ME);
|
||||
if (strstr (pos, server->nick))
|
||||
{
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG | MSG_TYPE_HIGHLIGHT,
|
||||
COLOR_WIN_CHAT_HIGHLIGHT,
|
||||
"%s", host);
|
||||
if ( (cfg_look_infobar)
|
||||
&& (cfg_look_infobar_delay_highlight > 0)
|
||||
&& (ptr_channel->buffer != gui_current_window->buffer) )
|
||||
gui_infobar_printf (cfg_look_infobar_delay_highlight,
|
||||
COLOR_WIN_INFOBAR_HIGHLIGHT,
|
||||
_("On %s: * %s %s"),
|
||||
ptr_channel->name,
|
||||
host, pos);
|
||||
}
|
||||
else
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_NICK_PRIVATE,
|
||||
"%s", host);
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "> ");
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
COLOR_WIN_CHAT, "%s\n", pos);
|
||||
COLOR_WIN_CHAT_DARK, "<");
|
||||
if (strstr (pos, server->nick))
|
||||
{
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
|
||||
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,
|
||||
COLOR_WIN_INFOBAR_HIGHLIGHT,
|
||||
_("Private %s> %s"),
|
||||
host, pos);
|
||||
}
|
||||
else
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_NICK_PRIVATE,
|
||||
"%s", host);
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "> ");
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
COLOR_WIN_CHAT, "%s\n", pos);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2004-07-03
|
||||
ChangeLog - 2004-07-04
|
||||
|
||||
|
||||
Version 0.0.7 (under dev!):
|
||||
* buffers ordered by number, auto-switch to active buffers (alt-a)
|
||||
* split terminal horizontally/vertically
|
||||
* /buffer command added, buffers ordered by number, auto-jump to active
|
||||
buffers (alt-a), jump to buffers by number (alt-number)
|
||||
* /window command added, 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
|
||||
|
|
17
weechat/TODO
17
weechat/TODO
|
@ -1,7 +1,7 @@
|
|||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
TODO - 2004-07-03
|
||||
TODO - 2004-07-04
|
||||
|
||||
Legend:
|
||||
# done
|
||||
|
@ -21,8 +21,12 @@ v0.0.7:
|
|||
+ "/dcc" command (for chat and sending/receiving files)
|
||||
|
||||
* Interface:
|
||||
+ split terminal in multiple windows (horizontally/vertically)
|
||||
+ hotlist (channels with activity) and auto-switch to channels
|
||||
+ "/buffer" command, buffers ordered by number, auto-jump to active
|
||||
buffers (alt-a), jump to buffers by number (alt-number)
|
||||
+ "/window" command, split terminal in multiple windows
|
||||
(horizontally/vertically)
|
||||
# forget some old lines that were displayed long time ago (now all is saved,
|
||||
if WeeChat is running for long time, a lot of memory is used!)
|
||||
+ internationalization (traduce WeeChat in many languages)
|
||||
|
||||
* Configuration:
|
||||
|
@ -63,10 +67,7 @@ Future versions:
|
|||
+ Gtk GUI
|
||||
- color for nicks (except own nick) when nick colors are disabled
|
||||
- interpret special chars in messages (color & bold for example)
|
||||
- many channel windows in one window/term (window split)
|
||||
- add lag indicator
|
||||
- forget some old lines that were displayed long time ago (now all is saved,
|
||||
if WeeChat is running for long time, a lot of memory is used!)
|
||||
- improve completion (for example complete command parameters when possible)
|
||||
- understand incomplete commands if unambigous (for example: /he for /help is ok)
|
||||
- tab key with empty command line should switch to next window (like F7)
|
||||
|
@ -79,10 +80,6 @@ Future versions:
|
|||
- SSL support
|
||||
- IPv6 protocol implementation
|
||||
|
||||
* Configuration:
|
||||
- load config file after GUI (so init values by default (colors, ...) before
|
||||
loading config)
|
||||
|
||||
* Plugins:
|
||||
- Python plugin
|
||||
- "/python load" and "/python unload" commands to (un)load Python scripts
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
@title WeeChat - User guide
|
||||
@subtitle Fast, light and extensible IRC client
|
||||
@subtitle Documentation for WeeChat v0.0.6 - June, 12 2004
|
||||
@subtitle Documentation for WeeChat v0.0.7 - July, 04 2004
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
|
@ -343,12 +343,12 @@ Type: color (Curses or Gtk color), default value: 'default'@*
|
|||
@item col_status
|
||||
Color for status bar@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_status_active
|
||||
Color for active window (status bar)@*
|
||||
Type: color (Curses or Gtk color), default value: 'yellow'@*
|
||||
@item col_status_data_msg
|
||||
Color for window with new messages (status bar)@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightred'@*
|
||||
@item col_status_highlight
|
||||
Color for window with highlight (status bar)@*
|
||||
Type: color (Curses or Gtk color), default value: 'yellow'@*
|
||||
@item col_status_data_other
|
||||
Color for window with new data (not messages) (status bar)@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
|
||||
|
@ -572,14 +572,23 @@ Execute command or send message@*
|
|||
Call again last commands/messages@*
|
||||
@*
|
||||
@item PageUp / PageDown
|
||||
Show window history@*
|
||||
Show buffer history@*
|
||||
@*
|
||||
@item F6 / F7
|
||||
Switch to previous / next window@*
|
||||
Switch to previous / next buffer@*
|
||||
@*
|
||||
@item F8
|
||||
Switch to next window@*
|
||||
@*
|
||||
@item Alt + left arrow / Alt + right arrow
|
||||
Same as F6 / F7@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Switch to next buffer with activity (with priority: highlight, message, other)@*
|
||||
@*
|
||||
@item Alt + digit (1-9)
|
||||
Switch to buffer by number@*
|
||||
@*
|
||||
@item F10
|
||||
Remove last infobar message@*
|
||||
@*
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
@title WeeChat - Guide utilisateur
|
||||
@subtitle Client IRC rapide, l@'eger et extensible
|
||||
@subtitle Documentation pour WeeChat v0.0.6 - 12 juin 2004
|
||||
@subtitle Documentation pour WeeChat v0.0.7 - 04 juillet 2004
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
|
@ -343,12 +343,12 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
|
|||
@item col_status
|
||||
Couleur pour la barre de statut@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_status_active
|
||||
Couleur pour la fen@^etre active (barre de statut)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
|
||||
@item col_status_data_msg
|
||||
Couleur pour une fen@^etre avec de nouvelles infos (barre de statut)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightred'@*
|
||||
@item col_status_highlight
|
||||
Color for window with highlight (status bar)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
|
||||
@item col_status_data_other
|
||||
Couleur pour une fen@^etre avec des nouvelles donn@'ees (pas des infos) (barre de statut)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
|
||||
|
@ -572,14 +572,23 @@ Ex@'ecuter la commande ou envoyer le message@*
|
|||
Rappeler les derni@`eres commandes/messages@*
|
||||
@*
|
||||
@item PageUp / PageDown
|
||||
Afficher l'historique de la fen@^etre@*
|
||||
Afficher l'historique du tampon@*
|
||||
@*
|
||||
@item F6 / F7
|
||||
Aller @`a la fen@^etre pr@'ec@'edente / suivante@*
|
||||
Aller au tampon pr@'ec@'edent@*
|
||||
@*
|
||||
@item F8
|
||||
Aller @`a la fen@^etre suivante@*
|
||||
@*
|
||||
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
|
||||
Identique @`a F6 / F7@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Sauter au tampon avec activit@'e (avec priorit@'e: highlight, message, autre)@*
|
||||
@*
|
||||
@item Alt + chiffre (1-9)
|
||||
Sauter au tampon avec ce num@'ero@*
|
||||
@*
|
||||
@item F10
|
||||
Effacer le dernier message de la barre d'infos@*
|
||||
@*
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
@title WeeChat - Guia do Utilizador
|
||||
@subtitle Cliente de IRC rapido, leve e extencivel
|
||||
@subtitle Documenta@,{c}@~ao do WeeChat v0.0.6 - 12 de Junho de 2004
|
||||
@subtitle Documenta@,{c}@~ao do WeeChat v0.0.7 - 04 de Julho de 2004
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
|
@ -277,6 +277,12 @@ Ir para a janela anterior/seguinte@*
|
|||
@item Alt + Seta da esquerda / Alt + Seta da direita
|
||||
Identico a F6 / F7@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Comute ao amortecedor seguinte com atividade (com prioridade: destaque, mensagem, outra)@*
|
||||
@*
|
||||
@item Alt + d@'igito (1-9)
|
||||
Comute ao amortecedor pelo n@'umero@*
|
||||
@*
|
||||
@item F10
|
||||
Apagar a @'ultima mensagem da barra do info@*
|
||||
@*
|
||||
|
|
423
weechat/po/fr.po
423
weechat/po/fr.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -43,6 +43,13 @@ t_weechat_command weechat_commands[] =
|
|||
N_("alias_name: name of alias\ncommand: command name (WeeChat "
|
||||
"or IRC command, without first '/')\n" "arguments: arguments for command"),
|
||||
0, MAX_ARGS, NULL, weechat_cmd_alias },
|
||||
{ "buffer", N_("manage buffers"),
|
||||
N_("[action | number]"),
|
||||
N_("action: action to do:\n"
|
||||
" move move buffer in the list (may be relative, for example -1)\n"
|
||||
" list list opened buffers (no parameter implies this list)\n"
|
||||
"number: jump to buffer by number"),
|
||||
0, MAX_ARGS, weechat_cmd_buffer, NULL },
|
||||
{ "clear", N_("clear window(s)"),
|
||||
N_("[-all]"),
|
||||
N_("-all: clear all windows"),
|
||||
|
@ -77,7 +84,7 @@ t_weechat_command weechat_commands[] =
|
|||
"nick2: alternate nick for server\n"
|
||||
"nick3: second alternate nick for server\n"
|
||||
"username: user name\n"
|
||||
"realname: real name of user\n"),
|
||||
"realname: real name of user"),
|
||||
0, MAX_ARGS, weechat_cmd_server, NULL },
|
||||
{ "save", N_("save config to disk"),
|
||||
N_("[file]"), N_("file: filename for writing config"),
|
||||
|
@ -818,6 +825,49 @@ weechat_cmd_alias (char *arguments)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_buffer: manage buffers
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_cmd_buffer (int argc, char **argv)
|
||||
{
|
||||
int number;
|
||||
char *error;
|
||||
|
||||
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
|
||||
{
|
||||
/* list opened bufferss */
|
||||
gui_printf (NULL, "buffer list -- NOT DEVELOPED!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcasecmp (argv[0], "move") == 0)
|
||||
{
|
||||
/* move buffer to another number in the list */
|
||||
gui_printf (NULL, "buffer move -- NOT DEVELOPED!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
number = strtol (argv[0], &error, 10);
|
||||
if (error)
|
||||
{
|
||||
gui_printf (NULL, _("%s incorrect buffer number\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
}
|
||||
if (!gui_switch_to_buffer_by_number (gui_current_window, number))
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s buffer \"%s\" not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[0], "buffer");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_clear: display or create alias
|
||||
*/
|
||||
|
@ -1495,7 +1545,7 @@ weechat_cmd_set (char *arguments)
|
|||
if (ptr_option->handler_change == NULL)
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s option '%s' can not be changed while WeeChat is running\n"),
|
||||
_("%s option \"%s\" can not be changed while WeeChat is running\n"),
|
||||
WEECHAT_ERROR, option);
|
||||
}
|
||||
else
|
||||
|
@ -1507,13 +1557,13 @@ weechat_cmd_set (char *arguments)
|
|||
gui_printf (NULL, " %s = %s\n", option, value);
|
||||
}
|
||||
else
|
||||
gui_printf (NULL, _("%s incorrect value for option '%s'\n"),
|
||||
gui_printf (NULL, _("%s incorrect value for option \"%s\"\n"),
|
||||
WEECHAT_ERROR, option);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf (NULL, _("%s config option '%s' not found\n"),
|
||||
gui_printf (NULL, _("%s config option \"%s\" not found\n"),
|
||||
WEECHAT_ERROR, option);
|
||||
}
|
||||
}
|
||||
|
@ -1583,15 +1633,15 @@ weechat_cmd_set (char *arguments)
|
|||
if (number_found == 0)
|
||||
{
|
||||
if (value)
|
||||
gui_printf (NULL, _("No config option found with '%s'\n"),
|
||||
gui_printf (NULL, _("No config option found with \"%s\"\n"),
|
||||
value);
|
||||
else
|
||||
gui_printf (NULL, _("No config option found with '%s'\n"));
|
||||
gui_printf (NULL, _("No config option found with \"%s\"\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value)
|
||||
gui_printf (NULL, _("%d config option(s) found with '%s'\n"),
|
||||
gui_printf (NULL, _("%d config option(s) found with \"%s\"\n"),
|
||||
number_found, value);
|
||||
else
|
||||
gui_printf (NULL, _("%d config option(s) found\n"),
|
||||
|
@ -1635,9 +1685,6 @@ weechat_cmd_unalias (char *arguments)
|
|||
int
|
||||
weechat_cmd_window (int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
t_irc_server server, *ptr_server, *server_found, *new_server;
|
||||
|
||||
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
|
||||
{
|
||||
/* list opened windows */
|
||||
|
@ -1656,7 +1703,11 @@ weechat_cmd_window (int argc, char **argv)
|
|||
gui_window_split_vertic (gui_current_window);
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s unknown option for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "window");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,6 +67,7 @@ extern t_weechat_alias *alias_new (char *, char *);
|
|||
extern int exec_weechat_command (t_irc_server *, char *);
|
||||
extern void user_command (t_irc_server *, char *);
|
||||
extern int weechat_cmd_alias (char *);
|
||||
extern int weechat_cmd_buffer (int, char **);
|
||||
extern int weechat_cmd_clear (int, char **);
|
||||
extern int weechat_cmd_connect (int, char **);
|
||||
extern int weechat_cmd_disconnect (int, char **);
|
||||
|
|
|
@ -482,8 +482,8 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int stop_at_end)
|
|||
|
||||
/* insert spaces for align text under time/nick */
|
||||
if ((window->win_chat_cursor_x == 0) &&
|
||||
(ptr_message->type != MSG_TYPE_TIME) &&
|
||||
(ptr_message->type != MSG_TYPE_NICK) &&
|
||||
(!(ptr_message->type & MSG_TYPE_TIME)) &&
|
||||
(!(ptr_message->type & MSG_TYPE_NICK)) &&
|
||||
(line->length_align > 0) &&
|
||||
/* TODO: modify arbitraty value for non aligning messages on time/nick? */
|
||||
(line->length_align < (window->win_chat_width - 5)))
|
||||
|
@ -805,12 +805,17 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
|||
wrefresh (ptr_win->win_status);
|
||||
}
|
||||
wmove (ptr_win->win_status, 0, 0);
|
||||
|
||||
/* display number of buffers */
|
||||
gui_window_set_color (ptr_win->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (ptr_win->win_status, "[%d] ",
|
||||
(last_gui_buffer) ? last_gui_buffer->number : 0);
|
||||
|
||||
/* display current server */
|
||||
if (SERVER(ptr_win->buffer) && SERVER(ptr_win->buffer)->name)
|
||||
{
|
||||
gui_window_set_color (ptr_win->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (ptr_win->win_status, "[%s] ", SERVER(ptr_win->buffer)->name);
|
||||
}
|
||||
|
||||
if (SERVER(ptr_win->buffer) && !CHANNEL(ptr_win->buffer))
|
||||
{
|
||||
gui_window_set_color (ptr_win->win_status,
|
||||
|
@ -870,7 +875,7 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
|||
if (hotlist)
|
||||
{
|
||||
gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS);
|
||||
wprintw (ptr_win->win_status, _("Act: "));
|
||||
wprintw (ptr_win->win_status, _("[Act: "));
|
||||
for (ptr_hotlist = hotlist; ptr_hotlist;
|
||||
ptr_hotlist = ptr_hotlist->next_hotlist)
|
||||
{
|
||||
|
@ -896,6 +901,9 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
|||
if (ptr_hotlist->next_hotlist)
|
||||
wprintw (ptr_win->win_status, ",");
|
||||
}
|
||||
gui_window_set_color (ptr_win->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (ptr_win->win_status, "]");
|
||||
}
|
||||
|
||||
/* display "-MORE-" if last line is not displayed */
|
||||
|
@ -1215,7 +1223,6 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
|
|||
window->win_status = newwin (1, window->win_width, window->win_y + window->win_height - 2, window->win_x);
|
||||
|
||||
buffer->num_displayed++;
|
||||
buffer->unread_data = 0;
|
||||
|
||||
hotlist_remove_buffer (buffer);
|
||||
}
|
||||
|
@ -1301,8 +1308,6 @@ gui_move_page_down (t_gui_window *window)
|
|||
window->sub_lines -= window->win_chat_height - 1;
|
||||
if (window->sub_lines < 0)
|
||||
window->sub_lines = 0;
|
||||
if (window->sub_lines == 0)
|
||||
window->buffer->unread_data = 0;
|
||||
gui_draw_buffer_chat (window->buffer, 0);
|
||||
gui_draw_buffer_status (window->buffer, 0);
|
||||
}
|
||||
|
@ -1344,7 +1349,7 @@ gui_curses_resize_handler ()
|
|||
}
|
||||
|
||||
/*
|
||||
* gui_view_init_subviews: init subviews for a WeeChat view
|
||||
* gui_window_init_subviews: init subviews for a WeeChat window
|
||||
*/
|
||||
|
||||
void
|
||||
|
@ -1661,9 +1666,11 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
|
|||
buffer->last_line->last_message->message = strdup (message);
|
||||
length = strlen (message);
|
||||
buffer->last_line->length += length;
|
||||
if (type == MSG_TYPE_MSG)
|
||||
if (type & MSG_TYPE_MSG)
|
||||
buffer->last_line->line_with_message = 1;
|
||||
if ((type == MSG_TYPE_TIME) || (type == MSG_TYPE_NICK))
|
||||
if (type & MSG_TYPE_HIGHLIGHT)
|
||||
buffer->last_line->line_with_highlight = 1;
|
||||
if ((type & MSG_TYPE_TIME) || (type & MSG_TYPE_NICK))
|
||||
buffer->last_line->length_align += length;
|
||||
if (pos)
|
||||
{
|
||||
|
@ -1677,14 +1684,12 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
|
|||
/*else
|
||||
gui_display_line (buffer, buffer->last_line, 1);*/
|
||||
}
|
||||
if ((buffer->num_displayed == 0) || (gui_current_window->sub_lines > 0))
|
||||
if (buffer->num_displayed == 0)
|
||||
{
|
||||
if (buffer->unread_data < 1 + buffer->last_line->line_with_message)
|
||||
{
|
||||
buffer->unread_data = 1 + buffer->last_line->line_with_message;
|
||||
hotlist_add (buffer->last_line->line_with_message, buffer);
|
||||
gui_draw_buffer_status (buffer, 1);
|
||||
}
|
||||
hotlist_add (buffer->last_line->line_with_message +
|
||||
buffer->last_line->line_with_highlight,
|
||||
buffer);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -299,6 +299,8 @@ gui_read_keyb ()
|
|||
case KEY_ESCAPE:
|
||||
if ((key = getch()) != ERR)
|
||||
{
|
||||
/*gui_printf (gui_current_window->buffer,
|
||||
"[Debug] key pressed = %d, as octal: %o\n", key, key);*/
|
||||
switch (key)
|
||||
{
|
||||
case KEY_LEFT:
|
||||
|
@ -327,6 +329,18 @@ gui_read_keyb ()
|
|||
}
|
||||
}
|
||||
break;
|
||||
/* Alt-number */
|
||||
case 49: /* Alt-1 */
|
||||
case 50: /* Alt-2 */
|
||||
case 51: /* Alt-3 */
|
||||
case 52: /* Alt-4 */
|
||||
case 53: /* Alt-5 */
|
||||
case 54: /* Alt-6 */
|
||||
case 55: /* Alt-7 */
|
||||
case 56: /* Alt-8 */
|
||||
case 57: /* Alt-9 */
|
||||
gui_switch_to_buffer_by_number (gui_current_window, key - 48);
|
||||
break;
|
||||
/* Alt-A */
|
||||
case 'a':
|
||||
case 'A':
|
||||
|
|
|
@ -145,7 +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;
|
||||
new_buffer->number = (last_gui_buffer) ? last_gui_buffer->number + 1 : 1;
|
||||
|
||||
/* assign server and channel to buffer */
|
||||
SERVER(new_buffer) = server;
|
||||
|
@ -157,21 +157,19 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int switch_to
|
|||
CHANNEL(new_buffer)->buffer = new_buffer;
|
||||
|
||||
if (!window->buffer)
|
||||
{
|
||||
window->buffer = new_buffer;
|
||||
window->first_line_displayed = 1;
|
||||
window->sub_lines = 0;
|
||||
|
||||
gui_calculate_pos_size (window);
|
||||
|
||||
/* init buffers */
|
||||
gui_window_init_subwindows (window);
|
||||
window->first_line_displayed = 1;
|
||||
window->sub_lines = 0;
|
||||
gui_calculate_pos_size (window);
|
||||
gui_window_init_subwindows (window);
|
||||
}
|
||||
|
||||
/* init lines */
|
||||
new_buffer->lines = NULL;
|
||||
new_buffer->last_line = NULL;
|
||||
new_buffer->num_lines = 0;
|
||||
new_buffer->line_complete = 1;
|
||||
new_buffer->unread_data = 0;
|
||||
|
||||
/* init input buffer */
|
||||
new_buffer->input_buffer_alloc = INPUT_BUFFER_BLOCK_SIZE;
|
||||
|
@ -242,7 +240,6 @@ gui_buffer_clear (t_gui_buffer *buffer)
|
|||
buffer->last_line = NULL;
|
||||
buffer->num_lines = 0;
|
||||
buffer->line_complete = 1;
|
||||
buffer->unread_data = 0;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
|
@ -407,6 +404,7 @@ gui_new_line (t_gui_buffer *buffer)
|
|||
new_line->length = 0;
|
||||
new_line->length_align = 0;
|
||||
new_line->line_with_message = 0;
|
||||
new_line->line_with_highlight = 0;
|
||||
new_line->messages = NULL;
|
||||
new_line->last_message = NULL;
|
||||
if (!buffer->lines)
|
||||
|
@ -624,3 +622,31 @@ gui_buffer_insert_string (t_gui_buffer *buffer, char *string, int pos)
|
|||
/* insert new string */
|
||||
strncpy (buffer->input_buffer + pos, string, length);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_buffer_by_number: switch to another buffer with number
|
||||
*/
|
||||
|
||||
t_gui_buffer *
|
||||
gui_switch_to_buffer_by_number (t_gui_window *window, int number)
|
||||
{
|
||||
t_gui_buffer *ptr_buffer;
|
||||
|
||||
/* buffer is currently displayed ? */
|
||||
if (number == window->buffer->number)
|
||||
return window->buffer;
|
||||
|
||||
/* search for buffer in the list */
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
if ((ptr_buffer != window->buffer) && (number == ptr_buffer->number))
|
||||
{
|
||||
gui_switch_to_buffer (window, ptr_buffer);
|
||||
gui_redraw_buffer (window->buffer);
|
||||
return ptr_buffer;
|
||||
}
|
||||
}
|
||||
|
||||
/* buffer not found */
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -66,10 +66,11 @@
|
|||
#define BUFFER_IS_CHANNEL(buffer) (CHANNEL(buffer) && (CHANNEL(buffer)->type == CHAT_CHANNEL))
|
||||
#define BUFFER_IS_PRIVATE(buffer) (CHANNEL(buffer) && (CHANNEL(buffer)->type == CHAT_PRIVATE))
|
||||
|
||||
#define MSG_TYPE_TIME 0
|
||||
#define MSG_TYPE_NICK 1
|
||||
#define MSG_TYPE_INFO 2
|
||||
#define MSG_TYPE_MSG 3
|
||||
#define MSG_TYPE_TIME 1
|
||||
#define MSG_TYPE_NICK 2
|
||||
#define MSG_TYPE_INFO 4
|
||||
#define MSG_TYPE_MSG 8
|
||||
#define MSG_TYPE_HIGHLIGHT 16
|
||||
|
||||
#define gui_printf_color(buffer, color, fmt, argz...) \
|
||||
gui_printf_color_type(buffer, MSG_TYPE_INFO, color, fmt, ##argz)
|
||||
|
@ -95,6 +96,7 @@ struct t_gui_line
|
|||
int length; /* length of the line (in char) */
|
||||
int length_align; /* alignment length (time or time/nick) */
|
||||
int line_with_message; /* line contains a message from a user? */
|
||||
int line_with_highlight; /* line contains highlight */
|
||||
t_gui_message *messages; /* messages for the line */
|
||||
t_gui_message *last_message; /* last message of the line */
|
||||
t_gui_line *prev_line; /* link to previous line */
|
||||
|
@ -138,7 +140,6 @@ struct t_gui_buffer
|
|||
t_gui_line *last_line; /* last line of chat window */
|
||||
int num_lines; /* number of lines in the window */
|
||||
int line_complete; /* current line complete ? (\n ending) */
|
||||
int unread_data; /* highlight windows with unread data */
|
||||
|
||||
/* inupt buffer */
|
||||
char *input_buffer; /* input buffer */
|
||||
|
@ -235,6 +236,7 @@ extern void gui_delete_previous_word (t_gui_buffer *);
|
|||
extern void gui_move_previous_word (t_gui_buffer *);
|
||||
extern void gui_move_next_word (t_gui_buffer *);
|
||||
extern void gui_buffer_insert_string (t_gui_buffer *, char *, int);
|
||||
extern t_gui_buffer *gui_switch_to_buffer_by_number (t_gui_window *, int);
|
||||
/* GUI dependant functions */
|
||||
extern int gui_assign_color (int *, char *);
|
||||
extern int gui_get_color_by_name (char *);
|
||||
|
|
|
@ -945,10 +945,11 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
|||
if (strstr (pos, server->nick))
|
||||
{
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
MSG_TYPE_MSG | MSG_TYPE_HIGHLIGHT,
|
||||
COLOR_WIN_CHAT_HIGHLIGHT,
|
||||
"%s", host);
|
||||
if ( (cfg_look_infobar_delay_highlight > 0)
|
||||
if ( (cfg_look_infobar)
|
||||
&& (cfg_look_infobar_delay_highlight > 0)
|
||||
&& (ptr_channel->buffer != gui_current_window->buffer) )
|
||||
gui_infobar_printf (cfg_look_infobar_delay_highlight,
|
||||
COLOR_WIN_INFOBAR_HIGHLIGHT,
|
||||
|
@ -971,8 +972,10 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
|||
if (strstr (pos, server->nick))
|
||||
{
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick,
|
||||
MSG_TYPE_NICK, 1, -1, 0);
|
||||
if ( (cfg_look_infobar_delay_highlight > 0)
|
||||
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
|
||||
1, -1, 0);
|
||||
if ( (cfg_look_infobar)
|
||||
&& (cfg_look_infobar_delay_highlight > 0)
|
||||
&& (ptr_channel->buffer != gui_current_window->buffer) )
|
||||
gui_infobar_printf (cfg_look_infobar_delay_highlight,
|
||||
COLOR_WIN_INFOBAR_HIGHLIGHT,
|
||||
|
@ -1157,38 +1160,67 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
|||
}
|
||||
}
|
||||
if (!ptr_channel->topic)
|
||||
{
|
||||
ptr_channel->topic = strdup (host2);
|
||||
gui_draw_buffer_title (ptr_channel->buffer, 1);
|
||||
}
|
||||
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "<");
|
||||
if (strstr (pos, server->nick))
|
||||
if (strncmp (pos, "\01ACTION ", 8) == 0)
|
||||
{
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
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,
|
||||
COLOR_WIN_INFOBAR_HIGHLIGHT,
|
||||
_("Private %s> %s"),
|
||||
host, pos);
|
||||
pos += 8;
|
||||
pos2 = strchr (pos, '\01');
|
||||
if (pos2)
|
||||
pos2[0] = '\0';
|
||||
irc_display_prefix (ptr_channel->buffer, PREFIX_ACTION_ME);
|
||||
if (strstr (pos, server->nick))
|
||||
{
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG | MSG_TYPE_HIGHLIGHT,
|
||||
COLOR_WIN_CHAT_HIGHLIGHT,
|
||||
"%s", host);
|
||||
if ( (cfg_look_infobar)
|
||||
&& (cfg_look_infobar_delay_highlight > 0)
|
||||
&& (ptr_channel->buffer != gui_current_window->buffer) )
|
||||
gui_infobar_printf (cfg_look_infobar_delay_highlight,
|
||||
COLOR_WIN_INFOBAR_HIGHLIGHT,
|
||||
_("On %s: * %s %s"),
|
||||
ptr_channel->name,
|
||||
host, pos);
|
||||
}
|
||||
else
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_NICK_PRIVATE,
|
||||
"%s", host);
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "> ");
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
COLOR_WIN_CHAT, "%s\n", pos);
|
||||
COLOR_WIN_CHAT_DARK, "<");
|
||||
if (strstr (pos, server->nick))
|
||||
{
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
|
||||
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,
|
||||
COLOR_WIN_INFOBAR_HIGHLIGHT,
|
||||
_("Private %s> %s"),
|
||||
host, pos);
|
||||
}
|
||||
else
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_NICK_PRIVATE,
|
||||
"%s", host);
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "> ");
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
COLOR_WIN_CHAT, "%s\n", pos);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue