diff --git a/ReleaseNotes.adoc b/ReleaseNotes.adoc index 28da82136..5230beca9 100644 --- a/ReleaseNotes.adoc +++ b/ReleaseNotes.adoc @@ -27,14 +27,29 @@ A new plugin called "buflist" has been added, it replaces the script "buffers.pl If the script is installed, you will see two sidebars with list of buffers. -If you fell in love with buflist, you can uninstall the script and remove its bar -with these commands: +If you fell in love with buflist and that the script buffers.pl is installed, +you can uninstall the script and remove its bar with these commands: ---- /script remove buffers.pl /bar del buffers ---- +If you don't want the list of buffers, you can disable buflist: + +---- +/set buflist.look.enabled off +---- + +To save extra memory, you can even unload the buflist plugin, remove the bar and +prevent the plugin from loading on next startup: + +---- +/plugin unload buflist +/bar del buflist +/set weechat.plugin.autoload "*,!buflist" +---- + [[v1.8_aspell_options]] === Aspell options diff --git a/doc/de/autogen/user/buflist_options.adoc b/doc/de/autogen/user/buflist_options.adoc index 198da344e..24b8969d7 100644 --- a/doc/de/autogen/user/buflist_options.adoc +++ b/doc/de/autogen/user/buflist_options.adoc @@ -86,6 +86,12 @@ ** Werte: beliebige Zeichenkette ** Standardwert: `+"${buffer.hidden}==0"+` +* [[option_buflist.look.enabled]] *buflist.look.enabled* +** Beschreibung: pass:none[enable buflist] +** Typ: boolesch +** Werte: on, off +** Standardwert: `+on+` + * [[option_buflist.look.mouse_jump_visited_buffer]] *buflist.look.mouse_jump_visited_buffer* ** Beschreibung: pass:none[ist diese Einstellung aktiviert, kann mit der linken/rechten Maustaste auf dem aktuellen Buffer zum vorherigen/nächsten Buffer gesprungen werden] ** Typ: boolesch diff --git a/doc/en/autogen/user/buflist_options.adoc b/doc/en/autogen/user/buflist_options.adoc index 5a85346e9..d62499951 100644 --- a/doc/en/autogen/user/buflist_options.adoc +++ b/doc/en/autogen/user/buflist_options.adoc @@ -86,6 +86,12 @@ ** values: any string ** default value: `+"${buffer.hidden}==0"+` +* [[option_buflist.look.enabled]] *buflist.look.enabled* +** description: pass:none[enable buflist] +** type: boolean +** values: on, off +** default value: `+on+` + * [[option_buflist.look.mouse_jump_visited_buffer]] *buflist.look.mouse_jump_visited_buffer* ** description: pass:none[if enabled, clicks with left/right buttons on the line with current buffer jump to previous/next visited buffer] ** type: boolean diff --git a/doc/fr/autogen/user/buflist_options.adoc b/doc/fr/autogen/user/buflist_options.adoc index 82098be11..3736af6ac 100644 --- a/doc/fr/autogen/user/buflist_options.adoc +++ b/doc/fr/autogen/user/buflist_options.adoc @@ -86,6 +86,12 @@ ** valeurs: toute chaîne ** valeur par défaut: `+"${buffer.hidden}==0"+` +* [[option_buflist.look.enabled]] *buflist.look.enabled* +** description: pass:none[activer buflist] +** type: booléen +** valeurs: on, off +** valeur par défaut: `+on+` + * [[option_buflist.look.mouse_jump_visited_buffer]] *buflist.look.mouse_jump_visited_buffer* ** description: pass:none[si activé, les clics avec les boutons gauche/droit sur la ligne avec le tampon courant sautent au tampon visité avant/après] ** type: booléen diff --git a/doc/it/autogen/user/buflist_options.adoc b/doc/it/autogen/user/buflist_options.adoc index bddc29bec..d4b9ebf7b 100644 --- a/doc/it/autogen/user/buflist_options.adoc +++ b/doc/it/autogen/user/buflist_options.adoc @@ -86,6 +86,12 @@ ** valori: qualsiasi stringa ** valore predefinito: `+"${buffer.hidden}==0"+` +* [[option_buflist.look.enabled]] *buflist.look.enabled* +** descrizione: pass:none[enable buflist] +** tipo: bool +** valori: on, off +** valore predefinito: `+on+` + * [[option_buflist.look.mouse_jump_visited_buffer]] *buflist.look.mouse_jump_visited_buffer* ** descrizione: pass:none[if enabled, clicks with left/right buttons on the line with current buffer jump to previous/next visited buffer] ** tipo: bool diff --git a/doc/ja/autogen/user/buflist_options.adoc b/doc/ja/autogen/user/buflist_options.adoc index 979daacc5..bc9f9b457 100644 --- a/doc/ja/autogen/user/buflist_options.adoc +++ b/doc/ja/autogen/user/buflist_options.adoc @@ -86,6 +86,12 @@ ** 値: 未制約文字列 ** デフォルト値: `+"${buffer.hidden}==0"+` +* [[option_buflist.look.enabled]] *buflist.look.enabled* +** 説明: pass:none[enable buflist] +** タイプ: ブール +** 値: on, off +** デフォルト値: `+on+` + * [[option_buflist.look.mouse_jump_visited_buffer]] *buflist.look.mouse_jump_visited_buffer* ** 説明: pass:none[有効の場合、現在のバッファを示す行で左または右ボタンをクリックすることで一つ前または次の訪問済みバッファに移動します] ** タイプ: ブール diff --git a/doc/pl/autogen/user/buflist_options.adoc b/doc/pl/autogen/user/buflist_options.adoc index 2f93781dd..b64681bdc 100644 --- a/doc/pl/autogen/user/buflist_options.adoc +++ b/doc/pl/autogen/user/buflist_options.adoc @@ -86,6 +86,12 @@ ** wartości: dowolny ciąg ** domyślna wartość: `+"${buffer.hidden}==0"+` +* [[option_buflist.look.enabled]] *buflist.look.enabled* +** opis: pass:none[enable buflist] +** typ: bool +** wartości: on, off +** domyślna wartość: `+on+` + * [[option_buflist.look.mouse_jump_visited_buffer]] *buflist.look.mouse_jump_visited_buffer* ** opis: pass:none[if enabled, clicks with left/right buttons on the line with current buffer jump to previous/next visited buffer] ** typ: bool diff --git a/po/cs.po b/po/cs.po index a0defe19c..1700d41e4 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-02 07:33+0200\n" +"POT-Creation-Date: 2017-05-05 23:16+0200\n" "PO-Revision-Date: 2017-01-06 21:59+0100\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -4966,6 +4966,9 @@ msgid "" "=core.weechat) || ${buffer.active}==1)\"" msgstr "" +msgid "enable buflist" +msgstr "" + msgid "" "if enabled, clicks with left/right buttons on the line with current buffer " "jump to previous/next visited buffer" diff --git a/po/de.po b/po/de.po index 27668377c..55d8c46c5 100644 --- a/po/de.po +++ b/po/de.po @@ -19,7 +19,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-02 07:33+0200\n" +"POT-Creation-Date: 2017-05-05 23:16+0200\n" "PO-Revision-Date: 2017-05-03 23:14+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -5909,6 +5909,9 @@ msgstr "" "\"${buffer.hidden}==0 && ((${type}!=server && ${buffer.full_name}!=core." "weechat) || ${buffer.active}==1)\"" +msgid "enable buflist" +msgstr "" + msgid "" "if enabled, clicks with left/right buttons on the line with current buffer " "jump to previous/next visited buffer" diff --git a/po/es.po b/po/es.po index 789b8d56b..9bd52c75d 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-02 07:33+0200\n" +"POT-Creation-Date: 2017-05-05 23:16+0200\n" "PO-Revision-Date: 2017-01-06 22:01+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -5179,6 +5179,9 @@ msgid "" "=core.weechat) || ${buffer.active}==1)\"" msgstr "" +msgid "enable buflist" +msgstr "" + msgid "" "if enabled, clicks with left/right buttons on the line with current buffer " "jump to previous/next visited buffer" diff --git a/po/fr.po b/po/fr.po index a30bb6f23..6e78e4bd3 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-02 07:33+0200\n" -"PO-Revision-Date: 2017-05-02 07:34+0200\n" +"POT-Creation-Date: 2017-05-05 23:16+0200\n" +"PO-Revision-Date: 2017-05-05 23:17+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -5778,6 +5778,9 @@ msgstr "" "fusionnés avec le tampon \"core\" : \"${buffer.hidden}==0 && ((${type}!" "=server && ${buffer.full_name}!=core.weechat) || ${buffer.active}==1)\"" +msgid "enable buflist" +msgstr "activer buflist" + msgid "" "if enabled, clicks with left/right buttons on the line with current buffer " "jump to previous/next visited buffer" diff --git a/po/hu.po b/po/hu.po index 3f6ce73f0..f1fcfc8fe 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-02 07:33+0200\n" +"POT-Creation-Date: 2017-05-05 23:16+0200\n" "PO-Revision-Date: 2017-01-06 22:03+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -4503,6 +4503,9 @@ msgid "" "=core.weechat) || ${buffer.active}==1)\"" msgstr "" +msgid "enable buflist" +msgstr "" + msgid "" "if enabled, clicks with left/right buttons on the line with current buffer " "jump to previous/next visited buffer" diff --git a/po/it.po b/po/it.po index dc68b9540..dad5cbb9f 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-02 07:33+0200\n" +"POT-Creation-Date: 2017-05-05 23:16+0200\n" "PO-Revision-Date: 2017-01-06 22:04+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -5317,6 +5317,9 @@ msgid "" "=core.weechat) || ${buffer.active}==1)\"" msgstr "" +msgid "enable buflist" +msgstr "" + msgid "" "if enabled, clicks with left/right buttons on the line with current buffer " "jump to previous/next visited buffer" diff --git a/po/ja.po b/po/ja.po index 1cf298d7b..780c8dd37 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-02 07:33+0200\n" +"POT-Creation-Date: 2017-05-05 23:16+0200\n" "PO-Revision-Date: 2017-05-02 09:00+0900\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: weechat-dev \n" @@ -5571,6 +5571,9 @@ msgid "" "=core.weechat) || ${buffer.active}==1)\"" msgstr "" +msgid "enable buflist" +msgstr "" + msgid "" "if enabled, clicks with left/right buttons on the line with current buffer " "jump to previous/next visited buffer" diff --git a/po/pt.po b/po/pt.po index 12529f0f6..297d5a3a0 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-02 07:33+0200\n" +"POT-Creation-Date: 2017-05-05 23:16+0200\n" "PO-Revision-Date: 2017-04-08 14:50+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -5573,6 +5573,9 @@ msgid "" "=core.weechat) || ${buffer.active}==1)\"" msgstr "" +msgid "enable buflist" +msgstr "" + msgid "" "if enabled, clicks with left/right buttons on the line with current buffer " "jump to previous/next visited buffer" diff --git a/po/pt_BR.po b/po/pt_BR.po index c695bf0db..d602c12b2 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-02 07:33+0200\n" +"POT-Creation-Date: 2017-05-05 23:16+0200\n" "PO-Revision-Date: 2016-09-03 08:24+0200\n" "Last-Translator: Eduardo Elias \n" "Language-Team: weechat-dev \n" @@ -5119,6 +5119,9 @@ msgid "" "=core.weechat) || ${buffer.active}==1)\"" msgstr "" +msgid "enable buflist" +msgstr "" + msgid "" "if enabled, clicks with left/right buttons on the line with current buffer " "jump to previous/next visited buffer" diff --git a/po/ru.po b/po/ru.po index f8ec8e04b..d84e3f59b 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-02 07:33+0200\n" +"POT-Creation-Date: 2017-05-05 23:16+0200\n" "PO-Revision-Date: 2017-01-06 22:06+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -4541,6 +4541,9 @@ msgid "" "=core.weechat) || ${buffer.active}==1)\"" msgstr "" +msgid "enable buflist" +msgstr "" + msgid "" "if enabled, clicks with left/right buttons on the line with current buffer " "jump to previous/next visited buffer" diff --git a/po/tr.po b/po/tr.po index 5248d5671..98305d0fd 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-02 07:33+0200\n" +"POT-Creation-Date: 2017-05-05 23:16+0200\n" "PO-Revision-Date: 2017-01-06 22:07+0100\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -4106,6 +4106,9 @@ msgid "" "=core.weechat) || ${buffer.active}==1)\"" msgstr "" +msgid "enable buflist" +msgstr "" + msgid "" "if enabled, clicks with left/right buttons on the line with current buffer " "jump to previous/next visited buffer" diff --git a/po/weechat.pot b/po/weechat.pot index 39608f419..4279c29f8 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-02 07:33+0200\n" +"POT-Creation-Date: 2017-05-05 23:16+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -4091,6 +4091,9 @@ msgid "" "=core.weechat) || ${buffer.active}==1)\"" msgstr "" +msgid "enable buflist" +msgstr "" + msgid "" "if enabled, clicks with left/right buttons on the line with current buffer " "jump to previous/next visited buffer" diff --git a/src/plugins/buflist/buflist-bar-item.c b/src/plugins/buflist/buflist-bar-item.c index 46a275aed..39f86d691 100644 --- a/src/plugins/buflist/buflist-bar-item.c +++ b/src/plugins/buflist/buflist-bar-item.c @@ -37,6 +37,17 @@ struct t_hashtable *buflist_hashtable_options_conditions = NULL; struct t_arraylist *buflist_list_buffers = NULL; +/* + * Updates buflist bar item if buflist is enabled. + */ + +void +buflist_bar_item_update () +{ + if (weechat_config_boolean (buflist_config_look_enabled)) + weechat_bar_item_update (BUFLIST_BAR_ITEM_NAME); +} + /* * Returns content of bar item "buffer_plugin": bar item with buffer plugin. */ @@ -79,6 +90,9 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, (void) buffer; (void) extra_info; + if (!weechat_config_boolean (buflist_config_look_enabled)) + return NULL; + prev_number = -1; buflist = weechat_string_dyn_alloc (256); diff --git a/src/plugins/buflist/buflist-bar-item.h b/src/plugins/buflist/buflist-bar-item.h index c015e87ad..c8626c0cf 100644 --- a/src/plugins/buflist/buflist-bar-item.h +++ b/src/plugins/buflist/buflist-bar-item.h @@ -24,6 +24,7 @@ extern struct t_arraylist *buflist_list_buffers; +extern void buflist_bar_item_update (); extern int buflist_bar_item_init (); extern void buflist_bar_item_end (); diff --git a/src/plugins/buflist/buflist-command.c b/src/plugins/buflist/buflist-command.c index 18bbb101c..9a186e0ae 100644 --- a/src/plugins/buflist/buflist-command.c +++ b/src/plugins/buflist/buflist-command.c @@ -52,7 +52,7 @@ buflist_command_buflist (const void *pointer, void *data, if (weechat_strcasecmp (argv[1], "refresh") == 0) { - weechat_bar_item_update (BUFLIST_BAR_ITEM_NAME); + buflist_bar_item_update (); return WEECHAT_RC_OK; } diff --git a/src/plugins/buflist/buflist-config.c b/src/plugins/buflist/buflist-config.c index 87ca1f8c1..86ede28bc 100644 --- a/src/plugins/buflist/buflist-config.c +++ b/src/plugins/buflist/buflist-config.c @@ -33,6 +33,7 @@ struct t_config_file *buflist_config_file = NULL; /* buflist config, look section */ struct t_config_option *buflist_config_look_display_conditions; +struct t_config_option *buflist_config_look_enabled; struct t_config_option *buflist_config_look_mouse_jump_visited_buffer; struct t_config_option *buflist_config_look_mouse_move_buffer; struct t_config_option *buflist_config_look_mouse_wheel; @@ -60,29 +61,6 @@ char **buflist_config_sort_fields = NULL; int buflist_config_sort_fields_count = 0; -/* - * Callback for changes on option "buflist.look.sort". - */ - -void -buflist_config_change_sort (const void *pointer, void *data, - struct t_config_option *option) -{ - /* make C compiler happy */ - (void) pointer; - (void) data; - (void) option; - - if (buflist_config_sort_fields) - weechat_string_free_split (buflist_config_sort_fields); - - buflist_config_sort_fields = weechat_string_split ( - weechat_config_string (buflist_config_look_sort), - ",", 0, 0, &buflist_config_sort_fields_count); - - weechat_bar_item_update (BUFLIST_BAR_ITEM_NAME); -} - /* * Frees the signals hooked for refresh. */ @@ -106,27 +84,6 @@ buflist_config_free_signals_refresh () buflist_config_num_signals_refresh = 0; } -/* - * Callback for a signal on a buffer. - */ - -int -buflist_config_signal_buffer_cb (const void *pointer, void *data, - const char *signal, const char *type_data, - void *signal_data) -{ - /* make C compiler happy */ - (void) pointer; - (void) data; - (void) signal; - (void) type_data; - (void) signal_data; - - weechat_bar_item_update (BUFLIST_BAR_ITEM_NAME); - - return WEECHAT_RC_OK; -} - /* * Compares two signals to add them in the sorted arraylist. * @@ -148,26 +105,38 @@ buflist_config_compare_signals (void *data, struct t_arraylist *arraylist, } /* - * Callback for changes on option "buflist.look.signals_refresh". + * Callback for a signal on a buffer. + */ + +int +buflist_config_signal_buffer_cb (const void *pointer, void *data, + const char *signal, const char *type_data, + void *signal_data) +{ + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) signal; + (void) type_data; + (void) signal_data; + + buflist_bar_item_update (); + + return WEECHAT_RC_OK; +} + +/* + * Hooks the signals for refresh. */ void -buflist_config_change_signals_refresh (const void *pointer, void *data, - struct t_config_option *option) +buflist_config_hook_signals_refresh () { char **all_signals, **signals; const char *ptr_signals_refresh; struct t_arraylist *signals_list; int count, i; - /* make C compiler happy */ - (void) pointer; - (void) data; - (void) option; - - if (buflist_config_signals_refresh) - buflist_config_free_signals_refresh (); - all_signals = weechat_string_dyn_alloc (256); if (!all_signals) return; @@ -232,6 +201,76 @@ buflist_config_change_signals_refresh (const void *pointer, void *data, weechat_string_dyn_free (all_signals, 1); } +/* + * Callback for changes on option "buflist.look.enabled". + */ + +void +buflist_config_change_enabled (const void *pointer, void *data, + struct t_config_option *option) +{ + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) option; + + buflist_config_free_signals_refresh (); + + if (weechat_config_boolean (buflist_config_look_enabled)) + { + /* buflist enabled */ + buflist_config_hook_signals_refresh (); + weechat_command (NULL, "/mute /bar show buflist"); + buflist_bar_item_update (); + } + else + { + /* buflist disabled */ + weechat_command (NULL, "/mute /bar hide buflist"); + weechat_bar_item_update (BUFLIST_BAR_ITEM_NAME); + } +} + +/* + * Callback for changes on option "buflist.look.sort". + */ + +void +buflist_config_change_sort (const void *pointer, void *data, + struct t_config_option *option) +{ + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) option; + + if (buflist_config_sort_fields) + weechat_string_free_split (buflist_config_sort_fields); + + buflist_config_sort_fields = weechat_string_split ( + weechat_config_string (buflist_config_look_sort), + ",", 0, 0, &buflist_config_sort_fields_count); + + buflist_bar_item_update (); +} + +/* + * Callback for changes on option "buflist.look.signals_refresh". + */ + +void +buflist_config_change_signals_refresh (const void *pointer, void *data, + struct t_config_option *option) +{ + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) option; + + buflist_config_free_signals_refresh (); + buflist_config_hook_signals_refresh (); +} + /* * Callback for changes on option "buflist.look.nick_prefix". */ @@ -246,7 +285,7 @@ buflist_config_change_nick_prefix (const void *pointer, void *data, (void) option; buflist_config_change_signals_refresh (NULL, NULL, NULL); - weechat_bar_item_update (BUFLIST_BAR_ITEM_NAME); + buflist_bar_item_update (); } /* @@ -262,7 +301,7 @@ buflist_config_change_buflist (const void *pointer, void *data, (void) data; (void) option; - weechat_bar_item_update (BUFLIST_BAR_ITEM_NAME); + buflist_bar_item_update (); } /* @@ -309,6 +348,14 @@ buflist_config_init () NULL, NULL, NULL, &buflist_config_change_buflist, NULL, NULL, NULL, NULL, NULL); + buflist_config_look_enabled = weechat_config_new_option ( + buflist_config_file, ptr_section, + "enabled", "boolean", + N_("enable buflist"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_enabled, NULL, NULL, + NULL, NULL, NULL); buflist_config_look_mouse_jump_visited_buffer = weechat_config_new_option ( buflist_config_file, ptr_section, "mouse_jump_visited_buffer", "boolean", diff --git a/src/plugins/buflist/buflist-config.h b/src/plugins/buflist/buflist-config.h index f80524c32..e62cb36c9 100644 --- a/src/plugins/buflist/buflist-config.h +++ b/src/plugins/buflist/buflist-config.h @@ -33,6 +33,7 @@ extern struct t_config_file *buflist_config_file; extern struct t_config_option *buflist_config_look_display_conditions; +extern struct t_config_option *buflist_config_look_enabled; extern struct t_config_option *buflist_config_look_mouse_jump_visited_buffer; extern struct t_config_option *buflist_config_look_mouse_move_buffer; extern struct t_config_option *buflist_config_look_mouse_wheel; diff --git a/src/plugins/buflist/buflist.c b/src/plugins/buflist/buflist.c index 82dde140a..7c98cc7e0 100644 --- a/src/plugins/buflist/buflist.c +++ b/src/plugins/buflist/buflist.c @@ -448,7 +448,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) "default", "default", "default", "on", BUFLIST_BAR_ITEM_NAME); - weechat_bar_item_update (BUFLIST_BAR_ITEM_NAME); + buflist_bar_item_update (); buflist_mouse_init ();