diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-01-31 19:03:30 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-01-31 19:03:30 +0100 |
commit | ccb08945a1c8fbbcdbd1b8df980e0b5489564ccf (patch) | |
tree | f59a7ad0a351a0faed6ac0c803f559c54ae47c3a | |
parent | 773effbb3ab16934b82b270bd8c684c33d562314 (diff) | |
download | weechat-ccb08945a1c8fbbcdbd1b8df980e0b5489564ccf.zip |
Dynamically allocate color pairs
This commit introduces major changes in 256 colors support:
- extended colors can be used without being added with command "/color add"
- background color is now allowed for nick colors (using slash separator)
49 files changed, 2133 insertions, 1973 deletions
@@ -1,12 +1,15 @@ WeeChat ChangeLog ================= Sébastien Helleu <flashcode@flashtux.org> -v0.3.5-dev, 2011-01-28 +v0.3.5-dev, 2011-01-31 Version 0.3.5 (under dev!) -------------------------- +* core: dynamically allocate color pairs (extended colors can be used without + being added with command "/color add") +* core: allow background for nick colors (using "/") * xfer: do not close chat buffers when removing xfer from list (bug #32271) Version 0.3.4 (2011-01-16) @@ -1,13 +1,17 @@ WeeChat News ============ Sébastien Helleu <flashcode@flashtux.org> -v0.3.5-dev, 2011-01-16 +v0.3.5-dev, 2011-01-31 Version 0.3.5 (under dev!) -------------------------- -No release note. +Important release notes: + +* if you have some colors defined in section "palette" with version 0.3.4, you + should remove all colors defined, and add new aliases (it's not needed any + more to add colors before using them) Version 0.3.4 (2011-01-16) -------------------------- diff --git a/doc/de/autogen/plugin_api/completions.txt b/doc/de/autogen/plugin_api/completions.txt index 70fa06a3a..d1f15f5f3 100644 --- a/doc/de/autogen/plugin_api/completions.txt +++ b/doc/de/autogen/plugin_api/completions.txt @@ -70,8 +70,6 @@ | weechat | buffers_plugins_names | Liste der Buffer (inkl. der Erweiterungen) -| weechat | color_pairs | Farbpaar - | weechat | commands | Befehle (WeeChat und Erweiterungen) | weechat | config_files | Konfigurationsdateien @@ -94,6 +92,8 @@ | weechat | nicks | Nicks in Nickliste des aktuellen Buffers +| weechat | palette_colors | palette colors + | weechat | plugins_commands | Befehle, definiert durch Erweiterungen | weechat | plugins_names | Liste der Erweiterungen diff --git a/doc/de/autogen/user/weechat_commands.txt b/doc/de/autogen/user/weechat_commands.txt index 5a40d9ac6..00f5dd40f 100644 --- a/doc/de/autogen/user/weechat_commands.txt +++ b/doc/de/autogen/user/weechat_commands.txt @@ -99,26 +99,23 @@ /buffer +1 ........................................ -• *`/color`* `[add pair [alias] [fg,bg]] | [del pair] | switch`:: +• *`/color`* `[add color alias] | [del color] | reset`:: ........................................ - erstellt benutzerdefinierte Farben und stellt die Farbpalette dar + define color aliases and display palette of colors - add: fügt ein Farbpaar hinzu - del: entfernt ein Farbpaar - switch: wechselt die Farben von WeeChat/Terminal - pair: Wert für Farbpaar (>= 1) - alias: Alias für Farbe (zum Beispiel: "orange") - fg,bg: Vordergrund- und Hintergrundfarbe (-1 setzt für den Vorder- oder Hintergrund die standard Terminalfarbe) + add: add an alias for a color + del: delete an alias + color: color number (>= 1, max depends on terminal, commonly 63 or 255) + alias: alias name for color (for example: "orange") + reset: reset all color pairs (useful when no more pairs are available) - Ohne Angabe von Argumenten öffnet der Befehl einen neuen Buffer, in welchem die Farbpalette dargestellt wird. + Without argument, this command displays colors in a new buffer. - Beispiele: - fügt die Farbe 214 mit dem Alias "orange" hinzu: + Examples: + add alias "orange" for color 214: /color add 214 orange - fügt die Farbe 250 mit dem Alias Orange auf Blau hinzu: - /color add 250 214,4 orange_blau - löscht die Farbe 214: + delete color 214: /color del 214 ........................................ @@ -131,18 +128,19 @@ Befehl: auszuführender Befehl (es wird automatisch ein '/' vorangestellt, falls dieser nicht angegeben wurde) ........................................ -• *`/debug`* `[list | set plugin level | dump [plugin] | buffer | windows | term]`:: +• *`/debug`* `[list | set plugin level | dump [plugin] | buffer | windows | term | color]`:: ........................................ Debug-Kontrolle für Hauptprogramm und/oder Erweiterung - set: setzt den Level der Protokollierung für eine Erweiterung - plugin: Name der Erweiterung ("core" für den WeeChat Kern) - level: Debuglevel der Erweiterung (0 = deaktiviert das Debug) - dump: Speicherabbild in die WeeChat Protokolldatei schreiben (wie bei einem Programmabsturz) - buffer: speichert den Bufferinhalt als hexadezimale Ausgabe in die Protokolldatei - windows: zeigt die Fensterstruktur an - term: gibt Informationen über das Terminal und verfügbare Farben aus. + set: set log level for plugin + plugin: name of plugin ("core" for WeeChat core) + level: debug level for plugin (0 = disable debug) + dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes) + buffer: dump buffer content with hexadecimal values in log file + windows: display windows tree + term: display infos about terminal and available colors + color: display infos about current color pairs ........................................ • *`/filter`* `[list] | [enable|disable|toggle [name]] | [add name plugin.buffer tags regex] | [del name|-all]`:: diff --git a/doc/de/autogen/user/weechat_options.txt b/doc/de/autogen/user/weechat_options.txt index fb74764b8..2cba4501f 100644 --- a/doc/de/autogen/user/weechat_options.txt +++ b/doc/de/autogen/user/weechat_options.txt @@ -49,7 +49,7 @@ ** Werte: ein Farbname (Standardwert: `lightcyan`) * *weechat.color.chat_nick_colors* -** Beschreibung: `Textfarbe für Nicks (durch Kommata getrennte Liste von Farben)` +** Beschreibung: `text color for nicks (comma separated list of colors, background is allowed with format: "fg/bg", for example: "blue/red")` ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette (Standardwert: `"cyan,magenta,green,brown,lightblue,default,lightcyan,lightmagenta,lightgreen,blue"`) diff --git a/doc/de/weechat_faq.de.txt b/doc/de/weechat_faq.de.txt index 4dde56d35..18297d8a1 100644 --- a/doc/de/weechat_faq.de.txt +++ b/doc/de/weechat_faq.de.txt @@ -265,7 +265,12 @@ Umgebungsvariable durchgeführt werden, ohne das WeeChat neu gestartet werden mu /upgrade ---------------------------------------- -Mit dem Befehl `/color` können die Farben ganz einfach in WeeChat angepasst werden. +// TRANSLATION MISSING +For version 0.3.4, you must use command `/color` to add new colors. + +// TRANSLATION MISSING +For versions > = 0.3.5, you can use any color number in options (optional: you +can add color aliases with command `/color`). Weiterführende Informationen zum Farbmanagement erhält man in der Benutzeranleitung. diff --git a/doc/de/weechat_user.de.txt b/doc/de/weechat_user.de.txt index 121b209da..96a54e6d8 100644 --- a/doc/de/weechat_user.de.txt +++ b/doc/de/weechat_user.de.txt @@ -937,61 +937,46 @@ Basisfarben in WeeChat sind: | white | weiß |======================================== -[[colors_palette]] -Palette -^^^^^^^ +// TRANSLATION MISSING +[[colors_extended]] +Extended colors +^^^^^^^^^^^^^^^ + +WeeChat dynamically allocates color pairs when colors are used on screen (to +display buffers and bars). + +In addition to basic colors, you can use a color number between 1 and the limit +of your terminal. + +Use command `/color` to see current colors and limits. With 'alt+c' you can +temporarily switch to terminal colors to choose a color. + +For example if you want to display time in orange in buffer, do: + +---------------------------------------- +/set weechat.color.chat_time 214 +---------------------------------------- -Gemäß der jeweiligen Terminal-Einstellung werden 64 oder 256 Farbpaare -durch WeeChat definiert. Diese bestehen aus einer Kombination von -Vordergrund- und Hintergrundfarben. - -* für 64 Paare: 8 Vordergrundfarben * 8 Hintergrundfarben (dunkle Farben) -* für 256 Paare: 16 Vordergrundfarben * 16 Hintergrundfarben (jeweils 8 dunkle und - 8 helle Farben) - -Mit dem Befehl `/color` können die Standardfarben angezeigt werden (im Buffer kann -mittels 'alt+c' zwischen den WeeChat und der Terminal Farbpalette gewechselt werden). - -Farbpaarungen (ein Paar besteht aus einer Vordergrund- und einer Hintergrundfarbe) -können mit dem Befehl `/color` angepasst werden. Es wird dazu in der Konfigurationsdatei -'weechat.conf', in der Sektion 'palette' eine entsprechende Option erstellt. - -Für jede definierte Farbe können folgende Parameter festgelegt werden: - -* Vordergrund- und Hintergrund, zu nutzendes Format "fg,bg": Farbe für den Text und den - Hintergrund. Standardmäßig wird für den Hintergrund die voreingestellte Hintergrundfarbe (-1) - verwendet. -* alias: der Farbpaarung kann ein Name zugeordnet werden, damit man diesen Namen zur einfacheren - Nutzung in den Farboptionen verwenden kann. - -Ein Beispiel, um die Farbpaarungen 225 bis 240 mit den Farben blau, türkis, -grün, gelb, orange, rot, rosa, violett zu definieren: - ----------------------------------------- -/color add 225 18,-1 -/color add 226 20,-1 -/color add 227 27,-1 -/color add 228 39,-1 -/color add 229 51,-1 -/color add 230 49,-1 -/color add 231 47,-1 -/color add 232 82,-1 -/color add 233 154,-1 -/color add 234 226,-1 -/color add 235 214,-1 -/color add 236 202,-1 -/color add 237 196,-1 -/color add 238 199,-1 -/color add 239 201,-1 -/color add 240 176,-1 ----------------------------------------- - -siehe `/help color` für weitere Beispiele: - -[IMPORTANT] -Farben die manuell definiert werden, überschreiben die von WeeChat genutzten -Standardfarben. Deshalb sollten Farbpaarungen nur redefiniert werden falls -man diese Farbe nicht in WeeChat nutzt. +Or if you want a very dark green background for status bar: + +---------------------------------------- +/set weechat.bar.status.color_bg 22 +---------------------------------------- + +// TRANSLATION MISSING +[[colors_aliases]] +Alises for colors +^^^^^^^^^^^^^^^^^ + +You can add color aliases with command `/color add` and then use this alias +in any color option. + +For example: + +---------------------------------------- +/color add 214 orange +/set weechat.color.chat_delimiters orange +---------------------------------------- [[plugins]] diff --git a/doc/en/autogen/plugin_api/completions.txt b/doc/en/autogen/plugin_api/completions.txt index f3ddecb50..c33587bfe 100644 --- a/doc/en/autogen/plugin_api/completions.txt +++ b/doc/en/autogen/plugin_api/completions.txt @@ -70,8 +70,6 @@ | weechat | buffers_plugins_names | names of buffers (including plugins names) -| weechat | color_pairs | color pairs - | weechat | commands | commands (weechat and plugins) | weechat | config_files | configuration files @@ -94,6 +92,8 @@ | weechat | nicks | nicks in nicklist of current buffer +| weechat | palette_colors | palette colors + | weechat | plugins_commands | commands defined by plugins | weechat | plugins_names | names of plugins diff --git a/doc/en/autogen/user/weechat_commands.txt b/doc/en/autogen/user/weechat_commands.txt index 479ce4531..033e09429 100644 --- a/doc/en/autogen/user/weechat_commands.txt +++ b/doc/en/autogen/user/weechat_commands.txt @@ -99,25 +99,22 @@ /buffer +1 ........................................ -• *`/color`* `[add pair [alias] [fg,bg]] | [del pair] | switch`:: +• *`/color`* `[add color alias] | [del color] | reset`:: ........................................ - define custom colors and display palette of colors + define color aliases and display palette of colors - add: add a color pair - del: delete a color pair - switch: switch WeeChat/terminal colors - pair: pair number (>= 1) + add: add an alias for a color + del: delete an alias + color: color number (>= 1, max depends on terminal, commonly 63 or 255) alias: alias name for color (for example: "orange") - fg,bg: foreground and background pair number (-1 for default terminal foreground or background) + reset: reset all color pairs (useful when no more pairs are available) Without argument, this command displays colors in a new buffer. Examples: - add color 214 with alias "orange": + add alias "orange" for color 214: /color add 214 orange - add color 250 with orange on blue: - /color add 250 214,4 orange_blue delete color 214: /color del 214 ........................................ @@ -131,7 +128,7 @@ command: command to execute (a '/' is automatically added if not found at beginning of command) ........................................ -• *`/debug`* `[list | set plugin level | dump [plugin] | buffer | windows | term]`:: +• *`/debug`* `[list | set plugin level | dump [plugin] | buffer | windows | term | color]`:: ........................................ control debug for core/plugins @@ -143,6 +140,7 @@ buffer: dump buffer content with hexadecimal values in log file windows: display windows tree term: display infos about terminal and available colors + color: display infos about current color pairs ........................................ • *`/filter`* `[list] | [enable|disable|toggle [name]] | [add name plugin.buffer tags regex] | [del name|-all]`:: diff --git a/doc/en/autogen/user/weechat_options.txt b/doc/en/autogen/user/weechat_options.txt index 29cc76be6..b108d28e0 100644 --- a/doc/en/autogen/user/weechat_options.txt +++ b/doc/en/autogen/user/weechat_options.txt @@ -49,7 +49,7 @@ ** values: a color name (default value: `lightcyan`) * *weechat.color.chat_nick_colors* -** description: `text color for nicks (comma separated list of colors)` +** description: `text color for nicks (comma separated list of colors, background is allowed with format: "fg/bg", for example: "blue/red")` ** type: string ** values: any string (default value: `"cyan,magenta,green,brown,lightblue,default,lightcyan,lightmagenta,lightgreen,blue"`) diff --git a/doc/en/weechat_faq.en.txt b/doc/en/weechat_faq.en.txt index fc932aebc..c1f7dfba3 100644 --- a/doc/en/weechat_faq.en.txt +++ b/doc/en/weechat_faq.en.txt @@ -250,7 +250,10 @@ don't panic! You can change it without restarting, thanks to script 'shell.py': /upgrade ---------------------------------------- -You can use command `/color` for easy setup of colors in WeeChat. +For version 0.3.4, you must use command `/color` to add new colors. + +For versions > = 0.3.5, you can use any color number in options (optional: you +can add color aliases with command `/color`). Please read user's guide for more information about colors management. diff --git a/doc/en/weechat_user.en.txt b/doc/en/weechat_user.en.txt index 491db50d1..a570b8aaa 100644 --- a/doc/en/weechat_user.en.txt +++ b/doc/en/weechat_user.en.txt @@ -934,57 +934,44 @@ Basic colors in WeeChat are: | white | white |======================================== -[[colors_palette]] -Palette -^^^^^^^ - -According to your terminal, 64 or 256 pairs are defined by WeeChat, a -combination of foreground with background colors: +[[colors_extended]] +Extended colors +^^^^^^^^^^^^^^^ -* for 64 pairs: 8 foreground colors * 8 background colors (dark colors) -* for 256 pairs: 16 foreground colors * 16 background colors (8 dark colors and - 8 light colors) +WeeChat dynamically allocates color pairs when colors are used on screen (to +display buffers and bars). -Use command `/color` to see default colors (on buffer you can press 'alt+c' to -switch between WeeChat and terminal colors). +In addition to basic colors, you can use a color number between 1 and the limit +of your terminal. -You can override some color pairs (a pair is foreground + background) with -command `/color`, which creates option in section 'palette' of file -'weechat.conf'. +Use command `/color` to see current colors and limits. With 'alt+c' you can +temporarily switch to terminal colors to choose a color. -For each color defined, you can specify: +For example if you want to display time in orange in buffer, do: -* foreground and background, using format "fg,bg": color for text and - background, by default it is color pair number on default background (-1) -* alias: you can give a name to your color, for easy use in color options +---------------------------------------- +/set weechat.color.chat_time 214 +---------------------------------------- -For example, to define pairs 225 to 240 with colors like blue, cyan, green, -yellow, orange, red, pink, purple: +Or if you want a very dark green background for status bar: ---------------------------------------- -/color add 225 18,-1 -/color add 226 20,-1 -/color add 227 27,-1 -/color add 228 39,-1 -/color add 229 51,-1 -/color add 230 49,-1 -/color add 231 47,-1 -/color add 232 82,-1 -/color add 233 154,-1 -/color add 234 226,-1 -/color add 235 214,-1 -/color add 236 202,-1 -/color add 237 196,-1 -/color add 238 199,-1 -/color add 239 201,-1 -/color add 240 176,-1 +/set weechat.bar.status.color_bg 22 ---------------------------------------- -See `/help color` for other examples. +[[colors_aliases]] +Alises for colors +^^^^^^^^^^^^^^^^^ + +You can add color aliases with command `/color add` and then use this alias +in any color option. -[IMPORTANT] -Colors defined are overriding default WeeChat color pairs, so you should -redefine pair only if you're not using this color in WeeChat. +For example: + +---------------------------------------- +/color add 214 orange +/set weechat.color.chat_delimiters orange +---------------------------------------- [[plugins]] diff --git a/doc/fr/autogen/plugin_api/completions.txt b/doc/fr/autogen/plugin_api/completions.txt index 033161995..eae29ce8f 100644 --- a/doc/fr/autogen/plugin_api/completions.txt +++ b/doc/fr/autogen/plugin_api/completions.txt @@ -70,8 +70,6 @@ | weechat | buffers_plugins_names | noms des tampons (incluant les noms d'extensions) -| weechat | color_pairs | paires de couleur - | weechat | commands | commandes (weechat et extensions) | weechat | config_files | fichiers de configuration @@ -94,6 +92,8 @@ | weechat | nicks | pseudos dans la liste des pseudos du tampon courant +| weechat | palette_colors | couleurs de la palette + | weechat | plugins_commands | commandes définies par les extensions | weechat | plugins_names | noms des extensions diff --git a/doc/fr/autogen/user/weechat_commands.txt b/doc/fr/autogen/user/weechat_commands.txt index f0515edea..ee3e3879e 100644 --- a/doc/fr/autogen/user/weechat_commands.txt +++ b/doc/fr/autogen/user/weechat_commands.txt @@ -99,25 +99,22 @@ /buffer +1 ........................................ -• *`/color`* `[add paire [alias] [fg,bg]] | [del paire] | switch`:: +• *`/color`* `[add couleur alias] | [del paire] | switch`:: ........................................ - définir des couleurs personnalisées et afficher la palette des couleurs + définir des alias de couleurs et afficher la palette des couleurs - add: ajouter une paire de couleur - del: supprimer une paire de couleur - switch: basculer entre les couleurs WeeChat et du terminal - paire: numéro de paire (>= 1) - alias: nom d'alias pour la couleur (par exemple: "orange") - fg,bg: numéro de paire pour le texte et le fond (-1 pour la couleur par défaut du terminal pour le texte ou le fond) + add: ajouter une paire de couleur + del: supprimer une paire de couleur + couleur: numéro de couleur (>= 1, le max dépend du terminal, généralement 63 ou 255) + alias: 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) Sans paramètre, cette commande affiche les couleurs dans un nouveau tampon. Exemples: - ajouter la couleur 214 avec l'alias "orange": + ajouter l'alias "orange" pour la couleur 214: /color add 214 orange - ajouter la couleur 250 avec orange sur bleu: - /color add 250 214,4 orange_bleu supprimer la couleur 214: /color del 214 ........................................ @@ -131,7 +128,7 @@ commande: commande à exécuter (un '/' est automatiquement ajouté s'il n'est pas trouvé au début de la commande) ........................................ -• *`/debug`* `[list | set extension niveau | dump [extension] | buffer | windows | term]`:: +• *`/debug`* `[list | set extension niveau | dump [extension] | buffer | windows | term | color]`:: ........................................ contrôle du debug pour le coeur/les extensions @@ -143,6 +140,7 @@ buffer: affiche le contenu du tampon en valeurs hexadécimales dans le fichier log windows: affiche l'arbre des fenêtres term: afficher des infos sur le terminal et les couleurs disponibles + color: afficher des infos sur les paires de couleur courantes ........................................ • *`/filter`* `[list] | [enable|disable|toggle [nom]] | [add nom extension.tampon tags regex] | [del nom|-all]`:: diff --git a/doc/fr/autogen/user/weechat_options.txt b/doc/fr/autogen/user/weechat_options.txt index cfad63063..52ad0bf7f 100644 --- a/doc/fr/autogen/user/weechat_options.txt +++ b/doc/fr/autogen/user/weechat_options.txt @@ -49,7 +49,7 @@ ** valeurs: un nom de couleur (valeur par défaut: `lightcyan`) * *weechat.color.chat_nick_colors* -** description: `couleur du texte pour les pseudos (liste de couleurs séparées par une virgule)` +** description: `couleur du texte pour les pseudos (liste de couleurs séparées par une virgule, un fond est autorisé avec le format: "couleur/fond", par exemple: "blue/red")` ** type: chaîne ** valeurs: toute chaîne (valeur par défaut: `"cyan,magenta,green,brown,lightblue,default,lightcyan,lightmagenta,lightgreen,blue"`) diff --git a/doc/fr/weechat_faq.fr.txt b/doc/fr/weechat_faq.fr.txt index a9b654776..d49171dab 100644 --- a/doc/fr/weechat_faq.fr.txt +++ b/doc/fr/weechat_faq.fr.txt @@ -260,8 +260,12 @@ ne paniquez pas ! Vous pouvez la changer sans redémarrer, grâce au script /upgrade ---------------------------------------- -Vous pouvez utiliser la commande `/color` pour une configuration facile des -couleurs dans WeeChat. +Pour la version 0.3.4, vous devez utiliser la commande `/color` pour ajouter +des nouvelles couleurs. + +Pour les versions > = 0.3.5, vous pouvez utiliser un numéro de couleur dans les +options (facultatif : vous pouvez ajouter des alias de couleurs avec la commande +`/color`). Merci de lire le guide utilisateur pour plus d'information sur la gestion des couleurs. diff --git a/doc/fr/weechat_user.fr.txt b/doc/fr/weechat_user.fr.txt index 5bc2b77cb..8fb74d762 100644 --- a/doc/fr/weechat_user.fr.txt +++ b/doc/fr/weechat_user.fr.txt @@ -957,62 +957,46 @@ Les couleurs de base dans WeeChat sont : | white | white |======================================== -[[colors_palette]] -Palette -^^^^^^^ +[[colors_extended]] +Couleurs étendues +^^^^^^^^^^^^^^^^^ + +WeeChat alloue dynamiquement les paires de couleurs quand elles sont utilisées +sur l'écran (pour afficher les tampons et les barres). + +En plus des couleurs de base, vous pouvez utiliser un numéro de couleur entre 1 +et la limite de votre terminal. + +Utilisez la commande `/color` pour voir les couleurs et les limites. Avec la +touche 'alt+c', vous pouvez basculer temporairement vers les couleurs du +terminal pour choisir une couleur. + +Par exemple si vous souhaitez afficher l'heure en orange dans le tampon, +faites : -Selon votre terminal, 64 ou 256 paires sont définies par WeeChat, une -combinaison des couleurs d'avant-plan avec le fond : - -* pour 64 paires : 8 couleurs d'avant-plan * 8 couleurs de fond (couleurs - sombres) -* pour 256 paires : 16 couleurs d'avant-plan * 16 couleurs de fond (8 couleurs - sombres et 8 couleurs claires) - -Utilisez la commande `/color` pour voir les couleurs par défaut (sur le tampon -vous pouvez appuyer sur 'alt+c' pour basculer entre les couleurs WeeChat et -celles du terminal). - -Vous pouvez écraser des paires de couleur (une paire est un avant-plan + un -fond) avec la commande `/color`, qui créé une option dans la section 'palette' -du fichier 'weechat.conf'. - -Pour chaque couleur définie, vous pouvez spécifier : - -* avant-plan et fond, en utilisant le format "fg,bg" : couleur pour le texte et - le fond, par défaut c'est la couleur du numéro de paire sur le fond par - défaut (-1) -* alias : vous pouvez donner un nom à la couleur, pour l'utiliser facilement - dans les options de couleurs - -Par exemple, pour définir les paires de 225 à 240 avec des couleurs comme le -bleu, cyan, vert, jaune, orange, rouge, rose, pourpre : - ----------------------------------------- -/color add 225 18,-1 -/color add 226 20,-1 -/color add 227 27,-1 -/color add 228 39,-1 -/color add 229 51,-1 -/color add 230 49,-1 -/color add 231 47,-1 -/color add 232 82,-1 -/color add 233 154,-1 -/color add 234 226,-1 -/color add 235 214,-1 -/color add 236 202,-1 -/color add 237 196,-1 -/color add 238 199,-1 -/color add 239 201,-1 -/color add 240 176,-1 ----------------------------------------- - -Voir `/help color` pour d'autres exemples. - -[IMPORTANT] -Les couleurs définies écrasent les paires de couleur WeeChat par défaut, donc -vous ne devriez redéfinir une paire seulement si vous n'utilisez pas cette -couleur dans WeeChat. +---------------------------------------- +/set weechat.color.chat_time 214 +---------------------------------------- + +Ou si vous voulez un fond vert très foncé pour la barre de statut : + +---------------------------------------- +/set weechat.bar.status.color_bg 22 +---------------------------------------- + +[[colors_aliases]] +Alias pour les couleurs +^^^^^^^^^^^^^^^^^^^^^^^ + +Vous pouvez ajouter des alias de couleur avec la commande `/color add` puis +utiliser cet alias dans n'importe quelle option de couleur. + +Par exemple : + +---------------------------------------- +/color add 214 orange +/set weechat.color.chat_delimiters orange +---------------------------------------- [[plugins]] diff --git a/doc/it/autogen/plugin_api/completions.txt b/doc/it/autogen/plugin_api/completions.txt index 25199ec3e..d3a7a100b 100644 --- a/doc/it/autogen/plugin_api/completions.txt +++ b/doc/it/autogen/plugin_api/completions.txt @@ -70,8 +70,6 @@ | weechat | buffers_plugins_names | nomi dei buffer (inclusi i nomi plugin) -| weechat | color_pairs | coppie di colori - | weechat | commands | comandi (weechat e plugin) | weechat | config_files | file di configurazione @@ -94,6 +92,8 @@ | weechat | nicks | nick nella lista nick del buffer corrente +| weechat | palette_colors | palette colors + | weechat | plugins_commands | comandi definiti dai plugin | weechat | plugins_names | nomi dei plugin diff --git a/doc/it/autogen/user/weechat_commands.txt b/doc/it/autogen/user/weechat_commands.txt index af488e5e9..71681b99f 100644 --- a/doc/it/autogen/user/weechat_commands.txt +++ b/doc/it/autogen/user/weechat_commands.txt @@ -99,26 +99,23 @@ /buffer +1 ........................................ -• *`/color`* `[add pair [alias] [fg,bg]] | [del pair] | switch`:: +• *`/color`* `[add color alias] | [del color] | reset`:: ........................................ - definisce i colori predefiniti e visualizza la tavolozza dei colori + define color aliases and display palette of colors - add: aggiunge una coppia di colore - del: elimina una coppia di colore - switch: passa tra i colori di WeeChat/terminale - pair: numero della coppia (>= 1) - alias: nome per il colore (ad esempio: "arancio") - fg,bg: numero di coppia per il primo piano e lo sfondo (-1 per il primo piano o sfondo del terminale predefinito) + add: add an alias for a color + del: delete an alias + color: color number (>= 1, max depends on terminal, commonly 63 or 255) + alias: alias name for color (for example: "orange") + reset: reset all color pairs (useful when no more pairs are available) - Senza argomenti, il comando visualizza i colori in un nuovo buffer. + Without argument, this command displays colors in a new buffer. - Esempi: - aggiunge il colore 214 con l'alias "arancio": + Examples: + add alias "orange" for color 214: /color add 214 orange - aggiunge il colore 250 con arancio su blu: - /color add 250 214,4 arancio_blu - elimina il colore 214: + delete color 214: /color del 214 ........................................ @@ -131,18 +128,19 @@ comando: comando da eseguire (una '/' viene aggiunta automaticamente se non trovata all'inizio del comando) ........................................ -• *`/debug`* `[list | set plugin livello | dump [plugin] | buffer | windows | term]`:: +• *`/debug`* `[list | set plugin level | dump [plugin] | buffer | windows | term | color]`:: ........................................ attiva debug per core/plugin - set: imposta il livello di log per il plugin - plugin: nome del plugin ("core" per il core di WeeChat) - livello: livello di debug per il plugin (0 = disabilita debug) - dump: salva il dump della memoria nel file di log di Weechat (lo stesso dump viene salvato quando WeeChat va in crash) - buffer: esegue il dump del contenuto con valori esadecimali nel file di log - windows: visualizza l'albero delle finestre - term: visualizza informazioni sul terminale e i colori disponibili + set: set log level for plugin + plugin: name of plugin ("core" for WeeChat core) + level: debug level for plugin (0 = disable debug) + dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes) + buffer: dump buffer content with hexadecimal values in log file + windows: display windows tree + term: display infos about terminal and available colors + color: display infos about current color pairs ........................................ • *`/filter`* `[list] | [enable|disable|toggle [nome]] | [add nome plugin.buffer tag regex] | [del nome|-all]`:: diff --git a/doc/it/autogen/user/weechat_options.txt b/doc/it/autogen/user/weechat_options.txt index 4486e5992..88e6e51a5 100644 --- a/doc/it/autogen/user/weechat_options.txt +++ b/doc/it/autogen/user/weechat_options.txt @@ -49,7 +49,7 @@ ** valori: un nome colore (valore predefinito: `lightcyan`) * *weechat.color.chat_nick_colors* -** descrizione: `colore del testo per i nick (elenco separato da virgole di colori)` +** descrizione: `text color for nicks (comma separated list of colors, background is allowed with format: "fg/bg", for example: "blue/red")` ** tipo: stringa ** valori: qualsiasi stringa (valore predefinito: `"cyan,magenta,green,brown,lightblue,default,lightcyan,lightmagenta,lightgreen,blue"`) diff --git a/doc/it/weechat_faq.it.txt b/doc/it/weechat_faq.it.txt index dd2b599b4..137fc4205 100644 --- a/doc/it/weechat_faq.it.txt +++ b/doc/it/weechat_faq.it.txt @@ -256,8 +256,12 @@ niente panico! È possibile cambiarla senza riavviare, grazie allo script 'shell /upgrade ---------------------------------------- -È possibile utilizzare il comando `/color` per una semplice impostazione -dei colori in WeeChat. +// TRANSLATION MISSING +For version 0.3.4, you must use command `/color` to add new colors. + +// TRANSLATION MISSING +For versions > = 0.3.5, you can use any color number in options (optional: you +can add color aliases with command `/color`). Per favore consultare la guida per l'utente per maggiori informazioni sulla gestione dei colori. diff --git a/doc/it/weechat_user.it.txt b/doc/it/weechat_user.it.txt index 5b80667a9..30e06373c 100644 --- a/doc/it/weechat_user.it.txt +++ b/doc/it/weechat_user.it.txt @@ -951,60 +951,47 @@ I colori base in WeeChat sono: | white | bianco |======================================== -[[colors_palette]] -Tavolozza -^^^^^^^^^ - -In base al proprio terminale, vengono definite 64 o 256 coppie da WeeChat, -una combinazione di colori di primo piano con quelli di sfondo: +// TRANSLATION MISSING +[[colors_extended]] +Extended colors +^^^^^^^^^^^^^^^ -* per 64 coppie: 8 colori di primo piano * 8 colori di sfondo (colori scuri) -* per 256 coppie: 16 colori di primo piano * 16 colori di sfondo (8 colori scuri - ed 8 colori chiari) +WeeChat dynamically allocates color pairs when colors are used on screen (to +display buffers and bars). -Usare il comando `/color` per visualizzare i colori predefiniti (nel buffer -è possibile digitare 'alt+c' per passare tra i colori di WeeChat e quelli del -terminale). +In addition to basic colors, you can use a color number between 1 and the limit +of your terminal. -È possibile sovrascrivere alcune coppie di colori (una coppia è costituita -da colore di primo piano + sfondo) con il comando `/color`, che crea un'opzione -nella sezione 'palette' del file 'weechat.conf'. +Use command `/color` to see current colors and limits. With 'alt+c' you can +temporarily switch to terminal colors to choose a color. -Per ogni colore definito, si può specificare: +For example if you want to display time in orange in buffer, do: -* colore di primo piano e sfondo, con il formato "fg,bg": colore per il testo e - di sfondo, quello predefinito è il numero della coppia del colore su - sfondo predefinito (-1) -* alias: si può dare un nome al proprio colore, per un facile utilizzo nelle opzioni +---------------------------------------- +/set weechat.color.chat_time 214 +---------------------------------------- -Ad esempio, per definire le coppie da 225 a 240 con colori come blu, ciano, verde, -giallo, arancione, rosso, rosa, porpora: +Or if you want a very dark green background for status bar: ---------------------------------------- -/color add 225 18,-1 -/color add 226 20,-1 -/color add 227 27,-1 -/color add 228 39,-1 -/color add 229 51,-1 -/color add 230 49,-1 -/color add 231 47,-1 -/color add 232 82,-1 -/color add 233 154,-1 -/color add 234 226,-1 -/color add 235 214,-1 -/color add 236 202,-1 -/color add 237 196,-1 -/color add 238 199,-1 -/color add 239 201,-1 -/color add 240 176,-1 +/set weechat.bar.status.color_bg 22 ---------------------------------------- -Consultare `/help color` per ulteriori esempi. +// TRANSLATION MISSING +[[colors_aliases]] +Alises for colors +^^^^^^^^^^^^^^^^^ + +You can add color aliases with command `/color add` and then use this alias +in any color option. + +For example: + +---------------------------------------- +/color add 214 orange +/set weechat.color.chat_delimiters orange +---------------------------------------- -[IMPORTANT] -I colori definiti sovrascrivono le coppie di colore predefinite di WeeChat, -per cui si consiglia di ridefinire la coppia solo questo colore non verrà -usato in WeeChat. [[plugins]] Plugin diff --git a/doc/pl/weechat_faq.pl.txt b/doc/pl/weechat_faq.pl.txt index 936f6dd0c..cdd46b244 100644 --- a/doc/pl/weechat_faq.pl.txt +++ b/doc/pl/weechat_faq.pl.txt @@ -251,7 +251,12 @@ nie należy panikować! Można to zmienić bez konieczności restartu, za pomoc /upgrade ---------------------------------------- -Możesz użyć komendy `/color` do łatwego dostosowania kolowów w WeeChat. +// TRANSLATION MISSING +For version 0.3.4, you must use command `/color` to add new colors. + +// TRANSLATION MISSING +For versions > = 0.3.5, you can use any color number in options (optional: you +can add color aliases with command `/color`). Więcej informacji na temat zarządzania kolorami można uzyskać w poradniku użytkownika. @@ -20,8 +20,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-01-16 09:21+0100\n" -"PO-Revision-Date: 2011-01-16 11:56+0100\n" +"POT-Creation-Date: 2011-01-31 18:41+0100\n" +"PO-Revision-Date: 2011-01-31 14:50+0100\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: Czech\n" @@ -219,7 +219,7 @@ msgid "No local variable defined for buffer \"%s\"" msgstr "Není definovaná žádná lokální proměnná pro buffer \"%s\"" #, c-format -msgid "%sInvalid pair number \"%s\" (must be between %d and %d)" +msgid "%sInvalid color number \"%s\" (must be between %d and %d)" msgstr "" #, c-format @@ -1003,28 +1003,24 @@ msgstr "" " skočit na další buffer:\n" " /buffer +1" -msgid "define custom colors and display palette of colors" +msgid "define color aliases and display palette of colors" msgstr "" -msgid "[add pair [alias] [fg,bg]] | [del pair] | switch" +msgid "[add color alias] | [del color] | reset" msgstr "" msgid "" -" add: add a color pair\n" -" del: delete a color pair\n" -"switch: switch WeeChat/terminal colors\n" -" pair: pair number (>= 1)\n" +" add: add an alias for a color\n" +" del: delete an alias\n" +" color: color number (>= 1, max depends on terminal, commonly 63 or 255)\n" " alias: alias name for color (for example: \"orange\")\n" -" fg,bg: foreground and background pair number (-1 for default terminal " -"foreground or background)\n" +" reset: reset all color pairs (useful when no more pairs are available)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" "Examples:\n" -" add color 214 with alias \"orange\":\n" +" add alias \"orange\" for color 214:\n" " /color add 214 orange\n" -" add color 250 with orange on blue:\n" -" /color add 250 214,4 orange_blue\n" " delete color 214:\n" " /color del 214" msgstr "" @@ -1048,9 +1044,11 @@ msgid "control debug for core/plugins" msgstr "spřáva ladění pro jádro/pluginy" #, fuzzy -msgid "[list | set plugin level | dump [plugin] | buffer | windows | term]" +msgid "" +"[list | set plugin level | dump [plugin] | buffer | windows | term | color]" msgstr "[list | set plugin level | dump | buffer | windows | term]" +#, fuzzy msgid "" " set: set log level for plugin\n" " plugin: name of plugin (\"core\" for WeeChat core)\n" @@ -1059,7 +1057,8 @@ msgid "" "WeeChat crashes)\n" " buffer: dump buffer content with hexadecimal values in log file\n" "windows: display windows tree\n" -" term: display infos about terminal and available colors" +" term: display infos about terminal and available colors\n" +" color: display infos about current color pairs" msgstr "" " set: nastavit úroveň logování pro plugin\n" " plugin: jméno pluginu (\"core\" pro jádro WeeChat)\n" @@ -1731,8 +1730,8 @@ msgid "properties that can be read on a buffer" msgstr "vlastnosti, které mohou být čteny o bufferu" #, fuzzy -msgid "color pairs" -msgstr "barva" +msgid "palette colors" +msgstr "Výchozí klávesové zkratky obnoveny" msgid "configuration files" msgstr "konfigurační soubory" @@ -1804,10 +1803,7 @@ msgstr "\t\tZměnil se den na %s" msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "úroveň ladění pro plugin (\"core\" pro jádro WeeChat)" -msgid "" -"custom color in palette, format is: \"alias;fg,bg\" where alias is color " -"name, fg,bg is \"foreground,background\" (example: \"200,-1\") (everything " -"is optional in this format and order is not important)" +msgid "alias for color" msgstr "" #, fuzzy, c-format @@ -2144,7 +2140,9 @@ msgid "text color for nicks in chat window" msgstr "barva textu přezdívky v okně rozhovoru" #, fuzzy -msgid "text color for nicks (comma separated list of colors)" +msgid "" +"text color for nicks (comma separated list of colors, background is allowed " +"with format: \"fg/bg\", for example: \"blue/red\")" msgstr "barva textu přezdívky v okně rozhovoru" msgid "text color for local nick in chat window" @@ -2557,6 +2555,12 @@ msgstr "" "čtení - špatný podpis (formát aktualizačního souboru se mohl změnit od " "poslední verze)" +#, c-format +msgid "" +"Warning: the %d color pairs are used, do \"/color reset\" to remove unused " +"pairs" +msgstr "" + msgid "Terminal infos:" msgstr "Informace o terminálu:" @@ -2567,22 +2571,18 @@ msgstr "" msgid "Default colors:" msgstr "Výchozí klávesové zkratky obnoveny" -msgid "" -"WeeChat colors | Actions: [R] Refresh [Q] Close buffer | Keys: [alt-c] " -"Toggle colors" -msgstr "" - #, fuzzy msgid "Terminal colors:" msgstr "Informace o terminálu:" -#, fuzzy -msgid "WeeChat colors:" -msgstr "datum kompilace WeeChat" +msgid "" +"WeeChat colors | Actions: [e] Display extra infos [r] Refresh [z] Reset " +"colors [q] Close buffer | Keys: [alt-c] Temporarily switch to terminal colors" +msgstr "" -#, fuzzy -msgid "fixed color" -msgstr "barva textu" +#, c-format +msgid "WeeChat colors (in use: %d, left: %d):" +msgstr "" #, fuzzy msgid "WeeChat basic colors:" @@ -2593,8 +2593,11 @@ msgid "Nick colors:" msgstr "barva" #, fuzzy -msgid "Palette colors:" -msgstr "Výchozí klávesové zkratky obnoveny" +msgid "Color aliases:" +msgstr "seznam aliasů" + +msgid "Content of colors (r/g/b):" +msgstr "" msgid "Terminal lost, exiting WeeChat..." msgstr "Terminál ztracen, ukončuji WeeChat..." @@ -2610,10 +2613,6 @@ msgstr "Obdržen signál SIGHUP, znovunačítám konfigurační soubory" msgid " TERM='%s', size: %dx%d" msgstr " TERM='%s', velikost: %dx%d" -#, c-format -msgid " %d colors available, %d pairs" -msgstr " %d dostupných barev, %d párů" - msgid "server" msgid_plural "servers" msgstr[0] "server" @@ -6984,13 +6983,13 @@ msgid "%s%s: error sending data to \"%s\" via xfer chat" msgstr "%s%s: chyba posílání dat k \"%s\" přes xfer chat" #, c-format -msgid "%s%s: can't find xfer for buffer \"%s\"" -msgstr "%s%s: nemohu najít xfer pro buffer \"%s\"" - -#, c-format msgid "Connected to %s (%d.%d.%d.%d) via xfer chat" msgstr "Připojeno na %s (%d.%d.%d.%d) přes xfer rozhovor" +#, c-format +msgid "%s%s: can't find xfer for buffer \"%s\"" +msgstr "%s%s: nemohu najít xfer pro buffer \"%s\"" + msgid "Xfer list:" msgstr "Xfer seznam:" @@ -7219,81 +7218,3 @@ msgstr "" msgid "Pointer" msgstr "Ukazatel" - -#~ msgid "number of colors to use for nicks colors" -#~ msgstr "počet barev použitých pro barvy přezdívek" - -#~ msgid "text color #1 for nick" -#~ msgstr "barva textu 1. přezdívky" - -#~ msgid "text color #2 for nick" -#~ msgstr "barva textu 2. přezdívky" - -#~ msgid "text color #3 for nick" -#~ msgstr "barva textu 3. přezdívky" - -#~ msgid "text color #4 for nick" -#~ msgstr "barva textu 4. přezdívky" - -#~ msgid "text color #5 for nick" -#~ msgstr "barva textu 5. přezdívky" - -#~ msgid "text color #6 for nick" -#~ msgstr "barva textu 6. přezdívky" - -#~ msgid "text color #7 for nick" -#~ msgstr "barva textu 7. přezdívky" - -#~ msgid "text color #8 for nick" -#~ msgstr "barva textu 8. přezdívky" - -#~ msgid "text color #9 for nick" -#~ msgstr "barva textu 9. přezdívky" - -#~ msgid "text color #10 for nick" -#~ msgstr "barva textu 10. přezdívky" - -#~ msgid "colors: %s buffer %s nick1 %s nick2 %s nick3 %s nick4" -#~ msgstr "" -#~ "barvy: %s buffer %s přezdívka1 %s přezdívka2 %s přezdívka3 %s přezdívka4" - -#~ msgid "[-server server] receiver[,receiver] text" -#~ msgstr "[-server server] příjemce[,příjemce] text" - -#~ msgid "[-server server] nickname text" -#~ msgstr "[-server server] přezdívka text" - -#~ msgid "" -#~ " server: send to this server (internal name)\n" -#~ "nickname: user to send notice to\n" -#~ " text: text to send" -#~ msgstr "" -#~ " server: poslat tomuto serveru (vnitřní jméno)\n" -#~ "přezdívka: uživatel, kterému poslat notifikaci\n" -#~ " text: text, který poslat" - -#~ msgid "items of bar" -#~ msgstr "položky pole" - -#~ msgid "time format for each line displayed in buffers" -#~ msgstr "formát času pro každý řádek v bufferu" - -#~ msgid "time format for \"time\" bar item" -#~ msgstr "formát času pro \"time\" položu pole" - -#~ msgid "file containing the certificate authorities" -#~ msgstr "soubor obsahuje certifikační autority" - -#~ msgid "ssl certificate file used to automatically identify your nick" -#~ msgstr "" -#~ "soubor ssl certifikátu použitého pro automatickou identifikaci vaší " -#~ "přezdívky" - -#~ msgid "path for writing incoming files" -#~ msgstr "cesta pro zápis příchozích souborů" - -#~ msgid "" -#~ "path for reading files when sending (when no path is specified by user)" -#~ msgstr "" -#~ "cesta pro čtení souborů při odesílání (když není uživatelem specifikována " -#~ "cesta)" @@ -22,8 +22,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-01-16 09:21+0100\n" -"PO-Revision-Date: 2011-01-16 11:56+0100\n" +"POT-Creation-Date: 2011-01-31 18:41+0100\n" +"PO-Revision-Date: 2011-01-31 18:57+0100\n" "Last-Translator: Nils G.\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: \n" @@ -227,8 +227,8 @@ msgstr "Lokale Variablen für Buffer \"%s\":" msgid "No local variable defined for buffer \"%s\"" msgstr "Keine lokale Variable definiert für Buffer \"%s\"" -#, c-format -msgid "%sInvalid pair number \"%s\" (must be between %d and %d)" +#, fuzzy, c-format +msgid "%sInvalid color number \"%s\" (must be between %d and %d)" msgstr "%sungültiger Wert für Farbpaar \"%s\" (muss zwischen %d und %d liegen)" #, c-format @@ -1021,28 +1021,27 @@ msgstr "" " wechselt zum nächsten Buffer:\n" " /buffer +1" -msgid "define custom colors and display palette of colors" +#, fuzzy +msgid "define color aliases and display palette of colors" msgstr "erstellt benutzerdefinierte Farben und stellt die Farbpalette dar" -msgid "[add pair [alias] [fg,bg]] | [del pair] | switch" +#, fuzzy +msgid "[add color alias] | [del color] | reset" msgstr "[add pair [alias] [fg,bg]] | [del pair] | switch" +#, fuzzy msgid "" -" add: add a color pair\n" -" del: delete a color pair\n" -"switch: switch WeeChat/terminal colors\n" -" pair: pair number (>= 1)\n" +" add: add an alias for a color\n" +" del: delete an alias\n" +" color: color number (>= 1, max depends on terminal, commonly 63 or 255)\n" " alias: alias name for color (for example: \"orange\")\n" -" fg,bg: foreground and background pair number (-1 for default terminal " -"foreground or background)\n" +" reset: reset all color pairs (useful when no more pairs are available)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" "Examples:\n" -" add color 214 with alias \"orange\":\n" +" add alias \"orange\" for color 214:\n" " /color add 214 orange\n" -" add color 250 with orange on blue:\n" -" /color add 250 214,4 orange_blue\n" " delete color 214:\n" " /color del 214" msgstr "" @@ -1083,9 +1082,12 @@ msgstr "" msgid "control debug for core/plugins" msgstr "Debug-Kontrolle für Hauptprogramm und/oder Erweiterung" -msgid "[list | set plugin level | dump [plugin] | buffer | windows | term]" +#, fuzzy +msgid "" +"[list | set plugin level | dump [plugin] | buffer | windows | term | color]" msgstr "[list | set plugin level | dump [plugin] | buffer | windows | term]" +#, fuzzy msgid "" " set: set log level for plugin\n" " plugin: name of plugin (\"core\" for WeeChat core)\n" @@ -1094,7 +1096,8 @@ msgid "" "WeeChat crashes)\n" " buffer: dump buffer content with hexadecimal values in log file\n" "windows: display windows tree\n" -" term: display infos about terminal and available colors" +" term: display infos about terminal and available colors\n" +" color: display infos about current color pairs" msgstr "" " set: setzt den Level der Protokollierung für eine Erweiterung\n" " plugin: Name der Erweiterung (\"core\" für den WeeChat Kern)\n" @@ -1807,8 +1810,9 @@ msgstr "Eigenschaften die für den Buffer gesetzt werden können" msgid "properties that can be read on a buffer" msgstr "Eigenschaften die für den Buffer gelesen werden können" -msgid "color pairs" -msgstr "Farbpaar" +#, fuzzy +msgid "palette colors" +msgstr "Farbpalette:" msgid "configuration files" msgstr "Konfigurationsdateien" @@ -1880,16 +1884,8 @@ msgstr "\t\tEin neuer Tag bricht an. Heute ist %s" msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "Debug-Level für Erweiterung (\"core\" für den WeeChat Core)" -msgid "" -"custom color in palette, format is: \"alias;fg,bg\" where alias is color " -"name, fg,bg is \"foreground,background\" (example: \"200,-1\") (everything " -"is optional in this format and order is not important)" +msgid "alias for color" msgstr "" -"Benutzerdefinierte Farbe in der Palette, Format: \"alias;fg,bg\" wobei " -"alias durch einen Farbnamen ersetzt werden kann, fg,bg steht für " -"\"Vordergrund,Hintergrund\"-Farbe (Beispiel: \"200,-1\") (alle Einträge in " -"diesem Format sind optional und die Reihenfolge der Einträge ist frei " -"wählbar)" #, c-format msgid "%sError: palette option must be numeric" @@ -2265,7 +2261,10 @@ msgstr "Farbe der Channel-Namens" msgid "text color for nicks in chat window" msgstr "Farbe für Nicks im Chat-Fenster" -msgid "text color for nicks (comma separated list of colors)" +#, fuzzy +msgid "" +"text color for nicks (comma separated list of colors, background is allowed " +"with format: \"fg/bg\", for example: \"blue/red\")" msgstr "Textfarbe für Nicks (durch Kommata getrennte Liste von Farben)" msgid "text color for local nick in chat window" @@ -2689,6 +2688,12 @@ msgstr "" "lese - falsche Signatur (das Dateiformat wurde vermutlich seit der letzten " "Version verändern)" +#, c-format +msgid "" +"Warning: the %d color pairs are used, do \"/color reset\" to remove unused " +"pairs" +msgstr "" + msgid "Terminal infos:" msgstr "Terminal Informationen:" @@ -2698,21 +2703,20 @@ msgstr "Keine Unterstützung von Farben im Terminal." msgid "Default colors:" msgstr "Standardfarben:" +msgid "Terminal colors:" +msgstr "Terminal-Farben:" + +#, fuzzy msgid "" -"WeeChat colors | Actions: [R] Refresh [Q] Close buffer | Keys: [alt-c] " -"Toggle colors" +"WeeChat colors | Actions: [e] Display extra infos [r] Refresh [z] Reset " +"colors [q] Close buffer | Keys: [alt-c] Temporarily switch to terminal colors" msgstr "" "WeeChat Farben | Aktionen: [R] aktualisieren [Q] Buffer schließen | Befehle: " "[alt-c] wechselt Farben" -msgid "Terminal colors:" -msgstr "Terminal-Farben:" - -msgid "WeeChat colors:" -msgstr "WeeChat Farben:" - -msgid "fixed color" -msgstr "vorgegebene Farbe" +#, c-format +msgid "WeeChat colors (in use: %d, left: %d):" +msgstr "" msgid "WeeChat basic colors:" msgstr "WeeChat Basisfarben:" @@ -2720,8 +2724,12 @@ msgstr "WeeChat Basisfarben:" msgid "Nick colors:" msgstr "Farben für Nicks:" -msgid "Palette colors:" -msgstr "Farbpalette:" +#, fuzzy +msgid "Color aliases:" +msgstr "Liste der Alias" + +msgid "Content of colors (r/g/b):" +msgstr "" msgid "Terminal lost, exiting WeeChat..." msgstr "Terminal verloren, beende WeeChat..." @@ -2737,10 +2745,6 @@ msgstr "Signal SIGHUP empfangen, lese Konfigurationsdateien neu" msgid " TERM='%s', size: %dx%d" msgstr " TERM='%s', Größe: %dx%d" -#, c-format -msgid " %d colors available, %d pairs" -msgstr " %d verfügbare Farben, %d Paare" - msgid "server" msgid_plural "servers" msgstr[0] "Server" @@ -7308,13 +7312,13 @@ msgid "%s%s: error sending data to \"%s\" via xfer chat" msgstr "%s%s: Fehler beim Senden von Daten an \"%s\" via Transfer-Chat" #, c-format -msgid "%s%s: can't find xfer for buffer \"%s\"" -msgstr "%s%s: Kann keinen Transfer für Buffer \"%s\" finden" - -#, c-format msgid "Connected to %s (%d.%d.%d.%d) via xfer chat" msgstr "Verbindung zu %s (%d.%d.%d.%d) via Transfer-Chat aufgebaut" +#, c-format +msgid "%s%s: can't find xfer for buffer \"%s\"" +msgstr "%s%s: Kann keinen Transfer für Buffer \"%s\" finden" + msgid "Xfer list:" msgstr "Transfer-Liste:" @@ -7549,76 +7553,3 @@ msgstr "Hashtable (Ausgabe)" msgid "Pointer" msgstr "Pointer" - -#~ msgid "number of colors to use for nicks colors" -#~ msgstr "Anzahl der Farben die für die Nicknamen genutzt werden sollen" - -#~ msgid "text color #1 for nick" -#~ msgstr "Textfarbe #1 für Nick" - -#~ msgid "text color #2 for nick" -#~ msgstr "Textfarbe #2 für Nick" - -#~ msgid "text color #3 for nick" -#~ msgstr "Textfarbe #3 für Nick" - -#~ msgid "text color #4 for nick" -#~ msgstr "Textfarbe #4 für Nick" - -#~ msgid "text color #5 for nick" -#~ msgstr "Textfarbe #5 für Nick" - -#~ msgid "text color #6 for nick" -#~ msgstr "Textfarbe #6 für Nick" - -#~ msgid "text color #7 for nick" -#~ msgstr "Textfarbe #7 für Nick" - -#~ msgid "text color #8 for nick" -#~ msgstr "Textfarbe #8 für Nick" - -#~ msgid "text color #9 for nick" -#~ msgstr "Textfarbe #9 für Nick" - -#~ msgid "text color #10 for nick" -#~ msgstr "Textfarbe #10 für Nick" - -#~ msgid "colors: %s buffer %s nick1 %s nick2 %s nick3 %s nick4" -#~ msgstr "Farben: %s Buffer %s Nick1 %s Nick2 %s Nick3 %s Nick4" - -#~ msgid "" -#~ " server: send to this server (internal name)\n" -#~ "nickname: user to send notice to\n" -#~ " text: text to send" -#~ msgstr "" -#~ " server: sende an diesen Server (interner Servername)\n" -#~ "Nickname: Empfänger der Nachricht\n" -#~ " Text: zu sendender Text" - -#~ msgid "time format for each line displayed in buffers" -#~ msgstr "" -#~ "Format für die Uhrzeit die am Anfang jeder Zeile in einem Buffer " -#~ "dargestellt wird" - -#~ msgid "time format for \"time\" bar item" -#~ msgstr "Zeitformatierung für die \"time\" Option in der Infobar" - -#~ msgid "items of bar" -#~ msgstr "Items der Infobar" - -#~ msgid "file containing the certificate authorities" -#~ msgstr "Datei enthält die Zertifizierungsstellen." - -#~ msgid "ssl certificate file used to automatically identify your nick" -#~ msgstr "" -#~ "SSL-Zertifikat Datei wurde genutzt um automatisch Deinen Nick zu " -#~ "identifizieren." - -#~ msgid "path for writing incoming files" -#~ msgstr "Zielpfad für eingehende Dateien" - -#~ msgid "" -#~ "path for reading files when sending (when no path is specified by user)" -#~ msgstr "" -#~ "Quellpfad, aus dem Dateien standardmäßig gelesen werden (falls keine " -#~ "explizite Angabe für einen Pfad angegeben worden ist)" @@ -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-01-16 09:21+0100\n" -"PO-Revision-Date: 2011-01-16 11:56+0100\n" +"POT-Creation-Date: 2011-01-31 18:41+0100\n" +"PO-Revision-Date: 2011-01-31 18:57+0100\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: Spanish\n" @@ -219,8 +219,8 @@ msgstr "Variables locales para el buffer \"%s\":" msgid "No local variable defined for buffer \"%s\"" msgstr "Ninguna variable local definida para el buffer \"%s\"" -#, c-format -msgid "%sInvalid pair number \"%s\" (must be between %d and %d)" +#, fuzzy, c-format +msgid "%sInvalid color number \"%s\" (must be between %d and %d)" msgstr "%sPar de números \"%s\" inválido (debe ser entre %d y %d)" #, c-format @@ -1005,28 +1005,27 @@ msgstr "" " ir al buffer siguiente:\n" " /buffer +1" -msgid "define custom colors and display palette of colors" +#, fuzzy +msgid "define color aliases and display palette of colors" msgstr "define colores personalizados y muestra la paleta de colores" -msgid "[add pair [alias] [fg,bg]] | [del pair] | switch" +#, fuzzy +msgid "[add color alias] | [del color] | reset" msgstr "[add par [sinónimo] [fg,bg]] | [del par] | switch" +#, fuzzy msgid "" -" add: add a color pair\n" -" del: delete a color pair\n" -"switch: switch WeeChat/terminal colors\n" -" pair: pair number (>= 1)\n" +" add: add an alias for a color\n" +" del: delete an alias\n" +" color: color number (>= 1, max depends on terminal, commonly 63 or 255)\n" " alias: alias name for color (for example: \"orange\")\n" -" fg,bg: foreground and background pair number (-1 for default terminal " -"foreground or background)\n" +" reset: reset all color pairs (useful when no more pairs are available)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" "Examples:\n" -" add color 214 with alias \"orange\":\n" +" add alias \"orange\" for color 214:\n" " /color add 214 orange\n" -" add color 250 with orange on blue:\n" -" /color add 250 214,4 orange_blue\n" " delete color 214:\n" " /color del 214" msgstr "" @@ -1068,9 +1067,12 @@ msgstr "" msgid "control debug for core/plugins" msgstr "controla los mensajes de depuración para el núcleo/plugins" -msgid "[list | set plugin level | dump [plugin] | buffer | windows | term]" +#, fuzzy +msgid "" +"[list | set plugin level | dump [plugin] | buffer | windows | term | color]" msgstr "[list | set plugin nivel | dump [plugin] | buffer | windows | term]" +#, fuzzy msgid "" " set: set log level for plugin\n" " plugin: name of plugin (\"core\" for WeeChat core)\n" @@ -1079,7 +1081,8 @@ msgid "" "WeeChat crashes)\n" " buffer: dump buffer content with hexadecimal values in log file\n" "windows: display windows tree\n" -" term: display infos about terminal and available colors" +" term: display infos about terminal and available colors\n" +" color: display infos about current color pairs" msgstr "" " set: configura el nivel de depuración para plugin\n" " plugin: nombre del plugin (\"core\" para el núcleo de WeeChat)\n" @@ -1767,8 +1770,9 @@ msgstr "propiedades del buffer que pueden configurarse" msgid "properties that can be read on a buffer" msgstr "propiedades del buffer que pueden leerse" -msgid "color pairs" -msgstr "pares de colores" +#, fuzzy +msgid "palette colors" +msgstr "Paleta de colores:" msgid "configuration files" msgstr "archivos de configuración" @@ -1839,14 +1843,8 @@ msgstr "\t\tNuevo día, %s" msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "nivel de depurado para el plugin (\"core\" para el núcleo de WeeChat)" -msgid "" -"custom color in palette, format is: \"alias;fg,bg\" where alias is color " -"name, fg,bg is \"foreground,background\" (example: \"200,-1\") (everything " -"is optional in this format and order is not important)" +msgid "alias for color" msgstr "" -"color personalizado en la paleta, el formato es: \"alias;fg,bg\" donde alias " -"es el nombre del color, fg,bg es \"color de texto,color de fondo\" (ejemplo: " -"\"200,-1\") (en este formato todo es opcional y el orden no es importante)" #, c-format msgid "%sError: palette option must be numeric" @@ -2200,7 +2198,10 @@ msgstr "color para los nombres de los canales" msgid "text color for nicks in chat window" msgstr "color para los apodos en la ventana de conversación" -msgid "text color for nicks (comma separated list of colors)" +#, fuzzy +msgid "" +"text color for nicks (comma separated list of colors, background is allowed " +"with format: \"fg/bg\", for example: \"blue/red\")" msgstr "color para los apodos (lista de colores separadas por comas)" msgid "text color for local nick in chat window" @@ -2619,6 +2620,12 @@ msgstr "" "lectura - firma incorrecta (el formato del archivo de actualización puede " "haber cambiado desde la última versión)" +#, c-format +msgid "" +"Warning: the %d color pairs are used, do \"/color reset\" to remove unused " +"pairs" +msgstr "" + msgid "Terminal infos:" msgstr "Información de la terminal:" @@ -2628,21 +2635,20 @@ msgstr "No hay soporte para color en la terminal." msgid "Default colors:" msgstr "Colores predeterminados:" +msgid "Terminal colors:" +msgstr "Colores de la terminal:" + +#, fuzzy msgid "" -"WeeChat colors | Actions: [R] Refresh [Q] Close buffer | Keys: [alt-c] " -"Toggle colors" +"WeeChat colors | Actions: [e] Display extra infos [r] Refresh [z] Reset " +"colors [q] Close buffer | Keys: [alt-c] Temporarily switch to terminal colors" msgstr "" "Colores de WeeChat | Acciones: [R] Refrescar [Q] Cerrar buffer | Atajos: " "[alt-c] Alternar colores" -msgid "Terminal colors:" -msgstr "Colores de la terminal:" - -msgid "WeeChat colors:" -msgstr "Colores de WeeChat" - -msgid "fixed color" -msgstr "color fijo" +#, c-format +msgid "WeeChat colors (in use: %d, left: %d):" +msgstr "" msgid "WeeChat basic colors:" msgstr "Colores básicos de WeeChat" @@ -2650,8 +2656,12 @@ msgstr "Colores básicos de WeeChat" msgid "Nick colors:" msgstr "Colores de apodos" -msgid "Palette colors:" -msgstr "Paleta de colores:" +#, fuzzy +msgid "Color aliases:" +msgstr "lista de alias" + +msgid "Content of colors (r/g/b):" +msgstr "" msgid "Terminal lost, exiting WeeChat..." msgstr "Se perdió la terminal, cerrando WeeChat..." @@ -2667,10 +2677,6 @@ msgstr "Señal SIGHUP recibida, recargando archivos de configuración" msgid " TERM='%s', size: %dx%d" msgstr " TERM='%s', tamaño: %dx%d" -#, c-format -msgid " %d colors available, %d pairs" -msgstr " %d colores disponibles, %d pares" - msgid "server" msgid_plural "servers" msgstr[0] "servidor" @@ -7143,13 +7149,13 @@ msgid "%s%s: error sending data to \"%s\" via xfer chat" msgstr "%s%s: error al enviar información a \"%s\" vía charla xfer" #, c-format -msgid "%s%s: can't find xfer for buffer \"%s\"" -msgstr "%s%s: no se puede encontrar xfer para el buffer \"%s\"" - -#, c-format msgid "Connected to %s (%d.%d.%d.%d) via xfer chat" msgstr "Conectado a %s (%d.%d.%d.%d) vía charla xfer" +#, c-format +msgid "%s%s: can't find xfer for buffer \"%s\"" +msgstr "%s%s: no se puede encontrar xfer para el buffer \"%s\"" + msgid "Xfer list:" msgstr "Lista de transferencias:" @@ -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-01-16 09:21+0100\n" -"PO-Revision-Date: 2011-01-16 11:56+0100\n" +"POT-Creation-Date: 2011-01-31 18:41+0100\n" +"PO-Revision-Date: 2011-01-31 18:57+0100\n" "Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: French\n" @@ -221,8 +221,8 @@ msgid "No local variable defined for buffer \"%s\"" msgstr "Pas de variable locale définie pour le tampon \"%s\"" #, c-format -msgid "%sInvalid pair number \"%s\" (must be between %d and %d)" -msgstr "%sNuméro de paire invalide \"%s\" (doit être entre %d et %d)" +msgid "%sInvalid color number \"%s\" (must be between %d and %d)" +msgstr "%sNuméro de couleur invalide \"%s\" (doit être entre %d et %d)" #, c-format msgid "%sColor \"%s\" is not defined in palette" @@ -1009,47 +1009,40 @@ msgstr "" " aller au tampon suivant:\n" " /buffer +1" -msgid "define custom colors and display palette of colors" -msgstr "" -"définir des couleurs personnalisées et afficher la palette des couleurs" +msgid "define color aliases and display palette of colors" +msgstr "définir des alias de couleurs et afficher la palette des couleurs" -msgid "[add pair [alias] [fg,bg]] | [del pair] | switch" -msgstr "[add paire [alias] [fg,bg]] | [del paire] | switch" +msgid "[add color alias] | [del color] | reset" +msgstr "[add couleur alias] | [del paire] | switch" msgid "" -" add: add a color pair\n" -" del: delete a color pair\n" -"switch: switch WeeChat/terminal colors\n" -" pair: pair number (>= 1)\n" +" add: add an alias for a color\n" +" del: delete an alias\n" +" color: color number (>= 1, max depends on terminal, commonly 63 or 255)\n" " alias: alias name for color (for example: \"orange\")\n" -" fg,bg: foreground and background pair number (-1 for default terminal " -"foreground or background)\n" +" reset: reset all color pairs (useful when no more pairs are available)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" "Examples:\n" -" add color 214 with alias \"orange\":\n" +" add alias \"orange\" for color 214:\n" " /color add 214 orange\n" -" add color 250 with orange on blue:\n" -" /color add 250 214,4 orange_blue\n" " delete color 214:\n" " /color del 214" msgstr "" -" add: ajouter une paire de couleur\n" -" del: supprimer une paire de couleur\n" -"switch: basculer entre les couleurs WeeChat et du terminal\n" -" paire: numéro de paire (>= 1)\n" -" alias: nom d'alias pour la couleur (par exemple: \"orange\")\n" -" fg,bg: numéro de paire pour le texte et le fond (-1 pour la couleur par " -"défaut du terminal pour le texte ou le fond)\n" +" add: ajouter une paire de couleur\n" +" del: supprimer une paire de couleur\n" +"couleur: numéro de couleur (>= 1, le max dépend du terminal, généralement 63 " +"ou 255)\n" +" alias: 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" "\n" "Sans paramètre, cette commande affiche les couleurs dans un nouveau tampon.\n" "\n" "Exemples:\n" -" ajouter la couleur 214 avec l'alias \"orange\":\n" +" ajouter l'alias \"orange\" pour la couleur 214:\n" " /color add 214 orange\n" -" ajouter la couleur 250 avec orange sur bleu:\n" -" /color add 250 214,4 orange_bleu\n" " supprimer la couleur 214:\n" " /color del 214" @@ -1071,9 +1064,11 @@ msgstr "" msgid "control debug for core/plugins" msgstr "contrôle du debug pour le coeur/les extensions" -msgid "[list | set plugin level | dump [plugin] | buffer | windows | term]" +msgid "" +"[list | set plugin level | dump [plugin] | buffer | windows | term | color]" msgstr "" -"[list | set extension niveau | dump [extension] | buffer | windows | term]" +"[list | set extension niveau | dump [extension] | buffer | windows | term | " +"color]" msgid "" " set: set log level for plugin\n" @@ -1083,7 +1078,8 @@ msgid "" "WeeChat crashes)\n" " buffer: dump buffer content with hexadecimal values in log file\n" "windows: display windows tree\n" -" term: display infos about terminal and available colors" +" term: display infos about terminal and available colors\n" +" color: display infos about current color pairs" msgstr "" " set: définir le niveau de log pour l'extension\n" "extension: nom de l'extension (\"core\" pour le coeur de WeeChat)\n" @@ -1093,7 +1089,8 @@ msgstr "" " buffer: affiche le contenu du tampon en valeurs hexadécimales dans le " "fichier log\n" " windows: affiche l'arbre des fenêtres\n" -" term: afficher des infos sur le terminal et les couleurs disponibles" +" term: afficher des infos sur le terminal et les couleurs disponibles\n" +" color: afficher des infos sur les paires de couleur courantes" msgid "" "filter messages in buffers, to hide/show them according to tags or regex" @@ -1776,8 +1773,8 @@ msgstr "propriétés qui peuvent être changées sur un tampon" msgid "properties that can be read on a buffer" msgstr "propriétés qui peuvent être lues sur un tampon" -msgid "color pairs" -msgstr "paires de couleur" +msgid "palette colors" +msgstr "couleurs de la palette" msgid "configuration files" msgstr "fichiers de configuration" @@ -1849,15 +1846,8 @@ msgstr "\t\tJour changé: %s" msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "niveau de debug pour l'extension (\"core\" pour le coeur de WeeChat)" -msgid "" -"custom color in palette, format is: \"alias;fg,bg\" where alias is color " -"name, fg,bg is \"foreground,background\" (example: \"200,-1\") (everything " -"is optional in this format and order is not important)" -msgstr "" -"couleur personnalisée dans la palette, le format est: \"alias;fg,bg\" où " -"alias est le nom de la couleur, fg,bg est \"texte,fond\" (par exemple: " -"\"200,-1\") (tout est optionnel dans ce format et l'ordre n'est pas " -"important)" +msgid "alias for color" +msgstr "alias pour la couleur" #, c-format msgid "%sError: palette option must be numeric" @@ -2215,10 +2205,13 @@ msgstr "couleur du texte pour le nom des canaux" msgid "text color for nicks in chat window" msgstr "couleur du texte pour les pseudos dans la fenêtre de discussion" -msgid "text color for nicks (comma separated list of colors)" +msgid "" +"text color for nicks (comma separated list of colors, background is allowed " +"with format: \"fg/bg\", for example: \"blue/red\")" msgstr "" "couleur du texte pour les pseudos (liste de couleurs séparées par une " -"virgule)" +"virgule, un fond est autorisé avec le format: \"couleur/fond\", par exemple: " +"\"blue/red\")" msgid "text color for local nick in chat window" msgstr "couleur du texte pour le pseudo local dans la fenêtre de discussion" @@ -2649,6 +2642,14 @@ msgstr "" "lecture - mauvaise signature (le format de fichier upgrade a peut-être " "changé depuis la dernière version)" +#, c-format +msgid "" +"Warning: the %d color pairs are used, do \"/color reset\" to remove unused " +"pairs" +msgstr "" +"Attention: les %d paires de couleurs sont utilisées, faîtes \"/color reset\" " +"pour supprimer les paires non utilisées" + msgid "Terminal infos:" msgstr "Infos sur le terminal:" @@ -2658,21 +2659,20 @@ msgstr "Pas de support pour la couleur dans le terminal." msgid "Default colors:" msgstr "Couleurs par défaut:" -msgid "" -"WeeChat colors | Actions: [R] Refresh [Q] Close buffer | Keys: [alt-c] " -"Toggle colors" -msgstr "" -"Couleurs WeeChat | Actions: [R] Rafraîchir [Q] Fermer le tampon | Touches: " -"[alt-c] Basculer les couleurs" - msgid "Terminal colors:" msgstr "Couleurs du terminal:" -msgid "WeeChat colors:" -msgstr "Couleurs WeeChat:" +msgid "" +"WeeChat colors | Actions: [e] Display extra infos [r] Refresh [z] Reset " +"colors [q] Close buffer | Keys: [alt-c] Temporarily switch to terminal colors" +msgstr "" +"Couleurs WeeChat | Actions: [e] Afficher des infos en plus [r] Rafraîchir " +"[z] Réinitialiser les couleurs [q] Fermer le tampon | Touches: [alt-c] " +"Basculer temporairement vers les couleurs du terminal" -msgid "fixed color" -msgstr "couleur fixe" +#, c-format +msgid "WeeChat colors (in use: %d, left: %d):" +msgstr "Couleurs WeeChat (en utilisation: %d, libres: %d):" msgid "WeeChat basic colors:" msgstr "Couleurs de base WeeChat:" @@ -2680,8 +2680,11 @@ msgstr "Couleurs de base WeeChat:" msgid "Nick colors:" msgstr "Couleurs des pseudos:" -msgid "Palette colors:" -msgstr "Couleurs de la palette:" +msgid "Color aliases:" +msgstr "Alias de couleurs:" + +msgid "Content of colors (r/g/b):" +msgstr "Contenu des couleurs (r/g/b):" msgid "Terminal lost, exiting WeeChat..." msgstr "Terminal perdu, sortie de WeeChat..." @@ -2697,10 +2700,6 @@ msgstr "Signal SIGHUP reçu, rechargement des fichiers de configuration" msgid " TERM='%s', size: %dx%d" msgstr " TERM='%s', taille: %dx%d" -#, c-format -msgid " %d colors available, %d pairs" -msgstr " %d couleurs disponibles, %d paires" - msgid "server" msgid_plural "servers" msgstr[0] "serveur" @@ -7188,13 +7187,13 @@ msgid "%s%s: error sending data to \"%s\" via xfer chat" msgstr "%s%s: erreur d'envoi de données à \"%s\" via discussion xfer" #, c-format -msgid "%s%s: can't find xfer for buffer \"%s\"" -msgstr "%s%s: impossible de trouver le xfer pour le tampon \"%s\"" - -#, c-format msgid "Connected to %s (%d.%d.%d.%d) via xfer chat" msgstr "Connecté à %s (%d.%d.%d.%d) via discussion xfer" +#, c-format +msgid "%s%s: can't find xfer for buffer \"%s\"" +msgstr "%s%s: impossible de trouver le xfer pour le tampon \"%s\"" + msgid "Xfer list:" msgstr "Liste Xfer:" @@ -20,8 +20,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-01-16 09:21+0100\n" -"PO-Revision-Date: 2011-01-16 11:56+0100\n" +"POT-Creation-Date: 2011-01-31 18:41+0100\n" +"PO-Revision-Date: 2011-01-31 14:50+0100\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: Hungarian\n" @@ -223,7 +223,7 @@ msgid "No local variable defined for buffer \"%s\"" msgstr "" #, c-format -msgid "%sInvalid pair number \"%s\" (must be between %d and %d)" +msgid "%sInvalid color number \"%s\" (must be between %d and %d)" msgstr "" #, c-format @@ -982,28 +982,24 @@ msgstr "" " ugrás 20 sorral feljebb: /buffer scroll -20\n" " ugrás a #weechat szobára: /buffer #weechat" -msgid "define custom colors and display palette of colors" +msgid "define color aliases and display palette of colors" msgstr "" -msgid "[add pair [alias] [fg,bg]] | [del pair] | switch" +msgid "[add color alias] | [del color] | reset" msgstr "" msgid "" -" add: add a color pair\n" -" del: delete a color pair\n" -"switch: switch WeeChat/terminal colors\n" -" pair: pair number (>= 1)\n" +" add: add an alias for a color\n" +" del: delete an alias\n" +" color: color number (>= 1, max depends on terminal, commonly 63 or 255)\n" " alias: alias name for color (for example: \"orange\")\n" -" fg,bg: foreground and background pair number (-1 for default terminal " -"foreground or background)\n" +" reset: reset all color pairs (useful when no more pairs are available)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" "Examples:\n" -" add color 214 with alias \"orange\":\n" +" add alias \"orange\" for color 214:\n" " /color add 214 orange\n" -" add color 250 with orange on blue:\n" -" /color add 250 214,4 orange_blue\n" " delete color 214:\n" " /color del 214" msgstr "" @@ -1028,7 +1024,8 @@ msgid "control debug for core/plugins" msgstr "" #, fuzzy -msgid "[list | set plugin level | dump [plugin] | buffer | windows | term]" +msgid "" +"[list | set plugin level | dump [plugin] | buffer | windows | term | color]" msgstr "dump | buffer | windows" #, fuzzy @@ -1040,7 +1037,8 @@ msgid "" "WeeChat crashes)\n" " buffer: dump buffer content with hexadecimal values in log file\n" "windows: display windows tree\n" -" term: display infos about terminal and available colors" +" term: display infos about terminal and available colors\n" +" color: display infos about current color pairs" msgstr "" " dump: memóriatartalom mentése a WeeChat logba (ugyanez a tartalom íródik " "a WeeChat összeomlásakor)\n" @@ -1538,8 +1536,8 @@ msgid "properties that can be read on a buffer" msgstr "puffer betöltése sikertelen" #, fuzzy -msgid "color pairs" -msgstr "üzenetek színe" +msgid "palette colors" +msgstr "Alapértelmezett billentyűparancsok visszaállítva\n" #, fuzzy msgid "configuration files" @@ -1627,10 +1625,7 @@ msgstr "A mai dátum: %s\n" msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "" -msgid "" -"custom color in palette, format is: \"alias;fg,bg\" where alias is color " -"name, fg,bg is \"foreground,background\" (example: \"200,-1\") (everything " -"is optional in this format and order is not important)" +msgid "alias for color" msgstr "" #, fuzzy, c-format @@ -1949,7 +1944,9 @@ msgid "text color for nicks in chat window" msgstr "idő színe a beszédablakban" #, fuzzy -msgid "text color for nicks (comma separated list of colors)" +msgid "" +"text color for nicks (comma separated list of colors, background is allowed " +"with format: \"fg/bg\", for example: \"blue/red\")" msgstr "idő színe a beszédablakban" #, fuzzy @@ -2383,6 +2380,12 @@ msgid "" "version)" msgstr "" +#, c-format +msgid "" +"Warning: the %d color pairs are used, do \"/color reset\" to remove unused " +"pairs" +msgstr "" + msgid "Terminal infos:" msgstr "" @@ -2393,22 +2396,18 @@ msgstr "" msgid "Default colors:" msgstr "Alapértelmezett billentyűparancsok visszaállítva\n" -msgid "" -"WeeChat colors | Actions: [R] Refresh [Q] Close buffer | Keys: [alt-c] " -"Toggle colors" -msgstr "" - #, fuzzy msgid "Terminal colors:" msgstr "pufferek kezelése" -#, fuzzy -msgid "WeeChat colors:" -msgstr "Konfigurációs fájl elmentve\n" +msgid "" +"WeeChat colors | Actions: [e] Display extra infos [r] Refresh [z] Reset " +"colors [q] Close buffer | Keys: [alt-c] Temporarily switch to terminal colors" +msgstr "" -#, fuzzy -msgid "fixed color" -msgstr "üzenetek színe" +#, c-format +msgid "WeeChat colors (in use: %d, left: %d):" +msgstr "" #, fuzzy msgid "WeeChat basic colors:" @@ -2419,8 +2418,11 @@ msgid "Nick colors:" msgstr "üzenetek színe" #, fuzzy -msgid "Palette colors:" -msgstr "Alapértelmezett billentyűparancsok visszaállítva\n" +msgid "Color aliases:" +msgstr "Aliaszok listája:\n" + +msgid "Content of colors (r/g/b):" +msgstr "" msgid "Terminal lost, exiting WeeChat..." msgstr "" @@ -2437,10 +2439,6 @@ msgstr "%s nem sikerült a konfigurációs fájlt elmenteni\n" msgid " TERM='%s', size: %dx%d" msgstr "" -#, c-format -msgid " %d colors available, %d pairs" -msgstr "" - #, fuzzy msgid "server" msgid_plural "servers" @@ -6686,15 +6684,15 @@ msgid "%s%s: error sending data to \"%s\" via xfer chat" msgstr "%s hiba a(z) \"%s\" felé DCC CHAT-tel történő adatküldés közben\n" #, fuzzy, c-format -msgid "%s%s: can't find xfer for buffer \"%s\"" -msgstr "%s nem sikerült új privát ablakot nyitni \"%s\"\n" - -#, fuzzy, c-format msgid "Connected to %s (%d.%d.%d.%d) via xfer chat" msgstr "" "Csatlakozás a %s%s %s(%s%d.%d.%d.%d%s)%s partnerhez DCC beszélgetésen " "keresztül\n" +#, fuzzy, c-format +msgid "%s%s: can't find xfer for buffer \"%s\"" +msgstr "%s nem sikerült új privát ablakot nyitni \"%s\"\n" + #, fuzzy msgid "Xfer list:" msgstr "hotlist törlése" @@ -6928,81 +6926,3 @@ msgstr "" #, fuzzy msgid "Pointer" msgstr "perc" - -#~ msgid "number of colors to use for nicks colors" -#~ msgstr "nevek színezéséhez használt színek száma" - -#, fuzzy -#~ msgid "text color #1 for nick" -#~ msgstr "név színe" - -#, fuzzy -#~ msgid "text color #2 for nick" -#~ msgstr "név színe" - -#, fuzzy -#~ msgid "text color #3 for nick" -#~ msgstr "név színe" - -#, fuzzy -#~ msgid "text color #4 for nick" -#~ msgstr "név színe" - -#, fuzzy -#~ msgid "text color #5 for nick" -#~ msgstr "név színe" - -#, fuzzy -#~ msgid "text color #6 for nick" -#~ msgstr "név színe" - -#, fuzzy -#~ msgid "text color #7 for nick" -#~ msgstr "név színe" - -#, fuzzy -#~ msgid "text color #8 for nick" -#~ msgstr "név színe" - -#, fuzzy -#~ msgid "text color #9 for nick" -#~ msgstr "név színe" - -#, fuzzy -#~ msgid "text color #10 for nick" -#~ msgstr "név színe" - -#, fuzzy -#~ msgid "[-server server] receiver[,receiver] text" -#~ msgstr "fogadó [,fogadó] szöveg" - -#, fuzzy -#~ msgid "[-server server] nickname text" -#~ msgstr "[szerver | név]" - -#, fuzzy -#~ msgid "" -#~ " server: send to this server (internal name)\n" -#~ "nickname: user to send notice to\n" -#~ " text: text to send" -#~ msgstr "" -#~ " név: felhasználó akinek az üzenetet küldjük\n" -#~ "szöveg: az üzenet szövege" - -#, fuzzy -#~ msgid "items of bar" -#~ msgstr "Aliaszok listája:\n" - -#, fuzzy -#~ msgid "time format for \"time\" bar item" -#~ msgstr "időbélyeg a információs pult idejéhez" - -#, fuzzy -#~ msgid "path for writing incoming files" -#~ msgstr "dcc-n beérkező fájlok helye" - -#, fuzzy -#~ msgid "" -#~ "path for reading files when sending (when no path is specified by user)" -#~ msgstr "" -#~ "dcc-n keresztül küldendő fájlok elérési útvonala (ha nincs külön megadva)" @@ -20,8 +20,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-01-16 09:21+0100\n" -"PO-Revision-Date: 2011-01-16 11:57+0100\n" +"POT-Creation-Date: 2011-01-31 18:41+0100\n" +"PO-Revision-Date: 2011-01-31 18:57+0100\n" "Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: Italian\n" @@ -218,8 +218,8 @@ msgstr "Variabili locali per il buffer \"%s\":" msgid "No local variable defined for buffer \"%s\"" msgstr "Nessuna variabile locale definita per il buffer \"%s\"" -#, c-format -msgid "%sInvalid pair number \"%s\" (must be between %d and %d)" +#, fuzzy, c-format +msgid "%sInvalid color number \"%s\" (must be between %d and %d)" msgstr "" "%sNumero di coppia \"%s\" non valido (deve essere compresto tra %d e %d)" @@ -1000,28 +1000,27 @@ msgstr "" " salta al buffer successivo:\n" " /buffer +1" -msgid "define custom colors and display palette of colors" +#, fuzzy +msgid "define color aliases and display palette of colors" msgstr "definisce i colori predefiniti e visualizza la tavolozza dei colori" -msgid "[add pair [alias] [fg,bg]] | [del pair] | switch" +#, fuzzy +msgid "[add color alias] | [del color] | reset" msgstr "[add pair [alias] [fg,bg]] | [del pair] | switch" +#, fuzzy msgid "" -" add: add a color pair\n" -" del: delete a color pair\n" -"switch: switch WeeChat/terminal colors\n" -" pair: pair number (>= 1)\n" +" add: add an alias for a color\n" +" del: delete an alias\n" +" color: color number (>= 1, max depends on terminal, commonly 63 or 255)\n" " alias: alias name for color (for example: \"orange\")\n" -" fg,bg: foreground and background pair number (-1 for default terminal " -"foreground or background)\n" +" reset: reset all color pairs (useful when no more pairs are available)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" "Examples:\n" -" add color 214 with alias \"orange\":\n" +" add alias \"orange\" for color 214:\n" " /color add 214 orange\n" -" add color 250 with orange on blue:\n" -" /color add 250 214,4 orange_blue\n" " delete color 214:\n" " /color del 214" msgstr "" @@ -1061,9 +1060,12 @@ msgstr "" msgid "control debug for core/plugins" msgstr "attiva debug per core/plugin" -msgid "[list | set plugin level | dump [plugin] | buffer | windows | term]" +#, fuzzy +msgid "" +"[list | set plugin level | dump [plugin] | buffer | windows | term | color]" msgstr "[list | set plugin livello | dump [plugin] | buffer | windows | term]" +#, fuzzy msgid "" " set: set log level for plugin\n" " plugin: name of plugin (\"core\" for WeeChat core)\n" @@ -1072,7 +1074,8 @@ msgid "" "WeeChat crashes)\n" " buffer: dump buffer content with hexadecimal values in log file\n" "windows: display windows tree\n" -" term: display infos about terminal and available colors" +" term: display infos about terminal and available colors\n" +" color: display infos about current color pairs" msgstr "" " set: imposta il livello di log per il plugin\n" " plugin: nome del plugin (\"core\" per il core di WeeChat)\n" @@ -1767,8 +1770,9 @@ msgstr "proprietà che possono essere impostate su un buffer" msgid "properties that can be read on a buffer" msgstr "proprietà che possono essere lette su un buffer" -msgid "color pairs" -msgstr "coppie di colori" +#, fuzzy +msgid "palette colors" +msgstr "Tavolozza dei colori:" msgid "configuration files" msgstr "file di configurazione" @@ -1840,15 +1844,8 @@ msgstr "\t\tOggi è %s" msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "livello di debug per il plugin (\"core\" per il core di WeeChat)" -msgid "" -"custom color in palette, format is: \"alias;fg,bg\" where alias is color " -"name, fg,bg is \"foreground,background\" (example: \"200,-1\") (everything " -"is optional in this format and order is not important)" +msgid "alias for color" msgstr "" -"colore personalizzato nella tavolozza, il formato è \"alias;fg,bg\" dove " -"l'alias è il nome del colore, fg,bg sono \"colore di primo piano,colore di " -"sfondo (esempio: \"200,-1\"), (tutto è opzionale in questo formato e non " -"importa l'ordine)" #, c-format msgid "%sError: palette option must be numeric" @@ -2202,7 +2199,10 @@ msgstr "colore del testo per i nomi dei canali" msgid "text color for nicks in chat window" msgstr "colore del testo per i nick nella finestra di chat" -msgid "text color for nicks (comma separated list of colors)" +#, fuzzy +msgid "" +"text color for nicks (comma separated list of colors, background is allowed " +"with format: \"fg/bg\", for example: \"blue/red\")" msgstr "colore del testo per i nick (elenco separato da virgole di colori)" msgid "text color for local nick in chat window" @@ -2623,6 +2623,12 @@ msgstr "" "lettura - firma errata (l'aggiornamento del formato del file potrebbe essere " "cambiato dall'ultima versione)" +#, c-format +msgid "" +"Warning: the %d color pairs are used, do \"/color reset\" to remove unused " +"pairs" +msgstr "" + msgid "Terminal infos:" msgstr "Informazioni sul terminale:" @@ -2632,21 +2638,20 @@ msgstr "Nessun supporto al colore nel terminale." msgid "Default colors:" msgstr "Colori predefiniti:" +msgid "Terminal colors:" +msgstr "Colori del terminale:" + +#, fuzzy msgid "" -"WeeChat colors | Actions: [R] Refresh [Q] Close buffer | Keys: [alt-c] " -"Toggle colors" +"WeeChat colors | Actions: [e] Display extra infos [r] Refresh [z] Reset " +"colors [q] Close buffer | Keys: [alt-c] Temporarily switch to terminal colors" msgstr "" "Colori WeeChat | Azioni: [R] Aggiorna [Q] Chiudi buffer | Tasti: [alt-c] " "Alterna colori" -msgid "Terminal colors:" -msgstr "Colori del terminale:" - -msgid "WeeChat colors:" -msgstr "Colori di WeeChat:" - -msgid "fixed color" -msgstr "colore fisso" +#, c-format +msgid "WeeChat colors (in use: %d, left: %d):" +msgstr "" msgid "WeeChat basic colors:" msgstr "Colori base di WeeChat" @@ -2654,8 +2659,12 @@ msgstr "Colori base di WeeChat" msgid "Nick colors:" msgstr "Colori per nick:" -msgid "Palette colors:" -msgstr "Tavolozza dei colori:" +#, fuzzy +msgid "Color aliases:" +msgstr "elenco di alias" + +msgid "Content of colors (r/g/b):" +msgstr "" msgid "Terminal lost, exiting WeeChat..." msgstr "Terminale perduto, chiusura di WeeChat..." @@ -2671,10 +2680,6 @@ msgstr "Ricevuto segnale SIGHUP, caricamento dei file di configurazione" msgid " TERM='%s', size: %dx%d" msgstr " TERM='%s', dimensione %dx%d" -#, c-format -msgid " %d colors available, %d pairs" -msgstr " %d colori disponibili, %d coppie" - msgid "server" msgid_plural "servers" msgstr[0] "server" @@ -7143,13 +7148,13 @@ msgid "%s%s: error sending data to \"%s\" via xfer chat" msgstr "%s%s: errore nell'invio dei dati a \"%s\" via chat xfer" #, c-format -msgid "%s%s: can't find xfer for buffer \"%s\"" -msgstr "%s%s: impossibile trovare xfer per il buffer \"%s\"" - -#, c-format msgid "Connected to %s (%d.%d.%d.%d) via xfer chat" msgstr "Connesso a %s (%d.%d.%d.%d) via chat xfer" +#, c-format +msgid "%s%s: can't find xfer for buffer \"%s\"" +msgstr "%s%s: impossibile trovare xfer per il buffer \"%s\"" + msgid "Xfer list:" msgstr "Lista xfer:" @@ -7375,74 +7380,3 @@ msgstr "Tabella hash (output)" msgid "Pointer" msgstr "Puntatore" - -#~ msgid "number of colors to use for nicks colors" -#~ msgstr "numero di colori da utilizzare per i colori dei nick" - -#~ msgid "text color #1 for nick" -#~ msgstr "colore del testo #1 per il nick" - -#~ msgid "text color #2 for nick" -#~ msgstr "colore del testo #2 per il nick" - -#~ msgid "text color #3 for nick" -#~ msgstr "colore del testo #3 per il nick" - -#~ msgid "text color #4 for nick" -#~ msgstr "colore del testo #4 per il nick" - -#~ msgid "text color #5 for nick" -#~ msgstr "colore del testo #5 per il nick" - -#~ msgid "text color #6 for nick" -#~ msgstr "colore del testo #6 per il nick" - -#~ msgid "text color #7 for nick" -#~ msgstr "colore del testo #7 per il nick<" - -#~ msgid "text color #8 for nick" -#~ msgstr "colore del testo #8 per il nick<" - -#~ msgid "text color #9 for nick" -#~ msgstr "colore del testo #9 per il nick<" - -#~ msgid "text color #10 for nick" -#~ msgstr "colore del testo #10 per il nick<" - -#~ msgid "colors: %s buffer %s nick1 %s nick2 %s nick3 %s nick4" -#~ msgstr "colori: %s buffer %s nick1 %s nick2 %s nick3 %s nick4" - -#~ msgid "" -#~ " server: send to this server (internal name)\n" -#~ "nickname: user to send notice to\n" -#~ " text: text to send" -#~ msgstr "" -#~ "server: invia a questo server (nome interno)\n" -#~ " nick: utente a cui inviare la notifica\n" -#~ " testo: testo da inviare" - -#~ msgid "time format for each line displayed in buffers" -#~ msgstr "formato dell'ora per ogni riga visualizzata nei buffer" - -#~ msgid "time format for \"time\" bar item" -#~ msgstr "formato dell'ora per l'elemento della barra \"tempo\"" - -#~ msgid "items of bar" -#~ msgstr "elementi della barra" - -#~ msgid "file containing the certificate authorities" -#~ msgstr "file contenente le autorità dei certificati" - -#~ msgid "ssl certificate file used to automatically identify your nick" -#~ msgstr "" -#~ "certificato ssl utilizzato per identificare automaticamente il proprio " -#~ "nick" - -#~ msgid "path for writing incoming files" -#~ msgstr "percorso per il salvataggio dei file in arrivo" - -#~ msgid "" -#~ "path for reading files when sending (when no path is specified by user)" -#~ msgstr "" -#~ "percorso per la lettura dei file in fase di invio (se non specificato " -#~ "dall'utente)" @@ -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-01-16 09:21+0100\n" -"PO-Revision-Date: 2011-01-16 11:57+0100\n" +"POT-Creation-Date: 2011-01-31 18:41+0100\n" +"PO-Revision-Date: 2011-01-31 18:57+0100\n" "Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: Polish\n" @@ -221,8 +221,8 @@ msgstr "Lokalne zmienne bufora \"%s\":" msgid "No local variable defined for buffer \"%s\"" msgstr "Żadne lokalne zmienne nie zostały zdefiniowane dla bufora \"%s\"" -#, c-format -msgid "%sInvalid pair number \"%s\" (must be between %d and %d)" +#, fuzzy, c-format +msgid "%sInvalid color number \"%s\" (must be between %d and %d)" msgstr "%sNiewłaściwy numer pary \"%s\" (musi się zawierać pomiędzy %d a %d)" #, c-format @@ -1013,28 +1013,27 @@ msgstr "" " przechodzi do następnego buforu:\n" " /buffer +1" -msgid "define custom colors and display palette of colors" +#, fuzzy +msgid "define color aliases and display palette of colors" msgstr "definiuje własne kolory i wyświetla paletę kolorów" -msgid "[add pair [alias] [fg,bg]] | [del pair] | switch" +#, fuzzy +msgid "[add color alias] | [del color] | reset" msgstr "[add para [alias] [fg,bg]] | [del para] | switch" +#, fuzzy msgid "" -" add: add a color pair\n" -" del: delete a color pair\n" -"switch: switch WeeChat/terminal colors\n" -" pair: pair number (>= 1)\n" +" add: add an alias for a color\n" +" del: delete an alias\n" +" color: color number (>= 1, max depends on terminal, commonly 63 or 255)\n" " alias: alias name for color (for example: \"orange\")\n" -" fg,bg: foreground and background pair number (-1 for default terminal " -"foreground or background)\n" +" reset: reset all color pairs (useful when no more pairs are available)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" "Examples:\n" -" add color 214 with alias \"orange\":\n" +" add alias \"orange\" for color 214:\n" " /color add 214 orange\n" -" add color 250 with orange on blue:\n" -" /color add 250 214,4 orange_blue\n" " delete color 214:\n" " /color del 214" msgstr "" @@ -1074,9 +1073,12 @@ msgstr "" msgid "control debug for core/plugins" msgstr "kontrola debugu dla rdzenia/wtyczek" -msgid "[list | set plugin level | dump [plugin] | buffer | windows | term]" +#, fuzzy +msgid "" +"[list | set plugin level | dump [plugin] | buffer | windows | term | color]" msgstr "[list | set plugin poziom | dump [wtyczka] | buffer | windows| term]" +#, fuzzy msgid "" " set: set log level for plugin\n" " plugin: name of plugin (\"core\" for WeeChat core)\n" @@ -1085,7 +1087,8 @@ msgid "" "WeeChat crashes)\n" " buffer: dump buffer content with hexadecimal values in log file\n" "windows: display windows tree\n" -" term: display infos about terminal and available colors" +" term: display infos about terminal and available colors\n" +" color: display infos about current color pairs" msgstr "" " set: ustawia poziom logowania dla wtyczki\n" " plugin: nazwa wtyczki (\"core\" dla rdzenia WeeChat)\n" @@ -1775,8 +1778,9 @@ msgstr "właściwości, jakie mogą być ustawione w buforze" msgid "properties that can be read on a buffer" msgstr "właściwości, jakie moga być przeczytane w buforze" -msgid "color pairs" -msgstr "pary kolorów" +#, fuzzy +msgid "palette colors" +msgstr "Paleta kolorów:" msgid "configuration files" msgstr "pliki konfiguracyjne" @@ -1848,14 +1852,8 @@ msgstr "\t\tDzień zmienił się na %s" msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "poziom debugowania dla wtyczki (\"core\" dla rdzenia WeeChat)" -msgid "" -"custom color in palette, format is: \"alias;fg,bg\" where alias is color " -"name, fg,bg is \"foreground,background\" (example: \"200,-1\") (everything " -"is optional in this format and order is not important)" +msgid "alias for color" msgstr "" -"własne kolory w palecie, format: \"alias;fg;bg\", gdzie alias to nazwa " -"koloru, fg i bg to \"pierwszy plan i tło\" (przykład: \"200,-1\") (wszystko " -"jest opcjonalne w tym formacie i kolejność nie jest ważna)" #, c-format msgid "%sError: palette option must be numeric" @@ -2204,7 +2202,10 @@ msgstr "kolor nazw kanałów" msgid "text color for nicks in chat window" msgstr "kolor nicków w oknie rozmowy" -msgid "text color for nicks (comma separated list of colors)" +#, fuzzy +msgid "" +"text color for nicks (comma separated list of colors, background is allowed " +"with format: \"fg/bg\", for example: \"blue/red\")" msgstr "kolor tenksu nickow (oddzielona przecinkami lista kolorów)" msgid "text color for local nick in chat window" @@ -2614,6 +2615,12 @@ msgid "" msgstr "" "odczyt - zła sygnatura (format pliku mógł ulec zmianie od poprzedniej wersji)" +#, c-format +msgid "" +"Warning: the %d color pairs are used, do \"/color reset\" to remove unused " +"pairs" +msgstr "" + msgid "Terminal infos:" msgstr "Informacje terminala:" @@ -2623,21 +2630,20 @@ msgstr "Brak wsparcia dla kolorów w terminalu." msgid "Default colors:" msgstr "Domyślne kolory:" +msgid "Terminal colors:" +msgstr "Kolory terminala:" + +#, fuzzy msgid "" -"WeeChat colors | Actions: [R] Refresh [Q] Close buffer | Keys: [alt-c] " -"Toggle colors" +"WeeChat colors | Actions: [e] Display extra infos [r] Refresh [z] Reset " +"colors [q] Close buffer | Keys: [alt-c] Temporarily switch to terminal colors" msgstr "" "Kolory WeeChat | Akcje: [R] Odświerz [Q] Zamknij bufor | Klawisze: [alt-c] " "Przełącza kolory" -msgid "Terminal colors:" -msgstr "Kolory terminala:" - -msgid "WeeChat colors:" -msgstr "Kolory WeeChat:" - -msgid "fixed color" -msgstr "stałe kolory" +#, c-format +msgid "WeeChat colors (in use: %d, left: %d):" +msgstr "" msgid "WeeChat basic colors:" msgstr "Podstawowe kolory WeeChat:" @@ -2645,8 +2651,12 @@ msgstr "Podstawowe kolory WeeChat:" msgid "Nick colors:" msgstr "Kolory nicków:" -msgid "Palette colors:" -msgstr "Paleta kolorów:" +#, fuzzy +msgid "Color aliases:" +msgstr "lista aliasów" + +msgid "Content of colors (r/g/b):" +msgstr "" msgid "Terminal lost, exiting WeeChat..." msgstr "Utracono terminal, wychodzę z WeeChat..." @@ -2662,10 +2672,6 @@ msgstr "Otrzymano sygnał SIGHUP, przeładowuję pliki konfiguracyjne" msgid " TERM='%s', size: %dx%d" msgstr " TERM='%s', rozmiar: %dx%d" -#, c-format -msgid " %d colors available, %d pairs" -msgstr " %d dostępnych kolorów, %d par" - msgid "server" msgid_plural "servers" msgstr[0] "serwer" @@ -7073,13 +7079,13 @@ msgid "%s%s: error sending data to \"%s\" via xfer chat" msgstr "%s%s: błąd podczas wysyłania danych do \"%s\" przez rozmowę xfer" #, c-format -msgid "%s%s: can't find xfer for buffer \"%s\"" -msgstr "%s%s: nie można znaleźć xfer dla bufora \"%s\"" - -#, c-format msgid "Connected to %s (%d.%d.%d.%d) via xfer chat" msgstr "Połączono z %s (%d.%d.%d.%d) poprzez rozmowę xfer" +#, c-format +msgid "%s%s: can't find xfer for buffer \"%s\"" +msgstr "%s%s: nie można znaleźć xfer dla bufora \"%s\"" + msgid "Xfer list:" msgstr "Lista xferów:" @@ -7303,79 +7309,3 @@ msgstr "Hashtable (wyjście)" msgid "Pointer" msgstr "Wskaźnik" - -#~ msgid "number of colors to use for nicks colors" -#~ msgstr "liczba kolorów do użycia dla kolorowania nicków" - -#~ msgid "text color #1 for nick" -#~ msgstr "kolor #1 nicka" - -#~ msgid "text color #2 for nick" -#~ msgstr "kolor #2 nicka" - -#~ msgid "text color #3 for nick" -#~ msgstr "kolor #3 nicka" - -#~ msgid "text color #4 for nick" -#~ msgstr "kolor #4 nicka" - -#~ msgid "text color #5 for nick" -#~ msgstr "kolor #5 nicka" - -#~ msgid "text color #6 for nick" -#~ msgstr "kolor #6 nicka" - -#~ msgid "text color #7 for nick" -#~ msgstr "kolor #7 nicka" - -#~ msgid "text color #8 for nick" -#~ msgstr "kolor #8 nicka" - -#~ msgid "text color #9 for nick" -#~ msgstr "kolor #9 nicka" - -#~ msgid "text color #10 for nick" -#~ msgstr "kolor #10 nicka" - -#~ msgid "colors: %s buffer %s nick1 %s nick2 %s nick3 %s nick4" -#~ msgstr "kolory: %s bufor %s nick1 %s nick2 %s nick3 %s nick4" - -#~ msgid "[-server server] receiver[,receiver] text" -#~ msgstr "[-server serwer] odbiorca[,odbiorca] tekst" - -#~ msgid "[-server server] nickname text" -#~ msgstr "[-server serwer] nick tekst" - -#~ msgid "" -#~ " server: send to this server (internal name)\n" -#~ "nickname: user to send notice to\n" -#~ " text: text to send" -#~ msgstr "" -#~ " serwer: wyślij do tego serwerar (nazwa wewnętrzna)\n" -#~ "nick: użytkownik, do którego wysłac powiadomienie\n" -#~ " tekst: treść" - -#~ msgid "items of bar" -#~ msgstr "elementy paska" - -#~ msgid "time format for each line displayed in buffers" -#~ msgstr "format czasu dla każej linii wyświetlanej w buforze" - -#~ msgid "time format for \"time\" bar item" -#~ msgstr "format czasu dla elementu paska \"time\"" - -#~ msgid "file containing the certificate authorities" -#~ msgstr "plik zawierający dane centrum uwierzytelniającego (CA)" - -#~ msgid "ssl certificate file used to automatically identify your nick" -#~ msgstr "" -#~ "certyfikat ssl użyty do automatycznego identyfikowania Twojego nicka" - -#~ msgid "path for writing incoming files" -#~ msgstr "ścieżka do zapisu przychodzących plików" - -#~ msgid "" -#~ "path for reading files when sending (when no path is specified by user)" -#~ msgstr "" -#~ "ścieżka dla plików do wysłania (kiedy nie podano żadnej, określa ją " -#~ "użytkownik)" diff --git a/po/pt_BR.po b/po/pt_BR.po index 37b24900f..9bb739439 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -20,8 +20,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-01-16 09:21+0100\n" -"PO-Revision-Date: 2011-01-16 11:57+0100\n" +"POT-Creation-Date: 2011-01-31 18:41+0100\n" +"PO-Revision-Date: 2011-01-31 14:51+0100\n" "Last-Translator: Ivan Sichmann Freitas <ivansichfreitas@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: Portuguese\n" @@ -221,7 +221,7 @@ msgid "No local variable defined for buffer \"%s\"" msgstr "Nenhuma variável local definida para o buffer \"%s\"" #, c-format -msgid "%sInvalid pair number \"%s\" (must be between %d and %d)" +msgid "%sInvalid color number \"%s\" (must be between %d and %d)" msgstr "" #, c-format @@ -1015,28 +1015,24 @@ msgstr "" " pular para o próximo buffer:\n" " /buffer +1" -msgid "define custom colors and display palette of colors" +msgid "define color aliases and display palette of colors" msgstr "" -msgid "[add pair [alias] [fg,bg]] | [del pair] | switch" +msgid "[add color alias] | [del color] | reset" msgstr "" msgid "" -" add: add a color pair\n" -" del: delete a color pair\n" -"switch: switch WeeChat/terminal colors\n" -" pair: pair number (>= 1)\n" +" add: add an alias for a color\n" +" del: delete an alias\n" +" color: color number (>= 1, max depends on terminal, commonly 63 or 255)\n" " alias: alias name for color (for example: \"orange\")\n" -" fg,bg: foreground and background pair number (-1 for default terminal " -"foreground or background)\n" +" reset: reset all color pairs (useful when no more pairs are available)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" "Examples:\n" -" add color 214 with alias \"orange\":\n" +" add alias \"orange\" for color 214:\n" " /color add 214 orange\n" -" add color 250 with orange on blue:\n" -" /color add 250 214,4 orange_blue\n" " delete color 214:\n" " /color del 214" msgstr "" @@ -1059,11 +1055,14 @@ msgstr "" msgid "control debug for core/plugins" msgstr "cotrolar depuração para core/plugins" -msgid "[list | set plugin level | dump [plugin] | buffer | windows | term]" +#, fuzzy +msgid "" +"[list | set plugin level | dump [plugin] | buffer | windows | term | color]" msgstr "[list | set plugin level | dump [plugin] | buffer | windows | term]" # find a better translation to dump? # find a better translation do log? +#, fuzzy msgid "" " set: set log level for plugin\n" " plugin: name of plugin (\"core\" for WeeChat core)\n" @@ -1072,7 +1071,8 @@ msgid "" "WeeChat crashes)\n" " buffer: dump buffer content with hexadecimal values in log file\n" "windows: display windows tree\n" -" term: display infos about terminal and available colors" +" term: display infos about terminal and available colors\n" +" color: display infos about current color pairs" msgstr "" " set: configura o nível de log para o plugin\n" " plugin: nome do plugin (\"core\" para o core do WeeChat)\n" @@ -1762,8 +1762,8 @@ msgid "properties that can be read on a buffer" msgstr "propriedades que podem ser lidas em um buffer" #, fuzzy -msgid "color pairs" -msgstr "cor" +msgid "palette colors" +msgstr "comando padrão:" msgid "configuration files" msgstr "arquivos de configuração" @@ -1841,10 +1841,7 @@ msgstr "" "nível de debug para o plugin (\"core\" para o componente principal do " "WeeChat)" -msgid "" -"custom color in palette, format is: \"alias;fg,bg\" where alias is color " -"name, fg,bg is \"foreground,background\" (example: \"200,-1\") (everything " -"is optional in this format and order is not important)" +msgid "alias for color" msgstr "" #, fuzzy, c-format @@ -2166,7 +2163,9 @@ msgstr "" msgid "text color for nicks in chat window" msgstr "" -msgid "text color for nicks (comma separated list of colors)" +msgid "" +"text color for nicks (comma separated list of colors, background is allowed " +"with format: \"fg/bg\", for example: \"blue/red\")" msgstr "" msgid "text color for local nick in chat window" @@ -2541,6 +2540,12 @@ msgid "" "version)" msgstr "" +#, c-format +msgid "" +"Warning: the %d color pairs are used, do \"/color reset\" to remove unused " +"pairs" +msgstr "" + msgid "Terminal infos:" msgstr "" @@ -2551,20 +2556,17 @@ msgstr "" msgid "Default colors:" msgstr "comando padrão:" -msgid "" -"WeeChat colors | Actions: [R] Refresh [Q] Close buffer | Keys: [alt-c] " -"Toggle colors" -msgstr "" - msgid "Terminal colors:" msgstr "" -msgid "WeeChat colors:" +msgid "" +"WeeChat colors | Actions: [e] Display extra infos [r] Refresh [z] Reset " +"colors [q] Close buffer | Keys: [alt-c] Temporarily switch to terminal colors" msgstr "" -#, fuzzy -msgid "fixed color" -msgstr "cor" +#, c-format +msgid "WeeChat colors (in use: %d, left: %d):" +msgstr "" msgid "WeeChat basic colors:" msgstr "" @@ -2572,7 +2574,11 @@ msgstr "" msgid "Nick colors:" msgstr "" -msgid "Palette colors:" +#, fuzzy +msgid "Color aliases:" +msgstr "cor" + +msgid "Content of colors (r/g/b):" msgstr "" msgid "Terminal lost, exiting WeeChat..." @@ -2589,10 +2595,6 @@ msgstr "" msgid " TERM='%s', size: %dx%d" msgstr "" -#, c-format -msgid " %d colors available, %d pairs" -msgstr "" - msgid "server" msgid_plural "servers" msgstr[0] "" @@ -6377,11 +6379,11 @@ msgid "%s%s: error sending data to \"%s\" via xfer chat" msgstr "" #, c-format -msgid "%s%s: can't find xfer for buffer \"%s\"" +msgid "Connected to %s (%d.%d.%d.%d) via xfer chat" msgstr "" #, c-format -msgid "Connected to %s (%d.%d.%d.%d) via xfer chat" +msgid "%s%s: can't find xfer for buffer \"%s\"" msgstr "" msgid "Xfer list:" @@ -20,8 +20,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-01-16 09:21+0100\n" -"PO-Revision-Date: 2011-01-16 11:57+0100\n" +"POT-Creation-Date: 2011-01-31 18:41+0100\n" +"PO-Revision-Date: 2011-01-31 14:51+0100\n" "Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: Russian\n" @@ -226,7 +226,7 @@ msgid "No local variable defined for buffer \"%s\"" msgstr "" #, c-format -msgid "%sInvalid pair number \"%s\" (must be between %d and %d)" +msgid "%sInvalid color number \"%s\" (must be between %d and %d)" msgstr "" #, c-format @@ -989,28 +989,24 @@ msgstr "" " отмотать 20 сообщений: /buffer scroll -20\n" " перейти к #weechat: /buffer #weechat" -msgid "define custom colors and display palette of colors" +msgid "define color aliases and display palette of colors" msgstr "" -msgid "[add pair [alias] [fg,bg]] | [del pair] | switch" +msgid "[add color alias] | [del color] | reset" msgstr "" msgid "" -" add: add a color pair\n" -" del: delete a color pair\n" -"switch: switch WeeChat/terminal colors\n" -" pair: pair number (>= 1)\n" +" add: add an alias for a color\n" +" del: delete an alias\n" +" color: color number (>= 1, max depends on terminal, commonly 63 or 255)\n" " alias: alias name for color (for example: \"orange\")\n" -" fg,bg: foreground and background pair number (-1 for default terminal " -"foreground or background)\n" +" reset: reset all color pairs (useful when no more pairs are available)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" "Examples:\n" -" add color 214 with alias \"orange\":\n" +" add alias \"orange\" for color 214:\n" " /color add 214 orange\n" -" add color 250 with orange on blue:\n" -" /color add 250 214,4 orange_blue\n" " delete color 214:\n" " /color del 214" msgstr "" @@ -1035,7 +1031,8 @@ msgid "control debug for core/plugins" msgstr "" #, fuzzy -msgid "[list | set plugin level | dump [plugin] | buffer | windows | term]" +msgid "" +"[list | set plugin level | dump [plugin] | buffer | windows | term | color]" msgstr "dump | buffer | windows" #, fuzzy @@ -1047,7 +1044,8 @@ msgid "" "WeeChat crashes)\n" " buffer: dump buffer content with hexadecimal values in log file\n" "windows: display windows tree\n" -" term: display infos about terminal and available colors" +" term: display infos about terminal and available colors\n" +" color: display infos about current color pairs" msgstr "" " dump: сохранить дамп памяти в журнал WeeChat (аналогично дампу при крахе " "WeeChat)\n" @@ -1547,8 +1545,8 @@ msgid "properties that can be read on a buffer" msgstr "загрузка буфера не удалась" #, fuzzy -msgid "color pairs" -msgstr "цвет чата" +msgid "palette colors" +msgstr "Комбинации клавиш по умолчанию восстановлены\n" #, fuzzy msgid "configuration files" @@ -1636,10 +1634,7 @@ msgstr "Дата сменилась на %s\n" msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "" -msgid "" -"custom color in palette, format is: \"alias;fg,bg\" where alias is color " -"name, fg,bg is \"foreground,background\" (example: \"200,-1\") (everything " -"is optional in this format and order is not important)" +msgid "alias for color" msgstr "" #, fuzzy, c-format @@ -1967,7 +1962,9 @@ msgid "text color for nicks in chat window" msgstr "цвет времени в окне чата" #, fuzzy -msgid "text color for nicks (comma separated list of colors)" +msgid "" +"text color for nicks (comma separated list of colors, background is allowed " +"with format: \"fg/bg\", for example: \"blue/red\")" msgstr "цвет времени в окне чата" #, fuzzy @@ -2399,6 +2396,12 @@ msgid "" "version)" msgstr "" +#, c-format +msgid "" +"Warning: the %d color pairs are used, do \"/color reset\" to remove unused " +"pairs" +msgstr "" + msgid "Terminal infos:" msgstr "" @@ -2409,22 +2412,18 @@ msgstr "" msgid "Default colors:" msgstr "Комбинации клавиш по умолчанию восстановлены\n" -msgid "" -"WeeChat colors | Actions: [R] Refresh [Q] Close buffer | Keys: [alt-c] " -"Toggle colors" -msgstr "" - #, fuzzy msgid "Terminal colors:" msgstr "управление буферами" -#, fuzzy -msgid "WeeChat colors:" -msgstr "Конфигурационный файл сохранён\n" +msgid "" +"WeeChat colors | Actions: [e] Display extra infos [r] Refresh [z] Reset " +"colors [q] Close buffer | Keys: [alt-c] Temporarily switch to terminal colors" +msgstr "" -#, fuzzy -msgid "fixed color" -msgstr "цвет чата" +#, c-format +msgid "WeeChat colors (in use: %d, left: %d):" +msgstr "" #, fuzzy msgid "WeeChat basic colors:" @@ -2435,8 +2434,11 @@ msgid "Nick colors:" msgstr "цвет чата" #, fuzzy -msgid "Palette colors:" -msgstr "Комбинации клавиш по умолчанию восстановлены\n" +msgid "Color aliases:" +msgstr "Список сокращений:\n" + +msgid "Content of colors (r/g/b):" +msgstr "" msgid "Terminal lost, exiting WeeChat..." msgstr "" @@ -2453,10 +2455,6 @@ msgstr "%s не могу сохранить конфигурационный ф msgid " TERM='%s', size: %dx%d" msgstr "" -#, c-format -msgid " %d colors available, %d pairs" -msgstr "" - #, fuzzy msgid "server" msgid_plural "servers" @@ -6694,13 +6692,13 @@ msgid "%s%s: error sending data to \"%s\" via xfer chat" msgstr "%s ошибка при отправке данных \"%s\" через DCC-чат\n" #, fuzzy, c-format -msgid "%s%s: can't find xfer for buffer \"%s\"" -msgstr "%s невозможно создать новый буфер привата \"%s\"\n" - -#, fuzzy, c-format msgid "Connected to %s (%d.%d.%d.%d) via xfer chat" msgstr "Соединён с %s%s %s(%s%d.%d.%d.%d%s)%s DCC-чатом\n" +#, fuzzy, c-format +msgid "%s%s: can't find xfer for buffer \"%s\"" +msgstr "%s невозможно создать новый буфер привата \"%s\"\n" + #, fuzzy msgid "Xfer list:" msgstr "очистить хотлист" @@ -6937,80 +6935,3 @@ msgstr "" #, fuzzy msgid "Pointer" msgstr "минута" - -#~ msgid "number of colors to use for nicks colors" -#~ msgstr "количество цветов для раскрашивания ников" - -#, fuzzy -#~ msgid "text color #1 for nick" -#~ msgstr "цвет ника" - -#, fuzzy -#~ msgid "text color #2 for nick" -#~ msgstr "цвет ника" - -#, fuzzy -#~ msgid "text color #3 for nick" -#~ msgstr "цвет ника" - -#, fuzzy -#~ msgid "text color #4 for nick" -#~ msgstr "цвет ника" - -#, fuzzy -#~ msgid "text color #5 for nick" -#~ msgstr "цвет ника" - -#, fuzzy -#~ msgid "text color #6 for nick" -#~ msgstr "цвет ника" - -#, fuzzy -#~ msgid "text color #7 for nick" -#~ msgstr "цвет ника" - -#, fuzzy -#~ msgid "text color #8 for nick" -#~ msgstr "цвет ника" - -#, fuzzy -#~ msgid "text color #9 for nick" -#~ msgstr "цвет ника" - -#, fuzzy -#~ msgid "text color #10 for nick" -#~ msgstr "цвет ника" - -#, fuzzy -#~ msgid "[-server server] receiver[,receiver] text" -#~ msgstr "адресат[,адресат] текст" - -#, fuzzy -#~ msgid "[-server server] nickname text" -#~ msgstr "[сервер | ник]" - -#, fuzzy -#~ msgid "" -#~ " server: send to this server (internal name)\n" -#~ "nickname: user to send notice to\n" -#~ " text: text to send" -#~ msgstr "" -#~ " ник: адресат уведомления\n" -#~ "текст: отправляемый текст" - -#, fuzzy -#~ msgid "items of bar" -#~ msgstr "Список сокращений:\n" - -#, fuzzy -#~ msgid "time format for \"time\" bar item" -#~ msgstr "время в информационной строке" - -#, fuzzy -#~ msgid "path for writing incoming files" -#~ msgstr "путь для получаемых файлов" - -#, fuzzy -#~ msgid "" -#~ "path for reading files when sending (when no path is specified by user)" -#~ msgstr "путь для поиска отправляемых файлов (если не задан полный путь)" diff --git a/po/weechat.pot b/po/weechat.pot index 8d1b7da1b..18952041f 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-01-16 09:21+0100\n" +"POT-Creation-Date: 2011-01-31 18:41+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -185,7 +185,7 @@ msgid "No local variable defined for buffer \"%s\"" msgstr "" #, c-format -msgid "%sInvalid pair number \"%s\" (must be between %d and %d)" +msgid "%sInvalid color number \"%s\" (must be between %d and %d)" msgstr "" #, c-format @@ -849,28 +849,24 @@ msgid "" " /buffer +1" msgstr "" -msgid "define custom colors and display palette of colors" +msgid "define color aliases and display palette of colors" msgstr "" -msgid "[add pair [alias] [fg,bg]] | [del pair] | switch" +msgid "[add color alias] | [del color] | reset" msgstr "" msgid "" -" add: add a color pair\n" -" del: delete a color pair\n" -"switch: switch WeeChat/terminal colors\n" -" pair: pair number (>= 1)\n" +" add: add an alias for a color\n" +" del: delete an alias\n" +" color: color number (>= 1, max depends on terminal, commonly 63 or 255)\n" " alias: alias name for color (for example: \"orange\")\n" -" fg,bg: foreground and background pair number (-1 for default terminal " -"foreground or background)\n" +" reset: reset all color pairs (useful when no more pairs are available)\n" "\n" "Without argument, this command displays colors in a new buffer.\n" "\n" "Examples:\n" -" add color 214 with alias \"orange\":\n" +" add alias \"orange\" for color 214:\n" " /color add 214 orange\n" -" add color 250 with orange on blue:\n" -" /color add 250 214,4 orange_blue\n" " delete color 214:\n" " /color del 214" msgstr "" @@ -890,7 +886,8 @@ msgstr "" msgid "control debug for core/plugins" msgstr "" -msgid "[list | set plugin level | dump [plugin] | buffer | windows | term]" +msgid "" +"[list | set plugin level | dump [plugin] | buffer | windows | term | color]" msgstr "" msgid "" @@ -901,7 +898,8 @@ msgid "" "WeeChat crashes)\n" " buffer: dump buffer content with hexadecimal values in log file\n" "windows: display windows tree\n" -" term: display infos about terminal and available colors" +" term: display infos about terminal and available colors\n" +" color: display infos about current color pairs" msgstr "" msgid "" @@ -1326,7 +1324,7 @@ msgstr "" msgid "properties that can be read on a buffer" msgstr "" -msgid "color pairs" +msgid "palette colors" msgstr "" msgid "configuration files" @@ -1395,10 +1393,7 @@ msgstr "" msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "" -msgid "" -"custom color in palette, format is: \"alias;fg,bg\" where alias is color " -"name, fg,bg is \"foreground,background\" (example: \"200,-1\") (everything " -"is optional in this format and order is not important)" +msgid "alias for color" msgstr "" #, c-format @@ -1674,7 +1669,9 @@ msgstr "" msgid "text color for nicks in chat window" msgstr "" -msgid "text color for nicks (comma separated list of colors)" +msgid "" +"text color for nicks (comma separated list of colors, background is allowed " +"with format: \"fg/bg\", for example: \"blue/red\")" msgstr "" msgid "text color for local nick in chat window" @@ -2049,6 +2046,12 @@ msgid "" "version)" msgstr "" +#, c-format +msgid "" +"Warning: the %d color pairs are used, do \"/color reset\" to remove unused " +"pairs" +msgstr "" + msgid "Terminal infos:" msgstr "" @@ -2058,18 +2061,16 @@ msgstr "" msgid "Default colors:" msgstr "" -msgid "" -"WeeChat colors | Actions: [R] Refresh [Q] Close buffer | Keys: [alt-c] " -"Toggle colors" -msgstr "" - msgid "Terminal colors:" msgstr "" -msgid "WeeChat colors:" +msgid "" +"WeeChat colors | Actions: [e] Display extra infos [r] Refresh [z] Reset " +"colors [q] Close buffer | Keys: [alt-c] Temporarily switch to terminal colors" msgstr "" -msgid "fixed color" +#, c-format +msgid "WeeChat colors (in use: %d, left: %d):" msgstr "" msgid "WeeChat basic colors:" @@ -2078,7 +2079,10 @@ msgstr "" msgid "Nick colors:" msgstr "" -msgid "Palette colors:" +msgid "Color aliases:" +msgstr "" + +msgid "Content of colors (r/g/b):" msgstr "" msgid "Terminal lost, exiting WeeChat..." @@ -2095,10 +2099,6 @@ msgstr "" msgid " TERM='%s', size: %dx%d" msgstr "" -#, c-format -msgid " %d colors available, %d pairs" -msgstr "" - msgid "server" msgid_plural "servers" msgstr[0] "" @@ -5880,11 +5880,11 @@ msgid "%s%s: error sending data to \"%s\" via xfer chat" msgstr "" #, c-format -msgid "%s%s: can't find xfer for buffer \"%s\"" +msgid "Connected to %s (%d.%d.%d.%d) via xfer chat" msgstr "" #, c-format -msgid "Connected to %s (%d.%d.%d.%d) via xfer chat" +msgid "%s%s: can't find xfer for buffer \"%s\"" msgstr "" msgid "Xfer list:" diff --git a/src/core/wee-command.c b/src/core/wee-command.c index a7d84117b..c1143883b 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -889,7 +889,7 @@ COMMAND_CALLBACK(buffer) COMMAND_CALLBACK(color) { - char *str_alias, *str_pair, *str_rgb, *pos, *error; + char *str_alias, *str_rgb, *pos, *error; char str_color[1024], str_command[1024]; long number; int i; @@ -905,17 +905,17 @@ COMMAND_CALLBACK(color) return WEECHAT_RC_OK; } - /* add a color pair */ + /* add a color */ if (string_strcasecmp (argv[1], "add") == 0) { - COMMAND_MIN_ARGS(3, "color add"); + COMMAND_MIN_ARGS(4, "color add"); - /* check pair number */ + /* check color number */ error = NULL; number = strtol (argv[2], &error, 10); if (error && !error[0]) { - if ((number < 1) || (number > gui_color_get_last_pair ())) + if ((number < 0) || (number > gui_color_get_term_colors ())) number = -1; } else @@ -925,30 +925,23 @@ COMMAND_CALLBACK(color) if (number < 0) { gui_chat_printf (NULL, - _("%sInvalid pair number \"%s\" (must be between " - "%d and %d)"), + _("%sInvalid color number \"%s\" (must be " + "between %d and %d)"), gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], - argv[2], 1, gui_color_get_last_pair ()); + argv[2], 0, gui_color_get_term_colors ()); return WEECHAT_RC_ERROR; } /* check other arguments */ str_alias = NULL; - str_pair = NULL; str_rgb = NULL; for (i = 3; i < argc; i++) { - pos = strchr (argv[i], ','); + pos = strchr (argv[i], '/'); if (pos) - str_pair = argv[i]; + str_rgb = argv[i]; else - { - pos = strchr (argv[i], '/'); - if (pos) - str_rgb = argv[i]; - else - str_alias = argv[i]; - } + str_alias = argv[i]; } str_color[0] = '\0'; if (str_alias) @@ -956,18 +949,13 @@ COMMAND_CALLBACK(color) strcat (str_color, ";"); strcat (str_color, str_alias); } - if (str_pair) - { - strcat (str_color, ";"); - strcat (str_color, str_pair); - } if (str_rgb) { strcat (str_color, ";"); strcat (str_color, str_rgb); } - /* add color pair */ + /* add color */ snprintf (str_command, sizeof (str_command), "/set weechat.palette.%d \"%s\"", (int)number, @@ -976,17 +964,17 @@ COMMAND_CALLBACK(color) return WEECHAT_RC_OK; } - /* delete a color pair */ + /* delete a color */ if (string_strcasecmp (argv[1], "del") == 0) { COMMAND_MIN_ARGS(3, "color del"); - /* check pair number */ + /* check color number */ error = NULL; number = strtol (argv[2], &error, 10); if (error && !error[0]) { - if ((number < 1) || (number > gui_color_get_last_pair ())) + if ((number < 0) || (number > gui_color_get_term_colors ())) number = -1; } else @@ -996,14 +984,14 @@ COMMAND_CALLBACK(color) if (number < 0) { gui_chat_printf (NULL, - _("%sInvalid pair number \"%s\" (must be between " - "%d and %d)"), + _("%sInvalid color number \"%s\" (must be " + "between %d and %d)"), gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], - argv[2], 1, gui_color_get_last_pair ()); + argv[2], 0, gui_color_get_term_colors ()); return WEECHAT_RC_ERROR; } - /* search color pair */ + /* search color */ color_palette = gui_color_palette_get ((int)number); if (!color_palette) { @@ -1014,7 +1002,7 @@ COMMAND_CALLBACK(color) return WEECHAT_RC_ERROR; } - /* delete color pair */ + /* delete color */ snprintf (str_command, sizeof (str_command), "/unset weechat.palette.%d", (int)number); @@ -1022,6 +1010,13 @@ COMMAND_CALLBACK(color) return WEECHAT_RC_OK; } + /* reset color pairs */ + if (string_strcasecmp (argv[1], "reset") == 0) + { + gui_color_reset_pairs (); + return WEECHAT_RC_OK; + } + /* switch WeeChat/terminal colors */ if (string_strcasecmp (argv[1], "switch") == 0) { @@ -1138,6 +1133,10 @@ COMMAND_CALLBACK(debug) { gui_window_term_display_infos (); } + else if (string_strcasecmp (argv[1], "color") == 0) + { + gui_color_dump (buffer); + } else if (string_strcasecmp (argv[1], "set") == 0) { COMMAND_MIN_ARGS(4, "debug set"); @@ -4524,27 +4523,25 @@ command_init () " || %(buffers_numbers)", &command_buffer, NULL); hook_command (NULL, "color", - N_("define custom colors and display palette of colors"), - N_("[add pair [alias] [fg,bg]] | [del pair] | switch"), - N_(" add: add a color pair\n" - " del: delete a color pair\n" - "switch: switch WeeChat/terminal colors\n" - " pair: pair number (>= 1)\n" + N_("define color aliases and display palette of colors"), + N_("[add color alias] | [del color] | reset"), + N_(" add: add an alias for a color\n" + " del: delete an alias\n" + " color: color number (>= 1, max depends on terminal, " + "commonly 63 or 255)\n" " alias: alias name for color (for example: \"orange\")\n" - " fg,bg: foreground and background pair number (-1 for " - "default terminal foreground or background)\n\n" + " reset: reset all color pairs (useful when no more " + "pairs are available)\n\n" "Without argument, this command displays colors in a new " "buffer.\n\n" "Examples:\n" - " add color 214 with alias \"orange\":\n" + " add alias \"orange\" for color 214:\n" " /color add 214 orange\n" - " add color 250 with orange on blue:\n" - " /color add 250 214,4 orange_blue\n" " delete color 214:\n" " /color del 214"), - "add %(color_pairs)" - " || del %(color_pairs)" - " || switch", + "add %(palette_colors)" + " || del %(palette_colors)" + " || reset", &command_color, NULL); hook_command (NULL, "command", N_("launch explicit WeeChat or plugin command"), @@ -4558,7 +4555,7 @@ command_init () hook_command (NULL, "debug", N_("control debug for core/plugins"), N_("[list | set plugin level | dump [plugin] | buffer | " - "windows | term]"), + "windows | term | color]"), N_(" set: set log level for plugin\n" " plugin: name of plugin (\"core\" for WeeChat core)\n" " level: debug level for plugin (0 = disable debug)\n" @@ -4568,13 +4565,15 @@ command_init () "in log file\n" "windows: display windows tree\n" " term: display infos about terminal and available " - "colors"), + "colors\n" + " color: display infos about current color pairs"), "list" " || set %(plugins_names)|core" " || dump %(plugins_names)|core" " || buffer" " || windows" - " || term", + " || term" + " || color", &command_debug, NULL); hook_command (NULL, "filter", N_("filter messages in buffers, to hide/show them according " diff --git a/src/core/wee-completion.c b/src/core/wee-completion.c index b7a1d00c9..5298fd0cf 100644 --- a/src/core/wee-completion.c +++ b/src/core/wee-completion.c @@ -261,13 +261,13 @@ completion_list_add_buffer_properties_get_cb (void *data, } /* - * completion_list_map_add_color_cb: add color pairs in completion + * completion_list_map_add_palette_color_cb: add palette color in completion */ void -completion_list_map_add_color_cb (void *data, - struct t_hashtable *hashtable, - const void *key, const void *value) +completion_list_map_add_palette_color_cb (void *data, + struct t_hashtable *hashtable, + const void *key, const void *value) { /* make C compiler happy */ (void) hashtable; @@ -279,14 +279,14 @@ completion_list_map_add_color_cb (void *data, } /* - * completion_list_add_color_pairs_cb: add color pairs (in section "palette") + * completion_list_add_palette_colors_cb: add colors (in section "palette") */ int -completion_list_add_color_pairs_cb (void *data, - const char *completion_item, - struct t_gui_buffer *buffer, - struct t_gui_completion *completion) +completion_list_add_palette_colors_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { /* make C compiler happy */ (void) data; @@ -294,7 +294,7 @@ completion_list_add_color_pairs_cb (void *data, (void) buffer; hashtable_map (gui_color_hash_palette_color, - &completion_list_map_add_color_cb, + &completion_list_map_add_palette_color_cb, completion); return WEECHAT_RC_OK; @@ -776,12 +776,13 @@ completion_list_add_config_option_values_cb (void *data, struct t_gui_completion *completion) { char *pos_space, *option_full_name, *pos_section, *pos_option; - char *file, *section, *value_string; + char *file, *section, *value_string, str_number[64]; const char *color_name; int length, i, num_colors; struct t_config_file *ptr_config; struct t_config_section *ptr_section, *section_found; struct t_config_option *option_found; + struct t_gui_color_palette *color_palette; /* make C compiler happy */ (void) data; @@ -943,15 +944,32 @@ completion_list_add_config_option_values_cb (void *data, { color_name = gui_color_get_name (i); if (color_name) + { gui_completion_list_add (completion, color_name, 0, WEECHAT_LIST_POS_SORT); + } } - if (gui_color_hash_palette_alias) + num_colors = gui_color_get_term_colors (); + for (i = 0; i <= num_colors; i++) { - hashtable_map (gui_color_hash_palette_alias, - &completion_list_map_add_color_alias_cb, - completion); + color_palette = gui_color_palette_get (i); + if (color_palette) + { + gui_completion_list_add (completion, + color_palette->alias, + 0, WEECHAT_LIST_POS_END); + } + else + { + snprintf (str_number, + sizeof (str_number), + "%d", + i); + gui_completion_list_add (completion, + str_number, + 0, WEECHAT_LIST_POS_END); + } } gui_completion_list_add (completion, "++1", 0, WEECHAT_LIST_POS_END); @@ -1195,9 +1213,9 @@ completion_init () hook_completion (NULL, "buffer_properties_get", N_("properties that can be read on a buffer"), &completion_list_add_buffer_properties_get_cb, NULL); - hook_completion (NULL, "color_pairs", - N_("color pairs"), - &completion_list_add_color_pairs_cb, NULL); + hook_completion (NULL, "palette_colors", + N_("palette colors"), + &completion_list_add_palette_colors_cb, NULL); hook_completion (NULL, "config_files", /* formerly "%c" */ N_("configuration files"), &completion_list_add_config_files_cb, NULL); diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 79e9f541d..1fcb7613e 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -251,7 +251,7 @@ config_change_buffers (void *data, struct t_config_option *option) (void) data; (void) option; - gui_window_refresh_windows (); + gui_window_ask_refresh (1); } /* @@ -384,7 +384,7 @@ config_change_prefix_align_min (void *data, struct t_config_option *option) if (ptr_buffer->mixed_lines) gui_line_compute_prefix_max_length (ptr_buffer->mixed_lines); } - gui_window_refresh_windows (); + gui_window_ask_refresh (1); } /* @@ -400,9 +400,8 @@ config_change_color (void *data, struct t_config_option *option) if (gui_ok) { - gui_color_init_pairs (); gui_color_init_weechat (); - gui_window_refresh_windows (); + gui_window_ask_refresh (1); } } @@ -742,10 +741,7 @@ config_weechat_palette_create_option_cb (void *data, ptr_option = config_file_new_option ( config_file, section, option_name, "string", - _("custom color in palette, format is: \"alias;fg,bg\" " - "where alias is color name, fg,bg is \"foreground,background\" " - "(example: \"200,-1\") (everything is optional " - "in this format and order is not important)"), + _("alias for color"), NULL, 0, 0, "", value, 0, NULL, NULL, &config_weechat_palette_change_cb, NULL, NULL, NULL); @@ -1879,7 +1875,8 @@ config_weechat_init_options () config_color_chat_nick_colors = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_colors", "string", - N_("text color for nicks (comma separated list of colors)"), + N_("text color for nicks (comma separated list of colors, background " + "is allowed with format: \"fg/bg\", for example: \"blue/red\")"), NULL, 0, 0, "cyan,magenta,green,brown,lightblue,default,lightcyan," "lightmagenta,lightgreen,blue", NULL, 0, NULL, NULL, &config_change_nick_colors, NULL, NULL, NULL); diff --git a/src/gui/curses/gui-curses-bar-window.c b/src/gui/curses/gui-curses-bar-window.c index 209ba57e2..cd4408117 100644 --- a/src/gui/curses/gui-curses-bar-window.c +++ b/src/gui/curses/gui-curses-bar-window.c @@ -156,8 +156,8 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window, int hide_chars_if_scrolling) { int weechat_color, x_with_hidden, size_on_screen, fg, bg, low_char, hidden; - int pair, rc; - char str_fg[3], str_bg[3], str_pair[6], utf_char[16], *next_char, *output; + int pair; + char str_fg[6], str_bg[6], str_pair[6], utf_char[16], *next_char, *output; char *error; if (!string || !string[0]) @@ -185,56 +185,150 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window, switch (string[0]) { case GUI_COLOR_FG_CHAR: /* fg color */ - if (string[1] && string[2]) + if (string[1] == GUI_COLOR_PAIR_CHAR) { - str_fg[0] = string[1]; - str_fg[1] = string[2]; - str_fg[2] = '\0'; - rc = sscanf (str_fg, "%d", &fg); - if ((rc != EOF) && (rc >= 1)) + if (string[2] && string[3] && string[4] + && string[5] && string[6]) { - gui_window_set_custom_color_fg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, - fg); + memcpy (str_fg, string + 2, 5); + str_fg[5] = '\0'; + error = NULL; + fg = (int)strtol (str_fg, &error, 10); + if (error && !error[0]) + { + gui_window_set_custom_color_fg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, + fg | GUI_COLOR_PAIR_FLAG); + } + string += 7; + } + } + else + { + if (string[1] && string[2]) + { + str_fg[0] = string[1]; + str_fg[1] = string[2]; + str_fg[2] = '\0'; + error = NULL; + fg = (int)strtol (str_fg, &error, 10); + if (error && !error[0]) + { + gui_window_set_custom_color_fg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, + fg); + } + string += 3; } - string += 3; } break; case GUI_COLOR_BG_CHAR: /* bg color */ - if (string[1] && string[2]) + if (string[1] == GUI_COLOR_PAIR_CHAR) { - str_bg[0] = string[1]; - str_bg[1] = string[2]; - str_bg[2] = '\0'; - rc = sscanf (str_bg, "%d", &bg); - if ((rc != EOF) && (rc >= 1)) + if (string[2] && string[3] && string[4] + && string[5] && string[6]) { - gui_window_set_custom_color_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, - bg); + memcpy (str_bg, string + 2, 5); + str_bg[5] = '\0'; + error = NULL; + bg = (int)strtol (str_bg, &error, 10); + if (error && !error[0]) + { + gui_window_set_custom_color_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, + bg | GUI_COLOR_PAIR_FLAG); + } + string += 7; + } + } + else + { + if (string[1] && string[2]) + { + str_bg[0] = string[1]; + str_bg[1] = string[2]; + str_bg[2] = '\0'; + error = NULL; + bg = (int)strtol (str_bg, &error, 10); + if (error && !error[0]) + { + gui_window_set_custom_color_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, + bg); + } + string += 3; } - string += 3; } break; case GUI_COLOR_FG_BG_CHAR: /* fg + bg color */ - if (string[1] && string[2] && (string[3] == ',') - && string[4] && string[5]) + str_fg[0] = '\0'; + str_bg[0] = '\0'; + fg = -1; + bg = -1; + if (string[1] == GUI_COLOR_PAIR_CHAR) { - str_fg[0] = string[1]; - str_fg[1] = string[2]; - str_fg[2] = '\0'; - str_bg[0] = string[4]; - str_bg[1] = string[5]; - str_bg[2] = '\0'; - rc = sscanf (str_fg, "%d", &fg); - if ((rc != EOF) && (rc >= 1)) + if (string[2] && string[3] && string[4] + && string[5] && string[6]) + { + memcpy (str_fg, string + 2, 5); + str_fg[5] = '\0'; + error = NULL; + fg = (int)strtol (str_fg, &error, 10); + if (!error || error[0]) + fg = -1; + else + fg |= GUI_COLOR_PAIR_FLAG; + string += 7; + } + } + else + { + if (string[1] && string[2]) + { + str_fg[0] = string[1]; + str_fg[1] = string[2]; + str_fg[2] = '\0'; + error = NULL; + fg = (int)strtol (str_fg, &error, 10); + if (!error || error[0]) + fg = -1; + string += 3; + } + } + if (str_fg[0] && (string[0] == ',')) + { + string++; + if (string[0] == GUI_COLOR_PAIR_CHAR) { - rc = sscanf (str_bg, "%d", &bg); - if ((rc != EOF) && (rc >= 1)) + if (string[1] && string[2] && string[3] + && string[4] && string[5]) { - gui_window_set_custom_color_fg_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, - fg, bg); + memcpy (str_bg, string + 1, 5); + str_bg[5] = '\0'; + error = NULL; + bg = (int)strtol (str_bg, &error, 10); + if (!error || error[0]) + bg = -1; + else + bg |= GUI_COLOR_PAIR_FLAG; + string += 6; + } + } + else + { + if (string[0] && string[1]) + { + str_bg[0] = string[0]; + str_bg[1] = string[1]; + str_bg[2] = '\0'; + error = NULL; + bg = (int)strtol (str_bg, &error, 10); + if (!error || error[0]) + bg = -1; + string += 2; } } - string += 6; + } + if ((fg >= 0) && (bg >= 0)) + { + gui_window_set_custom_color_fg_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, + fg, bg); } break; case GUI_COLOR_PAIR_CHAR: /* pair number */ @@ -303,8 +397,9 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window, str_fg[0] = string[0]; str_fg[1] = string[1]; str_fg[2] = '\0'; - rc = sscanf (str_fg, "%d", &weechat_color); - if ((rc != EOF) && (rc >= 1)) + error = NULL; + weechat_color = (int)strtol (str_fg, &error, 10); + if (error && !error[0]) { gui_window_set_weechat_color (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, weechat_color); @@ -500,6 +595,7 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window, if (CONFIG_INTEGER(bar_window->bar->options[GUI_BAR_OPTION_SIZE]) == 0) gui_bar_window_set_current_size (bar_window, window, 1); gui_window_clear (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, + CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_FG]), CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG])); } else @@ -554,6 +650,7 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window, } gui_window_clear (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, + CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_FG]), CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG])); x = 0; y = 0; @@ -714,6 +811,7 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window, if (CONFIG_INTEGER(bar_window->bar->options[GUI_BAR_OPTION_SIZE]) == 0) gui_bar_window_set_current_size (bar_window, window, 1); gui_window_clear (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, + CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_FG]), CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG])); } diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c index 9a5468e00..21a836e56 100644 --- a/src/gui/curses/gui-curses-chat.c +++ b/src/gui/curses/gui-curses-chat.c @@ -180,7 +180,7 @@ gui_chat_string_next_char (struct t_gui_window *window, const unsigned char *string, int apply_style) { char str_fg[3], str_bg[3], str_pair[6], *error; - int weechat_color, fg, bg, pair, rc; + int weechat_color, fg, bg, pair; while (string[0]) { @@ -196,65 +196,174 @@ gui_chat_string_next_char (struct t_gui_window *window, switch (string[0]) { case GUI_COLOR_FG_CHAR: /* fg color */ - if (string[1] && string[2]) + if (string[1] == GUI_COLOR_PAIR_CHAR) { - if (apply_style) + if (string[2] && string[3] && string[4] + && string[5] && string[6]) { - str_fg[0] = string[1]; - str_fg[1] = string[2]; - str_fg[2] = '\0'; - rc = sscanf (str_fg, "%d", &fg); - if ((rc != EOF) && (rc >= 1)) + if (apply_style) + { + memcpy (str_fg, string + 2, 5); + str_fg[5] = '\0'; + error = NULL; + fg = (int)strtol (str_fg, &error, 10); + if (error && !error[0]) + { + gui_window_set_custom_color_fg (GUI_WINDOW_OBJECTS(window)->win_chat, + fg | GUI_COLOR_PAIR_FLAG); + } + } + string += 7; + } + } + else + { + if (string[1] && string[2]) + { + if (apply_style) { - gui_window_set_custom_color_fg (GUI_WINDOW_OBJECTS(window)->win_chat, - fg); + str_fg[0] = string[1]; + str_fg[1] = string[2]; + str_fg[2] = '\0'; + error = NULL; + fg = (int)strtol (str_fg, &error, 10); + if (error && !error[0]) + { + gui_window_set_custom_color_fg (GUI_WINDOW_OBJECTS(window)->win_chat, + fg); + } } + string += 3; } - string += 3; } break; case GUI_COLOR_BG_CHAR: /* bg color */ - if (string[1] && string[2]) + if (string[1] == GUI_COLOR_PAIR_CHAR) { - if (apply_style) + if (string[2] && string[3] && string[4] + && string[5] && string[6]) + { + if (apply_style) + { + memcpy (str_bg, string + 2, 5); + str_bg[5] = '\0'; + error = NULL; + bg = (int)strtol (str_bg, &error, 10); + if (error && !error[0]) + { + gui_window_set_custom_color_bg (GUI_WINDOW_OBJECTS(window)->win_chat, + bg | GUI_COLOR_PAIR_FLAG); + } + } + string += 7; + } + } + else + { + if (string[1] && string[2]) { - str_bg[0] = string[1]; - str_bg[1] = string[2]; - str_bg[2] = '\0'; - rc = sscanf (str_bg, "%d", &bg); - if ((rc != EOF) && (rc >= 1)) + if (apply_style) { - gui_window_set_custom_color_bg (GUI_WINDOW_OBJECTS(window)->win_chat, - bg); + str_bg[0] = string[1]; + str_bg[1] = string[2]; + str_bg[2] = '\0'; + error = NULL; + bg = (int)strtol (str_bg, &error, 10); + if (error && !error[0]) + { + gui_window_set_custom_color_bg (GUI_WINDOW_OBJECTS(window)->win_chat, + bg); + } } + string += 3; } - string += 3; } break; case GUI_COLOR_FG_BG_CHAR: /* fg + bg color */ - if (string[1] && string[2] && (string[3] == ',') - && string[4] && string[5]) + str_fg[0] = '\0'; + str_bg[0] = '\0'; + fg = -1; + bg = -1; + if (string[1] == GUI_COLOR_PAIR_CHAR) { - if (apply_style) + if (string[2] && string[3] && string[4] + && string[5] && string[6]) { - str_fg[0] = string[1]; - str_fg[1] = string[2]; - str_fg[2] = '\0'; - str_bg[0] = string[4]; - str_bg[1] = string[5]; - str_bg[2] = '\0'; - rc = sscanf (str_fg, "%d", &fg); - if ((rc != EOF) && (rc >= 1)) + if (apply_style) + { + memcpy (str_fg, string + 2, 5); + str_fg[5] = '\0'; + error = NULL; + fg = (int)strtol (str_fg, &error, 10); + if (!error || error[0]) + fg = -1; + else + fg |= GUI_COLOR_PAIR_FLAG; + } + string += 7; + } + } + else + { + if (string[1] && string[2]) + { + if (apply_style) + { + str_fg[0] = string[1]; + str_fg[1] = string[2]; + str_fg[2] = '\0'; + error = NULL; + fg = (int)strtol (str_fg, &error, 10); + if (!error || error[0]) + fg = -1; + } + string += 3; + } + } + if (string[0] == ',') + { + string++; + if (string[0] == GUI_COLOR_PAIR_CHAR) + { + if (string[1] && string[2] && string[3] + && string[4] && string[5]) { - rc = sscanf (str_bg, "%d", &bg); - if ((rc != EOF) && (rc >= 1)) + if (apply_style) { - gui_window_set_custom_color_fg_bg (GUI_WINDOW_OBJECTS(window)->win_chat, - fg, bg); + memcpy (str_bg, string + 1, 5); + str_bg[5] = '\0'; + error = NULL; + bg = (int)strtol (str_bg, &error, 10); + if (!error || error[0]) + bg = -1; + else + bg |= GUI_COLOR_PAIR_FLAG; } + string += 6; } } - string += 6; + else + { + if (string[0] && string[1]) + { + if (apply_style) + { + str_bg[0] = string[0]; + str_bg[1] = string[1]; + str_bg[2] = '\0'; + error = NULL; + bg = (int)strtol (str_bg, &error, 10); + if (!error || error[0]) + bg = -1; + } + string += 2; + } + } + } + if (apply_style && (fg >= 0) && (bg >= 0)) + { + gui_window_set_custom_color_fg_bg (GUI_WINDOW_OBJECTS(window)->win_chat, + fg, bg); } break; case GUI_COLOR_PAIR_CHAR: /* pair number */ @@ -301,8 +410,9 @@ gui_chat_string_next_char (struct t_gui_window *window, str_fg[0] = string[0]; str_fg[1] = string[1]; str_fg[2] = '\0'; - rc = sscanf (str_fg, "%d", &weechat_color); - if ((rc != EOF) && (rc >= 1)) + error = NULL; + weechat_color = (int)strtol (str_fg, &error, 10); + if (error && !error[0]) { gui_window_set_weechat_color (GUI_WINDOW_OBJECTS(window)->win_chat, weechat_color); @@ -1028,7 +1138,7 @@ gui_chat_display_line_y (struct t_gui_window *window, struct t_gui_line *line, if (gui_chat_display_word_raw (window, line->data->message, window->win_chat_width, 1) < window->win_chat_width) { - gui_window_clrtoeol_with_current_bg (GUI_WINDOW_OBJECTS(window)->win_chat); + gui_window_clrtoeol (GUI_WINDOW_OBJECTS(window)->win_chat); } } diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c index c3ee4d467..8831946b7 100644 --- a/src/gui/curses/gui-curses-color.c +++ b/src/gui/curses/gui-curses-color.c @@ -32,6 +32,7 @@ #include "../../core/weechat.h" #include "../../core/wee-config.h" #include "../../core/wee-hashtable.h" +#include "../../core/wee-hook.h" #include "../../core/wee-list.h" #include "../../core/wee-string.h" #include "../../core/wee-utf8.h" @@ -43,13 +44,15 @@ #include "gui-curses.h" +#define GUI_COLOR_TIMER_TERM_COLORS 10 + struct t_gui_color gui_weechat_colors[GUI_CURSES_NUM_WEECHAT_COLORS + 1] = -{ { -1, 0, 0, "default" }, +{ { -1, -1, 0, "default" }, { COLOR_BLACK, COLOR_BLACK, 0, "black" }, { COLOR_BLACK, COLOR_BLACK + 8, A_BOLD, "darkgray" }, { COLOR_RED, COLOR_RED, 0, "red" }, { COLOR_RED, COLOR_RED + 8, A_BOLD, "lightred" }, - { COLOR_GREEN, COLOR_GREEN, 0, "green" }, + { COLOR_GREEN, COLOR_GREEN, 0, "green" }, { COLOR_GREEN, COLOR_GREEN + 8, A_BOLD, "lightgreen" }, { COLOR_YELLOW, COLOR_YELLOW, 0, "brown" }, { COLOR_YELLOW, COLOR_YELLOW + 8, A_BOLD, "yellow" }, @@ -63,10 +66,27 @@ struct t_gui_color gui_weechat_colors[GUI_CURSES_NUM_WEECHAT_COLORS + 1] = { 0, 0, 0, NULL } }; -int gui_color_last_pair = 63; -int gui_color_num_bg = 8; -struct t_gui_buffer *gui_color_buffer = NULL; -int gui_color_terminal_colors = 0; +/* terminal colors */ +int gui_color_term_has_colors = 0; /* terminal supports colors? */ +int gui_color_term_colors = 0; /* number of colors in terminal */ +int gui_color_term_color_pairs = 0; /* number of pairs in terminal */ +int gui_color_term_can_change_color = 0; /* change color allowed in term? */ +int gui_color_use_term_colors = 0; /* temp. use of terminal colors? */ +short *gui_color_term_color_content = NULL; /* content of colors (r/b/g) */ + +/* pairs */ +int gui_color_num_pairs = 63; /* number of pairs used by WeeChat */ +int gui_color_num_bg = 8; /* number of backgrounds */ +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? */ + +/* color buffer */ +struct t_gui_buffer *gui_color_buffer = NULL; /* buffer with colors */ +int gui_color_buffer_extra_info = 0; /* display extra info? */ +int gui_color_buffer_refresh_needed = 0; /* refresh needed on buffer? */ +struct t_hook *gui_color_hook_timer = NULL; /* timer for terminal colors */ +int gui_color_timer = 0; /* timer in seconds */ /* @@ -194,13 +214,169 @@ gui_color_get_weechat_colors_number () } /* - * gui_color_get_last_pair: get last pair number + * gui_color_get_term_colors: get number of colors supported by terminal + */ + +int +gui_color_get_term_colors () +{ + return gui_color_term_colors; +} + +/* + * gui_color_get_pairs_arrays: get current pairs as arrays (one array for + * foregrounds, another for backgrounds) + * Each array has "gui_color_num_pairs+1" entries. + * Pairs not used have value -2 in both arrays. + */ + +void +gui_color_get_pairs_arrays (short **foregrounds, short **backgrounds) +{ + int i, fg, bg, index; + + if (!foregrounds || !backgrounds) + return; + + *foregrounds = NULL; + *backgrounds = NULL; + + *foregrounds = malloc (sizeof (*foregrounds[0]) * (gui_color_num_pairs + 1)); + if (!*foregrounds) + goto error; + *backgrounds = malloc (sizeof (*backgrounds[0]) * (gui_color_num_pairs + 1)); + if (!*backgrounds) + goto error; + + for (i = 0; i <= gui_color_num_pairs; i++) + { + (*foregrounds)[i] = -2; + (*backgrounds)[i] = -2; + } + + for (bg = -1; bg <= gui_color_term_colors; bg++) + { + for (fg = -1; fg <= gui_color_term_colors; fg++) + { + index = ((bg + 1) * (gui_color_term_colors + 2)) + (fg + 1); + if ((gui_color_pairs[index] >= 1) + && (gui_color_pairs[index] <= gui_color_num_pairs)) + { + (*foregrounds)[gui_color_pairs[index]] = fg; + (*backgrounds)[gui_color_pairs[index]] = bg; + } + } + } + + return; + +error: + if (*foregrounds) + { + free (*foregrounds); + *foregrounds = NULL; + } + if (*backgrounds) + { + free (*backgrounds); + *backgrounds = NULL; + } +} + +int +gui_color_timer_warning_pairs_full (void *data, int remaining_calls) +{ + /* make C compiler happy */ + (void) data; + (void) remaining_calls; + + gui_chat_printf (NULL, + _("Warning: the %d color pairs are used, do " + "\"/color reset\" to remove unused pairs"), + gui_color_num_pairs); + + return WEECHAT_RC_OK; +} + +/* + * gui_color_get_pair: get a pair with given foreground/background colors + * If no pair is found for fg/bg, a new pair is created + * Value returned is between 0 and COLOR_PAIRS-1 + */ + +int +gui_color_get_pair (int fg, int bg) +{ + int index; + + /* only one color when displaying terminal colors */ + if (gui_color_use_term_colors) + return COLOR_WHITE; + + /* if invalid color, use default fg/bg */ + if (fg > gui_color_term_colors) + fg = -1; + if (bg > gui_color_term_colors) + bg = -1; + + /* if not real white, we use default terminal foreground instead of white */ + if ((fg == COLOR_WHITE) && !CONFIG_BOOLEAN(config_look_color_real_white)) + fg = -1; + + /* compute index for gui_color_pairs with foreground and background */ + index = ((bg + 1) * (gui_color_term_colors + 2)) + (fg + 1); + + /* pair not allocated for this fg/bg? */ + if (gui_color_pairs[index] == 0) + { + if (gui_color_pairs_used >= gui_color_num_pairs) + { + /* oh no, no more pair available! */ + if (!gui_color_warning_pairs_full) + { + hook_timer (NULL, 1, 0, 1, + &gui_color_timer_warning_pairs_full, NULL); + gui_color_warning_pairs_full = 1; + } + return 1; + } + + /* create a new pair if no pair exists for this fg/bg */ + gui_color_pairs_used++; + gui_color_pairs[index] = gui_color_pairs_used; + init_pair (gui_color_pairs_used, fg, bg); + gui_color_buffer_refresh_needed = 1; + } + + return gui_color_pairs[index]; +} + +/* + * gui_color_weechat_get_pair: get color pair with a WeeChat color number */ int -gui_color_get_last_pair () +gui_color_weechat_get_pair (int weechat_color) { - return gui_color_last_pair; + int fg, bg; + + if ((weechat_color < 0) || (weechat_color > GUI_COLOR_NUM_COLORS - 1)) + { + fg = -1; + bg = -1; + } + else + { + fg = gui_color[weechat_color]->foreground; + bg = gui_color[weechat_color]->background; + + if ((fg > 0) && (fg & GUI_COLOR_PAIR_FLAG)) + fg &= GUI_COLOR_PAIR_MASK; + if ((bg > 0) && (bg & GUI_COLOR_PAIR_FLAG)) + bg &= GUI_COLOR_PAIR_MASK; + } + + return gui_color_get_pair (fg, bg); } /* @@ -244,6 +420,7 @@ gui_color_build (int number, int foreground, int background) if (background < 0) background = 0; + /* allocate color */ if (!gui_color[number]) { gui_color[number] = malloc (sizeof (*gui_color[number])); @@ -252,227 +429,161 @@ gui_color_build (int number, int foreground, int background) gui_color[number]->string = malloc (4); } - if (foreground & GUI_COLOR_PAIR_FLAG) + /* set foreground and attributes */ + if (foreground <= GUI_CURSES_NUM_WEECHAT_COLORS) { - gui_color[number]->foreground = foreground; - gui_color[number]->background = 0; - gui_color[number]->attributes = 0; + gui_color[number]->foreground = gui_weechat_colors[foreground].foreground; + gui_color[number]->attributes = gui_weechat_colors[foreground].attributes; } else { - if (background & GUI_COLOR_PAIR_FLAG) - background = 0; - gui_color[number]->foreground = gui_weechat_colors[foreground].foreground; - gui_color[number]->background = gui_weechat_colors[background].foreground; - gui_color[number]->attributes = gui_weechat_colors[foreground].attributes; + gui_color[number]->foreground = foreground; + gui_color[number]->attributes = 0; } + + /* set background */ + if (background <= GUI_CURSES_NUM_WEECHAT_COLORS) + gui_color[number]->background = gui_weechat_colors[background].foreground; + else + gui_color[number]->background = background; + + /* set string */ if (gui_color[number]->string) { snprintf (gui_color[number]->string, 4, - "%s%02d", - GUI_COLOR_COLOR_STR, number); + "%c%02d", + GUI_COLOR_COLOR_CHAR, number); } } /* - * gui_color_weechat_get_pair: get color pair with a WeeChat color number - */ - -int -gui_color_weechat_get_pair (int weechat_color) -{ - int fg, bg; - - if ((weechat_color < 0) || (weechat_color > GUI_COLOR_NUM_COLORS - 1)) - return COLOR_WHITE; - - fg = gui_color[weechat_color]->foreground; - bg = gui_color[weechat_color]->background; - - if ((fg > 0) && (fg & GUI_COLOR_PAIR_FLAG)) - return fg & GUI_COLOR_PAIR_MASK; - - if (((fg == -1) || (fg == 99)) - && ((bg == -1) || (bg == 99))) - return gui_color_last_pair; - if ((fg == -1) || (fg == 99)) - fg = COLOR_WHITE; - if ((bg == -1) || (bg == 99)) - bg = 0; - - return (bg * gui_color_num_bg) + fg + 1; -} - -/* - * gui_color_init_pair: init a color pair + * gui_color_init_vars: init color variables using terminal infos */ void -gui_color_init_pair (int number) +gui_color_init_vars () { - struct t_gui_color_palette *ptr_color_palette; - int fg, bg; + int size; - if ((number >= 1) && (number <= gui_color_last_pair)) + gui_color_term_has_colors = (has_colors ()) ? 1 : 0; + gui_color_term_colors = 0; + gui_color_term_color_pairs = 0; + gui_color_term_can_change_color = 0; + gui_color_num_pairs = 63; + gui_color_num_bg = 8; + if (gui_color_pairs) { - if (gui_color_terminal_colors) - { - init_pair (number, number, -1); - } - else - { - ptr_color_palette = gui_color_palette_get (number); - if (ptr_color_palette) - { - init_pair (number, - ptr_color_palette->foreground, - ptr_color_palette->background); - } - else - { - fg = (number - 1) % gui_color_num_bg; - bg = ((number - 1) < gui_color_num_bg) ? -1 : (number - 1) / gui_color_num_bg; - init_pair (number, fg, bg); - } - } + free (gui_color_pairs); + gui_color_pairs = NULL; } -} - -/* - * gui_color_init_pairs: init color pairs - */ - -void -gui_color_init_pairs () -{ - int i, num_colors; - struct t_gui_color_palette *ptr_color_palette; + gui_color_pairs_used = 0; - /* - * depending on $TERM value, we can have for example: - * - * $TERM | colors | pairs - * ----------------------------------+--------+------ - * rxvt-unicode, xterm,... | 88 | 256 - * rxvt-256color, xterm-256color,... | 256 | 32767 - * screen | 8 | 64 - * screen-256color | 256 | 32767 - */ - - if (has_colors ()) + if (gui_color_term_has_colors) { - gui_color_num_bg = (COLOR_PAIRS >= 256) ? 16 : 8; - num_colors = (COLOR_PAIRS >= 256) ? 256 : COLOR_PAIRS; - gui_color_last_pair = num_colors - 1; + gui_color_term_colors = COLORS; + gui_color_term_color_pairs = COLOR_PAIRS; + gui_color_term_can_change_color = (can_change_color ()) ? 1 : 0; - /* WeeChat pairs */ - for (i = 1; i < num_colors; i++) + gui_color_num_pairs = (gui_color_term_color_pairs >= 256) ? + 255 : gui_color_term_color_pairs - 1; + gui_color_num_bg = (gui_color_term_color_pairs >= 256) ? 16 : 8; + if (gui_color_term_colors > 0) { - gui_color_init_pair (i); + size = (gui_color_term_colors + 2) + * (gui_color_term_colors + 2) + * sizeof (gui_color_pairs[0]); + gui_color_pairs = malloc (size); + if (gui_color_pairs) + memset (gui_color_pairs, 0, size); + gui_color_pairs_used = 0; } - - if (!gui_color_terminal_colors) + /* reserved for future usage */ + /* + gui_color_term_color_content = malloc (sizeof (gui_color_term_color_content[0]) * + (gui_color_term_colors + 1) * 3); + if (gui_color_term_color_content) { - /* disable white on white, replaced by black on white */ - ptr_color_palette = gui_color_palette_get (gui_color_last_pair); - if (!ptr_color_palette) - init_pair (gui_color_last_pair, -1, -1); - - /* - * white on default bg is default (-1) (for terminals with white/light - * background) - */ - if (!CONFIG_BOOLEAN(config_look_color_real_white)) + for (i = 0; i <= gui_color_term_colors; i++) { - ptr_color_palette = gui_color_palette_get (COLOR_WHITE); - if (!ptr_color_palette) - init_pair (COLOR_WHITE + 1, -1, -1); + color_content ((short) i, + &gui_color_term_color_content[i * 3], + &gui_color_term_color_content[(i * 3) + 1], + &gui_color_term_color_content[(i * 3) + 2]); } } + */ } } /* - * gui_color_init_weechat: init WeeChat colors + * gui_color_free_vars: free color variables */ void -gui_color_init_weechat () +gui_color_free_vars () { - gui_color_build (GUI_COLOR_SEPARATOR, CONFIG_COLOR(config_color_separator), CONFIG_COLOR(config_color_chat_bg)); - - gui_color_build (GUI_COLOR_CHAT, CONFIG_COLOR(config_color_chat), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_TIME, CONFIG_COLOR(config_color_chat_time), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_TIME_DELIMITERS, CONFIG_COLOR(config_color_chat_time_delimiters), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_PREFIX_ERROR, CONFIG_COLOR(config_color_chat_prefix[GUI_CHAT_PREFIX_ERROR]), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_PREFIX_NETWORK, CONFIG_COLOR(config_color_chat_prefix[GUI_CHAT_PREFIX_NETWORK]), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_PREFIX_ACTION, CONFIG_COLOR(config_color_chat_prefix[GUI_CHAT_PREFIX_ACTION]), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_PREFIX_JOIN, CONFIG_COLOR(config_color_chat_prefix[GUI_CHAT_PREFIX_JOIN]), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_PREFIX_QUIT, CONFIG_COLOR(config_color_chat_prefix[GUI_CHAT_PREFIX_QUIT]), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_PREFIX_MORE, CONFIG_COLOR(config_color_chat_prefix_more), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_PREFIX_SUFFIX, CONFIG_COLOR(config_color_chat_prefix_suffix), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_BUFFER, CONFIG_COLOR(config_color_chat_buffer), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_SERVER, CONFIG_COLOR(config_color_chat_server), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_CHANNEL, CONFIG_COLOR(config_color_chat_channel), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_NICK, CONFIG_COLOR(config_color_chat_nick), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_NICK_SELF, CONFIG_COLOR(config_color_chat_nick_self), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_NICK_OTHER, CONFIG_COLOR(config_color_chat_nick_other), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_HOST, CONFIG_COLOR(config_color_chat_host), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_DELIMITERS, CONFIG_COLOR(config_color_chat_delimiters), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_HIGHLIGHT, CONFIG_COLOR(config_color_chat_highlight), CONFIG_COLOR(config_color_chat_highlight_bg)); - gui_color_build (GUI_COLOR_CHAT_READ_MARKER, CONFIG_COLOR(config_color_chat_read_marker), CONFIG_COLOR(config_color_chat_read_marker_bg)); - gui_color_build (GUI_COLOR_CHAT_TEXT_FOUND, CONFIG_COLOR(config_color_chat_text_found), CONFIG_COLOR(config_color_chat_text_found_bg)); - gui_color_build (GUI_COLOR_CHAT_VALUE, CONFIG_COLOR(config_color_chat_value), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_PREFIX_BUFFER, CONFIG_COLOR(config_color_chat_prefix_buffer), CONFIG_COLOR(config_color_chat_bg)); - - /* - * define old nick colors for compatibility on /upgrade with previous - * versions: these colors have been removed in version 0.3.4 and replaced - * by new option "weechat.color.chat_nick_colors", which is a list of - * colors (without limit on number of colors) - */ - gui_color_build (GUI_COLOR_CHAT_NICK1_OBSOLETE, gui_color_search ("cyan"), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_NICK2_OBSOLETE, gui_color_search ("magenta"), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_NICK3_OBSOLETE, gui_color_search ("green"), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_NICK4_OBSOLETE, gui_color_search ("brown"), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_NICK5_OBSOLETE, gui_color_search ("lightblue"), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_NICK6_OBSOLETE, gui_color_search ("default"), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_NICK7_OBSOLETE, gui_color_search ("lightcyan"), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_NICK8_OBSOLETE, gui_color_search ("lightmagenta"), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_NICK9_OBSOLETE, gui_color_search ("lightgreen"), CONFIG_COLOR(config_color_chat_bg)); - gui_color_build (GUI_COLOR_CHAT_NICK10_OBSOLETE, gui_color_search ("blue"), CONFIG_COLOR(config_color_chat_bg)); + if (gui_color_pairs) + { + free (gui_color_pairs); + gui_color_pairs = NULL; + } + if (gui_color_term_color_content) + { + free (gui_color_term_color_content); + gui_color_term_color_content = NULL; + } } /* - * gui_color_pre_init: pre-init colors + * gui_color_init_pairs_terminal: init color pairs with terminal colors */ void -gui_color_pre_init () +gui_color_init_pairs_terminal () { int i; - for (i = 0; i < GUI_COLOR_NUM_COLORS; i++) + if (gui_color_term_has_colors) { - gui_color[i] = NULL; + for (i = 1; i <= gui_color_num_pairs; i++) + { + init_pair (i, i, -1); + } } } /* - * gui_color_init: init GUI colors + * gui_color_init_pairs_weechat: init color pairs with WeeChat colors + * Pairs defined by WeeChat are set with their + * values (from pair 1 to pair N), and other + * pairs are set with terminal color and default + * background (-1). */ void -gui_color_init () +gui_color_init_pairs_weechat () { - if (has_colors ()) + int i; + short *foregrounds, *backgrounds; + + if (gui_color_term_has_colors) { - start_color (); - use_default_colors (); + gui_color_get_pairs_arrays (&foregrounds, &backgrounds); + if (foregrounds && backgrounds) + { + for (i = 1; i <= gui_color_num_pairs; i++) + { + if ((foregrounds[i] >= -1) && (backgrounds[i] >= -1)) + init_pair (i, foregrounds[i], backgrounds[i]); + else + init_pair (i, i, -1); + } + } + if (foregrounds) + free (foregrounds); + if (backgrounds) + free (backgrounds); } - gui_color_init_pairs (); - gui_color_init_weechat (); - gui_color_palette_build_aliases (); } /* @@ -485,21 +596,14 @@ void gui_color_display_terminal_colors () { int lines, line, col, color; - int colors, color_pairs, change_color; char str_line[1024], str_color[64]; - colors = 0; - color_pairs = 0; - change_color = 0; - initscr (); if (has_colors ()) { start_color (); use_default_colors (); - colors = COLORS; - color_pairs = COLOR_PAIRS; - change_color = can_change_color () ? 1 : 0; + gui_color_init_vars (); refresh (); endwin (); } @@ -507,9 +611,9 @@ gui_color_display_terminal_colors () printf ("%s $TERM=%s COLORS: %d, COLOR_PAIRS: %d, " "can_change_color: %s\n", _("Terminal infos:"), - getenv ("TERM"), colors, color_pairs, - (change_color) ? "yes" : "no"); - if (colors == 0) + getenv ("TERM"), gui_color_term_colors, gui_color_term_color_pairs, + (gui_color_term_can_change_color) ? "yes" : "no"); + if (gui_color_term_colors == 0) { printf ("%s\n", _("No color support in terminal.")); } @@ -519,14 +623,14 @@ gui_color_display_terminal_colors () printf ("%s\n", _("Default colors:")); printf ("------------------------------------------------------------" "--------------------\n"); - lines = (colors < 16) ? colors : 16; + lines = (gui_color_term_colors < 16) ? gui_color_term_colors : 16; for (line = 0; line < lines; line++) { str_line[0] = '\0'; for (col = 0; col < 16; col++) { color = (col * 16) + line; - if (color < colors) + if (color < gui_color_term_colors) { snprintf (str_color, sizeof (str_color), "\33[0;38;5;%dm %03d ", color, color); @@ -540,6 +644,25 @@ gui_color_display_terminal_colors () "--------------------\n"); } printf ("\n"); + gui_color_free_vars (); +} + +/* + * gui_color_buffer_display_timer: display line with terminal colors and timer + * (remaining time for display of terminal + * colors) + */ + +void +gui_color_buffer_display_timer () +{ + if (gui_color_buffer && gui_color_use_term_colors) + { + gui_chat_printf_y (gui_color_buffer, 2, + "%s (%d)", + _("Terminal colors:"), + gui_color_timer); + } } /* @@ -549,8 +672,7 @@ gui_color_display_terminal_colors () void gui_color_buffer_display () { - int y, i, lines, line, col, color, max_color; - int colors, color_pairs, change_color, num_items; + int y, i, lines, line, col, color, max_color, num_items; char str_line[1024], str_color[64], str_rgb[64], **items; struct t_gui_color_palette *color_palette; @@ -559,21 +681,13 @@ gui_color_buffer_display () gui_buffer_clear (gui_color_buffer); - colors = 0; - color_pairs = 0; - change_color = 0; - - if (has_colors ()) - { - colors = COLORS; - color_pairs = COLOR_PAIRS; - change_color = can_change_color () ? 1 : 0; - } - /* set title buffer */ gui_buffer_set_title (gui_color_buffer, - _("WeeChat colors | Actions: [R] Refresh " - "[Q] Close buffer | Keys: [alt-c] Toggle colors")); + _("WeeChat colors | Actions: " + "[e] Display extra infos [r] Refresh " + "[z] Reset colors [q] Close buffer | " + "Keys: [alt-c] Temporarily switch to terminal " + "colors")); /* display terminal/colors infos */ y = 0; @@ -581,23 +695,26 @@ gui_color_buffer_display () "$TERM=%s COLORS: %d, COLOR_PAIRS: %d, " "can_change_color: %s", getenv ("TERM"), - colors, - color_pairs, - (change_color) ? "yes" : "no"); + gui_color_term_colors, + gui_color_term_color_pairs, + (gui_color_term_can_change_color) ? "yes" : "no"); /* display palette of colors */ y++; - gui_chat_printf_y (gui_color_buffer, y++, - (gui_color_terminal_colors) ? - _("Terminal colors:") : - _("WeeChat colors:")); - gui_chat_printf_y (gui_color_buffer, y++, - " %s%s00000 000 %s%s", - GUI_COLOR_COLOR_STR, - GUI_COLOR_PAIR_STR, - GUI_COLOR(GUI_COLOR_CHAT), - _("fixed color")); - max_color = (gui_color_terminal_colors) ? colors - 1 : gui_color_last_pair; + if (gui_color_use_term_colors) + { + gui_color_buffer_display_timer (); + y++; + } + else + { + gui_chat_printf_y (gui_color_buffer, y++, + _("WeeChat colors (in use: %d, left: %d):"), + gui_color_pairs_used, + gui_color_num_pairs - gui_color_pairs_used); + } + max_color = (gui_color_use_term_colors) ? + gui_color_term_colors - 1 : gui_color_num_pairs; if (max_color > 255) max_color = 255; lines = (max_color <= 64) ? 8 : 16; @@ -606,15 +723,32 @@ gui_color_buffer_display () str_line[0] = '\0'; for (col = 0; col < 16; col++) { - color = (col * lines) + line + 1; + color = (col * lines) + line; if (color <= max_color) { - snprintf (str_color, sizeof (str_color), - "%s%s%05d %03d ", - GUI_COLOR_COLOR_STR, - GUI_COLOR_PAIR_STR, - color, - color); + if (color == 0) + { + snprintf (str_color, sizeof (str_color), + " "); + } + else if (gui_color_use_term_colors + || (color <= gui_color_pairs_used)) + { + snprintf (str_color, sizeof (str_color), + "%c%c%05d%c%03d%c", + GUI_COLOR_COLOR_CHAR, + GUI_COLOR_PAIR_CHAR, + color, + (color == 0) ? '<' : ' ', + color, + (color == 0) ? '>' : ' '); + } + else + { + snprintf (str_color, sizeof (str_color), + "%s - ", + GUI_NO_COLOR); + } strcat (str_line, str_color); } else @@ -629,66 +763,30 @@ gui_color_buffer_display () " %s", str_line); } - - /* display WeeChat basic colors */ - y++; - gui_chat_printf_y (gui_color_buffer, y++, - _("WeeChat basic colors:")); - str_line[0] = '\0'; - for (i = 0; i < GUI_CURSES_NUM_WEECHAT_COLORS; i++) - { - if (gui_color_terminal_colors) - { - snprintf (str_color, sizeof (str_color), - " %s", - gui_weechat_colors[i].string); - } - else - { - snprintf (str_color, sizeof (str_color), - "%s%s%02d %s", - GUI_COLOR_COLOR_STR, - GUI_COLOR_FG_STR, - i, - gui_weechat_colors[i].string); - } - if (gui_chat_strlen_screen (str_line) + gui_chat_strlen_screen (str_color) > 80) - { - gui_chat_printf_y (gui_color_buffer, y++, - " %s", str_line); - str_line[0] = '\0'; - } - strcat (str_line, str_color); - } - if (str_line[0]) + + if (gui_color_buffer_extra_info) { + /* display WeeChat basic colors */ + y++; gui_chat_printf_y (gui_color_buffer, y++, - " %s", str_line); - } - - /* display nick colors */ - y++; - gui_chat_printf_y (gui_color_buffer, y++, - _("Nick colors:")); - items = string_split (CONFIG_STRING(config_color_chat_nick_colors), - ",", 0, 0, &num_items); - if (items) - { + _("WeeChat basic colors:")); str_line[0] = '\0'; - for (i = 0; i < num_items; i++) + for (i = 0; i < GUI_CURSES_NUM_WEECHAT_COLORS; i++) { - if (gui_color_terminal_colors) + if (gui_color_use_term_colors) { snprintf (str_color, sizeof (str_color), " %s", - items[i]); + gui_weechat_colors[i].string); } else { snprintf (str_color, sizeof (str_color), - "%s %s", - gui_color_get_custom (items[i]), - items[i]); + "%c%c%02d %s", + GUI_COLOR_COLOR_CHAR, + GUI_COLOR_FG_CHAR, + i, + gui_weechat_colors[i].string); } if (gui_chat_strlen_screen (str_line) + gui_chat_strlen_screen (str_color) > 80) { @@ -703,64 +801,204 @@ gui_color_buffer_display () gui_chat_printf_y (gui_color_buffer, y++, " %s", str_line); } - string_free_split (items); - } - - /* display palette colors */ - if (hashtable_get_integer (gui_color_hash_palette_color, - "items_count") > 0) - { + + /* display nick colors */ y++; gui_chat_printf_y (gui_color_buffer, y++, - _("Palette colors:")); - for (i = 1; i <= gui_color_last_pair; i++) + _("Nick colors:")); + items = string_split (CONFIG_STRING(config_color_chat_nick_colors), + ",", 0, 0, &num_items); + if (items) { - color_palette = gui_color_palette_get (i); - if (color_palette) + str_line[0] = '\0'; + for (i = 0; i < num_items; i++) { - str_color[0] = '\0'; - if (!gui_color_terminal_colors) + if (gui_color_use_term_colors) { snprintf (str_color, sizeof (str_color), - "%s%s%05d", - GUI_COLOR_COLOR_STR, - GUI_COLOR_PAIR_STR, - i); + " %s", + items[i]); } - snprintf (str_rgb, sizeof (str_rgb), " "); - if ((color_palette->r >= 0) && (color_palette->g >= 0) - && (color_palette->b >= 0)) + else + { + snprintf (str_color, sizeof (str_color), + "%s %s", + gui_color_get_custom (items[i]), + items[i]); + } + if (gui_chat_strlen_screen (str_line) + gui_chat_strlen_screen (str_color) > 80) { - snprintf (str_rgb, sizeof (str_rgb), - "%04d/%04d/%04d", - color_palette->r, - color_palette->g, - color_palette->b); + gui_chat_printf_y (gui_color_buffer, y++, + " %s", str_line); + str_line[0] = '\0'; + } + strcat (str_line, str_color); + } + if (str_line[0]) + { + gui_chat_printf_y (gui_color_buffer, y++, + " %s", str_line); + } + string_free_split (items); + } + + /* display palette colors */ + if (hashtable_get_integer (gui_color_hash_palette_color, + "items_count") > 0) + { + y++; + gui_chat_printf_y (gui_color_buffer, y++, + _("Color aliases:")); + for (i = 1; i <= gui_color_num_pairs; i++) + { + color_palette = gui_color_palette_get (i); + if (color_palette) + { + str_color[0] = '\0'; + if (!gui_color_use_term_colors) + { + snprintf (str_color, sizeof (str_color), + "%c%c%05d", + GUI_COLOR_COLOR_CHAR, + GUI_COLOR_PAIR_CHAR, + i); + } + str_rgb[0] = '\0'; + if ((color_palette->r >= 0) && (color_palette->g >= 0) + && (color_palette->b >= 0)) + { + snprintf (str_rgb, sizeof (str_rgb), + " (%d/%d/%d)", + color_palette->r, + color_palette->g, + color_palette->b); + } + gui_chat_printf_y (gui_color_buffer, y++, + " %5d: %s%s%s", + i, + str_color, + (color_palette->alias) ? color_palette->alias : "", + str_rgb); } + } + } + + /* display content of colors */ + if (gui_color_term_color_content) + { + y++; + gui_chat_printf_y (gui_color_buffer, y++, + _("Content of colors (r/g/b):")); + for (i = 0; i < gui_color_term_colors; i++) + { gui_chat_printf_y (gui_color_buffer, y++, - " %5d: %s%5d,%-5d %s %s", + " %3d: %4hd / %4hd / %4hd", i, - str_color, - color_palette->foreground, - color_palette->background, - str_rgb, - (color_palette->alias) ? - color_palette->alias : ""); + gui_color_term_color_content[i * 3], + gui_color_term_color_content[(i* 3) + 1], + gui_color_term_color_content[(i* 3) + 2]); } } } } /* + * gui_color_timer_cb: callback for timer + */ + +int +gui_color_timer_cb (void *data, int remaining_calls) +{ + /* make C compiler happy */ + (void) data; + (void) remaining_calls; + + gui_color_timer--; + + if (gui_color_timer <= 0) + { + if (gui_color_use_term_colors) + gui_color_switch_colors (); + } + else + { + if (gui_color_buffer && gui_color_use_term_colors) + { + gui_color_buffer_display_timer (); + } + } + + return WEECHAT_RC_OK; +} + +/* * gui_color_switch_colrs: switch between WeeChat and terminal colors */ void gui_color_switch_colors () { - gui_color_terminal_colors ^= 1; - gui_color_init_pairs (); - gui_color_buffer_display (); + if (gui_color_hook_timer) + { + unhook (gui_color_hook_timer); + gui_color_hook_timer = NULL; + } + + /* + * when we press alt-c many times quickly, this just adds some time for + * display of terminal colors + */ + if (gui_color_use_term_colors + && (gui_color_timer > 0) && (gui_color_timer % 10 == 0)) + { + if (gui_color_timer < 120) + gui_color_timer += 10; + gui_color_buffer_display_timer (); + } + else + { + gui_color_use_term_colors ^= 1; + + if (gui_color_use_term_colors) + gui_color_init_pairs_terminal (); + else + gui_color_init_pairs_weechat (); + + gui_color_buffer_refresh_needed = 1; + gui_window_ask_refresh (1); + + if (gui_color_use_term_colors) + gui_color_timer = GUI_COLOR_TIMER_TERM_COLORS; + } + + if (gui_color_use_term_colors) + { + gui_color_hook_timer = hook_timer (NULL, 1000, 0, 0, + &gui_color_timer_cb, NULL); + } +} + +/* + * gui_color_reset_pairs: reset all color pairs + * (the next refresh will auto reallocate needed pairs) + * It is useful when color pairs table is full, to + * remove non used pairs. + */ + +void +gui_color_reset_pairs () +{ + if (gui_color_pairs) + { + memset (gui_color_pairs, 0, + (gui_color_term_colors + 2) + * (gui_color_term_colors + 2) + * sizeof (gui_color_pairs[0])); + gui_color_pairs_used = 0; + gui_color_warning_pairs_full = 0; + gui_color_buffer_refresh_needed = 1; + gui_window_ask_refresh (1); + } } /* @@ -774,7 +1012,12 @@ gui_color_buffer_input_cb (void *data, struct t_gui_buffer *buffer, /* make C compiler happy */ (void) data; - if (string_strcasecmp (input_data, "r") == 0) + if (string_strcasecmp (input_data, "e") == 0) + { + gui_color_buffer_extra_info ^= 1; + gui_color_buffer_display (); + } + else if (string_strcasecmp (input_data, "r") == 0) { gui_color_buffer_display (); } @@ -782,6 +1025,10 @@ gui_color_buffer_input_cb (void *data, struct t_gui_buffer *buffer, { gui_buffer_close (buffer); } + else if (string_strcasecmp (input_data, "z") == 0) + { + gui_color_reset_pairs (buffer); + } return WEECHAT_RC_OK; } @@ -877,8 +1124,6 @@ gui_color_palette_add_alias_cb (void *data, color_palette->alias, &number); } - weelist_add (gui_color_list_with_alias, color_palette->alias, - WEECHAT_LIST_POS_END, NULL); } } @@ -890,6 +1135,8 @@ void gui_color_palette_build_aliases () { int i; + struct t_gui_color_palette *color_palette; + char str_number[64]; if (!gui_color_hash_palette_alias || !gui_color_list_with_alias || !gui_color_hash_palette_color) @@ -906,6 +1153,26 @@ gui_color_palette_build_aliases () WEECHAT_LIST_POS_END, NULL); } + for (i = 0; i <= gui_color_term_colors; i++) + { + color_palette = gui_color_palette_get (i); + if (color_palette) + { + weelist_add (gui_color_list_with_alias, + color_palette->alias, + WEECHAT_LIST_POS_END, + NULL); + } + else + { + snprintf (str_number, sizeof (str_number), + "%d", i); + weelist_add (gui_color_list_with_alias, + str_number, + WEECHAT_LIST_POS_END, + NULL); + } + } hashtable_map (gui_color_hash_palette_color, &gui_color_palette_add_alias_cb, NULL); } @@ -919,8 +1186,8 @@ gui_color_palette_new (int number, const char *value) { struct t_gui_color_palette *new_color_palette; char **items, *pos, *pos2, *error1, *error2, *error3; - char *str_alias, *str_pair, *str_rgb, str_number[64]; - int num_items, i, fg, bg, r, g, b; + char *str_alias, *str_rgb, str_number[64]; + int num_items, i, r, g, b; if (!value) return NULL; @@ -929,14 +1196,11 @@ gui_color_palette_new (int number, const char *value) if (new_color_palette) { new_color_palette->alias = NULL; - new_color_palette->foreground = number; - new_color_palette->background = -1; new_color_palette->r = -1; new_color_palette->g = -1; new_color_palette->b = -1; str_alias = NULL; - str_pair = NULL; str_rgb = NULL; items = string_split (value, ";", 0, 0, &num_items); @@ -944,15 +1208,13 @@ gui_color_palette_new (int number, const char *value) { for (i = 0; i < num_items; i++) { - pos = strchr (items[i], ','); + pos = strchr (items[i], '/'); if (pos) - str_pair = items[i]; + str_rgb = items[i]; else { - pos = strchr (items[i], '/'); - if (pos) - str_rgb = items[i]; - else + pos = strchr (items[i], ','); + if (!pos) str_alias = items[i]; } } @@ -962,25 +1224,6 @@ gui_color_palette_new (int number, const char *value) new_color_palette->alias = strdup (str_alias); } - if (str_pair) - { - pos = strchr (str_pair, ','); - if (pos) - { - pos[0] = '\0'; - error1 = NULL; - fg = (int)strtol (str_pair, &error1, 10); - error2 = NULL; - bg = (int)strtol (pos + 1, &error2, 10); - if (error1 && !error1[0] && error2 && !error2[0] - && (fg >= -1) && (bg >= -1)) - { - new_color_palette->foreground = fg; - new_color_palette->background = bg; - } - } - } - if (str_rgb) { pos = strchr (str_rgb, '/'); @@ -1039,6 +1282,124 @@ gui_color_palette_free (struct t_gui_color_palette *color_palette) } /* + * gui_color_init_weechat: init WeeChat colors + */ + +void +gui_color_init_weechat () +{ + gui_color_build (GUI_COLOR_SEPARATOR, CONFIG_COLOR(config_color_separator), CONFIG_COLOR(config_color_chat_bg)); + + gui_color_build (GUI_COLOR_CHAT, CONFIG_COLOR(config_color_chat), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_TIME, CONFIG_COLOR(config_color_chat_time), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_TIME_DELIMITERS, CONFIG_COLOR(config_color_chat_time_delimiters), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_PREFIX_ERROR, CONFIG_COLOR(config_color_chat_prefix[GUI_CHAT_PREFIX_ERROR]), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_PREFIX_NETWORK, CONFIG_COLOR(config_color_chat_prefix[GUI_CHAT_PREFIX_NETWORK]), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_PREFIX_ACTION, CONFIG_COLOR(config_color_chat_prefix[GUI_CHAT_PREFIX_ACTION]), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_PREFIX_JOIN, CONFIG_COLOR(config_color_chat_prefix[GUI_CHAT_PREFIX_JOIN]), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_PREFIX_QUIT, CONFIG_COLOR(config_color_chat_prefix[GUI_CHAT_PREFIX_QUIT]), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_PREFIX_MORE, CONFIG_COLOR(config_color_chat_prefix_more), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_PREFIX_SUFFIX, CONFIG_COLOR(config_color_chat_prefix_suffix), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_BUFFER, CONFIG_COLOR(config_color_chat_buffer), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_SERVER, CONFIG_COLOR(config_color_chat_server), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_CHANNEL, CONFIG_COLOR(config_color_chat_channel), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_NICK, CONFIG_COLOR(config_color_chat_nick), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_NICK_SELF, CONFIG_COLOR(config_color_chat_nick_self), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_NICK_OTHER, CONFIG_COLOR(config_color_chat_nick_other), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_HOST, CONFIG_COLOR(config_color_chat_host), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_DELIMITERS, CONFIG_COLOR(config_color_chat_delimiters), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_HIGHLIGHT, CONFIG_COLOR(config_color_chat_highlight), CONFIG_COLOR(config_color_chat_highlight_bg)); + gui_color_build (GUI_COLOR_CHAT_READ_MARKER, CONFIG_COLOR(config_color_chat_read_marker), CONFIG_COLOR(config_color_chat_read_marker_bg)); + gui_color_build (GUI_COLOR_CHAT_TEXT_FOUND, CONFIG_COLOR(config_color_chat_text_found), CONFIG_COLOR(config_color_chat_text_found_bg)); + gui_color_build (GUI_COLOR_CHAT_VALUE, CONFIG_COLOR(config_color_chat_value), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_PREFIX_BUFFER, CONFIG_COLOR(config_color_chat_prefix_buffer), CONFIG_COLOR(config_color_chat_bg)); + + /* + * define old nick colors for compatibility on /upgrade with previous + * versions: these colors have been removed in version 0.3.4 and replaced + * by new option "weechat.color.chat_nick_colors", which is a list of + * colors (without limit on number of colors) + */ + gui_color_build (GUI_COLOR_CHAT_NICK1_OBSOLETE, gui_color_search ("cyan"), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_NICK2_OBSOLETE, gui_color_search ("magenta"), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_NICK3_OBSOLETE, gui_color_search ("green"), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_NICK4_OBSOLETE, gui_color_search ("brown"), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_NICK5_OBSOLETE, gui_color_search ("lightblue"), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_NICK6_OBSOLETE, gui_color_search ("default"), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_NICK7_OBSOLETE, gui_color_search ("lightcyan"), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_NICK8_OBSOLETE, gui_color_search ("lightmagenta"), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_NICK9_OBSOLETE, gui_color_search ("lightgreen"), CONFIG_COLOR(config_color_chat_bg)); + gui_color_build (GUI_COLOR_CHAT_NICK10_OBSOLETE, gui_color_search ("blue"), CONFIG_COLOR(config_color_chat_bg)); +} + +/* + * gui_color_pre_init: pre-init colors + */ + +void +gui_color_pre_init () +{ + int i; + + for (i = 0; i < GUI_COLOR_NUM_COLORS; i++) + { + gui_color[i] = NULL; + } +} + +/* + * gui_color_init: init GUI colors + */ + +void +gui_color_init () +{ + if (has_colors()) + { + start_color (); + use_default_colors (); + } + gui_color_init_vars (); + gui_color_init_pairs_terminal (); + gui_color_init_weechat (); + gui_color_palette_build_aliases (); +} + +/* + * gui_color_dump: dump colors + */ + +void +gui_color_dump () +{ + int fg, bg, index, used; + + gui_chat_printf (NULL, ""); + gui_chat_printf (NULL, + _("WeeChat colors (in use: %d, left: %d):"), + gui_color_pairs_used, + gui_color_num_pairs - gui_color_pairs_used); + if (gui_color_pairs) + { + used = 0; + for (bg = -1; bg <= gui_color_term_colors; bg++) + { + for (fg = -1; fg <= gui_color_term_colors; fg++) + { + index = ((bg + 1) * (gui_color_term_colors + 2)) + (fg + 1); + if (gui_color_pairs[index] >= 1) + { + gui_chat_printf (NULL, + " fg:%3d, bg:%3d, pairs[%05d] = %hd", + fg, bg, index, gui_color_pairs[index]); + used++; + } + } + } + } +} + +/* * gui_color_end: end GUI colors */ @@ -1052,4 +1413,5 @@ gui_color_end () gui_color_free (gui_color[i]); } gui_color_palette_free_structs (); + gui_color_free_vars (); } diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c index bf25111ba..e1626decd 100644 --- a/src/gui/curses/gui-curses-main.c +++ b/src/gui/curses/gui-curses-main.c @@ -224,6 +224,13 @@ 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) + { + gui_color_buffer_display (); + gui_color_buffer_refresh_needed = 0; + } /* refresh window if needed */ if (gui_window_refresh_needed) diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c index 2741a436c..ad3e133be 100644 --- a/src/gui/curses/gui-curses-window.c +++ b/src/gui/curses/gui-curses-window.c @@ -205,22 +205,24 @@ gui_window_clear_weechat (WINDOW *window, int weechat_color) */ void -gui_window_clear (WINDOW *window, int bg) +gui_window_clear (WINDOW *window, int fg, int bg) { - int color; - if (!gui_ok) return; - - if ((bg >= 0) && (bg < GUI_CURSES_NUM_WEECHAT_COLORS)) - { - color = gui_weechat_colors[bg].background; - wbkgdset (window, - ' ' | COLOR_PAIR (((color == -1) || (color == 99)) ? - gui_color_last_pair : (color * gui_color_num_bg) + 1)); - werase (window); - wmove (window, 0, 0); - } + + if ((fg > 0) && (fg & GUI_COLOR_PAIR_FLAG)) + fg &= GUI_COLOR_PAIR_MASK; + else + fg = gui_weechat_colors[fg].foreground; + + if ((bg > 0) && (bg & GUI_COLOR_PAIR_FLAG)) + bg &= GUI_COLOR_PAIR_MASK; + else + bg = gui_weechat_colors[bg].background; + + wbkgdset (window, ' ' | COLOR_PAIR (gui_color_get_pair (fg, bg))); + werase (window); + wmove (window, 0, 0); } /* @@ -273,17 +275,7 @@ gui_window_set_color (WINDOW *window, int fg, int bg) window_current_style_fg = fg; window_current_style_bg = bg; - if (((fg == -1) || (fg == 99)) - && ((bg == -1) || (bg == 99))) - wattron (window, COLOR_PAIR(gui_color_last_pair)); - else - { - if ((fg == -1) || (fg == 99)) - fg = COLOR_WHITE; - if ((bg == -1) || (bg == 99)) - bg = 0; - wattron (window, COLOR_PAIR((bg * gui_color_num_bg) + fg + 1)); - } + wattron (window, COLOR_PAIR(gui_color_get_pair (fg, bg))); } /* @@ -293,21 +285,19 @@ gui_window_set_color (WINDOW *window, int fg, int bg) void gui_window_set_weechat_color (WINDOW *window, int num_color) { + int fg, bg; + if ((num_color >= 0) && (num_color < GUI_COLOR_NUM_COLORS)) { gui_window_reset_style (window, num_color); wattron (window, gui_color[num_color]->attributes); - if ((gui_color[num_color]->foreground > 0) - && (gui_color[num_color]->foreground & GUI_COLOR_PAIR_FLAG)) - { - wattron (window, COLOR_PAIR(gui_color[num_color]->foreground & GUI_COLOR_PAIR_MASK)); - } - else - { - gui_window_set_color (window, - gui_color[num_color]->foreground, - gui_color[num_color]->background); - } + fg = gui_color[num_color]->foreground; + bg = gui_color[num_color]->background; + if ((fg > 0) && (fg & GUI_COLOR_PAIR_FLAG)) + fg &= GUI_COLOR_PAIR_MASK; + if ((bg > 0) && (bg & GUI_COLOR_PAIR_FLAG)) + bg &= GUI_COLOR_PAIR_MASK; + gui_window_set_color (window, fg, bg); } } @@ -319,30 +309,27 @@ gui_window_set_weechat_color (WINDOW *window, int num_color) void gui_window_set_custom_color_fg_bg (WINDOW *window, int fg, int bg) { - if ((fg >= 0) && (fg < GUI_CURSES_NUM_WEECHAT_COLORS) - && (bg >= 0) && (bg < GUI_CURSES_NUM_WEECHAT_COLORS)) - { - gui_window_remove_color_style (window, A_BOLD); - wattron (window, gui_weechat_colors[fg].attributes); - gui_window_set_color (window, - gui_weechat_colors[fg].foreground, - (gui_color_num_bg > 8) ? - gui_weechat_colors[bg].background : gui_weechat_colors[bg].foreground); - } -} - -/* - * gui_window_set_custom_color_pair: set a custom color for a window - * (pair number) - */ - -void -gui_window_set_custom_color_pair (WINDOW *window, int pair) -{ - if ((pair >= 0) && (pair <= gui_color_last_pair)) + if ((fg >= 0) && (bg >= 0)) { gui_window_remove_color_style (window, A_BOLD); - wattron (window, COLOR_PAIR(pair)); + + if ((fg > 0) && (fg & GUI_COLOR_PAIR_FLAG)) + fg &= GUI_COLOR_PAIR_MASK; + else + { + wattron (window, gui_weechat_colors[fg].attributes); + fg = gui_weechat_colors[fg].foreground; + } + + if ((bg > 0) && (bg & GUI_COLOR_PAIR_FLAG)) + bg &= GUI_COLOR_PAIR_MASK; + else + { + bg = (gui_color_num_bg > 8) ? + gui_weechat_colors[bg].background : gui_weechat_colors[bg].foreground; + } + + gui_window_set_color (window, fg, bg); } } @@ -355,16 +342,17 @@ void gui_window_set_custom_color_fg (WINDOW *window, int fg) { int current_bg; - + if (fg >= 0) { - if (fg & GUI_COLOR_PAIR_FLAG) + current_bg = window_current_style_bg; + + if ((fg > 0) && (fg & GUI_COLOR_PAIR_FLAG)) { - gui_window_set_custom_color_pair (window, fg & GUI_COLOR_PAIR_MASK); + gui_window_set_color (window, fg & GUI_COLOR_PAIR_MASK, current_bg); } else if (fg < GUI_CURSES_NUM_WEECHAT_COLORS) { - current_bg = window_current_style_bg; gui_window_remove_color_style (window, A_BOLD); gui_window_set_color_style (window, gui_weechat_colors[fg].attributes); gui_window_set_color (window, @@ -386,14 +374,15 @@ gui_window_set_custom_color_bg (WINDOW *window, int bg) if (bg >= 0) { - if (bg & GUI_COLOR_PAIR_FLAG) + current_attr = window_current_style_attr; + current_fg = window_current_style_fg; + + if ((bg > 0) && (bg & GUI_COLOR_PAIR_FLAG)) { - gui_window_set_custom_color_pair (window, bg & GUI_COLOR_PAIR_MASK); + gui_window_set_color (window, current_fg, bg & GUI_COLOR_PAIR_MASK); } else if (bg < GUI_CURSES_NUM_WEECHAT_COLORS) { - current_attr = window_current_style_attr; - current_fg = window_current_style_fg; gui_window_set_color_style (window, current_attr); gui_window_set_color (window, current_fg, (gui_color_num_bg > 8) ? @@ -403,15 +392,30 @@ gui_window_set_custom_color_bg (WINDOW *window, int bg) } /* - * gui_window_clrtoeol_with_current_bg: clear until end of line with current bg + * gui_window_set_custom_color_pair: set a custom color for a window + * (pair number) + */ + +void +gui_window_set_custom_color_pair (WINDOW *window, int pair) +{ + if ((pair >= 0) && (pair <= gui_color_num_pairs)) + { + gui_window_remove_color_style (window, A_BOLD); + wattron (window, COLOR_PAIR(pair)); + } +} + +/* + * gui_window_clrtoeol: clear until end of line with current background */ void -gui_window_clrtoeol_with_current_bg (WINDOW *window) +gui_window_clrtoeol (WINDOW *window) { wbkgdset (window, - ' ' | COLOR_PAIR ((window_current_style_bg < 0) ? - gui_color_last_pair : (window_current_style_bg * gui_color_num_bg) + 1)); + ' ' | COLOR_PAIR (gui_color_get_pair (window_current_style_fg, + window_current_style_bg))); wclrtoeol (window); } @@ -1526,8 +1530,6 @@ gui_window_term_display_infos () gui_chat_printf (NULL, _("Terminal infos:")); gui_chat_printf (NULL, _(" TERM='%s', size: %dx%d"), getenv("TERM"), gui_term_cols, gui_term_lines); - gui_chat_printf (NULL, _(" %d colors available, %d pairs"), - COLORS, COLOR_PAIRS); } /* diff --git a/src/gui/curses/gui-curses.h b/src/gui/curses/gui-curses.h index 8e33663b8..efb686a69 100644 --- a/src/gui/curses/gui-curses.h +++ b/src/gui/curses/gui-curses.h @@ -57,10 +57,12 @@ struct t_gui_bar_window_curses_objects extern int gui_term_cols, gui_term_lines; extern struct t_gui_color gui_weechat_colors[]; -extern int gui_color_last_pair; +extern int gui_color_num_pairs; extern int gui_color_num_bg; +extern int gui_color_buffer_refresh_needed; /* color functions */ +extern int gui_color_get_pair (int fg, int bg); extern int gui_color_weechat_get_pair (int weechat_color); extern void gui_color_pre_init (); extern void gui_color_init (); @@ -79,7 +81,7 @@ extern int gui_keyboard_read_cb (void *data, int fd); extern void gui_window_read_terminal_size (); extern void gui_window_redraw_buffer (struct t_gui_buffer *buffer); extern int gui_window_get_hline_char (); -extern void gui_window_clear (WINDOW *window, int bg); +extern void gui_window_clear (WINDOW *window, int fg, int bg); extern void gui_window_reset_style (WINDOW *window, int num_color); extern void gui_window_set_color_style (WINDOW *window, int style); extern void gui_window_remove_color_style (WINDOW *window, int style); @@ -89,7 +91,7 @@ extern void gui_window_set_custom_color_fg_bg (WINDOW *window, int fg, int bg); extern void gui_window_set_custom_color_pair (WINDOW *window, int pair); extern void gui_window_set_custom_color_fg (WINDOW *window, int fg); extern void gui_window_set_custom_color_bg (WINDOW *window, int bg); -extern void gui_window_clrtoeol_with_current_bg (WINDOW *window); +extern void gui_window_clrtoeol (WINDOW *window); extern void gui_window_set_title (const char *title); #endif /* __WEECHAT_GUI_CURSES_H */ diff --git a/src/gui/gtk/gui-gtk-chat.c b/src/gui/gtk/gui-gtk-chat.c index 950646583..f416389dc 100644 --- a/src/gui/gtk/gui-gtk-chat.c +++ b/src/gui/gtk/gui-gtk-chat.c @@ -147,17 +147,6 @@ void gui_chat_set_color (struct t_gui_window *window, int fg, int bg) { /* TODO: write this function for Gtk */ - /*if (((fg == -1) || (fg == 99)) - && ((bg == -1) || (bg == 99))) - wattron (window->win_chat, COLOR_PAIR(63)); - else - { - if ((fg == -1) || (fg == 99)) - fg = WEECHAT_COLOR_WHITE; - if ((bg == -1) || (bg == 99)) - bg = 0; - wattron (window->win_chat, COLOR_PAIR((bg * 8) + fg)); - }*/ (void) window; (void) fg; (void) bg; diff --git a/src/gui/gtk/gui-gtk-color.c b/src/gui/gtk/gui-gtk-color.c index 49697ed65..50f8220af 100644 --- a/src/gui/gtk/gui-gtk-color.c +++ b/src/gui/gtk/gui-gtk-color.c @@ -132,70 +132,48 @@ gui_color_get_weechat_colors_number () } /* - * gui_color_get_last_pair: get last pair number + * gui_color_get_term_colors: get number of colors supported by terminal */ int -gui_color_get_last_pair () +gui_color_get_term_colors () { return 0; } /* - * gui_color_get_name: get color name - */ - -const char * -gui_color_get_name (int num_color) -{ - return gui_weechat_colors[num_color].string; -} - -/* - * gui_color_get_pair: get color pair with a WeeChat color number + * gui_color_get_pair: get a pair with given foreground/background colors */ int -gui_color_get_pair (int num_color) +gui_color_get_pair (int fg, int bg) { - int fg, bg; - - if ((num_color < 0) || (num_color > GUI_COLOR_NUM_COLORS - 1)) - return WEECHAT_COLOR_WHITE; - - fg = gui_color[num_color]->foreground; - bg = gui_color[num_color]->background; + (void) fg; + (void) bg; - if (((fg == -1) || (fg == 99)) - && ((bg == -1) || (bg == 99))) - return 63; - if ((fg == -1) || (fg == 99)) - fg = WEECHAT_COLOR_WHITE; - if ((bg == -1) || (bg == 99)) - bg = 0; - - return (bg * 8) + fg; + return 0; } /* - * gui_color_init_pair: init a color pair + * gui_color_weechat_get_pair: get color pair with a WeeChat color number */ -void -gui_color_init_pair (int number) +int +gui_color_weechat_get_pair (int weechat_color) { - /* This function does nothing in Gtk GUI */ - (void) number; + (void) weechat_color; + + return 0; } /* - * gui_color_init_pairs: init color pairs + * gui_color_get_name: get color name */ -void -gui_color_init_pairs () +const char * +gui_color_get_name (int num_color) { - /* This function does nothing in Gtk GUI */ + return gui_weechat_colors[num_color].string; } /* @@ -231,32 +209,6 @@ gui_color_rebuild_weechat () } /* - * gui_color_pre_init: pre-init colors - */ - -void -gui_color_pre_init () -{ - int i; - - for (i = 0; i < GUI_COLOR_NUM_COLORS; i++) - { - gui_color[i] = NULL; - } -} - -/* - * gui_color_init: init GUI colors - */ - -void -gui_color_init () -{ - gui_color_init_pairs (); - gui_color_init_weechat (); -} - -/* * gui_color_display_terminal_colors: display terminal colors * This is called by command line option * "-c" / "--colors" @@ -289,6 +241,16 @@ gui_color_switch_colors () } /* + * gui_color_reset_pairs: reset all color pairs + */ + +void +gui_color_reset_pairs () +{ + /* This function does nothing in Gtk GUI */ +} + +/* * gui_color_buffer_assign: assign color buffer to pointer if it is not yet set */ @@ -344,6 +306,41 @@ gui_color_palette_free (struct t_gui_color_palette *color_palette) } /* + * gui_color_pre_init: pre-init colors + */ + +void +gui_color_pre_init () +{ + int i; + + for (i = 0; i < GUI_COLOR_NUM_COLORS; i++) + { + gui_color[i] = NULL; + } +} + +/* + * gui_color_init: init GUI colors + */ + +void +gui_color_init () +{ + gui_color_init_weechat (); +} + +/* + * gui_color_dump: dump colors + */ + +void +gui_color_dump () +{ + /* This function does nothing in Gtk GUI */ +} + +/* * gui_color_end: end GUI colors */ diff --git a/src/gui/gtk/gui-gtk.h b/src/gui/gtk/gui-gtk.h index c93ba13e2..fac1eb00a 100644 --- a/src/gui/gtk/gui-gtk.h +++ b/src/gui/gtk/gui-gtk.h @@ -88,7 +88,7 @@ extern GtkWidget *gui_gtk_entry_input; extern GtkWidget *gui_gtk_label1; /* color functions */ -extern int gui_color_get_pair (int num_color); +extern int gui_color_get_pair (int fg, int bg); extern void gui_color_pre_init (); extern void gui_color_init (); extern void gui_color_end (); diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index 5f0609e7e..061cb1b8f 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -888,7 +888,7 @@ void gui_buffer_set_nicklist (struct t_gui_buffer *buffer, int nicklist) { buffer->nicklist = (nicklist) ? 1 : 0; - gui_window_refresh_windows (); + gui_window_ask_refresh (1); } /* @@ -913,7 +913,7 @@ gui_buffer_set_nicklist_display_groups (struct t_gui_buffer *buffer, buffer->nicklist_display_groups = (display_groups) ? 1 : 0; buffer->nicklist_visible_count = 0; gui_nicklist_compute_visible_count (buffer, buffer->nicklist_root); - gui_window_refresh_windows (); + gui_window_ask_refresh (1); } /* diff --git a/src/gui/gui-color.c b/src/gui/gui-color.c index d7e5c4ccd..eb8f30fd2 100644 --- a/src/gui/gui-color.c +++ b/src/gui/gui-color.c @@ -91,10 +91,11 @@ gui_color_search_config (const char *color_name) const char * gui_color_get_custom (const char *color_name) { - int fg, bg, pair; + int fg, bg, fg_pair, bg_pair, pair; static char color[32][16]; static int index_color = 0; - char *pos_comma, *str_fg, *pos_bg, *error; + char color_fg[32], color_bg[32]; + char *pos_delim, *str_fg, *pos_bg, *error; /* attribute or other color name (GUI dependent) */ index_color = (index_color + 1) % 32; @@ -106,64 +107,64 @@ gui_color_get_custom (const char *color_name) if (string_strcasecmp (color_name, "reset") == 0) { snprintf (color[index_color], sizeof (color[index_color]), - "%s", - GUI_COLOR_RESET_STR); + "%c", + GUI_COLOR_RESET_CHAR); } else if (string_strcasecmp (color_name, "bold") == 0) { snprintf (color[index_color], sizeof (color[index_color]), - "%s%s", - GUI_COLOR_SET_WEECHAT_STR, - GUI_COLOR_ATTR_BOLD_STR); + "%c%c", + GUI_COLOR_SET_WEECHAT_CHAR, + GUI_COLOR_ATTR_BOLD_CHAR); } else if (string_strcasecmp (color_name, "-bold") == 0) { snprintf (color[index_color], sizeof (color[index_color]), - "%s%s", - GUI_COLOR_REMOVE_WEECHAT_STR, - GUI_COLOR_ATTR_BOLD_STR); + "%c%c", + GUI_COLOR_REMOVE_WEECHAT_CHAR, + GUI_COLOR_ATTR_BOLD_CHAR); } else if (string_strcasecmp (color_name, "reverse") == 0) { snprintf (color[index_color], sizeof (color[index_color]), - "%s%s", - GUI_COLOR_SET_WEECHAT_STR, - GUI_COLOR_ATTR_REVERSE_STR); + "%c%c", + GUI_COLOR_SET_WEECHAT_CHAR, + GUI_COLOR_ATTR_REVERSE_CHAR); } else if (string_strcasecmp (color_name, "-reverse") == 0) { snprintf (color[index_color], sizeof (color[index_color]), - "%s%s", - GUI_COLOR_REMOVE_WEECHAT_STR, - GUI_COLOR_ATTR_REVERSE_STR); + "%c%c", + GUI_COLOR_REMOVE_WEECHAT_CHAR, + GUI_COLOR_ATTR_REVERSE_CHAR); } else if (string_strcasecmp (color_name, "italic") == 0) { snprintf (color[index_color], sizeof (color[index_color]), - "%s%s", - GUI_COLOR_SET_WEECHAT_STR, - GUI_COLOR_ATTR_ITALIC_STR); + "%c%c", + GUI_COLOR_SET_WEECHAT_CHAR, + GUI_COLOR_ATTR_ITALIC_CHAR); } else if (string_strcasecmp (color_name, "-italic") == 0) { snprintf (color[index_color], sizeof (color[index_color]), - "%s%s", - GUI_COLOR_REMOVE_WEECHAT_STR, - GUI_COLOR_ATTR_ITALIC_STR); + "%c%c", + GUI_COLOR_REMOVE_WEECHAT_CHAR, + GUI_COLOR_ATTR_ITALIC_CHAR); } else if (string_strcasecmp (color_name, "underline") == 0) { snprintf (color[index_color], sizeof (color[index_color]), - "%s%s", - GUI_COLOR_SET_WEECHAT_STR, - GUI_COLOR_ATTR_UNDERLINE_STR); + "%c%c", + GUI_COLOR_SET_WEECHAT_CHAR, + GUI_COLOR_ATTR_UNDERLINE_CHAR); } else if (string_strcasecmp (color_name, "-underline") == 0) { snprintf (color[index_color], sizeof (color[index_color]), - "%s%s", - GUI_COLOR_REMOVE_WEECHAT_STR, - GUI_COLOR_ATTR_UNDERLINE_STR); + "%c%c", + GUI_COLOR_REMOVE_WEECHAT_CHAR, + GUI_COLOR_ATTR_UNDERLINE_CHAR); } else if (string_strcasecmp (color_name, "bar_fg") == 0) { @@ -192,86 +193,121 @@ gui_color_get_custom (const char *color_name) else { /* custom color name (GUI dependent) */ - pair = gui_color_palette_get_alias (color_name); - if (pair >= 0) + pos_delim = strchr (color_name, ','); + if (!pos_delim) + pos_delim = strchr (color_name, '/'); + if (pos_delim) { - snprintf (color[index_color], sizeof (color[index_color]), - "%s%s%05d", - GUI_COLOR_COLOR_STR, - GUI_COLOR_PAIR_STR, - pair); + if (pos_delim == color_name) + str_fg = NULL; + else + str_fg = string_strndup (color_name, pos_delim - color_name); + pos_bg = pos_delim + 1; } else { - error = NULL; - pair = (int)strtol (color_name, &error, 10); - if (error && !error[0]) - { - snprintf (color[index_color], sizeof (color[index_color]), - "%s%s%05d", - GUI_COLOR_COLOR_STR, - GUI_COLOR_PAIR_STR, - pair); - } - else + str_fg = strdup (color_name); + pos_bg = NULL; + } + + fg_pair = -1; + bg_pair = -1; + fg = -1; + bg = -1; + color_fg[0] = '\0'; + color_bg[0] = '\0'; + + if (str_fg) + { + fg_pair = gui_color_palette_get_alias (str_fg); + if (fg_pair < 0) { - pos_comma = strchr (color_name, ','); - if (pos_comma) + error = NULL; + pair = (int)strtol (str_fg, &error, 10); + if (error && !error[0]) { - if (pos_comma == color_name) - str_fg = NULL; - else - str_fg = string_strndup (color_name, pos_comma - color_name); - pos_bg = pos_comma + 1; + fg_pair = pair; + if (fg_pair < 0) + fg_pair = 0; + else if (fg_pair > 99999) + fg_pair = 99999; } else - { - str_fg = strdup (color_name); - pos_bg = NULL; - } - - if (str_fg && pos_bg) - { fg = gui_color_search (str_fg); - bg = gui_color_search (pos_bg); - if ((fg >= 0) && (bg >= 0)) - { - snprintf (color[index_color], sizeof (color[index_color]), - "%s%s%02d,%02d", - GUI_COLOR_COLOR_STR, - GUI_COLOR_FG_BG_STR, - fg, bg); - } - } - else if (str_fg && !pos_bg) + } + } + if (pos_bg) + { + bg_pair = gui_color_palette_get_alias (pos_bg); + if (bg_pair < 0) + { + error = NULL; + pair = (int)strtol (pos_bg, &error, 10); + if (error && !error[0]) { - fg = gui_color_search (str_fg); - if (fg >= 0) - { - snprintf (color[index_color], sizeof (color[index_color]), - "%s%s%02d", - GUI_COLOR_COLOR_STR, - GUI_COLOR_FG_STR, - fg); - } + bg_pair = pair; + if (bg_pair < 0) + bg_pair = 0; + else if (bg_pair > 99999) + bg_pair = 99999; } - else if (!str_fg && pos_bg) - { + else bg = gui_color_search (pos_bg); - if (bg >= 0) - { - snprintf (color[index_color], sizeof (color[index_color]), - "%s%s%02d", - GUI_COLOR_COLOR_STR, - GUI_COLOR_BG_STR, - bg); - } - } - - if (str_fg) - free (str_fg); } } + + if (fg_pair >= 0) + { + snprintf (color_fg, sizeof (color_fg), "%c%05d", + GUI_COLOR_PAIR_CHAR, + fg_pair); + } + else if (fg >= 0) + { + snprintf (color_fg, sizeof (color_fg), "%02d", + fg); + } + + if (bg_pair >= 0) + { + snprintf (color_bg, sizeof (color_bg), "%c%05d", + GUI_COLOR_PAIR_CHAR, + bg_pair); + } + else if (bg >= 0) + { + snprintf (color_bg, sizeof (color_bg), "%02d", + bg); + } + + if (color_fg[0] && color_bg[0]) + { + snprintf (color[index_color], sizeof (color[index_color]), + "%c%c%s,%s", + GUI_COLOR_COLOR_CHAR, + GUI_COLOR_FG_BG_CHAR, + color_fg, + color_bg); + } + else if (color_fg[0]) + { + snprintf (color[index_color], sizeof (color[index_color]), + "%c%c%s", + GUI_COLOR_COLOR_CHAR, + GUI_COLOR_FG_CHAR, + color_fg); + } + else if (color_bg[0]) + { + snprintf (color[index_color], sizeof (color[index_color]), + "%c%c%s", + GUI_COLOR_COLOR_CHAR, + GUI_COLOR_BG_CHAR, + color_bg); + } + + if (str_fg) + free (str_fg); } return color[index_color]; @@ -314,13 +350,51 @@ gui_color_decode (const char *string, const char *replacement) { case GUI_COLOR_FG_CHAR: case GUI_COLOR_BG_CHAR: - if (ptr_string[1] && ptr_string[2]) - ptr_string += 3; + if (ptr_string[1] == GUI_COLOR_PAIR_CHAR) + { + if (ptr_string[2] && ptr_string[3] && ptr_string[4] + && ptr_string[5] && ptr_string[6]) + { + ptr_string += 7; + } + } + else + { + if (ptr_string[1] && ptr_string[2]) + ptr_string += 3; + } break; case GUI_COLOR_FG_BG_CHAR: - if (ptr_string[1] && ptr_string[2] && (ptr_string[3] == ',') - && ptr_string[4] && ptr_string[5]) - ptr_string += 6; + if (ptr_string[1] == GUI_COLOR_PAIR_CHAR) + { + if (ptr_string[2] && ptr_string[3] && ptr_string[4] + && ptr_string[5] && ptr_string[6]) + { + ptr_string += 7; + } + } + else + { + if (ptr_string[1] && ptr_string[2]) + ptr_string += 3; + } + if (ptr_string[0] == ',') + { + if (ptr_string[1] == GUI_COLOR_PAIR_CHAR) + { + if (ptr_string[2] && ptr_string[3] + && ptr_string[4] && ptr_string[5] + && ptr_string[6]) + { + ptr_string += 7; + } + } + else + { + if (ptr_string[1] && ptr_string[2]) + ptr_string += 3; + } + } break; case GUI_COLOR_PAIR_CHAR: if ((isdigit (ptr_string[1])) && (isdigit (ptr_string[2])) @@ -582,17 +656,14 @@ gui_color_palette_add (int number, const char *value) new_color_palette = gui_color_palette_new (number, value); if (!new_color_palette) return; - + snprintf (str_number, sizeof (str_number), "%d", number); hashtable_set (gui_color_hash_palette_color, str_number, new_color_palette); gui_color_palette_build_aliases (); if (gui_init_ok) - { - gui_color_init_pair (number); gui_color_buffer_display (); - } } /* @@ -614,11 +685,9 @@ gui_color_palette_remove (int number) { hashtable_remove (gui_color_hash_palette_color, str_number); gui_color_palette_build_aliases (); + if (gui_init_ok) - { - gui_color_init_pair (number); gui_color_buffer_display (); - } } } diff --git a/src/gui/gui-color.h b/src/gui/gui-color.h index de102b3e5..87a12f97c 100644 --- a/src/gui/gui-color.h +++ b/src/gui/gui-color.h @@ -69,52 +69,36 @@ enum t_gui_color_enum /* WeeChat internal color attributes (should never be in protocol messages) */ #define GUI_COLOR_COLOR_CHAR '\x19' -#define GUI_COLOR_COLOR_STR "\x19" #define GUI_COLOR_SET_WEECHAT_CHAR '\x1A' -#define GUI_COLOR_SET_WEECHAT_STR "\x1A" #define GUI_COLOR_REMOVE_WEECHAT_CHAR '\x1B' -#define GUI_COLOR_REMOVE_WEECHAT_STR "\x1B" #define GUI_COLOR_RESET_CHAR '\x1C' -#define GUI_COLOR_RESET_STR "\x1C" #define GUI_COLOR_ATTR_BOLD_CHAR '\x01' -#define GUI_COLOR_ATTR_BOLD_STR "\x01" #define GUI_COLOR_ATTR_REVERSE_CHAR '\x02' -#define GUI_COLOR_ATTR_REVERSE_STR "\x02" #define GUI_COLOR_ATTR_ITALIC_CHAR '\x03' -#define GUI_COLOR_ATTR_ITALIC_STR "\x03" #define GUI_COLOR_ATTR_UNDERLINE_CHAR '\x04' -#define GUI_COLOR_ATTR_UNDERLINE_STR "\x04" #define GUI_COLOR(color) ((gui_color[color]) ? gui_color[color]->string : "") -#define GUI_NO_COLOR GUI_COLOR_RESET_STR +#define GUI_NO_COLOR "\x1C" #define GUI_COLOR_CUSTOM_BAR_FG (gui_color_get_custom ("bar_fg")) #define GUI_COLOR_CUSTOM_BAR_DELIM (gui_color_get_custom ("bar_delim")) #define GUI_COLOR_CUSTOM_BAR_BG (gui_color_get_custom ("bar_bg")) +/* color codes for chat and bars */ #define GUI_COLOR_FG_CHAR 'F' -#define GUI_COLOR_FG_STR "F" #define GUI_COLOR_BG_CHAR 'B' -#define GUI_COLOR_BG_STR "B" #define GUI_COLOR_FG_BG_CHAR '*' -#define GUI_COLOR_FG_BG_STR "*" #define GUI_COLOR_PAIR_CHAR '@' -#define GUI_COLOR_PAIR_STR "@" + +/* color codes specific to bars */ #define GUI_COLOR_BAR_CHAR 'b' -#define GUI_COLOR_BAR_STR "b" #define GUI_COLOR_BAR_FG_CHAR 'F' -#define GUI_COLOR_BAR_FG_STR "F" #define GUI_COLOR_BAR_DELIM_CHAR 'D' -#define GUI_COLOR_BAR_DELIM_STR "D" #define GUI_COLOR_BAR_BG_CHAR 'B' -#define GUI_COLOR_BAR_BG_STR "B" #define GUI_COLOR_BAR_START_INPUT_CHAR '_' -#define GUI_COLOR_BAR_START_INPUT_STR "_" #define GUI_COLOR_BAR_START_INPUT_HIDDEN_CHAR '-' -#define GUI_COLOR_BAR_START_INPUT_HIDDEN_STR "-" #define GUI_COLOR_BAR_MOVE_CURSOR_CHAR '#' -#define GUI_COLOR_BAR_MOVE_CURSOR_STR "#" #define GUI_COLOR_PAIR_FLAG 0x10000 #define GUI_COLOR_PAIR_MASK 0xFFFF @@ -134,8 +118,6 @@ struct t_gui_color struct t_gui_color_palette { char *alias; /* alias name for this color pair */ - int foreground; /* foreground color */ - int background; /* background color */ int r, g, b; /* red/green/blue values for color */ }; @@ -167,7 +149,7 @@ extern int gui_color_assign (int *color, char const *color_name); extern int gui_color_assign_by_diff (int *color, const char *color_name, int diff); extern int gui_color_get_weechat_colors_number (); -extern int gui_color_get_last_pair (); +extern int gui_color_get_term_colors (); extern const char *gui_color_get_name (int num_color); extern void gui_color_init_pair (int number); extern void gui_color_init_pairs (); @@ -175,11 +157,13 @@ extern void gui_color_init_weechat (); extern void gui_color_display_terminal_colors (); extern void gui_color_buffer_display (); extern void gui_color_switch_colors (); +extern void gui_color_reset_pairs (); extern void gui_color_buffer_assign (); extern void gui_color_buffer_open (); extern void gui_color_palette_build_aliases (); extern struct t_gui_color_palette *gui_color_palette_new (int number, const char *value); extern void gui_color_palette_free (struct t_gui_color_palette *color_palette); +extern void gui_color_dump (); #endif /* __WEECHAT_GUI_COLOR_H */ diff --git a/src/gui/gui-window.h b/src/gui/gui-window.h index 152e98c2e..87d4da5ee 100644 --- a/src/gui/gui-window.h +++ b/src/gui/gui-window.h @@ -158,7 +158,6 @@ extern void gui_window_scroll_up (struct t_gui_window *window); extern void gui_window_scroll_down (struct t_gui_window *window); extern void gui_window_scroll_top (struct t_gui_window *window); extern void gui_window_scroll_bottom (struct t_gui_window *window); -extern void gui_window_refresh_windows (); extern struct t_gui_window *gui_window_split_horizontal (struct t_gui_window *window, int percentage); extern struct t_gui_window *gui_window_split_vertical (struct t_gui_window *window, |