summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.asciidoc2
-rw-r--r--ReleaseNotes.asciidoc18
-rw-r--r--doc/de/autogen/user/weechat_options.txt8
-rw-r--r--doc/en/autogen/user/weechat_options.txt8
-rw-r--r--doc/fr/autogen/user/weechat_options.txt8
-rw-r--r--doc/it/autogen/user/weechat_options.txt8
-rw-r--r--doc/ja/autogen/user/weechat_options.txt8
-rw-r--r--doc/pl/autogen/user/weechat_options.txt8
-rw-r--r--po/cs.po17
-rw-r--r--po/de.po19
-rw-r--r--po/es.po19
-rw-r--r--po/fr.po27
-rw-r--r--po/hu.po16
-rw-r--r--po/it.po17
-rw-r--r--po/ja.po17
-rw-r--r--po/pl.po17
-rw-r--r--po/pt_BR.po18
-rw-r--r--po/ru.po16
-rw-r--r--po/tr.po13
-rw-r--r--po/weechat.pot13
-rw-r--r--src/core/wee-config.c18
-rw-r--r--src/core/wee-config.h2
-rw-r--r--src/gui/curses/gui-curses-main.c4
-rw-r--r--src/gui/gui-hotlist.c100
-rw-r--r--src/gui/gui-hotlist.h1
25 files changed, 250 insertions, 152 deletions
diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc
index 50b88e4db..8dc6163df 100644
--- a/ChangeLog.asciidoc
+++ b/ChangeLog.asciidoc
@@ -15,6 +15,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
== Version 0.4.4 (under dev)
+* core: add option weechat.look.hotlist_add_conditions, remove option
+ weechat.look.hotlist_add_buffer_if_away
* core: fix recursive calls to function eval_expression
* core: mute all buffers by default in command /mute (replace option -all by
-core)
diff --git a/ReleaseNotes.asciidoc b/ReleaseNotes.asciidoc
index 5a2b6e9fe..a5b327a95 100644
--- a/ReleaseNotes.asciidoc
+++ b/ReleaseNotes.asciidoc
@@ -17,6 +17,24 @@ http://weechat.org/files/changelog/ChangeLog-devel.html[ChangeLog]
== Version 0.4.4 (under dev)
+=== Hotlist conditions
+
+A new option 'weechat.look.hotlist_add_conditions' has been added. This option
+replaces the option 'weechat.look.hotlist_add_buffer_if_away', which has been
+removed.
+
+Default conditions are `${away} || ${buffer.num_displayed} == 0`, which means
+that a buffer is added in hotlist if you are away ("away" local variable is
+set), or if the buffer is not visible on screen (not displayed in any window).
+
+If you have set 'weechat.look.hotlist_add_buffer_if_away' to `off` (to not add
+current buffer in hotlist when you are away), then you must manually change the
+default conditions with the following command:
+
+----
+/set weechat.look.hotlist_add_conditions "${buffer.num_displayed} == 0"
+----
+
=== Rmodifier replaced by Trigger plugin
The trigger plugin replaces the rmodifier plugin, which has been removed
diff --git a/doc/de/autogen/user/weechat_options.txt b/doc/de/autogen/user/weechat_options.txt
index 4c8f1eb3f..536cea44a 100644
--- a/doc/de/autogen/user/weechat_options.txt
+++ b/doc/de/autogen/user/weechat_options.txt
@@ -558,10 +558,10 @@
** Typ: Zeichenkette
** Werte: beliebige Zeichenkette (Standardwert: `""`)
-* [[option_weechat.look.hotlist_add_buffer_if_away]] *weechat.look.hotlist_add_buffer_if_away*
-** Beschreibung: `fügt einen beliebigen Buffer zur Hotlist hinzu (dies schließt den aktuellen oder jeden anderen sichtbaren Buffer ein), sofern die lokale Variable "away" für den Buffer gesetzt wurde`
-** Typ: boolesch
-** Werte: on, off (Standardwert: `on`)
+* [[option_weechat.look.hotlist_add_conditions]] *weechat.look.hotlist_add_conditions*
+** Beschreibung: `conditions to add a buffer in hotlist (if notify level is OK for the buffer); you can use in these conditions: "window" (current window pointer), "buffer" (buffer pointer to add in hotlist), "priority" (0 = low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added to hotlist if you are away, or if the buffer is not visible on screen (not displayed in any window)`
+** Typ: Zeichenkette
+** Werte: beliebige Zeichenkette (Standardwert: `"${away} || ${buffer.num_displayed} == 0"`)
* [[option_weechat.look.hotlist_buffer_separator]] *weechat.look.hotlist_buffer_separator*
** Beschreibung: `Zeichen welches zum Trennen zwischen den verschiedenen Buffern in der Hotlist genutzt werden soll`
diff --git a/doc/en/autogen/user/weechat_options.txt b/doc/en/autogen/user/weechat_options.txt
index 013d195c8..c670a89e0 100644
--- a/doc/en/autogen/user/weechat_options.txt
+++ b/doc/en/autogen/user/weechat_options.txt
@@ -558,10 +558,10 @@
** type: string
** values: any string (default value: `""`)
-* [[option_weechat.look.hotlist_add_buffer_if_away]] *weechat.look.hotlist_add_buffer_if_away*
-** description: `add any buffer to hotlist (including current or visible buffers) if local variable "away" is set on buffer`
-** type: boolean
-** values: on, off (default value: `on`)
+* [[option_weechat.look.hotlist_add_conditions]] *weechat.look.hotlist_add_conditions*
+** description: `conditions to add a buffer in hotlist (if notify level is OK for the buffer); you can use in these conditions: "window" (current window pointer), "buffer" (buffer pointer to add in hotlist), "priority" (0 = low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added to hotlist if you are away, or if the buffer is not visible on screen (not displayed in any window)`
+** type: string
+** values: any string (default value: `"${away} || ${buffer.num_displayed} == 0"`)
* [[option_weechat.look.hotlist_buffer_separator]] *weechat.look.hotlist_buffer_separator*
** description: `string displayed between buffers in hotlist`
diff --git a/doc/fr/autogen/user/weechat_options.txt b/doc/fr/autogen/user/weechat_options.txt
index e5eefb22d..8246cc087 100644
--- a/doc/fr/autogen/user/weechat_options.txt
+++ b/doc/fr/autogen/user/weechat_options.txt
@@ -558,10 +558,10 @@
** type: chaîne
** valeurs: toute chaîne (valeur par défaut: `""`)
-* [[option_weechat.look.hotlist_add_buffer_if_away]] *weechat.look.hotlist_add_buffer_if_away*
-** description: `ajouter tout tampon dans la hotlist (incluant le tampon courant ou les tampons visibles) si la variable locale "away" est définie sur le tampon`
-** type: booléen
-** valeurs: on, off (valeur par défaut: `on`)
+* [[option_weechat.look.hotlist_add_conditions]] *weechat.look.hotlist_add_conditions*
+** description: `conditions pour ajouter un tampon dans la hotlist (si le niveau de notification est OK pour le tampon); vous pouvez utiliser dans ces conditions : \"window\" (pointeur de la fenêtre courante), \"buffer\" (pointeur du tampon à ajouter dans la hotlist), "priority" (0 = faible, 1 = message, 2 = privé, 3 = highlight); par défaut un tampon est ajouté dans la hotlist si vous êtes absent, ou si le tampon n'est pas visible à l'écran (pas affiché dans une fenêtre)`
+** type: chaîne
+** valeurs: toute chaîne (valeur par défaut: `"${away} || ${buffer.num_displayed} == 0"`)
* [[option_weechat.look.hotlist_buffer_separator]] *weechat.look.hotlist_buffer_separator*
** description: `chaîne affichée entre les tampons dans la hotlist`
diff --git a/doc/it/autogen/user/weechat_options.txt b/doc/it/autogen/user/weechat_options.txt
index ba8347dc1..a1ae1b8f3 100644
--- a/doc/it/autogen/user/weechat_options.txt
+++ b/doc/it/autogen/user/weechat_options.txt
@@ -558,10 +558,10 @@
** tipo: stringa
** valori: qualsiasi stringa (valore predefinito: `""`)
-* [[option_weechat.look.hotlist_add_buffer_if_away]] *weechat.look.hotlist_add_buffer_if_away*
-** descrizione: `aggiunge qualsiasi buffer alla hotlist (inclusi buffer corrente o visibili) se la variabile locale "away" è impostata sul buffer`
-** tipo: bool
-** valori: on, off (valore predefinito: `on`)
+* [[option_weechat.look.hotlist_add_conditions]] *weechat.look.hotlist_add_conditions*
+** descrizione: `conditions to add a buffer in hotlist (if notify level is OK for the buffer); you can use in these conditions: "window" (current window pointer), "buffer" (buffer pointer to add in hotlist), "priority" (0 = low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added to hotlist if you are away, or if the buffer is not visible on screen (not displayed in any window)`
+** tipo: stringa
+** valori: qualsiasi stringa (valore predefinito: `"${away} || ${buffer.num_displayed} == 0"`)
* [[option_weechat.look.hotlist_buffer_separator]] *weechat.look.hotlist_buffer_separator*
** descrizione: `stringa mostrata tra i buffer nella hotlist`
diff --git a/doc/ja/autogen/user/weechat_options.txt b/doc/ja/autogen/user/weechat_options.txt
index 13e7e672f..ec9cb7fae 100644
--- a/doc/ja/autogen/user/weechat_options.txt
+++ b/doc/ja/autogen/user/weechat_options.txt
@@ -558,10 +558,10 @@
** タイプ: 文字列
** 値: 未制約文字列 (デフォルト値: `""`)
-* [[option_weechat.look.hotlist_add_buffer_if_away]] *weechat.look.hotlist_add_buffer_if_away*
-** 説明: `バッファにローカル変数 "away" がセットされていれば任意のバッファをホットリストに追加 (現在のバッファと目に見えるバッファを含む)`
-** タイプ: ブール
-** 値: on, off (デフォルト値: `on`)
+* [[option_weechat.look.hotlist_add_conditions]] *weechat.look.hotlist_add_conditions*
+** 説明: `conditions to add a buffer in hotlist (if notify level is OK for the buffer); you can use in these conditions: "window" (current window pointer), "buffer" (buffer pointer to add in hotlist), "priority" (0 = low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added to hotlist if you are away, or if the buffer is not visible on screen (not displayed in any window)`
+** タイプ: 文字列
+** 値: 未制約文字列 (デフォルト値: `"${away} || ${buffer.num_displayed} == 0"`)
* [[option_weechat.look.hotlist_buffer_separator]] *weechat.look.hotlist_buffer_separator*
** 説明: `ホットリストにあるバッファの間に表示される文字列`
diff --git a/doc/pl/autogen/user/weechat_options.txt b/doc/pl/autogen/user/weechat_options.txt
index d93fb968c..2d7ffd5f8 100644
--- a/doc/pl/autogen/user/weechat_options.txt
+++ b/doc/pl/autogen/user/weechat_options.txt
@@ -558,10 +558,10 @@
** typ: ciąg
** wartości: dowolny ciąg (domyślna wartość: `""`)
-* [[option_weechat.look.hotlist_add_buffer_if_away]] *weechat.look.hotlist_add_buffer_if_away*
-** opis: `dodaje dowolny bufor do hotlisty (włączając obecny lub widoczne bufory) jeśli lokalna zmienna "away" jest ustawiona dla bufora`
-** typ: bool
-** wartości: on, off (domyślna wartość: `on`)
+* [[option_weechat.look.hotlist_add_conditions]] *weechat.look.hotlist_add_conditions*
+** opis: `conditions to add a buffer in hotlist (if notify level is OK for the buffer); you can use in these conditions: "window" (current window pointer), "buffer" (buffer pointer to add in hotlist), "priority" (0 = low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added to hotlist if you are away, or if the buffer is not visible on screen (not displayed in any window)`
+** typ: ciąg
+** wartości: dowolny ciąg (domyślna wartość: `"${away} || ${buffer.num_displayed} == 0"`)
* [[option_weechat.look.hotlist_buffer_separator]] *weechat.look.hotlist_buffer_separator*
** opis: `ciąg znaków wyświetlany pomiędzy buforami w hotliście`
diff --git a/po/cs.po b/po/cs.po
index c1ade6b49..65eff7cca 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -20,8 +20,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-03-05 11:39+0100\n"
-"PO-Revision-Date: 2014-03-04 11:20+0100\n"
+"POT-Creation-Date: 2014-03-06 19:25+0100\n"
+"PO-Revision-Date: 2014-03-06 18:56+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: cs\n"
@@ -2865,11 +2865,13 @@ msgid ""
msgstr ""
msgid ""
-"add any buffer to hotlist (including current or visible buffers) if local "
-"variable \"away\" is set on buffer"
+"conditions to add a buffer in hotlist (if notify level is OK for the "
+"buffer); you can use in these conditions: \"window\" (current window "
+"pointer), \"buffer\" (buffer pointer to add in hotlist), \"priority\" (0 = "
+"low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added "
+"to hotlist if you are away, or if the buffer is not visible on screen (not "
+"displayed in any window)"
msgstr ""
-"přidat do hotlistu jakýkoliv buffer (včetně aktuálního nebo viditelných "
-"bufferů), když je nastavena hodnota \"away\" v bufferu"
msgid "string displayed between buffers in hotlist"
msgstr "řetězec zobrazený mezi buffery v hotlistu"
@@ -4115,9 +4117,6 @@ msgstr[2] "normálních"
msgid "Debug disabled for cursor mode"
msgstr "Ladění vypnuto pro \"%s\""
-msgid "Error: not enough memory to add a buffer to hotlist"
-msgstr "Chyba: nedostatek paměti pro přidáni bufferu do hotlistu"
-
#, fuzzy, c-format
msgid "New key binding (context \"%s\"): %s%s => %s%s"
msgstr "Nová klávesová zkratka: %s%s => %s%s"
diff --git a/po/de.po b/po/de.po
index 1965f31cb..9bc4e734a 100644
--- a/po/de.po
+++ b/po/de.po
@@ -22,8 +22,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-03-05 11:39+0100\n"
-"PO-Revision-Date: 2014-03-04 11:21+0100\n"
+"POT-Creation-Date: 2014-03-06 19:25+0100\n"
+"PO-Revision-Date: 2014-03-06 18:56+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
"Language: de_DE\n"
@@ -3339,12 +3339,13 @@ msgstr ""
"die mit \"toto\" beginnen"
msgid ""
-"add any buffer to hotlist (including current or visible buffers) if local "
-"variable \"away\" is set on buffer"
+"conditions to add a buffer in hotlist (if notify level is OK for the "
+"buffer); you can use in these conditions: \"window\" (current window "
+"pointer), \"buffer\" (buffer pointer to add in hotlist), \"priority\" (0 = "
+"low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added "
+"to hotlist if you are away, or if the buffer is not visible on screen (not "
+"displayed in any window)"
msgstr ""
-"fügt einen beliebigen Buffer zur Hotlist hinzu (dies schließt den aktuellen "
-"oder jeden anderen sichtbaren Buffer ein), sofern die lokale Variable \"away"
-"\" für den Buffer gesetzt wurde"
msgid "string displayed between buffers in hotlist"
msgstr ""
@@ -4767,10 +4768,6 @@ msgstr[1] "normale"
msgid "Debug disabled for cursor mode"
msgstr "Debug für Cursor Modus deaktiviert"
-msgid "Error: not enough memory to add a buffer to hotlist"
-msgstr ""
-"Fehler: nicht genügend Speicher um den Buffer der Hotlist hinzu zu fügen"
-
#, c-format
msgid "New key binding (context \"%s\"): %s%s => %s%s"
msgstr "Neue Tastenbelegung (Kontext \"%s\"): %s%s => %s%s"
diff --git a/po/es.po b/po/es.po
index a135d7165..881b141e4 100644
--- a/po/es.po
+++ b/po/es.po
@@ -22,8 +22,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-03-05 11:39+0100\n"
-"PO-Revision-Date: 2014-03-04 11:21+0100\n"
+"POT-Creation-Date: 2014-03-06 19:25+0100\n"
+"PO-Revision-Date: 2014-03-06 18:56+0100\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: es\n"
@@ -3024,11 +3024,13 @@ msgid ""
msgstr ""
msgid ""
-"add any buffer to hotlist (including current or visible buffers) if local "
-"variable \"away\" is set on buffer"
+"conditions to add a buffer in hotlist (if notify level is OK for the "
+"buffer); you can use in these conditions: \"window\" (current window "
+"pointer), \"buffer\" (buffer pointer to add in hotlist), \"priority\" (0 = "
+"low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added "
+"to hotlist if you are away, or if the buffer is not visible on screen (not "
+"displayed in any window)"
msgstr ""
-"agrega cualquier buffer a la lista de actividad (incluyendo actual o buffers "
-"visibles) si la variable local \"away\" está activada en el buffer"
msgid "string displayed between buffers in hotlist"
msgstr "cadena mostrada entre los buffers en la lista de actividad"
@@ -4324,11 +4326,6 @@ msgstr[1] "normales"
msgid "Debug disabled for cursor mode"
msgstr "Depurado para el modo cursor desactivado"
-msgid "Error: not enough memory to add a buffer to hotlist"
-msgstr ""
-"Error: no hay suficiente memoria para agregar el buffer a la lista de "
-"actividad"
-
#, c-format
msgid "New key binding (context \"%s\"): %s%s => %s%s"
msgstr "Nuevo atajo (contexto \"%s\"): %s%s => %s%s"
diff --git a/po/fr.po b/po/fr.po
index 44c659009..d42b2f425 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: 2014-03-05 11:39+0100\n"
-"PO-Revision-Date: 2014-03-05 11:36+0100\n"
+"POT-Creation-Date: 2014-03-06 19:25+0100\n"
+"PO-Revision-Date: 2014-03-06 19:26+0100\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -3247,11 +3247,20 @@ msgstr ""
"commençant par \"toto\""
msgid ""
-"add any buffer to hotlist (including current or visible buffers) if local "
-"variable \"away\" is set on buffer"
+"conditions to add a buffer in hotlist (if notify level is OK for the "
+"buffer); you can use in these conditions: \"window\" (current window "
+"pointer), \"buffer\" (buffer pointer to add in hotlist), \"priority\" (0 = "
+"low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added "
+"to hotlist if you are away, or if the buffer is not visible on screen (not "
+"displayed in any window)"
msgstr ""
-"ajouter tout tampon dans la hotlist (incluant le tampon courant ou les "
-"tampons visibles) si la variable locale \"away\" est définie sur le tampon"
+"conditions pour ajouter un tampon dans la hotlist (si le niveau de "
+"notification est OK pour le tampon); vous pouvez utiliser dans ces "
+"conditions : \\\"window\\\" (pointeur de la fenêtre courante), \\\"buffer\\"
+"\" (pointeur du tampon à ajouter dans la hotlist), \"priority\" (0 = faible, "
+"1 = message, 2 = privé, 3 = highlight); par défaut un tampon est ajouté dans "
+"la hotlist si vous êtes absent, ou si le tampon n'est pas visible à l'écran "
+"(pas affiché dans une fenêtre)"
msgid "string displayed between buffers in hotlist"
msgstr "chaîne affichée entre les tampons dans la hotlist"
@@ -4652,9 +4661,6 @@ msgstr[1] "normaux"
msgid "Debug disabled for cursor mode"
msgstr "Debug désactivé pour le mode curseur"
-msgid "Error: not enough memory to add a buffer to hotlist"
-msgstr "Erreur: impossible d'ajouter le tampon à la liste des tampons actifs"
-
#, c-format
msgid "New key binding (context \"%s\"): %s%s => %s%s"
msgstr "Nouvelle touche (contexte \"%s\"): %s%s => %s%s"
@@ -11340,6 +11346,3 @@ msgstr ""
#, c-format
msgid "%s%s: timeout for \"%s\" with %s"
msgstr "%s%s: délai d'attente dépassé pour \"%s\" avec %s"
-
-#~ msgid "number of clients for relay (for optional status)"
-#~ msgstr "nombre de clients pour le relai"
diff --git a/po/hu.po b/po/hu.po
index addb858fe..abe9f07b7 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -20,8 +20,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-03-05 11:39+0100\n"
-"PO-Revision-Date: 2014-03-04 11:21+0100\n"
+"POT-Creation-Date: 2014-03-06 19:25+0100\n"
+"PO-Revision-Date: 2014-03-06 18:56+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: hu\n"
@@ -2507,8 +2507,12 @@ msgid ""
msgstr ""
msgid ""
-"add any buffer to hotlist (including current or visible buffers) if local "
-"variable \"away\" is set on buffer"
+"conditions to add a buffer in hotlist (if notify level is OK for the "
+"buffer); you can use in these conditions: \"window\" (current window "
+"pointer), \"buffer\" (buffer pointer to add in hotlist), \"priority\" (0 = "
+"low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added "
+"to hotlist if you are away, or if the buffer is not visible on screen (not "
+"displayed in any window)"
msgstr ""
#, fuzzy
@@ -3739,10 +3743,6 @@ msgstr[1] "normál"
msgid "Debug disabled for cursor mode"
msgstr ""
-#, fuzzy
-msgid "Error: not enough memory to add a buffer to hotlist"
-msgstr "%s nincs elég memória az ignore elkészítéséhez\n"
-
#, fuzzy, c-format
msgid "New key binding (context \"%s\"): %s%s => %s%s"
msgstr "Új billentyűparancs: %s"
diff --git a/po/it.po b/po/it.po
index 403965c2d..e243c846d 100644
--- a/po/it.po
+++ b/po/it.po
@@ -20,8 +20,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-03-05 11:39+0100\n"
-"PO-Revision-Date: 2014-03-04 11:21+0100\n"
+"POT-Creation-Date: 2014-03-06 19:25+0100\n"
+"PO-Revision-Date: 2014-03-06 18:56+0100\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: it\n"
@@ -3115,11 +3115,13 @@ msgid ""
msgstr ""
msgid ""
-"add any buffer to hotlist (including current or visible buffers) if local "
-"variable \"away\" is set on buffer"
+"conditions to add a buffer in hotlist (if notify level is OK for the "
+"buffer); you can use in these conditions: \"window\" (current window "
+"pointer), \"buffer\" (buffer pointer to add in hotlist), \"priority\" (0 = "
+"low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added "
+"to hotlist if you are away, or if the buffer is not visible on screen (not "
+"displayed in any window)"
msgstr ""
-"aggiunge qualsiasi buffer alla hotlist (inclusi buffer corrente o visibili) "
-"se la variabile locale \"away\" è impostata sul buffer"
msgid "string displayed between buffers in hotlist"
msgstr "stringa mostrata tra i buffer nella hotlist"
@@ -4447,9 +4449,6 @@ msgstr[1] "normali"
msgid "Debug disabled for cursor mode"
msgstr "Debug disabilitato per la modalità cursore"
-msgid "Error: not enough memory to add a buffer to hotlist"
-msgstr "Errore: memoria non sufficiente per aggiungere un buffer alla hotlist"
-
#, c-format
msgid "New key binding (context \"%s\"): %s%s => %s%s"
msgstr "Nuova combinazione tasti (contesto \"%s\"): %s%s => %s%s"
diff --git a/po/ja.po b/po/ja.po
index 28fe091e8..d8553bfbb 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -20,8 +20,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-03-05 11:39+0100\n"
-"PO-Revision-Date: 2014-03-04 11:21+0100\n"
+"POT-Creation-Date: 2014-03-06 19:25+0100\n"
+"PO-Revision-Date: 2014-03-06 18:56+0100\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/WeeChat>\n"
"Language: ja\n"
@@ -3152,11 +3152,13 @@ msgstr ""
"で始まるユーザからの notice メッセージは \"irc_notice+nick_toto*\""
msgid ""
-"add any buffer to hotlist (including current or visible buffers) if local "
-"variable \"away\" is set on buffer"
+"conditions to add a buffer in hotlist (if notify level is OK for the "
+"buffer); you can use in these conditions: \"window\" (current window "
+"pointer), \"buffer\" (buffer pointer to add in hotlist), \"priority\" (0 = "
+"low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added "
+"to hotlist if you are away, or if the buffer is not visible on screen (not "
+"displayed in any window)"
msgstr ""
-"バッファにローカル変数 \"away\" がセットされていれば任意のバッファをホットリ"
-"ストに追加 (現在のバッファと目に見えるバッファを含む)"
msgid "string displayed between buffers in hotlist"
msgstr "ホットリストにあるバッファの間に表示される文字列"
@@ -4463,9 +4465,6 @@ msgstr[0] "通常"
msgid "Debug disabled for cursor mode"
msgstr "カーソルモードのデバッグを無効化"
-msgid "Error: not enough memory to add a buffer to hotlist"
-msgstr "エラー: バッファをホットリストに追加するメモリが足りません"
-
#, c-format
msgid "New key binding (context \"%s\"): %s%s => %s%s"
msgstr "新しいキー割り当て (コンテキスト \"%s\"): %s%s => %s%s"
diff --git a/po/pl.po b/po/pl.po
index ab6c27ccc..33da6a9ca 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-03-05 11:39+0100\n"
-"PO-Revision-Date: 2014-03-04 11:21+0100\n"
+"POT-Creation-Date: 2014-03-06 19:25+0100\n"
+"PO-Revision-Date: 2014-03-06 18:56+0100\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: pl\n"
@@ -3223,11 +3223,13 @@ msgstr ""
"od nicka zaczynającego się na \"toto\""
msgid ""
-"add any buffer to hotlist (including current or visible buffers) if local "
-"variable \"away\" is set on buffer"
+"conditions to add a buffer in hotlist (if notify level is OK for the "
+"buffer); you can use in these conditions: \"window\" (current window "
+"pointer), \"buffer\" (buffer pointer to add in hotlist), \"priority\" (0 = "
+"low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added "
+"to hotlist if you are away, or if the buffer is not visible on screen (not "
+"displayed in any window)"
msgstr ""
-"dodaje dowolny bufor do hotlisty (włączając obecny lub widoczne bufory) "
-"jeśli lokalna zmienna \"away\" jest ustawiona dla bufora"
msgid "string displayed between buffers in hotlist"
msgstr "ciąg znaków wyświetlany pomiędzy buforami w hotliście"
@@ -4569,9 +4571,6 @@ msgstr[2] "normalnych"
msgid "Debug disabled for cursor mode"
msgstr "Debugowanie wyłączone dla trybu kursora"
-msgid "Error: not enough memory to add a buffer to hotlist"
-msgstr "Błąd: za mało pamięci, aby dodać bufor do hotlisty"
-
#, c-format
msgid "New key binding (context \"%s\"): %s%s => %s%s"
msgstr "Nowy skrót klawiszowy (kontekst: \"%s\"): %s%s => %s%s"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index b50d383fd..75505a59f 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-03-05 11:39+0100\n"
-"PO-Revision-Date: 2014-03-04 11:21+0100\n"
+"POT-Creation-Date: 2014-03-06 19:25+0100\n"
+"PO-Revision-Date: 2014-03-06 18:56+0100\n"
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: pt_BR\n"
@@ -2951,11 +2951,13 @@ msgid ""
msgstr ""
msgid ""
-"add any buffer to hotlist (including current or visible buffers) if local "
-"variable \"away\" is set on buffer"
+"conditions to add a buffer in hotlist (if notify level is OK for the "
+"buffer); you can use in these conditions: \"window\" (current window "
+"pointer), \"buffer\" (buffer pointer to add in hotlist), \"priority\" (0 = "
+"low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added "
+"to hotlist if you are away, or if the buffer is not visible on screen (not "
+"displayed in any window)"
msgstr ""
-"adiciona qualquer buffer para a lista de atividade (incluindo buffers atuais "
-"e vísiveis) se a variável local \"away\" está definida em outro buffer"
msgid "string displayed between buffers in hotlist"
msgstr "string exibida entre buffers na lista de atividade"
@@ -4209,10 +4211,6 @@ msgstr[1] "normais"
msgid "Debug disabled for cursor mode"
msgstr "Depuração desabilitada para modo cursor"
-msgid "Error: not enough memory to add a buffer to hotlist"
-msgstr ""
-"Erro: memória insuficiente para adicionar um buffer na lista de atividades"
-
#, c-format
msgid "New key binding (context \"%s\"): %s%s => %s%s"
msgstr "Novo atalho de teclado (contexto \"%s\"): %s%s => %s%s"
diff --git a/po/ru.po b/po/ru.po
index bd18f2cd5..a1d20b63d 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-03-05 11:39+0100\n"
-"PO-Revision-Date: 2014-03-04 11:21+0100\n"
+"POT-Creation-Date: 2014-03-06 19:25+0100\n"
+"PO-Revision-Date: 2014-03-06 18:56+0100\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: ru\n"
@@ -2530,8 +2530,12 @@ msgid ""
msgstr ""
msgid ""
-"add any buffer to hotlist (including current or visible buffers) if local "
-"variable \"away\" is set on buffer"
+"conditions to add a buffer in hotlist (if notify level is OK for the "
+"buffer); you can use in these conditions: \"window\" (current window "
+"pointer), \"buffer\" (buffer pointer to add in hotlist), \"priority\" (0 = "
+"low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added "
+"to hotlist if you are away, or if the buffer is not visible on screen (not "
+"displayed in any window)"
msgstr ""
#, fuzzy
@@ -3773,10 +3777,6 @@ msgstr[2] "обычные"
msgid "Debug disabled for cursor mode"
msgstr ""
-#, fuzzy
-msgid "Error: not enough memory to add a buffer to hotlist"
-msgstr "%s не могу добавить буфер в хотлист\n"
-
#, fuzzy, c-format
msgid "New key binding (context \"%s\"): %s%s => %s%s"
msgstr "Новая комбинация клавиш: %s"
diff --git a/po/tr.po b/po/tr.po
index 145b09f22..260ab0ebf 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: 2014-03-05 11:39+0100\n"
+"POT-Creation-Date: 2014-03-06 19:25+0100\n"
"PO-Revision-Date: 2014-02-16 11:21+0100\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2255,8 +2255,12 @@ msgid ""
msgstr ""
msgid ""
-"add any buffer to hotlist (including current or visible buffers) if local "
-"variable \"away\" is set on buffer"
+"conditions to add a buffer in hotlist (if notify level is OK for the "
+"buffer); you can use in these conditions: \"window\" (current window "
+"pointer), \"buffer\" (buffer pointer to add in hotlist), \"priority\" (0 = "
+"low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added "
+"to hotlist if you are away, or if the buffer is not visible on screen (not "
+"displayed in any window)"
msgstr ""
msgid "string displayed between buffers in hotlist"
@@ -3358,9 +3362,6 @@ msgstr[0] ""
msgid "Debug disabled for cursor mode"
msgstr ""
-msgid "Error: not enough memory to add a buffer to hotlist"
-msgstr ""
-
#, c-format
msgid "New key binding (context \"%s\"): %s%s => %s%s"
msgstr ""
diff --git a/po/weechat.pot b/po/weechat.pot
index 913e134da..b642eedaa 100644
--- a/po/weechat.pot
+++ b/po/weechat.pot
@@ -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-03-05 11:39+0100\n"
+"POT-Creation-Date: 2014-03-06 19:25+0100\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"
@@ -2257,8 +2257,12 @@ msgid ""
msgstr ""
msgid ""
-"add any buffer to hotlist (including current or visible buffers) if local "
-"variable \"away\" is set on buffer"
+"conditions to add a buffer in hotlist (if notify level is OK for the "
+"buffer); you can use in these conditions: \"window\" (current window "
+"pointer), \"buffer\" (buffer pointer to add in hotlist), \"priority\" (0 = "
+"low, 1 = message, 2 = private, 3 = highlight); by default a buffer is added "
+"to hotlist if you are away, or if the buffer is not visible on screen (not "
+"displayed in any window)"
msgstr ""
msgid "string displayed between buffers in hotlist"
@@ -3362,9 +3366,6 @@ msgstr[1] ""
msgid "Debug disabled for cursor mode"
msgstr ""
-msgid "Error: not enough memory to add a buffer to hotlist"
-msgstr ""
-
#, c-format
msgid "New key binding (context \"%s\"): %s%s => %s%s"
msgstr ""
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index c7187d980..7aee73825 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -113,6 +113,7 @@ struct t_config_option *config_look_highlight;
struct t_config_option *config_look_highlight_regex;
struct t_config_option *config_look_highlight_tags;
struct t_config_option *config_look_hotlist_add_buffer_if_away;
+struct t_config_option *config_look_hotlist_add_conditions;
struct t_config_option *config_look_hotlist_buffer_separator;
struct t_config_option *config_look_hotlist_count_max;
struct t_config_option *config_look_hotlist_count_min_msg;
@@ -2293,12 +2294,17 @@ config_weechat_init_options ()
"messages from nick \"FlashCode\", \"irc_notice+nick_toto*\" for "
"notices from a nick starting with \"toto\""),
NULL, 0, 0, "", NULL, 0, NULL, NULL, &config_change_highlight_tags, NULL, NULL, NULL);
- config_look_hotlist_add_buffer_if_away = config_file_new_option (
- weechat_config_file, ptr_section,
- "hotlist_add_buffer_if_away", "boolean",
- N_("add any buffer to hotlist (including current or visible buffers) "
- "if local variable \"away\" is set on buffer"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ config_look_hotlist_add_conditions = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "hotlist_add_conditions", "string",
+ N_("conditions to add a buffer in hotlist (if notify level is OK for "
+ "the buffer); you can use in these conditions: \"window\" (current "
+ "window pointer), \"buffer\" (buffer pointer to add in hotlist), "
+ "\"priority\" (0 = low, 1 = message, 2 = private, 3 = highlight); "
+ "by default a buffer is added to hotlist if you are away, or if the "
+ "buffer is not visible on screen (not displayed in any window)"),
+ NULL, 0, 0, "${away} || ${buffer.num_displayed} == 0",
+ NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_hotlist_buffer_separator = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_buffer_separator", "string",
diff --git a/src/core/wee-config.h b/src/core/wee-config.h
index 11e47c0da..ac4c79d24 100644
--- a/src/core/wee-config.h
+++ b/src/core/wee-config.h
@@ -144,7 +144,7 @@ extern struct t_config_option *config_look_emphasized_attributes;
extern struct t_config_option *config_look_highlight;
extern struct t_config_option *config_look_highlight_regex;
extern struct t_config_option *config_look_highlight_tags;
-extern struct t_config_option *config_look_hotlist_add_buffer_if_away;
+extern struct t_config_option *config_look_hotlist_add_conditions;
extern struct t_config_option *config_look_hotlist_buffer_separator;
extern struct t_config_option *config_look_hotlist_count_max;
extern struct t_config_option *config_look_hotlist_count_min_msg;
diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c
index 3a0f27435..8bfd31882 100644
--- a/src/gui/curses/gui-curses-main.c
+++ b/src/gui/curses/gui-curses-main.c
@@ -49,6 +49,7 @@
#include "../gui-color.h"
#include "../gui-cursor.h"
#include "../gui-filter.h"
+#include "../gui-hotlist.h"
#include "../gui-input.h"
#include "../gui-layout.h"
#include "../gui-line.h"
@@ -583,6 +584,9 @@ gui_main_end (int clean_exit)
/* free some variables used for nicklist */
gui_nicklist_end ();
+
+ /* free some variables used for hotlist */
+ gui_hotlist_end ();
}
/* end of Curses output */
diff --git a/src/gui/gui-hotlist.c b/src/gui/gui-hotlist.c
index b1b570cdc..468785566 100644
--- a/src/gui/gui-hotlist.c
+++ b/src/gui/gui-hotlist.c
@@ -29,6 +29,7 @@
#include "../core/weechat.h"
#include "../core/wee-config.h"
+#include "../core/wee-eval.h"
#include "../core/wee-hashtable.h"
#include "../core/wee-hdata.h"
#include "../core/wee-hook.h"
@@ -45,6 +46,9 @@
struct t_gui_hotlist *gui_hotlist = NULL;
struct t_gui_hotlist *last_gui_hotlist = NULL;
struct t_gui_buffer *gui_hotlist_initial_buffer = NULL;
+struct t_hashtable *gui_hotlist_hashtable_add_conditions_pointers = NULL;
+struct t_hashtable *gui_hotlist_hashtable_add_conditions_vars = NULL;
+struct t_hashtable *gui_hotlist_hashtable_add_conditions_options = NULL;
int gui_add_hotlist = 1; /* 0 is for temporarily disable */
/* hotlist add for all buffers */
@@ -289,8 +293,8 @@ gui_hotlist_add (struct t_gui_buffer *buffer,
struct timeval *creation_time)
{
struct t_gui_hotlist *new_hotlist, *ptr_hotlist;
- int i, count[GUI_HOTLIST_NUM_PRIORITIES];
- const char *away;
+ int i, count[GUI_HOTLIST_NUM_PRIORITIES], rc;
+ char *value, str_value[32];
if (!buffer || !gui_add_hotlist)
return NULL;
@@ -299,13 +303,6 @@ gui_hotlist_add (struct t_gui_buffer *buffer,
if (weechat_upgrading && (buffer == gui_buffer_search_main ()))
return NULL;
- /* do not add buffer if it is displayed and away is not set */
- away = hashtable_get (buffer->local_variables, "away");
- if ((buffer->num_displayed > 0)
- && ((!away || !away[0])
- || !CONFIG_BOOLEAN(config_look_hotlist_add_buffer_if_away)))
- return NULL;
-
if (priority > GUI_HOTLIST_MAX)
priority = GUI_HOTLIST_MAX;
@@ -313,6 +310,63 @@ gui_hotlist_add (struct t_gui_buffer *buffer,
if (!gui_hotlist_check_buffer_notify (buffer, priority))
return NULL;
+ /* create hashtable if needed (to evaluate conditions) */
+ if (!gui_hotlist_hashtable_add_conditions_pointers)
+ {
+ gui_hotlist_hashtable_add_conditions_pointers = hashtable_new (
+ 32,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_POINTER,
+ NULL,
+ NULL);
+ if (!gui_hotlist_hashtable_add_conditions_pointers)
+ return NULL;
+ }
+ if (!gui_hotlist_hashtable_add_conditions_vars)
+ {
+ gui_hotlist_hashtable_add_conditions_vars = hashtable_new (
+ 32,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING,
+ NULL,
+ NULL);
+ if (!gui_hotlist_hashtable_add_conditions_vars)
+ return NULL;
+ }
+ if (!gui_hotlist_hashtable_add_conditions_options)
+ {
+ gui_hotlist_hashtable_add_conditions_options = hashtable_new (
+ 32,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING,
+ NULL,
+ NULL);
+ if (!gui_hotlist_hashtable_add_conditions_options)
+ return NULL;
+ hashtable_set (gui_hotlist_hashtable_add_conditions_options,
+ "type", "condition");
+ }
+
+ /* set data in hashtables */
+ hashtable_set (gui_hotlist_hashtable_add_conditions_pointers,
+ "window", gui_current_window);
+ hashtable_set (gui_hotlist_hashtable_add_conditions_pointers,
+ "buffer", buffer);
+ snprintf (str_value, sizeof (str_value), "%d", priority);
+ hashtable_set (gui_hotlist_hashtable_add_conditions_vars,
+ "priority", str_value);
+
+ /* check if conditions are true */
+ value = eval_expression (CONFIG_STRING(config_look_hotlist_add_conditions),
+ gui_hotlist_hashtable_add_conditions_pointers,
+ gui_hotlist_hashtable_add_conditions_vars,
+ gui_hotlist_hashtable_add_conditions_options);
+ rc = (value && (strcmp (value, "1") == 0));
+ if (value)
+ free (value);
+ if (!rc)
+ return NULL;
+
/* init count */
for (i = 0; i < GUI_HOTLIST_NUM_PRIORITIES; i++)
{
@@ -340,11 +394,7 @@ gui_hotlist_add (struct t_gui_buffer *buffer,
new_hotlist = malloc (sizeof (*new_hotlist));
if (!new_hotlist)
- {
- log_printf (_("Error: not enough memory to add a buffer to "
- "hotlist"));
return NULL;
- }
new_hotlist->priority = priority;
if (creation_time)
@@ -595,3 +645,27 @@ gui_hotlist_print_log ()
log_printf (" next_hotlist . . . . . : 0x%lx", ptr_hotlist->next_hotlist);
}
}
+
+/*
+ * Ends hotlist.
+ */
+
+void
+gui_hotlist_end ()
+{
+ if (gui_hotlist_hashtable_add_conditions_pointers)
+ {
+ hashtable_free (gui_hotlist_hashtable_add_conditions_pointers);
+ gui_hotlist_hashtable_add_conditions_pointers = NULL;
+ }
+ if (gui_hotlist_hashtable_add_conditions_vars)
+ {
+ hashtable_free (gui_hotlist_hashtable_add_conditions_vars);
+ gui_hotlist_hashtable_add_conditions_vars = NULL;
+ }
+ if (gui_hotlist_hashtable_add_conditions_options)
+ {
+ hashtable_free (gui_hotlist_hashtable_add_conditions_options);
+ gui_hotlist_hashtable_add_conditions_options = NULL;
+ }
+}
diff --git a/src/gui/gui-hotlist.h b/src/gui/gui-hotlist.h
index d78b7a570..89405a78b 100644
--- a/src/gui/gui-hotlist.h
+++ b/src/gui/gui-hotlist.h
@@ -65,5 +65,6 @@ extern struct t_hdata *gui_hotlist_hdata_hotlist_cb (void *data,
extern int gui_hotlist_add_to_infolist (struct t_infolist *infolist,
struct t_gui_hotlist *hotlist);
extern void gui_hotlist_print_log ();
+extern void gui_hotlist_end ();
#endif /* __WEECHAT_GUI_HOTLIST_H */