mirror of
https://github.com/weechat/weechat.git
synced 2026-07-07 22:25:43 +02:00
Allow clear of multiple selected buffers with /clear (patch #6112)
This commit is contained in:
@@ -5,6 +5,7 @@ ChangeLog - 2007-08-08
|
||||
|
||||
|
||||
Version 0.2.6 (under dev!):
|
||||
* allow clear of multiple selected buffers with /clear (patch #6112)
|
||||
* added "copy" and "rename" options to /server command
|
||||
* added key for setting unread marker on all buffers (default:
|
||||
ctrl-S + ctrl-U) (task 7180)
|
||||
|
||||
@@ -54,7 +54,7 @@ Befehl: auszuf
|
||||
|
||||
|
||||
</programlisting>
|
||||
<command>clear [-all | Nummer]</command>
|
||||
<command>clear [-all | number [number ...]]</command>
|
||||
<programlisting>
|
||||
Fenster leeren
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ command: command to execute (a '/' is automatically added if not found at beginn
|
||||
|
||||
|
||||
</programlisting>
|
||||
<command>clear [-all | number]</command>
|
||||
<command>clear [-all | number [number ...]]</command>
|
||||
<programlisting>
|
||||
clear window(s)
|
||||
|
||||
|
||||
@@ -54,12 +54,12 @@ commande: commande
|
||||
|
||||
|
||||
</programlisting>
|
||||
<command>clear [-all | nombre]</command>
|
||||
<command>clear [-all | numéro [numéro ...]]</command>
|
||||
<programlisting>
|
||||
effacer la/les fenêtre(s)
|
||||
|
||||
-all: effacer tous les tampons
|
||||
nombre: effacer un tampon par son numéro
|
||||
numéro: effacer un tampon par son numéro
|
||||
|
||||
</programlisting>
|
||||
<command>connect [-all [-nojoin] | nom_serveur [nom_serveur...] [-nojoin]]</command>
|
||||
|
||||
+130
-130
File diff suppressed because it is too large
Load Diff
+22
-18
@@ -91,10 +91,10 @@ 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 | number]"),
|
||||
N_("[-all | number [number ...]]"),
|
||||
N_(" -all: clear all buffers\n"
|
||||
"number: clear buffer by number"),
|
||||
"-all", 0, 1, 0, weechat_cmd_clear, NULL },
|
||||
"-all", 0, MAX_ARGS, 0, weechat_cmd_clear, NULL },
|
||||
{ "connect", N_("connect to server(s)"),
|
||||
N_("[-all [-nojoin] | servername [servername ...] [-nojoin]]"),
|
||||
N_(" -all: connect to all servers\n"
|
||||
@@ -1522,35 +1522,39 @@ weechat_cmd_clear (t_irc_server *server, t_irc_channel *channel,
|
||||
t_gui_buffer *buffer;
|
||||
char *error;
|
||||
long number;
|
||||
int i;
|
||||
|
||||
if (argc == 1)
|
||||
if (argc > 0)
|
||||
{
|
||||
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'))
|
||||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
buffer = gui_buffer_search_by_number (number);
|
||||
if (!buffer)
|
||||
error = NULL;
|
||||
number = strtol (argv[i], &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 number \"%s\" not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[i], "clear");
|
||||
return -1;
|
||||
}
|
||||
gui_buffer_clear (buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s buffer not found for \"%s\" command\n"),
|
||||
_("%s unknown option 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ ChangeLog - 2007-08-08
|
||||
|
||||
|
||||
Version 0.2.6 (under dev!):
|
||||
* allow clear of multiple selected buffers with /clear (patch #6112)
|
||||
* added "copy" and "rename" options to /server command
|
||||
* added key for setting unread marker on all buffers (default:
|
||||
ctrl-S + ctrl-U) (task 7180)
|
||||
|
||||
@@ -54,7 +54,7 @@ Befehl: auszuf
|
||||
|
||||
|
||||
</programlisting>
|
||||
<command>clear [-all | Nummer]</command>
|
||||
<command>clear [-all | number [number ...]]</command>
|
||||
<programlisting>
|
||||
Fenster leeren
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ command: command to execute (a '/' is automatically added if not found at beginn
|
||||
|
||||
|
||||
</programlisting>
|
||||
<command>clear [-all | number]</command>
|
||||
<command>clear [-all | number [number ...]]</command>
|
||||
<programlisting>
|
||||
clear window(s)
|
||||
|
||||
|
||||
@@ -54,12 +54,12 @@ commande: commande
|
||||
|
||||
|
||||
</programlisting>
|
||||
<command>clear [-all | nombre]</command>
|
||||
<command>clear [-all | numéro [numéro ...]]</command>
|
||||
<programlisting>
|
||||
effacer la/les fenêtre(s)
|
||||
|
||||
-all: effacer tous les tampons
|
||||
nombre: effacer un tampon par son numéro
|
||||
numéro: effacer un tampon par son numéro
|
||||
|
||||
</programlisting>
|
||||
<command>connect [-all [-nojoin] | nom_serveur [nom_serveur...] [-nojoin]]</command>
|
||||
|
||||
+132
-131
File diff suppressed because it is too large
Load Diff
+132
-131
File diff suppressed because it is too large
Load Diff
+130
-130
File diff suppressed because it is too large
Load Diff
+134
-134
File diff suppressed because it is too large
Load Diff
+130
-130
File diff suppressed because it is too large
Load Diff
+132
-131
File diff suppressed because it is too large
Load Diff
+130
-130
File diff suppressed because it is too large
Load Diff
@@ -91,10 +91,10 @@ 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 | number]"),
|
||||
N_("[-all | number [number ...]]"),
|
||||
N_(" -all: clear all buffers\n"
|
||||
"number: clear buffer by number"),
|
||||
"-all", 0, 1, 0, weechat_cmd_clear, NULL },
|
||||
"-all", 0, MAX_ARGS, 0, weechat_cmd_clear, NULL },
|
||||
{ "connect", N_("connect to server(s)"),
|
||||
N_("[-all [-nojoin] | servername [servername ...] [-nojoin]]"),
|
||||
N_(" -all: connect to all servers\n"
|
||||
@@ -1522,35 +1522,39 @@ weechat_cmd_clear (t_irc_server *server, t_irc_channel *channel,
|
||||
t_gui_buffer *buffer;
|
||||
char *error;
|
||||
long number;
|
||||
int i;
|
||||
|
||||
if (argc == 1)
|
||||
if (argc > 0)
|
||||
{
|
||||
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'))
|
||||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
buffer = gui_buffer_search_by_number (number);
|
||||
if (!buffer)
|
||||
error = NULL;
|
||||
number = strtol (argv[i], &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 number \"%s\" not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[i], "clear");
|
||||
return -1;
|
||||
}
|
||||
gui_buffer_clear (buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s buffer not found for \"%s\" command\n"),
|
||||
_("%s unknown option 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user