1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 00:33:13 +02:00

core: add option weechat.look.hotlist_remove (closes #99)

This commit is contained in:
Sébastien Helleu
2014-06-06 19:39:19 +02:00
parent 0bdb7d2f80
commit 5d0a74a43e
22 changed files with 138 additions and 17 deletions
+1
View File
@@ -55,6 +55,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
* core: fix "/window scroll -N" on a buffer with free content
* core: add option weechat.look.hotlist_add_conditions, remove option
weechat.look.hotlist_add_buffer_if_away
* core: add option weechat.look.hotlist_remove (closes #99)
* core: fix recursive calls to function eval_expression
* core: mute all buffers by default in command /mute (replace option -all by
-core)
@@ -603,6 +603,11 @@
** Typ: Zeichenkette
** Werte: beliebige Zeichenkette (Standardwert: `"H: "`)
* [[option_weechat.look.hotlist_remove]] *weechat.look.hotlist_remove*
** Beschreibung: `remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove all visible merged buffers at once`
** Typ: integer
** Werte: buffer, merged (Standardwert: `buffer`)
* [[option_weechat.look.hotlist_short_names]] *weechat.look.hotlist_short_names*
** Beschreibung: `ist diese Option aktiviert, wird der Kurzname der zusammengefügten Buffer in der Hotlist dargestellt (die Darstellung geschieht nach dem ersten '.' im Namen)`
** Typ: boolesch
@@ -603,6 +603,11 @@
** type: string
** values: any string (default value: `"H: "`)
* [[option_weechat.look.hotlist_remove]] *weechat.look.hotlist_remove*
** description: `remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove all visible merged buffers at once`
** type: integer
** values: buffer, merged (default value: `buffer`)
* [[option_weechat.look.hotlist_short_names]] *weechat.look.hotlist_short_names*
** description: `if set, uses short names to display buffer names in hotlist (start after first '.' in name)`
** type: boolean
@@ -603,6 +603,11 @@
** type: chaîne
** valeurs: toute chaîne (valeur par défaut: `"H: "`)
* [[option_weechat.look.hotlist_remove]] *weechat.look.hotlist_remove*
** description: `supprimer les tampons de la liste d'activité : buffer = supprimer tampon par tampon, merged = supprimer tous les tampons mélangés visibles d'un seul coup`
** type: entier
** valeurs: buffer, merged (valeur par défaut: `buffer`)
* [[option_weechat.look.hotlist_short_names]] *weechat.look.hotlist_short_names*
** description: `si défini, utilise des noms courts pour afficher les noms de tampons dans la hotlist (commence après le premier '.' dans le nom)`
** type: booléen
@@ -603,6 +603,11 @@
** tipo: stringa
** valori: qualsiasi stringa (valore predefinito: `"H: "`)
* [[option_weechat.look.hotlist_remove]] *weechat.look.hotlist_remove*
** descrizione: `remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove all visible merged buffers at once`
** tipo: intero
** valori: buffer, merged (valore predefinito: `buffer`)
* [[option_weechat.look.hotlist_short_names]] *weechat.look.hotlist_short_names*
** descrizione: `se impostato, usa i nomi brevi per visualizzare i nomi dei buffer nella hotlist (inizia dopo il primo '.' nel nome)`
** tipo: bool
@@ -603,6 +603,11 @@
** タイプ: 文字列
** 値: 未制約文字列 (デフォルト値: `"H: "`)
* [[option_weechat.look.hotlist_remove]] *weechat.look.hotlist_remove*
** 説明: `remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove all visible merged buffers at once`
** タイプ: 整数
** 値: buffer, merged (デフォルト値: `buffer`)
* [[option_weechat.look.hotlist_short_names]] *weechat.look.hotlist_short_names*
** 説明: `セットされた場合、ホットリストではバッファ名に短い名前を使う (名前に含まれる最初の '.' 以降)`
** タイプ: ブール
@@ -603,6 +603,11 @@
** typ: ciąg
** wartości: dowolny ciąg (domyślna wartość: `"H: "`)
* [[option_weechat.look.hotlist_remove]] *weechat.look.hotlist_remove*
** opis: `remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove all visible merged buffers at once`
** typ: liczba
** wartości: buffer, merged (domyślna wartość: `buffer`)
* [[option_weechat.look.hotlist_short_names]] *weechat.look.hotlist_short_names*
** opis: `jeśli ustawione, używa krótkich nazw do wyświetlania nazw buforów w hotliście (zaczyna po pierwszym wystąpieniu '.' w nazwie)`
** typ: bool
+6 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"POT-Creation-Date: 2014-06-06 19:29+0200\n"
"PO-Revision-Date: 2014-04-19 13:08+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2943,6 +2943,11 @@ msgstr ""
msgid "text displayed at the beginning of the hotlist"
msgstr "řetězec zobrazený mezi buffery v hotlistu"
msgid ""
"remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove "
"all visible merged buffers at once"
msgstr ""
msgid ""
"if set, uses short names to display buffer names in hotlist (start after "
"first '.' in name)"
+6 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"POT-Creation-Date: 2014-06-06 19:29+0200\n"
"PO-Revision-Date: 2014-05-26 19:19+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
@@ -3451,6 +3451,11 @@ msgstr ""
msgid "text displayed at the beginning of the hotlist"
msgstr "Text der vor der Hotlist angezeigt werden soll"
msgid ""
"remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove "
"all visible merged buffers at once"
msgstr ""
msgid ""
"if set, uses short names to display buffer names in hotlist (start after "
"first '.' in name)"
+6 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"POT-Creation-Date: 2014-06-06 19:29+0200\n"
"PO-Revision-Date: 2014-04-19 13:08+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3106,6 +3106,11 @@ msgstr ""
msgid "text displayed at the beginning of the hotlist"
msgstr "cadena mostrada entre los buffers en la lista de actividad"
msgid ""
"remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove "
"all visible merged buffers at once"
msgstr ""
msgid ""
"if set, uses short names to display buffer names in hotlist (start after "
"first '.' in name)"
+9 -2
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"PO-Revision-Date: 2014-05-26 07:51+0200\n"
"POT-Creation-Date: 2014-06-06 19:29+0200\n"
"PO-Revision-Date: 2014-06-06 19:30+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -3362,6 +3362,13 @@ msgstr ""
msgid "text displayed at the beginning of the hotlist"
msgstr "chaîne affichée au début de la hotlist"
msgid ""
"remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove "
"all visible merged buffers at once"
msgstr ""
"supprimer les tampons de la liste d'activité : buffer = supprimer tampon par "
"tampon, merged = supprimer tous les tampons mélangés visibles d'un seul coup"
msgid ""
"if set, uses short names to display buffer names in hotlist (start after "
"first '.' in name)"
+6 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"POT-Creation-Date: 2014-06-06 19:29+0200\n"
"PO-Revision-Date: 2014-04-05 16:12+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2575,6 +2575,11 @@ msgstr ""
msgid "text displayed at the beginning of the hotlist"
msgstr "kiemelendő szavak listája"
msgid ""
"remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove "
"all visible merged buffers at once"
msgstr ""
msgid ""
"if set, uses short names to display buffer names in hotlist (start after "
"first '.' in name)"
+6 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"POT-Creation-Date: 2014-06-06 19:29+0200\n"
"PO-Revision-Date: 2014-04-19 13:08+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3199,6 +3199,11 @@ msgstr ""
msgid "text displayed at the beginning of the hotlist"
msgstr "testo mostrato in cima alla hotlist"
msgid ""
"remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove "
"all visible merged buffers at once"
msgstr ""
msgid ""
"if set, uses short names to display buffer names in hotlist (start after "
"first '.' in name)"
+6 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"POT-Creation-Date: 2014-06-06 19:29+0200\n"
"PO-Revision-Date: 2014-05-15 12:40+0900\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/translation_ja>\n"
@@ -3255,6 +3255,11 @@ msgstr ""
msgid "text displayed at the beginning of the hotlist"
msgstr "ホットリストの最初に表示されるテキスト"
msgid ""
"remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove "
"all visible merged buffers at once"
msgstr ""
msgid ""
"if set, uses short names to display buffer names in hotlist (start after "
"first '.' in name)"
+6 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"POT-Creation-Date: 2014-06-06 19:29+0200\n"
"PO-Revision-Date: 2014-04-19 13:08+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3311,6 +3311,11 @@ msgstr ""
msgid "text displayed at the beginning of the hotlist"
msgstr "ciąg znaków wyświetlany na początku hotlisty"
msgid ""
"remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove "
"all visible merged buffers at once"
msgstr ""
msgid ""
"if set, uses short names to display buffer names in hotlist (start after "
"first '.' in name)"
+6 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"POT-Creation-Date: 2014-06-06 19:29+0200\n"
"PO-Revision-Date: 2014-04-05 16:12+0200\n"
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3034,6 +3034,11 @@ msgstr ""
msgid "text displayed at the beginning of the hotlist"
msgstr "string exibida entre buffers na lista de atividade"
msgid ""
"remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove "
"all visible merged buffers at once"
msgstr ""
msgid ""
"if set, uses short names to display buffer names in hotlist (start after "
"first '.' in name)"
+6 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"POT-Creation-Date: 2014-06-06 19:29+0200\n"
"PO-Revision-Date: 2014-04-05 16:12+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2602,6 +2602,11 @@ msgstr ""
msgid "text displayed at the beginning of the hotlist"
msgstr "максимальная длина имён в хотлисте"
msgid ""
"remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove "
"all visible merged buffers at once"
msgstr ""
msgid ""
"if set, uses short names to display buffer names in hotlist (start after "
"first '.' in name)"
+6 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"POT-Creation-Date: 2014-06-06 19:29+0200\n"
"PO-Revision-Date: 2014-03-24 14:23+0100\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2322,6 +2322,11 @@ msgstr ""
msgid "text displayed at the beginning of the hotlist"
msgstr ""
msgid ""
"remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove "
"all visible merged buffers at once"
msgstr ""
msgid ""
"if set, uses short names to display buffer names in hotlist (start after "
"first '.' in name)"
+6 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.1-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"POT-Creation-Date: 2014-06-06 19:29+0200\n"
"PO-Revision-Date: 2013-02-14 18:20+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2323,6 +2323,11 @@ msgstr ""
msgid "text displayed at the beginning of the hotlist"
msgstr ""
msgid ""
"remove buffers in hotlist: buffer = remove buffer by buffer, merged = remove "
"all visible merged buffers at once"
msgstr ""
msgid ""
"if set, uses short names to display buffer names in hotlist (start after "
"first '.' in name)"
+8
View File
@@ -122,6 +122,7 @@ struct t_config_option *config_look_hotlist_names_length;
struct t_config_option *config_look_hotlist_names_level;
struct t_config_option *config_look_hotlist_names_merged_buffers;
struct t_config_option *config_look_hotlist_prefix;
struct t_config_option *config_look_hotlist_remove;
struct t_config_option *config_look_hotlist_short_names;
struct t_config_option *config_look_hotlist_sort;
struct t_config_option *config_look_hotlist_suffix;
@@ -2351,6 +2352,13 @@ config_weechat_init_options ()
"hotlist_prefix", "string",
N_("text displayed at the beginning of the hotlist"),
NULL, 0, 0, "H: ", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
config_look_hotlist_remove = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_remove", "integer",
N_("remove buffers in hotlist: buffer = remove buffer by buffer, "
"merged = remove all visible merged buffers at once"),
"buffer|merged",
0, 0, "buffer", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_hotlist_short_names = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_short_names", "boolean",
+7
View File
@@ -66,6 +66,12 @@ enum t_config_look_prefix_buffer_align
CONFIG_LOOK_PREFIX_BUFFER_ALIGN_RIGHT,
};
enum t_config_look_hotlist_remove
{
CONFIG_LOOK_HOTLIST_REMOVE_BUFFER = 0,
CONFIG_LOOK_HOTLIST_REMOVE_MERGED,
};
enum t_config_look_hotlist_sort
{
CONFIG_LOOK_HOTLIST_SORT_GROUP_TIME_ASC = 0,
@@ -153,6 +159,7 @@ extern struct t_config_option *config_look_hotlist_names_length;
extern struct t_config_option *config_look_hotlist_names_level;
extern struct t_config_option *config_look_hotlist_names_merged_buffers;
extern struct t_config_option *config_look_hotlist_prefix;
extern struct t_config_option *config_look_hotlist_remove;
extern struct t_config_option *config_look_hotlist_short_names;
extern struct t_config_option *config_look_hotlist_sort;
extern struct t_config_option *config_look_hotlist_suffix;
+17 -4
View File
@@ -489,7 +489,7 @@ gui_hotlist_clear ()
void
gui_hotlist_remove_buffer (struct t_gui_buffer *buffer)
{
int hotlist_changed;
int hotlist_changed, hotlist_remove, buffer_to_remove;
struct t_gui_hotlist *ptr_hotlist, *next_hotlist;
if (!buffer || weechat_upgrading)
@@ -497,14 +497,27 @@ gui_hotlist_remove_buffer (struct t_gui_buffer *buffer)
hotlist_changed = 0;
hotlist_remove = CONFIG_INTEGER(config_look_hotlist_remove);
ptr_hotlist = gui_hotlist;
while (ptr_hotlist)
{
next_hotlist = ptr_hotlist->next_hotlist;
if ((ptr_hotlist->buffer->number == buffer->number)
&& (!ptr_hotlist->buffer->zoomed
|| (ptr_hotlist->buffer->active == 2)))
buffer_to_remove = 0;
switch (hotlist_remove)
{
case CONFIG_LOOK_HOTLIST_REMOVE_BUFFER:
buffer_to_remove = (ptr_hotlist->buffer == buffer);
break;
case CONFIG_LOOK_HOTLIST_REMOVE_MERGED:
buffer_to_remove =
((ptr_hotlist->buffer->number == buffer->number)
&& (!ptr_hotlist->buffer->zoomed
|| (ptr_hotlist->buffer->active == 2)));
break;
}
if (buffer_to_remove)
{
gui_hotlist_free (&gui_hotlist, &last_gui_hotlist, ptr_hotlist);
hotlist_changed = 1;