Added numeric argument for /clear command (buffer number) (patch #5372)

This commit is contained in:
Sebastien Helleu 2007-02-03 08:49:23 +00:00
parent 0e113ded09
commit ef43b3e013
26 changed files with 3276 additions and 3026 deletions

View File

@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2007-01-21
ChangeLog - 2007-02-03
Version 0.2.4 (under dev!):
* added numeric argument for /clear command (buffer number) (patch #5372)
* fixed crash when /away command is issued with no server connection
(bug #18839)
* fixed crash when closing a buffer opened on many windows

View File

@ -40,11 +40,12 @@ Befehl: auszuf
</programlisting>
<command>clear [-all]</command>
<command>clear [-all | number]</command>
<programlisting>
Fenster leeren
-all: alle Fenster leeren
-all: clear all buffers
number: clear buffer by number
</programlisting>
<command>connect [Servername]</command>

View File

@ -40,11 +40,12 @@ command: command to execute (a '/' is automatically added if not found at beginn
</programlisting>
<command>clear [-all]</command>
<command>clear [-all | number]</command>
<programlisting>
clear window(s)
-all: clear all windows
-all: clear all buffers
number: clear buffer by number
</programlisting>
<command>connect [servername]</command>

View File

@ -40,11 +40,12 @@ commande: commande
</programlisting>
<command>clear [-all]</command>
<command>clear [-all | nombre]</command>
<programlisting>
effacer la/les fenêtre(s)
-all: effacer toutes les fenêtres
-all: effacer tous les tampons
nombre: effacer un tampon par son numéro
</programlisting>
<command>connect [nom_serveur]</command>

442
po/cs.po

File diff suppressed because it is too large Load Diff

442
po/de.po

File diff suppressed because it is too large Load Diff

442
po/es.po

File diff suppressed because it is too large Load Diff

445
po/fr.po

File diff suppressed because it is too large Load Diff

442
po/hu.po

File diff suppressed because it is too large Load Diff

442
po/ru.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -75,8 +75,9 @@ t_weechat_command weechat_commands[] =
N_("command: command to execute (a '/' is automatically added if not found at beginning of command)\n"),
"%w|%i", 0, MAX_ARGS, 1, NULL, weechat_cmd_builtin },
{ "clear", N_("clear window(s)"),
N_("[-all]"),
N_("-all: clear all windows"),
N_("[-all | number]"),
N_(" -all: clear all buffers\n"
"number: clear buffer by number"),
"-all", 0, 1, 0, weechat_cmd_clear, NULL },
{ "connect", N_("connect to a server"),
N_("[servername]"),
@ -1405,14 +1406,31 @@ weechat_cmd_clear (t_irc_server *server, t_irc_channel *channel,
int argc, char **argv)
{
t_gui_buffer *buffer;
irc_find_context (server, channel, NULL, &buffer);
char *error;
long number;
if (argc == 1)
{
if (ascii_strcasecmp (argv[0], "-all") == 0)
gui_buffer_clear_all ();
else
{
error = NULL;
number = strtol (argv[0], &error, 10);
if ((error) && (error[0] == '\0'))
{
buffer = gui_buffer_search_by_number (number);
if (!buffer)
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s buffer not found for \"%s\" command\n"),
WEECHAT_ERROR, "clear");
return -1;
}
gui_buffer_clear (buffer);
}
else
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL,
@ -1421,8 +1439,13 @@ weechat_cmd_clear (t_irc_server *server, t_irc_channel *channel,
return -1;
}
}
}
else
{
irc_find_context (server, channel, NULL, &buffer);
gui_buffer_clear (buffer);
}
return 0;
}

View File

@ -379,6 +379,12 @@ gui_buffer_clear (t_gui_buffer *buffer)
t_gui_window *ptr_win;
t_gui_line *ptr_line;
if (!buffer)
return;
if (buffer->type == BUFFER_TYPE_DCC)
return;
/* remove buffer from hotlist */
hotlist_remove_buffer (buffer);

View File

@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2007-01-21
ChangeLog - 2007-02-03
Version 0.2.4 (under dev!):
* added numeric argument for /clear command (buffer number) (patch #5372)
* fixed crash when /away command is issued with no server connection
(bug #18839)
* fixed crash when closing a buffer opened on many windows

View File

@ -40,11 +40,12 @@ Befehl: auszuf
</programlisting>
<command>clear [-all]</command>
<command>clear [-all | number]</command>
<programlisting>
Fenster leeren
-all: alle Fenster leeren
-all: clear all buffers
number: clear buffer by number
</programlisting>
<command>connect [Servername]</command>

View File

@ -40,11 +40,12 @@ command: command to execute (a '/' is automatically added if not found at beginn
</programlisting>
<command>clear [-all]</command>
<command>clear [-all | number]</command>
<programlisting>
clear window(s)
-all: clear all windows
-all: clear all buffers
number: clear buffer by number
</programlisting>
<command>connect [servername]</command>

View File

@ -40,11 +40,12 @@ commande: commande
</programlisting>
<command>clear [-all]</command>
<command>clear [-all | nombre]</command>
<programlisting>
effacer la/les fenêtre(s)
-all: effacer toutes les fenêtres
-all: effacer tous les tampons
nombre: effacer un tampon par son numéro
</programlisting>
<command>connect [nom_serveur]</command>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -75,8 +75,9 @@ t_weechat_command weechat_commands[] =
N_("command: command to execute (a '/' is automatically added if not found at beginning of command)\n"),
"%w|%i", 0, MAX_ARGS, 1, NULL, weechat_cmd_builtin },
{ "clear", N_("clear window(s)"),
N_("[-all]"),
N_("-all: clear all windows"),
N_("[-all | number]"),
N_(" -all: clear all buffers\n"
"number: clear buffer by number"),
"-all", 0, 1, 0, weechat_cmd_clear, NULL },
{ "connect", N_("connect to a server"),
N_("[servername]"),
@ -1405,14 +1406,31 @@ weechat_cmd_clear (t_irc_server *server, t_irc_channel *channel,
int argc, char **argv)
{
t_gui_buffer *buffer;
irc_find_context (server, channel, NULL, &buffer);
char *error;
long number;
if (argc == 1)
{
if (ascii_strcasecmp (argv[0], "-all") == 0)
gui_buffer_clear_all ();
else
{
error = NULL;
number = strtol (argv[0], &error, 10);
if ((error) && (error[0] == '\0'))
{
buffer = gui_buffer_search_by_number (number);
if (!buffer)
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s buffer not found for \"%s\" command\n"),
WEECHAT_ERROR, "clear");
return -1;
}
gui_buffer_clear (buffer);
}
else
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL,
@ -1421,8 +1439,13 @@ weechat_cmd_clear (t_irc_server *server, t_irc_channel *channel,
return -1;
}
}
}
else
{
irc_find_context (server, channel, NULL, &buffer);
gui_buffer_clear (buffer);
}
return 0;
}

View File

@ -379,6 +379,12 @@ gui_buffer_clear (t_gui_buffer *buffer)
t_gui_window *ptr_win;
t_gui_line *ptr_line;
if (!buffer)
return;
if (buffer->type == BUFFER_TYPE_DCC)
return;
/* remove buffer from hotlist */
hotlist_remove_buffer (buffer);