From 7c6723f255ceea7a33e1b3421ce2b4af7583e12b Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sun, 17 Apr 2011 11:02:45 +0200 Subject: [PATCH] core: add automatic reset of color pairs, new option weechat.look.color_pairs_auto_reset --- ChangeLog | 3 ++- doc/de/autogen/user/weechat_commands.txt | 18 ++++++++-------- doc/de/autogen/user/weechat_options.txt | 5 +++++ doc/en/autogen/user/weechat_commands.txt | 2 +- doc/en/autogen/user/weechat_options.txt | 5 +++++ doc/fr/autogen/user/weechat_commands.txt | 2 +- doc/fr/autogen/user/weechat_options.txt | 5 +++++ doc/it/autogen/user/weechat_commands.txt | 18 ++++++++-------- doc/it/autogen/user/weechat_options.txt | 5 +++++ po/cs.po | 16 ++++++++++++-- po/de.po | 17 +++++++++++++-- po/es.po | 16 ++++++++++++-- po/fr.po | 27 +++++++++++++++++++----- po/hu.po | 16 ++++++++++++-- po/it.po | 17 +++++++++++++-- po/pl.po | 16 ++++++++++++-- po/pt_BR.po | 16 ++++++++++++-- po/ru.po | 16 ++++++++++++-- po/weechat.pot | 16 ++++++++++++-- src/core/wee-command.c | 5 +++-- src/core/wee-config.c | 9 ++++++++ src/core/wee-config.h | 1 + src/gui/curses/gui-curses-color.c | 23 ++++++++++++++++++-- src/gui/curses/gui-curses-main.c | 14 +++++++++++- src/gui/curses/gui-curses.h | 5 +++++ 25 files changed, 244 insertions(+), 49 deletions(-) diff --git a/ChangeLog b/ChangeLog index 63762bac9..3817bf1f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -45,7 +45,8 @@ Version 0.3.5 (under dev!) * core: add color "gray" * core: add attributes for colors ("*": bold, "!": reverse, "_": underline) * core: dynamically allocate color pairs (extended colors can be used without - being added with command "/color") + being added with command "/color"), auto reset of color pairs with option + weechat.look.color_pairs_auto_reset * core: allow background for nick colors (using ":") * api: add new functions buffer_match_list and window_search_with_buffer * plugins: fix memory leaks when setting buffer callbacks after /upgrade diff --git a/doc/de/autogen/user/weechat_commands.txt b/doc/de/autogen/user/weechat_commands.txt index 8a4b60e4e..d11f0cb3b 100644 --- a/doc/de/autogen/user/weechat_commands.txt +++ b/doc/de/autogen/user/weechat_commands.txt @@ -117,18 +117,18 @@ Beispiele: unalias reset - alias: weißt einer Farbzahl einen Namen zu -unalias: entfernt einen Namen - color: Farbnummer (>= 0, maximale Anzahl ist abhängig vom Terminal, üblicherweise 63 oder 255) - name: Aliasname für eine Farbe (zum Beispiel: "orange") - reset: setzt alle Farbpaarungen zurück (nützlich falls keine Farbpaarung mehr verfügbar sein sollte) + alias: add an alias for a color +unalias: delete an alias + color: color number (>= 0, max depends on terminal, commonly 63 or 255) + name: alias name for color (for example: "orange") + reset: reset all color pairs (required when no more color pairs are available if automatic reset is disabled, see option weechat.look.color_pairs_auto_reset) -Ohne Angabe von Argumenten wird in einem neuen Buffer die nutzbare Farbpalette angezeigt. +Without argument, this command displays colors in a new buffer. -Beispiele: - der Farbe 214 wird das Alias "orange" zugeordnet: +Examples: + add alias "orange" for color 214: /color alias 214 orange - löscht die Farbe 214: + delete color 214: /color unalias 214 ........................................ diff --git a/doc/de/autogen/user/weechat_options.txt b/doc/de/autogen/user/weechat_options.txt index 375896e6d..09077ec7b 100644 --- a/doc/de/autogen/user/weechat_options.txt +++ b/doc/de/autogen/user/weechat_options.txt @@ -328,6 +328,11 @@ ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette (Standardwert: `"%H:%M:%S"`) +* *weechat.look.color_pairs_auto_reset* +** Beschreibung: `automatically reset table of color pairs when number of available pairs is lower or equal to this number (-1 = disable automatic reset, and then a manual "/color reset" is needed when table is full)` +** Typ: integer +** Werte: -1 .. 256 (Standardwert: `5`) + * *weechat.look.color_real_white* ** Beschreibung: `Falls diese Option aktiviert ist, wird echtes weiß als Farbe genutzt. In der Standardeinstellung ist diese Option allerdings deaktiviert damit es zu keinen Problemen mit Terminals kommt die einen weißen Hintergrund nutzen (falls man keinen weißen Hintergrund nutzt dann ist es ratsam diese Option zu aktivieren, andernfalls wird die voreingestellte Vordergrundfarbe des Terminals verwendet)` ** Typ: boolesch diff --git a/doc/en/autogen/user/weechat_commands.txt b/doc/en/autogen/user/weechat_commands.txt index aa9941d37..36cf2edc4 100644 --- a/doc/en/autogen/user/weechat_commands.txt +++ b/doc/en/autogen/user/weechat_commands.txt @@ -121,7 +121,7 @@ Examples: unalias: delete an alias color: color number (>= 0, max depends on terminal, commonly 63 or 255) name: alias name for color (for example: "orange") - reset: reset all color pairs (useful when no more pairs are available) + reset: reset all color pairs (required when no more color pairs are available if automatic reset is disabled, see option weechat.look.color_pairs_auto_reset) Without argument, this command displays colors in a new buffer. diff --git a/doc/en/autogen/user/weechat_options.txt b/doc/en/autogen/user/weechat_options.txt index a55a2f81d..f2ac00653 100644 --- a/doc/en/autogen/user/weechat_options.txt +++ b/doc/en/autogen/user/weechat_options.txt @@ -328,6 +328,11 @@ ** type: string ** values: any string (default value: `"%H:%M:%S"`) +* *weechat.look.color_pairs_auto_reset* +** description: `automatically reset table of color pairs when number of available pairs is lower or equal to this number (-1 = disable automatic reset, and then a manual "/color reset" is needed when table is full)` +** type: integer +** values: -1 .. 256 (default value: `5`) + * *weechat.look.color_real_white* ** description: `if set, uses real white color, disabled by default for terms with white background (if you never use white background, you should turn on this option to see real white instead of default term foreground color)` ** type: boolean diff --git a/doc/fr/autogen/user/weechat_commands.txt b/doc/fr/autogen/user/weechat_commands.txt index 2fb39ce51..80d6a3a19 100644 --- a/doc/fr/autogen/user/weechat_commands.txt +++ b/doc/fr/autogen/user/weechat_commands.txt @@ -121,7 +121,7 @@ Exemples: unalias: supprimer un alias pour une couleur couleur: numéro de couleur (>= 0, le max dépend du terminal, généralement 63 ou 255) nom: nom d'alias pour la couleur (par exemple: "orange") - reset: réinitialiser toutes les paires de couleurs (pratique quand il n'y a plus de paires disponibles) + reset: réinitialiser toutes les paires de couleurs (requis quand il n'y a plus de paires de couleurs disponibles si la réinitialisation automatique est désactivée, voir l'option weechat.look.color_pairs_auto_reset) Sans paramètre, cette commande affiche les couleurs dans un nouveau tampon. diff --git a/doc/fr/autogen/user/weechat_options.txt b/doc/fr/autogen/user/weechat_options.txt index 1a07ebbb5..7ec2f94a6 100644 --- a/doc/fr/autogen/user/weechat_options.txt +++ b/doc/fr/autogen/user/weechat_options.txt @@ -328,6 +328,11 @@ ** type: chaîne ** valeurs: toute chaîne (valeur par défaut: `"%H:%M:%S"`) +* *weechat.look.color_pairs_auto_reset* +** description: `réinitialisation automatique de la table des paires de couleurs quand le nombre de paires disponibles est inférieur ou égal à ce nombre (-1 = désactiver la réinitialisation automatique, et donc un "/color reset" manuel est nécessaire quand la table est pleine)` +** type: entier +** valeurs: -1 .. 256 (valeur par défaut: `5`) + * *weechat.look.color_real_white* ** description: `si activé, utilise la vraie couleur blanche, désactivé par défaut pour les terminaux avec un fond blanc (si vous n'utilisez jamais de fond blanc, vous devriez activer cette option pour voir du vrai blanc au lieu de la couleur d'avant plan par défaut du terminal)` ** type: booléen diff --git a/doc/it/autogen/user/weechat_commands.txt b/doc/it/autogen/user/weechat_commands.txt index 3251f3df7..b5093379e 100644 --- a/doc/it/autogen/user/weechat_commands.txt +++ b/doc/it/autogen/user/weechat_commands.txt @@ -117,18 +117,18 @@ Examples: unalias reset - alias: aggiunge un alias per un colore -unalias: elimina un alias - colore: numero colore (>= 0, il massimo dipende dal terminale, di solito 63 o 255) - nome: nome alias per il colore (ad esempio: "arancione") - reset: ripristina tutte le coppie di colore (utile quando non ci sono più coppie disponibili) + alias: add an alias for a color +unalias: delete an alias + color: color number (>= 0, max depends on terminal, commonly 63 or 255) + name: alias name for color (for example: "orange") + reset: reset all color pairs (required when no more color pairs are available if automatic reset is disabled, see option weechat.look.color_pairs_auto_reset) -senza argomento, il comando mostra i colori in un nuovo buffer. +Without argument, this command displays colors in a new buffer. -Esempi: - aggiunge alias "arancione" per il colore 214: +Examples: + add alias "orange" for color 214: /color alias 214 orange - elimina il colore 214: + delete color 214: /color unalias 214 ........................................ diff --git a/doc/it/autogen/user/weechat_options.txt b/doc/it/autogen/user/weechat_options.txt index c4eca18ac..7a2096949 100644 --- a/doc/it/autogen/user/weechat_options.txt +++ b/doc/it/autogen/user/weechat_options.txt @@ -328,6 +328,11 @@ ** tipo: stringa ** valori: qualsiasi stringa (valore predefinito: `"%H:%M:%S"`) +* *weechat.look.color_pairs_auto_reset* +** descrizione: `automatically reset table of color pairs when number of available pairs is lower or equal to this number (-1 = disable automatic reset, and then a manual "/color reset" is needed when table is full)` +** tipo: intero +** valori: -1 .. 256 (valore predefinito: `5`) + * *weechat.look.color_real_white* ** descrizione: `se impostato, utilizza il colore bianco reale, disabilitato sui terminali con lo sfondo bianco (se non utilizzato, l'opzione dovrebbe essere attivata per visualizzare il bianco reale invece del colore di primo piano predefinito del terminale)` ** tipo: bool diff --git a/po/cs.po b/po/cs.po index 3dd978b75..f66feaaf4 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-04-16 10:41+0200\n" +"POT-Creation-Date: 2011-04-17 11:00+0200\n" "PO-Revision-Date: 2011-04-10 17:32+0200\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -1021,7 +1021,9 @@ msgid "" "unalias: delete an alias\n" " color: color number (>= 0, max depends on terminal, commonly 63 or 255)\n" " name: alias name for color (for example: \"orange\")\n" -" reset: reset all color pairs (useful when no more pairs are available)\n" +" reset: reset all color pairs (required when no more color pairs are " +"available if automatic reset is disabled, see option weechat.look." +"color_pairs_auto_reset)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" @@ -1950,6 +1952,12 @@ msgstr "" "časová známka použita v logovacích souborech (použijte manuálovou stránku " "strftime pro spcifikátory data/času)" +msgid "" +"automatically reset table of color pairs when number of available pairs is " +"lower or equal to this number (-1 = disable automatic reset, and then a " +"manual \"/color reset\" is needed when table is full)" +msgstr "" + msgid "" "if set, uses real white color, disabled by default for terms with white " "background (if you never use white background, you should turn on this " @@ -2740,6 +2748,10 @@ msgstr "" msgid "WeeChat color pairs (in use: %d, left: %d):" msgstr "" +#, c-format +msgid "Last auto reset of pairs: %s" +msgstr "" + #, fuzzy msgid "WeeChat basic colors:" msgstr "adresář WeeChat" diff --git a/po/de.po b/po/de.po index 37258dabc..207101f90 100644 --- a/po/de.po +++ b/po/de.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-04-16 10:41+0200\n" +"POT-Creation-Date: 2011-04-17 11:00+0200\n" "PO-Revision-Date: 2011-04-15 21:04+0100\n" "Last-Translator: Nils G.\n" "Language-Team: weechat-dev \n" @@ -1035,12 +1035,15 @@ msgstr "definiert Farbaliase und stellt eine Palette der möglichen Farben dar" msgid "alias || unalias || reset" msgstr "alias || unalias || reset" +#, fuzzy msgid "" " alias: add an alias for a color\n" "unalias: delete an alias\n" " color: color number (>= 0, max depends on terminal, commonly 63 or 255)\n" " name: alias name for color (for example: \"orange\")\n" -" reset: reset all color pairs (useful when no more pairs are available)\n" +" reset: reset all color pairs (required when no more color pairs are " +"available if automatic reset is disabled, see option weechat.look." +"color_pairs_auto_reset)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" @@ -2105,6 +2108,12 @@ msgstr "" "\"${Farbe}\" ist es möglich eine Farbauswahl zu treffen, zum Beispiel eine " "französische Uhr: \"${lightblue}%H${white}%M${lightred}%S\"" +msgid "" +"automatically reset table of color pairs when number of available pairs is " +"lower or equal to this number (-1 = disable automatic reset, and then a " +"manual \"/color reset\" is needed when table is full)" +msgstr "" + msgid "" "if set, uses real white color, disabled by default for terms with white " "background (if you never use white background, you should turn on this " @@ -2954,6 +2963,10 @@ msgstr "" msgid "WeeChat color pairs (in use: %d, left: %d):" msgstr "WeeChat Farbpaare (in Benutzung: %d, noch frei verfügbar: %d):" +#, c-format +msgid "Last auto reset of pairs: %s" +msgstr "" + msgid "WeeChat basic colors:" msgstr "WeeChat Basisfarben:" diff --git a/po/es.po b/po/es.po index 18e86b406..ba372a59e 100644 --- a/po/es.po +++ b/po/es.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-04-16 10:41+0200\n" +"POT-Creation-Date: 2011-04-17 11:00+0200\n" "PO-Revision-Date: 2011-04-10 17:31+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -1025,7 +1025,9 @@ msgid "" "unalias: delete an alias\n" " color: color number (>= 0, max depends on terminal, commonly 63 or 255)\n" " name: alias name for color (for example: \"orange\")\n" -" reset: reset all color pairs (useful when no more pairs are available)\n" +" reset: reset all color pairs (required when no more color pairs are " +"available if automatic reset is disabled, see option weechat.look." +"color_pairs_auto_reset)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" @@ -1995,6 +1997,12 @@ msgstr "" "\"${color}\", ejemplo hora francesa: \"${lightblue}%H${white}%M${lightred}%S" "\"" +msgid "" +"automatically reset table of color pairs when number of available pairs is " +"lower or equal to this number (-1 = disable automatic reset, and then a " +"manual \"/color reset\" is needed when table is full)" +msgstr "" + msgid "" "if set, uses real white color, disabled by default for terms with white " "background (if you never use white background, you should turn on this " @@ -2808,6 +2816,10 @@ msgstr "" msgid "WeeChat color pairs (in use: %d, left: %d):" msgstr "" +#, c-format +msgid "Last auto reset of pairs: %s" +msgstr "" + msgid "WeeChat basic colors:" msgstr "Colores básicos de WeeChat" diff --git a/po/fr.po b/po/fr.po index 4c49a3c3e..a4593c1dc 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-04-16 10:41+0200\n" -"PO-Revision-Date: 2011-04-16 10:42+0200\n" +"POT-Creation-Date: 2011-04-17 11:00+0200\n" +"PO-Revision-Date: 2011-04-17 11:00+0200\n" "Last-Translator: Sebastien Helleu \n" "Language-Team: weechat-dev \n" "Language: French\n" @@ -1028,7 +1028,9 @@ msgid "" "unalias: delete an alias\n" " color: color number (>= 0, max depends on terminal, commonly 63 or 255)\n" " name: alias name for color (for example: \"orange\")\n" -" reset: reset all color pairs (useful when no more pairs are available)\n" +" reset: reset all color pairs (required when no more color pairs are " +"available if automatic reset is disabled, see option weechat.look." +"color_pairs_auto_reset)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" @@ -1043,8 +1045,9 @@ msgstr "" "couleur: numéro de couleur (>= 0, le max dépend du terminal, généralement 63 " "ou 255)\n" " nom: nom d'alias pour la couleur (par exemple: \"orange\")\n" -" reset: réinitialiser toutes les paires de couleurs (pratique quand il n'y " -"a plus de paires disponibles)\n" +" reset: réinitialiser toutes les paires de couleurs (requis quand il n'y a " +"plus de paires de couleurs disponibles si la réinitialisation automatique " +"est désactivée, voir l'option weechat.look.color_pairs_auto_reset)\n" "\n" "Sans paramètre, cette commande affiche les couleurs dans un nouveau tampon.\n" "\n" @@ -2054,6 +2057,16 @@ msgstr "" "format \"${couleur}\", par exemple l'heure française: \"${lightblue}%H" "${white}%M${lightred}%S\"" +msgid "" +"automatically reset table of color pairs when number of available pairs is " +"lower or equal to this number (-1 = disable automatic reset, and then a " +"manual \"/color reset\" is needed when table is full)" +msgstr "" +"réinitialisation automatique de la table des paires de couleurs quand le " +"nombre de paires disponibles est inférieur ou égal à ce nombre (-1 = " +"désactiver la réinitialisation automatique, et donc un \"/color reset\" " +"manuel est nécessaire quand la table est pleine)" + msgid "" "if set, uses real white color, disabled by default for terms with white " "background (if you never use white background, you should turn on this " @@ -2896,6 +2909,10 @@ msgstr "" msgid "WeeChat color pairs (in use: %d, left: %d):" msgstr "Paires de couleurs WeeChat (en utilisation: %d, libres: %d):" +#, c-format +msgid "Last auto reset of pairs: %s" +msgstr "Dernière réinitialisation automatique des paires: %s" + msgid "WeeChat basic colors:" msgstr "Couleurs de base WeeChat:" diff --git a/po/hu.po b/po/hu.po index 991d89fc6..4133f1d7a 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-04-16 10:41+0200\n" +"POT-Creation-Date: 2011-04-17 11:00+0200\n" "PO-Revision-Date: 2011-04-10 11:21+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -994,7 +994,9 @@ msgid "" "unalias: delete an alias\n" " color: color number (>= 0, max depends on terminal, commonly 63 or 255)\n" " name: alias name for color (for example: \"orange\")\n" -" reset: reset all color pairs (useful when no more pairs are available)\n" +" reset: reset all color pairs (required when no more color pairs are " +"available if automatic reset is disabled, see option weechat.look." +"color_pairs_auto_reset)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" @@ -1741,6 +1743,12 @@ msgid "" "french time: \"${lightblue}%H${white}%M${lightred}%S\"" msgstr "új nap kezdetével megjelenő időbélyeg" +msgid "" +"automatically reset table of color pairs when number of available pairs is " +"lower or equal to this number (-1 = disable automatic reset, and then a " +"manual \"/color reset\" is needed when table is full)" +msgstr "" + msgid "" "if set, uses real white color, disabled by default for terms with white " "background (if you never use white background, you should turn on this " @@ -2539,6 +2547,10 @@ msgstr "" msgid "WeeChat color pairs (in use: %d, left: %d):" msgstr "" +#, c-format +msgid "Last auto reset of pairs: %s" +msgstr "" + #, fuzzy msgid "WeeChat basic colors:" msgstr "WeeChat Hiba:" diff --git a/po/it.po b/po/it.po index 70aa0699f..2845dc100 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-04-16 10:41+0200\n" +"POT-Creation-Date: 2011-04-17 11:00+0200\n" "PO-Revision-Date: 2011-04-10 17:33+0200\n" "Last-Translator: Marco Paolone \n" "Language-Team: weechat-dev \n" @@ -1015,12 +1015,15 @@ msgstr "definisce gli alias dei colori e visualizza la tavolozza dei colori" msgid "alias || unalias || reset" msgstr "alias || unalias || reset" +#, fuzzy msgid "" " alias: add an alias for a color\n" "unalias: delete an alias\n" " color: color number (>= 0, max depends on terminal, commonly 63 or 255)\n" " name: alias name for color (for example: \"orange\")\n" -" reset: reset all color pairs (useful when no more pairs are available)\n" +" reset: reset all color pairs (required when no more color pairs are " +"available if automatic reset is disabled, see option weechat.look." +"color_pairs_auto_reset)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" @@ -2047,6 +2050,12 @@ msgstr "" "formato \"${colore}\", nell'orario italiano ad esempio: \"${lightblue}%H" "${white}%M{lightred}%S\"" +msgid "" +"automatically reset table of color pairs when number of available pairs is " +"lower or equal to this number (-1 = disable automatic reset, and then a " +"manual \"/color reset\" is needed when table is full)" +msgstr "" + msgid "" "if set, uses real white color, disabled by default for terms with white " "background (if you never use white background, you should turn on this " @@ -2868,6 +2877,10 @@ msgstr "" msgid "WeeChat color pairs (in use: %d, left: %d):" msgstr "Coppie colore di WeeChat (in uso: %d, rimaste: %d):" +#, c-format +msgid "Last auto reset of pairs: %s" +msgstr "" + msgid "WeeChat basic colors:" msgstr "Colori base di WeeChat" diff --git a/po/pl.po b/po/pl.po index 588a14c18..fae74d06b 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-04-16 10:41+0200\n" +"POT-Creation-Date: 2011-04-17 11:00+0200\n" "PO-Revision-Date: 2011-04-10 17:32+0200\n" "Last-Translator: Krzysztof Koroscik \n" "Language-Team: weechat-dev \n" @@ -1031,7 +1031,9 @@ msgid "" "unalias: delete an alias\n" " color: color number (>= 0, max depends on terminal, commonly 63 or 255)\n" " name: alias name for color (for example: \"orange\")\n" -" reset: reset all color pairs (useful when no more pairs are available)\n" +" reset: reset all color pairs (required when no more color pairs are " +"available if automatic reset is disabled, see option weechat.look." +"color_pairs_auto_reset)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" @@ -2001,6 +2003,12 @@ msgstr "" "specyfikatorów daty/czasu), kolory są dozwolone poprzez \"${color}\", na " "przykład francuski czas: \"${lightblue}%H${white}%M${lightred}%S\"" +msgid "" +"automatically reset table of color pairs when number of available pairs is " +"lower or equal to this number (-1 = disable automatic reset, and then a " +"manual \"/color reset\" is needed when table is full)" +msgstr "" + msgid "" "if set, uses real white color, disabled by default for terms with white " "background (if you never use white background, you should turn on this " @@ -2800,6 +2808,10 @@ msgstr "" msgid "WeeChat color pairs (in use: %d, left: %d):" msgstr "" +#, c-format +msgid "Last auto reset of pairs: %s" +msgstr "" + msgid "WeeChat basic colors:" msgstr "Podstawowe kolory WeeChat:" diff --git a/po/pt_BR.po b/po/pt_BR.po index 3ac9a69df..ddf372e5f 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-04-16 10:41+0200\n" +"POT-Creation-Date: 2011-04-17 11:00+0200\n" "PO-Revision-Date: 2011-04-10 11:22+0200\n" "Last-Translator: Ivan Sichmann Freitas \n" "Language-Team: weechat-dev \n" @@ -1032,7 +1032,9 @@ msgid "" "unalias: delete an alias\n" " color: color number (>= 0, max depends on terminal, commonly 63 or 255)\n" " name: alias name for color (for example: \"orange\")\n" -" reset: reset all color pairs (useful when no more pairs are available)\n" +" reset: reset all color pairs (required when no more color pairs are " +"available if automatic reset is disabled, see option weechat.look." +"color_pairs_auto_reset)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" @@ -1992,6 +1994,12 @@ msgstr "" "o formato de tempo para cada linha mostrada nos buffers (veja man strftime " "paraespecificadores de data/horário" +msgid "" +"automatically reset table of color pairs when number of available pairs is " +"lower or equal to this number (-1 = disable automatic reset, and then a " +"manual \"/color reset\" is needed when table is full)" +msgstr "" + # Find a better translation for foreground' in this context #, fuzzy msgid "" @@ -2720,6 +2728,10 @@ msgstr "" msgid "WeeChat color pairs (in use: %d, left: %d):" msgstr "" +#, c-format +msgid "Last auto reset of pairs: %s" +msgstr "" + msgid "WeeChat basic colors:" msgstr "" diff --git a/po/ru.po b/po/ru.po index 60a232aad..911fa23de 100644 --- a/po/ru.po +++ b/po/ru.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-04-16 10:41+0200\n" +"POT-Creation-Date: 2011-04-17 11:00+0200\n" "PO-Revision-Date: 2011-04-10 17:33+0200\n" "Last-Translator: Pavel Shevchuk \n" "Language-Team: weechat-dev \n" @@ -1001,7 +1001,9 @@ msgid "" "unalias: delete an alias\n" " color: color number (>= 0, max depends on terminal, commonly 63 or 255)\n" " name: alias name for color (for example: \"orange\")\n" -" reset: reset all color pairs (useful when no more pairs are available)\n" +" reset: reset all color pairs (required when no more color pairs are " +"available if automatic reset is disabled, see option weechat.look." +"color_pairs_auto_reset)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" @@ -1750,6 +1752,12 @@ msgid "" "french time: \"${lightblue}%H${white}%M${lightred}%S\"" msgstr "отображение маркера даты при смене дня" +msgid "" +"automatically reset table of color pairs when number of available pairs is " +"lower or equal to this number (-1 = disable automatic reset, and then a " +"manual \"/color reset\" is needed when table is full)" +msgstr "" + msgid "" "if set, uses real white color, disabled by default for terms with white " "background (if you never use white background, you should turn on this " @@ -2555,6 +2563,10 @@ msgstr "" msgid "WeeChat color pairs (in use: %d, left: %d):" msgstr "" +#, c-format +msgid "Last auto reset of pairs: %s" +msgstr "" + #, fuzzy msgid "WeeChat basic colors:" msgstr "Ошибка WeeChat:" diff --git a/po/weechat.pot b/po/weechat.pot index ede8bb004..98f08f55d 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-04-16 10:41+0200\n" +"POT-Creation-Date: 2011-04-17 11:00+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -862,7 +862,9 @@ msgid "" "unalias: delete an alias\n" " color: color number (>= 0, max depends on terminal, commonly 63 or 255)\n" " name: alias name for color (for example: \"orange\")\n" -" reset: reset all color pairs (useful when no more pairs are available)\n" +" reset: reset all color pairs (required when no more color pairs are " +"available if automatic reset is disabled, see option weechat.look." +"color_pairs_auto_reset)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" @@ -1506,6 +1508,12 @@ msgid "" "french time: \"${lightblue}%H${white}%M${lightred}%S\"" msgstr "" +msgid "" +"automatically reset table of color pairs when number of available pairs is " +"lower or equal to this number (-1 = disable automatic reset, and then a " +"manual \"/color reset\" is needed when table is full)" +msgstr "" + msgid "" "if set, uses real white color, disabled by default for terms with white " "background (if you never use white background, you should turn on this " @@ -2194,6 +2202,10 @@ msgstr "" msgid "WeeChat color pairs (in use: %d, left: %d):" msgstr "" +#, c-format +msgid "Last auto reset of pairs: %s" +msgstr "" + msgid "WeeChat basic colors:" msgstr "" diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 22dd71675..9b901db07 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -4754,8 +4754,9 @@ command_init () " color: color number (>= 0, max depends on terminal, " "commonly 63 or 255)\n" " name: alias name for color (for example: \"orange\")\n" - " reset: reset all color pairs (useful when no more " - "pairs are available)\n\n" + " reset: reset all color pairs (required when no more " + "color pairs are available if automatic reset is disabled, " + "see option weechat.look.color_pairs_auto_reset)\n\n" "Without argument, this command displays colors in a new " "buffer.\n\n" "Examples:\n" diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 4a7cd482b..e0fd3775e 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -79,6 +79,7 @@ struct t_config_option *config_startup_display_version; struct t_config_option *config_look_align_end_of_lines; struct t_config_option *config_look_buffer_notify_default; struct t_config_option *config_look_buffer_time_format; +struct t_config_option *config_look_color_pairs_auto_reset; struct t_config_option *config_look_color_real_white; struct t_config_option *config_look_command_chars; struct t_config_option *config_look_confirm_quit; @@ -1556,6 +1557,14 @@ config_weechat_init_options () "\"${color}\", for example french time: " "\"${lightblue}%H${white}%M${lightred}%S\""), NULL, 0, 0, "%H:%M:%S", NULL, 0, NULL, NULL, &config_change_buffer_time_format, NULL, NULL, NULL); + config_look_color_pairs_auto_reset = config_file_new_option ( + weechat_config_file, ptr_section, + "color_pairs_auto_reset", "integer", + N_("automatically reset table of color pairs when number of available " + "pairs is lower or equal to this number (-1 = disable automatic " + "reset, and then a manual \"/color reset\" is needed when table " + "is full)"), + NULL, -1, 256, "5", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); config_look_color_real_white = config_file_new_option ( weechat_config_file, ptr_section, "color_real_white", "boolean", diff --git a/src/core/wee-config.h b/src/core/wee-config.h index de7f62fe3..e1191b946 100644 --- a/src/core/wee-config.h +++ b/src/core/wee-config.h @@ -108,6 +108,7 @@ extern struct t_config_option *config_look_buffer_notify_default; extern struct t_config_option *config_look_buffer_time_format; extern struct t_config_option *config_look_command_chars; extern struct t_config_option *config_look_confirm_quit; +extern struct t_config_option *config_look_color_pairs_auto_reset; extern struct t_config_option *config_look_color_real_white; extern struct t_config_option *config_look_day_change; extern struct t_config_option *config_look_day_change_time_format; diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c index 00c8e7133..c85961bfc 100644 --- a/src/gui/curses/gui-curses-color.c +++ b/src/gui/curses/gui-curses-color.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "../../core/weechat.h" #include "../../core/wee-config.h" @@ -80,6 +81,9 @@ int gui_color_num_pairs = 63; /* number of pairs used by WeeChat */ short *gui_color_pairs = NULL; /* table with pair for each fg+bg */ int gui_color_pairs_used = 0; /* number of pairs currently used */ int gui_color_warning_pairs_full = 0; /* warning displayed? */ +int gui_color_pairs_auto_reset = 0; /* auto reset of pairs needed */ +int gui_color_pairs_auto_reset_pending = 0; /* auto reset is pending */ +time_t gui_color_pairs_auto_reset_last = 0; /* time of last auto reset */ /* color buffer */ struct t_gui_buffer *gui_color_buffer = NULL; /* buffer with colors */ @@ -343,8 +347,10 @@ gui_color_get_pair (int fg, int bg) if (gui_color_pairs_used >= gui_color_num_pairs) { /* oh no, no more pair available! */ - if (!gui_color_warning_pairs_full) + if (!gui_color_warning_pairs_full + && (CONFIG_INTEGER(config_look_color_pairs_auto_reset) < 0)) { + /* display warning if auto reset of pairs is disabled */ hook_timer (NULL, 1, 0, 1, &gui_color_timer_warning_pairs_full, NULL); gui_color_warning_pairs_full = 1; @@ -356,6 +362,12 @@ gui_color_get_pair (int fg, int bg) gui_color_pairs_used++; gui_color_pairs[index] = gui_color_pairs_used; init_pair (gui_color_pairs_used, fg, bg); + if ((gui_color_num_pairs > 1) && !gui_color_pairs_auto_reset_pending + && (CONFIG_INTEGER(config_look_color_pairs_auto_reset) >= 0) + && (gui_color_num_pairs - gui_color_pairs_used <= CONFIG_INTEGER(config_look_color_pairs_auto_reset))) + { + gui_color_pairs_auto_reset = 1; + } gui_color_buffer_refresh_needed = 1; } @@ -812,6 +824,13 @@ gui_color_buffer_display () if (gui_color_buffer_extra_info) { + /* display time of last auto reset of color pairs */ + y++; + gui_chat_printf_y (gui_color_buffer, y++, + _("Last auto reset of pairs: %s"), + (gui_color_pairs_auto_reset_last == 0) ? + "-" : ctime (&gui_color_pairs_auto_reset_last)); + /* display WeeChat basic colors */ y++; gui_chat_printf_y (gui_color_buffer, y++, @@ -1074,7 +1093,7 @@ gui_color_buffer_input_cb (void *data, struct t_gui_buffer *buffer, } else if (string_strcasecmp (input_data, "z") == 0) { - gui_color_reset_pairs (buffer); + gui_color_reset_pairs (); } return WEECHAT_RC_OK; diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c index e1626decd..550449f8c 100644 --- a/src/gui/curses/gui-curses-main.c +++ b/src/gui/curses/gui-curses-main.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "../../core/weechat.h" #include "../../core/wee-command.h" @@ -224,7 +225,7 @@ gui_main_refreshs () struct t_gui_window *ptr_win; struct t_gui_buffer *ptr_buffer; struct t_gui_bar *ptr_bar; - + /* refresh color buffer if needed */ if (gui_color_buffer_refresh_needed) { @@ -325,11 +326,22 @@ gui_main_loop () /* execute hook timers */ hook_timer_exec (); + + /* auto reset of color pairs */ + if (gui_color_pairs_auto_reset) + { + gui_color_reset_pairs (); + gui_color_pairs_auto_reset_last = time (NULL); + gui_color_pairs_auto_reset = 0; + gui_color_pairs_auto_reset_pending = 1; + } gui_main_refreshs (); if (gui_window_refresh_needed) gui_main_refreshs (); + gui_color_pairs_auto_reset_pending = 0; + /* wait for keyboard or network activity */ FD_ZERO (&read_fds); FD_ZERO (&write_fds); diff --git a/src/gui/curses/gui-curses.h b/src/gui/curses/gui-curses.h index 47ac40e97..7c5033912 100644 --- a/src/gui/curses/gui-curses.h +++ b/src/gui/curses/gui-curses.h @@ -20,6 +20,8 @@ #ifndef __WEECHAT_GUI_CURSES_H #define __WEECHAT_GUI_CURSES_H 1 +#include + #ifdef HAVE_NCURSESW_CURSES_H #include #elif HAVE_NCURSES_H @@ -59,6 +61,9 @@ extern int gui_term_cols, gui_term_lines; extern struct t_gui_color gui_weechat_colors[]; extern int gui_color_term_colors; extern int gui_color_num_pairs; +extern int gui_color_pairs_auto_reset; +extern int gui_color_pairs_auto_reset_pending; +extern time_t gui_color_pairs_auto_reset_last; extern int gui_color_buffer_refresh_needed; /* color functions */