Added numeric argument for /clear command (buffer number) (patch #5372)
This commit is contained in:
parent
0e113ded09
commit
ef43b3e013
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
431
po/weechat.pot
431
po/weechat.pot
File diff suppressed because it is too large
Load Diff
@ -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,8 +1406,8 @@ 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)
|
||||
{
|
||||
@ -1414,15 +1415,37 @@ weechat_cmd_clear (t_irc_server *server, t_irc_channel *channel,
|
||||
gui_buffer_clear_all ();
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unknown option for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "clear");
|
||||
return -1;
|
||||
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,
|
||||
_("%s unknown option for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "clear");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_find_context (server, channel, NULL, &buffer);
|
||||
gui_buffer_clear (buffer);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -378,6 +378,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);
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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
weechat/po/cs.po
442
weechat/po/cs.po
File diff suppressed because it is too large
Load Diff
442
weechat/po/de.po
442
weechat/po/de.po
File diff suppressed because it is too large
Load Diff
442
weechat/po/es.po
442
weechat/po/es.po
File diff suppressed because it is too large
Load Diff
445
weechat/po/fr.po
445
weechat/po/fr.po
File diff suppressed because it is too large
Load Diff
442
weechat/po/hu.po
442
weechat/po/hu.po
File diff suppressed because it is too large
Load Diff
442
weechat/po/ru.po
442
weechat/po/ru.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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,8 +1406,8 @@ 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)
|
||||
{
|
||||
@ -1414,15 +1415,37 @@ weechat_cmd_clear (t_irc_server *server, t_irc_channel *channel,
|
||||
gui_buffer_clear_all ();
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unknown option for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "clear");
|
||||
return -1;
|
||||
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,
|
||||
_("%s unknown option for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "clear");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_find_context (server, channel, NULL, &buffer);
|
||||
gui_buffer_clear (buffer);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -378,6 +378,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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user