diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-04-11 18:36:06 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-04-11 18:36:06 +0200 |
commit | d975629686360821c020bb7304b7af1528a877f9 (patch) | |
tree | b021375ae20ae8dcffc9b18b86e3dc24ff538dc8 | |
parent | 8211dd6043557f445bf664507fe6daf22a5aa694 (diff) | |
download | weechat-d975629686360821c020bb7304b7af1528a877f9.zip |
Improved /set command, added /unset command, new name for config files (*.conf)
70 files changed, 7086 insertions, 5284 deletions
@@ -1,10 +1,12 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2008-03-28 +ChangeLog - 2008-04-11 Version 0.2.7 (under dev!): + * new names for config files (*.conf instead of *.rc) + * improved /set command, new command /unset * added new type of buffer, with free content * added tags for lines and custom filtering by tags or regex (task #7674) * added custom bars, with custom items diff --git a/po/POTFILES.in b/po/POTFILES.in index 4238047ab..6d3141416 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -90,7 +90,6 @@ ./src/plugins/aspell/aspell.c ./src/plugins/aspell/aspell.h ./src/plugins/charset/charset.c -./src/plugins/charset/charset.h ./src/plugins/debug/debug.c ./src/plugins/demo/demo.c ./src/plugins/fifo/fifo.c @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-04-03 18:09+0200\n" +"POT-Creation-Date: 2008-04-11 18:29+0200\n" "PO-Revision-Date: 2007-09-06 12:44+0200\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -60,12 +60,12 @@ msgstr "" " -v, --version zobrazí verzi WeeChat\n" " -w, --weechat-commands zobrazí příkazy WeeChat\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, fuzzy, c-format msgid "%s configuration options:\n" msgstr "nastaví konfigurační možnosti" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s internal commands:\n" msgstr "%s vnitřní příkazy:\n" @@ -73,7 +73,7 @@ msgstr "%s vnitřní příkazy:\n" msgid "Internal key functions:\n" msgstr "Vnitřní klávesové funkce:\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s default keys:\n" msgstr "%s výchozí klávesy:\n" @@ -202,7 +202,7 @@ msgid "%sError: incorrect notify level (must be between %d and %d)" msgstr "%s nekorektní level upozornění (musí být mezi %d a %d)\n" #, fuzzy, c-format -msgid "%sNew notify level for %s%s%s: %d %s" +msgid "New notify level for %s%s%s: %d %s" msgstr "Nový level upozornění %s%s%s: %s%d %s" #, fuzzy @@ -271,7 +271,7 @@ msgstr "%s plugin \"%s\" nenalezen\n" msgid "%sError: wrong filter number" msgstr "%s nekorektní číslo bufferu\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, fuzzy, c-format msgid "%s internal commands:" msgstr "%s vnitřní příkazy:\n" @@ -293,7 +293,51 @@ msgid "plugin:" msgstr " (není plugin)\n" #, fuzzy, c-format -msgid "%sNo help available, \"%s\" is an unknown command" +msgid "Option \"%s%s%s\": %s" +msgstr "Přezdívkz %s%s%s: %s[" + +#, fuzzy +msgid " type: boolean ('on' or 'off')" +msgstr " . typ boolean (hodnota: 'on' nebo 'off')\n" + +#, c-format +msgid " value: %s%s%s (default: %s)" +msgstr "" + +#, fuzzy, c-format +msgid " type: string (%s)" +msgstr " . typ: řetězec\n" + +#, c-format +msgid " value: '%s%s%s' (default: '%s')" +msgstr "" + +#, fuzzy, c-format +msgid " type: integer (between %d and %d)" +msgstr " . typ celočíselný (hodnoty: mezi %d a %d)\n" + +#, c-format +msgid " value: %s%d%s (default: %d)" +msgstr "" + +#, fuzzy +msgid " type: string (any string)" +msgstr " . typ řetězec (jakýkoliv řetězec)\n" + +#, fuzzy +msgid " type: char (any char)" +msgstr " . typ: znak (jakýkoliv znak)\n" + +#, fuzzy, c-format +msgid " type: string (limit: %d chars)" +msgstr " . typ řetězec (jakýkoliv řetězec, limit: %d znaků)\n" + +#, fuzzy +msgid " type: color (values depend on GUI used)" +msgstr " . hodnoty: mezi %d a %d\n" + +#, fuzzy, c-format +msgid "%sNo help available, \"%s\" is not a command or an option" msgstr "Není dostupná žádná nápověda, \"%s\" je neznámý příkaz\n" #, fuzzy @@ -301,7 +345,7 @@ msgid "Buffer command history:" msgstr "zobrazit historii příkazů bufferu" #, fuzzy, c-format -msgid "%sNew key binding: %s%s => %s%s%s%s%s" +msgid "New key binding: %s%s => %s%s%s%s%s" msgstr "Nová klávesová zkratka: %s" #, fuzzy @@ -312,8 +356,8 @@ msgstr "Klávesové zkratky:\n" msgid "Internal key functions:" msgstr "Vnitřní klávesové funkce:\n" -#, fuzzy, c-format -msgid "%sDefault key bindings restored" +#, fuzzy +msgid "Default key bindings restored" msgstr "Výchozí klávesové zkratky obnoveny\n" #, fuzzy, c-format @@ -322,7 +366,7 @@ msgstr "" "%s \"-yes\" argument je požadován pro reset kaláves (bezpečnostní opatření)\n" #, fuzzy, c-format -msgid "%sKey \"%s\" unbound" +msgid "Key \"%s\" unbound" msgstr "Klávesa \"%s\" odpojena\n" #, fuzzy, c-format @@ -441,7 +485,7 @@ msgid "%sError: wrong argument count for \"%s\" command" msgstr "%s špatný počet parametrů pro příkaz \"%s\"\n" #, fuzzy, c-format -msgid "%sOptions reloaded from %s" +msgid "Options reloaded from %s" msgstr "Možnosti pluginů uloženy\n" #, fuzzy, c-format @@ -449,11 +493,11 @@ msgid "%sError: failed to reload options from %s" msgstr "%s selhalo uložení nastavení pluginů\n" #, fuzzy, c-format -msgid "%sUnknown configuration file \"%s\"" +msgid "Unknown configuration file \"%s\"" msgstr "říct serveru, aby znovu načetl svůj konfigurační soubor" #, fuzzy, c-format -msgid "%sOptions saved to %s" +msgid "Options saved to %s" msgstr "Možnosti pluginů uloženy\n" #, fuzzy, c-format @@ -463,17 +507,19 @@ msgstr "%s selhalo uložení nastavení pluginů\n" msgid "(unknown)" msgstr "(neznámý)" -#, fuzzy, c-format -msgid "No configuration option found with \"%s\"" -msgstr "Nebyla nalezena žádná volba nastavení s \"%s\"\n" +#, c-format +msgid "" +"%sOption \"%s\" not found (tip: you can use \"*\" at beginning and/or end of " +"option to see a sublist)" +msgstr "" #, fuzzy msgid "No configuration option found" msgstr "Nebyla nalezena žádná volba nastavení\n" #, fuzzy, c-format -msgid "%s%d%s configuration option found with \"%s\"" -msgid_plural "%s%d%s configuration options found with \"%s\"" +msgid "%s%d%s configuration option found matching with \"%s\"" +msgid_plural "%s%d%s configuration options found matching with \"%s\"" msgstr[0] "volba/volby nastavení nalezeny s \"%s\"\n" msgstr[1] "volba/volby nastavení nalezeny s \"%s\"\n" @@ -484,48 +530,28 @@ msgstr[0] "volba/volby nastavení nalezeny\n" msgstr[1] "volba/volby nastavení nalezeny\n" #, fuzzy, c-format +msgid "%sError: failed to set option \"%s\"" +msgstr "%s selhalo uložení nastavení pluginů\n" + +#, fuzzy, c-format msgid "%sError: configuration option \"%s\" not found" msgstr "%s volba nastavení \"%s\" nenalezena\n" #, fuzzy -msgid "Option changed: " +msgid "Option changed" msgstr "není na kanále" #, fuzzy, c-format -msgid "%sError: incorrect value for option \"%s\"" -msgstr "%s nekorektní hodnota pro volbu \"%s\"\n" - -#, fuzzy, c-format -msgid "No plugin option found with \"%s\"" -msgstr "Nebyla nalezena žádná možnost pluginu s \"%s\"\n" - -#, fuzzy -msgid "No plugin option found" -msgstr "Nebyla nalezena žádná možnost pluginu\n" - -#, fuzzy, c-format -msgid "%s%d%s plugin option found with \"%s\"" -msgid_plural "%s%d%s plugin options found with \"%s\"" -msgstr[0] "Nebyla nalezena žádná možnost pluginu s \"%s\"\n" -msgstr[1] "Nebyla nalezena žádná možnost pluginu s \"%s\"\n" - -#, fuzzy, c-format -msgid "%s%d%s plugin option found" -msgid_plural "%s%d%s plugin options found" -msgstr[0] "Nebyla nalezena žádná možnost pluginu\n" -msgstr[1] "Nebyla nalezena žádná možnost pluginu\n" - -#, fuzzy, c-format -msgid "%sError: plugin \"%s\" not found" +msgid "%sOption not found" msgstr "%s plugin \"%s\" nenalezen\n" -#, fuzzy, c-format -msgid "Plugin option changed: %s%s = \"%s%s%s\"" -msgstr "Nebyla nalezena žádná možnost pluginu s \"%s\"\n" +#, fuzzy +msgid "Option reset" +msgstr "Možnosti pluginů uloženy\n" -#, fuzzy, c-format -msgid "%sError: incorrect value for plugin option \"%s\"" -msgstr "%s nekorektní hodnota pro možnost pluginu \"%s\"\n" +#, fuzzy +msgid "Option removed" +msgstr "není na kanále" #, c-format msgid "WeeChat uptime: %d %s %02d:%02d:%02d, started on %s" @@ -686,13 +712,18 @@ msgid "" "from message)" msgstr "" -msgid "display help about commands" +#, fuzzy +msgid "display help about commands and options" msgstr "zobrazí nápovědu k příkazům" -msgid "[command]" +#, fuzzy +msgid "[command | option]" msgstr "[příkaz]" -msgid "command: name of a WeeChat or IRC command" +#, fuzzy +msgid "" +"command: a command name\n" +" option: an option name (use /set to see list)" msgstr "příkaz: jméno WeeChat nebo IRC příkazu" msgid "show buffer command history" @@ -799,33 +830,24 @@ msgid "[option [ = value]]" msgstr "[možnost [ = hodnota]]" msgid "" -"option: name of an option (if name is full and no value is given, then help " -"is displayed on option)\n" -" value: value for option\n" -"\n" -"Option may be: servername.server_xxx where \"servername\" is an internal " -"server name and \"xxx\" an option for this server." +"option: name of an option\n" +" value: value for option" msgstr "" -"možnost: jméno možnosti (pokud je jméno celé a není předána žádná hodnota, " -"pak je zobrazena nápověda pro tuto možnost)\n" -"hodnota: hodnota volby\n" -"\n" -"Možnost může být: jmenoserveru.server_xxx kde \"jmenoserveru\" je vnitřní " -"jméno serveru a \"xxx\" je možnost tohoto serveru." -msgid "set plugin config options" -msgstr "nastaví konfigurační možností pluginu" +#, fuzzy +msgid "unset/reset config options" +msgstr "nastaví konfigurační možnosti" + +#, fuzzy +msgid "[option]" +msgstr "[příkaz]" msgid "" -"option: name of a plugin option\n" -" value: value for option\n" +"option: name of an option\n" "\n" -"Option is format: plugin.option, example: perl.myscript.item1" +"According to option, it's reset (for standard options) or removed (for " +"optional settings, like server values)." msgstr "" -"možnost: jméno možnosti pluginu\n" -"hodnota: hodnota možnosti\n" -"\n" -"Formát možnosti je: plugin.možnost, příklad: perl.mujskript.polozka1" msgid "upgrade WeeChat without disconnecting from servers" msgstr "aktualizovat WeeChat bez odpojení od serveru" @@ -922,6 +944,9 @@ msgstr "" msgid "command executed when WeeChat starts, after loading plugins" msgstr "" +msgid "WeeChat slogan (if empty, slogan is not used)" +msgstr "WeeChat slogan (pokud je prázdné, není slogan použit)" + msgid "" "if set, uses real white color, disabled by default for terms with white " "background (if you never use white background, you should turn on this " @@ -939,9 +964,6 @@ msgstr "uložit soubor s nastavením při ukončení" msgid "set title for window (terminal for Curses GUI) with name and version" msgstr "nastaví titulek okna (terminálu pro Cruses GUI) s jménem a verzí" -msgid "WeeChat slogan (if empty, slogan is not used)" -msgstr "WeeChat slogan (pokud je prázdné, není slogan použit)" - msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "o kolik řádů posunou pomocí scroll_up a scroll_down" @@ -985,10 +1007,6 @@ msgid "display space if nick mode is not (half)op/voice" msgstr "zobrazit mezeru pokud mód přezdívkz není (částečný)op/voice" #, fuzzy -msgid "prefix for info messages" -msgstr "barva okna s novými zprávami" - -#, fuzzy msgid "prefix for error messages" msgstr "vypsat debug zprávy" @@ -1094,11 +1112,6 @@ msgstr "" "maximální počet řádků pro vložení bez dotazování uživatele (0 = vypnout tuto " "vlastnost)" -msgid "" -"default quit message ('%v' will be replaced by WeeChat version in string)" -msgstr "" -"výchozí zpráva při uknočnení ('%v' bude nahrazeno verzí WeeChat v řetězci)" - #, fuzzy msgid "background color for window separators (when splited)" msgstr "barva děliče oken (při rozdělení)" @@ -1132,10 +1145,6 @@ msgid "text color for time delimiters" msgstr "barva děličů v infobaru" #, fuzzy -msgid "text color for info prefix" -msgstr "barva textu v info baru" - -#, fuzzy msgid "text color for error prefix" msgstr "barva pro šipku pri 'join' (prefix)" @@ -1490,14 +1499,6 @@ msgid "(default options)" msgstr "" #, fuzzy, c-format -msgid "" -"#\n" -"# %s configuration file, created by %s v%s on %s#\n" -msgstr "" -"#\n" -"# %s konfigurační soubor, vytvořil %s v%s %s" - -#, fuzzy, c-format msgid "%sWarning: config file \"%s\" not found" msgstr "%s konfigurační soubor \"%s\" nenalezen\n" @@ -1859,15 +1860,15 @@ msgid "%s%s: error creating alias \"%s\" => \"%s\"" msgstr "%s nedostatek paměti pro infobar zprávu\n" #, fuzzy, c-format -msgid "%sAlias \"%s\" => \"%s\" created" +msgid "Alias \"%s\" => \"%s\" created" msgstr "Alias \"%s\" => \"%s\" vytvořen\n" #, fuzzy msgid "Alias:" msgstr "Alias:\n" -#, fuzzy, c-format -msgid "%sNo alias found." +#, fuzzy +msgid "No alias found" msgstr "Žádné aliasy nenalezeny.\n" #, fuzzy @@ -1883,7 +1884,7 @@ msgid "%sAlias \"%s\" not found" msgstr "%s adresa \"%s\" nenalezena\n" #, fuzzy, c-format -msgid "%sAlias \"%s\" removed" +msgid "Alias \"%s\" removed" msgstr "Alias \"%s\" odebrán\n" msgid "create an alias for a command" @@ -1923,67 +1924,63 @@ msgid "alias_name: name of alias to remove" msgstr "jméno_aliasu: jméno aliasu pro odebrání" #, fuzzy, c-format +msgid "%s: debug enabled" +msgstr "FIFO roura je otevřena\n" + +#, c-format +msgid "%s: debug disabled" +msgstr "" + +#, fuzzy, c-format msgid "%s%s: error creating charset \"%s\" => \"%s\"" msgstr "%s nedostatek paměti pro infobar zprávu\n" -#, fuzzy, c-format -msgid "%sCharset \"%s\" => \"%s\"" -msgstr "Alias \"%s\" => \"%s\" vytvořen\n" +msgid "global decoding charset" +msgstr "" + +msgid "global encoding charset" +msgstr "" #, fuzzy, c-format -msgid "%s%s: charset \"%s\" not found" -msgstr "%s server \"%s\" nenalezen\n" +msgid "Charset: %s, %s => %s" +msgstr "Alias \"%s\" => \"%s\" vytvořen\n" #, fuzzy, c-format -msgid "%sCharset \"%s\" removed" +msgid "Charset: %s, %s: removed" msgstr "Alias \"%s\" odebrán\n" -#, fuzzy -msgid "List of charsets:" -msgstr "Seznam pro aliasy:\n" - #, fuzzy, c-format -msgid "List of charsets with \"%s\":" -msgstr "Seznam pro aliasy:\n" +msgid "%s%s: missing parameters" +msgstr "%s chybí argument pro volbu \"%s\"\n" -#, fuzzy -msgid "No charset found" -msgstr "Žádná klávesa nenalezena.\n" +#, c-format +msgid "%s%s: wrong charset type (decode or encode expected)" +msgstr "" -#, fuzzy -msgid "No charset defined" -msgstr "Žádné aliasy nejsou definovány.\n" +#, fuzzy, c-format +msgid "%s%s: invalid charset: \"%s\"" +msgstr "Nemůžu zapsat log soubor \"%s\"\n" #, fuzzy, c-format -msgid "%s%s: terminal: %s, internal: %s" +msgid "%s: terminal: %s, internal: %s" msgstr "%s plugin \"%s\" nenalezen\n" #, fuzzy, c-format -msgid "%s%s: error creating configuration file \"%s\"" +msgid "%s%s: error creating configuration file" msgstr "říct serveru, aby znovu načetl svůj konfigurační soubor" #, fuzzy -msgid "manage charsets" -msgstr "řídit buffery" +msgid "change charset for current buffer" +msgstr "nenalezeno jméno kanálu pro buffer" -msgid "[[type.]plugin.string [= charset]]" +msgid "[[decode | encode] charset] | [reset]" msgstr "" msgid "" -" type: \"decode\" or \"encode\" (if type is omitted, then both \"decode\" " -"and \"encode\" are set)\n" -" plugin: plugin name\n" -" string: string specific to plugin (for example a server name or server." -"channel for IRC plugin)\n" -"charset: charset to use (if empty, then charset is removed)\n" -"\n" -"Examples :\n" -"/charset decode iso-8859-15 => set global decode charset to iso-8859-15\n" -"/charset encode iso-8859-15 => set global encode charset to iso-8859-15\n" -"/charset decode.irc.freenode => set decode charset to iso-8859-15 for IRC " -"server \"freenode\" (all channels)\n" -"/charset decode.irc.freenode.#weechat => set decode charset to iso-8859-15 " -"for IRC channel \"#weechat\" on server \"freenode\"" +" decode: change decoding charset\n" +" encode: change encoding charset\n" +"charset: new charset for current buffer\n" +" reset: reset charsets for current buffer" msgstr "" msgid "print debug messages" @@ -2006,22 +2003,10 @@ msgstr "" " buffer: vypíše obsah bufferu s hexadecimálními hodnotami do log souboru\n" "windows: zobrazit strom oken" -#, fuzzy, c-format -msgid "%s: debug enabled" -msgstr "FIFO roura je otevřena\n" - -#, c-format -msgid "%s: debug disabled" -msgstr "" - msgid "demo message without prefix" msgstr "" #, c-format -msgid "%sdemo message with info prefix" -msgstr "" - -#, c-format msgid "%sdemo message with error prefix" msgstr "" @@ -2108,7 +2093,7 @@ msgid "" msgstr "" #, fuzzy, c-format -msgid "%s%s: pipe open" +msgid "%s: pipe open" msgstr "FIFO roura je otevřena\n" #, fuzzy, c-format @@ -2120,7 +2105,7 @@ msgid "%s%s: unable to create pipe for remote control (%s)" msgstr "%s nemohu zpravit FIFO rouru pro vzdálené ovládání (%s)\n" #, fuzzy, c-format -msgid "%s%s: pipe closed" +msgid "%s: pipe closed" msgstr "FIFO roura zavřena\n" #, fuzzy, c-format @@ -2148,11 +2133,11 @@ msgid "%s%s: cannot find nick for sending message" msgstr "%s nemohu najít přezdívku pro poslání zprávy\n" #, fuzzy, c-format -msgid "%s%s: future away on %s%s%s: %s" +msgid "%s: future away on %s%s%s: %s" msgstr "Budoucí zpráva o nepřítomnosit na %s%s%s: %s\n" #, fuzzy, c-format -msgid "%s%s: future away on %s%s%s removed" +msgid "%s: future away on %s%s%s removed" msgstr "Budoucí zpráva o nepřítomnosti na %s%s%s odebrána.\n" #, fuzzy, c-format @@ -2172,7 +2157,7 @@ msgid "%s%s: missing argument for \"%s\" option" msgstr "%s chybí argument pro volbu \"%s\"\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s created (temporary server, NOT SAVED!)" +msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "Server %s%s%s vytvořen (dočasný server, NEUKLÁDÁ SE!)\n" #, fuzzy, c-format @@ -2192,7 +2177,7 @@ msgid "%s%s: not connected to server \"%s\"!" msgstr "%s nepřipojen k serveru \"%s\"!\n" #, fuzzy, c-format -msgid "%s%s: auto-reconnection is cancelled" +msgid "%s: auto-reconnection is cancelled" msgstr "Automatické znovupřipojené je zrušeno\n" #, fuzzy, c-format @@ -2243,7 +2228,7 @@ msgid "%s%s: server \"%s\" already exists, can't create it!" msgstr "%s server \"%s\" již existuje, nemohu jej vytvořít!\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s created" +msgid "%s: server %s%s%s created" msgstr "Server %s%s%s vytvořen\n" #, fuzzy, c-format @@ -2259,11 +2244,11 @@ msgid "%s%s: server \"%s\" already exists for \"%s\" command" msgstr "%s server \"%s\" pro příkaz \"%s\" již existuje\n" #, fuzzy, c-format -msgid "%s%s: Server %s%s%s has been copied to %s%s" +msgid "%s: server %s%s%s has been copied to %s%s" msgstr "Server %s%s%s byl zkopírován do %s%s\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s has been renamed to %s%s" +msgid "%s: server %s%s%s has been renamed to %s%s" msgstr "Server %s%s%s byl přejmenován na %s%s\n" #, fuzzy, c-format @@ -2271,7 +2256,7 @@ msgid "%s%s: server \"%s\" is not a temporary server" msgstr "%s server \"%s\" není dočasným serverem\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s is not temporary any more" +msgid "%s: server %s%s%s is not temporary any more" msgstr "Server %s%s%s již není dočasný\n" #, fuzzy, c-format @@ -2283,12 +2268,12 @@ msgstr "" "nejprve /dissconnect %s.\n" #, fuzzy, c-format -msgid "%s%s: Server %s%s%s has been deleted" +msgid "%s: Server %s%s%s has been deleted" msgstr "Server %s%s%s byl odebrán\n" #, fuzzy, c-format msgid "" -"%s%s: messages outqueue DELETED for all servers. Some messages from you or " +"%s: messages outqueue DELETED for all servers. Some messages from you or " "WeeChat may have been lost!" msgstr "" "Fronty odchozích zpráv všech serverů byly SMAZÁNY. Některé zprávy od Vás " @@ -3048,23 +3033,96 @@ msgstr "" msgid "%sirc: too few arguments for \"%s\" command" msgstr "%s špatné parametry pro příkaz \"%s\"\n" +#, fuzzy, c-format +msgid "%s%s: error creating server \"%s\"" +msgstr "%s nedostatek paměti pro infobar zprávu\n" + +#, fuzzy, c-format +msgid "%s%s: error creating option \"%s\" for server \"%s\" (server not found)" +msgstr "%s volba nastavení \"%s\" nenalezena\n" + #, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" msgstr "" -#, fuzzy, c-format -msgid "%s%s: value \"%s\" is invalid for option \"%s\"" -msgstr "%s %s, řádek %d: nevalidní volba \"%s\"\n" +msgid "automatically connect to server when WeeChat is starting" +msgstr "automaticky připojit k serveru, když je WeeChat spouštěn" -#, fuzzy, c-format -msgid "%s%s: option \"%s\" not found" -msgstr "%s plugin \"%s\" nenalezen\n" +msgid "automatically reconnect to server when disconnected" +msgstr "automaticky znovu připojit server, když je odpojen" + +msgid "delay (in seconds) before trying again to reconnect to server" +msgstr "doba (v sekundách) před novým zkušením znovupřipojení na server" + +#, fuzzy +msgid "list of IP/port or hostname/port for server (separated by comma)" +msgstr "přezdívka použitá na IRC serveru" + +msgid "use IPv6 protocol for server communication" +msgstr "použít protokol IPv6 pro komunikaci se serverem" + +msgid "use SSL for server communication" +msgstr "použít SSL pro komunikaci se serverem" + +msgid "password for IRC server" +msgstr "heslo pro IRC server" + +#, fuzzy +msgid "nicknames to use on IRC server (separated by comma)" +msgstr "přezdívka použitá na IRC serveru" + +msgid "user name to use on IRC server" +msgstr "uživatelské jméno použité na IRC serveru" + +msgid "real name to use on IRC server" +msgstr "skutečné jméno použité na IRC serveru" + +msgid "" +"custom hostname/IP for server (optional, if empty local hostname is used)" +msgstr "" +"vlastní jméno hosta/IP pro server (nepovinné, pokud je volné použije se " +"lokální jméno hosta)" + +msgid "" +"command(s) to run when connected to server (many commands should be " +"separated by ';', use '\\;' for a semicolon, special variables $nick, " +"$channel and $server are replaced by their value)" +msgstr "" +"příkaz(y), které provést po přípojení k serveru (více příkazů se odděluje " +"pomocí ';', použijte '\\;' pro středník, speciální proměnné $nick, $channel " +"a $server jsou přepsány svou hodnotou)" + +msgid "" +"delay (in seconds) after command was executed (example: give some time for " +"authentication)" +msgstr "" +"počkání (v sekundách) po spuštění příkazu (například: dád nějaký čas pro " +"autorizaci)" + +msgid "" +"comma separated list of channels to join when connected to server (example: " +"\"#chan1,#chan2,#chan3 key1,key2\")" +msgstr "" +"čárkou rozdělený seznam kanálů na které přistoupit po připojení na server " +"(příklad: \"#kanál1,#kanál2,#kanál3 klíč1,klíč2\")" + +msgid "automatically rejoin channels when kicked" +msgstr "automaticky znovu přijít na kanál po vykopnutí" + +msgid "" +"comma separated list of notify levels for channels of this server (format: " +"#channel:1,..), a channel name '*' is reserved for server default notify " +"level" +msgstr "" +"čárkou oddělený seznam levelů upozornění pro kanály na tomto serveru " +"(formát: #kanál:1,..), jméno serveru '*' je rezervováno pro defaultní " +"hodnotu levelu upozornění" #, fuzzy, c-format -msgid "%s%s: error creating server for reading configuration file" -msgstr "říct serveru, aby znovu načetl svůj konfigurační soubor" +msgid "%s%s: error creating server option \"%s\"" +msgstr "%s nedostatek paměti pro infobar zprávu\n" msgid "use same buffer for all servers" msgstr "pužít stejný buffer pro všechny servery" @@ -3087,6 +3145,16 @@ msgstr "zobrazit zprávu, když označen/odznačen jako nepřítomen" msgid "show remote away message only once in private" msgstr "zobrazit vzdálený zprávu o nepřítomnosti pouze jednou v soukromém okně" +msgid "display notices as private messages" +msgstr "zobrazit upozornění jako soukromé zprávy" + +msgid "" +"comma separated list of words to highlight (case insensitive comparison, " +"words may begin or end with \"*\" for partial match)" +msgstr "" +"čárkou oddělený seznam slov pro zvýraznění (neporovnává se velikost písmen, " +"slova mohou začínat nebo končit \"*\" pro částečnou schodu)" + msgid "" "default part message (leaving channel) ('%v' will be replaced by WeeChat " "version in string)" @@ -3094,8 +3162,12 @@ msgstr "" "výchozí zpráva při odchodu z kanálu ('%v' bude nahrazeno verzí WeeChat v " "řetězci)" -msgid "display notices as private messages" -msgstr "zobrazit upozornění jako soukromé zprávy" +#, fuzzy +msgid "" +"default quit message (disconnecting from server) ('%v' will be replaced by " +"WeeChat version in string)" +msgstr "" +"výchozí zpráva při uknočnení ('%v' bude nahrazeno verzí WeeChat v řetězci)" msgid "interval between two checks for away (in minutes, 0 = never check)" msgstr "" @@ -3125,13 +3197,6 @@ msgstr "" "anti-flood: počet sekund mezi dvěmi uživatelovými zprávami (0 = vypnutí anti-" "flood)" -msgid "" -"comma separated list of words to highlight (case insensitive comparison, " -"words may begin or end with \"*\" for partial match)" -msgstr "" -"čárkou oddělený seznam slov pro zvýraznění (neporovnává se velikost písmen, " -"slova mohou začínat nebo končit \"*\" pro částečnou schodu)" - msgid "when off, colors codes are ignored in incoming messages" msgstr "pokud je off, jsou barvy v příchozích zprávách ignorovány" @@ -3211,82 +3276,6 @@ msgstr "automaticky logovat soukromé rozhovory" msgid "hide password displayed by nickserv" msgstr "schovat heslo zobrazené nickservem" -msgid "name associated to IRC server (for display only)" -msgstr "jméno asociované k IRC serveru (pouze pro zobrazení)" - -msgid "automatically connect to server when WeeChat is starting" -msgstr "automaticky připojit k serveru, když je WeeChat spouštěn" - -msgid "automatically reconnect to server when disconnected" -msgstr "automaticky znovu připojit server, když je odpojen" - -msgid "delay (in seconds) before trying again to reconnect to server" -msgstr "doba (v sekundách) před novým zkušením znovupřipojení na server" - -#, fuzzy -msgid "list of IP/port or hostname/port for server (separated by comma)" -msgstr "přezdívka použitá na IRC serveru" - -msgid "use IPv6 protocol for server communication" -msgstr "použít protokol IPv6 pro komunikaci se serverem" - -msgid "use SSL for server communication" -msgstr "použít SSL pro komunikaci se serverem" - -msgid "password for IRC server" -msgstr "heslo pro IRC server" - -#, fuzzy -msgid "nicknames to use on IRC server (separated by comma)" -msgstr "přezdívka použitá na IRC serveru" - -msgid "user name to use on IRC server" -msgstr "uživatelské jméno použité na IRC serveru" - -msgid "real name to use on IRC server" -msgstr "skutečné jméno použité na IRC serveru" - -msgid "" -"custom hostname/IP for server (optional, if empty local hostname is used)" -msgstr "" -"vlastní jméno hosta/IP pro server (nepovinné, pokud je volné použije se " -"lokální jméno hosta)" - -msgid "" -"command(s) to run when connected to server (many commands should be " -"separated by ';', use '\\;' for a semicolon, special variables $nick, " -"$channel and $server are replaced by their value)" -msgstr "" -"příkaz(y), které provést po přípojení k serveru (více příkazů se odděluje " -"pomocí ';', použijte '\\;' pro středník, speciální proměnné $nick, $channel " -"a $server jsou přepsány svou hodnotou)" - -msgid "" -"delay (in seconds) after command was executed (example: give some time for " -"authentication)" -msgstr "" -"počkání (v sekundách) po spuštění příkazu (například: dád nějaký čas pro " -"autorizaci)" - -msgid "" -"comma separated list of channels to join when connected to server (example: " -"\"#chan1,#chan2,#chan3 key1,key2\")" -msgstr "" -"čárkou rozdělený seznam kanálů na které přistoupit po připojení na server " -"(příklad: \"#kanál1,#kanál2,#kanál3 klíč1,klíč2\")" - -msgid "automatically rejoin channels when kicked" -msgstr "automaticky znovu přijít na kanál po vykopnutí" - -msgid "" -"comma separated list of notify levels for channels of this server (format: " -"#channel:1,..), a channel name '*' is reserved for server default notify " -"level" -msgstr "" -"čárkou oddělený seznam levelů upozornění pro kanály na tomto serveru " -"(formát: #kanál:1,..), jméno serveru '*' je rezervováno pro defaultní " -"hodnotu levelu upozornění" - msgid "Waiting" msgstr "Čekám" @@ -3793,7 +3782,7 @@ msgstr "" "serverem!\n" #, fuzzy, c-format -msgid "%s%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" +msgid "%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" msgstr "" "%s: přezdívka \"%s\" je již používaná, zkouším druhou přezdívku \"%s\"\n" @@ -4136,15 +4125,15 @@ msgid "%s%s: cannot read data from socket, disconnecting from server..." msgstr "%s nemůžu přečíst data ze soketu, odpojuji se od serveru...\n" #, fuzzy, c-format -msgid "%s%s: lag is high, disconnecting from server..." +msgid "%s: lag is high, disconnecting from server..." msgstr "%s zpoždění je veliké, odpojuji se od serveru...\n" #, fuzzy, c-format -msgid "%s%s: reconnecting to server in %d %s" +msgid "%s: reconnecting to server in %d %s" msgstr "%s: Navazuji nové spojení se serverem za %d sekund\n" #, fuzzy, c-format -msgid "%s%s: switching address to %s/%d" +msgid "%s: switching address to %s/%d" msgstr "%s IP adresa nenalezena\n" #, fuzzy, c-format @@ -4187,6 +4176,14 @@ msgstr "" msgid "%s%s: unable to set local hostname/IP" msgstr "%s nemohu nastavit lokální hostname/IP\n" +#, c-format +msgid "%s%s: addresses not defined for server \"%s\", cannot connect" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: nicks not defined for server \"%s\", cannot connect" +msgstr "%s přezdívka \"%s\" nebyla nalezena pro příkaz \"%s\"\n" + #, fuzzy, c-format msgid "" "%s%s: cannot connect with SSL since WeeChat was not built with GnuTLS support" @@ -4195,7 +4192,7 @@ msgstr "" "GNUtls\n" #, fuzzy, c-format -msgid "%s%s: connecting to server %s/%d%s%s via %s proxy %s/%d%s..." +msgid "%s: connecting to server %s/%d%s%s via %s proxy %s/%d%s..." msgstr "%s: připojuji se k serveru %s:%d%s%s přes %s proxy %s:%d%s...\n" #, fuzzy, c-format @@ -4203,10 +4200,6 @@ msgid "Connecting to server %s/%d%s%s via %s proxy %s/%d%s..." msgstr "Připojuji se k serveru %s:%d%s%s přes %s proxy %s:%d%s...\n" #, fuzzy, c-format -msgid "%s%s: connecting to server %s/%d%s%s..." -msgstr "%s: připojuji se k serveru %s:%d%s%s...\n" - -#, fuzzy, c-format msgid "%s: connecting to server %s/%d%s%s..." msgstr "%s: připojuji se k serveru %s:%d%s%s...\n" @@ -4231,11 +4224,11 @@ msgid "%s%s: cannot set socket option \"SO_KEEPALIVE\"" msgstr "%s nemohu nastavit nastavení soketu \"SO_KEEPALIVE\"\n" #, fuzzy, c-format -msgid "%s%s: reconnecting to server..." +msgid "%s: reconnecting to server..." msgstr "%s: Připojuji se znovu k serveru...\n" #, fuzzy, c-format -msgid "%s%s: disconnected from server" +msgid "%s: disconnected from server" msgstr "Odpojen od serveru!\n" #, fuzzy, c-format @@ -4292,13 +4285,17 @@ msgid "%sError: unable to load plugin \"%s\" (not enough memory)" msgstr "%s nemohu načíst plugin \"%s\" (nedostatek paměti)\n" #, fuzzy, c-format -msgid "%sPlugin \"%s\" loaded" +msgid "Plugin \"%s\" loaded" msgstr "Plugin \"%s\" odebrán.\n" #, fuzzy, c-format -msgid "%sPlugin \"%s\" unloaded" +msgid "Plugin \"%s\" unloaded" msgstr "Plugin \"%s\" odebrán.\n" +#, fuzzy, c-format +msgid "%sError: plugin \"%s\" not found" +msgstr "%s plugin \"%s\" nenalezen\n" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " @@ -4306,7 +4303,7 @@ msgid "" msgstr "" #, c-format -msgid "%s%s: registered script \"%s\", version %s (%s)" +msgid "%s: registered script \"%s\", version %s (%s)" msgstr "" #, fuzzy, c-format @@ -4322,7 +4319,7 @@ msgid "%s%s: script \"%s\" not found" msgstr "%s server \"%s\" nenalezen\n" #, fuzzy, c-format -msgid "%s%s: loading script \"%s\"" +msgid "%s: loading script \"%s\"" msgstr "sezeni: načítám server \"%s\"\n" #, fuzzy, c-format @@ -4348,11 +4345,11 @@ msgstr "" "selhalo\n" #, fuzzy, c-format -msgid "%s%s: unloading script \"%s\"" +msgid "%s: unloading script \"%s\"" msgstr "sezeni: načítám server \"%s\"\n" #, fuzzy, c-format -msgid "%s%s: script \"%s\" unloaded" +msgid "%s: script \"%s\" unloaded" msgstr "Plugin \"%s\" odebrán.\n" #, fuzzy, c-format @@ -4518,6 +4515,132 @@ msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s špatné parametry pro příkaz \"%s\"\n" #, fuzzy +#~ msgid "# %s, created by %s v%s on %s#\n" +#~ msgstr "" +#~ "#\n" +#~ "# %s konfigurační soubor, vytvořil %s v%s %s" + +#, fuzzy +#~ msgid "No configuration option found with \"%s\"" +#~ msgstr "Nebyla nalezena žádná volba nastavení s \"%s\"\n" + +#~ msgid "" +#~ "option: name of an option (if name is full and no value is given, then " +#~ "help is displayed on option)\n" +#~ " value: value for option\n" +#~ "\n" +#~ "Option may be: servername.server_xxx where \"servername\" is an internal " +#~ "server name and \"xxx\" an option for this server." +#~ msgstr "" +#~ "možnost: jméno možnosti (pokud je jméno celé a není předána žádná " +#~ "hodnota, pak je zobrazena nápověda pro tuto možnost)\n" +#~ "hodnota: hodnota volby\n" +#~ "\n" +#~ "Možnost může být: jmenoserveru.server_xxx kde \"jmenoserveru\" je vnitřní " +#~ "jméno serveru a \"xxx\" je možnost tohoto serveru." + +#, fuzzy +#~ msgid "%s%s: error creating charset (%s) \"%s\" => \"%s\"" +#~ msgstr "%s nedostatek paměti pro infobar zprávu\n" + +#, fuzzy +#~ msgid "%sCharset \"%s\" not found" +#~ msgstr "%s server \"%s\" nenalezen\n" + +#, fuzzy +#~ msgid "List of charsets:" +#~ msgstr "Seznam pro aliasy:\n" + +#, fuzzy +#~ msgid "List of charsets with \"%s\":" +#~ msgstr "Seznam pro aliasy:\n" + +#, fuzzy +#~ msgid "No charset found" +#~ msgstr "Žádná klávesa nenalezena.\n" + +#, fuzzy +#~ msgid "No charset defined" +#~ msgstr "Žádné aliasy nejsou definovány.\n" + +#, fuzzy +#~ msgid "manage charsets" +#~ msgstr "řídit buffery" + +#, fuzzy +#~ msgid "%s%s: value \"%s\" is invalid for option \"%s\"" +#~ msgstr "%s %s, řádek %d: nevalidní volba \"%s\"\n" + +#, fuzzy +#~ msgid "%s%s: error creating server for reading configuration file" +#~ msgstr "říct serveru, aby znovu načetl svůj konfigurační soubor" + +#~ msgid "name associated to IRC server (for display only)" +#~ msgstr "jméno asociované k IRC serveru (pouze pro zobrazení)" + +#, fuzzy +#~ msgid "Option changed: " +#~ msgstr "není na kanále" + +#, fuzzy +#~ msgid "%sError: incorrect value for option \"%s\"" +#~ msgstr "%s nekorektní hodnota pro volbu \"%s\"\n" + +#, fuzzy +#~ msgid "No plugin option found with \"%s\"" +#~ msgstr "Nebyla nalezena žádná možnost pluginu s \"%s\"\n" + +#, fuzzy +#~ msgid "No plugin option found" +#~ msgstr "Nebyla nalezena žádná možnost pluginu\n" + +#, fuzzy +#~ msgid "%s%d%s plugin option found with \"%s\"" +#~ msgid_plural "%s%d%s plugin options found with \"%s\"" +#~ msgstr[0] "Nebyla nalezena žádná možnost pluginu s \"%s\"\n" +#~ msgstr[1] "Nebyla nalezena žádná možnost pluginu s \"%s\"\n" + +#, fuzzy +#~ msgid "%s%d%s plugin option found" +#~ msgid_plural "%s%d%s plugin options found" +#~ msgstr[0] "Nebyla nalezena žádná možnost pluginu\n" +#~ msgstr[1] "Nebyla nalezena žádná možnost pluginu\n" + +#, fuzzy +#~ msgid "Plugin option changed: %s%s = \"%s%s%s\"" +#~ msgstr "Nebyla nalezena žádná možnost pluginu s \"%s\"\n" + +#, fuzzy +#~ msgid "%sError: incorrect value for plugin option \"%s\"" +#~ msgstr "%s nekorektní hodnota pro možnost pluginu \"%s\"\n" + +#~ msgid "set plugin config options" +#~ msgstr "nastaví konfigurační možností pluginu" + +#~ msgid "" +#~ "option: name of a plugin option\n" +#~ " value: value for option\n" +#~ "\n" +#~ "Option is format: plugin.option, example: perl.myscript.item1" +#~ msgstr "" +#~ "možnost: jméno možnosti pluginu\n" +#~ "hodnota: hodnota možnosti\n" +#~ "\n" +#~ "Formát možnosti je: plugin.možnost, příklad: perl.mujskript.polozka1" + +#, fuzzy +#~ msgid "prefix for info messages" +#~ msgstr "barva okna s novými zprávami" + +#, fuzzy +#~ msgid "text color for info prefix" +#~ msgstr "barva textu v info baru" + +#, fuzzy +#~ msgid "%s%s: connecting to server %s/%d%s%s..." +#~ msgstr "%s: připojuji se k serveru %s:%d%s%s...\n" + +#, fuzzy #~ msgid "%s[%sF%s%s%s]" #~ msgstr "%s[%s%s%s]%s nečinný: " @@ -4570,10 +4693,6 @@ msgstr "%s špatné parametry pro příkaz \"%s\"\n" #~ msgstr "%s%s %s(%s%s@%s%s)%s byl %s\n" #, fuzzy -#~ msgid "Notice from %s%s%s: %s" -#~ msgstr "Přezdívkz %s%s%s: %s[" - -#, fuzzy #~ msgid "Notice: %s" #~ msgstr "voices" @@ -5236,9 +5355,6 @@ msgstr "%s špatné parametry pro příkaz \"%s\"\n" #~ msgid "server name not found for buffer" #~ msgstr "nenalezeno jméno serveru pro buffer" -#~ msgid "channel name not found for buffer" -#~ msgstr "nenalezeno jméno kanálu pro buffer" - #~ msgid "buffer type not found" #~ msgstr "typ bufferu nenalezen" @@ -5781,27 +5897,12 @@ msgstr "%s špatné parametry pro příkaz \"%s\"\n" #~ msgid "%sDetail:\n" #~ msgstr "%sDetail:\n" -#~ msgid " . type boolean (values: 'on' or 'off')\n" -#~ msgstr " . typ boolean (hodnota: 'on' nebo 'off')\n" - -#~ msgid " . type integer (values: between %d and %d)\n" -#~ msgstr " . typ celočíselný (hodnoty: mezi %d a %d)\n" - #~ msgid " . type string (values: " #~ msgstr " . typ řetězec (hodnoty: " #~ msgid " . type color (Curses or Gtk color, look at WeeChat doc)\n" #~ msgstr " . typ barva (Curses nebo Gtk barva, viz WeeChat dokumentace)\n" -#~ msgid " . type string (any string)\n" -#~ msgstr " . typ řetězec (jakýkoliv řetězec)\n" - -#~ msgid " . type: char (any char)\n" -#~ msgstr " . typ: znak (jakýkoliv znak)\n" - -#~ msgid " . type string (any string, limit: %d chars)\n" -#~ msgstr " . typ řetězec (jakýkoliv řetězec, limit: %d znaků)\n" - #~ msgid "%s%d%s ignore was removed.\n" #~ msgid_plural "%s%d%s ignore were removed.\n" #~ msgstr[0] "%s%d%s ignorování bylo odebráno\n" @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-04-03 18:09+0200\n" +"POT-Creation-Date: 2008-04-11 18:29+0200\n" "PO-Revision-Date: 2007-09-06 12:44+0200\n" "Last-Translator: Thomas Schuetz <i18n@internet-villa.de>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -65,12 +65,12 @@ msgstr "" " -v, --version zeigt die WeeChat-Version an\n" " -w, --weechat-commands zeigt die WeeChat-Befehle an\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, fuzzy, c-format msgid "%s configuration options:\n" msgstr "Konfigurationsparameter setzen" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s internal commands:\n" msgstr "%s interne Befehle:\n" @@ -78,7 +78,7 @@ msgstr "%s interne Befehle:\n" msgid "Internal key functions:\n" msgstr "Interne Tastenfunktionen:\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s default keys:\n" msgstr "%s Standardtastenbelegungen:\n" @@ -207,7 +207,7 @@ msgid "%sError: incorrect notify level (must be between %d and %d)" msgstr "%s ungültige Notify-Ebene (muss zwischen %d und %d liegen)\n" #, fuzzy, c-format -msgid "%sNew notify level for %s%s%s: %d %s" +msgid "New notify level for %s%s%s: %d %s" msgstr "Neue Notify-Ebenen für: %s%s%s: %s%d %s" #, fuzzy @@ -276,7 +276,7 @@ msgstr "%s Plugin \"%s\" nicht gefunden\n" msgid "%sError: wrong filter number" msgstr "%s falsche Puffernummer\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, fuzzy, c-format msgid "%s internal commands:" msgstr "%s interne Befehle:\n" @@ -298,7 +298,51 @@ msgid "plugin:" msgstr " (kein Plugin)\n" #, fuzzy, c-format -msgid "%sNo help available, \"%s\" is an unknown command" +msgid "Option \"%s%s%s\": %s" +msgstr "Nicks %s%s%s: %s[" + +#, fuzzy +msgid " type: boolean ('on' or 'off')" +msgstr " . boolesche Werte ('on' or 'off')\n" + +#, c-format +msgid " value: %s%s%s (default: %s)" +msgstr "" + +#, fuzzy, c-format +msgid " type: string (%s)" +msgstr " . Typ: Zeichenfolge\n" + +#, c-format +msgid " value: '%s%s%s' (default: '%s')" +msgstr "" + +#, fuzzy, c-format +msgid " type: integer (between %d and %d)" +msgstr " . Ganzzahl (Werte zwischen %d und %d)\n" + +#, c-format +msgid " value: %s%d%s (default: %d)" +msgstr "" + +#, fuzzy +msgid " type: string (any string)" +msgstr " . Zeichenfolge (beliebig)\n" + +#, fuzzy +msgid " type: char (any char)" +msgstr " . Zeichenfolge (beliebig)\n" + +#, fuzzy, c-format +msgid " type: string (limit: %d chars)" +msgstr " . Zeichenfolge (beliebig)\n" + +#, fuzzy +msgid " type: color (values depend on GUI used)" +msgstr " . Werte: zwischen %d und %d\n" + +#, fuzzy, c-format +msgid "%sNo help available, \"%s\" is not a command or an option" msgstr "Keine Hilfe verfügbar, der Befehl \"%s\" ist unbekannt\n" #, fuzzy @@ -306,7 +350,7 @@ msgid "Buffer command history:" msgstr "zeigt Befehlsverlauf des Puffers" #, fuzzy, c-format -msgid "%sNew key binding: %s%s => %s%s%s%s%s" +msgid "New key binding: %s%s => %s%s%s%s%s" msgstr "Neue Tastenbelegung: %s" #, fuzzy @@ -317,8 +361,8 @@ msgstr "Tastenbelegungen:\n" msgid "Internal key functions:" msgstr "Interne Tastenfunktionen:\n" -#, fuzzy, c-format -msgid "%sDefault key bindings restored" +#, fuzzy +msgid "Default key bindings restored" msgstr "Standardtastenbelegungen wiederhergestellt\n" #, fuzzy, c-format @@ -328,7 +372,7 @@ msgstr "" "notwendig\n" #, fuzzy, c-format -msgid "%sKey \"%s\" unbound" +msgid "Key \"%s\" unbound" msgstr "Tastenbelegung \"%s\" gelöscht\n" #, fuzzy, c-format @@ -447,7 +491,7 @@ msgid "%sError: wrong argument count for \"%s\" command" msgstr "%s fehlerhafte Anzahl von Argumenten für der \"%s\"-Befehl\n" #, fuzzy, c-format -msgid "%sOptions reloaded from %s" +msgid "Options reloaded from %s" msgstr "Plugin-Optionen gesichert\n" #, fuzzy, c-format @@ -455,11 +499,11 @@ msgid "%sError: failed to reload options from %s" msgstr "%s konnte die Plugin-Konfigurationsdatei nicht sichern\n" #, fuzzy, c-format -msgid "%sUnknown configuration file \"%s\"" +msgid "Unknown configuration file \"%s\"" msgstr "den Server dazu bringen, seine Konfigurationsdatei neu zu laden" #, fuzzy, c-format -msgid "%sOptions saved to %s" +msgid "Options saved to %s" msgstr "Plugin-Optionen gesichert\n" #, fuzzy, c-format @@ -469,17 +513,19 @@ msgstr "%s konnte die Plugin-Konfigurationsdatei nicht sichern\n" msgid "(unknown)" msgstr "(unbekannt)" -#, fuzzy, c-format -msgid "No configuration option found with \"%s\"" -msgstr "Keine Konfigurationsoptionen mit \"%s\" gefunden\n" +#, c-format +msgid "" +"%sOption \"%s\" not found (tip: you can use \"*\" at beginning and/or end of " +"option to see a sublist)" +msgstr "" #, fuzzy msgid "No configuration option found" msgstr "Keine Konfigurationsoption gefunden\n" #, fuzzy, c-format -msgid "%s%d%s configuration option found with \"%s\"" -msgid_plural "%s%d%s configuration options found with \"%s\"" +msgid "%s%d%s configuration option found matching with \"%s\"" +msgid_plural "%s%d%s configuration options found matching with \"%s\"" msgstr[0] "Konfigurationsoption(en) gefunden mit \"%s\"\n" msgstr[1] "Konfigurationsoption(en) gefunden mit \"%s\"\n" @@ -490,48 +536,28 @@ msgstr[0] "Konfigurationsoption(en) gefunden\n" msgstr[1] "Konfigurationsoption(en) gefunden\n" #, fuzzy, c-format +msgid "%sError: failed to set option \"%s\"" +msgstr "%s konnte die Plugin-Konfigurationsdatei nicht sichern\n" + +#, fuzzy, c-format msgid "%sError: configuration option \"%s\" not found" msgstr "%s Konfigurationsoption \"%s\" nicht gefunden\n" #, fuzzy -msgid "Option changed: " +msgid "Option changed" msgstr "Sie sind nicht im Channel" #, fuzzy, c-format -msgid "%sError: incorrect value for option \"%s\"" -msgstr "%s ungültiger Wert für die Option \"%s\"\n" - -#, fuzzy, c-format -msgid "No plugin option found with \"%s\"" -msgstr "Keine Plugin-Optionen mit \"%s\" gefunden\n" - -#, fuzzy -msgid "No plugin option found" -msgstr "Keine Plugin-Option gefunden\n" - -#, fuzzy, c-format -msgid "%s%d%s plugin option found with \"%s\"" -msgid_plural "%s%d%s plugin options found with \"%s\"" -msgstr[0] "Keine Plugin-Optionen mit \"%s\" gefunden\n" -msgstr[1] "Keine Plugin-Optionen mit \"%s\" gefunden\n" - -#, fuzzy, c-format -msgid "%s%d%s plugin option found" -msgid_plural "%s%d%s plugin options found" -msgstr[0] "Keine Plugin-Option gefunden\n" -msgstr[1] "Keine Plugin-Option gefunden\n" - -#, fuzzy, c-format -msgid "%sError: plugin \"%s\" not found" +msgid "%sOption not found" msgstr "%s Plugin \"%s\" nicht gefunden\n" -#, fuzzy, c-format -msgid "Plugin option changed: %s%s = \"%s%s%s\"" -msgstr "Keine Plugin-Optionen mit \"%s\" gefunden\n" +#, fuzzy +msgid "Option reset" +msgstr "Plugin-Optionen gesichert\n" -#, fuzzy, c-format -msgid "%sError: incorrect value for plugin option \"%s\"" -msgstr "%s ungültiger Wert für die Plugin-Option \"%s\"\n" +#, fuzzy +msgid "Option removed" +msgstr "Sie sind nicht im Channel" #, c-format msgid "WeeChat uptime: %d %s %02d:%02d:%02d, started on %s" @@ -678,13 +704,18 @@ msgid "" "from message)" msgstr "" -msgid "display help about commands" +#, fuzzy +msgid "display help about commands and options" msgstr "Hilfe zu Befehlen abfragen" -msgid "[command]" +#, fuzzy +msgid "[command | option]" msgstr "[Befehl]" -msgid "command: name of a WeeChat or IRC command" +#, fuzzy +msgid "" +"command: a command name\n" +" option: an option name (use /set to see list)" msgstr "Befehl: Name eines WeeChat- oder IRC-Befehls" msgid "show buffer command history" @@ -792,33 +823,24 @@ msgid "[option [ = value]]" msgstr "[Option [ = Wert]]" msgid "" -"option: name of an option (if name is full and no value is given, then help " -"is displayed on option)\n" -" value: value for option\n" -"\n" -"Option may be: servername.server_xxx where \"servername\" is an internal " -"server name and \"xxx\" an option for this server." +"option: name of an option\n" +" value: value for option" msgstr "" -"Option: Name einer Option (wenn der Name vorhanden ist, aber kein Wert, dann " -"wird eine Hilfe zur Option ausgegeben\n" -" Wert: Wert der Option\n" -"\n" -"Option kann Servername.server_xxx lauten, wobei \"Servername\" der interne " -"Servername ist und \"xxx\" eine Option für diesen Server." -msgid "set plugin config options" -msgstr "Konfigurationsparameter für Plugin setzen" +#, fuzzy +msgid "unset/reset config options" +msgstr "Konfigurationsparameter setzen" + +#, fuzzy +msgid "[option]" +msgstr "[Befehl]" msgid "" -"option: name of a plugin option\n" -" value: value for option\n" +"option: name of an option\n" "\n" -"Option is format: plugin.option, example: perl.myscript.item1" +"According to option, it's reset (for standard options) or removed (for " +"optional settings, like server values)." msgstr "" -"Option: Name einer Plugin-Option\n" -" Wert: Wert für Option\n" -"\n" -"Option wird wie folgt formatiert: Plugin.Option, z.B. perl.myscript.item1" msgid "upgrade WeeChat without disconnecting from servers" msgstr "aktualisiert WeeChat ohne die Verbindung zum Server zu trennen" @@ -918,6 +940,9 @@ msgstr "" msgid "command executed when WeeChat starts, after loading plugins" msgstr "" +msgid "WeeChat slogan (if empty, slogan is not used)" +msgstr "WeeChat-Slogan (wenn leer, wird keiner benutzt)" + msgid "" "if set, uses real white color, disabled by default for terms with white " "background (if you never use white background, you should turn on this " @@ -936,9 +961,6 @@ msgid "set title for window (terminal for Curses GUI) with name and version" msgstr "" "Fenstertitel setzen (oder Terminaltitel im Curses-GUI) mit Name und Version" -msgid "WeeChat slogan (if empty, slogan is not used)" -msgstr "WeeChat-Slogan (wenn leer, wird keiner benutzt)" - msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "Anzahl der zu scrollenden Zeilen bei Bild-Hoch- und Bild-Runter-Taste" @@ -983,10 +1005,6 @@ msgid "display space if nick mode is not (half)op/voice" msgstr "Leerzeichen anzeigen wenn Nickmode nicht @%+ ist" #, fuzzy -msgid "prefix for info messages" -msgstr "Farbe eines Fensters mit neuen Messages" - -#, fuzzy msgid "prefix for error messages" msgstr "Debugging-Nachricht ausgeben" @@ -1086,11 +1104,6 @@ msgid "" "max number of lines for paste without asking user (0 = disable this feature)" msgstr "maximale Nick-Anzahl für Abwesenheitsüberprüfung" -msgid "" -"default quit message ('%v' will be replaced by WeeChat version in string)" -msgstr "" -"Standardnachricht beim Beenden ('%v' wird durch die WeeChat-Version ersetzt)" - #, fuzzy msgid "background color for window separators (when splited)" msgstr "" @@ -1125,10 +1138,6 @@ msgid "text color for time delimiters" msgstr "Farbe der Infobar-Trennzeichen" #, fuzzy -msgid "text color for info prefix" -msgstr "Farbe des Infobar-Textes" - -#, fuzzy msgid "text color for error prefix" msgstr "Farbe des join-Pfeiles (Präfix)" @@ -1482,14 +1491,6 @@ msgid "(default options)" msgstr "" #, fuzzy, c-format -msgid "" -"#\n" -"# %s configuration file, created by %s v%s on %s#\n" -msgstr "" -"#\n" -"# %s Konfigurationsdatei, erstellt von %s v%s auf %s " - -#, fuzzy, c-format msgid "%sWarning: config file \"%s\" not found" msgstr "%s Konfigurationsdatei \"%s\" nicht gefunden.\n" @@ -1863,15 +1864,15 @@ msgid "%s%s: error creating alias \"%s\" => \"%s\"" msgstr "%s nicht genügend Speicher für Infobar-Nachricht\n" #, fuzzy, c-format -msgid "%sAlias \"%s\" => \"%s\" created" +msgid "Alias \"%s\" => \"%s\" created" msgstr "Alias \"%s\" => \"%s\" angelegt\n" #, fuzzy msgid "Alias:" msgstr "Alias:\n" -#, fuzzy, c-format -msgid "%sNo alias found." +#, fuzzy +msgid "No alias found" msgstr "Keine Aliases gefunden.\n" #, fuzzy @@ -1887,7 +1888,7 @@ msgid "%sAlias \"%s\" not found" msgstr "%s Adresse \"%s\" nicht gefunden\n" #, fuzzy, c-format -msgid "%sAlias \"%s\" removed" +msgid "Alias \"%s\" removed" msgstr "Alias \"%s\" entfernt\n" msgid "create an alias for a command" @@ -1927,67 +1928,63 @@ msgid "alias_name: name of alias to remove" msgstr "Aliasname: Name des zu löschenden Aliases" #, fuzzy, c-format +msgid "%s: debug enabled" +msgstr "FIFO ist offen\n" + +#, c-format +msgid "%s: debug disabled" +msgstr "" + +#, fuzzy, c-format msgid "%s%s: error creating charset \"%s\" => \"%s\"" msgstr "%s nicht genügend Speicher für Infobar-Nachricht\n" -#, fuzzy, c-format -msgid "%sCharset \"%s\" => \"%s\"" -msgstr "Alias \"%s\" => \"%s\" angelegt\n" +msgid "global decoding charset" +msgstr "" + +msgid "global encoding charset" +msgstr "" #, fuzzy, c-format -msgid "%s%s: charset \"%s\" not found" -msgstr "%s Server \"%s\" nicht gefunden\n" +msgid "Charset: %s, %s => %s" +msgstr "Alias \"%s\" => \"%s\" angelegt\n" #, fuzzy, c-format -msgid "%sCharset \"%s\" removed" +msgid "Charset: %s, %s: removed" msgstr "Alias \"%s\" entfernt\n" -#, fuzzy -msgid "List of charsets:" -msgstr "Liste der Aliases:\n" - #, fuzzy, c-format -msgid "List of charsets with \"%s\":" -msgstr "Liste der Aliases:\n" +msgid "%s%s: missing parameters" +msgstr "%s fehlende Argumente für die \"--dir\"-Option\n" -#, fuzzy -msgid "No charset found" -msgstr "Keine Taste gefunden.\n" +#, c-format +msgid "%s%s: wrong charset type (decode or encode expected)" +msgstr "" -#, fuzzy -msgid "No charset defined" -msgstr "Keine Aliases definiert.\n" +#, fuzzy, c-format +msgid "%s%s: invalid charset: \"%s\"" +msgstr "Kann das Logfile nicht schreiben\n" #, fuzzy, c-format -msgid "%s%s: terminal: %s, internal: %s" +msgid "%s: terminal: %s, internal: %s" msgstr "%s Plugin \"%s\" nicht gefunden\n" #, fuzzy, c-format -msgid "%s%s: error creating configuration file \"%s\"" +msgid "%s%s: error creating configuration file" msgstr "den Server dazu bringen, seine Konfigurationsdatei neu zu laden" #, fuzzy -msgid "manage charsets" -msgstr "Puffer verwalten" +msgid "change charset for current buffer" +msgstr "Channelnamen für den Puffer nicht gefunden" -msgid "[[type.]plugin.string [= charset]]" +msgid "[[decode | encode] charset] | [reset]" msgstr "" msgid "" -" type: \"decode\" or \"encode\" (if type is omitted, then both \"decode\" " -"and \"encode\" are set)\n" -" plugin: plugin name\n" -" string: string specific to plugin (for example a server name or server." -"channel for IRC plugin)\n" -"charset: charset to use (if empty, then charset is removed)\n" -"\n" -"Examples :\n" -"/charset decode iso-8859-15 => set global decode charset to iso-8859-15\n" -"/charset encode iso-8859-15 => set global encode charset to iso-8859-15\n" -"/charset decode.irc.freenode => set decode charset to iso-8859-15 for IRC " -"server \"freenode\" (all channels)\n" -"/charset decode.irc.freenode.#weechat => set decode charset to iso-8859-15 " -"for IRC channel \"#weechat\" on server \"freenode\"" +" decode: change decoding charset\n" +" encode: change encoding charset\n" +"charset: new charset for current buffer\n" +" reset: reset charsets for current buffer" msgstr "" msgid "print debug messages" @@ -2009,22 +2006,10 @@ msgstr "" "Programmabsturz)\n" "windows: zeigt Fensterdaten an" -#, fuzzy, c-format -msgid "%s: debug enabled" -msgstr "FIFO ist offen\n" - -#, c-format -msgid "%s: debug disabled" -msgstr "" - msgid "demo message without prefix" msgstr "" #, c-format -msgid "%sdemo message with info prefix" -msgstr "" - -#, c-format msgid "%sdemo message with error prefix" msgstr "" @@ -2111,7 +2096,7 @@ msgid "" msgstr "" #, fuzzy, c-format -msgid "%s%s: pipe open" +msgid "%s: pipe open" msgstr "FIFO ist offen\n" #, fuzzy, c-format @@ -2123,7 +2108,7 @@ msgid "%s%s: unable to create pipe for remote control (%s)" msgstr "%s kann die FIFO-Pipe zur Fernsteuerung nicht anlegen (%s)\n" #, fuzzy, c-format -msgid "%s%s: pipe closed" +msgid "%s: pipe closed" msgstr "FIFO geschlossen\n" #, fuzzy, c-format @@ -2152,11 +2137,11 @@ msgstr "" "%s kann keinen Nickname finden, an den die Nachricht gesendet werden soll\n" #, fuzzy, c-format -msgid "%s%s: future away on %s%s%s: %s" +msgid "%s: future away on %s%s%s: %s" msgstr "/ignore-Regel entfernt.\n" #, fuzzy, c-format -msgid "%s%s: future away on %s%s%s removed" +msgid "%s: future away on %s%s%s removed" msgstr "/ignore-Regel entfernt.\n" #, fuzzy, c-format @@ -2176,7 +2161,7 @@ msgid "%s%s: missing argument for \"%s\" option" msgstr "%s fehlende Argumente für die \"--dir\"-Option\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s created (temporary server, NOT SAVED!)" +msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "%s Server \"%s\" nicht gefunden\n" #, fuzzy, c-format @@ -2196,7 +2181,7 @@ msgid "%s%s: not connected to server \"%s\"!" msgstr "%s keine Verbindung zum Server \"%s\"!\n" #, fuzzy, c-format -msgid "%s%s: auto-reconnection is cancelled" +msgid "%s: auto-reconnection is cancelled" msgstr "Automatisches Neuverbinden abgebrochen\n" #, fuzzy, c-format @@ -2249,7 +2234,7 @@ msgstr "" "werden!\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s created" +msgid "%s: server %s%s%s created" msgstr "Server %s%s%s angelegt\n" #, fuzzy, c-format @@ -2265,11 +2250,11 @@ msgid "%s%s: server \"%s\" already exists for \"%s\" command" msgstr "%s Server \"%s\" nicht gefunden für den \"%s\"-Befehl\n" #, fuzzy, c-format -msgid "%s%s: Server %s%s%s has been copied to %s%s" +msgid "%s: server %s%s%s has been copied to %s%s" msgstr "Server %s%s%s wurde gelöscht\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s has been renamed to %s%s" +msgid "%s: server %s%s%s has been renamed to %s%s" msgstr "Server %s%s%s wurde gelöscht\n" #, fuzzy, c-format @@ -2277,7 +2262,7 @@ msgid "%s%s: server \"%s\" is not a temporary server" msgstr "%s Server \"%s\" nicht gefunden\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s is not temporary any more" +msgid "%s: server %s%s%s is not temporary any more" msgstr "%s Server \"%s\" nicht gefunden\n" #, fuzzy, c-format @@ -2289,12 +2274,12 @@ msgstr "" "sind. Probieren Sie /disconnect %s vorher.\n" #, fuzzy, c-format -msgid "%s%s: Server %s%s%s has been deleted" +msgid "%s: Server %s%s%s has been deleted" msgstr "Server %s%s%s wurde gelöscht\n" #, c-format msgid "" -"%s%s: messages outqueue DELETED for all servers. Some messages from you or " +"%s: messages outqueue DELETED for all servers. Some messages from you or " "WeeChat may have been lost!" msgstr "" @@ -3024,23 +3009,99 @@ msgstr "" msgid "%sirc: too few arguments for \"%s\" command" msgstr "%s fehlerhafte Argumente für der \"%s\"-Befehl\n" +#, fuzzy, c-format +msgid "%s%s: error creating server \"%s\"" +msgstr "%s nicht genügend Speicher für Infobar-Nachricht\n" + +#, fuzzy, c-format +msgid "%s%s: error creating option \"%s\" for server \"%s\" (server not found)" +msgstr "%s Konfigurationsoption \"%s\" nicht gefunden\n" + #, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" msgstr "" -#, fuzzy, c-format -msgid "%s%s: value \"%s\" is invalid for option \"%s\"" -msgstr "%s %s, Zeile %d: ungültige Option \"%s\"\n" +msgid "automatically connect to server when WeeChat is starting" +msgstr "automatisch mit dem Server verbinden, wenn WeeChat gestartet wird" -#, fuzzy, c-format -msgid "%s%s: option \"%s\" not found" -msgstr "%s Plugin \"%s\" nicht gefunden\n" +msgid "automatically reconnect to server when disconnected" +msgstr "die Verbindung nach Trennung automatisch wiederherstellen" + +msgid "delay (in seconds) before trying again to reconnect to server" +msgstr "" +"Zeit in Sekunden, die gewartet wird, bevor ein Verbindungsneuaufbau versucht " +"wird" + +#, fuzzy +msgid "list of IP/port or hostname/port for server (separated by comma)" +msgstr "eigener Nickname, der auf dem IRC-Server benutzt werden soll" + +msgid "use IPv6 protocol for server communication" +msgstr "Server über IPv6 ansprechen" + +msgid "use SSL for server communication" +msgstr "Server über SSL ansprechen" + +msgid "password for IRC server" +msgstr "Passwort für den IRC-Server" + +#, fuzzy +msgid "nicknames to use on IRC server (separated by comma)" +msgstr "eigener Nickname, der auf dem IRC-Server benutzt werden soll" + +msgid "user name to use on IRC server" +msgstr "Benutzername, der an den Server übermittelt werden soll" + +msgid "real name to use on IRC server" +msgstr "voller Name, der an den Server übermittelt werden soll" + +msgid "" +"custom hostname/IP for server (optional, if empty local hostname is used)" +msgstr "" +"angepasster Hostname oder angepasste IP-Adresse für den Server (wenn nichts " +"eingetragen ist, wird der lokale Hostname verwendet)" + +msgid "" +"command(s) to run when connected to server (many commands should be " +"separated by ';', use '\\;' for a semicolon, special variables $nick, " +"$channel and $server are replaced by their value)" +msgstr "" +"Befehle, die nach der Verbindung zum Server ausgeführt werden sollen " +"(mehrere Befehle müssen mit einem Semikolon getrennt werden, um ein " +"Semikolon zu schreiben, muss man '\\;' verwenden, die spezielllen Variablen " +"$nick, $channel und $server werden dabei durch den jeweiligen Wert ersetzt)" + +msgid "" +"delay (in seconds) after command was executed (example: give some time for " +"authentication)" +msgstr "" +"Wartezeit in Sekunden nach Ausführung des Befehls, um z.B. eine " +"Authentifizierung zu ermöglichen" + +msgid "" +"comma separated list of channels to join when connected to server (example: " +"\"#chan1,#chan2,#chan3 key1,key2\")" +msgstr "" +"durch Kommata getrennte Liste der Channels, die beim Verbinden zum Server " +"betreten werden sollen (Beispiel: \"#chan1,#chan2,#chan3 key1,key2\")" + +msgid "automatically rejoin channels when kicked" +msgstr "Channels nach Kick automatisch wieder betreten, falls möglich" + +msgid "" +"comma separated list of notify levels for channels of this server (format: " +"#channel:1,..), a channel name '*' is reserved for server default notify " +"level" +msgstr "" +"durch Kommata getrennte Liste der Notify-Levels für die Channels auf diesem " +"Server (Format: #channel:1,...), der Channelname '*' ist für den Default-" +"Server-Notify-Level" #, fuzzy, c-format -msgid "%s%s: error creating server for reading configuration file" -msgstr "den Server dazu bringen, seine Konfigurationsdatei neu zu laden" +msgid "%s%s: error creating server option \"%s\"" +msgstr "%s nicht genügend Speicher für Infobar-Nachricht\n" msgid "use same buffer for all servers" msgstr "benutze den gleichen Puffer für alle Server" @@ -3066,6 +3127,17 @@ msgid "show remote away message only once in private" msgstr "" "in privaten Unterhaltungen nur einmalig eine Abwesenheitsnachricht anzeigen" +msgid "display notices as private messages" +msgstr "NOTICEs als Queries anzeigen" + +msgid "" +"comma separated list of words to highlight (case insensitive comparison, " +"words may begin or end with \"*\" for partial match)" +msgstr "" +"durch Kommata getrennte Liste der hervorzuhebenden Wörter (Groß-/" +"Kleinschreibung wird nicht beachtet, die Wörter können mit \"*\" als Joker " +"beginnen oder enden)" + msgid "" "default part message (leaving channel) ('%v' will be replaced by WeeChat " "version in string)" @@ -3073,8 +3145,12 @@ msgstr "" "Standardnachricht beim Verlasseb eines Channels ('%v' wird durch die WeeChat-" "Version ersetzt)" -msgid "display notices as private messages" -msgstr "NOTICEs als Queries anzeigen" +#, fuzzy +msgid "" +"default quit message (disconnecting from server) ('%v' will be replaced by " +"WeeChat version in string)" +msgstr "" +"Standardnachricht beim Beenden ('%v' wird durch die WeeChat-Version ersetzt)" msgid "interval between two checks for away (in minutes, 0 = never check)" msgstr "Intervall zwischen zwei Away-Checks (in Minuten, 0 = nie überprüfen)" @@ -3101,14 +3177,6 @@ msgstr "" "anti-flood: # Sekunden zwischen zwei Benutzernachrichten (0 = kein anti-" "flood)" -msgid "" -"comma separated list of words to highlight (case insensitive comparison, " -"words may begin or end with \"*\" for partial match)" -msgstr "" -"durch Kommata getrennte Liste der hervorzuhebenden Wörter (Groß-/" -"Kleinschreibung wird nicht beachtet, die Wörter können mit \"*\" als Joker " -"beginnen oder enden)" - msgid "when off, colors codes are ignored in incoming messages" msgstr "" "wenn der Schalter deaktiviert ist, werden die Farben von eingehenden " @@ -3195,85 +3263,6 @@ msgstr "Automatisches Logging von Queries" msgid "hide password displayed by nickserv" msgstr "Von NickServ angezeigte Passwörter verstecken" -msgid "name associated to IRC server (for display only)" -msgstr "mit dem IRC-Server assoziierter eindeutiger Name (nur zur Anzeige)" - -msgid "automatically connect to server when WeeChat is starting" -msgstr "automatisch mit dem Server verbinden, wenn WeeChat gestartet wird" - -msgid "automatically reconnect to server when disconnected" -msgstr "die Verbindung nach Trennung automatisch wiederherstellen" - -msgid "delay (in seconds) before trying again to reconnect to server" -msgstr "" -"Zeit in Sekunden, die gewartet wird, bevor ein Verbindungsneuaufbau versucht " -"wird" - -#, fuzzy -msgid "list of IP/port or hostname/port for server (separated by comma)" -msgstr "eigener Nickname, der auf dem IRC-Server benutzt werden soll" - -msgid "use IPv6 protocol for server communication" -msgstr "Server über IPv6 ansprechen" - -msgid "use SSL for server communication" -msgstr "Server über SSL ansprechen" - -msgid "password for IRC server" -msgstr "Passwort für den IRC-Server" - -#, fuzzy -msgid "nicknames to use on IRC server (separated by comma)" -msgstr "eigener Nickname, der auf dem IRC-Server benutzt werden soll" - -msgid "user name to use on IRC server" -msgstr "Benutzername, der an den Server übermittelt werden soll" - -msgid "real name to use on IRC server" -msgstr "voller Name, der an den Server übermittelt werden soll" - -msgid "" -"custom hostname/IP for server (optional, if empty local hostname is used)" -msgstr "" -"angepasster Hostname oder angepasste IP-Adresse für den Server (wenn nichts " -"eingetragen ist, wird der lokale Hostname verwendet)" - -msgid "" -"command(s) to run when connected to server (many commands should be " -"separated by ';', use '\\;' for a semicolon, special variables $nick, " -"$channel and $server are replaced by their value)" -msgstr "" -"Befehle, die nach der Verbindung zum Server ausgeführt werden sollen " -"(mehrere Befehle müssen mit einem Semikolon getrennt werden, um ein " -"Semikolon zu schreiben, muss man '\\;' verwenden, die spezielllen Variablen " -"$nick, $channel und $server werden dabei durch den jeweiligen Wert ersetzt)" - -msgid "" -"delay (in seconds) after command was executed (example: give some time for " -"authentication)" -msgstr "" -"Wartezeit in Sekunden nach Ausführung des Befehls, um z.B. eine " -"Authentifizierung zu ermöglichen" - -msgid "" -"comma separated list of channels to join when connected to server (example: " -"\"#chan1,#chan2,#chan3 key1,key2\")" -msgstr "" -"durch Kommata getrennte Liste der Channels, die beim Verbinden zum Server " -"betreten werden sollen (Beispiel: \"#chan1,#chan2,#chan3 key1,key2\")" - -msgid "automatically rejoin channels when kicked" -msgstr "Channels nach Kick automatisch wieder betreten, falls möglich" - -msgid "" -"comma separated list of notify levels for channels of this server (format: " -"#channel:1,..), a channel name '*' is reserved for server default notify " -"level" -msgstr "" -"durch Kommata getrennte Liste der Notify-Levels für die Channels auf diesem " -"Server (Format: #channel:1,...), der Channelname '*' ist für den Default-" -"Server-Notify-Level" - msgid "Waiting" msgstr "warten" @@ -3781,7 +3770,7 @@ msgstr "" "getrennt!\n" #, fuzzy, c-format -msgid "%s%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" +msgid "%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" msgstr "" "%s: Nickname \"%s\" wird bereits verwendet, versuche 2. Nickname \"%s\"\n" @@ -4126,15 +4115,15 @@ msgid "%s%s: cannot read data from socket, disconnecting from server..." msgstr "%s Socket-Lesefehler, die Serververbindung wird getrennt...\n" #, fuzzy, c-format -msgid "%s%s: lag is high, disconnecting from server..." +msgid "%s: lag is high, disconnecting from server..." msgstr "%s der Lag ist hoch, die Verbindung wird getrennt...\n" #, fuzzy, c-format -msgid "%s%s: reconnecting to server in %d %s" +msgid "%s: reconnecting to server in %d %s" msgstr "%s: Neuverbinden in %d Sekunden\n" #, fuzzy, c-format -msgid "%s%s: switching address to %s/%d" +msgid "%s: switching address to %s/%d" msgstr "%s IP-Adresse nicht gefunden\n" #, fuzzy, c-format @@ -4177,6 +4166,14 @@ msgstr "" msgid "%s%s: unable to set local hostname/IP" msgstr "%s kann lokalen Hostname/lokale IP nicht festlegen\n" +#, c-format +msgid "%s%s: addresses not defined for server \"%s\", cannot connect" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: nicks not defined for server \"%s\", cannot connect" +msgstr "%s Nickname \"%s\" für den \"%s\"-Befehl nicht gefunden\n" + #, fuzzy, c-format msgid "" "%s%s: cannot connect with SSL since WeeChat was not built with GnuTLS support" @@ -4185,7 +4182,7 @@ msgstr "" "kompiliert wurde\n" #, fuzzy, c-format -msgid "%s%s: connecting to server %s/%d%s%s via %s proxy %s/%d%s..." +msgid "%s: connecting to server %s/%d%s%s via %s proxy %s/%d%s..." msgstr "%s: verbinden zu Server %s:%d%s%s via %s-Proxy %s:%d%s...\n" #, fuzzy, c-format @@ -4193,10 +4190,6 @@ msgid "Connecting to server %s/%d%s%s via %s proxy %s/%d%s..." msgstr "verbinden zu Server %s:%d%s%s via %s-Proxy %s:%d%s...\n" #, fuzzy, c-format -msgid "%s%s: connecting to server %s/%d%s%s..." -msgstr "%s: verbinden zu Server %s:%d%s%s...\n" - -#, fuzzy, c-format msgid "%s: connecting to server %s/%d%s%s..." msgstr "%s: verbinden zu Server %s:%d%s%s...\n" @@ -4221,11 +4214,11 @@ msgid "%s%s: cannot set socket option \"SO_KEEPALIVE\"" msgstr "%s Fehler beim Setzen der Socketoption \"SO_KEEPALIVE\"\n" #, fuzzy, c-format -msgid "%s%s: reconnecting to server..." +msgid "%s: reconnecting to server..." msgstr "%s: Neuverbinden zum Server...\n" #, fuzzy, c-format -msgid "%s%s: disconnected from server" +msgid "%s: disconnected from server" msgstr "Vom Server getrennt!\n" #, fuzzy, c-format @@ -4284,13 +4277,17 @@ msgid "%sError: unable to load plugin \"%s\" (not enough memory)" msgstr "%s kann das Plugin \"%s\" nicht laden (Speichermangel)\n" #, fuzzy, c-format -msgid "%sPlugin \"%s\" loaded" +msgid "Plugin \"%s\" loaded" msgstr "Plugin \"%s\" entladen.\n" #, fuzzy, c-format -msgid "%sPlugin \"%s\" unloaded" +msgid "Plugin \"%s\" unloaded" msgstr "Plugin \"%s\" entladen.\n" +#, fuzzy, c-format +msgid "%sError: plugin \"%s\" not found" +msgstr "%s Plugin \"%s\" nicht gefunden\n" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " @@ -4298,7 +4295,7 @@ msgid "" msgstr "" #, c-format -msgid "%s%s: registered script \"%s\", version %s (%s)" +msgid "%s: registered script \"%s\", version %s (%s)" msgstr "" #, fuzzy, c-format @@ -4314,7 +4311,7 @@ msgid "%s%s: script \"%s\" not found" msgstr "%s Server \"%s\" nicht gefunden\n" #, fuzzy, c-format -msgid "%s%s: loading script \"%s\"" +msgid "%s: loading script \"%s\"" msgstr "Sitzung: Lade Server \"%s\"\n" #, fuzzy, c-format @@ -4340,11 +4337,11 @@ msgstr "" "gescheitert\n" #, fuzzy, c-format -msgid "%s%s: unloading script \"%s\"" +msgid "%s: unloading script \"%s\"" msgstr "Sitzung: Lade Server \"%s\"\n" #, fuzzy, c-format -msgid "%s%s: script \"%s\" unloaded" +msgid "%s: script \"%s\" unloaded" msgstr "Plugin \"%s\" entladen.\n" #, fuzzy, c-format @@ -4510,6 +4507,132 @@ msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s fehlerhafte Argumente für der \"%s\"-Befehl\n" #, fuzzy +#~ msgid "# %s, created by %s v%s on %s#\n" +#~ msgstr "" +#~ "#\n" +#~ "# %s Konfigurationsdatei, erstellt von %s v%s auf %s " + +#, fuzzy +#~ msgid "No configuration option found with \"%s\"" +#~ msgstr "Keine Konfigurationsoptionen mit \"%s\" gefunden\n" + +#~ msgid "" +#~ "option: name of an option (if name is full and no value is given, then " +#~ "help is displayed on option)\n" +#~ " value: value for option\n" +#~ "\n" +#~ "Option may be: servername.server_xxx where \"servername\" is an internal " +#~ "server name and \"xxx\" an option for this server." +#~ msgstr "" +#~ "Option: Name einer Option (wenn der Name vorhanden ist, aber kein Wert, " +#~ "dann wird eine Hilfe zur Option ausgegeben\n" +#~ " Wert: Wert der Option\n" +#~ "\n" +#~ "Option kann Servername.server_xxx lauten, wobei \"Servername\" der " +#~ "interne Servername ist und \"xxx\" eine Option für diesen Server." + +#, fuzzy +#~ msgid "%s%s: error creating charset (%s) \"%s\" => \"%s\"" +#~ msgstr "%s nicht genügend Speicher für Infobar-Nachricht\n" + +#, fuzzy +#~ msgid "%sCharset \"%s\" not found" +#~ msgstr "%s Server \"%s\" nicht gefunden\n" + +#, fuzzy +#~ msgid "List of charsets:" +#~ msgstr "Liste der Aliases:\n" + +#, fuzzy +#~ msgid "List of charsets with \"%s\":" +#~ msgstr "Liste der Aliases:\n" + +#, fuzzy +#~ msgid "No charset found" +#~ msgstr "Keine Taste gefunden.\n" + +#, fuzzy +#~ msgid "No charset defined" +#~ msgstr "Keine Aliases definiert.\n" + +#, fuzzy +#~ msgid "manage charsets" +#~ msgstr "Puffer verwalten" + +#, fuzzy +#~ msgid "%s%s: value \"%s\" is invalid for option \"%s\"" +#~ msgstr "%s %s, Zeile %d: ungültige Option \"%s\"\n" + +#, fuzzy +#~ msgid "%s%s: error creating server for reading configuration file" +#~ msgstr "den Server dazu bringen, seine Konfigurationsdatei neu zu laden" + +#~ msgid "name associated to IRC server (for display only)" +#~ msgstr "mit dem IRC-Server assoziierter eindeutiger Name (nur zur Anzeige)" + +#, fuzzy +#~ msgid "Option changed: " +#~ msgstr "Sie sind nicht im Channel" + +#, fuzzy +#~ msgid "%sError: incorrect value for option \"%s\"" +#~ msgstr "%s ungültiger Wert für die Option \"%s\"\n" + +#, fuzzy +#~ msgid "No plugin option found with \"%s\"" +#~ msgstr "Keine Plugin-Optionen mit \"%s\" gefunden\n" + +#, fuzzy +#~ msgid "No plugin option found" +#~ msgstr "Keine Plugin-Option gefunden\n" + +#, fuzzy +#~ msgid "%s%d%s plugin option found with \"%s\"" +#~ msgid_plural "%s%d%s plugin options found with \"%s\"" +#~ msgstr[0] "Keine Plugin-Optionen mit \"%s\" gefunden\n" +#~ msgstr[1] "Keine Plugin-Optionen mit \"%s\" gefunden\n" + +#, fuzzy +#~ msgid "%s%d%s plugin option found" +#~ msgid_plural "%s%d%s plugin options found" +#~ msgstr[0] "Keine Plugin-Option gefunden\n" +#~ msgstr[1] "Keine Plugin-Option gefunden\n" + +#, fuzzy +#~ msgid "Plugin option changed: %s%s = \"%s%s%s\"" +#~ msgstr "Keine Plugin-Optionen mit \"%s\" gefunden\n" + +#, fuzzy +#~ msgid "%sError: incorrect value for plugin option \"%s\"" +#~ msgstr "%s ungültiger Wert für die Plugin-Option \"%s\"\n" + +#~ msgid "set plugin config options" +#~ msgstr "Konfigurationsparameter für Plugin setzen" + +#~ msgid "" +#~ "option: name of a plugin option\n" +#~ " value: value for option\n" +#~ "\n" +#~ "Option is format: plugin.option, example: perl.myscript.item1" +#~ msgstr "" +#~ "Option: Name einer Plugin-Option\n" +#~ " Wert: Wert für Option\n" +#~ "\n" +#~ "Option wird wie folgt formatiert: Plugin.Option, z.B. perl.myscript.item1" + +#, fuzzy +#~ msgid "prefix for info messages" +#~ msgstr "Farbe eines Fensters mit neuen Messages" + +#, fuzzy +#~ msgid "text color for info prefix" +#~ msgstr "Farbe des Infobar-Textes" + +#, fuzzy +#~ msgid "%s%s: connecting to server %s/%d%s%s..." +#~ msgstr "%s: verbinden zu Server %s:%d%s%s...\n" + +#, fuzzy #~ msgid "%s[%sF%s%s%s]" #~ msgstr "%s[%s%s%s]%s idlet: " @@ -4562,10 +4685,6 @@ msgstr "%s fehlerhafte Argumente für der \"%s\"-Befehl\n" #~ msgstr "%s%s %s(%s%s@%s%s)%s war %s\n" #, fuzzy -#~ msgid "Notice from %s%s%s: %s" -#~ msgstr "Nicks %s%s%s: %s[" - -#, fuzzy #~ msgid "Notice: %s" #~ msgstr "Gevoicete" @@ -5232,9 +5351,6 @@ msgstr "%s fehlerhafte Argumente für der \"%s\"-Befehl\n" #~ msgid "server name not found for buffer" #~ msgstr "Servername für den Puffer nicht gefunden" -#~ msgid "channel name not found for buffer" -#~ msgstr "Channelnamen für den Puffer nicht gefunden" - #~ msgid "buffer type not found" #~ msgstr "Puffertyp nicht gefunden" @@ -5788,29 +5904,12 @@ msgstr "%s fehlerhafte Argumente für der \"%s\"-Befehl\n" #~ msgid "%sDetail:\n" #~ msgstr "%sDetail:\n" -#~ msgid " . type boolean (values: 'on' or 'off')\n" -#~ msgstr " . boolesche Werte ('on' or 'off')\n" - -#~ msgid " . type integer (values: between %d and %d)\n" -#~ msgstr " . Ganzzahl (Werte zwischen %d und %d)\n" - #~ msgid " . type string (values: " #~ msgstr " . Zeichenfolge (Werte: " #~ msgid " . type color (Curses or Gtk color, look at WeeChat doc)\n" #~ msgstr " . Farbe (Curses- or Gtk-color, siehe WeeChat-Dokumentation)\n" -#~ msgid " . type string (any string)\n" -#~ msgstr " . Zeichenfolge (beliebig)\n" - -#, fuzzy -#~ msgid " . type: char (any char)\n" -#~ msgstr " . Zeichenfolge (beliebig)\n" - -#, fuzzy -#~ msgid " . type string (any string, limit: %d chars)\n" -#~ msgstr " . Zeichenfolge (beliebig)\n" - #, fuzzy #~ msgid "%s%d%s ignore was removed.\n" #~ msgid_plural "%s%d%s ignore were removed.\n" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-04-03 18:09+0200\n" +"POT-Creation-Date: 2008-04-11 18:29+0200\n" "PO-Revision-Date: 2007-09-19 12:09+0200\n" "Last-Translator: Roberto González Cardenete <robert.glez@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -62,12 +62,12 @@ msgstr "" " -v, --version mostrar versión de Weechat\n" " -w, --weechat-commands mostrar comandos de Weechat\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, fuzzy, c-format msgid "%s configuration options:\n" msgstr "poner opciones de configuración" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s internal commands:\n" msgstr "Comandos internos %s :\n" @@ -75,7 +75,7 @@ msgstr "Comandos internos %s :\n" msgid "Internal key functions:\n" msgstr "Funciones de clave internas:\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s default keys:\n" msgstr "%s claves por defecto:\n" @@ -203,7 +203,7 @@ msgid "%sError: incorrect notify level (must be between %d and %d)" msgstr "%s nivel de notificación incorrecto (debe estar entre %d y %d)\n" #, fuzzy, c-format -msgid "%sNew notify level for %s%s%s: %d %s" +msgid "New notify level for %s%s%s: %d %s" msgstr "Nuevo nivel de notificación para %s%s%s: %s%d %s" #, fuzzy @@ -272,7 +272,7 @@ msgstr "%s plugin \"%s\" no encontrado\n" msgid "%sError: wrong filter number" msgstr "%s número de búfer incorrecto\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, fuzzy, c-format msgid "%s internal commands:" msgstr "Comandos internos %s :\n" @@ -294,7 +294,51 @@ msgid "plugin:" msgstr " (sin plugins)\n" #, fuzzy, c-format -msgid "%sNo help available, \"%s\" is an unknown command" +msgid "Option \"%s%s%s\": %s" +msgstr "Usuarios %s%s%s: %s[" + +#, fuzzy +msgid " type: boolean ('on' or 'off')" +msgstr " . tipo booleano (valores: 'on' u 'off')\n" + +#, c-format +msgid " value: %s%s%s (default: %s)" +msgstr "" + +#, fuzzy, c-format +msgid " type: string (%s)" +msgstr " . tipo: cadena\n" + +#, c-format +msgid " value: '%s%s%s' (default: '%s')" +msgstr "" + +#, fuzzy, c-format +msgid " type: integer (between %d and %d)" +msgstr " . tipo entero (valores: entre %d y %d)\n" + +#, c-format +msgid " value: %s%d%s (default: %d)" +msgstr "" + +#, fuzzy +msgid " type: string (any string)" +msgstr " . tipo cadena (cualquier cadena)\n" + +#, fuzzy +msgid " type: char (any char)" +msgstr " . tipo cadena (cualquier cadena)\n" + +#, fuzzy, c-format +msgid " type: string (limit: %d chars)" +msgstr " . tipo cadena (cualquier cadena)\n" + +#, fuzzy +msgid " type: color (values depend on GUI used)" +msgstr " . valores: entre %d y %d\n" + +#, fuzzy, c-format +msgid "%sNo help available, \"%s\" is not a command or an option" msgstr "No hay ayuda disponible, el comando \"%s\" es desconocido\n" #, fuzzy @@ -302,7 +346,7 @@ msgid "Buffer command history:" msgstr "mostrar historial de comandos de búfer" #, fuzzy, c-format -msgid "%sNew key binding: %s%s => %s%s%s%s%s" +msgid "New key binding: %s%s => %s%s%s%s%s" msgstr "Nueva anclaje de clave: %s" #, fuzzy @@ -313,8 +357,8 @@ msgstr "Anclajes de clave:\n" msgid "Internal key functions:" msgstr "Funciones de clave internas:\n" -#, fuzzy, c-format -msgid "%sDefault key bindings restored" +#, fuzzy +msgid "Default key bindings restored" msgstr "Anclajes de clave por defecto restaurados\n" #, fuzzy, c-format @@ -324,7 +368,7 @@ msgstr "" "seguridad)\n" #, fuzzy, c-format -msgid "%sKey \"%s\" unbound" +msgid "Key \"%s\" unbound" msgstr "Clave \"%s\" desatada\n" #, fuzzy, c-format @@ -442,7 +486,7 @@ msgid "%sError: wrong argument count for \"%s\" command" msgstr "%s número de argumentos incorrecto para el comando \"%s\"\n" #, fuzzy, c-format -msgid "%sOptions reloaded from %s" +msgid "Options reloaded from %s" msgstr "opción/opciones de plugin encontrada(s)\n" #, fuzzy, c-format @@ -450,11 +494,11 @@ msgid "%sError: failed to reload options from %s" msgstr "%s falló al salvar el archivo de configuración\n" #, fuzzy, c-format -msgid "%sUnknown configuration file \"%s\"" +msgid "Unknown configuration file \"%s\"" msgstr "pedir al servidor que recargue su archivo de configuración" #, fuzzy, c-format -msgid "%sOptions saved to %s" +msgid "Options saved to %s" msgstr "opción/opciones de plugin encontrada(s)\n" #, fuzzy, c-format @@ -464,17 +508,19 @@ msgstr "%s falló al salvar el archivo de configuración\n" msgid "(unknown)" msgstr "(desconocido)" -#, fuzzy, c-format -msgid "No configuration option found with \"%s\"" -msgstr "Ninguna opción de configuración encontrada con \"%s\"\n" +#, c-format +msgid "" +"%sOption \"%s\" not found (tip: you can use \"*\" at beginning and/or end of " +"option to see a sublist)" +msgstr "" #, fuzzy msgid "No configuration option found" msgstr "Ninguna opción de configuración encontrada\n" #, fuzzy, c-format -msgid "%s%d%s configuration option found with \"%s\"" -msgid_plural "%s%d%s configuration options found with \"%s\"" +msgid "%s%d%s configuration option found matching with \"%s\"" +msgid_plural "%s%d%s configuration options found matching with \"%s\"" msgstr[0] "opción/opciones de configuración encontrada(s) con \"%s\"\n" msgstr[1] "opción/opciones de configuración encontrada(s) con \"%s\"\n" @@ -485,48 +531,28 @@ msgstr[0] "opción/opciones de configuración encontrada(s)\n" msgstr[1] "opción/opciones de configuración encontrada(s)\n" #, fuzzy, c-format +msgid "%sError: failed to set option \"%s\"" +msgstr "%s falló al salvar el archivo de configuración\n" + +#, fuzzy, c-format msgid "%sError: configuration option \"%s\" not found" msgstr "%s opción de configuración \"%s\" no encontrada\n" #, fuzzy -msgid "Option changed: " +msgid "Option changed" msgstr "no presente en el canal" #, fuzzy, c-format -msgid "%sError: incorrect value for option \"%s\"" -msgstr "%s valor incorrecto para la opción \"%s\"\n" - -#, fuzzy, c-format -msgid "No plugin option found with \"%s\"" -msgstr "Ninguna opción de plugin encontrada con \"%s\"\n" - -#, fuzzy -msgid "No plugin option found" -msgstr "Ninguna opción de plugin encontrada\n" - -#, fuzzy, c-format -msgid "%s%d%s plugin option found with \"%s\"" -msgid_plural "%s%d%s plugin options found with \"%s\"" -msgstr[0] "Ninguna opción de plugin encontrada con \"%s\"\n" -msgstr[1] "Ninguna opción de plugin encontrada con \"%s\"\n" - -#, fuzzy, c-format -msgid "%s%d%s plugin option found" -msgid_plural "%s%d%s plugin options found" -msgstr[0] "Ninguna opción de plugin encontrada\n" -msgstr[1] "Ninguna opción de plugin encontrada\n" - -#, fuzzy, c-format -msgid "%sError: plugin \"%s\" not found" +msgid "%sOption not found" msgstr "%s plugin \"%s\" no encontrado\n" -#, fuzzy, c-format -msgid "Plugin option changed: %s%s = \"%s%s%s\"" -msgstr "Ninguna opción de plugin encontrada con \"%s\"\n" +#, fuzzy +msgid "Option reset" +msgstr "opción/opciones de plugin encontrada(s)\n" -#, fuzzy, c-format -msgid "%sError: incorrect value for plugin option \"%s\"" -msgstr "%s valor incorrecto para la opción de plugin \"%s\"\n" +#, fuzzy +msgid "Option removed" +msgstr "no presente en el canal" #, c-format msgid "WeeChat uptime: %d %s %02d:%02d:%02d, started on %s" @@ -675,13 +701,18 @@ msgid "" "from message)" msgstr "" -msgid "display help about commands" +#, fuzzy +msgid "display help about commands and options" msgstr "mostrar ayuda sobre los comandos" -msgid "[command]" +#, fuzzy +msgid "[command | option]" msgstr "[comando]" -msgid "command: name of a WeeChat or IRC command" +#, fuzzy +msgid "" +"command: a command name\n" +" option: an option name (use /set to see list)" msgstr "comando: nombre de un comando de Weechat o de IRC" msgid "show buffer command history" @@ -777,34 +808,24 @@ msgid "[option [ = value]]" msgstr "[opción [ = valor]]" msgid "" -"option: name of an option (if name is full and no value is given, then help " -"is displayed on option)\n" -" value: value for option\n" -"\n" -"Option may be: servername.server_xxx where \"servername\" is an internal " -"server name and \"xxx\" an option for this server." +"option: name of an option\n" +" value: value for option" msgstr "" -"opción: nombre de una opción (si el nombre está completo y no se da " -"ningún valor, entonces se muestra la ayuda de la opción)\n" -"valor: valor para una opción\n" -"\n" -"Una opción podrÃa ser: nombredeservidor.servidor_xxx donde " -"\"nombredeservidor\" es un nombre de servidor interno y \"xxx\" una opción " -"para dicho servidor." -msgid "set plugin config options" -msgstr "poner opciones de configuración de plugins" +#, fuzzy +msgid "unset/reset config options" +msgstr "poner opciones de configuración" + +#, fuzzy +msgid "[option]" +msgstr "[comando]" msgid "" -"option: name of a plugin option\n" -" value: value for option\n" +"option: name of an option\n" "\n" -"Option is format: plugin.option, example: perl.myscript.item1" +"According to option, it's reset (for standard options) or removed (for " +"optional settings, like server values)." msgstr "" -"opción: nombre de la opción de plugin\n" -" valor: valor para la opción\n" -"\n" -"Una opción tiene formato: plugin.opción, ejemplo: perl.miscript.objeto1" msgid "upgrade WeeChat without disconnecting from servers" msgstr "actualizar Weechat sin desconectarse de los servidores" @@ -900,6 +921,9 @@ msgstr "" msgid "command executed when WeeChat starts, after loading plugins" msgstr "" +msgid "WeeChat slogan (if empty, slogan is not used)" +msgstr "eslógan de WeeChat (si está vacÃo, el eslógan no será utilizado)" + msgid "" "if set, uses real white color, disabled by default for terms with white " "background (if you never use white background, you should turn on this " @@ -919,9 +943,6 @@ msgstr "" "define el tÃtulo de la ventana (el terminal para la interfaz Curses) con el " "nombre y la versión" -msgid "WeeChat slogan (if empty, slogan is not used)" -msgstr "eslógan de WeeChat (si está vacÃo, el eslógan no será utilizado)" - msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "cuántas lÃneas a desplazar con scroll_up and scroll_down" @@ -968,10 +989,6 @@ msgid "display space if nick mode is not (half)op/voice" msgstr "mostrar un espacio si el modo de usuario no es (half)op/voice" #, fuzzy -msgid "prefix for info messages" -msgstr "color para una ventana con mensajes nuevos" - -#, fuzzy msgid "prefix for error messages" msgstr "imprime mensajes de depuración" @@ -1076,12 +1093,6 @@ msgid "" "max number of lines for paste without asking user (0 = disable this feature)" msgstr "número máximo de nicks para la comprobación de ausencia" -msgid "" -"default quit message ('%v' will be replaced by WeeChat version in string)" -msgstr "" -"mensaje de fin por defecto ('%v' será reemplazado por la versión de " -"WeeChat en la cadena)" - #, fuzzy msgid "background color for window separators (when splited)" msgstr "color para los separadores de ventana (cuando se dividen)" @@ -1115,10 +1126,6 @@ msgid "text color for time delimiters" msgstr "color para los delimitadores de la barra de información" #, fuzzy -msgid "text color for info prefix" -msgstr "color para el texto de la barra de información" - -#, fuzzy msgid "text color for error prefix" msgstr "color para la flecha de join (prefijo)" @@ -1476,14 +1483,6 @@ msgid "(default options)" msgstr "" #, fuzzy, c-format -msgid "" -"#\n" -"# %s configuration file, created by %s v%s on %s#\n" -msgstr "" -"#\n" -"# %s: fichero de configuración, creado por %s v%s el %s" - -#, fuzzy, c-format msgid "%sWarning: config file \"%s\" not found" msgstr "%s fichero de configuración \"%s\" no encontrado.\n" @@ -1855,14 +1854,14 @@ msgstr "" "No hay suficiente memoria para el mensaje de la barra de información\n" #, fuzzy, c-format -msgid "%sAlias \"%s\" => \"%s\" created" +msgid "Alias \"%s\" => \"%s\" created" msgstr "Alias \"%s\" => \"%s\" creado\n" msgid "Alias:" msgstr "" -#, fuzzy, c-format -msgid "%sNo alias found." +#, fuzzy +msgid "No alias found" msgstr "Ningún alias definido.\n" #, fuzzy @@ -1878,7 +1877,7 @@ msgid "%sAlias \"%s\" not found" msgstr "%s dirección \"%s\" no encontrada\n" #, fuzzy, c-format -msgid "%sAlias \"%s\" removed" +msgid "Alias \"%s\" removed" msgstr "Alias \"%s\" eliminado\n" msgid "create an alias for a command" @@ -1912,68 +1911,64 @@ msgid "alias_name: name of alias to remove" msgstr "alias: nombre del alias a suprimir" #, fuzzy, c-format +msgid "%s: debug enabled" +msgstr "La tuberÃa FIFO está abierta\n" + +#, c-format +msgid "%s: debug disabled" +msgstr "" + +#, fuzzy, c-format msgid "%s%s: error creating charset \"%s\" => \"%s\"" msgstr "" "No hay suficiente memoria para el mensaje de la barra de información\n" -#, fuzzy, c-format -msgid "%sCharset \"%s\" => \"%s\"" -msgstr "Alias \"%s\" => \"%s\" creado\n" +msgid "global decoding charset" +msgstr "" + +msgid "global encoding charset" +msgstr "" #, fuzzy, c-format -msgid "%s%s: charset \"%s\" not found" -msgstr "%s servidor \"%s\" no encontrado\n" +msgid "Charset: %s, %s => %s" +msgstr "Alias \"%s\" => \"%s\" creado\n" #, fuzzy, c-format -msgid "%sCharset \"%s\" removed" +msgid "Charset: %s, %s: removed" msgstr "Alias \"%s\" eliminado\n" -#, fuzzy -msgid "List of charsets:" -msgstr "Lista de alias:\n" - #, fuzzy, c-format -msgid "List of charsets with \"%s\":" -msgstr "Lista de alias:\n" +msgid "%s%s: missing parameters" +msgstr "%s falta un argumento para la opción --dir\n" -#, fuzzy -msgid "No charset found" -msgstr "Ningún alias definido.\n" +#, c-format +msgid "%s%s: wrong charset type (decode or encode expected)" +msgstr "" -#, fuzzy -msgid "No charset defined" -msgstr "Ningún alias definido.\n" +#, fuzzy, c-format +msgid "%s%s: invalid charset: \"%s\"" +msgstr "No es posible escribir un fichero de log para un búfer\n" #, fuzzy, c-format -msgid "%s%s: terminal: %s, internal: %s" +msgid "%s: terminal: %s, internal: %s" msgstr "%s plugin \"%s\" no encontrado\n" #, fuzzy, c-format -msgid "%s%s: error creating configuration file \"%s\"" +msgid "%s%s: error creating configuration file" msgstr "pedir al servidor que recargue su archivo de configuración" #, fuzzy -msgid "manage charsets" -msgstr "gestionar los búfers" +msgid "change charset for current buffer" +msgstr "nombre de canal no encontrado para el búfer" -msgid "[[type.]plugin.string [= charset]]" +msgid "[[decode | encode] charset] | [reset]" msgstr "" msgid "" -" type: \"decode\" or \"encode\" (if type is omitted, then both \"decode\" " -"and \"encode\" are set)\n" -" plugin: plugin name\n" -" string: string specific to plugin (for example a server name or server." -"channel for IRC plugin)\n" -"charset: charset to use (if empty, then charset is removed)\n" -"\n" -"Examples :\n" -"/charset decode iso-8859-15 => set global decode charset to iso-8859-15\n" -"/charset encode iso-8859-15 => set global encode charset to iso-8859-15\n" -"/charset decode.irc.freenode => set decode charset to iso-8859-15 for IRC " -"server \"freenode\" (all channels)\n" -"/charset decode.irc.freenode.#weechat => set decode charset to iso-8859-15 " -"for IRC channel \"#weechat\" on server \"freenode\"" +" decode: change decoding charset\n" +" encode: change encoding charset\n" +"charset: new charset for current buffer\n" +" reset: reset charsets for current buffer" msgstr "" msgid "print debug messages" @@ -1995,22 +1990,10 @@ msgstr "" "(el mismo volcado se escribe cuando Weechat se cuelga)\n" "ventanas: mostrar árbol de ventanas" -#, fuzzy, c-format -msgid "%s: debug enabled" -msgstr "La tuberÃa FIFO está abierta\n" - -#, c-format -msgid "%s: debug disabled" -msgstr "" - msgid "demo message without prefix" msgstr "" #, c-format -msgid "%sdemo message with info prefix" -msgstr "" - -#, c-format msgid "%sdemo message with error prefix" msgstr "" @@ -2097,7 +2080,7 @@ msgid "" msgstr "" #, fuzzy, c-format -msgid "%s%s: pipe open" +msgid "%s: pipe open" msgstr "La tuberÃa FIFO está abierta\n" #, fuzzy, c-format @@ -2110,7 +2093,7 @@ msgstr "" "%s no ha sido posible crear la tuberÃa FIFO para el control remoto (%s)\n" #, fuzzy, c-format -msgid "%s%s: pipe closed" +msgid "%s: pipe closed" msgstr "La tuberÃa FIFO está cerrada\n" #, fuzzy, c-format @@ -2138,11 +2121,11 @@ msgid "%s%s: cannot find nick for sending message" msgstr "%s no ha sido posible encontrar el usuario al que enviar el mensaje\n" #, fuzzy, c-format -msgid "%s%s: future away on %s%s%s: %s" +msgid "%s: future away on %s%s%s: %s" msgstr "el ignore fue eliminado.\n" #, fuzzy, c-format -msgid "%s%s: future away on %s%s%s removed" +msgid "%s: future away on %s%s%s removed" msgstr "el ignore fue eliminado.\n" #, fuzzy, c-format @@ -2163,7 +2146,7 @@ msgid "%s%s: missing argument for \"%s\" option" msgstr "%s falta un argumento para la opción --dir\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s created (temporary server, NOT SAVED!)" +msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "%s servidor \"%s\" no encontrado\n" #, fuzzy, c-format @@ -2183,7 +2166,7 @@ msgid "%s%s: not connected to server \"%s\"!" msgstr "%s ¡no conectado al servidor \"%s\"!\n" #, fuzzy, c-format -msgid "%s%s: auto-reconnection is cancelled" +msgid "%s: auto-reconnection is cancelled" msgstr "La reconexión automática está anulada\n" #, fuzzy, c-format @@ -2233,7 +2216,7 @@ msgid "%s%s: server \"%s\" already exists, can't create it!" msgstr "%s el servidor \"%s\" ya existe, ¡no se puede crear!\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s created" +msgid "%s: server %s%s%s created" msgstr "Servidor %s%s%s creado\n" #, fuzzy, c-format @@ -2249,11 +2232,11 @@ msgid "%s%s: server \"%s\" already exists for \"%s\" command" msgstr "%s servidor \"%s\" no encontrado para el comando \"%s\"\n" #, fuzzy, c-format -msgid "%s%s: Server %s%s%s has been copied to %s%s" +msgid "%s: server %s%s%s has been copied to %s%s" msgstr "El servidor %s%s%s ha sido borrado\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s has been renamed to %s%s" +msgid "%s: server %s%s%s has been renamed to %s%s" msgstr "El servidor %s%s%s ha sido borrado\n" #, fuzzy, c-format @@ -2261,7 +2244,7 @@ msgid "%s%s: server \"%s\" is not a temporary server" msgstr "%s servidor \"%s\" no encontrado\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s is not temporary any more" +msgid "%s: server %s%s%s is not temporary any more" msgstr "%s servidor \"%s\" no encontrado\n" #, fuzzy, c-format @@ -2273,12 +2256,12 @@ msgstr "" "él. Pruebe /disconnect %s antes.\n" #, fuzzy, c-format -msgid "%s%s: Server %s%s%s has been deleted" +msgid "%s: Server %s%s%s has been deleted" msgstr "El servidor %s%s%s ha sido borrado\n" #, c-format msgid "" -"%s%s: messages outqueue DELETED for all servers. Some messages from you or " +"%s: messages outqueue DELETED for all servers. Some messages from you or " "WeeChat may have been lost!" msgstr "" @@ -3027,23 +3010,99 @@ msgstr "" msgid "%sirc: too few arguments for \"%s\" command" msgstr "%s argumentos incorrectos para el comando \"%s\"\n" +#, fuzzy, c-format +msgid "%s%s: error creating server \"%s\"" +msgstr "" +"No hay suficiente memoria para el mensaje de la barra de información\n" + +#, fuzzy, c-format +msgid "%s%s: error creating option \"%s\" for server \"%s\" (server not found)" +msgstr "%s opción de configuración \"%s\" no encontrada\n" + #, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" msgstr "" -#, fuzzy, c-format -msgid "%s%s: value \"%s\" is invalid for option \"%s\"" -msgstr "%s %s, lÃnea %d: opción \"%s\" inválida\n" +msgid "automatically connect to server when WeeChat is starting" +msgstr "conexión automática al servidor cuando WeeChat está arrancando" -#, fuzzy, c-format -msgid "%s%s: option \"%s\" not found" -msgstr "%s plugin \"%s\" no encontrado\n" +msgid "automatically reconnect to server when disconnected" +msgstr "reconexión automática al servidor tras una desconexión" + +msgid "delay (in seconds) before trying again to reconnect to server" +msgstr "" +"espera (en segundos) antes de intentar de nuevo una reconexión al servidor" + +#, fuzzy +msgid "list of IP/port or hostname/port for server (separated by comma)" +msgstr "nombre de usuario a utilizar en el servidor IRC" + +msgid "use IPv6 protocol for server communication" +msgstr "usar el protocolo IPv6 para la comunicación del servidor" + +msgid "use SSL for server communication" +msgstr "usar SSL para la comunicación del servidor" + +msgid "password for IRC server" +msgstr "contraseña para el servidor IRC" + +#, fuzzy +msgid "nicknames to use on IRC server (separated by comma)" +msgstr "nombre de usuario a utilizar en el servidor IRC" + +msgid "user name to use on IRC server" +msgstr "nombre de usuario para el servidor IRC" + +msgid "real name to use on IRC server" +msgstr "nombre real para el servidor IRC" + +msgid "" +"custom hostname/IP for server (optional, if empty local hostname is used)" +msgstr "" +"nombre de máquina local/IP personalizado para el servidor (opcional, si " +"está vacÃo se utiliza el nombre de máquina local)" + +#, fuzzy +msgid "" +"command(s) to run when connected to server (many commands should be " +"separated by ';', use '\\;' for a semicolon, special variables $nick, " +"$channel and $server are replaced by their value)" +msgstr "" +"comando(s) a ejecutar cuando se conecte al servidor (muchos comandos deberÃ" +"an ser separados por ';', utilizar '\\;' para un punto y coma)" + +msgid "" +"delay (in seconds) after command was executed (example: give some time for " +"authentication)" +msgstr "" +"espera (en segundos) después de que el comando sea ejecutado (ejemplo: dar " +"algo de tiempo para la autenticación)" + +msgid "" +"comma separated list of channels to join when connected to server (example: " +"\"#chan1,#chan2,#chan3 key1,key2\")" +msgstr "" +"lista de canales (separados por comas) a unirse cuando se conecte a un " +"servidor (ejemplo: \"#chan1,#chan2,#chan3 key1,key2\")" + +msgid "automatically rejoin channels when kicked" +msgstr "unirse de nuevo automáticamente a los canales cuando sea expulsado" + +#, fuzzy +msgid "" +"comma separated list of notify levels for channels of this server (format: " +"#channel:1,..), a channel name '*' is reserved for server default notify " +"level" +msgstr "" +"lista separada por comas de niveles de notificación para canales de este " +"servidor (formato: #canal:1,...)" #, fuzzy, c-format -msgid "%s%s: error creating server for reading configuration file" -msgstr "pedir al servidor que recargue su archivo de configuración" +msgid "%s%s: error creating server option \"%s\"" +msgstr "" +"No hay suficiente memoria para el mensaje de la barra de información\n" msgid "use same buffer for all servers" msgstr "usar el mismo búfer para todos los servidores" @@ -3067,6 +3126,17 @@ msgid "show remote away message only once in private" msgstr "" "mostrar mensaje de ausencia remota únicamente una vez se está en privado" +msgid "display notices as private messages" +msgstr "mostrar noticias como mensajes privados" + +msgid "" +"comma separated list of words to highlight (case insensitive comparison, " +"words may begin or end with \"*\" for partial match)" +msgstr "" +"lista separada por comas de palabras a resaltar (comparación insensible a " +"mayúsculas, las palabras pueden empezar o terminar con \"*\" para una " +"concordancia parcial)" + msgid "" "default part message (leaving channel) ('%v' will be replaced by WeeChat " "version in string)" @@ -3074,8 +3144,13 @@ msgstr "" "mensaje de partida por defecto (abandonando el canal) ('%v' será " "reemplazado por la versión de WeeChat en la cadena)" -msgid "display notices as private messages" -msgstr "mostrar noticias como mensajes privados" +#, fuzzy +msgid "" +"default quit message (disconnecting from server) ('%v' will be replaced by " +"WeeChat version in string)" +msgstr "" +"mensaje de fin por defecto ('%v' será reemplazado por la versión de " +"WeeChat en la cadena)" msgid "interval between two checks for away (in minutes, 0 = never check)" msgstr "" @@ -3102,14 +3177,6 @@ msgstr "" msgid "anti-flood: # seconds between two user messages (0 = no anti-flood)" msgstr "" -msgid "" -"comma separated list of words to highlight (case insensitive comparison, " -"words may begin or end with \"*\" for partial match)" -msgstr "" -"lista separada por comas de palabras a resaltar (comparación insensible a " -"mayúsculas, las palabras pueden empezar o terminar con \"*\" para una " -"concordancia parcial)" - msgid "when off, colors codes are ignored in incoming messages" msgstr "" "cuando se desactiva, los códigos de color se ignoran en los mensajes " @@ -3200,83 +3267,6 @@ msgstr "registrar automáticamente las conversaciones privadas" msgid "hide password displayed by nickserv" msgstr "ocultar contraseña mostrada por nickserv" -msgid "name associated to IRC server (for display only)" -msgstr "nombre asociado al servidor IRC (para mostrar solamente)" - -msgid "automatically connect to server when WeeChat is starting" -msgstr "conexión automática al servidor cuando WeeChat está arrancando" - -msgid "automatically reconnect to server when disconnected" -msgstr "reconexión automática al servidor tras una desconexión" - -msgid "delay (in seconds) before trying again to reconnect to server" -msgstr "" -"espera (en segundos) antes de intentar de nuevo una reconexión al servidor" - -#, fuzzy -msgid "list of IP/port or hostname/port for server (separated by comma)" -msgstr "nombre de usuario a utilizar en el servidor IRC" - -msgid "use IPv6 protocol for server communication" -msgstr "usar el protocolo IPv6 para la comunicación del servidor" - -msgid "use SSL for server communication" -msgstr "usar SSL para la comunicación del servidor" - -msgid "password for IRC server" -msgstr "contraseña para el servidor IRC" - -#, fuzzy -msgid "nicknames to use on IRC server (separated by comma)" -msgstr "nombre de usuario a utilizar en el servidor IRC" - -msgid "user name to use on IRC server" -msgstr "nombre de usuario para el servidor IRC" - -msgid "real name to use on IRC server" -msgstr "nombre real para el servidor IRC" - -msgid "" -"custom hostname/IP for server (optional, if empty local hostname is used)" -msgstr "" -"nombre de máquina local/IP personalizado para el servidor (opcional, si " -"está vacÃo se utiliza el nombre de máquina local)" - -#, fuzzy -msgid "" -"command(s) to run when connected to server (many commands should be " -"separated by ';', use '\\;' for a semicolon, special variables $nick, " -"$channel and $server are replaced by their value)" -msgstr "" -"comando(s) a ejecutar cuando se conecte al servidor (muchos comandos deberÃ" -"an ser separados por ';', utilizar '\\;' para un punto y coma)" - -msgid "" -"delay (in seconds) after command was executed (example: give some time for " -"authentication)" -msgstr "" -"espera (en segundos) después de que el comando sea ejecutado (ejemplo: dar " -"algo de tiempo para la autenticación)" - -msgid "" -"comma separated list of channels to join when connected to server (example: " -"\"#chan1,#chan2,#chan3 key1,key2\")" -msgstr "" -"lista de canales (separados por comas) a unirse cuando se conecte a un " -"servidor (ejemplo: \"#chan1,#chan2,#chan3 key1,key2\")" - -msgid "automatically rejoin channels when kicked" -msgstr "unirse de nuevo automáticamente a los canales cuando sea expulsado" - -#, fuzzy -msgid "" -"comma separated list of notify levels for channels of this server (format: " -"#channel:1,..), a channel name '*' is reserved for server default notify " -"level" -msgstr "" -"lista separada por comas de niveles de notificación para canales de este " -"servidor (formato: #canal:1,...)" - msgid "Waiting" msgstr "Esperando" @@ -3786,7 +3776,7 @@ msgstr "" "conexión con el servidor!\n" #, fuzzy, c-format -msgid "%s%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" +msgid "%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" msgstr "" "%s: el nombre de usuario \"%s\" ya está en uso, probando con el 2 nombre de " "usuario \"%s\"\n" @@ -4138,15 +4128,15 @@ msgstr "" "%s no ha sido posible leer datos del socket, desconectando del servidor...\n" #, fuzzy, c-format -msgid "%s%s: lag is high, disconnecting from server..." +msgid "%s: lag is high, disconnecting from server..." msgstr "%s el lag (retraso) es alto, desconectando del servidor...\n" #, fuzzy, c-format -msgid "%s%s: reconnecting to server in %d %s" +msgid "%s: reconnecting to server in %d %s" msgstr "%s: Reconexión al servidor en %d segundos\n" #, fuzzy, c-format -msgid "%s%s: switching address to %s/%d" +msgid "%s: switching address to %s/%d" msgstr "%s Dirección IP no encontrada\n" #, fuzzy, c-format @@ -4189,6 +4179,14 @@ msgstr "" msgid "%s%s: unable to set local hostname/IP" msgstr "%s no es posible crear el servidor\n" +#, c-format +msgid "%s%s: addresses not defined for server \"%s\", cannot connect" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: nicks not defined for server \"%s\", cannot connect" +msgstr "%s usuario \"%s\" no encontrado para el comando \"%s\"\n" + #, fuzzy, c-format msgid "" "%s%s: cannot connect with SSL since WeeChat was not built with GnuTLS support" @@ -4197,7 +4195,7 @@ msgstr "" "con soporte GNUtls\n" #, fuzzy, c-format -msgid "%s%s: connecting to server %s/%d%s%s via %s proxy %s/%d%s..." +msgid "%s: connecting to server %s/%d%s%s via %s proxy %s/%d%s..." msgstr "%s: conectando al servidor %s:%d%s%s vÃa %s proxy %s: %d%s...\n" #, fuzzy, c-format @@ -4205,10 +4203,6 @@ msgid "Connecting to server %s/%d%s%s via %s proxy %s/%d%s..." msgstr "Conectando al servidor %s:%d%s%s vÃa %s proxy %s:%d%s...\n" #, fuzzy, c-format -msgid "%s%s: connecting to server %s/%d%s%s..." -msgstr "%s: conectando al servidor %s:%d%s%s...\n" - -#, fuzzy, c-format msgid "%s: connecting to server %s/%d%s%s..." msgstr "%s: conectando al servidor %s:%d%s%s...\n" @@ -4233,11 +4227,11 @@ msgid "%s%s: cannot set socket option \"SO_KEEPALIVE\"" msgstr "%s no ha sido posible configurar la opción socket \"SO_KEEPALIVE\"\n" #, fuzzy, c-format -msgid "%s%s: reconnecting to server..." +msgid "%s: reconnecting to server..." msgstr "%s: Reconectando al servidor...\n" #, fuzzy, c-format -msgid "%s%s: disconnected from server" +msgid "%s: disconnected from server" msgstr "¡Desconectado del servidor!\n" #, fuzzy, c-format @@ -4297,13 +4291,17 @@ msgstr "" "%s no ha sido posible cargar el plugin \"%s\" (no hay suficiente memoria)\n" #, fuzzy, c-format -msgid "%sPlugin \"%s\" loaded" +msgid "Plugin \"%s\" loaded" msgstr "Plugin \"%s\" descargado.\n" #, fuzzy, c-format -msgid "%sPlugin \"%s\" unloaded" +msgid "Plugin \"%s\" unloaded" msgstr "Plugin \"%s\" descargado.\n" +#, fuzzy, c-format +msgid "%sError: plugin \"%s\" not found" +msgstr "%s plugin \"%s\" no encontrado\n" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " @@ -4311,7 +4309,7 @@ msgid "" msgstr "" #, c-format -msgid "%s%s: registered script \"%s\", version %s (%s)" +msgid "%s: registered script \"%s\", version %s (%s)" msgstr "" #, fuzzy, c-format @@ -4327,7 +4325,7 @@ msgid "%s%s: script \"%s\" not found" msgstr "%s servidor \"%s\" no encontrado\n" #, fuzzy, c-format -msgid "%s%s: loading script \"%s\"" +msgid "%s: loading script \"%s\"" msgstr "sesión: cargando servidor \"%s\"\n" #, fuzzy, c-format @@ -4353,11 +4351,11 @@ msgstr "" "falló al cargar\n" #, fuzzy, c-format -msgid "%s%s: unloading script \"%s\"" +msgid "%s: unloading script \"%s\"" msgstr "sesión: cargando servidor \"%s\"\n" #, fuzzy, c-format -msgid "%s%s: script \"%s\" unloaded" +msgid "%s: script \"%s\" unloaded" msgstr "Plugin \"%s\" descargado.\n" #, fuzzy, c-format @@ -4522,6 +4520,134 @@ msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s argumentos incorrectos para el comando \"%s\"\n" #, fuzzy +#~ msgid "# %s, created by %s v%s on %s#\n" +#~ msgstr "" +#~ "#\n" +#~ "# %s: fichero de configuración, creado por %s v%s el %s" + +#, fuzzy +#~ msgid "No configuration option found with \"%s\"" +#~ msgstr "Ninguna opción de configuración encontrada con \"%s\"\n" + +#~ msgid "" +#~ "option: name of an option (if name is full and no value is given, then " +#~ "help is displayed on option)\n" +#~ " value: value for option\n" +#~ "\n" +#~ "Option may be: servername.server_xxx where \"servername\" is an internal " +#~ "server name and \"xxx\" an option for this server." +#~ msgstr "" +#~ "opción: nombre de una opción (si el nombre está completo y no se da " +#~ "ningún valor, entonces se muestra la ayuda de la opción)\n" +#~ "valor: valor para una opción\n" +#~ "\n" +#~ "Una opción podrÃa ser: nombredeservidor.servidor_xxx donde " +#~ "\"nombredeservidor\" es un nombre de servidor interno y \"xxx\" una " +#~ "opción para dicho servidor." + +#, fuzzy +#~ msgid "%s%s: error creating charset (%s) \"%s\" => \"%s\"" +#~ msgstr "" +#~ "No hay suficiente memoria para el mensaje de la barra de información\n" + +#, fuzzy +#~ msgid "%sCharset \"%s\" not found" +#~ msgstr "%s servidor \"%s\" no encontrado\n" + +#, fuzzy +#~ msgid "List of charsets:" +#~ msgstr "Lista de alias:\n" + +#, fuzzy +#~ msgid "List of charsets with \"%s\":" +#~ msgstr "Lista de alias:\n" + +#, fuzzy +#~ msgid "No charset found" +#~ msgstr "Ningún alias definido.\n" + +#, fuzzy +#~ msgid "No charset defined" +#~ msgstr "Ningún alias definido.\n" + +#, fuzzy +#~ msgid "manage charsets" +#~ msgstr "gestionar los búfers" + +#, fuzzy +#~ msgid "%s%s: value \"%s\" is invalid for option \"%s\"" +#~ msgstr "%s %s, lÃnea %d: opción \"%s\" inválida\n" + +#, fuzzy +#~ msgid "%s%s: error creating server for reading configuration file" +#~ msgstr "pedir al servidor que recargue su archivo de configuración" + +#~ msgid "name associated to IRC server (for display only)" +#~ msgstr "nombre asociado al servidor IRC (para mostrar solamente)" + +#, fuzzy +#~ msgid "Option changed: " +#~ msgstr "no presente en el canal" + +#, fuzzy +#~ msgid "%sError: incorrect value for option \"%s\"" +#~ msgstr "%s valor incorrecto para la opción \"%s\"\n" + +#, fuzzy +#~ msgid "No plugin option found with \"%s\"" +#~ msgstr "Ninguna opción de plugin encontrada con \"%s\"\n" + +#, fuzzy +#~ msgid "No plugin option found" +#~ msgstr "Ninguna opción de plugin encontrada\n" + +#, fuzzy +#~ msgid "%s%d%s plugin option found with \"%s\"" +#~ msgid_plural "%s%d%s plugin options found with \"%s\"" +#~ msgstr[0] "Ninguna opción de plugin encontrada con \"%s\"\n" +#~ msgstr[1] "Ninguna opción de plugin encontrada con \"%s\"\n" + +#, fuzzy +#~ msgid "%s%d%s plugin option found" +#~ msgid_plural "%s%d%s plugin options found" +#~ msgstr[0] "Ninguna opción de plugin encontrada\n" +#~ msgstr[1] "Ninguna opción de plugin encontrada\n" + +#, fuzzy +#~ msgid "Plugin option changed: %s%s = \"%s%s%s\"" +#~ msgstr "Ninguna opción de plugin encontrada con \"%s\"\n" + +#, fuzzy +#~ msgid "%sError: incorrect value for plugin option \"%s\"" +#~ msgstr "%s valor incorrecto para la opción de plugin \"%s\"\n" + +#~ msgid "set plugin config options" +#~ msgstr "poner opciones de configuración de plugins" + +#~ msgid "" +#~ "option: name of a plugin option\n" +#~ " value: value for option\n" +#~ "\n" +#~ "Option is format: plugin.option, example: perl.myscript.item1" +#~ msgstr "" +#~ "opción: nombre de la opción de plugin\n" +#~ " valor: valor para la opción\n" +#~ "\n" +#~ "Una opción tiene formato: plugin.opción, ejemplo: perl.miscript.objeto1" + +#, fuzzy +#~ msgid "prefix for info messages" +#~ msgstr "color para una ventana con mensajes nuevos" + +#, fuzzy +#~ msgid "text color for info prefix" +#~ msgstr "color para el texto de la barra de información" + +#, fuzzy +#~ msgid "%s%s: connecting to server %s/%d%s%s..." +#~ msgstr "%s: conectando al servidor %s:%d%s%s...\n" + +#, fuzzy #~ msgid "%s[%sF%s%s%s]" #~ msgstr "%s[%s%s%s]%s inactividad: " @@ -4573,10 +4699,6 @@ msgstr "%s argumentos incorrectos para el comando \"%s\"\n" #~ msgstr "%s%s %s(%s%s@%s%s)%s estaba %s\n" #, fuzzy -#~ msgid "Notice from %s%s%s: %s" -#~ msgstr "Usuarios %s%s%s: %s[" - -#, fuzzy #~ msgid "Notice: %s" #~ msgstr "voces" @@ -5251,9 +5373,6 @@ msgstr "%s argumentos incorrectos para el comando \"%s\"\n" #~ msgid "server name not found for buffer" #~ msgstr "nombre de servidor no encontrado para el búfer" -#~ msgid "channel name not found for buffer" -#~ msgstr "nombre de canal no encontrado para el búfer" - #~ msgid "buffer type not found" #~ msgstr "tipo de búfer no encontrado" @@ -5799,12 +5918,6 @@ msgstr "%s argumentos incorrectos para el comando \"%s\"\n" #~ msgid "%sDetail:\n" #~ msgstr "%sDetalle:\n" -#~ msgid " . type boolean (values: 'on' or 'off')\n" -#~ msgstr " . tipo booleano (valores: 'on' u 'off')\n" - -#~ msgid " . type integer (values: between %d and %d)\n" -#~ msgstr " . tipo entero (valores: entre %d y %d)\n" - #~ msgid " . type string (values: " #~ msgstr " . tipo cadena (valores: " @@ -5812,17 +5925,6 @@ msgstr "%s argumentos incorrectos para el comando \"%s\"\n" #~ msgstr "" #~ " . tipo color (color Curses o Gtk, ver la documentación de WeeChat)\n" -#~ msgid " . type string (any string)\n" -#~ msgstr " . tipo cadena (cualquier cadena)\n" - -#, fuzzy -#~ msgid " . type: char (any char)\n" -#~ msgstr " . tipo cadena (cualquier cadena)\n" - -#, fuzzy -#~ msgid " . type string (any string, limit: %d chars)\n" -#~ msgstr " . tipo cadena (cualquier cadena)\n" - #, fuzzy #~ msgid "%s%d%s ignore was removed.\n" #~ msgid_plural "%s%d%s ignore were removed.\n" @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-04-03 18:09+0200\n" -"PO-Revision-Date: 2008-04-03 18:09+0200\n" +"POT-Creation-Date: 2008-04-11 18:29+0200\n" +"PO-Revision-Date: 2008-04-11 18:29+0200\n" "Last-Translator: FlashCode <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "MIME-Version: 1.0\n" @@ -60,12 +60,12 @@ msgstr "" " -v, --version afficher la version de WeeChat\n" "\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s configuration options:\n" msgstr "Options de configuration %s:\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s internal commands:\n" msgstr "Commandes internes %s:\n" @@ -73,7 +73,7 @@ msgstr "Commandes internes %s:\n" msgid "Internal key functions:\n" msgstr "Fonctions internes pour les touches:\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s default keys:\n" msgstr "Touches par défaut %s:\n" @@ -193,8 +193,8 @@ msgid "%sError: incorrect notify level (must be between %d and %d)" msgstr "%sErreur: niveau de notification incorrect (doit être entre %d et %d)" #, c-format -msgid "%sNew notify level for %s%s%s: %d %s" -msgstr "%sNouveau niveau de notification pour %s%s%s: %d %s" +msgid "New notify level for %s%s%s: %d %s" +msgstr "Nouveau niveau de notification pour %s%s%s: %d %s" msgid "(hotlist: never)" msgstr "(hotlist: jamais)" @@ -254,7 +254,7 @@ msgstr "%sErreur: filtre non trouvé" msgid "%sError: wrong filter number" msgstr "%sErreur: numéro de filtre incorrect" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s internal commands:" msgstr "Commandes internes %s:" @@ -263,7 +263,7 @@ msgid " (used by a plugin)" msgstr " (utilisé par une extension)" msgid "Other commands:" -msgstr "Autre commandes:" +msgstr "Autres commandes:" msgid " (masked by a plugin)" msgstr " (masqué par une extension)" @@ -272,15 +272,55 @@ msgid "plugin:" msgstr "extension:" #, c-format -msgid "%sNo help available, \"%s\" is an unknown command" -msgstr "%sPas d'aide disponible, la commande \"%s\" est inconnue" +msgid "Option \"%s%s%s\": %s" +msgstr "Option \"%s%s%s\": %s" + +msgid " type: boolean ('on' or 'off')" +msgstr " type: booléen ('on' ou 'off')" + +#, c-format +msgid " value: %s%s%s (default: %s)" +msgstr " valeur: %s%s%s (défaut: %s)" + +#, c-format +msgid " type: string (%s)" +msgstr " type: chaîne (%s)" + +#, c-format +msgid " value: '%s%s%s' (default: '%s')" +msgstr " valeur: '%s%s%s' (défaut: '%s')" + +#, c-format +msgid " type: integer (between %d and %d)" +msgstr " type: entier (entre %d et %d)" + +#, c-format +msgid " value: %s%d%s (default: %d)" +msgstr " valeur: %s%d%s (défaut: %d)" + +msgid " type: string (any string)" +msgstr " type: chaîne (toute chaîne)" + +msgid " type: char (any char)" +msgstr " type: caractère (tout caractère)" + +#, c-format +msgid " type: string (limit: %d chars)" +msgstr " type: chaîne (limite: %d caractères)" + +msgid " type: color (values depend on GUI used)" +msgstr " type: couleur (les valeurs dépendent de l'interface utilisée)" + +#, c-format +msgid "%sNo help available, \"%s\" is not a command or an option" +msgstr "%sPas d'aide disponible, \"%s\" n'est pas une commande ou une option" msgid "Buffer command history:" msgstr "Historique des commandes du tampon:" #, c-format -msgid "%sNew key binding: %s%s => %s%s%s%s%s" -msgstr "%sNouvelle touche: %s%s => %s%s%s%s%s" +msgid "New key binding: %s%s => %s%s%s%s%s" +msgstr "Nouvelle touche: %s%s => %s%s%s%s%s" msgid "Key bindings:" msgstr "Associations de touches:" @@ -288,9 +328,8 @@ msgstr "Associations de touches:" msgid "Internal key functions:" msgstr "Fonctions internes pour les touches:" -#, c-format -msgid "%sDefault key bindings restored" -msgstr "%sTouches par défaut restaurées" +msgid "Default key bindings restored" +msgstr "Touches par défaut restaurées" #, c-format msgid "%sError: \"-yes\" argument is required for keys reset (security reason)" @@ -299,8 +338,8 @@ msgstr "" "touches (raison de sécurité)" #, c-format -msgid "%sKey \"%s\" unbound" -msgstr "%sTouche \"%s\" supprimée" +msgid "Key \"%s\" unbound" +msgstr "Touche \"%s\" supprimée" #, c-format msgid "%sError: unable to unbind key \"%s\"" @@ -402,20 +441,20 @@ msgid "%sError: wrong argument count for \"%s\" command" msgstr "%sErreur: nombre de paramètres erroné pour la commande \"%s\"" #, c-format -msgid "%sOptions reloaded from %s" -msgstr "%sOptions rechargées depuis %s" +msgid "Options reloaded from %s" +msgstr "Options rechargées depuis %s" #, c-format msgid "%sError: failed to reload options from %s" msgstr "%sErreur: impossible de recharger les options depuis %s" #, c-format -msgid "%sUnknown configuration file \"%s\"" -msgstr "%sFichier de configuration inconnu \"%s\"" +msgid "Unknown configuration file \"%s\"" +msgstr "Fichier de configuration inconnu \"%s\"" #, c-format -msgid "%sOptions saved to %s" -msgstr "%sOptions sauvegardées dans %s" +msgid "Options saved to %s" +msgstr "Options sauvegardées dans %s" #, c-format msgid "%sError: failed to save options to %s" @@ -425,17 +464,19 @@ msgid "(unknown)" msgstr "(inconnu)" #, c-format -msgid "No configuration option found with \"%s\"" -msgstr "Aucune option de configuration trouvée avec \"%s\"" +msgid "" +"%sOption \"%s\" not found (tip: you can use \"*\" at beginning and/or end of " +"option to see a sublist)" +msgstr "%sOption \"%s\" non trouvée (astuce: vous pouvez utiliser \"*\" au début et/ou à la fin de l'option pour voir une sous-liste)" msgid "No configuration option found" msgstr "Aucune option de configuration trouvée" #, c-format -msgid "%s%d%s configuration option found with \"%s\"" -msgid_plural "%s%d%s configuration options found with \"%s\"" -msgstr[0] "%s%d%s option de configuration trouvée avec \"%s\"" -msgstr[1] "%s%d%s options de configuration trouvées avec \"%s\"" +msgid "%s%d%s configuration option found matching with \"%s\"" +msgid_plural "%s%d%s configuration options found matching with \"%s\"" +msgstr[0] "%s%d%s option de configuration trouvée correspondant à \"%s\"" +msgstr[1] "%s%d%s options de configuration trouvées correspondant à \"%s\"" #, c-format msgid "%s%d%s configuration option found" @@ -444,46 +485,25 @@ msgstr[0] "%s%d%s option de configuration trouvée" msgstr[1] "%s%d%s options de configuration trouvées" #, c-format -msgid "%sError: configuration option \"%s\" not found" -msgstr "%sErreur: option de configuration \"%s\" non trouvée" - -msgid "Option changed: " -msgstr "Option modifiée: " - -#, c-format -msgid "%sError: incorrect value for option \"%s\"" -msgstr "%sErreur: valeur incorrecte pour l'option \"%s\"" +msgid "%sError: failed to set option \"%s\"" +msgstr "%sErreur: impossible de modifier l'option \"%s\"" #, c-format -msgid "No plugin option found with \"%s\"" -msgstr "Aucune option de configuration d'extension trouvée avec \"%s\"" - -msgid "No plugin option found" -msgstr "Aucune option de configuration d'extension trouvée" +msgid "%sError: configuration option \"%s\" not found" +msgstr "%sErreur: option de configuration \"%s\" non trouvée" -#, c-format -msgid "%s%d%s plugin option found with \"%s\"" -msgid_plural "%s%d%s plugin options found with \"%s\"" -msgstr[0] "%s%d%s option de configuration d'extension trouvée" -msgstr[1] "%s%d%s options de configuration d'extension trouvées avec \"%s\"" +msgid "Option changed" +msgstr "Option modifiée" #, c-format -msgid "%s%d%s plugin option found" -msgid_plural "%s%d%s plugin options found" -msgstr[0] "%s%d%s option de configuration d'extension trouvée" -msgstr[1] "%s%d%s options de configuration d'extension trouvées" +msgid "%sOption not found" +msgstr "%sOption non trouvée" -#, c-format -msgid "%sError: plugin \"%s\" not found" -msgstr "%sErreur: extension \"%s\" non trouvée" +msgid "Option reset" +msgstr "Option réinitialisée" -#, c-format -msgid "Plugin option changed: %s%s = \"%s%s%s\"" -msgstr "Option d'extension modifiée: %s%s = \"%s%s%s\"" - -#, c-format -msgid "%sError: incorrect value for plugin option \"%s\"" -msgstr "%sErreur: valeur incorrecte pour l'option d'extension \"%s\"" +msgid "Option removed" +msgstr "Option supprimée" #, c-format msgid "WeeChat uptime: %d %s %02d:%02d:%02d, started on %s" @@ -516,7 +536,10 @@ msgid "" "[add barname type position size separator item1,item2,...] | [del barname] | " "[set barname name|number|position|size|separator|items value] | [list] | " "[listitems]" -msgstr "[add nombarre type position taille separateur objet1,objet2,...] | [del nombarre] | [set nombarre name|position|size|separator|items valeur] | [list] | [listitems]" +msgstr "" +"[add nombarre type position taille separateur objet1,objet2,...] | [del " +"nombarre] | [set nombarre name|position|size|separator|items valeur] | " +"[list] | [listitems]" msgid "" " add: add a new bar\n" @@ -671,14 +694,18 @@ msgstr "" " regex: expressoin régulière à rechercher dans la ligne (utiliser \\t pour " "séparer le préfixe du message)" -msgid "display help about commands" -msgstr "afficher l'aide sur les commandes" +msgid "display help about commands and options" +msgstr "afficher l'aide sur les commandes et les options" -msgid "[command]" -msgstr "[commande]" +msgid "[command | option]" +msgstr "[commande | option]" -msgid "command: name of a WeeChat or IRC command" -msgstr "commande: nom d'une commande WeeChat ou IRC" +msgid "" +"command: a command name\n" +" option: an option name (use /set to see list)" +msgstr "" +"commande: nom d'une commande\n" +" option: nom d'une option (utilisez /set pour voir la liste)" msgid "show buffer command history" msgstr "affiche l'historique des commandes du tampon" @@ -791,34 +818,29 @@ msgid "[option [ = value]]" msgstr "[option [ = valeur]]" msgid "" -"option: name of an option (if name is full and no value is given, then help " -"is displayed on option)\n" -" value: value for option\n" -"\n" -"Option may be: servername.server_xxx where \"servername\" is an internal " -"server name and \"xxx\" an option for this server." +"option: name of an option\n" +" value: value for option" msgstr "" -"option: nom de l'option (si le nom est complet et qu'aucune valeur n'est " -"donnée, alors l'aide sur l'option est affichée)\n" -"valeur: valeur pour l'option\n" -"\n" -"L'option peut être: nomserveur.server_xxx où \"nomserveur\" est le nom " -"interne d'un serveur et \"xxx\" une option pour ce serveur." +"option: nom d'une option\n" +"valeur: valeur pour l'option" + +msgid "unset/reset config options" +msgstr "supprimer/réinitialiser des options de configuration" -msgid "set plugin config options" -msgstr "modifier des options de configuration des extensions" +msgid "[option]" +msgstr "[option]" msgid "" -"option: name of a plugin option\n" -" value: value for option\n" +"option: name of an option\n" "\n" -"Option is format: plugin.option, example: perl.myscript.item1" +"According to option, it's reset (for standard options) or removed (for " +"optional settings, like server values)." msgstr "" -"option: nom d'une option d'extension\n" -"valeur: valeur pour l'option\n" +"option: nom d'une option\n" "\n" -"L'option est au format: extension.option, par exemple: perl.monscript." -"variable1" +"Selon l'option, elle est réinitialisée (pour les options standards) ou " +"supprimée (pour les options facultatives, comme les valeurs pour les " +"serveurs)." msgid "upgrade WeeChat without disconnecting from servers" msgstr "mettre à jour WeeChat sans se déconnecter des serveurs" @@ -920,6 +942,9 @@ msgid "command executed when WeeChat starts, after loading plugins" msgstr "" "commande exécutée quand WeeChat démarre, après le chargement des extensions" +msgid "WeeChat slogan (if empty, slogan is not used)" +msgstr "slogan WeeChat (si vide, le slogan ne sera pas utilisé)" + msgid "" "if set, uses real white color, disabled by default for terms with white " "background (if you never use white background, you should turn on this " @@ -938,9 +963,6 @@ msgstr "" "définit le titre de la fenêtre (terminal pour l'interface Curses) avec le " "nom et la version" -msgid "WeeChat slogan (if empty, slogan is not used)" -msgstr "slogan WeeChat (si vide, le slogan ne sera pas utilisé)" - msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "nombre de lignes pour le défilement avec scroll_up et scroll_down" @@ -984,9 +1006,6 @@ msgstr "afficher le mode du pseudo ((half)op/voice) devant chaque utilisateur" msgid "display space if nick mode is not (half)op/voice" msgstr "afficher un espace si le mode du pseudo n'est pas (half)op/voice" -msgid "prefix for info messages" -msgstr "préfixe pour les messages d'info" - msgid "prefix for error messages" msgstr "préfixe pour les messages d'erreur" @@ -1086,12 +1105,6 @@ msgstr "" "nombre maximum de lignes pour la détection de collage sans demander à " "l'utilisateur (0 = désactiver cette fonctionnalité)" -msgid "" -"default quit message ('%v' will be replaced by WeeChat version in string)" -msgstr "" -"message de fin par défaut ('%v' sera remplacé par la version de WeeChat dans " -"la chaîne)" - msgid "background color for window separators (when splited)" msgstr "couleur du fond pour les séparateurs de fenêtres (quand divisé)" @@ -1116,9 +1129,6 @@ msgstr "couleur du texte pour l'heure dans la fenêtre de discussion" msgid "text color for time delimiters" msgstr "couleur du texte pour les délimiteurs de l'heure" -msgid "text color for info prefix" -msgstr "couleur du texte pour le préfixe d'info" - msgid "text color for error prefix" msgstr "couleur du texte pour le préfixe d'erreur" @@ -1414,14 +1424,6 @@ msgid "(default options)" msgstr "(options par défaut)" #, c-format -msgid "" -"#\n" -"# %s configuration file, created by %s v%s on %s#\n" -msgstr "" -"#\n" -"# %s: fichier de configuration, créé par %s v%s le %s#\n" - -#, c-format msgid "%sWarning: config file \"%s\" not found" msgstr "%sAttention: fichier de configuration \"%s\" non trouvé." @@ -1781,15 +1783,14 @@ msgid "%s%s: error creating alias \"%s\" => \"%s\"" msgstr "%s%s: erreur en création de l'alias \"%s\" => \"%s\"" #, c-format -msgid "%sAlias \"%s\" => \"%s\" created" -msgstr "%sAlias \"%s\" => \"%s\" créé" +msgid "Alias \"%s\" => \"%s\" created" +msgstr "Alias \"%s\" => \"%s\" créé" msgid "Alias:" msgstr "Alias:" -#, c-format -msgid "%sNo alias found." -msgstr "%sAucun alias trouvé." +msgid "No alias found" +msgstr "Aucun alias trouvé." msgid "List of aliases:" msgstr "Liste des alias:" @@ -1802,8 +1803,8 @@ msgid "%sAlias \"%s\" not found" msgstr "%sAlias \"%s\" non trouvé" #, c-format -msgid "%sAlias \"%s\" removed" -msgstr "%sAlias \"%s\" supprimé" +msgid "Alias \"%s\" removed" +msgstr "Alias \"%s\" supprimé" msgid "create an alias for a command" msgstr "créer un alias pour une commande" @@ -1842,81 +1843,67 @@ msgid "alias_name: name of alias to remove" msgstr "nom_alias: nom de l'alias à supprimer" #, c-format -msgid "%s%s: error creating charset \"%s\" => \"%s\"" -msgstr "%s%s: erreur en création du charset \"%s\" => \"%s\"" +msgid "%s: debug enabled" +msgstr "%s: debug activé" #, c-format -msgid "%sCharset \"%s\" => \"%s\"" -msgstr "%sCharset \"%s\" => \"%s\"" +msgid "%s: debug disabled" +msgstr "%s: debug désactivé" #, c-format -msgid "%s%s: charset \"%s\" not found" -msgstr "%s%s: charset \"%s\" non trouvé" +msgid "%s%s: error creating charset \"%s\" => \"%s\"" +msgstr "%s%s: erreur en création du charset \"%s\" => \"%s\"" + +msgid "global decoding charset" +msgstr "charset de décodage global" + +msgid "global encoding charset" +msgstr "charset d'encodage global" #, c-format -msgid "%sCharset \"%s\" removed" -msgstr "%sCharset \"%s\" supprimé" +msgid "Charset: %s, %s => %s" +msgstr "Charset %s, %s => %s" -msgid "List of charsets:" -msgstr "Liste des charsets:" +#, c-format +msgid "Charset: %s, %s: removed" +msgstr "Charset: %s, %s: supprimé" #, c-format -msgid "List of charsets with \"%s\":" -msgstr "Liste des charsets avec \"%s\":" +msgid "%s%s: missing parameters" +msgstr "%s%s: paramètres manquants" -msgid "No charset found" -msgstr "Aucun charset trouvé" +#, c-format +msgid "%s%s: wrong charset type (decode or encode expected)" +msgstr "%s%s: mauvais type de charset (decode ou encode attendu)" -msgid "No charset defined" -msgstr "Aucun charset défini" +#, c-format +msgid "%s%s: invalid charset: \"%s\"" +msgstr "%s%s: charset invalide: \"%s\"" #, c-format -msgid "%s%s: terminal: %s, internal: %s" -msgstr "%s%s: terminal: %s, interne: %s" +msgid "%s: terminal: %s, internal: %s" +msgstr "%s: terminal: %s, interne: %s" #, c-format -msgid "%s%s: error creating configuration file \"%s\"" -msgstr "%s%s: erreur de création du fichier de configuration \"%s\"" +msgid "%s%s: error creating configuration file" +msgstr "%s%s: erreur de création du fichier de configuration" -msgid "manage charsets" -msgstr "gestion des charsets" +msgid "change charset for current buffer" +msgstr "changer le charset pour le tampon courant" -msgid "[[type.]plugin.string [= charset]]" -msgstr "[[type.]extension.chaine [= charset]]" +msgid "[[decode | encode] charset] | [reset]" +msgstr "[[decode | encode] charset] | [reset]" msgid "" -" type: \"decode\" or \"encode\" (if type is omitted, then both \"decode\" " -"and \"encode\" are set)\n" -" plugin: plugin name\n" -" string: string specific to plugin (for example a server name or server." -"channel for IRC plugin)\n" -"charset: charset to use (if empty, then charset is removed)\n" -"\n" -"Examples :\n" -"/charset decode iso-8859-15 => set global decode charset to iso-8859-15\n" -"/charset encode iso-8859-15 => set global encode charset to iso-8859-15\n" -"/charset decode.irc.freenode => set decode charset to iso-8859-15 for IRC " -"server \"freenode\" (all channels)\n" -"/charset decode.irc.freenode.#weechat => set decode charset to iso-8859-15 " -"for IRC channel \"#weechat\" on server \"freenode\"" -msgstr "" -" type: \"decode\" ou \"encode\" (si le type est omis, alors \"decode\" " -"et \"encode\" sont définis)\n" -"extension: nom d'une extension\n" -" chaine: chaine spécifique à une extension (par exemple un nom de serveur " -"ou serveur.canal pour l'extension IRC)\n" -" charset: charset à utiliser (si non renseigné, alors le charset est " -"supprimé)\n" -"\n" -"Exemples :\n" -"/charset decode iso-8859-15 => définit le charset de décodage global à iso-" -"8859-15\n" -"/charset encode iso-8859-15 => définit le charset d'encodage global à iso-" -"8859-15\n" -"/charset decode.irc.freenode => définit le charset de décodage à iso-8859-15 " -"pour le serveur IRC \"freenode\" (tous les serveurs)\n" -"/charset decode.irc.freenode.#weechat => définit le charset de décodage à " -"iso-8859-15 pour le canal IRC \"#weechat\" sur le serveur \"freenode\"" +" decode: change decoding charset\n" +" encode: change encoding charset\n" +"charset: new charset for current buffer\n" +" reset: reset charsets for current buffer" +msgstr "" +" decode: changer le charset de décodage\n" +" encode: changer le charset d'encodage\n" +"charset: nouveau charset pour le tampon courant\n" +" reset: réinitialiser les charsets pour le tampon courant" msgid "print debug messages" msgstr "affiche des messages de debogage" @@ -1938,22 +1925,10 @@ msgstr "" "windows: affiche l'arbre des fenêtres<\n" " texte: envoie le signal \"debug\" avec \"texte\" comme paramètre" -#, c-format -msgid "%s: debug enabled" -msgstr "%s: debug activé" - -#, c-format -msgid "%s: debug disabled" -msgstr "%s: debug désactivé" - msgid "demo message without prefix" msgstr "message de démonstration sans préfixe" #, c-format -msgid "%sdemo message with info prefix" -msgstr "%smessage de démonstration avec un préfixe d'info" - -#, c-format msgid "%sdemo message with error prefix" msgstr "%smessage de démonstration avec préfixe d'erreur" @@ -2035,8 +2010,8 @@ msgstr "" "input_mask, input_pos)" #, c-format -msgid "%s%s: pipe open" -msgstr "%s%s: tube ouvert" +msgid "%s: pipe open" +msgstr "%s: tube ouvert" #, c-format msgid "%s%s: unable to open pipe (%s) for reading" @@ -2047,8 +2022,8 @@ msgid "%s%s: unable to create pipe for remote control (%s)" msgstr "%s%s: impossible de créer le tube pour le contrôle à distance (%s)" #, c-format -msgid "%s%s: pipe closed" -msgstr "%s%s: tube fermé" +msgid "%s: pipe closed" +msgstr "%s: tube fermé" #, c-format msgid "%s%s: error, invalid text received on pipe" @@ -2075,12 +2050,12 @@ msgid "%s%s: cannot find nick for sending message" msgstr "%s%s: impossible de trouver le pseudo pour envoyer le message" #, c-format -msgid "%s%s: future away on %s%s%s: %s" -msgstr "%s%s: future absence sur %s%s%s: %s" +msgid "%s: future away on %s%s%s: %s" +msgstr "%s: future absence sur %s%s%s: %s" #, c-format -msgid "%s%s: future away on %s%s%s removed" -msgstr "%s%s: future absence sur %s%s%s supprimée" +msgid "%s: future away on %s%s%s removed" +msgstr "%s: future absence sur %s%s%s supprimée" #, c-format msgid "%s%s: \"%s\" command can only be executed in a channel buffer" @@ -2100,8 +2075,8 @@ msgid "%s%s: missing argument for \"%s\" option" msgstr "%s%s: paramètre manquant pour l'option \"%s\"" #, c-format -msgid "%s%s: server %s%s%s created (temporary server, NOT SAVED!)" -msgstr "%s%s: serveur %s%s%s créé (serveur temporaire, NON SAUVE !)" +msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" +msgstr "%s: serveur %s%s%s créé (serveur temporaire, NON SAUVE !)" #, c-format msgid "%s%s: unable to create server \"%s\"" @@ -2121,8 +2096,8 @@ msgid "%s%s: not connected to server \"%s\"!" msgstr "%s%s: non connecté au serveur \"%s\" !" #, c-format -msgid "%s%s: auto-reconnection is cancelled" -msgstr "%s%s: la reconnexion automatique est annulée" +msgid "%s: auto-reconnection is cancelled" +msgstr "%s: la reconnexion automatique est annulée" #, c-format msgid "%s%s: server \"%s\" not found" @@ -2170,8 +2145,8 @@ msgid "%s%s: server \"%s\" already exists, can't create it!" msgstr "%s%s: le serveur \"%s\" existe déjà, impossible de le créer !" #, c-format -msgid "%s%s: server %s%s%s created" -msgstr "%s%s: serveur %s%s%s créé" +msgid "%s: server %s%s%s created" +msgstr "%s: serveur %s%s%s créé" #, c-format msgid "%s%s: unable to create server" @@ -2186,20 +2161,20 @@ msgid "%s%s: server \"%s\" already exists for \"%s\" command" msgstr "%s%s: le serveur \"%s\" existe déjà pour la commande \"%s\"" #, c-format -msgid "%s%s: Server %s%s%s has been copied to %s%s" -msgstr "%s%s: le serveur %s%s%s a été copié vers %s%s" +msgid "%s: server %s%s%s has been copied to %s%s" +msgstr "%s: le serveur %s%s%s a été copié vers %s%s" #, c-format -msgid "%s%s: server %s%s%s has been renamed to %s%s" -msgstr "%s%s: le serveur %s%s%s a été renommé en %s%s" +msgid "%s: server %s%s%s has been renamed to %s%s" +msgstr "%s: le serveur %s%s%s a été renommé en %s%s" #, c-format msgid "%s%s: server \"%s\" is not a temporary server" msgstr "%s%s: le serveur \"%s\" n'est pas un serveur temporaire" #, c-format -msgid "%s%s: server %s%s%s is not temporary any more" -msgstr "%s%s: le serveur %s%s%s n'est plus temporaire" +msgid "%s: server %s%s%s is not temporary any more" +msgstr "%s: le serveur %s%s%s n'est plus temporaire" #, c-format msgid "" @@ -2210,15 +2185,15 @@ msgstr "" "dessus. Essayez /disconnect %s avant." #, c-format -msgid "%s%s: Server %s%s%s has been deleted" -msgstr "%s%s: le serveur %s%s%s a été supprimé" +msgid "%s: Server %s%s%s has been deleted" +msgstr "%s: le serveur %s%s%s a été supprimé" #, c-format msgid "" -"%s%s: messages outqueue DELETED for all servers. Some messages from you or " +"%s: messages outqueue DELETED for all servers. Some messages from you or " "WeeChat may have been lost!" msgstr "" -"%s%s: la file d'attente de messages sortants a été SUPPRIMEE. Quelques " +"%s: la file d'attente de messages sortants a été SUPPRIMEE. Quelques " "messages de vous ou WeeChat risquent d'être perdus !" #, c-format @@ -2979,6 +2954,16 @@ msgid "%sirc: too few arguments for \"%s\" command" msgstr "%sirc: pas assez de paramètres pour la commande \"%s\"" #, c-format +msgid "%s%s: error creating server \"%s\"" +msgstr "%s%s: erreur de création du serveur \"%s\"" + +#, c-format +msgid "%s%s: error creating option \"%s\" for server \"%s\" (server not found)" +msgstr "" +"%s%s: erreur de création de l'option \"%s\" pour le serveur \"%s\" (server " +"non trouvé)" + +#, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" @@ -2986,18 +2971,81 @@ msgstr "" "%s%s: attention: le serveur \"%s\" n'a pas été trouvé dans le fichier de " "configuration, non supprimé en mémoire car il est en cours d'utilisation" -#, c-format -msgid "%s%s: value \"%s\" is invalid for option \"%s\"" -msgstr "%s%s: valeur \"%s\" invalide pour l'option \"%s\"" +msgid "automatically connect to server when WeeChat is starting" +msgstr "connexion automatique au serveur quand WeeChat démarre" -#, c-format -msgid "%s%s: option \"%s\" not found" -msgstr "%s%s: option \"%s\" non trouvée" +msgid "automatically reconnect to server when disconnected" +msgstr "reconnexion automatique au serveur après une déconnexion" -#, c-format -msgid "%s%s: error creating server for reading configuration file" +msgid "delay (in seconds) before trying again to reconnect to server" +msgstr "délai (en secondes) avant de tenter une reconnexion au serveur" + +msgid "list of IP/port or hostname/port for server (separated by comma)" +msgstr "liste d'IP/port ou nom/port pour le serveur (séparés par des virgules)" + +msgid "use IPv6 protocol for server communication" +msgstr "utiliser le protocole IPv6 pour la communication avec le serveur" + +msgid "use SSL for server communication" +msgstr "utiliser SSL pour la communication avec le serveur" + +msgid "password for IRC server" +msgstr "mot de passe pour le serveur IRC" + +msgid "nicknames to use on IRC server (separated by comma)" +msgstr "pseudos à utiliser sur le serveur IRC (séparés par des virgules)" + +msgid "user name to use on IRC server" +msgstr "nom d'utilisateur pour le serveur IRC" + +msgid "real name to use on IRC server" +msgstr "nom réel pour le serveur IRC" + +msgid "" +"custom hostname/IP for server (optional, if empty local hostname is used)" +msgstr "" +"nom de machine/IP personnalisé pour le serveur (optionnel, si non renseigné, " +"le nom de machine local est utilisé)" + +msgid "" +"command(s) to run when connected to server (many commands should be " +"separated by ';', use '\\;' for a semicolon, special variables $nick, " +"$channel and $server are replaced by their value)" +msgstr "" +"commande(s) à exécuter lorsque connecté au serveur (plusieurs commandes " +"doivent être séparées par ';', utilisez '\\;' pour un point-virgule, les " +"variables spéciales $nick, $channel et $server sont remplacées par leur " +"valeur)" + +msgid "" +"delay (in seconds) after command was executed (example: give some time for " +"authentication)" +msgstr "" +"délai (en secondes) après exécution de la commande (exemple: donner du temps " +"pour l'authentification)" + +msgid "" +"comma separated list of channels to join when connected to server (example: " +"\"#chan1,#chan2,#chan3 key1,key2\")" +msgstr "" +"liste des canaux (séparés par des virgules) à rejoindre lorsque connecté au " +"serveur (exemple: \"#chan1,#chan2,#chan3 key1,key2\")" + +msgid "automatically rejoin channels when kicked" +msgstr "rejoindre automatiquement les canaux quand mis dehors" + +msgid "" +"comma separated list of notify levels for channels of this server (format: " +"#channel:1,..), a channel name '*' is reserved for server default notify " +"level" msgstr "" -"%s%s: erreur de création du serveur pour lire le fichier de configuration" +"liste des niveaux de notifications (séparés par des virgules) pour les " +"canaux de ce serveur (format: #canal:1,..), un nom de canal '*' est réservé " +"pour la notification par défaut du serveur" + +#, c-format +msgid "%s%s: error creating server option \"%s\"" +msgstr "%s%s: erreur de création de l'option serveur \"%s\"" msgid "use same buffer for all servers" msgstr "utiliser le même tampon pour tous les serveurs" @@ -3022,15 +3070,30 @@ msgstr "affiche un message pour l'absence/le retour" msgid "show remote away message only once in private" msgstr "voir le message d'absence distant une seule fois en privé" +msgid "display notices as private messages" +msgstr "afficher les notices comme des messages privés" + +msgid "" +"comma separated list of words to highlight (case insensitive comparison, " +"words may begin or end with \"*\" for partial match)" +msgstr "" +"liste des mots pour la notification (séparés par des virgules, la " +"comparaison ne tient pas compte de la casse, les mots peuvent commencer ou " +"se terminer par \"*\" pour une comparaison partielle)" + msgid "" "default part message (leaving channel) ('%v' will be replaced by WeeChat " "version in string)" msgstr "" -"message par défaut pour le part (quitte un canal) ('%v' sera remplacé par la " -"version de WeeChat dans la chaîne)" +"message par défaut pour le part (en quittant un canal) ('%v' sera remplacé " +"par la version de WeeChat dans la chaîne)" -msgid "display notices as private messages" -msgstr "afficher les notices comme des messages privés" +msgid "" +"default quit message (disconnecting from server) ('%v' will be replaced by " +"WeeChat version in string)" +msgstr "" +"message de fin par défaut (lors de la déconnexion du serveur) ('%v' sera " +"remplacé par la version de WeeChat dans la chaîne)" msgid "interval between two checks for away (in minutes, 0 = never check)" msgstr "" @@ -3060,14 +3123,6 @@ msgstr "" "anti-flood: nombre de secondes entre deux messages utilisateur (0 = pas " "d'anti-flood)" -msgid "" -"comma separated list of words to highlight (case insensitive comparison, " -"words may begin or end with \"*\" for partial match)" -msgstr "" -"liste des mots pour la notification (séparés par des virgules, la " -"comparaison ne tient pas compte de la casse, les mots peuvent commencer ou " -"se terminer par \"*\" pour une comparaison partielle)" - msgid "when off, colors codes are ignored in incoming messages" msgstr "si désactivé, les codes couleurs des messages entrants sont ignorés" @@ -3150,81 +3205,6 @@ msgstr "enregistrer automatiquement les conversations privées" msgid "hide password displayed by nickserv" msgstr "masquer le mot de passe affiché par nickserv" -msgid "name associated to IRC server (for display only)" -msgstr "nom associé au serveur IRC (pour affichage seulement)" - -msgid "automatically connect to server when WeeChat is starting" -msgstr "connexion automatique au serveur quand WeeChat démarre" - -msgid "automatically reconnect to server when disconnected" -msgstr "reconnexion automatique au serveur après une déconnexion" - -msgid "delay (in seconds) before trying again to reconnect to server" -msgstr "délai (en secondes) avant de tenter une reconnexion au serveur" - -msgid "list of IP/port or hostname/port for server (separated by comma)" -msgstr "liste d'IP/port ou nom/port pour le serveur (séparés par des virgules)" - -msgid "use IPv6 protocol for server communication" -msgstr "utiliser le protocole IPv6 pour la communication avec le serveur" - -msgid "use SSL for server communication" -msgstr "utiliser SSL pour la communication avec le serveur" - -msgid "password for IRC server" -msgstr "mot de passe pour le serveur IRC" - -msgid "nicknames to use on IRC server (separated by comma)" -msgstr "pseudos à utiliser sur le serveur IRC (séparés par des virgules)" - -msgid "user name to use on IRC server" -msgstr "nom d'utilisateur pour le serveur IRC" - -msgid "real name to use on IRC server" -msgstr "nom réel pour le serveur IRC" - -msgid "" -"custom hostname/IP for server (optional, if empty local hostname is used)" -msgstr "" -"nom de machine/IP personnalisé pour le serveur (optionnel, si non renseigné, " -"le nom de machine local est utilisé)" - -msgid "" -"command(s) to run when connected to server (many commands should be " -"separated by ';', use '\\;' for a semicolon, special variables $nick, " -"$channel and $server are replaced by their value)" -msgstr "" -"commande(s) à exécuter lorsque connecté au serveur (plusieurs commandes " -"doivent être séparées par ';', utilisez '\\;' pour un point-virgule, les " -"variables spéciales $nick, $channel et $server sont remplacées par leur " -"valeur)" - -msgid "" -"delay (in seconds) after command was executed (example: give some time for " -"authentication)" -msgstr "" -"délai (en secondes) après exécution de la commande (exemple: donner du temps " -"pour l'authentification)" - -msgid "" -"comma separated list of channels to join when connected to server (example: " -"\"#chan1,#chan2,#chan3 key1,key2\")" -msgstr "" -"liste des canaux (séparés par des virgules) à rejoindre lorsque connecté au " -"serveur (exemple: \"#chan1,#chan2,#chan3 key1,key2\")" - -msgid "automatically rejoin channels when kicked" -msgstr "rejoindre automatiquement les canaux quand mis dehors" - -msgid "" -"comma separated list of notify levels for channels of this server (format: " -"#channel:1,..), a channel name '*' is reserved for server default notify " -"level" -msgstr "" -"liste des niveaux de notifications (séparés par des virgules) pour les " -"canaux de ce serveur (format: #canal:1,..), un nom de canal '*' est réservé " -"pour la notification par défaut du serveur" - msgid "Waiting" msgstr "Attente" @@ -3731,10 +3711,10 @@ msgstr "" "de la connexion avec le serveur" #, c-format -msgid "%s%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" +msgid "%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" msgstr "" -"%s%s: le pseudo \"%s\" est déjà en cours d'utilisation, essai avec le pseudo " -"n°%d (\"%s\")" +"%s: le pseudo \"%s\" est déjà en cours d'utilisation, essai avec le pseudo n°" +"%d (\"%s\")" msgid "error received from IRC server" msgstr "erreur reçue du serveur IRC" @@ -4083,16 +4063,16 @@ msgstr "" "%s%s: impossible de lire des données sur la socket, déconnexion du serveur..." #, c-format -msgid "%s%s: lag is high, disconnecting from server..." -msgstr "%s%s: le lag est élevé, déconnexion du serveur..." +msgid "%s: lag is high, disconnecting from server..." +msgstr "%s: le lag est élevé, déconnexion du serveur..." #, c-format -msgid "%s%s: reconnecting to server in %d %s" -msgstr "%s%s: reconnexion au serveur dans %d %s" +msgid "%s: reconnecting to server in %d %s" +msgstr "%s: reconnexion au serveur dans %d %s" #, c-format -msgid "%s%s: switching address to %s/%d" -msgstr "%s%s: bascule vers l'adresse %s/%d" +msgid "%s: switching address to %s/%d" +msgstr "%s: bascule vers l'adresse %s/%d" #, c-format msgid "%s%s: GnuTLS handshake failed" @@ -4135,6 +4115,15 @@ msgid "%s%s: unable to set local hostname/IP" msgstr "%s%s: impossible de paramétrer le nom/IP local" #, c-format +msgid "%s%s: addresses not defined for server \"%s\", cannot connect" +msgstr "" +"%s%s: adresses non définies pour le serveur \"%s\", connexion impossible" + +#, c-format +msgid "%s%s: nicks not defined for server \"%s\", cannot connect" +msgstr "%s%s: pseudos non définis pour le serveur \"%s\", connexion impossible" + +#, c-format msgid "" "%s%s: cannot connect with SSL since WeeChat was not built with GnuTLS support" msgstr "" @@ -4142,18 +4131,14 @@ msgstr "" "avec le support GnuTLS" #, c-format -msgid "%s%s: connecting to server %s/%d%s%s via %s proxy %s/%d%s..." -msgstr "%s%s: connexion au serveur %s/%d%s%s via le proxy %s %s/%d%s..." +msgid "%s: connecting to server %s/%d%s%s via %s proxy %s/%d%s..." +msgstr "%s: connexion au serveur %s/%d%s%s via le proxy %s %s/%d%s..." #, c-format msgid "Connecting to server %s/%d%s%s via %s proxy %s/%d%s..." msgstr "Connexion au serveur %s/%d%s%s via le proxy %s %s/%d%s..." #, c-format -msgid "%s%s: connecting to server %s/%d%s%s..." -msgstr "%s%s: connexion au serveur %s/%d%s%s..." - -#, c-format msgid "%s: connecting to server %s/%d%s%s..." msgstr "%s: connexion au serveur %s/%d%s%s..." @@ -4178,12 +4163,12 @@ msgid "%s%s: cannot set socket option \"SO_KEEPALIVE\"" msgstr "%s%s: impossible d'activer l'option socket \"SO_KEEPALIVE\"" #, c-format -msgid "%s%s: reconnecting to server..." -msgstr "%s%s: reconnexion au serveur..." +msgid "%s: reconnecting to server..." +msgstr "%s: reconnexion au serveur..." #, c-format -msgid "%s%s: disconnected from server" -msgstr "%s%s: déconnecté du serveur" +msgid "%s: disconnected from server" +msgstr "%s: déconnecté du serveur" #, c-format msgid "%s%s: unable to write log file \"%s\"" @@ -4242,12 +4227,16 @@ msgstr "" "%sErreur: impossible de charger l'extension \"%s\" (mémoire insuffisante)" #, c-format -msgid "%sPlugin \"%s\" loaded" -msgstr "%sExtension \"%s\" chargée" +msgid "Plugin \"%s\" loaded" +msgstr "Extension \"%s\" chargée" #, c-format -msgid "%sPlugin \"%s\" unloaded" -msgstr "%sExtension \"%s\" déchargée" +msgid "Plugin \"%s\" unloaded" +msgstr "Extension \"%s\" déchargée" + +#, c-format +msgid "%sError: plugin \"%s\" not found" +msgstr "%sErreur: extension \"%s\" non trouvée" #, c-format msgid "" @@ -4258,8 +4247,8 @@ msgstr "" "même nom)" #, c-format -msgid "%s%s: registered script \"%s\", version %s (%s)" -msgstr "%s%s: script \"%s\" chargé, version %s (%s)" +msgid "%s: registered script \"%s\", version %s (%s)" +msgstr "%s: script \"%s\" chargé, version %s (%s)" #, c-format msgid "%s%s: unable to run function \"%s\"" @@ -4274,8 +4263,8 @@ msgid "%s%s: script \"%s\" not found" msgstr "%s%s: script \"%s\" non trouvé" #, c-format -msgid "%s%s: loading script \"%s\"" -msgstr "%s%s: chargement du script \"%s\"" +msgid "%s: loading script \"%s\"" +msgstr "%s: chargement du script \"%s\"" #, c-format msgid "%s%s: unable to create new sub-interpreter" @@ -4299,12 +4288,12 @@ msgstr "" "%s%s: fonction \"register\" non trouvée (ou a échoué) dans le fichier \"%s\"" #, c-format -msgid "%s%s: unloading script \"%s\"" -msgstr "%s%s: déchargement du script \"%s\"" +msgid "%s: unloading script \"%s\"" +msgstr "%s: déchargement du script \"%s\"" #, c-format -msgid "%s%s: script \"%s\" unloaded" -msgstr "%s%s: script \"%s\" déchargé" +msgid "%s: script \"%s\" unloaded" +msgstr "%s: script \"%s\" déchargé" #, c-format msgid "%s%s: script \"%s\" not loaded" @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-04-03 18:09+0200\n" +"POT-Creation-Date: 2008-04-11 18:29+0200\n" "PO-Revision-Date: 2007-10-10 18:07+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -66,12 +66,12 @@ msgstr "" " -v, --version WeeChat verziójának mutatása\n" " -w, --weechat-commands WeeChat parancsok mutatása\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, fuzzy, c-format msgid "%s configuration options:\n" msgstr "konfigurációs paraméterek beállítása" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s internal commands:\n" msgstr "%s belső parancsok:\n" @@ -79,7 +79,7 @@ msgstr "%s belső parancsok:\n" msgid "Internal key functions:\n" msgstr "Belső billentyűfunkciók:\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s default keys:\n" msgstr "%s alapértelmezett billentyűk:\n" @@ -209,7 +209,7 @@ msgstr "" "%s helytelen értesítési szint (az értéknek %d és %d között kell lennie)\n" #, fuzzy, c-format -msgid "%sNew notify level for %s%s%s: %d %s" +msgid "New notify level for %s%s%s: %d %s" msgstr "A %s%s%s új értesítési szintje: %s%d %s" #, fuzzy @@ -275,7 +275,7 @@ msgstr "%s a \"%s\" modul nem található\n" msgid "%sError: wrong filter number" msgstr "%s helytelen pufferszám\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, fuzzy, c-format msgid "%s internal commands:" msgstr "%s belső parancsok:\n" @@ -297,7 +297,51 @@ msgid "plugin:" msgstr " (nem található bővítőmodul)\n" #, fuzzy, c-format -msgid "%sNo help available, \"%s\" is an unknown command" +msgid "Option \"%s%s%s\": %s" +msgstr "Felhasználók a %s%s%s szobában: %s[" + +#, fuzzy +msgid " type: boolean ('on' or 'off')" +msgstr " . típus logikai (értékek: 'on' vagy 'off')\n" + +#, c-format +msgid " value: %s%s%s (default: %s)" +msgstr "" + +#, fuzzy, c-format +msgid " type: string (%s)" +msgstr " . típus: szöveg\n" + +#, c-format +msgid " value: '%s%s%s' (default: '%s')" +msgstr "" + +#, fuzzy, c-format +msgid " type: integer (between %d and %d)" +msgstr " . típus szám (értékek: %d és %d között)\n" + +#, c-format +msgid " value: %s%d%s (default: %d)" +msgstr "" + +#, fuzzy +msgid " type: string (any string)" +msgstr " . típus szöveg (bármilyen szöveg)\n" + +#, fuzzy +msgid " type: char (any char)" +msgstr " . típus: karakter (bármilyen karakter)\n" + +#, fuzzy, c-format +msgid " type: string (limit: %d chars)" +msgstr " . típus szöveg (bármilyen szöveg, korlát: %d karakter)\n" + +#, fuzzy +msgid " type: color (values depend on GUI used)" +msgstr " . értékek: %d és %d között\n" + +#, fuzzy, c-format +msgid "%sNo help available, \"%s\" is not a command or an option" msgstr "Nem érhető el segítség, a \"%s\" ismeretlen parancs\n" #, fuzzy @@ -305,7 +349,7 @@ msgid "Buffer command history:" msgstr "a pufferben kiadott parancsok előzményének mutatása" #, fuzzy, c-format -msgid "%sNew key binding: %s%s => %s%s%s%s%s" +msgid "New key binding: %s%s => %s%s%s%s%s" msgstr "Új billentyűparancs: %s" #, fuzzy @@ -316,8 +360,8 @@ msgstr "Billentyűparancsok:\n" msgid "Internal key functions:" msgstr "Belső billentyűfunkciók:\n" -#, fuzzy, c-format -msgid "%sDefault key bindings restored" +#, fuzzy +msgid "Default key bindings restored" msgstr "Alapértelmezett billentyűparancsok visszaállítva\n" #, fuzzy, c-format @@ -327,7 +371,7 @@ msgstr "" "visszaállításához (biztonsági okokból)\n" #, fuzzy, c-format -msgid "%sKey \"%s\" unbound" +msgid "Key \"%s\" unbound" msgstr "A(z) \"%s\" billentyűparancs visszavonva\n" #, fuzzy, c-format @@ -446,7 +490,7 @@ msgid "%sError: wrong argument count for \"%s\" command" msgstr "%s rossz argumentum szám a \"%s\" parancsnak\n" #, fuzzy, c-format -msgid "%sOptions reloaded from %s" +msgid "Options reloaded from %s" msgstr "Modul beállítások elmentve\n" #, fuzzy, c-format @@ -454,11 +498,11 @@ msgid "%sError: failed to reload options from %s" msgstr "%s nem sikerült a modul opciókat elmenteni\n" #, fuzzy, c-format -msgid "%sUnknown configuration file \"%s\"" +msgid "Unknown configuration file \"%s\"" msgstr "szerver konfigurációs fájljának újraolvastatása" #, fuzzy, c-format -msgid "%sOptions saved to %s" +msgid "Options saved to %s" msgstr "Modul beállítások elmentve\n" #, fuzzy, c-format @@ -468,17 +512,19 @@ msgstr "%s nem sikerült a modul opciókat elmenteni\n" msgid "(unknown)" msgstr "(ismeretlen)" -#, fuzzy, c-format -msgid "No configuration option found with \"%s\"" -msgstr "Nem találtam beállítási lehetőséget a \"%s\" szóhoz\n" +#, c-format +msgid "" +"%sOption \"%s\" not found (tip: you can use \"*\" at beginning and/or end of " +"option to see a sublist)" +msgstr "" #, fuzzy msgid "No configuration option found" msgstr "Nem található az opció\n" #, fuzzy, c-format -msgid "%s%d%s configuration option found with \"%s\"" -msgid_plural "%s%d%s configuration options found with \"%s\"" +msgid "%s%d%s configuration option found matching with \"%s\"" +msgid_plural "%s%d%s configuration options found matching with \"%s\"" msgstr[0] "a \"%s\" kifejezéshez tartozó opciót találtam\n" msgstr[1] "a \"%s\" kifejezéshez tartozó opciót találtam\n" @@ -489,48 +535,28 @@ msgstr[0] "megtalált opciók\n" msgstr[1] "megtalált opciók\n" #, fuzzy, c-format +msgid "%sError: failed to set option \"%s\"" +msgstr "%s nem sikerült a modul opciókat elmenteni\n" + +#, fuzzy, c-format msgid "%sError: configuration option \"%s\" not found" msgstr "%s a \"%s\" opció nem található\n" #, fuzzy -msgid "Option changed: " +msgid "Option changed" msgstr "nincs a szobában" #, fuzzy, c-format -msgid "%sError: incorrect value for option \"%s\"" -msgstr "%s helytelen érték a \"%s\" paraméternek\n" - -#, fuzzy, c-format -msgid "No plugin option found with \"%s\"" -msgstr "A(z) \"%s\" kifejezéshez nem található modul opció\n" - -#, fuzzy -msgid "No plugin option found" -msgstr "Nem található modul opció\n" - -#, fuzzy, c-format -msgid "%s%d%s plugin option found with \"%s\"" -msgid_plural "%s%d%s plugin options found with \"%s\"" -msgstr[0] "A(z) \"%s\" kifejezéshez nem található modul opció\n" -msgstr[1] "A(z) \"%s\" kifejezéshez nem található modul opció\n" - -#, fuzzy, c-format -msgid "%s%d%s plugin option found" -msgid_plural "%s%d%s plugin options found" -msgstr[0] "Nem található modul opció\n" -msgstr[1] "Nem található modul opció\n" - -#, fuzzy, c-format -msgid "%sError: plugin \"%s\" not found" +msgid "%sOption not found" msgstr "%s a \"%s\" modul nem található\n" -#, fuzzy, c-format -msgid "Plugin option changed: %s%s = \"%s%s%s\"" -msgstr "A(z) \"%s\" kifejezéshez nem található modul opció\n" +#, fuzzy +msgid "Option reset" +msgstr "Modul beállítások elmentve\n" -#, fuzzy, c-format -msgid "%sError: incorrect value for plugin option \"%s\"" -msgstr "%s helytelen érték a(z) \"%s\" modul paraméternek\n" +#, fuzzy +msgid "Option removed" +msgstr "nincs a szobában" #, c-format msgid "WeeChat uptime: %d %s %02d:%02d:%02d, started on %s" @@ -692,13 +718,18 @@ msgid "" "from message)" msgstr "" -msgid "display help about commands" +#, fuzzy +msgid "display help about commands and options" msgstr "segítség megjelenítése a parancsokhoz" -msgid "[command]" +#, fuzzy +msgid "[command | option]" msgstr "[parancs]" -msgid "command: name of a WeeChat or IRC command" +#, fuzzy +msgid "" +"command: a command name\n" +" option: an option name (use /set to see list)" msgstr "parancs: WeeChat vagy IRC parancs neve" msgid "show buffer command history" @@ -805,33 +836,24 @@ msgid "[option [ = value]]" msgstr "[opció [ = érték]]" msgid "" -"option: name of an option (if name is full and no value is given, then help " -"is displayed on option)\n" -" value: value for option\n" -"\n" -"Option may be: servername.server_xxx where \"servername\" is an internal " -"server name and \"xxx\" an option for this server." +"option: name of an option\n" +" value: value for option" msgstr "" -"opció: az opció neve (ha a név teljes és nincs érték megadva, akkor " -"megjeleníti az opcióhoz tartozó segítséget\n" -"érték: az opcióhoz tartozó érték\n" -"\n" -"A opció lehet: szervernév.szerver_xxx, ahol a \"szervernév\" egy belső " -"szervernév és az \"xxx\" a szerver egyik opciója." -msgid "set plugin config options" -msgstr "modul opcióinak beállítása" +#, fuzzy +msgid "unset/reset config options" +msgstr "konfigurációs paraméterek beállítása" + +#, fuzzy +msgid "[option]" +msgstr "[parancs]" msgid "" -"option: name of a plugin option\n" -" value: value for option\n" +"option: name of an option\n" "\n" -"Option is format: plugin.option, example: perl.myscript.item1" +"According to option, it's reset (for standard options) or removed (for " +"optional settings, like server values)." msgstr "" -"opció: modul opció neve\n" -"érték: az opció értéke\n" -"\n" -"Az opció formája: modul.opció, például: perl.azénszkriptem.azénopcióm" msgid "upgrade WeeChat without disconnecting from servers" msgstr "WeeChat frissítése a szerverekről való lecsatlakozás nélkül" @@ -929,6 +951,9 @@ msgstr "" msgid "command executed when WeeChat starts, after loading plugins" msgstr "" +msgid "WeeChat slogan (if empty, slogan is not used)" +msgstr "WeeChat szlogen (ha üres, akkor nem használja a program)" + msgid "" "if set, uses real white color, disabled by default for terms with white " "background (if you never use white background, you should turn on this " @@ -948,9 +973,6 @@ msgstr "" "ablak címsorának beállítása (Curses GUI esetén a terminálé) a program nevére " "és verziójára" -msgid "WeeChat slogan (if empty, slogan is not used)" -msgstr "WeeChat szlogen (ha üres, akkor nem használja a program)" - msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "a scroll_up és scroll_down hány sort görgessen" @@ -994,10 +1016,6 @@ msgid "display space if nick mode is not (half)op/voice" msgstr "szóköz megjelenítése, ha a mód nem (fél)operátor/voice" #, fuzzy -msgid "prefix for info messages" -msgstr "új üzenetet tartalmazó ablak színe" - -#, fuzzy msgid "prefix for error messages" msgstr "hibakereső üzenetek megjelenítése" @@ -1095,12 +1113,6 @@ msgstr "" "maximálisan beilleszthető sorok száma a felhasználó megkérdezése nélkül (0 = " "szolgáltatás kikapcsolása)" -msgid "" -"default quit message ('%v' will be replaced by WeeChat version in string)" -msgstr "" -"alapértelmezett kilépő üzenet (a '%v' változó a WeeChat verziójára " -"cserélődik)" - #, fuzzy msgid "background color for window separators (when splited)" msgstr "ablakelválasztó színe (ha meg van osztva)" @@ -1134,10 +1146,6 @@ msgid "text color for time delimiters" msgstr "információs pult határolóinak színe" #, fuzzy -msgid "text color for info prefix" -msgstr "információs pult szövegének színe" - -#, fuzzy msgid "text color for error prefix" msgstr "belépési nyíl színe" @@ -1494,14 +1502,6 @@ msgid "(default options)" msgstr "" #, fuzzy, c-format -msgid "" -"#\n" -"# %s configuration file, created by %s v%s on %s#\n" -msgstr "" -"#\n" -"# %s konfigurációs fájl, készítette: %s v%s - %s" - -#, fuzzy, c-format msgid "%sWarning: config file \"%s\" not found" msgstr "%s a \"%s\" beállítófájl nem található.\n" @@ -1865,15 +1865,15 @@ msgid "%s%s: error creating alias \"%s\" => \"%s\"" msgstr "%s nincs elég memória az információs pult üzenethez\n" #, fuzzy, c-format -msgid "%sAlias \"%s\" => \"%s\" created" +msgid "Alias \"%s\" => \"%s\" created" msgstr "A \"%s\" => \"%s\" aliasz elkészült\n" #, fuzzy msgid "Alias:" msgstr "Aliasz:\n" -#, fuzzy, c-format -msgid "%sNo alias found." +#, fuzzy +msgid "No alias found" msgstr "Nem találtam aliaszt.\n" #, fuzzy @@ -1889,7 +1889,7 @@ msgid "%sAlias \"%s\" not found" msgstr "%s cím \"%s\" nem található\n" #, fuzzy, c-format -msgid "%sAlias \"%s\" removed" +msgid "Alias \"%s\" removed" msgstr "A \"%s\" aliasz eltávolítva\n" msgid "create an alias for a command" @@ -1930,67 +1930,63 @@ msgid "alias_name: name of alias to remove" msgstr "alias_név: az eltávolítandó alias neve" #, fuzzy, c-format +msgid "%s: debug enabled" +msgstr "FIFO cső nyitva\n" + +#, c-format +msgid "%s: debug disabled" +msgstr "" + +#, fuzzy, c-format msgid "%s%s: error creating charset \"%s\" => \"%s\"" msgstr "%s nincs elég memória az információs pult üzenethez\n" -#, fuzzy, c-format -msgid "%sCharset \"%s\" => \"%s\"" -msgstr "A \"%s\" => \"%s\" aliasz elkészült\n" +msgid "global decoding charset" +msgstr "" + +msgid "global encoding charset" +msgstr "" #, fuzzy, c-format -msgid "%s%s: charset \"%s\" not found" -msgstr "%s a \"%s\" szerver nem található\n" +msgid "Charset: %s, %s => %s" +msgstr "A \"%s\" => \"%s\" aliasz elkészült\n" #, fuzzy, c-format -msgid "%sCharset \"%s\" removed" +msgid "Charset: %s, %s: removed" msgstr "A \"%s\" aliasz eltávolítva\n" -#, fuzzy -msgid "List of charsets:" -msgstr "Aliaszok listája:\n" - #, fuzzy, c-format -msgid "List of charsets with \"%s\":" -msgstr "Aliaszok listája:\n" +msgid "%s%s: missing parameters" +msgstr "%s hiányzó argumentum a(z) \"%s\" opciónak\n" -#, fuzzy -msgid "No charset found" -msgstr "Nem találtam billentyűt.\n" +#, c-format +msgid "%s%s: wrong charset type (decode or encode expected)" +msgstr "" -#, fuzzy -msgid "No charset defined" -msgstr "Nincs aliasz definiálva.\n" +#, fuzzy, c-format +msgid "%s%s: invalid charset: \"%s\"" +msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" #, fuzzy, c-format -msgid "%s%s: terminal: %s, internal: %s" +msgid "%s: terminal: %s, internal: %s" msgstr "%s a \"%s\" modul nem található\n" #, fuzzy, c-format -msgid "%s%s: error creating configuration file \"%s\"" +msgid "%s%s: error creating configuration file" msgstr "szerver konfigurációs fájljának újraolvastatása" #, fuzzy -msgid "manage charsets" -msgstr "pufferek kezelése" +msgid "change charset for current buffer" +msgstr "szobanév nem található a pufferhez" -msgid "[[type.]plugin.string [= charset]]" +msgid "[[decode | encode] charset] | [reset]" msgstr "" msgid "" -" type: \"decode\" or \"encode\" (if type is omitted, then both \"decode\" " -"and \"encode\" are set)\n" -" plugin: plugin name\n" -" string: string specific to plugin (for example a server name or server." -"channel for IRC plugin)\n" -"charset: charset to use (if empty, then charset is removed)\n" -"\n" -"Examples :\n" -"/charset decode iso-8859-15 => set global decode charset to iso-8859-15\n" -"/charset encode iso-8859-15 => set global encode charset to iso-8859-15\n" -"/charset decode.irc.freenode => set decode charset to iso-8859-15 for IRC " -"server \"freenode\" (all channels)\n" -"/charset decode.irc.freenode.#weechat => set decode charset to iso-8859-15 " -"for IRC channel \"#weechat\" on server \"freenode\"" +" decode: change decoding charset\n" +" encode: change encoding charset\n" +"charset: new charset for current buffer\n" +" reset: reset charsets for current buffer" msgstr "" msgid "print debug messages" @@ -2013,22 +2009,10 @@ msgstr "" " buffer: hexadecimális puffertartalom logba írása\n" "windows: ablakfa megjelenítése" -#, fuzzy, c-format -msgid "%s: debug enabled" -msgstr "FIFO cső nyitva\n" - -#, c-format -msgid "%s: debug disabled" -msgstr "" - msgid "demo message without prefix" msgstr "" #, c-format -msgid "%sdemo message with info prefix" -msgstr "" - -#, c-format msgid "%sdemo message with error prefix" msgstr "" @@ -2115,7 +2099,7 @@ msgid "" msgstr "" #, fuzzy, c-format -msgid "%s%s: pipe open" +msgid "%s: pipe open" msgstr "FIFO cső nyitva\n" #, fuzzy, c-format @@ -2127,7 +2111,7 @@ msgid "%s%s: unable to create pipe for remote control (%s)" msgstr "%s nem sikerült a FIFO csövet létrehozni a távoli felügyelethez (%s)\n" #, fuzzy, c-format -msgid "%s%s: pipe closed" +msgid "%s: pipe closed" msgstr "FIFO cső bezárva\n" #, fuzzy, c-format @@ -2155,11 +2139,11 @@ msgid "%s%s: cannot find nick for sending message" msgstr "%s nem található név az üzenet küldéséhez\n" #, fuzzy, c-format -msgid "%s%s: future away on %s%s%s: %s" +msgid "%s: future away on %s%s%s: %s" msgstr "CTCP %sVERSION%s válasz %s%s%s felhasználótól: %s\n" #, fuzzy, c-format -msgid "%s%s: future away on %s%s%s removed" +msgid "%s: future away on %s%s%s removed" msgstr "%s%d%s mellőzés eltávolítva.\n" #, fuzzy, c-format @@ -2179,7 +2163,7 @@ msgid "%s%s: missing argument for \"%s\" option" msgstr "%s hiányzó argumentum a(z) \"%s\" opciónak\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s created (temporary server, NOT SAVED!)" +msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "A(z) %s%s%s szerver létrehozva (ideiglenes szerver, NINCS MENTVE!)\n" #, fuzzy, c-format @@ -2199,7 +2183,7 @@ msgid "%s%s: not connected to server \"%s\"!" msgstr "%s nincs csatlakozva a \"%s\" szerverhez!\n" #, fuzzy, c-format -msgid "%s%s: auto-reconnection is cancelled" +msgid "%s: auto-reconnection is cancelled" msgstr "automata újracsatlakozás megszakítva\n" #, fuzzy, c-format @@ -2248,7 +2232,7 @@ msgid "%s%s: server \"%s\" already exists, can't create it!" msgstr "%s a \"%s\" szerver már létezik, nem hozhatja létre!\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s created" +msgid "%s: server %s%s%s created" msgstr "A %s%s%s szerver létrehozva\n" #, fuzzy, c-format @@ -2264,11 +2248,11 @@ msgid "%s%s: server \"%s\" already exists for \"%s\" command" msgstr "%s a \"%s\" szerver már létezik a(z) \"%s\" parancshoz\n" #, fuzzy, c-format -msgid "%s%s: Server %s%s%s has been copied to %s%s" +msgid "%s: server %s%s%s has been copied to %s%s" msgstr "A %s%s%s szerver másolva lett %s%s néven\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s has been renamed to %s%s" +msgid "%s: server %s%s%s has been renamed to %s%s" msgstr "A %s%s%s szerver mostantól: %s%s\n" #, fuzzy, c-format @@ -2276,7 +2260,7 @@ msgid "%s%s: server \"%s\" is not a temporary server" msgstr "%s a \"%s\" szerver nem ideiglenes\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s is not temporary any more" +msgid "%s: server %s%s%s is not temporary any more" msgstr "A(z) %s%s%s szerver mostantól nem ideiglenes\n" #, fuzzy, c-format @@ -2288,12 +2272,12 @@ msgstr "" "a /disconnect %s parancsot előbb.\n" #, fuzzy, c-format -msgid "%s%s: Server %s%s%s has been deleted" +msgid "%s: Server %s%s%s has been deleted" msgstr "A %s%s%s szerver törölve\n" #, fuzzy, c-format msgid "" -"%s%s: messages outqueue DELETED for all servers. Some messages from you or " +"%s: messages outqueue DELETED for all servers. Some messages from you or " "WeeChat may have been lost!" msgstr "" "Minden szerver kimenő üzenetlistája TÖRÖLVE. Néhány üzenete vagy WeeChat " @@ -3058,23 +3042,97 @@ msgstr "" msgid "%sirc: too few arguments for \"%s\" command" msgstr "%s rossz argumentum a \"%s\" parancsnak\n" +#, fuzzy, c-format +msgid "%s%s: error creating server \"%s\"" +msgstr "%s nincs elég memória az információs pult üzenethez\n" + +#, fuzzy, c-format +msgid "%s%s: error creating option \"%s\" for server \"%s\" (server not found)" +msgstr "%s a \"%s\" opció nem található\n" + #, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" msgstr "" -#, fuzzy, c-format -msgid "%s%s: value \"%s\" is invalid for option \"%s\"" -msgstr "%s %s, %d. sor: érvénytelen opció: \"%s\"\n" +msgid "automatically connect to server when WeeChat is starting" +msgstr "automatikus csatlakozás a szerverhez a WeeChat indulásakor" -#, fuzzy, c-format -msgid "%s%s: option \"%s\" not found" -msgstr "%s a \"%s\" modul nem található\n" +msgid "automatically reconnect to server when disconnected" +msgstr "automatikus újracsatlakozás a szerverhez, ha lekapcsolódik" + +msgid "delay (in seconds) before trying again to reconnect to server" +msgstr "két újracsatlakozási próba közti szünet (másodpercben)" + +#, fuzzy +msgid "list of IP/port or hostname/port for server (separated by comma)" +msgstr "felhasználónév az IRC szerveren" + +msgid "use IPv6 protocol for server communication" +msgstr "IPv6 protokoll használata a kapcsolathoz" + +msgid "use SSL for server communication" +msgstr "SSL használata a a kapcsolathoz" + +msgid "password for IRC server" +msgstr "jelszó az IRC szerveren" + +#, fuzzy +msgid "nicknames to use on IRC server (separated by comma)" +msgstr "felhasználónév az IRC szerveren" + +msgid "user name to use on IRC server" +msgstr "használni kívánt felhasználónév az IRC szerveren" + +msgid "real name to use on IRC server" +msgstr "az IRC szerveren használt valódi név" + +msgid "" +"custom hostname/IP for server (optional, if empty local hostname is used)" +msgstr "" +"szokásos hosztnév/IP a szerveren (tetszőleges, ha üres akkor a helyi " +"hosztnevet használja)" + +msgid "" +"command(s) to run when connected to server (many commands should be " +"separated by ';', use '\\;' for a semicolon, special variables $nick, " +"$channel and $server are replaced by their value)" +msgstr "" +"szerverre csatlakozáskor futtatandó parancs(ok) (több parancs esetén azokat " +"';'-vel kell elválasztani, használja a '\\;' sorozatot, ha " +"pontosvesszőtszeretne írni, a $nick, $channel és $server szavak helyére azok " +"értéke kerül)" + +msgid "" +"delay (in seconds) after command was executed (example: give some time for " +"authentication)" +msgstr "" +"szünet (másodpercben) a parancs futtatása után (például: hagyni némi időt az " +"azonosításra)" + +msgid "" +"comma separated list of channels to join when connected to server (example: " +"\"#chan1,#chan2,#chan3 key1,key2\")" +msgstr "" +"szobák vesszővel elválasztott listája ahová be akarunk lépni csatlakozás " +"után (például: \"#szoba1,#szoba2,#szoba3 kulcs1,kulcs2\")" + +msgid "automatically rejoin channels when kicked" +msgstr "automatikus visszalépés a szobába kirúgáskor" + +msgid "" +"comma separated list of notify levels for channels of this server (format: " +"#channel:1,..), a channel name '*' is reserved for server default notify " +"level" +msgstr "" +"vesszővel elválasztott emlékeztetési szintek ezen szerver szobáira (forma: " +"#szoba:1,...), a '*' szobanév a szerver alapértelmezett értesítési " +"szintjének van fenntartva" #, fuzzy, c-format -msgid "%s%s: error creating server for reading configuration file" -msgstr "szerver konfigurációs fájljának újraolvastatása" +msgid "%s%s: error creating server option \"%s\"" +msgstr "%s nincs elég memória az információs pult üzenethez\n" msgid "use same buffer for all servers" msgstr "ugyanazon puffer használata minden szerverhez" @@ -3097,6 +3155,16 @@ msgstr "üzenet mutatása távollétkor/visszatéréskor" msgid "show remote away message only once in private" msgstr "privát beszélgetésben a másik fél távollétét csak egyszer jelezze" +msgid "display notices as private messages" +msgstr "figyelmeztetések privát üzenetként való mutatása" + +msgid "" +"comma separated list of words to highlight (case insensitive comparison, " +"words may begin or end with \"*\" for partial match)" +msgstr "" +"kiemelendő szavak vesszővel elválasztott listája (kis/nagybetűtől független " +"összehasonlítás, a szavak végére/elejére \"*\"-ot illesztve részleges keresés" + msgid "" "default part message (leaving channel) ('%v' will be replaced by WeeChat " "version in string)" @@ -3104,8 +3172,13 @@ msgstr "" "alapértelmezett távozó üzenet (szoba elhagyásakor) (a '%v' változó a WeeChat " "verziójára cserélődik)" -msgid "display notices as private messages" -msgstr "figyelmeztetések privát üzenetként való mutatása" +#, fuzzy +msgid "" +"default quit message (disconnecting from server) ('%v' will be replaced by " +"WeeChat version in string)" +msgstr "" +"alapértelmezett kilépő üzenet (a '%v' változó a WeeChat verziójára " +"cserélődik)" msgid "interval between two checks for away (in minutes, 0 = never check)" msgstr "két távollétellenőrzés közti idő (percben, 0 = nincs ellenőrzés)" @@ -3128,13 +3201,6 @@ msgstr "lekapcsolódás túl nagy késés esetén (percben, 0 = nincs lecsatlako msgid "anti-flood: # seconds between two user messages (0 = no anti-flood)" msgstr "anti-flood: # másodperc két üzenet között (0 = anti-flood kikapcsolva)" -msgid "" -"comma separated list of words to highlight (case insensitive comparison, " -"words may begin or end with \"*\" for partial match)" -msgstr "" -"kiemelendő szavak vesszővel elválasztott listája (kis/nagybetűtől független " -"összehasonlítás, a szavak végére/elejére \"*\"-ot illesztve részleges keresés" - msgid "when off, colors codes are ignored in incoming messages" msgstr "ha ki van kapcsolva, " @@ -3213,83 +3279,6 @@ msgstr "személyes beszélgetése automatikus naplózása" msgid "hide password displayed by nickserv" msgstr "a nickserv által mutatott jelszó elrejtése" -msgid "name associated to IRC server (for display only)" -msgstr "az IRC szerverhez rendelt név (csak megjelenítéshez)" - -msgid "automatically connect to server when WeeChat is starting" -msgstr "automatikus csatlakozás a szerverhez a WeeChat indulásakor" - -msgid "automatically reconnect to server when disconnected" -msgstr "automatikus újracsatlakozás a szerverhez, ha lekapcsolódik" - -msgid "delay (in seconds) before trying again to reconnect to server" -msgstr "két újracsatlakozási próba közti szünet (másodpercben)" - -#, fuzzy -msgid "list of IP/port or hostname/port for server (separated by comma)" -msgstr "felhasználónév az IRC szerveren" - -msgid "use IPv6 protocol for server communication" -msgstr "IPv6 protokoll használata a kapcsolathoz" - -msgid "use SSL for server communication" -msgstr "SSL használata a a kapcsolathoz" - -msgid "password for IRC server" -msgstr "jelszó az IRC szerveren" - -#, fuzzy -msgid "nicknames to use on IRC server (separated by comma)" -msgstr "felhasználónév az IRC szerveren" - -msgid "user name to use on IRC server" -msgstr "használni kívánt felhasználónév az IRC szerveren" - -msgid "real name to use on IRC server" -msgstr "az IRC szerveren használt valódi név" - -msgid "" -"custom hostname/IP for server (optional, if empty local hostname is used)" -msgstr "" -"szokásos hosztnév/IP a szerveren (tetszőleges, ha üres akkor a helyi " -"hosztnevet használja)" - -msgid "" -"command(s) to run when connected to server (many commands should be " -"separated by ';', use '\\;' for a semicolon, special variables $nick, " -"$channel and $server are replaced by their value)" -msgstr "" -"szerverre csatlakozáskor futtatandó parancs(ok) (több parancs esetén azokat " -"';'-vel kell elválasztani, használja a '\\;' sorozatot, ha " -"pontosvesszőtszeretne írni, a $nick, $channel és $server szavak helyére azok " -"értéke kerül)" - -msgid "" -"delay (in seconds) after command was executed (example: give some time for " -"authentication)" -msgstr "" -"szünet (másodpercben) a parancs futtatása után (például: hagyni némi időt az " -"azonosításra)" - -msgid "" -"comma separated list of channels to join when connected to server (example: " -"\"#chan1,#chan2,#chan3 key1,key2\")" -msgstr "" -"szobák vesszővel elválasztott listája ahová be akarunk lépni csatlakozás " -"után (például: \"#szoba1,#szoba2,#szoba3 kulcs1,kulcs2\")" - -msgid "automatically rejoin channels when kicked" -msgstr "automatikus visszalépés a szobába kirúgáskor" - -msgid "" -"comma separated list of notify levels for channels of this server (format: " -"#channel:1,..), a channel name '*' is reserved for server default notify " -"level" -msgstr "" -"vesszővel elválasztott emlékeztetési szintek ezen szerver szobáira (forma: " -"#szoba:1,...), a '*' szobanév a szerver alapértelmezett értesítési " -"szintjének van fenntartva" - msgid "Waiting" msgstr "Várakozás" @@ -3796,7 +3785,7 @@ msgid "" msgstr "%s: minden megadott név foglalt, kapcsolat bontása a szerverrel!\n" #, fuzzy, c-format -msgid "%s%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" +msgid "%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" msgstr "%s: a(z) \"%s\" név már foglalt, próbálom a második nevet: \"%s\"\n" msgid "error received from IRC server" @@ -4139,15 +4128,15 @@ msgstr "" "%s nem sikerült adatot olvasni a csatornából, kilépés a szerverről...\n" #, fuzzy, c-format -msgid "%s%s: lag is high, disconnecting from server..." +msgid "%s: lag is high, disconnecting from server..." msgstr "%s túl nagy a késés(lag), lecsatlakozás a szerverről...\n" #, fuzzy, c-format -msgid "%s%s: reconnecting to server in %d %s" +msgid "%s: reconnecting to server in %d %s" msgstr "%s: Újracsatlakozás a szerverhez %d másodperc múlva\n" #, fuzzy, c-format -msgid "%s%s: switching address to %s/%d" +msgid "%s: switching address to %s/%d" msgstr "%s IP-cím nem található\n" #, fuzzy, c-format @@ -4190,6 +4179,14 @@ msgstr "" msgid "%s%s: unable to set local hostname/IP" msgstr "%s nem sikerült a helyi hosztnevet/IP-t beállítani\n" +#, c-format +msgid "%s%s: addresses not defined for server \"%s\", cannot connect" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: nicks not defined for server \"%s\", cannot connect" +msgstr "%s név \"%s\" nem található a \"%s\" parancshoz\n" + #, fuzzy, c-format msgid "" "%s%s: cannot connect with SSL since WeeChat was not built with GnuTLS support" @@ -4198,7 +4195,7 @@ msgstr "" "támogatás nélkül lett fordítva\n" #, fuzzy, c-format -msgid "%s%s: connecting to server %s/%d%s%s via %s proxy %s/%d%s..." +msgid "%s: connecting to server %s/%d%s%s via %s proxy %s/%d%s..." msgstr "" "%s: csatlakozás a(z) %s:%d%s%s szerverhez %s proxy kiszolgálón keresztül: %s:" "%d%s...\n" @@ -4210,10 +4207,6 @@ msgstr "" "s...\n" #, fuzzy, c-format -msgid "%s%s: connecting to server %s/%d%s%s..." -msgstr "%s: csatlakozás a(z) %s:%d%s%s szerverhez...\n" - -#, fuzzy, c-format msgid "%s: connecting to server %s/%d%s%s..." msgstr "%s: csatlakozás a(z) %s:%d%s%s szerverhez...\n" @@ -4238,11 +4231,11 @@ msgid "%s%s: cannot set socket option \"SO_KEEPALIVE\"" msgstr "%s nem sikerült a \"SO_KEEPALIVE\" csatornaopciót beállítani\n" #, fuzzy, c-format -msgid "%s%s: reconnecting to server..." +msgid "%s: reconnecting to server..." msgstr "%s: Újracsatlakozás a szerverhez...\n" #, fuzzy, c-format -msgid "%s%s: disconnected from server" +msgid "%s: disconnected from server" msgstr "Lekapcsolódott a szerverről!\n" #, fuzzy, c-format @@ -4299,13 +4292,17 @@ msgid "%sError: unable to load plugin \"%s\" (not enough memory)" msgstr "%s nem sikerült a modult betölteni \"%s\" (nincs elég memória)\n" #, fuzzy, c-format -msgid "%sPlugin \"%s\" loaded" +msgid "Plugin \"%s\" loaded" msgstr "A \"%s\" modul eltávolítva.\n" #, fuzzy, c-format -msgid "%sPlugin \"%s\" unloaded" +msgid "Plugin \"%s\" unloaded" msgstr "A \"%s\" modul eltávolítva.\n" +#, fuzzy, c-format +msgid "%sError: plugin \"%s\" not found" +msgstr "%s a \"%s\" modul nem található\n" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " @@ -4313,7 +4310,7 @@ msgid "" msgstr "" #, c-format -msgid "%s%s: registered script \"%s\", version %s (%s)" +msgid "%s: registered script \"%s\", version %s (%s)" msgstr "" #, fuzzy, c-format @@ -4329,7 +4326,7 @@ msgid "%s%s: script \"%s\" not found" msgstr "%s a \"%s\" szerver nem található\n" #, fuzzy, c-format -msgid "%s%s: loading script \"%s\"" +msgid "%s: loading script \"%s\"" msgstr "folyamat: \"%s\" szerver betöltése\n" #, fuzzy, c-format @@ -4355,11 +4352,11 @@ msgstr "" "betöltés sikertelen\n" #, fuzzy, c-format -msgid "%s%s: unloading script \"%s\"" +msgid "%s: unloading script \"%s\"" msgstr "folyamat: \"%s\" szerver betöltése\n" #, fuzzy, c-format -msgid "%s%s: script \"%s\" unloaded" +msgid "%s: script \"%s\" unloaded" msgstr "A \"%s\" modul eltávolítva.\n" #, fuzzy, c-format @@ -4525,6 +4522,132 @@ msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s rossz argumentum a \"%s\" parancsnak\n" #, fuzzy +#~ msgid "# %s, created by %s v%s on %s#\n" +#~ msgstr "" +#~ "#\n" +#~ "# %s konfigurációs fájl, készítette: %s v%s - %s" + +#, fuzzy +#~ msgid "No configuration option found with \"%s\"" +#~ msgstr "Nem találtam beállítási lehetőséget a \"%s\" szóhoz\n" + +#~ msgid "" +#~ "option: name of an option (if name is full and no value is given, then " +#~ "help is displayed on option)\n" +#~ " value: value for option\n" +#~ "\n" +#~ "Option may be: servername.server_xxx where \"servername\" is an internal " +#~ "server name and \"xxx\" an option for this server." +#~ msgstr "" +#~ "opció: az opció neve (ha a név teljes és nincs érték megadva, akkor " +#~ "megjeleníti az opcióhoz tartozó segítséget\n" +#~ "érték: az opcióhoz tartozó érték\n" +#~ "\n" +#~ "A opció lehet: szervernév.szerver_xxx, ahol a \"szervernév\" egy belső " +#~ "szervernév és az \"xxx\" a szerver egyik opciója." + +#, fuzzy +#~ msgid "%s%s: error creating charset (%s) \"%s\" => \"%s\"" +#~ msgstr "%s nincs elég memória az információs pult üzenethez\n" + +#, fuzzy +#~ msgid "%sCharset \"%s\" not found" +#~ msgstr "%s a \"%s\" szerver nem található\n" + +#, fuzzy +#~ msgid "List of charsets:" +#~ msgstr "Aliaszok listája:\n" + +#, fuzzy +#~ msgid "List of charsets with \"%s\":" +#~ msgstr "Aliaszok listája:\n" + +#, fuzzy +#~ msgid "No charset found" +#~ msgstr "Nem találtam billentyűt.\n" + +#, fuzzy +#~ msgid "No charset defined" +#~ msgstr "Nincs aliasz definiálva.\n" + +#, fuzzy +#~ msgid "manage charsets" +#~ msgstr "pufferek kezelése" + +#, fuzzy +#~ msgid "%s%s: value \"%s\" is invalid for option \"%s\"" +#~ msgstr "%s %s, %d. sor: érvénytelen opció: \"%s\"\n" + +#, fuzzy +#~ msgid "%s%s: error creating server for reading configuration file" +#~ msgstr "szerver konfigurációs fájljának újraolvastatása" + +#~ msgid "name associated to IRC server (for display only)" +#~ msgstr "az IRC szerverhez rendelt név (csak megjelenítéshez)" + +#, fuzzy +#~ msgid "Option changed: " +#~ msgstr "nincs a szobában" + +#, fuzzy +#~ msgid "%sError: incorrect value for option \"%s\"" +#~ msgstr "%s helytelen érték a \"%s\" paraméternek\n" + +#, fuzzy +#~ msgid "No plugin option found with \"%s\"" +#~ msgstr "A(z) \"%s\" kifejezéshez nem található modul opció\n" + +#, fuzzy +#~ msgid "No plugin option found" +#~ msgstr "Nem található modul opció\n" + +#, fuzzy +#~ msgid "%s%d%s plugin option found with \"%s\"" +#~ msgid_plural "%s%d%s plugin options found with \"%s\"" +#~ msgstr[0] "A(z) \"%s\" kifejezéshez nem található modul opció\n" +#~ msgstr[1] "A(z) \"%s\" kifejezéshez nem található modul opció\n" + +#, fuzzy +#~ msgid "%s%d%s plugin option found" +#~ msgid_plural "%s%d%s plugin options found" +#~ msgstr[0] "Nem található modul opció\n" +#~ msgstr[1] "Nem található modul opció\n" + +#, fuzzy +#~ msgid "Plugin option changed: %s%s = \"%s%s%s\"" +#~ msgstr "A(z) \"%s\" kifejezéshez nem található modul opció\n" + +#, fuzzy +#~ msgid "%sError: incorrect value for plugin option \"%s\"" +#~ msgstr "%s helytelen érték a(z) \"%s\" modul paraméternek\n" + +#~ msgid "set plugin config options" +#~ msgstr "modul opcióinak beállítása" + +#~ msgid "" +#~ "option: name of a plugin option\n" +#~ " value: value for option\n" +#~ "\n" +#~ "Option is format: plugin.option, example: perl.myscript.item1" +#~ msgstr "" +#~ "opció: modul opció neve\n" +#~ "érték: az opció értéke\n" +#~ "\n" +#~ "Az opció formája: modul.opció, például: perl.azénszkriptem.azénopcióm" + +#, fuzzy +#~ msgid "prefix for info messages" +#~ msgstr "új üzenetet tartalmazó ablak színe" + +#, fuzzy +#~ msgid "text color for info prefix" +#~ msgstr "információs pult szövegének színe" + +#, fuzzy +#~ msgid "%s%s: connecting to server %s/%d%s%s..." +#~ msgstr "%s: csatlakozás a(z) %s:%d%s%s szerverhez...\n" + +#, fuzzy #~ msgid "%s[%sF%s%s%s]" #~ msgstr "%s[%s%s%s]%s tétlen: " @@ -4577,10 +4700,6 @@ msgstr "%s rossz argumentum a \"%s\" parancsnak\n" #~ msgstr "%s%s %s(%s%s@%s%s)%s neve %s volt\n" #, fuzzy -#~ msgid "Notice from %s%s%s: %s" -#~ msgstr "Felhasználók a %s%s%s szobában: %s[" - -#, fuzzy #~ msgid "Notice: %s" #~ msgstr "voice" @@ -5234,9 +5353,6 @@ msgstr "%s rossz argumentum a \"%s\" parancsnak\n" #~ msgid "server name not found for buffer" #~ msgstr "szervernév nem található a pufferhez" -#~ msgid "channel name not found for buffer" -#~ msgstr "szobanév nem található a pufferhez" - #~ msgid "buffer type not found" #~ msgstr "a puffer típusa nem található" @@ -5784,27 +5900,12 @@ msgstr "%s rossz argumentum a \"%s\" parancsnak\n" #~ msgid "%sDetail:\n" #~ msgstr "%sRészletek:\n" -#~ msgid " . type boolean (values: 'on' or 'off')\n" -#~ msgstr " . típus logikai (értékek: 'on' vagy 'off')\n" - -#~ msgid " . type integer (values: between %d and %d)\n" -#~ msgstr " . típus szám (értékek: %d és %d között)\n" - #~ msgid " . type string (values: " #~ msgstr " . típus szöveg (értékek: " #~ msgid " . type color (Curses or Gtk color, look at WeeChat doc)\n" #~ msgstr " . típus szín (Curses vagy Gtk szín, lásd WeeChat dokumentáció)\n" -#~ msgid " . type string (any string)\n" -#~ msgstr " . típus szöveg (bármilyen szöveg)\n" - -#~ msgid " . type: char (any char)\n" -#~ msgstr " . típus: karakter (bármilyen karakter)\n" - -#~ msgid " . type string (any string, limit: %d chars)\n" -#~ msgstr " . típus szöveg (bármilyen szöveg, korlát: %d karakter)\n" - #~ msgid "%s no ignore found\n" #~ msgstr "%s nem található ilyen mellőzés\n" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-04-03 18:09+0200\n" +"POT-Creation-Date: 2008-04-11 18:29+0200\n" "PO-Revision-Date: 2007-09-06 12:44+0200\n" "Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -62,12 +62,12 @@ msgstr "" " -v, --version отобразить версию WeeChat\n" " -w, --weechat-commands отобразить команды WeeChat\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, fuzzy, c-format msgid "%s configuration options:\n" msgstr "настроить параметры конфигурации" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s internal commands:\n" msgstr "Внутренние команды %s:\n" @@ -75,7 +75,7 @@ msgstr "Внутренние команды %s:\n" msgid "Internal key functions:\n" msgstr "Встроенные функции клавиш:\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s default keys:\n" msgstr "%s клавиши по умолчанию:\n" @@ -204,7 +204,7 @@ msgid "%sError: incorrect notify level (must be between %d and %d)" msgstr "%s некорректный уровень уведомления (должен быть от %d до %d)\n" #, fuzzy, c-format -msgid "%sNew notify level for %s%s%s: %d %s" +msgid "New notify level for %s%s%s: %d %s" msgstr "Новый уровень уведомления для %s%s%s: %s%d %s" #, fuzzy @@ -273,7 +273,7 @@ msgstr "%s plugin \"%s\" не найден\n" msgid "%sError: wrong filter number" msgstr "%s неправильный номер буфера\n" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, fuzzy, c-format msgid "%s internal commands:" msgstr "Внутренние команды %s:\n" @@ -295,7 +295,51 @@ msgid "plugin:" msgstr " (нет pluginа)\n" #, fuzzy, c-format -msgid "%sNo help available, \"%s\" is an unknown command" +msgid "Option \"%s%s%s\": %s" +msgstr "Ники %s%s%s: %s[" + +#, fuzzy +msgid " type: boolean ('on' or 'off')" +msgstr " . булевый тип (значения: 'on' или 'off')\n" + +#, c-format +msgid " value: %s%s%s (default: %s)" +msgstr "" + +#, fuzzy, c-format +msgid " type: string (%s)" +msgstr " . тип: строка\n" + +#, c-format +msgid " value: '%s%s%s' (default: '%s')" +msgstr "" + +#, fuzzy, c-format +msgid " type: integer (between %d and %d)" +msgstr " . целочисленное значение (значения: от %d до %d)\n" + +#, c-format +msgid " value: %s%d%s (default: %d)" +msgstr "" + +#, fuzzy +msgid " type: string (any string)" +msgstr " . строковой тип (любая строка)\n" + +#, fuzzy +msgid " type: char (any char)" +msgstr " . тип: символ (любой символ)\n" + +#, fuzzy, c-format +msgid " type: string (limit: %d chars)" +msgstr " . строковой тип (любая строка, ограничение: %d символов)\n" + +#, fuzzy +msgid " type: color (values depend on GUI used)" +msgstr " . значения: от %d до %d\n" + +#, fuzzy, c-format +msgid "%sNo help available, \"%s\" is not a command or an option" msgstr "Справка недоступна, \"%s\" не является командой\n" #, fuzzy @@ -303,7 +347,7 @@ msgid "Buffer command history:" msgstr "показать историю буфера команд" #, fuzzy, c-format -msgid "%sNew key binding: %s%s => %s%s%s%s%s" +msgid "New key binding: %s%s => %s%s%s%s%s" msgstr "Новая комбинация клавиш: %s" #, fuzzy @@ -314,8 +358,8 @@ msgstr "Комбинации клавиш:\n" msgid "Internal key functions:" msgstr "Встроенные функции клавиш:\n" -#, fuzzy, c-format -msgid "%sDefault key bindings restored" +#, fuzzy +msgid "Default key bindings restored" msgstr "Комбинации клавиш по умолчанию восстановлены\n" #, fuzzy, c-format @@ -324,7 +368,7 @@ msgstr "" "%s аргумент \"-yes\" необходим для сброса ключей (в целях безопасности)\n" #, fuzzy, c-format -msgid "%sKey \"%s\" unbound" +msgid "Key \"%s\" unbound" msgstr "Клавиша \"%s\" не привязана\n" #, fuzzy, c-format @@ -443,7 +487,7 @@ msgid "%sError: wrong argument count for \"%s\" command" msgstr "%s некорректное количество аргументов команды \"%s\"\n" #, fuzzy, c-format -msgid "%sOptions reloaded from %s" +msgid "Options reloaded from %s" msgstr "Настройки pluginов сохранены\n" #, fuzzy, c-format @@ -451,11 +495,11 @@ msgid "%sError: failed to reload options from %s" msgstr "%s не могу сохранить конфигурационный файл pluginов\n" #, fuzzy, c-format -msgid "%sUnknown configuration file \"%s\"" +msgid "Unknown configuration file \"%s\"" msgstr "перезагрузить конфигурационный файл сервера" #, fuzzy, c-format -msgid "%sOptions saved to %s" +msgid "Options saved to %s" msgstr "Настройки pluginов сохранены\n" #, fuzzy, c-format @@ -465,17 +509,19 @@ msgstr "%s не могу сохранить конфигурационный ф msgid "(unknown)" msgstr "(неизвестен)" -#, fuzzy, c-format -msgid "No configuration option found with \"%s\"" -msgstr "Не найден параметр с \"%s\"\n" +#, c-format +msgid "" +"%sOption \"%s\" not found (tip: you can use \"*\" at beginning and/or end of " +"option to see a sublist)" +msgstr "" #, fuzzy msgid "No configuration option found" msgstr "Не найден параметр\n" #, fuzzy, c-format -msgid "%s%d%s configuration option found with \"%s\"" -msgid_plural "%s%d%s configuration options found with \"%s\"" +msgid "%s%d%s configuration option found matching with \"%s\"" +msgid_plural "%s%d%s configuration options found matching with \"%s\"" msgstr[0] "параметров с \"%s\" найдено\n" msgstr[1] "параметров с \"%s\" найдено\n" @@ -486,48 +532,28 @@ msgstr[0] "параметров найдено\n" msgstr[1] "параметров найдено\n" #, fuzzy, c-format +msgid "%sError: failed to set option \"%s\"" +msgstr "%s не могу сохранить конфигурационный файл pluginов\n" + +#, fuzzy, c-format msgid "%sError: configuration option \"%s\" not found" msgstr "%s параметр конфигурации \"%s\" не найден\n" #, fuzzy -msgid "Option changed: " +msgid "Option changed" msgstr "не на канале" #, fuzzy, c-format -msgid "%sError: incorrect value for option \"%s\"" -msgstr "%s некорректное значение параметра \"%s\"\n" - -#, fuzzy, c-format -msgid "No plugin option found with \"%s\"" -msgstr "Не найден параметр pluginа с \"%s\"\n" - -#, fuzzy -msgid "No plugin option found" -msgstr "Не найден параметр pluginа\n" - -#, fuzzy, c-format -msgid "%s%d%s plugin option found with \"%s\"" -msgid_plural "%s%d%s plugin options found with \"%s\"" -msgstr[0] "Не найден параметр pluginа с \"%s\"\n" -msgstr[1] "Не найден параметр pluginа с \"%s\"\n" - -#, fuzzy, c-format -msgid "%s%d%s plugin option found" -msgid_plural "%s%d%s plugin options found" -msgstr[0] "Не найден параметр pluginа\n" -msgstr[1] "Не найден параметр pluginа\n" - -#, fuzzy, c-format -msgid "%sError: plugin \"%s\" not found" +msgid "%sOption not found" msgstr "%s plugin \"%s\" не найден\n" -#, fuzzy, c-format -msgid "Plugin option changed: %s%s = \"%s%s%s\"" -msgstr "Не найден параметр pluginа с \"%s\"\n" +#, fuzzy +msgid "Option reset" +msgstr "Настройки pluginов сохранены\n" -#, fuzzy, c-format -msgid "%sError: incorrect value for plugin option \"%s\"" -msgstr "%s некорректное значение параметра \"%s\" pluginа\n" +#, fuzzy +msgid "Option removed" +msgstr "не на канале" #, c-format msgid "WeeChat uptime: %d %s %02d:%02d:%02d, started on %s" @@ -687,13 +713,18 @@ msgid "" "from message)" msgstr "" -msgid "display help about commands" +#, fuzzy +msgid "display help about commands and options" msgstr "отобразить помощь по командам" -msgid "[command]" +#, fuzzy +msgid "[command | option]" msgstr "[команда]" -msgid "command: name of a WeeChat or IRC command" +#, fuzzy +msgid "" +"command: a command name\n" +" option: an option name (use /set to see list)" msgstr "команда: название команды WeeChat или IRC" msgid "show buffer command history" @@ -801,33 +832,24 @@ msgid "[option [ = value]]" msgstr "[параметр [ = значение]]" msgid "" -"option: name of an option (if name is full and no value is given, then help " -"is displayed on option)\n" -" value: value for option\n" -"\n" -"Option may be: servername.server_xxx where \"servername\" is an internal " -"server name and \"xxx\" an option for this server." +"option: name of an option\n" +" value: value for option" msgstr "" -"параметр: название параметра (если название полное, а значение не указано, " -"выводит справку)\n" -"значение: значение параметра\n" -"\n" -"Параметром может быть: servername.server_xxx где \"servername\" - имя " -"сервера, а \"xxx\" - параметр сервера" -msgid "set plugin config options" -msgstr "настроить параметры pluginов" +#, fuzzy +msgid "unset/reset config options" +msgstr "настроить параметры конфигурации" + +#, fuzzy +msgid "[option]" +msgstr "[команда]" msgid "" -"option: name of a plugin option\n" -" value: value for option\n" +"option: name of an option\n" "\n" -"Option is format: plugin.option, example: perl.myscript.item1" +"According to option, it's reset (for standard options) or removed (for " +"optional settings, like server values)." msgstr "" -"параметр: название параметра pluginа\n" -"значение: значение параметра\n" -"\n" -"Формат параметров: plugin.параметр, например: perl.myscript.item1" msgid "upgrade WeeChat without disconnecting from servers" msgstr "обновить WeeChat не отключаясь от серверов" @@ -925,6 +947,9 @@ msgstr "" msgid "command executed when WeeChat starts, after loading plugins" msgstr "" +msgid "WeeChat slogan (if empty, slogan is not used)" +msgstr "слоган WeeChat (если пусто - используется слоган по умолчанию)" + msgid "" "if set, uses real white color, disabled by default for terms with white " "background (if you never use white background, you should turn on this " @@ -944,9 +969,6 @@ msgstr "" "устанавливать заголовок окна (терминала при интерфейсе Curses) с именем и " "версией" -msgid "WeeChat slogan (if empty, slogan is not used)" -msgstr "слоган WeeChat (если пусто - используется слоган по умолчанию)" - msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "количество проматываемых кнопками PageUp и PageDown строк" @@ -991,10 +1013,6 @@ msgid "display space if nick mode is not (half)op/voice" msgstr "оставлять пробел, если ник не op/voice" #, fuzzy -msgid "prefix for info messages" -msgstr "цвет текущего окна с сообщениями" - -#, fuzzy msgid "prefix for error messages" msgstr "выводить отладочные сообщения" @@ -1099,10 +1117,6 @@ msgstr "" "максимальное количество строк, вставляемых без подтверждения (0 = отключить " "подтверждение)" -msgid "" -"default quit message ('%v' will be replaced by WeeChat version in string)" -msgstr "сообщение о выходе по-умолчанию ('%v' будет заменён на версию WeeChat)" - #, fuzzy msgid "background color for window separators (when splited)" msgstr "цвет разделителей окна (при разбитом экране)" @@ -1136,10 +1150,6 @@ msgid "text color for time delimiters" msgstr "цвет разделителей информационной панели" #, fuzzy -msgid "text color for info prefix" -msgstr "цвет текста информационной панели" - -#, fuzzy msgid "text color for error prefix" msgstr "цвет стрелки захода на канал (префикс)" @@ -1494,14 +1504,6 @@ msgid "(default options)" msgstr "" #, fuzzy, c-format -msgid "" -"#\n" -"# %s configuration file, created by %s v%s on %s#\n" -msgstr "" -"#\n" -"# %s конфигурационный файл, созданный пользователем %s v%s, %s" - -#, fuzzy, c-format msgid "%sWarning: config file \"%s\" not found" msgstr "%s конфигурационынй файл \"%s\" не найден.\n" @@ -1867,15 +1869,15 @@ msgid "%s%s: error creating alias \"%s\" => \"%s\"" msgstr "%s недостаточно памяти для сообщения в строке информации\n" #, fuzzy, c-format -msgid "%sAlias \"%s\" => \"%s\" created" +msgid "Alias \"%s\" => \"%s\" created" msgstr "Сокращение \"%s\" => \"%s\" создано\n" #, fuzzy msgid "Alias:" msgstr "Сокращение:\n" -#, fuzzy, c-format -msgid "%sNo alias found." +#, fuzzy +msgid "No alias found" msgstr "Сокращения не найдены.\n" #, fuzzy @@ -1891,7 +1893,7 @@ msgid "%sAlias \"%s\" not found" msgstr "%s адрес \"%s\" не найден\n" #, fuzzy, c-format -msgid "%sAlias \"%s\" removed" +msgid "Alias \"%s\" removed" msgstr "Сокращение \"%s\" удалено\n" msgid "create an alias for a command" @@ -1931,67 +1933,63 @@ msgid "alias_name: name of alias to remove" msgstr "сокращение: удаляемое сокращение" #, fuzzy, c-format +msgid "%s: debug enabled" +msgstr "FIFO pipe открыт\n" + +#, c-format +msgid "%s: debug disabled" +msgstr "" + +#, fuzzy, c-format msgid "%s%s: error creating charset \"%s\" => \"%s\"" msgstr "%s недостаточно памяти для сообщения в строке информации\n" -#, fuzzy, c-format -msgid "%sCharset \"%s\" => \"%s\"" -msgstr "Сокращение \"%s\" => \"%s\" создано\n" +msgid "global decoding charset" +msgstr "" + +msgid "global encoding charset" +msgstr "" #, fuzzy, c-format -msgid "%s%s: charset \"%s\" not found" -msgstr "%s сервер \"%s\" не найден\n" +msgid "Charset: %s, %s => %s" +msgstr "Сокращение \"%s\" => \"%s\" создано\n" #, fuzzy, c-format -msgid "%sCharset \"%s\" removed" +msgid "Charset: %s, %s: removed" msgstr "Сокращение \"%s\" удалено\n" -#, fuzzy -msgid "List of charsets:" -msgstr "Список сокращений:\n" - #, fuzzy, c-format -msgid "List of charsets with \"%s\":" -msgstr "Список сокращений:\n" +msgid "%s%s: missing parameters" +msgstr "%s нет аргумента для параметра \"%s\"\n" -#, fuzzy -msgid "No charset found" -msgstr "Клавиши не найдены.\n" +#, c-format +msgid "%s%s: wrong charset type (decode or encode expected)" +msgstr "" -#, fuzzy -msgid "No charset defined" -msgstr "Сокращения не заданы.\n" +#, fuzzy, c-format +msgid "%s%s: invalid charset: \"%s\"" +msgstr "Не могу записать лог-файл \"%s\"\n" #, fuzzy, c-format -msgid "%s%s: terminal: %s, internal: %s" +msgid "%s: terminal: %s, internal: %s" msgstr "%s plugin \"%s\" не найден\n" #, fuzzy, c-format -msgid "%s%s: error creating configuration file \"%s\"" +msgid "%s%s: error creating configuration file" msgstr "перезагрузить конфигурационный файл сервера" #, fuzzy -msgid "manage charsets" -msgstr "управление буферами" +msgid "change charset for current buffer" +msgstr "не найдено имя канала для буфера" -msgid "[[type.]plugin.string [= charset]]" +msgid "[[decode | encode] charset] | [reset]" msgstr "" msgid "" -" type: \"decode\" or \"encode\" (if type is omitted, then both \"decode\" " -"and \"encode\" are set)\n" -" plugin: plugin name\n" -" string: string specific to plugin (for example a server name or server." -"channel for IRC plugin)\n" -"charset: charset to use (if empty, then charset is removed)\n" -"\n" -"Examples :\n" -"/charset decode iso-8859-15 => set global decode charset to iso-8859-15\n" -"/charset encode iso-8859-15 => set global encode charset to iso-8859-15\n" -"/charset decode.irc.freenode => set decode charset to iso-8859-15 for IRC " -"server \"freenode\" (all channels)\n" -"/charset decode.irc.freenode.#weechat => set decode charset to iso-8859-15 " -"for IRC channel \"#weechat\" on server \"freenode\"" +" decode: change decoding charset\n" +" encode: change encoding charset\n" +"charset: new charset for current buffer\n" +" reset: reset charsets for current buffer" msgstr "" msgid "print debug messages" @@ -2015,22 +2013,10 @@ msgstr "" "файл\n" "windows: отобразить дерево окон" -#, fuzzy, c-format -msgid "%s: debug enabled" -msgstr "FIFO pipe открыт\n" - -#, c-format -msgid "%s: debug disabled" -msgstr "" - msgid "demo message without prefix" msgstr "" #, c-format -msgid "%sdemo message with info prefix" -msgstr "" - -#, c-format msgid "%sdemo message with error prefix" msgstr "" @@ -2117,7 +2103,7 @@ msgid "" msgstr "" #, fuzzy, c-format -msgid "%s%s: pipe open" +msgid "%s: pipe open" msgstr "FIFO pipe открыт\n" #, fuzzy, c-format @@ -2129,7 +2115,7 @@ msgid "%s%s: unable to create pipe for remote control (%s)" msgstr "%s не могу создать FIFO pipe для удалённого управления (%s)\n" #, fuzzy, c-format -msgid "%s%s: pipe closed" +msgid "%s: pipe closed" msgstr "FIFO pipe закрыт\n" #, fuzzy, c-format @@ -2157,11 +2143,11 @@ msgid "%s%s: cannot find nick for sending message" msgstr "%s не могу найти адресата сообщения\n" #, fuzzy, c-format -msgid "%s%s: future away on %s%s%s: %s" +msgid "%s: future away on %s%s%s: %s" msgstr "Планирование статуса на %s%s%s: %s\n" #, fuzzy, c-format -msgid "%s%s: future away on %s%s%s removed" +msgid "%s: future away on %s%s%s removed" msgstr "Планирование статуса на %s%s%s удалено.\n" #, fuzzy, c-format @@ -2181,7 +2167,7 @@ msgid "%s%s: missing argument for \"%s\" option" msgstr "%s нет аргумента для параметра \"%s\"\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s created (temporary server, NOT SAVED!)" +msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "Сервер %s%s%s создан (временный сервер, НЕ СОХРАНЁН!\n" #, fuzzy, c-format @@ -2201,7 +2187,7 @@ msgid "%s%s: not connected to server \"%s\"!" msgstr "%s не подключен к серверу \"%s\"!\n" #, fuzzy, c-format -msgid "%s%s: auto-reconnection is cancelled" +msgid "%s: auto-reconnection is cancelled" msgstr "Авто-переподключение отменено\n" #, fuzzy, c-format @@ -2251,7 +2237,7 @@ msgid "%s%s: server \"%s\" already exists, can't create it!" msgstr "%s сервер \"%s\" уже существует, не могу создать его!\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s created" +msgid "%s: server %s%s%s created" msgstr "Сервер %s%s%s создан\n" #, fuzzy, c-format @@ -2267,11 +2253,11 @@ msgid "%s%s: server \"%s\" already exists for \"%s\" command" msgstr "%s сервер \"%s\" уже существует для команды \"%s\"\n" #, fuzzy, c-format -msgid "%s%s: Server %s%s%s has been copied to %s%s" +msgid "%s: server %s%s%s has been copied to %s%s" msgstr "Сервер %s%s%s скопирован в %s%s\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s has been renamed to %s%s" +msgid "%s: server %s%s%s has been renamed to %s%s" msgstr "Сервер %s%s%s переименован в %s%s\n" #, fuzzy, c-format @@ -2279,7 +2265,7 @@ msgid "%s%s: server \"%s\" is not a temporary server" msgstr "%s сервер \"%s\" не является временным сервером\n" #, fuzzy, c-format -msgid "%s%s: server %s%s%s is not temporary any more" +msgid "%s: server %s%s%s is not temporary any more" msgstr "Сервер %s%s%s больше не временный\n" #, fuzzy, c-format @@ -2291,12 +2277,12 @@ msgstr "" "Попробуйте отключиться (/disconnect) %s перед удалением.\n" #, fuzzy, c-format -msgid "%s%s: Server %s%s%s has been deleted" +msgid "%s: Server %s%s%s has been deleted" msgstr "Сервер %s%s%s удалён\n" #, fuzzy, c-format msgid "" -"%s%s: messages outqueue DELETED for all servers. Some messages from you or " +"%s: messages outqueue DELETED for all servers. Some messages from you or " "WeeChat may have been lost!" msgstr "" "Исходящая очередь сообщений УДАЛЕНА на всех серверах. Некоторые исходящие " @@ -3049,23 +3035,97 @@ msgstr "" msgid "%sirc: too few arguments for \"%s\" command" msgstr "%s некорректные аргументы команды \"%s\"\n" +#, fuzzy, c-format +msgid "%s%s: error creating server \"%s\"" +msgstr "%s недостаточно памяти для сообщения в строке информации\n" + +#, fuzzy, c-format +msgid "%s%s: error creating option \"%s\" for server \"%s\" (server not found)" +msgstr "%s параметр конфигурации \"%s\" не найден\n" + #, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" msgstr "" -#, fuzzy, c-format -msgid "%s%s: value \"%s\" is invalid for option \"%s\"" -msgstr "%s %s, строка %d: некорректный параметр \"%s\"\n" +msgid "automatically connect to server when WeeChat is starting" +msgstr "подключаться к серверу автоматически при запуске WeeChat" -#, fuzzy, c-format -msgid "%s%s: option \"%s\" not found" -msgstr "%s plugin \"%s\" не найден\n" +msgid "automatically reconnect to server when disconnected" +msgstr "автоматически переподключаться к серверу при обрыве связи" + +msgid "delay (in seconds) before trying again to reconnect to server" +msgstr "задержка (в секундах) перед повторным соединением с сервером" + +#, fuzzy +msgid "list of IP/port or hostname/port for server (separated by comma)" +msgstr "ник, используемый на IRC сервере" + +msgid "use IPv6 protocol for server communication" +msgstr "использовать IPv6 при связи с сервером" + +msgid "use SSL for server communication" +msgstr "использовать SSL при связи с сервером" + +msgid "password for IRC server" +msgstr "пароль, используемый при подключении к IRC серверу" + +#, fuzzy +msgid "nicknames to use on IRC server (separated by comma)" +msgstr "ник, используемый на IRC сервере" + +msgid "user name to use on IRC server" +msgstr "имя пользователя, используемое на IRC сервере" + +msgid "real name to use on IRC server" +msgstr "настоящее имя, используемое на IRC сервере" + +msgid "" +"custom hostname/IP for server (optional, if empty local hostname is used)" +msgstr "" +"другой ip/хост для сервера (опционально, если не задано - используется " +"локальный хост)" + +msgid "" +"command(s) to run when connected to server (many commands should be " +"separated by ';', use '\\;' for a semicolon, special variables $nick, " +"$channel and $server are replaced by their value)" +msgstr "" +"команды, выполняемые при подключении к серверу (несколько команд должны быть " +"разделены символом ';', используйте '\\;' вместо обычной точки с запятой, " +"специальные переменные $nick, $channel и $server заменяются на " +"соответствующие значения)" + +msgid "" +"delay (in seconds) after command was executed (example: give some time for " +"authentication)" +msgstr "" +"задержка (в секундах) перед выполнением команды (например, нужно время для " +"аутентификации)" + +msgid "" +"comma separated list of channels to join when connected to server (example: " +"\"#chan1,#chan2,#chan3 key1,key2\")" +msgstr "" +"разделённый запятыми список каналов, на которые заходить при подключении к " +"серверу (например, \"#chan1,#chan2,#chan3 key1,key2\")" + +msgid "automatically rejoin channels when kicked" +msgstr "автоматически перезаходить на каналы после кика" + +msgid "" +"comma separated list of notify levels for channels of this server (format: " +"#channel:1,..), a channel name '*' is reserved for server default notify " +"level" +msgstr "" +"разделённый запятыми список уровней уведомления этого сервера (формат: " +"#канал:1,..), название канала '*' зарезервировано для уровня уведомления " +"сервера" #, fuzzy, c-format -msgid "%s%s: error creating server for reading configuration file" -msgstr "перезагрузить конфигурационный файл сервера" +msgid "%s%s: error creating server option \"%s\"" +msgstr "%s недостаточно памяти для сообщения в строке информации\n" msgid "use same buffer for all servers" msgstr "один буфер для всех серверов" @@ -3088,13 +3148,26 @@ msgstr "показывать сообщение во все каналы при msgid "show remote away message only once in private" msgstr "отображать уведомление об отсутствии единожды в привате" +msgid "display notices as private messages" +msgstr "отображать notice'ы в виде личных сообщений" + +msgid "" +"comma separated list of words to highlight (case insensitive comparison, " +"words may begin or end with \"*\" for partial match)" +msgstr "" +"разделённый запятыми список подсвечиваемых слов (регистр учитывается, слова " +"могут начинаться или кончаться \"*\" для неполного соответствия)" + msgid "" "default part message (leaving channel) ('%v' will be replaced by WeeChat " "version in string)" msgstr "сообщение покидания канала ('%v' будет заменён на версию WeeChat)" -msgid "display notices as private messages" -msgstr "отображать notice'ы в виде личных сообщений" +#, fuzzy +msgid "" +"default quit message (disconnecting from server) ('%v' will be replaced by " +"WeeChat version in string)" +msgstr "сообщение о выходе по-умолчанию ('%v' будет заменён на версию WeeChat)" msgid "interval between two checks for away (in minutes, 0 = never check)" msgstr "" @@ -3121,13 +3194,6 @@ msgstr "" msgid "anti-flood: # seconds between two user messages (0 = no anti-flood)" msgstr "анти-флуд; интервал отправки сообщений в секундах (0 = без анти-флуда)" -msgid "" -"comma separated list of words to highlight (case insensitive comparison, " -"words may begin or end with \"*\" for partial match)" -msgstr "" -"разделённый запятыми список подсвечиваемых слов (регистр учитывается, слова " -"могут начинаться или кончаться \"*\" для неполного соответствия)" - msgid "when off, colors codes are ignored in incoming messages" msgstr "когда выключено, цвета в исходящих сообщениях игнорируются" @@ -3208,83 +3274,6 @@ msgstr "автоматически журналировать приваты" msgid "hide password displayed by nickserv" msgstr "скрывать пароль, отображаемый nickserv'ом" -msgid "name associated to IRC server (for display only)" -msgstr "имя IRC сервера (для внутреннего пользования)" - -msgid "automatically connect to server when WeeChat is starting" -msgstr "подключаться к серверу автоматически при запуске WeeChat" - -msgid "automatically reconnect to server when disconnected" -msgstr "автоматически переподключаться к серверу при обрыве связи" - -msgid "delay (in seconds) before trying again to reconnect to server" -msgstr "задержка (в секундах) перед повторным соединением с сервером" - -#, fuzzy -msgid "list of IP/port or hostname/port for server (separated by comma)" -msgstr "ник, используемый на IRC сервере" - -msgid "use IPv6 protocol for server communication" -msgstr "использовать IPv6 при связи с сервером" - -msgid "use SSL for server communication" -msgstr "использовать SSL при связи с сервером" - -msgid "password for IRC server" -msgstr "пароль, используемый при подключении к IRC серверу" - -#, fuzzy -msgid "nicknames to use on IRC server (separated by comma)" -msgstr "ник, используемый на IRC сервере" - -msgid "user name to use on IRC server" -msgstr "имя пользователя, используемое на IRC сервере" - -msgid "real name to use on IRC server" -msgstr "настоящее имя, используемое на IRC сервере" - -msgid "" -"custom hostname/IP for server (optional, if empty local hostname is used)" -msgstr "" -"другой ip/хост для сервера (опционально, если не задано - используется " -"локальный хост)" - -msgid "" -"command(s) to run when connected to server (many commands should be " -"separated by ';', use '\\;' for a semicolon, special variables $nick, " -"$channel and $server are replaced by their value)" -msgstr "" -"команды, выполняемые при подключении к серверу (несколько команд должны быть " -"разделены символом ';', используйте '\\;' вместо обычной точки с запятой, " -"специальные переменные $nick, $channel и $server заменяются на " -"соответствующие значения)" - -msgid "" -"delay (in seconds) after command was executed (example: give some time for " -"authentication)" -msgstr "" -"задержка (в секундах) перед выполнением команды (например, нужно время для " -"аутентификации)" - -msgid "" -"comma separated list of channels to join when connected to server (example: " -"\"#chan1,#chan2,#chan3 key1,key2\")" -msgstr "" -"разделённый запятыми список каналов, на которые заходить при подключении к " -"серверу (например, \"#chan1,#chan2,#chan3 key1,key2\")" - -msgid "automatically rejoin channels when kicked" -msgstr "автоматически перезаходить на каналы после кика" - -msgid "" -"comma separated list of notify levels for channels of this server (format: " -"#channel:1,..), a channel name '*' is reserved for server default notify " -"level" -msgstr "" -"разделённый запятыми список уровней уведомления этого сервера (формат: " -"#канал:1,..), название канала '*' зарезервировано для уровня уведомления " -"сервера" - msgid "Waiting" msgstr "Ожидание" @@ -3783,7 +3772,7 @@ msgid "" msgstr "%s: все предложенные ники заняты, отключаюсь от сервера!\n" #, fuzzy, c-format -msgid "%s%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" +msgid "%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" msgstr "%s: ник \"%s\" уже используется, пробую второй ник \"%s\"\n" msgid "error received from IRC server" @@ -4125,15 +4114,15 @@ msgid "%s%s: cannot read data from socket, disconnecting from server..." msgstr "%s невозможно прочитать данные из сокета, отключаюсь от сервера...\n" #, fuzzy, c-format -msgid "%s%s: lag is high, disconnecting from server..." +msgid "%s: lag is high, disconnecting from server..." msgstr "%s задержка слишком высокая, отключаюсь от сервера...\n" #, fuzzy, c-format -msgid "%s%s: reconnecting to server in %d %s" +msgid "%s: reconnecting to server in %d %s" msgstr "%s: Повторное подключение к серверу через %d секунд\n" #, fuzzy, c-format -msgid "%s%s: switching address to %s/%d" +msgid "%s: switching address to %s/%d" msgstr "%s IP адрес не найден\n" #, fuzzy, c-format @@ -4176,6 +4165,14 @@ msgstr "" msgid "%s%s: unable to set local hostname/IP" msgstr "%s не могу установить локальный хост/IP\n" +#, c-format +msgid "%s%s: addresses not defined for server \"%s\", cannot connect" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: nicks not defined for server \"%s\", cannot connect" +msgstr "%s ник \"%s\" не найден для команды \"%s\"\n" + #, fuzzy, c-format msgid "" "%s%s: cannot connect with SSL since WeeChat was not built with GnuTLS support" @@ -4184,7 +4181,7 @@ msgstr "" "поддержки GNUtls\n" #, fuzzy, c-format -msgid "%s%s: connecting to server %s/%d%s%s via %s proxy %s/%d%s..." +msgid "%s: connecting to server %s/%d%s%s via %s proxy %s/%d%s..." msgstr "%s: подключение к серверу %s:%d%s%s через %s proxy %s:%d%s...\n" #, fuzzy, c-format @@ -4192,10 +4189,6 @@ msgid "Connecting to server %s/%d%s%s via %s proxy %s/%d%s..." msgstr "Подключаюсь к серверу %s:%d%s%s через %s proxy %s:%d%s...\n" #, fuzzy, c-format -msgid "%s%s: connecting to server %s/%d%s%s..." -msgstr "%s: поключаюсь к серверу %s:%d%s%s...\n" - -#, fuzzy, c-format msgid "%s: connecting to server %s/%d%s%s..." msgstr "%s: поключаюсь к серверу %s:%d%s%s...\n" @@ -4220,11 +4213,11 @@ msgid "%s%s: cannot set socket option \"SO_KEEPALIVE\"" msgstr "%s не могу установить настройку сокета \"SO_KEEPALIVE\"\n" #, fuzzy, c-format -msgid "%s%s: reconnecting to server..." +msgid "%s: reconnecting to server..." msgstr "%s: Повторное соединение...\n" #, fuzzy, c-format -msgid "%s%s: disconnected from server" +msgid "%s: disconnected from server" msgstr "Отключен от сервера!\n" #, fuzzy, c-format @@ -4281,13 +4274,17 @@ msgid "%sError: unable to load plugin \"%s\" (not enough memory)" msgstr "%s не могу загрузить plugin \"%s\" (недостаточно памяти)\n" #, fuzzy, c-format -msgid "%sPlugin \"%s\" loaded" +msgid "Plugin \"%s\" loaded" msgstr "Plugin \"%s\" выгружен.\n" #, fuzzy, c-format -msgid "%sPlugin \"%s\" unloaded" +msgid "Plugin \"%s\" unloaded" msgstr "Plugin \"%s\" выгружен.\n" +#, fuzzy, c-format +msgid "%sError: plugin \"%s\" not found" +msgstr "%s plugin \"%s\" не найден\n" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " @@ -4295,7 +4292,7 @@ msgid "" msgstr "" #, c-format -msgid "%s%s: registered script \"%s\", version %s (%s)" +msgid "%s: registered script \"%s\", version %s (%s)" msgstr "" #, fuzzy, c-format @@ -4311,7 +4308,7 @@ msgid "%s%s: script \"%s\" not found" msgstr "%s сервер \"%s\" не найден\n" #, fuzzy, c-format -msgid "%s%s: loading script \"%s\"" +msgid "%s: loading script \"%s\"" msgstr "сессия: загружаю сервер \"%s\"\n" #, fuzzy, c-format @@ -4337,11 +4334,11 @@ msgstr "" "удалась\n" #, fuzzy, c-format -msgid "%s%s: unloading script \"%s\"" +msgid "%s: unloading script \"%s\"" msgstr "сессия: загружаю сервер \"%s\"\n" #, fuzzy, c-format -msgid "%s%s: script \"%s\" unloaded" +msgid "%s: script \"%s\" unloaded" msgstr "Plugin \"%s\" выгружен.\n" #, fuzzy, c-format @@ -4507,6 +4504,132 @@ msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s некорректные аргументы команды \"%s\"\n" #, fuzzy +#~ msgid "# %s, created by %s v%s on %s#\n" +#~ msgstr "" +#~ "#\n" +#~ "# %s конфигурационный файл, созданный пользователем %s v%s, %s" + +#, fuzzy +#~ msgid "No configuration option found with \"%s\"" +#~ msgstr "Не найден параметр с \"%s\"\n" + +#~ msgid "" +#~ "option: name of an option (if name is full and no value is given, then " +#~ "help is displayed on option)\n" +#~ " value: value for option\n" +#~ "\n" +#~ "Option may be: servername.server_xxx where \"servername\" is an internal " +#~ "server name and \"xxx\" an option for this server." +#~ msgstr "" +#~ "параметр: название параметра (если название полное, а значение не " +#~ "указано, выводит справку)\n" +#~ "значение: значение параметра\n" +#~ "\n" +#~ "Параметром может быть: servername.server_xxx где \"servername\" - имя " +#~ "сервера, а \"xxx\" - параметр сервера" + +#, fuzzy +#~ msgid "%s%s: error creating charset (%s) \"%s\" => \"%s\"" +#~ msgstr "%s недостаточно памяти для сообщения в строке информации\n" + +#, fuzzy +#~ msgid "%sCharset \"%s\" not found" +#~ msgstr "%s сервер \"%s\" не найден\n" + +#, fuzzy +#~ msgid "List of charsets:" +#~ msgstr "Список сокращений:\n" + +#, fuzzy +#~ msgid "List of charsets with \"%s\":" +#~ msgstr "Список сокращений:\n" + +#, fuzzy +#~ msgid "No charset found" +#~ msgstr "Клавиши не найдены.\n" + +#, fuzzy +#~ msgid "No charset defined" +#~ msgstr "Сокращения не заданы.\n" + +#, fuzzy +#~ msgid "manage charsets" +#~ msgstr "управление буферами" + +#, fuzzy +#~ msgid "%s%s: value \"%s\" is invalid for option \"%s\"" +#~ msgstr "%s %s, строка %d: некорректный параметр \"%s\"\n" + +#, fuzzy +#~ msgid "%s%s: error creating server for reading configuration file" +#~ msgstr "перезагрузить конфигурационный файл сервера" + +#~ msgid "name associated to IRC server (for display only)" +#~ msgstr "имя IRC сервера (для внутреннего пользования)" + +#, fuzzy +#~ msgid "Option changed: " +#~ msgstr "не на канале" + +#, fuzzy +#~ msgid "%sError: incorrect value for option \"%s\"" +#~ msgstr "%s некорректное значение параметра \"%s\"\n" + +#, fuzzy +#~ msgid "No plugin option found with \"%s\"" +#~ msgstr "Не найден параметр pluginа с \"%s\"\n" + +#, fuzzy +#~ msgid "No plugin option found" +#~ msgstr "Не найден параметр pluginа\n" + +#, fuzzy +#~ msgid "%s%d%s plugin option found with \"%s\"" +#~ msgid_plural "%s%d%s plugin options found with \"%s\"" +#~ msgstr[0] "Не найден параметр pluginа с \"%s\"\n" +#~ msgstr[1] "Не найден параметр pluginа с \"%s\"\n" + +#, fuzzy +#~ msgid "%s%d%s plugin option found" +#~ msgid_plural "%s%d%s plugin options found" +#~ msgstr[0] "Не найден параметр pluginа\n" +#~ msgstr[1] "Не найден параметр pluginа\n" + +#, fuzzy +#~ msgid "Plugin option changed: %s%s = \"%s%s%s\"" +#~ msgstr "Не найден параметр pluginа с \"%s\"\n" + +#, fuzzy +#~ msgid "%sError: incorrect value for plugin option \"%s\"" +#~ msgstr "%s некорректное значение параметра \"%s\" pluginа\n" + +#~ msgid "set plugin config options" +#~ msgstr "настроить параметры pluginов" + +#~ msgid "" +#~ "option: name of a plugin option\n" +#~ " value: value for option\n" +#~ "\n" +#~ "Option is format: plugin.option, example: perl.myscript.item1" +#~ msgstr "" +#~ "параметр: название параметра pluginа\n" +#~ "значение: значение параметра\n" +#~ "\n" +#~ "Формат параметров: plugin.параметр, например: perl.myscript.item1" + +#, fuzzy +#~ msgid "prefix for info messages" +#~ msgstr "цвет текущего окна с сообщениями" + +#, fuzzy +#~ msgid "text color for info prefix" +#~ msgstr "цвет текста информационной панели" + +#, fuzzy +#~ msgid "%s%s: connecting to server %s/%d%s%s..." +#~ msgstr "%s: поключаюсь к серверу %s:%d%s%s...\n" + +#, fuzzy #~ msgid "%s[%sF%s%s%s]" #~ msgstr "%s[%s%s%s]%s бездействует: " @@ -4559,10 +4682,6 @@ msgstr "%s некорректные аргументы команды \"%s\"\n" #~ msgstr "%s%s %s(%s%s@%s%s)%s был %s\n" #, fuzzy -#~ msgid "Notice from %s%s%s: %s" -#~ msgstr "Ники %s%s%s: %s[" - -#, fuzzy #~ msgid "Notice: %s" #~ msgstr "войсы" @@ -5230,9 +5349,6 @@ msgstr "%s некорректные аргументы команды \"%s\"\n" #~ msgid "server name not found for buffer" #~ msgstr "не найдено имя сервера для буфера" -#~ msgid "channel name not found for buffer" -#~ msgstr "не найдено имя канала для буфера" - #~ msgid "buffer type not found" #~ msgstr "тип буфера не найден" @@ -5783,27 +5899,12 @@ msgstr "%s некорректные аргументы команды \"%s\"\n" #~ msgid "%sDetail:\n" #~ msgstr "%sПодробности:\n" -#~ msgid " . type boolean (values: 'on' or 'off')\n" -#~ msgstr " . булевый тип (значения: 'on' или 'off')\n" - -#~ msgid " . type integer (values: between %d and %d)\n" -#~ msgstr " . целочисленное значение (значения: от %d до %d)\n" - #~ msgid " . type string (values: " #~ msgstr " . строковой тип (значения: " #~ msgid " . type color (Curses or Gtk color, look at WeeChat doc)\n" #~ msgstr " . цветовой тип (цвет Curses или Gtk, см. документацию WeeChat)\n" -#~ msgid " . type string (any string)\n" -#~ msgstr " . строковой тип (любая строка)\n" - -#~ msgid " . type: char (any char)\n" -#~ msgstr " . тип: символ (любой символ)\n" - -#~ msgid " . type string (any string, limit: %d chars)\n" -#~ msgstr " . строковой тип (любая строка, ограничение: %d символов)\n" - #~ msgid "%s%d%s ignore was removed.\n" #~ msgid_plural "%s%d%s ignore were removed.\n" #~ msgstr[0] "%s%d%s игнорирование удалено.\n" diff --git a/po/srcfiles.cmake b/po/srcfiles.cmake index cd8306674..9bbbbdb61 100644 --- a/po/srcfiles.cmake +++ b/po/srcfiles.cmake @@ -91,7 +91,6 @@ SET(WEECHAT_SOURCES ./src/plugins/aspell/aspell.c ./src/plugins/aspell/aspell.h ./src/plugins/charset/charset.c -./src/plugins/charset/charset.h ./src/plugins/debug/debug.c ./src/plugins/demo/demo.c ./src/plugins/fifo/fifo.c diff --git a/po/weechat.pot b/po/weechat.pot index 1d8734fb6..7f8c04c66 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: 2008-04-03 18:09+0200\n" +"POT-Creation-Date: 2008-04-11 18:29+0200\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" @@ -43,12 +43,12 @@ msgid "" "\n" msgstr "" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s configuration options:\n" msgstr "" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s internal commands:\n" msgstr "" @@ -56,7 +56,7 @@ msgstr "" msgid "Internal key functions:\n" msgstr "" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s default keys:\n" msgstr "" @@ -176,7 +176,7 @@ msgid "%sError: incorrect notify level (must be between %d and %d)" msgstr "" #, c-format -msgid "%sNew notify level for %s%s%s: %d %s" +msgid "New notify level for %s%s%s: %d %s" msgstr "" msgid "(hotlist: never)" @@ -235,7 +235,7 @@ msgstr "" msgid "%sError: wrong filter number" msgstr "" -#. TRANSLATORS: %s is "WeeChat" +#. TRANSLATORS: %s is "weechat" #, c-format msgid "%s internal commands:" msgstr "" @@ -253,14 +253,54 @@ msgid "plugin:" msgstr "" #, c-format -msgid "%sNo help available, \"%s\" is an unknown command" +msgid "Option \"%s%s%s\": %s" +msgstr "" + +msgid " type: boolean ('on' or 'off')" +msgstr "" + +#, c-format +msgid " value: %s%s%s (default: %s)" +msgstr "" + +#, c-format +msgid " type: string (%s)" +msgstr "" + +#, c-format +msgid " value: '%s%s%s' (default: '%s')" +msgstr "" + +#, c-format +msgid " type: integer (between %d and %d)" +msgstr "" + +#, c-format +msgid " value: %s%d%s (default: %d)" +msgstr "" + +msgid " type: string (any string)" +msgstr "" + +msgid " type: char (any char)" +msgstr "" + +#, c-format +msgid " type: string (limit: %d chars)" +msgstr "" + +msgid " type: color (values depend on GUI used)" +msgstr "" + +#, c-format +msgid "%sNo help available, \"%s\" is not a command or an option" msgstr "" msgid "Buffer command history:" msgstr "" #, c-format -msgid "%sNew key binding: %s%s => %s%s%s%s%s" +msgid "New key binding: %s%s => %s%s%s%s%s" msgstr "" msgid "Key bindings:" @@ -269,8 +309,7 @@ msgstr "" msgid "Internal key functions:" msgstr "" -#, c-format -msgid "%sDefault key bindings restored" +msgid "Default key bindings restored" msgstr "" #, c-format @@ -278,7 +317,7 @@ msgid "%sError: \"-yes\" argument is required for keys reset (security reason)" msgstr "" #, c-format -msgid "%sKey \"%s\" unbound" +msgid "Key \"%s\" unbound" msgstr "" #, c-format @@ -381,7 +420,7 @@ msgid "%sError: wrong argument count for \"%s\" command" msgstr "" #, c-format -msgid "%sOptions reloaded from %s" +msgid "Options reloaded from %s" msgstr "" #, c-format @@ -389,11 +428,11 @@ msgid "%sError: failed to reload options from %s" msgstr "" #, c-format -msgid "%sUnknown configuration file \"%s\"" +msgid "Unknown configuration file \"%s\"" msgstr "" #, c-format -msgid "%sOptions saved to %s" +msgid "Options saved to %s" msgstr "" #, c-format @@ -404,15 +443,17 @@ msgid "(unknown)" msgstr "" #, c-format -msgid "No configuration option found with \"%s\"" +msgid "" +"%sOption \"%s\" not found (tip: you can use \"*\" at beginning and/or end of " +"option to see a sublist)" msgstr "" msgid "No configuration option found" msgstr "" #, c-format -msgid "%s%d%s configuration option found with \"%s\"" -msgid_plural "%s%d%s configuration options found with \"%s\"" +msgid "%s%d%s configuration option found matching with \"%s\"" +msgid_plural "%s%d%s configuration options found matching with \"%s\"" msgstr[0] "" msgstr[1] "" @@ -423,45 +464,24 @@ msgstr[0] "" msgstr[1] "" #, c-format -msgid "%sError: configuration option \"%s\" not found" -msgstr "" - -msgid "Option changed: " -msgstr "" - -#, c-format -msgid "%sError: incorrect value for option \"%s\"" +msgid "%sError: failed to set option \"%s\"" msgstr "" #, c-format -msgid "No plugin option found with \"%s\"" +msgid "%sError: configuration option \"%s\" not found" msgstr "" -msgid "No plugin option found" +msgid "Option changed" msgstr "" #, c-format -msgid "%s%d%s plugin option found with \"%s\"" -msgid_plural "%s%d%s plugin options found with \"%s\"" -msgstr[0] "" -msgstr[1] "" - -#, c-format -msgid "%s%d%s plugin option found" -msgid_plural "%s%d%s plugin options found" -msgstr[0] "" -msgstr[1] "" - -#, c-format -msgid "%sError: plugin \"%s\" not found" +msgid "%sOption not found" msgstr "" -#, c-format -msgid "Plugin option changed: %s%s = \"%s%s%s\"" +msgid "Option reset" msgstr "" -#, c-format -msgid "%sError: incorrect value for plugin option \"%s\"" +msgid "Option removed" msgstr "" #, c-format @@ -585,13 +605,15 @@ msgid "" "from message)" msgstr "" -msgid "display help about commands" +msgid "display help about commands and options" msgstr "" -msgid "[command]" +msgid "[command | option]" msgstr "" -msgid "command: name of a WeeChat or IRC command" +msgid "" +"command: a command name\n" +" option: an option name (use /set to see list)" msgstr "" msgid "show buffer command history" @@ -674,22 +696,21 @@ msgid "[option [ = value]]" msgstr "" msgid "" -"option: name of an option (if name is full and no value is given, then help " -"is displayed on option)\n" -" value: value for option\n" -"\n" -"Option may be: servername.server_xxx where \"servername\" is an internal " -"server name and \"xxx\" an option for this server." +"option: name of an option\n" +" value: value for option" msgstr "" -msgid "set plugin config options" +msgid "unset/reset config options" +msgstr "" + +msgid "[option]" msgstr "" msgid "" -"option: name of a plugin option\n" -" value: value for option\n" +"option: name of an option\n" "\n" -"Option is format: plugin.option, example: perl.myscript.item1" +"According to option, it's reset (for standard options) or removed (for " +"optional settings, like server values)." msgstr "" msgid "upgrade WeeChat without disconnecting from servers" @@ -762,6 +783,9 @@ msgstr "" msgid "command executed when WeeChat starts, after loading plugins" msgstr "" +msgid "WeeChat slogan (if empty, slogan is not used)" +msgstr "" + msgid "" "if set, uses real white color, disabled by default for terms with white " "background (if you never use white background, you should turn on this " @@ -774,9 +798,6 @@ msgstr "" msgid "set title for window (terminal for Curses GUI) with name and version" msgstr "" -msgid "WeeChat slogan (if empty, slogan is not used)" -msgstr "" - msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "" @@ -811,9 +832,6 @@ msgstr "" msgid "display space if nick mode is not (half)op/voice" msgstr "" -msgid "prefix for info messages" -msgstr "" - msgid "prefix for error messages" msgstr "" @@ -897,10 +915,6 @@ msgid "" "max number of lines for paste without asking user (0 = disable this feature)" msgstr "" -msgid "" -"default quit message ('%v' will be replaced by WeeChat version in string)" -msgstr "" - msgid "background color for window separators (when splited)" msgstr "" @@ -925,9 +939,6 @@ msgstr "" msgid "text color for time delimiters" msgstr "" -msgid "text color for info prefix" -msgstr "" - msgid "text color for error prefix" msgstr "" @@ -1201,12 +1212,6 @@ msgid "(default options)" msgstr "" #, c-format -msgid "" -"#\n" -"# %s configuration file, created by %s v%s on %s#\n" -msgstr "" - -#, c-format msgid "%sWarning: config file \"%s\" not found" msgstr "" @@ -1554,14 +1559,13 @@ msgid "%s%s: error creating alias \"%s\" => \"%s\"" msgstr "" #, c-format -msgid "%sAlias \"%s\" => \"%s\" created" +msgid "Alias \"%s\" => \"%s\" created" msgstr "" msgid "Alias:" msgstr "" -#, c-format -msgid "%sNo alias found." +msgid "No alias found" msgstr "" msgid "List of aliases:" @@ -1575,7 +1579,7 @@ msgid "%sAlias \"%s\" not found" msgstr "" #, c-format -msgid "%sAlias \"%s\" removed" +msgid "Alias \"%s\" removed" msgstr "" msgid "create an alias for a command" @@ -1605,63 +1609,62 @@ msgid "alias_name: name of alias to remove" msgstr "" #, c-format -msgid "%s%s: error creating charset \"%s\" => \"%s\"" +msgid "%s: debug enabled" msgstr "" #, c-format -msgid "%sCharset \"%s\" => \"%s\"" +msgid "%s: debug disabled" msgstr "" #, c-format -msgid "%s%s: charset \"%s\" not found" +msgid "%s%s: error creating charset \"%s\" => \"%s\"" +msgstr "" + +msgid "global decoding charset" +msgstr "" + +msgid "global encoding charset" msgstr "" #, c-format -msgid "%sCharset \"%s\" removed" +msgid "Charset: %s, %s => %s" msgstr "" -msgid "List of charsets:" +#, c-format +msgid "Charset: %s, %s: removed" msgstr "" #, c-format -msgid "List of charsets with \"%s\":" +msgid "%s%s: missing parameters" msgstr "" -msgid "No charset found" +#, c-format +msgid "%s%s: wrong charset type (decode or encode expected)" msgstr "" -msgid "No charset defined" +#, c-format +msgid "%s%s: invalid charset: \"%s\"" msgstr "" #, c-format -msgid "%s%s: terminal: %s, internal: %s" +msgid "%s: terminal: %s, internal: %s" msgstr "" #, c-format -msgid "%s%s: error creating configuration file \"%s\"" +msgid "%s%s: error creating configuration file" msgstr "" -msgid "manage charsets" +msgid "change charset for current buffer" msgstr "" -msgid "[[type.]plugin.string [= charset]]" +msgid "[[decode | encode] charset] | [reset]" msgstr "" msgid "" -" type: \"decode\" or \"encode\" (if type is omitted, then both \"decode\" " -"and \"encode\" are set)\n" -" plugin: plugin name\n" -" string: string specific to plugin (for example a server name or server." -"channel for IRC plugin)\n" -"charset: charset to use (if empty, then charset is removed)\n" -"\n" -"Examples :\n" -"/charset decode iso-8859-15 => set global decode charset to iso-8859-15\n" -"/charset encode iso-8859-15 => set global encode charset to iso-8859-15\n" -"/charset decode.irc.freenode => set decode charset to iso-8859-15 for IRC " -"server \"freenode\" (all channels)\n" -"/charset decode.irc.freenode.#weechat => set decode charset to iso-8859-15 " -"for IRC channel \"#weechat\" on server \"freenode\"" +" decode: change decoding charset\n" +" encode: change encoding charset\n" +"charset: new charset for current buffer\n" +" reset: reset charsets for current buffer" msgstr "" msgid "print debug messages" @@ -1678,22 +1681,10 @@ msgid "" " text: send \"debug\" signal with \"text\" as argument" msgstr "" -#, c-format -msgid "%s: debug enabled" -msgstr "" - -#, c-format -msgid "%s: debug disabled" -msgstr "" - msgid "demo message without prefix" msgstr "" #, c-format -msgid "%sdemo message with info prefix" -msgstr "" - -#, c-format msgid "%sdemo message with error prefix" msgstr "" @@ -1771,7 +1762,7 @@ msgid "" msgstr "" #, c-format -msgid "%s%s: pipe open" +msgid "%s: pipe open" msgstr "" #, c-format @@ -1783,7 +1774,7 @@ msgid "%s%s: unable to create pipe for remote control (%s)" msgstr "" #, c-format -msgid "%s%s: pipe closed" +msgid "%s: pipe closed" msgstr "" #, c-format @@ -1811,11 +1802,11 @@ msgid "%s%s: cannot find nick for sending message" msgstr "" #, c-format -msgid "%s%s: future away on %s%s%s: %s" +msgid "%s: future away on %s%s%s: %s" msgstr "" #, c-format -msgid "%s%s: future away on %s%s%s removed" +msgid "%s: future away on %s%s%s removed" msgstr "" #, c-format @@ -1835,7 +1826,7 @@ msgid "%s%s: missing argument for \"%s\" option" msgstr "" #, c-format -msgid "%s%s: server %s%s%s created (temporary server, NOT SAVED!)" +msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "" #, c-format @@ -1855,7 +1846,7 @@ msgid "%s%s: not connected to server \"%s\"!" msgstr "" #, c-format -msgid "%s%s: auto-reconnection is cancelled" +msgid "%s: auto-reconnection is cancelled" msgstr "" #, c-format @@ -1902,7 +1893,7 @@ msgid "%s%s: server \"%s\" already exists, can't create it!" msgstr "" #, c-format -msgid "%s%s: server %s%s%s created" +msgid "%s: server %s%s%s created" msgstr "" #, c-format @@ -1918,11 +1909,11 @@ msgid "%s%s: server \"%s\" already exists for \"%s\" command" msgstr "" #, c-format -msgid "%s%s: Server %s%s%s has been copied to %s%s" +msgid "%s: server %s%s%s has been copied to %s%s" msgstr "" #, c-format -msgid "%s%s: server %s%s%s has been renamed to %s%s" +msgid "%s: server %s%s%s has been renamed to %s%s" msgstr "" #, c-format @@ -1930,7 +1921,7 @@ msgid "%s%s: server \"%s\" is not a temporary server" msgstr "" #, c-format -msgid "%s%s: server %s%s%s is not temporary any more" +msgid "%s: server %s%s%s is not temporary any more" msgstr "" #, c-format @@ -1940,12 +1931,12 @@ msgid "" msgstr "" #, c-format -msgid "%s%s: Server %s%s%s has been deleted" +msgid "%s: Server %s%s%s has been deleted" msgstr "" #, c-format msgid "" -"%s%s: messages outqueue DELETED for all servers. Some messages from you or " +"%s: messages outqueue DELETED for all servers. Some messages from you or " "WeeChat may have been lost!" msgstr "" @@ -2554,21 +2545,80 @@ msgid "%sirc: too few arguments for \"%s\" command" msgstr "" #, c-format +msgid "%s%s: error creating server \"%s\"" +msgstr "" + +#, c-format +msgid "%s%s: error creating option \"%s\" for server \"%s\" (server not found)" +msgstr "" + +#, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" msgstr "" -#, c-format -msgid "%s%s: value \"%s\" is invalid for option \"%s\"" +msgid "automatically connect to server when WeeChat is starting" msgstr "" -#, c-format -msgid "%s%s: option \"%s\" not found" +msgid "automatically reconnect to server when disconnected" +msgstr "" + +msgid "delay (in seconds) before trying again to reconnect to server" +msgstr "" + +msgid "list of IP/port or hostname/port for server (separated by comma)" +msgstr "" + +msgid "use IPv6 protocol for server communication" +msgstr "" + +msgid "use SSL for server communication" +msgstr "" + +msgid "password for IRC server" +msgstr "" + +msgid "nicknames to use on IRC server (separated by comma)" +msgstr "" + +msgid "user name to use on IRC server" +msgstr "" + +msgid "real name to use on IRC server" +msgstr "" + +msgid "" +"custom hostname/IP for server (optional, if empty local hostname is used)" +msgstr "" + +msgid "" +"command(s) to run when connected to server (many commands should be " +"separated by ';', use '\\;' for a semicolon, special variables $nick, " +"$channel and $server are replaced by their value)" +msgstr "" + +msgid "" +"delay (in seconds) after command was executed (example: give some time for " +"authentication)" +msgstr "" + +msgid "" +"comma separated list of channels to join when connected to server (example: " +"\"#chan1,#chan2,#chan3 key1,key2\")" +msgstr "" + +msgid "automatically rejoin channels when kicked" +msgstr "" + +msgid "" +"comma separated list of notify levels for channels of this server (format: " +"#channel:1,..), a channel name '*' is reserved for server default notify " +"level" msgstr "" #, c-format -msgid "%s%s: error creating server for reading configuration file" +msgid "%s%s: error creating server option \"%s\"" msgstr "" msgid "use same buffer for all servers" @@ -2592,12 +2642,22 @@ msgstr "" msgid "show remote away message only once in private" msgstr "" +msgid "display notices as private messages" +msgstr "" + +msgid "" +"comma separated list of words to highlight (case insensitive comparison, " +"words may begin or end with \"*\" for partial match)" +msgstr "" + msgid "" "default part message (leaving channel) ('%v' will be replaced by WeeChat " "version in string)" msgstr "" -msgid "display notices as private messages" +msgid "" +"default quit message (disconnecting from server) ('%v' will be replaced by " +"WeeChat version in string)" msgstr "" msgid "interval between two checks for away (in minutes, 0 = never check)" @@ -2619,11 +2679,6 @@ msgstr "" msgid "anti-flood: # seconds between two user messages (0 = no anti-flood)" msgstr "" -msgid "" -"comma separated list of words to highlight (case insensitive comparison, " -"words may begin or end with \"*\" for partial match)" -msgstr "" - msgid "when off, colors codes are ignored in incoming messages" msgstr "" @@ -2690,68 +2745,6 @@ msgstr "" msgid "hide password displayed by nickserv" msgstr "" -msgid "name associated to IRC server (for display only)" -msgstr "" - -msgid "automatically connect to server when WeeChat is starting" -msgstr "" - -msgid "automatically reconnect to server when disconnected" -msgstr "" - -msgid "delay (in seconds) before trying again to reconnect to server" -msgstr "" - -msgid "list of IP/port or hostname/port for server (separated by comma)" -msgstr "" - -msgid "use IPv6 protocol for server communication" -msgstr "" - -msgid "use SSL for server communication" -msgstr "" - -msgid "password for IRC server" -msgstr "" - -msgid "nicknames to use on IRC server (separated by comma)" -msgstr "" - -msgid "user name to use on IRC server" -msgstr "" - -msgid "real name to use on IRC server" -msgstr "" - -msgid "" -"custom hostname/IP for server (optional, if empty local hostname is used)" -msgstr "" - -msgid "" -"command(s) to run when connected to server (many commands should be " -"separated by ';', use '\\;' for a semicolon, special variables $nick, " -"$channel and $server are replaced by their value)" -msgstr "" - -msgid "" -"delay (in seconds) after command was executed (example: give some time for " -"authentication)" -msgstr "" - -msgid "" -"comma separated list of channels to join when connected to server (example: " -"\"#chan1,#chan2,#chan3 key1,key2\")" -msgstr "" - -msgid "automatically rejoin channels when kicked" -msgstr "" - -msgid "" -"comma separated list of notify levels for channels of this server (format: " -"#channel:1,..), a channel name '*' is reserved for server default notify " -"level" -msgstr "" - msgid "Waiting" msgstr "" @@ -3239,7 +3232,7 @@ msgid "" msgstr "" #, c-format -msgid "%s%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" +msgid "%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" msgstr "" msgid "error received from IRC server" @@ -3580,15 +3573,15 @@ msgid "%s%s: cannot read data from socket, disconnecting from server..." msgstr "" #, c-format -msgid "%s%s: lag is high, disconnecting from server..." +msgid "%s: lag is high, disconnecting from server..." msgstr "" #, c-format -msgid "%s%s: reconnecting to server in %d %s" +msgid "%s: reconnecting to server in %d %s" msgstr "" #, c-format -msgid "%s%s: switching address to %s/%d" +msgid "%s: switching address to %s/%d" msgstr "" #, c-format @@ -3630,20 +3623,24 @@ msgid "%s%s: unable to set local hostname/IP" msgstr "" #, c-format -msgid "" -"%s%s: cannot connect with SSL since WeeChat was not built with GnuTLS support" +msgid "%s%s: addresses not defined for server \"%s\", cannot connect" msgstr "" #, c-format -msgid "%s%s: connecting to server %s/%d%s%s via %s proxy %s/%d%s..." +msgid "%s%s: nicks not defined for server \"%s\", cannot connect" msgstr "" #, c-format -msgid "Connecting to server %s/%d%s%s via %s proxy %s/%d%s..." +msgid "" +"%s%s: cannot connect with SSL since WeeChat was not built with GnuTLS support" msgstr "" #, c-format -msgid "%s%s: connecting to server %s/%d%s%s..." +msgid "%s: connecting to server %s/%d%s%s via %s proxy %s/%d%s..." +msgstr "" + +#, c-format +msgid "Connecting to server %s/%d%s%s via %s proxy %s/%d%s..." msgstr "" #, c-format @@ -3671,11 +3668,11 @@ msgid "%s%s: cannot set socket option \"SO_KEEPALIVE\"" msgstr "" #, c-format -msgid "%s%s: reconnecting to server..." +msgid "%s: reconnecting to server..." msgstr "" #, c-format -msgid "%s%s: disconnected from server" +msgid "%s: disconnected from server" msgstr "" #, c-format @@ -3726,11 +3723,15 @@ msgid "%sError: unable to load plugin \"%s\" (not enough memory)" msgstr "" #, c-format -msgid "%sPlugin \"%s\" loaded" +msgid "Plugin \"%s\" loaded" msgstr "" #, c-format -msgid "%sPlugin \"%s\" unloaded" +msgid "Plugin \"%s\" unloaded" +msgstr "" + +#, c-format +msgid "%sError: plugin \"%s\" not found" msgstr "" #, c-format @@ -3740,7 +3741,7 @@ msgid "" msgstr "" #, c-format -msgid "%s%s: registered script \"%s\", version %s (%s)" +msgid "%s: registered script \"%s\", version %s (%s)" msgstr "" #, c-format @@ -3756,7 +3757,7 @@ msgid "%s%s: script \"%s\" not found" msgstr "" #, c-format -msgid "%s%s: loading script \"%s\"" +msgid "%s: loading script \"%s\"" msgstr "" #, c-format @@ -3780,11 +3781,11 @@ msgid "%s%s: function \"register\" not found (or failed) in file \"%s\"" msgstr "" #, c-format -msgid "%s%s: unloading script \"%s\"" +msgid "%s: unloading script \"%s\"" msgstr "" #, c-format -msgid "%s%s: script \"%s\" unloaded" +msgid "%s: script \"%s\" unloaded" msgstr "" #, c-format diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 575ed8d71..96699e4ba 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -430,9 +430,8 @@ command_buffer (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_ERROR; } gui_chat_printf (NULL, - _("%sNew notify level for %s%s%s: " + _("New notify level for %s%s%s: " "%d %s"), - gui_chat_prefix[GUI_CHAT_PREFIX_INFO], GUI_COLOR(GUI_COLOR_CHAT_BUFFER), buffer->name, GUI_COLOR(GUI_COLOR_CHAT), @@ -567,7 +566,7 @@ command_buffer (void *data, struct t_gui_buffer *buffer, } /* - * command_builtin: launch WeeChat/IRC builtin command + * command_builtin: launch WeeChat builtin command */ int @@ -782,6 +781,9 @@ command_help (void *data, struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { struct t_hook *ptr_hook; + struct t_config_option *ptr_option; + int i, length; + char *string; /* make C compiler happy */ (void) data; @@ -793,7 +795,7 @@ command_help (void *data, struct t_gui_buffer *buffer, { gui_chat_printf (NULL, ""); gui_chat_printf (NULL, - /* TRANSLATORS: %s is "WeeChat" */ + /* TRANSLATORS: %s is "weechat" */ _("%s internal commands:"), PACKAGE_NAME); for (ptr_hook = weechat_hooks[HOOK_TYPE_COMMAND]; ptr_hook; @@ -854,7 +856,7 @@ command_help (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_OK; } - /* display help about a command */ + /* look for command */ for (ptr_hook = weechat_hooks[HOOK_TYPE_COMMAND]; ptr_hook; ptr_hook = ptr_hook->next_hook) { @@ -896,9 +898,117 @@ command_help (void *data, struct t_gui_buffer *buffer, } } + /* look for option */ + config_file_search_with_string (argv[1], NULL, NULL, &ptr_option, NULL); + if (ptr_option) + { + gui_chat_printf (NULL, ""); + gui_chat_printf (NULL, + _("Option \"%s%s%s\": %s"), + GUI_COLOR(GUI_COLOR_CHAT_CHANNEL), + argv[1], + GUI_COLOR(GUI_COLOR_CHAT), + ptr_option->description); + switch (ptr_option->type) + { + case CONFIG_OPTION_TYPE_BOOLEAN: + gui_chat_printf (NULL, _(" type: boolean ('on' or 'off')")); + gui_chat_printf (NULL, _(" value: %s%s%s (default: %s)"), + GUI_COLOR(GUI_COLOR_CHAT_HOST), + (CONFIG_BOOLEAN(ptr_option) == CONFIG_BOOLEAN_TRUE) ? + "on" : "off", + GUI_COLOR(GUI_COLOR_CHAT), + (CONFIG_BOOLEAN_DEFAULT(ptr_option) == CONFIG_BOOLEAN_TRUE) ? + "on" : "off"); + break; + case CONFIG_OPTION_TYPE_INTEGER: + if (ptr_option->string_values) + { + length = 0; + i = 0; + while (ptr_option->string_values[i]) + { + length += strlen (ptr_option->string_values[i]) + 5; + i++; + } + string = malloc (length); + if (string) + { + string[0] = '\0'; + i = 0; + while (ptr_option->string_values[i]) + { + strcat (string, "'"); + strcat (string, ptr_option->string_values[i]); + strcat (string, "'"); + if (ptr_option->string_values[i + 1]) + strcat (string, ", "); + i++; + } + gui_chat_printf (NULL, + _(" type: string (%s)"), + string); + gui_chat_printf (NULL, + _(" value: '%s%s%s' (default: '%s')"), + GUI_COLOR(GUI_COLOR_CHAT_HOST), + ptr_option->string_values[CONFIG_INTEGER(ptr_option)], + GUI_COLOR(GUI_COLOR_CHAT), + ptr_option->string_values[CONFIG_INTEGER_DEFAULT(ptr_option)]); + free (string); + } + } + else + { + gui_chat_printf (NULL, _(" type: integer (between %d and %d)"), + ptr_option->min, + ptr_option->max); + gui_chat_printf (NULL, _(" value: %s%d%s (default: %d)"), + GUI_COLOR(GUI_COLOR_CHAT_HOST), + CONFIG_INTEGER(ptr_option), + GUI_COLOR(GUI_COLOR_CHAT), + CONFIG_INTEGER_DEFAULT(ptr_option)); + } + break; + case CONFIG_OPTION_TYPE_STRING: + switch (ptr_option->max) + { + case 0: + gui_chat_printf (NULL, _(" type: string (any string)")); + break; + case 1: + gui_chat_printf (NULL, _(" type: char (any char)")); + break; + default: + gui_chat_printf (NULL, _(" type: string (limit: %d chars)"), + ptr_option->max); + break; + } + gui_chat_printf (NULL, + _(" value: '%s%s%s' (default: '%s')"), + GUI_COLOR(GUI_COLOR_CHAT_HOST), + CONFIG_STRING(ptr_option), + GUI_COLOR(GUI_COLOR_CHAT), + CONFIG_STRING_DEFAULT(ptr_option)); + break; + case CONFIG_OPTION_TYPE_COLOR: + gui_chat_printf (NULL, + _(" type: color (values depend on GUI used)")); + gui_chat_printf (NULL, + _(" value: %s%s%s (default: %s)"), + GUI_COLOR(GUI_COLOR_CHAT_HOST), + gui_color_get_name (CONFIG_COLOR(ptr_option)), + GUI_COLOR(GUI_COLOR_CHAT), + gui_color_get_name (CONFIG_COLOR_DEFAULT(ptr_option))); + break; + case CONFIG_NUM_OPTION_TYPES: + break; + } + return WEECHAT_RC_OK; + } + gui_chat_printf (NULL, - _("%sNo help available, \"%s\" is an " - "unknown command"), + _("%sNo help available, \"%s\" is not a command or an " + "option"), gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], argv[1]); @@ -973,8 +1083,7 @@ command_key_display (struct t_gui_key *key, int new_key) if (new_key) { gui_chat_printf (NULL, - _("%sNew key binding: %s%s => %s%s%s%s%s"), - gui_chat_prefix[GUI_CHAT_PREFIX_INFO], + _("New key binding: %s%s => %s%s%s%s%s"), (expanded_name) ? expanded_name : key->key, GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS), GUI_COLOR(GUI_COLOR_CHAT), @@ -1054,8 +1163,7 @@ command_key (void *data, struct t_gui_buffer *buffer, gui_keyboard_free_all (); gui_keyboard_init (); gui_chat_printf (NULL, - _("%sDefault key bindings restored"), - gui_chat_prefix[GUI_CHAT_PREFIX_INFO]); + _("Default key bindings restored")); } else { @@ -1076,8 +1184,7 @@ command_key (void *data, struct t_gui_buffer *buffer, if (gui_keyboard_unbind (argv[2])) { gui_chat_printf (NULL, - _("%sKey \"%s\" unbound"), - gui_chat_prefix[GUI_CHAT_PREFIX_INFO], + _("Key \"%s\" unbound"), argv[2]); } else @@ -1333,9 +1440,7 @@ command_plugin_list (char *name, int full) "hooked:")); hook_found = 1; gui_chat_printf (NULL, - " (%s) %s", - HOOK_CONFIG(ptr_hook, type) ? - HOOK_CONFIG(ptr_hook, type) : "*", + " %s", HOOK_CONFIG(ptr_hook, option) ? HOOK_CONFIG(ptr_hook, option) : "*"); } @@ -1467,8 +1572,7 @@ command_quit (void *data, struct t_gui_buffer *buffer, /* send quit signal (used by plugins to disconnect from servers,..) */ hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, - (argc > 1) ? - argv_eol[1] : CONFIG_STRING(config_look_default_msg_quit)); + (argc > 1) ? argv_eol[1] : NULL); /* force end of main loop */ quit_weechat = 1; @@ -1487,8 +1591,7 @@ command_reload_file (struct t_config_file *config_file) (config_file->callback_reload_data, config_file) == 0) { gui_chat_printf (NULL, - _("%sOptions reloaded from %s"), - gui_chat_prefix[GUI_CHAT_PREFIX_INFO], + _("Options reloaded from %s"), config_file->filename); } else @@ -1528,8 +1631,7 @@ command_reload (void *data, struct t_gui_buffer *buffer, else { gui_chat_printf (NULL, - _("%sUnknown configuration file \"%s\""), - gui_chat_prefix[GUI_CHAT_PREFIX_INFO], + _("Unknown configuration file \"%s\""), argv[i]); } } @@ -1559,8 +1661,7 @@ command_save_file (struct t_config_file *config_file) if (config_file_write (config_file) == 0) { gui_chat_printf (NULL, - _("%sOptions saved to %s"), - gui_chat_prefix[GUI_CHAT_PREFIX_INFO], + _("Options saved to %s"), config_file->filename); } else @@ -1601,8 +1702,7 @@ command_save (void *data, struct t_gui_buffer *buffer, else { gui_chat_printf (NULL, - _("%sUnknown configuration file \"%s\""), - gui_chat_prefix[GUI_CHAT_PREFIX_INFO], + _("Unknown configuration file \"%s\""), argv[i]); } } @@ -1621,33 +1721,55 @@ command_save (void *data, struct t_gui_buffer *buffer, } /* + * command_set_display_section: display configuration section + */ + +void +command_set_display_section (struct t_config_file *config_file, + struct t_config_section *section) +{ + gui_chat_printf (NULL, ""); + gui_chat_printf (NULL, "%s[%s%s%s]%s (%s)", + GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS), + GUI_COLOR(GUI_COLOR_CHAT_BUFFER), + section->name, + GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS), + GUI_COLOR(GUI_COLOR_CHAT), + config_file->filename); +} + +/* * command_set_display_option: display configuration option */ void -command_set_display_option (struct t_config_option *option, char *prefix, +command_set_display_option (struct t_config_file *config_file, + struct t_config_section *section, + struct t_config_option *option, char *message) { char *color_name; switch (option->type) { - case CONFIG_OPTION_BOOLEAN: - gui_chat_printf (NULL, "%s%s%s%s = %s%s", - prefix, + case CONFIG_OPTION_TYPE_BOOLEAN: + gui_chat_printf (NULL, "%s%s.%s.%s%s = %s%s", (message) ? message : " ", + config_file->name, + section->name, option->name, GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS), GUI_COLOR(GUI_COLOR_CHAT_HOST), (CONFIG_BOOLEAN(option) == CONFIG_BOOLEAN_TRUE) ? - "ON" : "OFF"); + "on" : "off"); break; - case CONFIG_OPTION_INTEGER: + case CONFIG_OPTION_TYPE_INTEGER: if (option->string_values) { - gui_chat_printf (NULL, "%s%s%s%s = %s%s", - prefix, + gui_chat_printf (NULL, "%s%s.%s.%s%s = %s%s", (message) ? message : " ", + config_file->name, + section->name, option->name, GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS), GUI_COLOR(GUI_COLOR_CHAT_HOST), @@ -1655,35 +1777,41 @@ command_set_display_option (struct t_config_option *option, char *prefix, } else { - gui_chat_printf (NULL, "%s%s%s%s = %s%d", - prefix, + gui_chat_printf (NULL, "%s%s.%s.%s%s = %s%d", (message) ? message : " ", + config_file->name, + section->name, option->name, GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS), GUI_COLOR(GUI_COLOR_CHAT_HOST), CONFIG_INTEGER(option)); } break; - case CONFIG_OPTION_STRING: - gui_chat_printf (NULL, "%s%s%s%s = \"%s%s%s\"", - prefix, + case CONFIG_OPTION_TYPE_STRING: + gui_chat_printf (NULL, "%s%s.%s.%s%s = \"%s%s%s\"", (message) ? message : " ", + config_file->name, + section->name, option->name, GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS), GUI_COLOR(GUI_COLOR_CHAT_HOST), (option->value) ? CONFIG_STRING(option) : "", GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS)); break; - case CONFIG_OPTION_COLOR: + case CONFIG_OPTION_TYPE_COLOR: color_name = gui_color_get_name (CONFIG_COLOR(option)); - gui_chat_printf (NULL, "%s%s%s%s = %s%s", - prefix, + gui_chat_printf (NULL, "%s%s.%s.%s%s = %s%s", (message) ? message : " ", + config_file->name, + section->name, option->name, GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS), GUI_COLOR(GUI_COLOR_CHAT_HOST), (color_name) ? color_name : _("(unknown)")); break; + case CONFIG_NUM_OPTION_TYPES: + /* make C compiler happy */ + break; } } @@ -1693,43 +1821,51 @@ command_set_display_option (struct t_config_option *option, char *prefix, */ int -command_set_display_option_list (struct t_config_file *config_file, - char *message, char *search) +command_set_display_option_list (char *message, char *search) { - int number_found, section_displayed; + int number_found, section_displayed, length; + char *option_full_name; + struct t_config_file *ptr_config; struct t_config_section *ptr_section; struct t_config_option *ptr_option; - if (!config_file) - return 0; - number_found = 0; - for (ptr_section = config_file->sections; ptr_section; - ptr_section = ptr_section->next_section) + for (ptr_config = config_files; ptr_config; + ptr_config = ptr_config->next_config) { - if (ptr_section->options) + for (ptr_section = ptr_config->sections; ptr_section; + ptr_section = ptr_section->next_section) { section_displayed = 0; + for (ptr_option = ptr_section->options; ptr_option; ptr_option = ptr_option->next_option) { - if ((!search) || - ((search) && (search[0]) - && (string_strcasestr (ptr_option->name, search)))) + length = strlen (ptr_config->name) + 1 + + strlen (ptr_section->name) + 1 + + strlen (ptr_option->name) + 1; + option_full_name = malloc (length); + if (option_full_name) { - if (!section_displayed) + snprintf (option_full_name, length, "%s.%s.%s", + ptr_config->name, ptr_section->name, + ptr_option->name); + if ((!search) || + (search && search[0] && option_full_name + && (string_match (option_full_name, search, 0)))) { - gui_chat_printf (NULL, ""); - gui_chat_printf (NULL, "%s[%s%s%s]", - GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS), - GUI_COLOR(GUI_COLOR_CHAT_BUFFER), - ptr_section->name, - GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS)); - section_displayed = 1; + if (!section_displayed) + { + command_set_display_section (ptr_config, + ptr_section); + section_displayed = 1; + } + command_set_display_option (ptr_config, ptr_section, + ptr_option, message); + number_found++; } - command_set_display_option (ptr_option, "", message); - number_found++; + free (option_full_name); } } } @@ -1737,7 +1873,7 @@ command_set_display_option_list (struct t_config_file *config_file, return number_found; } - + /* * command_set: set config options */ @@ -1747,7 +1883,6 @@ command_set (void *data, struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { char *value; - struct t_config_option *ptr_option; int number_found, rc; /* make C compiler happy */ @@ -1759,8 +1894,7 @@ command_set (void *data, struct t_gui_buffer *buffer, { number_found = 0; - number_found += command_set_display_option_list (weechat_config_file, - NULL, + number_found += command_set_display_option_list (NULL, (argc == 2) ? argv[1] : NULL); @@ -1768,8 +1902,10 @@ command_set (void *data, struct t_gui_buffer *buffer, { if (argc == 2) gui_chat_printf (NULL, - _("No configuration option found with " - "\"%s\""), + _("%sOption \"%s\" not found (tip: you can use " + "\"*\" at beginning and/or end of option to " + "see a sublist)"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], argv[1]); else gui_chat_printf (NULL, @@ -1780,10 +1916,10 @@ command_set (void *data, struct t_gui_buffer *buffer, gui_chat_printf (NULL, ""); if (argc == 2) gui_chat_printf (NULL, - NG_("%s%d%s configuration option found with " - "\"%s\"", - "%s%d%s configuration options found with " - "\"%s\"", + NG_("%s%d%s configuration option found " + "matching with \"%s\"", + "%s%d%s configuration options found " + "matching with \"%s\"", number_found), GUI_COLOR(GUI_COLOR_CHAT_BUFFER), number_found, @@ -1804,41 +1940,29 @@ command_set (void *data, struct t_gui_buffer *buffer, /* set option value */ if ((argc >= 4) && (string_strcasecmp (argv[2], "=") == 0)) { - ptr_option = config_file_search_option (weechat_config_file, NULL, argv[1]); - if (!ptr_option) - { - gui_chat_printf (NULL, - _("%sError: configuration option \"%s\" not " - "found"), - gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], - argv[1]); - return WEECHAT_RC_ERROR; - } value = string_remove_quotes (argv_eol[3], "'\""); - rc = config_file_option_set (ptr_option, - (value) ? value : argv_eol[3], - 0); + rc = config_file_option_set_with_string (argv[1], + (value) ? value : argv_eol[3]); if (value) free (value); - if (rc > 0) + switch (rc) { - command_set_display_option (ptr_option, - gui_chat_prefix[GUI_CHAT_PREFIX_INFO], - _("Option changed: ")); - if ((rc == 2) && (ptr_option->callback_change)) - { - (void) (ptr_option->callback_change) - (ptr_option->callback_change_data); - } - } - else - { - gui_chat_printf (NULL, - _("%sError: incorrect value for " - "option \"%s\""), - gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], - argv[1]); - return WEECHAT_RC_ERROR; + case 0: + gui_chat_printf (NULL, + _("%sError: failed to set option \"%s\""), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + argv[1]); + return WEECHAT_RC_ERROR; + case -1: + gui_chat_printf (NULL, + _("%sError: configuration option \"%s\" not " + "found"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + argv[1]); + return WEECHAT_RC_ERROR; + default: + gui_chat_printf (NULL, _("Option changed")); + break; } } @@ -1846,125 +1970,33 @@ command_set (void *data, struct t_gui_buffer *buffer, } /* - * command_setp: set plugin options + * command_unset: unset/reset config options */ int -command_setp (void *data, struct t_gui_buffer *buffer, - int argc, char **argv, char **argv_eol) +command_unset (void *data, struct t_gui_buffer *buffer, + int argc, char **argv, char **argv_eol) { - char *pos, *ptr_name, *value; - struct t_config_option *ptr_option; - int number_found; - /* make C compiler happy */ (void) data; (void) buffer; - (void) argc; (void) argv; - - if (argc < 3) - { - number_found = 0; - for (ptr_option = plugin_options; ptr_option; - ptr_option = ptr_option->next_option) - { - if ((argc == 1) || - (strstr (ptr_option->name, argv[1]))) - { - if (number_found == 0) - gui_chat_printf (NULL, ""); - gui_chat_printf (NULL, " %s%s = \"%s%s%s\"", - ptr_option->name, - GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS), - GUI_COLOR(GUI_COLOR_CHAT_HOST), - (char *)ptr_option->value, - GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS)); - number_found++; - } - } - if (number_found == 0) - { - if (argc == 2) - gui_chat_printf (NULL, - _("No plugin option found with \"%s\""), - argv[1]); - else - gui_chat_printf (NULL, _("No plugin option found")); - } - else - { - gui_chat_printf (NULL, ""); - if (argc == 2) - gui_chat_printf (NULL, - NG_("%s%d%s plugin option found with \"%s\"", - "%s%d%s plugin options found with \"%s\"", - number_found), - GUI_COLOR(GUI_COLOR_CHAT_BUFFER), - number_found, - GUI_COLOR(GUI_COLOR_CHAT), - argv[1]); - else - gui_chat_printf (NULL, - NG_("%s%d%s plugin option found", - "%s%d%s plugin options found", - number_found), - GUI_COLOR(GUI_COLOR_CHAT_BUFFER), - number_found, - GUI_COLOR(GUI_COLOR_CHAT)); - } - } - - if ((argc >= 4) && (string_strcasecmp (argv[2], "=") == 0)) + + if (argc >= 2) { - ptr_name = NULL; - ptr_option = plugin_config_search_internal (argv[1]); - if (ptr_option) - ptr_name = ptr_option->name; - else - { - pos = strchr (argv[1], '.'); - if (pos) - pos[0] = '\0'; - if (!pos || !pos[1] || (!plugin_search (argv[1]))) - { - gui_chat_printf (NULL, - _("%sError: plugin \"%s\" not found"), - gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], - argv[1]); - if (pos) - pos[0] = '.'; - return WEECHAT_RC_ERROR; - } - else - ptr_name = argv[1]; - if (pos) - pos[0] = '.'; - } - if (ptr_name) + switch (config_file_unset_with_string (argv_eol[1])) { - value = string_remove_quotes (argv_eol[3], "'\""); - if (plugin_config_set_internal (ptr_name, (value) ? value : argv_eol[3])) - gui_chat_printf (NULL, - _("Plugin option changed: %s%s = \"%s%s%s\""), - ptr_name, - GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS), - GUI_COLOR(GUI_COLOR_CHAT_HOST), - value, - GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS)); - else - { - gui_chat_printf (NULL, - _("%sError: incorrect value for plugin " - "option \"%s\""), - gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], - ptr_name); - if (value) - free (value); - return WEECHAT_RC_ERROR; - } - if (value) - free (value); + case 0: + gui_chat_printf (NULL, _("%sOption not found"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]); + break; + case 1: + gui_chat_printf (NULL, _("Option reset")); + break; + case 2: + gui_chat_printf (NULL, _("Option removed")); + break; + } } @@ -2391,10 +2423,11 @@ command_init () "list|enable|disable|toggle|add|del", &command_filter, NULL); hook_command (NULL, "help", - N_("display help about commands"), - N_("[command]"), - N_("command: name of a WeeChat or IRC command"), - "%w|%h", + N_("display help about commands and options"), + N_("[command | option]"), + N_("command: a command name\n" + " option: an option name (use /set to see list)"), + "%h|%o", &command_help, NULL); hook_command (NULL, "history", N_("show buffer command history"), @@ -2435,7 +2468,7 @@ command_init () hook_command (NULL, "quit", N_("quit WeeChat"), "", "", - "%q", + "", &command_quit, NULL); hook_command (NULL, "reload", N_("reload configuration files from disk"), @@ -2456,24 +2489,18 @@ command_init () hook_command (NULL, "set", N_("set config options"), N_("[option [ = value]]"), - N_("option: name of an option (if name is full " - "and no value is given, then help is displayed on " - "option)\n" - " value: value for option\n\n" - "Option may be: servername.server_xxx where " - "\"servername\" is an internal server name and \"xxx\" " - "an option for this server."), + N_("option: name of an option\n" + " value: value for option"), "%o = %v", &command_set, NULL); - hook_command (NULL, "setp", - N_("set plugin config options"), - N_("[option [ = value]]"), - N_("option: name of a plugin option\n" - " value: value for option\n\n" - "Option is format: plugin.option, example: " - "perl.myscript.item1"), - "%O = %V", - &command_setp, NULL); + hook_command (NULL, "unset", + N_("unset/reset config options"), + N_("[option]"), + N_("option: name of an option\n\n" + "According to option, it's reset (for standard options) " + "or removed (for optional settings, like server values)."), + "%o", + &command_unset, NULL); hook_command (NULL, "upgrade", N_("upgrade WeeChat without disconnecting from servers"), N_("[path_to_binary]"), diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c index 3257d35a3..0b052f680 100644 --- a/src/core/wee-config-file.c +++ b/src/core/wee-config-file.c @@ -32,6 +32,7 @@ #include "weechat.h" #include "wee-config-file.h" +#include "wee-hook.h" #include "wee-log.h" #include "wee-string.h" #include "../gui/gui-color.h" @@ -41,6 +42,8 @@ struct t_config_file *config_files = NULL; struct t_config_file *last_config_file = NULL; +char *config_option_type_str[CONFIG_NUM_OPTION_TYPES] = +{ "boolean", "integer", "string", "color" }; char *config_boolean_true[] = { "on", "yes", "y", "true", "t", "1", NULL }; char *config_boolean_false[] = { "off", "no", "n", "false", "f", "0", NULL }; @@ -50,17 +53,17 @@ char *config_boolean_false[] = { "off", "no", "n", "false", "f", "0", NULL }; */ struct t_config_file * -config_file_search (char *filename) +config_file_search (char *name) { struct t_config_file *ptr_config; - if (!filename) + if (!name) return NULL; for (ptr_config = config_files; ptr_config; ptr_config = ptr_config->next_config) { - if (strcmp (ptr_config->filename, filename) == 0) + if (string_strcasecmp (ptr_config->name, name) == 0) return ptr_config; } @@ -73,24 +76,30 @@ config_file_search (char *filename) */ struct t_config_file * -config_file_new (struct t_weechat_plugin *plugin, char *filename, +config_file_new (struct t_weechat_plugin *plugin, char *name, int (*callback_reload)(void *data, struct t_config_file *config_file), void *callback_reload_data) { struct t_config_file *new_config_file; + char *filename; + int length; - if (!filename) + if (!name) return NULL; /* it's NOT authorized to create two config files with same filename */ - if (config_file_search (filename)) + if (config_file_search (name)) return NULL; new_config_file = malloc (sizeof (*new_config_file)); if (new_config_file) { new_config_file->plugin = plugin; + new_config_file->name = strdup (name); + length = strlen (name) + 8 + 1; + filename = malloc (length); + snprintf (filename, length, "%s.conf", name); new_config_file->filename = strdup (filename); new_config_file->file = NULL; new_config_file->callback_reload = callback_reload; @@ -140,9 +149,11 @@ config_file_valid_for_plugin (struct t_weechat_plugin *plugin, struct t_config_section * config_file_new_section (struct t_config_file *config_file, char *name, - void (*callback_read)(void *data, - struct t_config_file *config_file, - char *option_name, char *value), + int (*callback_read)(void *data, + struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, + char *value), void *callback_read_data, void (*callback_write)(void *data, struct t_config_file *config_file, @@ -151,7 +162,13 @@ config_file_new_section (struct t_config_file *config_file, char *name, void (*callback_write_default)(void *data, struct t_config_file *config_file, char *section_name), - void *callback_write_default_data) + void *callback_write_default_data, + int (*callback_create_option)(void *data, + struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, + char *value), + void *callback_create_option_data) { struct t_config_section *new_section; @@ -168,6 +185,8 @@ config_file_new_section (struct t_config_file *config_file, char *name, new_section->callback_write_data = callback_write_data; new_section->callback_write_default = callback_write_default; new_section->callback_write_default_data = callback_write_default_data; + new_section->callback_create_option = callback_create_option; + new_section->callback_create_option_data = callback_create_option_data; new_section->options = NULL; new_section->last_option = NULL; @@ -239,35 +258,64 @@ config_file_section_valid_for_plugin (struct t_weechat_plugin *plugin, } /* - * config_file_new_option: create a new option in a config section + * config_file_option_find_pos: find position for an option in section + * (for sorting options) + */ + +struct t_config_option * +config_file_option_find_pos (struct t_config_section *section, char *name) +{ + struct t_config_option *ptr_option; + + for (ptr_option = section->options; ptr_option; + ptr_option = ptr_option->next_option) + { + if (string_strcasecmp (name, ptr_option->name) < 0) + return ptr_option; + } + + /* position not found (we will add to the end of list) */ + return NULL; +} + +/* + * config_file_new_option: create a new option */ struct t_config_option * config_file_new_option (struct t_config_file *config_file, struct t_config_section *section, char *name, - char *type, char *description, char *string_values, - int min, int max, char *default_value, - void (*callback_change)(), - void *callback_change_data) + char *type, char *description, + char *string_values, int min, int max, + char *default_value, + int (*callback_check_value)(void *data, + struct t_config_option *option, + char *value), + void *callback_check_value_data, + void (*callback_change)(void *data, + struct t_config_option *option), + void *callback_change_data, + void (*callback_delete)(void *data, + struct t_config_option *option), + void *callback_delete_data) { - struct t_config_option *new_option; + struct t_config_option *new_option, *pos_option; int var_type, int_value, argc, i, index_value; long number; char *error; - if (!config_file || !section || !name) + if (!name) return NULL; var_type = -1; - if (string_strcasecmp (type, "boolean") == 0) - var_type = CONFIG_OPTION_BOOLEAN; - if (string_strcasecmp (type, "integer") == 0) - var_type = CONFIG_OPTION_INTEGER; - if (string_strcasecmp (type, "string") == 0) - var_type = CONFIG_OPTION_STRING; - if (string_strcasecmp (type, "color") == 0) - var_type = CONFIG_OPTION_COLOR; - + for (i = 0; i < CONFIG_NUM_OPTION_TYPES; i++) + { + if (string_strcasecmp (type, config_option_type_str[i]) == 0) + { + var_type = i; + break; + } + } if (var_type < 0) { gui_chat_printf (NULL, "%sError: unknown option type \"%s\"", @@ -279,13 +327,15 @@ config_file_new_option (struct t_config_file *config_file, new_option = malloc (sizeof (*new_option)); if (new_option) { + new_option->config_file = config_file; + new_option->section = section; new_option->name = strdup (name); new_option->type = var_type; new_option->description = (description) ? strdup (description) : NULL; argc = 0; switch (var_type) { - case CONFIG_OPTION_BOOLEAN: + case CONFIG_OPTION_TYPE_BOOLEAN: new_option->string_values = NULL; new_option->min = CONFIG_BOOLEAN_FALSE; new_option->max = CONFIG_BOOLEAN_TRUE; @@ -295,7 +345,7 @@ config_file_new_option (struct t_config_file *config_file, new_option->value = malloc (sizeof (int)); *((int *)new_option->value) = int_value; break; - case CONFIG_OPTION_INTEGER: + case CONFIG_OPTION_TYPE_INTEGER: new_option->string_values = (string_values) ? string_explode (string_values, "|", 0, 0, &argc) : NULL; if (new_option->string_values) @@ -332,7 +382,7 @@ config_file_new_option (struct t_config_file *config_file, *((int *)new_option->value) = number; } break; - case CONFIG_OPTION_STRING: + case CONFIG_OPTION_TYPE_STRING: new_option->string_values = NULL; new_option->min = min; new_option->max = max; @@ -341,7 +391,7 @@ config_file_new_option (struct t_config_file *config_file, new_option->value = (default_value) ? strdup (default_value) : NULL; break; - case CONFIG_OPTION_COLOR: + case CONFIG_OPTION_TYPE_COLOR: new_option->string_values = NULL; new_option->min = min; new_option->max = min; @@ -351,18 +401,56 @@ config_file_new_option (struct t_config_file *config_file, new_option->value = malloc (sizeof (int)); *((int *)new_option->value) = *((int *)new_option->default_value); break; + case CONFIG_NUM_OPTION_TYPES: + break; } + new_option->callback_check_value = callback_check_value; + new_option->callback_check_value_data = callback_check_value_data; new_option->callback_change = callback_change; new_option->callback_change_data = callback_change_data; + new_option->callback_delete = callback_delete; + new_option->callback_delete_data = callback_delete_data; new_option->loaded = 0; - - new_option->prev_option = section->last_option; - new_option->next_option = NULL; - if (section->options) - section->last_option->next_option = new_option; + + if (section) + { + if (section->options) + { + pos_option = config_file_option_find_pos (section, name); + if (pos_option) + { + /* insert option into the list (before option found) */ + new_option->prev_option = pos_option->prev_option; + new_option->next_option = pos_option; + if (pos_option->prev_option) + (pos_option->prev_option)->next_option = new_option; + else + section->options = new_option; + pos_option->prev_option = new_option; + } + else + { + /* add option to end of section */ + new_option->prev_option = section->last_option; + new_option->next_option = NULL; + section->last_option->next_option = new_option; + section->last_option = new_option; + } + } + else + { + /* first option for section */ + new_option->prev_option = NULL; + new_option->next_option = NULL; + section->options = new_option; + section->last_option = new_option; + } + } else - section->options = new_option; - section->last_option = new_option; + { + new_option->prev_option = NULL; + new_option->next_option = NULL; + } } return new_option; @@ -408,6 +496,130 @@ config_file_search_option (struct t_config_file *config_file, } /* + * config_file_search_section_option: search an option in a config or section + * and return section/option + */ + +void +config_file_search_section_option (struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, + struct t_config_section **section_found, + struct t_config_option **option_found) +{ + struct t_config_section *ptr_section; + struct t_config_option *ptr_option; + + *section_found = NULL; + *option_found = NULL; + + if (section) + { + for (ptr_option = section->options; ptr_option; + ptr_option = ptr_option->next_option) + { + if (string_strcasecmp (ptr_option->name, option_name) == 0) + { + *section_found = section; + *option_found = ptr_option; + return; + } + } + } + else if (config_file) + { + for (ptr_section = config_file->sections; ptr_section; + ptr_section = ptr_section->next_section) + { + for (ptr_option = ptr_section->options; ptr_option; + ptr_option = ptr_option->next_option) + { + if (string_strcasecmp (ptr_option->name, option_name) == 0) + { + *section_found = ptr_section; + *option_found = ptr_option; + } + } + } + } +} + +/* + * config_file_search_with_string: search file/section/option for + * an option with full string + * (file.section.option) + */ + +void +config_file_search_with_string (char *option_name, + struct t_config_file **config_file, + struct t_config_section **section, + struct t_config_option **option, + char **pos_option_name) +{ + struct t_config_file *ptr_config; + struct t_config_section *ptr_section; + struct t_config_option *ptr_option; + char *file_name, *pos_section, *section_name, *pos_option; + + if (config_file) + *config_file = NULL; + if (section) + *section = NULL; + if (option) + *option = NULL; + if (pos_option_name) + *pos_option_name = NULL; + + ptr_config = NULL; + ptr_section = NULL; + ptr_option = NULL; + + file_name = NULL; + section_name = NULL; + pos_option = NULL; + + pos_section = strchr (option_name, '.'); + pos_option = (pos_section) ? strchr (pos_section + 1, '.') : NULL; + if (pos_section && pos_option) + { + file_name = string_strndup (option_name, pos_section - option_name); + section_name = string_strndup (pos_section + 1, + pos_option - pos_section - 1); + pos_option++; + } + if (file_name && section_name && pos_option) + { + if (pos_option_name) + *pos_option_name = pos_option; + ptr_config = config_file_search (file_name); + if (ptr_config) + { + ptr_section = config_file_search_section (ptr_config, + section_name); + if (ptr_section) + { + ptr_option = config_file_search_option (ptr_config, + ptr_section, + pos_option); + } + } + } + + if (file_name) + free (file_name); + if (section_name) + free (section_name); + + if (config_file) + *config_file = ptr_config; + if (section) + *section = ptr_section; + if (option) + *option = ptr_option; +} + +/* * config_file_option_valid_for_plugin: check if an option pointer exists for a plugin * return 1 if option exists for plugin * 0 if option is not found for plugin @@ -494,177 +706,357 @@ config_file_string_to_boolean (char *text) } /* + * config_file_option_reset: set default value for an option + * return: 2 if ok (value changed) + * 1 if ok (value is the same) + * 0 if failed + */ + +int +config_file_option_reset (struct t_config_option *option, int run_callback) +{ + int rc; + + if (!option) + return 0; + + rc = 0; + + switch (option->type) + { + case CONFIG_OPTION_TYPE_BOOLEAN: + if (CONFIG_BOOLEAN(option) == CONFIG_BOOLEAN_DEFAULT(option)) + rc = 1; + else + { + CONFIG_BOOLEAN(option) = CONFIG_BOOLEAN_DEFAULT(option); + rc = 2; + } + break; + case CONFIG_OPTION_TYPE_INTEGER: + if (CONFIG_INTEGER(option) == CONFIG_INTEGER_DEFAULT(option)) + rc = 1; + else + { + CONFIG_INTEGER(option) = CONFIG_INTEGER_DEFAULT(option); + rc = 2; + } + break; + case CONFIG_OPTION_TYPE_STRING: + rc = 1; + if ((!option->value && option->default_value) + || (option->value && !option->default_value) + || (strcmp ((char *)option->value, + (char *)option->default_value) != 0)) + rc = 2; + if (option->value) + free (option->value); + if (option->default_value) + { + option->value = strdup ((char *)option->default_value); + if (!option->value) + rc = 0; + } + else + option->value = NULL; + break; + case CONFIG_OPTION_TYPE_COLOR: + if (CONFIG_COLOR(option) == CONFIG_COLOR_DEFAULT(option)) + rc = 1; + else + { + CONFIG_COLOR(option) = CONFIG_COLOR_DEFAULT(option); + rc = 2; + } + break; + case CONFIG_NUM_OPTION_TYPES: + break; + } + + if ((rc == 2) && run_callback && option->callback_change) + { + (void)(option->callback_change)(option->callback_change_data, option); + } + + return 0; +} + +/* * config_file_option_set: set value for an option + * if value is NULL, then default value for option is set * return: 2 if ok (value changed) * 1 if ok (value is the same) * 0 if failed */ int -config_file_option_set (struct t_config_option *option, char *new_value, +config_file_option_set (struct t_config_option *option, char *value, int run_callback) { - int new_value_int, i, rc; + int value_int, i, rc, length_option; long number; - char *error; + char *error, *option_full_name; if (!option) return 0; + rc = 0; + + if (value && option->callback_check_value) + { + if (!(int)(option->callback_check_value) + (option->callback_check_value_data, + option, + value)) + return 0; + } + switch (option->type) { - case CONFIG_OPTION_BOOLEAN: - if (!new_value) - return 0; - if (!config_file_string_boolean_is_valid (new_value)) - return 0; - new_value_int = config_file_string_to_boolean (new_value); - if (new_value_int == *((int *)option->value)) - return 1; - *((int *)option->value) = new_value_int; - if (run_callback && option->callback_change) - { - (void) (option->callback_change) - (option->callback_change_data); - } - return 2; - case CONFIG_OPTION_INTEGER: - if (!new_value) - return 0; - if (option->string_values) + case CONFIG_OPTION_TYPE_BOOLEAN: + if (value) { - new_value_int = -1; - for (i = 0; option->string_values[i]; i++) + if (config_file_string_boolean_is_valid (value)) { - if (string_strcasecmp (option->string_values[i], - new_value) == 0) + value_int = config_file_string_to_boolean (value); + if (value_int == *((int *)option->value)) + rc = 1; + else { - new_value_int = i; - break; + *((int *)option->value) = value_int; + rc = 2; } } - if (new_value_int < 0) - return 0; - if (new_value_int == *((int *)option->value)) - return 1; - *((int *)option->value) = new_value_int; - if (run_callback && option->callback_change) - { - (void) (option->callback_change) - (option->callback_change_data); - } - return 2; } - else + break; + case CONFIG_OPTION_TYPE_INTEGER: + if (value) { - error = NULL; - number = strtol (new_value, &error, 10); - if (error && !error[0]) + if (option->string_values) { - if (number == *((int *)option->value)) - return 1; - *((int *)option->value) = number; - if (run_callback && option->callback_change) + value_int = -1; + for (i = 0; option->string_values[i]; i++) + { + if (string_strcasecmp (option->string_values[i], + value) == 0) + { + value_int = i; + break; + } + } + if (value_int >= 0) + { + if (value_int == *((int *)option->value)) + rc = 1; + else + { + *((int *)option->value) = value_int; + rc = 2; + } + } + } + else + { + error = NULL; + number = strtol (value, &error, 10); + if (error && !error[0]) { - (void) (option->callback_change) - (option->callback_change_data); + if (number == *((int *)option->value)) + rc = 1; + else + { + *((int *)option->value) = number; + rc = 2; + } } - return 2; } } break; - case CONFIG_OPTION_STRING: + case CONFIG_OPTION_TYPE_STRING: rc = 1; - if ((!option->value && new_value) - || (option->value && !new_value) - || (strcmp ((char *)option->value, new_value) != 0)) + if ((!option->value && value) + || (option->value && !value) + || (strcmp ((char *)option->value, value) != 0)) rc = 2; if (option->value) free (option->value); - if (new_value) + if (value) { - option->value = strdup (new_value); + option->value = strdup (value); if (!option->value) - return 0; + rc = 0; } else option->value = NULL; - if (run_callback && (rc == 2) && option->callback_change) + break; + case CONFIG_OPTION_TYPE_COLOR: + if (gui_color_assign (&value_int, value)) { - (void) (option->callback_change) - (option->callback_change_data); + if (value_int == *((int *)option->value)) + rc = 1; + else + { + *((int *)option->value) = value_int; + rc = 2; + } } - return rc; - case CONFIG_OPTION_COLOR: - if (!gui_color_assign (&new_value_int, new_value)) - return 0; - if (new_value_int == *((int *)option->value)) - return 1; - *((int *)option->value) = new_value_int; - if (run_callback && option->callback_change) + break; + case CONFIG_NUM_OPTION_TYPES: + break; + } + + if ((rc == 2) && run_callback && option->callback_change) + { + (void)(option->callback_change)(option->callback_change_data, option); + } + + if (rc > 0) + { + if (option->config_file && option->section) + { + length_option = strlen (option->config_file->name) + 1 + + strlen (option->section->name) + 1 + strlen (option->name) + 1; + option_full_name = malloc (length_option); + if (option_full_name) { - (void) (option->callback_change) - (option->callback_change_data); + snprintf (option_full_name, length_option, + "%s.%s.%s", + option->config_file->name, + option->section->name, + option->name); + hook_config_exec (option_full_name, value); + free (option_full_name); } - return 2; + } } - return 0; + return rc; } /* - * config_file_option_reset: set default value for an option - * return: 2 if ok (value changed) - * 1 if ok (value is the same) - * 0 if failed + * config_file_option_get_pointer: get a pointer of an option property + */ + +void * +config_file_option_get_pointer (struct t_config_option *option, char *property) +{ + if (string_strcasecmp (property, "config_file") == 0) + return option->config_file; + else if (string_strcasecmp (property, "section") == 0) + return option->section; + else if (string_strcasecmp (property, "name") == 0) + return option->name; + else if (string_strcasecmp (property, "type") == 0) + return &option->type; + else if (string_strcasecmp (property, "description") == 0) + return option->description; + else if (string_strcasecmp (property, "string_values") == 0) + return option->string_values; + else if (string_strcasecmp (property, "min") == 0) + return &option->min; + else if (string_strcasecmp (property, "max") == 0) + return &option->max; + else if (string_strcasecmp (property, "default_value") == 0) + return option->default_value; + else if (string_strcasecmp (property, "value") == 0) + return option->value; + else if (string_strcasecmp (property, "prev_option") == 0) + return option->prev_option; + else if (string_strcasecmp (property, "next_option") == 0) + return option->next_option; + + return NULL; +} + +/* + * config_file_option_set_with_string: set value for an option (with a string + * for name of option) + * return: 2 if ok (value changed) + * 1 if ok (value is the same) + * 0 if failed to set option + * -1 if option is not found */ int -config_file_option_reset (struct t_config_option *option) +config_file_option_set_with_string (char *option_name, char *value) { int rc; + struct t_config_file *ptr_config; + struct t_config_section *ptr_section; + struct t_config_option *ptr_option; + char *pos_option; - if (!option) - return 0; + rc = 0; - switch (option->type) + config_file_search_with_string (option_name, &ptr_config, &ptr_section, + &ptr_option, &pos_option); + + if (ptr_config && ptr_section) { - case CONFIG_OPTION_BOOLEAN: - if (CONFIG_BOOLEAN(option) == CONFIG_BOOLEAN_DEFAULT(option)) - return 1; - CONFIG_BOOLEAN(option) = CONFIG_BOOLEAN_DEFAULT(option); - return 2; - case CONFIG_OPTION_INTEGER: - if (CONFIG_INTEGER(option) == CONFIG_INTEGER_DEFAULT(option)) - return 1; - CONFIG_INTEGER(option) = CONFIG_INTEGER_DEFAULT(option); - return 2; - case CONFIG_OPTION_STRING: - rc = 1; - if ((!option->value && option->default_value) - || (option->value && !option->default_value) - || (strcmp ((char *)option->value, - (char *)option->default_value) != 0)) - rc = 2; - if (option->value) - free (option->value); - if (option->default_value) + if (ptr_option) + rc = config_file_option_set (ptr_option, value, 1); + else + { + if (ptr_section->callback_create_option) { - option->value = strdup ((char *)option->default_value); - if (!option->value) - return 0; + rc = (int)(ptr_section->callback_create_option) + (ptr_section->callback_create_option_data, + ptr_config, + ptr_section, + pos_option, + value); + if (rc > 0) + hook_config_exec (option_name, value); } - else - option->value = NULL; - return rc; - case CONFIG_OPTION_COLOR: - if (CONFIG_COLOR(option) == CONFIG_COLOR_DEFAULT(option)) - return 1; - CONFIG_COLOR(option) = CONFIG_COLOR_DEFAULT(option); - return 2; + } } - return 0; + return rc; +} + +/* + * config_file_unset_with_string: unset/reset option + * return: 0 if failed + * 1 if option reset + * 2 if option removed + */ + +int +config_file_unset_with_string (char *option_name) +{ + struct t_config_section *ptr_section; + struct t_config_option *ptr_option; + int rc; + + rc = 0; + + config_file_search_with_string (option_name, NULL, &ptr_section, + &ptr_option, NULL); + + /* delete option */ + if (ptr_section && ptr_option) + { + if (ptr_section->callback_create_option) + { + /* removing option */ + if (ptr_option->callback_delete) + { + (void)(ptr_option->callback_delete) + (ptr_option->callback_delete_data, + ptr_option); + } + config_file_option_free (ptr_section, ptr_option); + rc = 2; + } + else + { + /* reset value */ + config_file_option_reset (ptr_option, 1); + rc = 1; + } + } + + return rc; } /* @@ -677,7 +1069,7 @@ config_file_option_boolean (struct t_config_option *option) if (!option) return 0; - if (option->type == CONFIG_OPTION_BOOLEAN) + if (option->type == CONFIG_OPTION_TYPE_BOOLEAN) return CONFIG_BOOLEAN(option); else return 0; @@ -695,16 +1087,18 @@ config_file_option_integer (struct t_config_option *option) switch (option->type) { - case CONFIG_OPTION_BOOLEAN: + case CONFIG_OPTION_TYPE_BOOLEAN: if (CONFIG_BOOLEAN(option) == CONFIG_BOOLEAN_TRUE) return 1; else return 0; - case CONFIG_OPTION_INTEGER: - case CONFIG_OPTION_COLOR: + case CONFIG_OPTION_TYPE_INTEGER: + case CONFIG_OPTION_TYPE_COLOR: return CONFIG_INTEGER(option); - case CONFIG_OPTION_STRING: + case CONFIG_OPTION_TYPE_STRING: return 0; + case CONFIG_NUM_OPTION_TYPES: + break; } return 0; } @@ -721,13 +1115,17 @@ config_file_option_string (struct t_config_option *option) switch (option->type) { - case CONFIG_OPTION_STRING: - return CONFIG_STRING(option); - case CONFIG_OPTION_INTEGER: + case CONFIG_OPTION_TYPE_BOOLEAN: + return NULL; + case CONFIG_OPTION_TYPE_INTEGER: if (option->string_values) return option->string_values[CONFIG_INTEGER(option)]; return NULL; - default: + case CONFIG_OPTION_TYPE_STRING: + return CONFIG_STRING(option); + case CONFIG_OPTION_TYPE_COLOR: + return NULL; + case CONFIG_NUM_OPTION_TYPES: return NULL; } return NULL; @@ -743,7 +1141,7 @@ config_file_option_color (struct t_config_option *option) if (!option) return 0; - if (option->type == CONFIG_OPTION_COLOR) + if (option->type == CONFIG_OPTION_TYPE_COLOR) return CONFIG_COLOR(option); else return 0; @@ -767,13 +1165,13 @@ config_file_write_option (struct t_config_file *config_file, switch (option->type) { - case CONFIG_OPTION_BOOLEAN: + case CONFIG_OPTION_TYPE_BOOLEAN: string_iconv_fprintf (config_file->file, "%s = %s\n", option->name, (*((int *)value)) == CONFIG_BOOLEAN_TRUE ? "on" : "off"); break; - case CONFIG_OPTION_INTEGER: + case CONFIG_OPTION_TYPE_INTEGER: if (option->string_values) string_iconv_fprintf (config_file->file, "%s = %s\n", option->name, @@ -783,16 +1181,18 @@ config_file_write_option (struct t_config_file *config_file, option->name, *((int *)value)); break; - case CONFIG_OPTION_STRING: + case CONFIG_OPTION_TYPE_STRING: string_iconv_fprintf (config_file->file, "%s = \"%s\"\n", option->name, (char *)value); break; - case CONFIG_OPTION_COLOR: + case CONFIG_OPTION_TYPE_COLOR: string_iconv_fprintf (config_file->file, "%s = %s\n", option->name, gui_color_get_name (*((int *)value))); break; + case CONFIG_NUM_OPTION_TYPES: + break; } } @@ -885,10 +1285,10 @@ config_file_write_internal (struct t_config_file *config_file, /* write header with version and date */ current_time = time (NULL); + string_iconv_fprintf (config_file->file, "#\n"); string_iconv_fprintf (config_file->file, - _("#\n# %s configuration file, created by " - "%s v%s on %s#\n"), - PACKAGE_NAME, PACKAGE_NAME, PACKAGE_VERSION, + "# %s -- %s v%s, %s#\n", + config_file->filename, PACKAGE_NAME, PACKAGE_VERSION, ctime (¤t_time)); /* write all sections */ @@ -1043,16 +1443,7 @@ config_file_read_internal (struct t_config_file *config_file, int reload) pos = ptr_line + 1; ptr_section = config_file_search_section (config_file, pos); - if (ptr_section) - { - if (ptr_section->callback_read) - { - (void) (ptr_section->callback_read) (ptr_section->callback_read_data, - config_file, - NULL, NULL); - } - } - else + if (!ptr_section) { gui_chat_printf (NULL, _("%sWarning: %s, line %d: unknown " @@ -1121,14 +1512,16 @@ config_file_read_internal (struct t_config_file *config_file, int reload) pos++; } } - + if (ptr_section && ptr_section->callback_read) { ptr_option = NULL; - (void) (ptr_section->callback_read) (ptr_section->callback_read_data, - config_file, - line, pos); - rc = 1; + rc = (ptr_section->callback_read) + (ptr_section->callback_read_data, + config_file, + ptr_section, + line, + pos); } else { @@ -1141,6 +1534,19 @@ config_file_read_internal (struct t_config_file *config_file, int reload) rc = config_file_option_set (ptr_option, pos, 1); ptr_option->loaded = 1; } + else + { + if (ptr_section + && ptr_section->callback_create_option) + { + rc = (int)(ptr_section->callback_create_option) + (ptr_section->callback_create_option_data, + config_file, + ptr_section, + line, + pos); + } + } } switch (rc) @@ -1222,13 +1628,10 @@ config_file_reload (struct t_config_file *config_file) for (ptr_section = config_file->sections; ptr_section; ptr_section = ptr_section->next_section) { - if (!ptr_section->callback_read) + for (ptr_option = ptr_section->options; ptr_option; + ptr_option = ptr_option->next_option) { - for (ptr_option = ptr_section->options; ptr_option; - ptr_option = ptr_option->next_option) - { - ptr_option->loaded = 0; - } + ptr_option->loaded = 0; } } @@ -1239,23 +1642,11 @@ config_file_reload (struct t_config_file *config_file) for (ptr_section = config_file->sections; ptr_section; ptr_section = ptr_section->next_section) { - if (!ptr_section->callback_read) + for (ptr_option = ptr_section->options; ptr_option; + ptr_option = ptr_option->next_option) { - for (ptr_option = ptr_section->options; ptr_option; - ptr_option = ptr_option->next_option) - { - if (!ptr_option->loaded) - { - if (config_file_option_reset (ptr_option) == 2) - { - if (ptr_option->callback_change) - { - (void) (ptr_option->callback_change) - (ptr_option->callback_change_data); - } - } - } - } + if (!ptr_option->loaded) + config_file_option_reset (ptr_option, 1); } } @@ -1291,29 +1682,48 @@ config_file_option_free (struct t_config_section *section, { struct t_config_option *new_options; - if (!section || !option) + if (!option) return; - /* remove option */ - if (section->last_option == option) - section->last_option = option->prev_option; - if (option->prev_option) + /* remove option from section */ + if (section) { - (option->prev_option)->next_option = option->next_option; - new_options = section->options; + if (section->last_option == option) + section->last_option = option->prev_option; + if (option->prev_option) + { + (option->prev_option)->next_option = option->next_option; + new_options = section->options; + } + else + new_options = option->next_option; + if (option->next_option) + (option->next_option)->prev_option = option->prev_option; } - else - new_options = option->next_option; - - if (option->next_option) - (option->next_option)->prev_option = option->prev_option; /* free data */ config_file_option_free_data (option); free (option); - section->options = new_options; + if (section) + section->options = new_options; +} + +/* + * config_file_section_free_options: free options in a section + */ + +void +config_file_section_free_options (struct t_config_section *section) +{ + if (!section) + return; + + while (section->options) + { + config_file_option_free (section, section->options); + } } /* @@ -1344,10 +1754,7 @@ config_file_section_free (struct t_config_file *config_file, (section->next_section)->prev_section = section->prev_section; /* free data */ - while (section->options) - { - config_file_option_free (section, section->options); - } + config_file_section_free_options (section); if (section->name) free (section->name); @@ -1387,6 +1794,8 @@ config_file_free (struct t_config_file *config_file) { config_file_section_free (config_file, config_file->sections); } + if (config_file->name) + free (config_file->name); if (config_file->filename) free (config_file->filename); @@ -1452,14 +1861,14 @@ config_file_print_stdout (struct t_config_file *config_file) ptr_option->name); switch (ptr_option->type) { - case CONFIG_OPTION_BOOLEAN: + case CONFIG_OPTION_TYPE_BOOLEAN: string_iconv_fprintf (stdout, _(" . type: boolean\n")); string_iconv_fprintf (stdout, _(" . values: 'on' or 'off'\n")); string_iconv_fprintf (stdout, _(" . default value: '%s'\n"), (CONFIG_BOOLEAN_DEFAULT(ptr_option) == CONFIG_BOOLEAN_TRUE) ? "on" : "off"); break; - case CONFIG_OPTION_INTEGER: + case CONFIG_OPTION_TYPE_INTEGER: if (ptr_option->string_values) { string_iconv_fprintf (stdout, _(" . type: string\n")); @@ -1487,7 +1896,7 @@ config_file_print_stdout (struct t_config_file *config_file) CONFIG_INTEGER_DEFAULT(ptr_option)); } break; - case CONFIG_OPTION_STRING: + case CONFIG_OPTION_TYPE_STRING: switch (ptr_option->max) { case 0: @@ -1507,13 +1916,15 @@ config_file_print_stdout (struct t_config_file *config_file) string_iconv_fprintf (stdout, _(" . default value: '%s'\n"), CONFIG_STRING_DEFAULT(ptr_option)); break; - case CONFIG_OPTION_COLOR: + case CONFIG_OPTION_TYPE_COLOR: color_name = gui_color_get_name (CONFIG_COLOR_DEFAULT(ptr_option)); string_iconv_fprintf (stdout, _(" . type: color\n")); string_iconv_fprintf (stdout, _(" . values: color (depends on GUI used)\n")); string_iconv_fprintf (stdout, _(" . default value: '%s'\n"), color_name); break; + case CONFIG_NUM_OPTION_TYPES: + break; } string_iconv_fprintf (stdout, _(" . description: %s\n"), _(ptr_option->description)); @@ -1539,8 +1950,11 @@ config_file_print_log () log_printf (""); log_printf ("[config (addr:0x%x)]", ptr_config_file); log_printf (" plugin . . . . . . . . : 0x%x", ptr_config_file->plugin); + log_printf (" name . . . . . . . . . : '%s'", ptr_config_file->name); log_printf (" filename . . . . . . . : '%s'", ptr_config_file->filename); log_printf (" file . . . . . . . . . : 0x%x", ptr_config_file->file); + log_printf (" callback_reload. . . . : 0x%x", ptr_config_file->callback_reload); + log_printf (" callback_reload_data . : 0x%x", ptr_config_file->callback_reload_data); log_printf (" sections . . . . . . . : 0x%x", ptr_config_file->sections); log_printf (" last_section . . . . . : 0x%x", ptr_config_file->last_section); log_printf (" prev_config. . . . . . : 0x%x", ptr_config_file->prev_config); @@ -1551,20 +1965,27 @@ config_file_print_log () { log_printf (""); log_printf (" [section (addr:0x%x)]", ptr_section); - log_printf (" name . . . . . . . . . : '%s'", ptr_section->name); - log_printf (" callback_read. . . . . : 0x%x", ptr_section->callback_read); - log_printf (" callback_write . . . . : 0x%x", ptr_section->callback_write); - log_printf (" callback_write_default : 0x%x", ptr_section->callback_write_default); - log_printf (" options. . . . . . . . : 0x%x", ptr_section->options); - log_printf (" last_option. . . . . . : 0x%x", ptr_section->last_option); - log_printf (" prev_section . . . . . : 0x%x", ptr_section->prev_section); - log_printf (" next_section . . . . . : 0x%x", ptr_section->next_section); + log_printf (" name . . . . . . . . . . . : '%s'", ptr_section->name); + log_printf (" callback_read. . . . . . . : 0x%x", ptr_section->callback_read); + log_printf (" callback_read_data . . . . : 0x%x", ptr_section->callback_read_data); + log_printf (" callback_write . . . . . . : 0x%x", ptr_section->callback_write); + log_printf (" callback_write_data. . . . : 0x%x", ptr_section->callback_write_data); + log_printf (" callback_write_default . . : 0x%x", ptr_section->callback_write_default); + log_printf (" callback_write_default_data: 0x%x", ptr_section->callback_write_default_data); + log_printf (" callback_create_option. . .: 0x%x", ptr_section->callback_create_option); + log_printf (" callback_create_option_data: 0x%x", ptr_section->callback_create_option_data); + log_printf (" options. . . . . . . . . . : 0x%x", ptr_section->options); + log_printf (" last_option. . . . . . . . : 0x%x", ptr_section->last_option); + log_printf (" prev_section . . . . . . . : 0x%x", ptr_section->prev_section); + log_printf (" next_section . . . . . . . : 0x%x", ptr_section->next_section); for (ptr_option = ptr_section->options; ptr_option; ptr_option = ptr_option->next_option) { log_printf (""); log_printf (" [option (addr:0x%x)]", ptr_option); + log_printf (" config_file. . . . . : 0x%x", ptr_option->config_file); + log_printf (" section. . . . . . . : 0x%x", ptr_option->section); log_printf (" name . . . . . . . . : '%s'", ptr_option->name); log_printf (" type . . . . . . . . : %d", ptr_option->type); log_printf (" description. . . . . : '%s'", ptr_option->description); @@ -1573,15 +1994,15 @@ config_file_print_log () log_printf (" max. . . . . . . . . : %d", ptr_option->max); switch (ptr_option->type) { - case CONFIG_OPTION_BOOLEAN: + case CONFIG_OPTION_TYPE_BOOLEAN: log_printf (" default value. . . . : %s", (CONFIG_BOOLEAN_DEFAULT(ptr_option) == CONFIG_BOOLEAN_TRUE) ? - "true" : "false"); + "on" : "off"); log_printf (" value (boolean). . . : %s", (CONFIG_BOOLEAN(ptr_option) == CONFIG_BOOLEAN_TRUE) ? - "true" : "false"); + "on" : "off"); break; - case CONFIG_OPTION_INTEGER: + case CONFIG_OPTION_TYPE_INTEGER: if (ptr_option->string_values) { log_printf (" default value. . . . : '%s'", @@ -1591,15 +2012,19 @@ config_file_print_log () } else { - log_printf (" default value. . . . : %d", CONFIG_INTEGER_DEFAULT(ptr_option)); - log_printf (" value (integer). . . : %d", CONFIG_INTEGER(ptr_option)); + log_printf (" default value. . . . : %d", + CONFIG_INTEGER_DEFAULT(ptr_option)); + log_printf (" value (integer). . . : %d", + CONFIG_INTEGER(ptr_option)); } break; - case CONFIG_OPTION_STRING: - log_printf (" default value. . . . : '%s'", CONFIG_STRING_DEFAULT(ptr_option)); - log_printf (" value (string) . . . : '%s'", CONFIG_STRING(ptr_option)); + case CONFIG_OPTION_TYPE_STRING: + log_printf (" default value. . . . : '%s'", + CONFIG_STRING_DEFAULT(ptr_option)); + log_printf (" value (string) . . . : '%s'", + CONFIG_STRING(ptr_option)); break; - case CONFIG_OPTION_COLOR: + case CONFIG_OPTION_TYPE_COLOR: log_printf (" default value. . . . : %d ('%s')", CONFIG_COLOR_DEFAULT(ptr_option), gui_color_get_name (CONFIG_COLOR_DEFAULT(ptr_option))); @@ -1607,6 +2032,8 @@ config_file_print_log () CONFIG_COLOR(ptr_option), gui_color_get_name (CONFIG_COLOR(ptr_option))); break; + case CONFIG_NUM_OPTION_TYPES: + break; } log_printf (" callback_change. . . : 0x%x", ptr_option->callback_change); log_printf (" loaded . . . . . . . : %d", ptr_option->loaded); diff --git a/src/core/wee-config-file.h b/src/core/wee-config-file.h index 0b65f53f3..ab5faa205 100644 --- a/src/core/wee-config-file.h +++ b/src/core/wee-config-file.h @@ -35,10 +35,14 @@ #define CONFIG_BOOLEAN_FALSE 0 #define CONFIG_BOOLEAN_TRUE 1 +struct t_weelist; + struct t_config_file { struct t_weechat_plugin *plugin; /* plugin which created this cfg */ - char *filename; /* config filename (without path)*/ + char *name; /* name (exemple: "weechat") */ + char *filename; /* filename (without path) */ + /* (example: "weechat.conf") */ FILE *file; /* file pointer */ int (*callback_reload) /* callback for reloading file */ (void *data, @@ -53,14 +57,16 @@ struct t_config_file struct t_config_section { char *name; /* section name */ - void (*callback_read) /* called when unknown option */ - (void *data, /* is read from config file */ - struct t_config_file *config_file, - char *option_name, char *value); + int (*callback_read) /* called to read a line from */ + (void *data, /* config file (only for some */ + struct t_config_file *config_file, /* special sections) */ + struct t_config_section *section, + char *option_name, + char *value); void *callback_read_data; /* data sent to read callback */ - void (*callback_write) /* called to write special */ - (void *data, /* options in config file */ - struct t_config_file *config_file, + void (*callback_write) /* called to write options */ + (void *data, /* in config file (only for some */ + struct t_config_file *config_file, /* special sections) */ char *section_name); void *callback_write_data; /* data sent to write callback */ void (*callback_write_default) /* called to write default */ @@ -68,6 +74,12 @@ struct t_config_section struct t_config_file *config_file, char *section_name); void *callback_write_default_data; /* data sent to write def. callb.*/ + int (*callback_create_option) /* called to create option in */ + (void *data, /* section */ + struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, char *value); + void *callback_create_option_data; /* data sent to create callback */ struct t_config_option *options; /* options in section */ struct t_config_option *last_option; /* last option in section */ struct t_config_section *prev_section; /* link to previous section */ @@ -76,14 +88,18 @@ struct t_config_section enum t_config_option_type { - CONFIG_OPTION_BOOLEAN = 0, - CONFIG_OPTION_INTEGER, - CONFIG_OPTION_STRING, - CONFIG_OPTION_COLOR, + CONFIG_OPTION_TYPE_BOOLEAN = 0, + CONFIG_OPTION_TYPE_INTEGER, + CONFIG_OPTION_TYPE_STRING, + CONFIG_OPTION_TYPE_COLOR, + /* number of option types */ + CONFIG_NUM_OPTION_TYPES, }; struct t_config_option { + struct t_config_file *config_file; /* configuration file */ + struct t_config_section *section; /* section */ char *name; /* name */ enum t_config_option_type type; /* type */ char *description; /* description */ @@ -91,8 +107,19 @@ struct t_config_option int min, max; /* min and max for value */ void *default_value; /* default value */ void *value; /* value */ - void (*callback_change)(void *data); /* called when value is changed */ + int (*callback_check_value) /* called to check value before */ + (void *data, /* assiging new value */ + struct t_config_option *option, + char *value); + void *callback_check_value_data; /* data sent to check callback */ + void (*callback_change) /* called when value is changed */ + (void *data, + struct t_config_option *option); void *callback_change_data; /* data sent to change callback */ + void (*callback_delete) /* called when option is deleted */ + (void *data, + struct t_config_option *option); + void *callback_delete_data; /* data sent to delete callback */ int loaded; /* 1 if opt was found in config */ struct t_config_option *prev_option; /* link to previous option */ struct t_config_option *next_option; /* link to next option */ @@ -101,9 +128,9 @@ struct t_config_option extern struct t_config_file *config_files; extern struct t_config_file *last_config_file; -extern struct t_config_file *config_file_search (char *filename); +extern struct t_config_file *config_file_search (char *name); extern struct t_config_file *config_file_new (struct t_weechat_plugin *plugin, - char *filename, + char *name, int (*callback_reload)(void *data, struct t_config_file *config_file), void *callback_data); @@ -111,10 +138,11 @@ extern int config_file_valid_for_plugin (struct t_weechat_plugin *plugin, struct t_config_file *config_file); extern struct t_config_section *config_file_new_section (struct t_config_file *config_file, char *name, - void (*callback_read)(void *data, - struct t_config_file *config_file, - char *option_name, - char *value), + int (*callback_read)(void *data, + struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, + char *value), void *callback_read_data, void (*callback_write)(void *data, struct t_config_file *config_file, @@ -123,7 +151,13 @@ extern struct t_config_section *config_file_new_section (struct t_config_file *c void (*callback_write_default)(void *data, struct t_config_file *config_file, char *section_name), - void *callback_write_default_data); + void *callback_write_default_data, + int (*callback_create_option)(void *data, + struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, + char *value), + void *callback_create_option_data); extern struct t_config_section *config_file_search_section (struct t_config_file *config_file, char *section_name); extern int config_file_section_valid_for_plugin (struct t_weechat_plugin *plugin, @@ -135,17 +169,40 @@ extern struct t_config_option *config_file_new_option (struct t_config_file *con char *string_values, int min, int max, char *default_value, - void (*callback_change)(void *data), - void *callback_change_data); + int (*callback_check_value)(void *data, + struct t_config_option *option, + char *value), + void *callback_check_value_data, + void (*callback_change)(void *data, + struct t_config_option *option), + void *callback_change_data, + void (*callback_delete)(void *data, + struct t_config_option *option), + void *callback_delete_data); extern struct t_config_option *config_file_search_option (struct t_config_file *config_file, struct t_config_section *section, char *option_name); +extern void config_file_search_section_option (struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, + struct t_config_section **section_found, + struct t_config_option **option_found); +extern void config_file_search_with_string (char *option_name, + struct t_config_file **config_file, + struct t_config_section **section, + struct t_config_option **option, + char **pos_option_name); extern int config_file_option_valid_for_plugin (struct t_weechat_plugin *plugin, struct t_config_option *option); extern int config_file_string_to_boolean (char *text); +extern int config_file_option_reset (struct t_config_option *option, + int run_callback); extern int config_file_option_set (struct t_config_option *option, - char *new_value, int run_callback); -extern int config_file_option_reset (struct t_config_option *option); + char *value, int run_callback); +extern void *config_file_option_get_pointer (struct t_config_option *option, + char *property); +extern int config_file_option_set_with_string (char *option_name, char *value); +extern int config_file_unset_with_string (char *option_name); extern int config_file_option_boolean (struct t_config_option *option); extern int config_file_option_integer (struct t_config_option *option); extern char *config_file_option_string (struct t_config_option *option); @@ -159,6 +216,7 @@ extern int config_file_reload (struct t_config_file *config_file); extern void config_file_option_free_data (struct t_config_option *option); extern void config_file_option_free (struct t_config_section *section, struct t_config_option *option); +extern void config_file_section_free_options (struct t_config_section *section); extern void config_file_section_free (struct t_config_file *config_file, struct t_config_section *section); extern void config_file_free (struct t_config_file *config_file); diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 5b67ccfb5..7d3e02897 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -59,17 +59,17 @@ struct t_config_file *weechat_config_file = NULL; /* config, startup section */ -struct t_config_option *config_startup_logo; -struct t_config_option *config_startup_version; +struct t_config_option *config_startup_display_logo; +struct t_config_option *config_startup_display_version; struct t_config_option *config_startup_command_before_plugins; struct t_config_option *config_startup_command_after_plugins; +struct t_config_option *config_startup_weechat_slogan; /* config, look & feel section */ struct t_config_option *config_look_color_real_white; struct t_config_option *config_look_save_on_exit; struct t_config_option *config_look_set_title; -struct t_config_option *config_look_weechat_slogan; struct t_config_option *config_look_scroll_amount; struct t_config_option *config_look_buffer_time_format; struct t_config_option *config_look_color_nicks_number; @@ -81,7 +81,7 @@ struct t_config_option *config_look_nicklist_separator; struct t_config_option *config_look_nickmode; struct t_config_option *config_look_nickmode_empty; struct t_config_option *config_look_no_nickname; -struct t_config_option *config_look_prefix[GUI_CHAT_PREFIX_NUMBER]; +struct t_config_option *config_look_prefix[GUI_CHAT_NUM_PREFIXES]; struct t_config_option *config_look_prefix_align; struct t_config_option *config_look_prefix_align_max; struct t_config_option *config_look_prefix_suffix; @@ -101,7 +101,6 @@ struct t_config_option *config_look_day_change_time_format; struct t_config_option *config_look_read_marker; struct t_config_option *config_look_input_format; struct t_config_option *config_look_paste_max_lines; -struct t_config_option *config_look_default_msg_quit; /* config, colors section */ @@ -113,7 +112,7 @@ struct t_config_option *config_color_chat; struct t_config_option *config_color_chat_bg; struct t_config_option *config_color_chat_time; struct t_config_option *config_color_chat_time_delimiters; -struct t_config_option *config_color_chat_prefix[GUI_CHAT_PREFIX_NUMBER]; +struct t_config_option *config_color_chat_prefix[GUI_CHAT_NUM_PREFIXES]; struct t_config_option *config_color_chat_prefix_more; struct t_config_option *config_color_chat_prefix_suffix; struct t_config_option *config_color_chat_buffer; @@ -188,12 +187,12 @@ struct t_config_option *config_proxy_port; struct t_config_option *config_proxy_username; struct t_config_option *config_proxy_password; -/* config, plugins section */ +/* config, plugin section */ -struct t_config_option *config_plugins_path; -struct t_config_option *config_plugins_autoload; -struct t_config_option *config_plugins_extension; -struct t_config_option *config_plugins_save_config_on_unload; +struct t_config_option *config_plugin_path; +struct t_config_option *config_plugin_autoload; +struct t_config_option *config_plugin_extension; +struct t_config_option *config_plugin_save_config_on_unload; /* hooks */ @@ -445,11 +444,13 @@ config_weechat_reload (void *data, struct t_config_file *config_file) } /* - * config_weechat_read_bar: read a bar in configuration file + * config_weechat_bar_read: read bar option in config file + * return: 1 if ok, 0 if error */ -void -config_weechat_read_bar (void *data, struct t_config_file *config_file, +int +config_weechat_bar_read (void *data, struct t_config_file *config_file, + struct t_config_section *section, char *option_name, char *value) { char **argv, *error; @@ -459,6 +460,7 @@ config_weechat_read_bar (void *data, struct t_config_file *config_file, /* make C compiler happy */ (void) data; (void) config_file; + (void) section; if (option_name) { @@ -483,17 +485,19 @@ config_weechat_read_bar (void *data, struct t_config_file *config_file, } } } + + return 1; } /* - * config_weechat_write_bars: write bars section in configuration file - * Return: 0 = successful - * -1 = write error + * config_weechat_bar_write: write bar section in configuration file + * Return: 0 = successful + * -1 = write error */ void -config_weechat_write_bars (void *data, struct t_config_file *config_file, - char *section_name) +config_weechat_bar_write (void *data, struct t_config_file *config_file, + char *section_name) { struct t_gui_bar *ptr_bar; @@ -516,11 +520,14 @@ config_weechat_write_bars (void *data, struct t_config_file *config_file, } /* - * config_weechat_read_filter: read a filter in configuration file + * config_weechat_filter_read: read filter option from config file + * return 1 if ok, 0 if error */ -void -config_weechat_read_filter (void *data, struct t_config_file *config_file, +int +config_weechat_filter_read (void *data, + struct t_config_file *config_file, + struct t_config_section *section, char *option_name, char *value) { char **argv, **argv_eol; @@ -529,6 +536,7 @@ config_weechat_read_filter (void *data, struct t_config_file *config_file, /* make C compiler happy */ (void) data; (void) config_file; + (void) section; if (option_name) { @@ -546,17 +554,19 @@ config_weechat_read_filter (void *data, struct t_config_file *config_file, string_free_exploded (argv_eol); } } + + return 1; } /* - * config_weechat_write_filters: write filters section in configuration file - * Return: 0 = successful - * -1 = write error + * config_weechat_filter_write: write filter section in configuration file + * Return: 0 = successful + * -1 = write error */ void -config_weechat_write_filters (void *data, struct t_config_file *config_file, - char *section_name) +config_weechat_filter_write (void *data, struct t_config_file *config_file, + char *section_name) { struct t_gui_filter *ptr_filter; @@ -578,16 +588,19 @@ config_weechat_write_filters (void *data, struct t_config_file *config_file, } /* - * config_weechat_read_key: read a key in configuration file + * config_weechat_key_read: read key option in config file + * return 1 if ok, 0 if error */ -void -config_weechat_read_key (void *data, struct t_config_file *config_file, +int +config_weechat_key_read (void *data, struct t_config_file *config_file, + struct t_config_section *section, char *option_name, char *value) { /* make C compiler happy */ (void) data; (void) config_file; + (void) section; if (option_name) { @@ -602,17 +615,19 @@ config_weechat_read_key (void *data, struct t_config_file *config_file, gui_keyboard_unbind (option_name); } } + + return 1; } /* - * config_weechat_write_keys: write keys section in configuration file - * Return: 0 = successful - * -1 = write error + * config_weechat_key_write: write key section in configuration file + * Return: 0 = successful + * -1 = write error */ void -config_weechat_write_keys (void *data, struct t_config_file *config_file, - char *section_name) +config_weechat_key_write (void *data, struct t_config_file *config_file, + char *section_name) { struct t_gui_key *ptr_key; char *expanded_name, *function_name; @@ -662,44 +677,51 @@ config_weechat_init () { struct t_config_section *ptr_section; - weechat_config_file = config_file_new (NULL, WEECHAT_CONFIG_FILENAME, + weechat_config_file = config_file_new (NULL, WEECHAT_CONFIG_NAME, &config_weechat_reload, NULL); if (!weechat_config_file) return 0; /* startup */ ptr_section = config_file_new_section (weechat_config_file, "startup", - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); return 0; } - config_startup_logo = config_file_new_option ( + config_startup_display_logo = config_file_new_option ( weechat_config_file, ptr_section, - "startup_logo", "boolean", + "display_logo", "boolean", N_("display WeeChat logo at startup"), - NULL, 0, 0, "on", NULL, NULL); - config_startup_version = config_file_new_option ( + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + config_startup_display_version = config_file_new_option ( weechat_config_file, ptr_section, - "startup_version", "boolean", + "display_version", "boolean", N_("display WeeChat version at startup"), - NULL, 0, 0, "on", NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); config_startup_command_before_plugins = config_file_new_option ( weechat_config_file, ptr_section, - "startup_command_before_plugins", "string", + "command_before_plugins", "string", N_("command executed when WeeChat starts, before loading plugins"), - NULL, 0, 0, "", NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); config_startup_command_after_plugins = config_file_new_option ( weechat_config_file, ptr_section, - "startup_command_after_plugins", "string", + "command_after_plugins", "string", N_("command executed when WeeChat starts, after loading plugins"), - NULL, 0, 0, "", NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); + config_startup_weechat_slogan = config_file_new_option ( + weechat_config_file, ptr_section, + "weechat_slogan", "string", + N_("WeeChat slogan (if empty, slogan is not used)"), + NULL, 0, 0, "the geekest IRC client!", NULL, NULL, NULL, NULL, NULL, NULL); /* look */ ptr_section = config_file_new_section (weechat_config_file, "look", - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -708,231 +730,216 @@ config_weechat_init () config_look_color_real_white = config_file_new_option ( weechat_config_file, ptr_section, - "look_color_real_white", "boolean", + "color_real_white", "boolean", N_("if set, uses real white color, disabled by default " "for terms with white background (if you never use " "white background, you should turn on this option to " "see real white instead of default term foreground " "color)"), - NULL, 0, 0, "off", &config_change_color, NULL); + NULL, 0, 0, "off", NULL, NULL, &config_change_color, NULL, NULL, NULL); config_look_save_on_exit = config_file_new_option ( weechat_config_file, ptr_section, - "look_save_on_exit", "boolean", + "save_on_exit", "boolean", N_("save configuration file on exit"), - NULL, 0, 0, "on", &config_change_save_on_exit, NULL); + NULL, 0, 0, "on", NULL, NULL, &config_change_save_on_exit, NULL, NULL, NULL); config_look_set_title = config_file_new_option ( weechat_config_file, ptr_section, - "look_set_title", "boolean", + "set_title", "boolean", N_("set title for window (terminal for Curses GUI) with " "name and version"), - NULL, 0, 0, "on", &config_change_title, NULL); - config_look_weechat_slogan = config_file_new_option ( - weechat_config_file, ptr_section, - "look_weechat_slogan", "string", - N_("WeeChat slogan (if empty, slogan is not used)"), - NULL, 0, 0, "the geekest IRC client!", NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, &config_change_title, NULL, NULL, NULL); config_look_scroll_amount = config_file_new_option ( weechat_config_file, ptr_section, - "look_scroll_amount", "integer", + "scroll_amount", "integer", N_("how many lines to scroll by with scroll_up and " "scroll_down"), - NULL, 1, INT_MAX, "3", &config_change_buffer_content, NULL); + NULL, 1, INT_MAX, "3", NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); config_look_buffer_time_format = config_file_new_option ( weechat_config_file, ptr_section, - "look_buffer_time_format", "string", + "buffer_time_format", "string", N_("time format for buffers"), - NULL, 0, 0, "[%H:%M:%S]", &config_change_buffer_time_format, NULL); + NULL, 0, 0, "[%H:%M:%S]", NULL, NULL, &config_change_buffer_time_format, NULL, NULL, NULL); config_look_color_nicks_number = config_file_new_option ( weechat_config_file, ptr_section, - "look_color_nicks_number", "integer", + "color_nicks_number", "integer", N_("number of colors to use for nicks colors"), - NULL, 1, 10, "10", &config_change_nicks_colors, NULL); + NULL, 1, 10, "10", NULL, NULL, &config_change_nicks_colors, NULL, NULL, NULL); config_look_nicklist = config_file_new_option ( weechat_config_file, ptr_section, - "look_nicklist", "boolean", + "nicklist", "boolean", N_("display nicklist (on buffers with nicklist enabled)"), - NULL, 0, 0, "on", &config_change_buffers, NULL); + NULL, 0, 0, "on", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_nicklist_position = config_file_new_option ( weechat_config_file, ptr_section, - "look_nicklist_position", "integer", + "nicklist_position", "integer", N_("nicklist position (top, left, right (default), " "bottom)"), - "left|right|top|bottom", 0, 0, "right", &config_change_buffers, NULL); + "left|right|top|bottom", 0, 0, "right", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_nicklist_min_size = config_file_new_option ( weechat_config_file, ptr_section, - "look_nicklist_min_size", "integer", + "nicklist_min_size", "integer", N_("min size for nicklist (width or height, depending on " "look_nicklist_position (0 = no min size))"), - NULL, 0, 100, "0", &config_change_buffers, NULL); + NULL, 0, 100, "0", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_nicklist_max_size = config_file_new_option ( weechat_config_file, ptr_section, - "look_nicklist_max_size", "integer", + "nicklist_max_size", "integer", N_("max size for nicklist (width or height, depending on " "look_nicklist_position (0 = no max size; if min = max " "and > 0, then size is fixed))"), - NULL, 0, 100, "0", &config_change_buffers, NULL); + NULL, 0, 100, "0", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_nicklist_separator = config_file_new_option ( weechat_config_file, ptr_section, - "look_nicklist_separator", "boolean", + "nicklist_separator", "boolean", N_("separator between chat and nicklist"), - NULL, 0, 0, "on", &config_change_buffers, NULL); + NULL, 0, 0, "on", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_nickmode = config_file_new_option ( weechat_config_file, ptr_section, - "look_nickmode", "boolean", + "nickmode", "boolean", N_("display nick mode ((half)op/voice) before each nick"), - NULL, 0, 0, "on", &config_change_buffers, NULL); + NULL, 0, 0, "on", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_nickmode_empty = config_file_new_option ( weechat_config_file, ptr_section, - "look_nickmode_empty", "boolean", + "nickmode_empty", "boolean", N_("display space if nick mode is not (half)op/voice"), - NULL, 0, 0, "off", &config_change_buffers, NULL); - config_look_prefix[GUI_CHAT_PREFIX_INFO] = config_file_new_option ( - weechat_config_file, ptr_section, - "look_prefix_info", "string", - N_("prefix for info messages"), - NULL, 0, 0, "-=-", &config_change_prefix, NULL); + NULL, 0, 0, "off", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_prefix[GUI_CHAT_PREFIX_ERROR] = config_file_new_option ( weechat_config_file, ptr_section, - "look_prefix_error", "string", + "prefix_error", "string", N_("prefix for error messages"), - NULL, 0, 0, "=!=", &config_change_prefix, NULL); + NULL, 0, 0, "=!=", NULL, NULL, &config_change_prefix, NULL, NULL, NULL); config_look_prefix[GUI_CHAT_PREFIX_NETWORK] = config_file_new_option ( weechat_config_file, ptr_section, - "look_prefix_network", "string", + "prefix_network", "string", N_("prefix for network messages"), - NULL, 0, 0, "--", &config_change_prefix, NULL); + NULL, 0, 0, "--", NULL, NULL, &config_change_prefix, NULL, NULL, NULL); config_look_prefix[GUI_CHAT_PREFIX_ACTION] = config_file_new_option ( weechat_config_file, ptr_section, - "look_prefix_action", "string", + "prefix_action", "string", N_("prefix for action messages"), - NULL, 0, 0, "*", &config_change_prefix, NULL); + NULL, 0, 0, "*", NULL, NULL, &config_change_prefix, NULL, NULL, NULL); config_look_prefix[GUI_CHAT_PREFIX_JOIN] = config_file_new_option ( weechat_config_file, ptr_section, - "look_prefix_join", "string", + "prefix_join", "string", N_("prefix for join messages"), - NULL, 0, 0, "-->", &config_change_prefix, NULL); + NULL, 0, 0, "-->", NULL, NULL, &config_change_prefix, NULL, NULL, NULL); config_look_prefix[GUI_CHAT_PREFIX_QUIT] = config_file_new_option ( weechat_config_file, ptr_section, - "look_prefix_quit", "string", + "prefix_quit", "string", N_("prefix for quit messages"), - NULL, 0, 0, "<--", &config_change_prefix, NULL); + NULL, 0, 0, "<--", NULL, NULL, &config_change_prefix, NULL, NULL, NULL); config_look_prefix_align = config_file_new_option ( weechat_config_file, ptr_section, - "look_prefix_align", "integer", + "prefix_align", "integer", N_("prefix alignment (none, left, right (default))"), - "none|left|right", 0, 0, "right", &config_change_buffers, NULL); + "none|left|right", 0, 0, "right", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_prefix_align_max = config_file_new_option ( weechat_config_file, ptr_section, - "look_prefix_align_max", "integer", + "prefix_align_max", "integer", N_("max size for prefix (0 = no max size)"), - NULL, 0, 64, "0", &config_change_buffers, NULL); + NULL, 0, 64, "0", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_prefix_suffix = config_file_new_option ( weechat_config_file, ptr_section, - "look_prefix_suffix", "string", + "prefix_suffix", "string", N_("string displayed after prefix"), - NULL, 0, 0, "|", &config_change_buffers, NULL); + NULL, 0, 0, "|", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_nick_completor = config_file_new_option ( weechat_config_file, ptr_section, - "look_nick_completor", "string", + "nick_completor", "string", N_("string inserted after nick completion"), - NULL, 0, 0, ":", NULL, NULL); + NULL, 0, 0, ":", NULL, NULL, NULL, NULL, NULL, NULL); config_look_nick_completion_ignore = config_file_new_option ( weechat_config_file, ptr_section, - "look_nick_completion_ignore", "string", + "nick_completion_ignore", "string", N_("chars ignored for nick completion"), - NULL, 0, 0, "[]-^", NULL, NULL); + NULL, 0, 0, "[]-^", NULL, NULL, NULL, NULL, NULL, NULL); config_look_nick_complete_first = config_file_new_option ( weechat_config_file, ptr_section, - "look_nick_complete_first", "boolean", + "nick_complete_first", "boolean", N_("complete only with first nick found"), - NULL, 0, 0, "off", NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); config_look_infobar = config_file_new_option ( weechat_config_file, ptr_section, - "look_infobar", "boolean", + "infobar", "boolean", N_("enable info bar"), - NULL, 0, 0, "on", &config_change_buffers, NULL); + NULL, 0, 0, "on", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_infobar_time_format = config_file_new_option ( weechat_config_file, ptr_section, - "look_infobar_time_format", "string", + "infobar_time_format", "string", N_("time format for time in infobar"), - NULL, 0, 0, "%B, %A %d %Y", &config_change_buffer_content, NULL); + NULL, 0, 0, "%B, %A %d %Y", NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); config_look_infobar_seconds = config_file_new_option ( weechat_config_file, ptr_section, - "look_infobar_seconds", "boolean", + "infobar_seconds", "boolean", N_("display seconds in infobar time"), - NULL, 0, 0, "on", &config_change_infobar_seconds, NULL); + NULL, 0, 0, "on", NULL, NULL, &config_change_infobar_seconds, NULL, NULL, NULL); config_look_infobar_delay_highlight = config_file_new_option ( weechat_config_file, ptr_section, - "look_infobar_delay_highlight", "integer", + "infobar_delay_highlight", "integer", N_("delay (in seconds) for highlight messages in " "infobar (0 = disable highlight notifications in " "infobar)"), - NULL, 0, INT_MAX, "7", NULL, NULL); + NULL, 0, INT_MAX, "7", NULL, NULL, NULL, NULL, NULL, NULL); config_look_hotlist_names_count = config_file_new_option ( weechat_config_file, ptr_section, - "look_hotlist_names_count", "integer", + "hotlist_names_count", "integer", N_("max number of names in hotlist (0 = no name " "displayed, only buffer numbers)"), - NULL, 0, 32, "3", &config_change_buffer_content, NULL); + NULL, 0, 32, "3", NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); config_look_hotlist_names_level = config_file_new_option ( weechat_config_file, ptr_section, - "look_hotlist_names_level", "integer", + "hotlist_names_level", "integer", N_("level for displaying names in hotlist (combination " "of: 1=join/part, 2=message, 4=private, 8=highlight, " "for example: 12=private+highlight)"), - NULL, 1, 15, "12", &config_change_buffer_content, NULL); + NULL, 1, 15, "12", NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); config_look_hotlist_names_length = config_file_new_option ( weechat_config_file, ptr_section, - "look_hotlist_names_length", "integer", + "hotlist_names_length", "integer", N_("max length of names in hotlist (0 = no limit)"), - NULL, 0, 32, "0", &config_change_buffer_content, NULL); + NULL, 0, 32, "0", NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); config_look_hotlist_sort = config_file_new_option ( weechat_config_file, ptr_section, - "look_hotlist_sort", "integer", + "hotlist_sort", "integer", N_("hotlist sort type (group_time_asc (default), " "group_time_desc, group_number_asc, group_number_desc, " "number_asc, number_desc)"), "group_time_asc|group_time_desc|group_number_asc|" "group_number_desc|number_asc|number_desc", - 0, 0, "group_time_asc", &config_change_hotlist, NULL); + 0, 0, "group_time_asc", NULL, NULL, &config_change_hotlist, NULL, NULL, NULL); config_look_day_change = config_file_new_option ( weechat_config_file, ptr_section, - "look_day_change", "boolean", + "day_change", "boolean", N_("display special message when day changes"), - NULL, 0, 0, "on", &config_change_day_change, NULL); + NULL, 0, 0, "on", NULL, NULL, &config_change_day_change, NULL, NULL, NULL); config_look_day_change_time_format = config_file_new_option ( weechat_config_file, ptr_section, - "look_day_change_time_format", "string", + "day_change_time_format", "string", N_("time format for date displayed when day changed"), - NULL, 0, 0, "%a, %d %b %Y", NULL, NULL); + NULL, 0, 0, "%a, %d %b %Y", NULL, NULL, NULL, NULL, NULL, NULL); config_look_read_marker = config_file_new_option ( weechat_config_file, ptr_section, - "look_read_marker", "string", + "read_marker", "string", N_("use a marker on servers/channels to show first unread " "line"), - NULL, 0, 1, " ", &config_change_read_marker, NULL); + NULL, 0, 1, " ", NULL, NULL, &config_change_read_marker, NULL, NULL, NULL); config_look_input_format = config_file_new_option ( weechat_config_file, ptr_section, - "look_input_format", "string", + "input_format", "string", N_("format for input prompt ('%c' is replaced by channel " "or server, '%n' by nick and '%m' by nick modes)"), - NULL, 0, 0, "[%n(%m)] ", &config_change_buffer_content, NULL); + NULL, 0, 0, "[%n(%m)] ", NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); config_look_paste_max_lines = config_file_new_option ( weechat_config_file, ptr_section, - "look_paste_max_lines", "integer", + "paste_max_lines", "integer", N_("max number of lines for paste without asking user " "(0 = disable this feature)"), - NULL, 0, INT_MAX, "3", NULL, NULL); - config_look_default_msg_quit = config_file_new_option ( - weechat_config_file, ptr_section, - "look_default_msg_quit", "string", - N_("default quit message ('%v' will be replaced by WeeChat version in " - "string)"), - NULL, 0, 0, "WeeChat %v", NULL, NULL); + NULL, 0, INT_MAX, "3", NULL, NULL, NULL, NULL, NULL, NULL); /* colors */ - ptr_section = config_file_new_section (weechat_config_file, "colors", - NULL, NULL, NULL, NULL, NULL, NULL); + ptr_section = config_file_new_section (weechat_config_file, "color", + NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -941,411 +948,484 @@ config_weechat_init () /* general color settings */ config_color_separator = config_file_new_option ( - weechat_config_file, ptr_section, "color_separator", "color", + weechat_config_file, ptr_section, + "separator", "color", N_("background color for window separators (when splited)"), - NULL, GUI_COLOR_SEPARATOR, 0, "blue", &config_change_color, NULL); + NULL, GUI_COLOR_SEPARATOR, 0, "blue", + NULL, NULL, &config_change_color, NULL, NULL, NULL); /* title window */ config_color_title = config_file_new_option ( weechat_config_file, ptr_section, - "color_title", "color", + "title", "color", N_("text color for title bar"), - NULL, GUI_COLOR_TITLE, 0, "default", &config_change_color, NULL); + NULL, GUI_COLOR_TITLE, 0, "default", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_title_bg = config_file_new_option ( weechat_config_file, ptr_section, - "color_title_bg", "color", + "title_bg", "color", N_("background color for title bar"), - NULL, -1, 0, "blue", &config_change_color, NULL); + NULL, -1, 0, "blue", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_title_more = config_file_new_option ( weechat_config_file, ptr_section, - "color_title_more", "color", + "title_more", "color", N_("text color for '+' when scrolling title"), - NULL, GUI_COLOR_TITLE_MORE, 0, "lightmagenta", &config_change_color, NULL); + NULL, GUI_COLOR_TITLE_MORE, 0, "lightmagenta", + NULL, NULL, &config_change_color, NULL, NULL, NULL); /* chat window */ config_color_chat = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat", "color", + "chat", "color", N_("text color for chat"), - NULL, GUI_COLOR_CHAT, 0, "default", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT, 0, "default", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_bg = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_bg", "color", + "chat_bg", "color", N_("background color for chat"), - NULL, -1, 0, "default", &config_change_color, NULL); + NULL, -1, 0, "default", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_time = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_time", "color", + "chat_time", "color", N_("text color for time in chat window"), - NULL, GUI_COLOR_CHAT_TIME, 0, "default", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_TIME, 0, "default", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_time_delimiters = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_time_delimiters", "color", + "chat_time_delimiters", "color", N_("text color for time delimiters"), - NULL, GUI_COLOR_CHAT_TIME_DELIMITERS, 0, "brown", &config_change_color, NULL); - config_color_chat_prefix[GUI_CHAT_PREFIX_INFO] = config_file_new_option ( - weechat_config_file, ptr_section, - "color_chat_prefix_info", "color", - N_("text color for info prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_INFO, 0, "lightcyan", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_TIME_DELIMITERS, 0, "brown", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_ERROR] = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_prefix_error", "color", + "chat_prefix_error", "color", N_("text color for error prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_ERROR, 0, "yellow", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_PREFIX_ERROR, 0, "yellow", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_NETWORK] = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_prefix_network", "color", + "chat_prefix_network", "color", N_("text color for network prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_NETWORK, 0, "magenta", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_PREFIX_NETWORK, 0, "magenta", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_ACTION] = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_prefix_action", "color", + "chat_prefix_action", "color", N_("text color for action prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_ACTION, 0, "white", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_PREFIX_ACTION, 0, "white", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_JOIN] = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_prefix_join", "color", + "chat_prefix_join", "color", N_("text color for join prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_JOIN, 0, "lightgreen", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_PREFIX_JOIN, 0, "lightgreen", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_QUIT] = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_prefix_quit", "color", + "chat_prefix_quit", "color", N_("text color for quit prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_QUIT, 0, "lightred", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_PREFIX_QUIT, 0, "lightred", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_prefix_more = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_prefix_more", "color", + "chat_prefix_more", "color", N_("text color for '+' when prefix is too long"), - NULL, GUI_COLOR_CHAT_PREFIX_MORE, 0, "lightmagenta", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_PREFIX_MORE, 0, "lightmagenta", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_prefix_suffix = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_prefix_suffix", "color", + "chat_prefix_suffix", "color", N_("text color for suffix (after prefix)"), - NULL, GUI_COLOR_CHAT_PREFIX_SUFFIX, 0, "green", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_PREFIX_SUFFIX, 0, "green", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_buffer = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_buffer", "color", + "chat_buffer", "color", N_("text color for buffer names"), - NULL, GUI_COLOR_CHAT_BUFFER, 0, "white", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_BUFFER, 0, "white", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_server = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_server", "color", + "chat_server", "color", N_("text color for server names"), - NULL, GUI_COLOR_CHAT_SERVER, 0, "brown", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_SERVER, 0, "brown", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_channel = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_channel", "color", + "chat_channel", "color", N_("text color for channel names"), - NULL, GUI_COLOR_CHAT_CHANNEL, 0, "white", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_CHANNEL, 0, "white", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_nick", "color", + "chat_nick", "color", N_("text color for nicks in chat window"), - NULL, GUI_COLOR_CHAT_NICK, 0, "lightcyan", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_NICK, 0, "lightcyan", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_self = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_nick_self", "color", + "chat_nick_self", "color", N_("text color for local nick in chat window"), - NULL, GUI_COLOR_CHAT_NICK_SELF, 0, "white", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_NICK_SELF, 0, "white", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_other = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_nick_other", "color", + "chat_nick_other", "color", N_("text color for other nick in private buffer"), - NULL, GUI_COLOR_CHAT_NICK_OTHER, 0, "default", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_NICK_OTHER, 0, "default", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[0] = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_nick_color1", "color", + "chat_nick_color1", "color", N_("text color #1 for nick"), - NULL, GUI_COLOR_CHAT_NICK1, 0, "cyan", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_NICK1, 0, "cyan", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[1] = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_nick_color2", "color", + "chat_nick_color2", "color", N_("text color #2 for nick"), - NULL, GUI_COLOR_CHAT_NICK2, 0, "magenta", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_NICK2, 0, "magenta", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[2] = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_nick_color3", "color", + "chat_nick_color3", "color", N_("text color #3 for nick"), - NULL, GUI_COLOR_CHAT_NICK3, 0, "green", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_NICK3, 0, "green", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[3] = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_nick_color4", "color", + "chat_nick_color4", "color", N_("text color #4 for nick"), - NULL, GUI_COLOR_CHAT_NICK4, 0, "brown", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_NICK4, 0, "brown", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[4] = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_nick_color5", "color", + "chat_nick_color5", "color", N_("text color #5 for nick"), - NULL, GUI_COLOR_CHAT_NICK5, 0, "lightblue", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_NICK5, 0, "lightblue", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[5] = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_nick_color6", "color", + "chat_nick_color6", "color", N_("text color #6 for nick"), - NULL, GUI_COLOR_CHAT_NICK6, 0, "default", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_NICK6, 0, "default", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[6] = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_nick_color7", "color", + "chat_nick_color7", "color", N_("text color #7 for nick"), - NULL, GUI_COLOR_CHAT_NICK7, 0, "lightcyan", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_NICK7, 0, "lightcyan", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[7] = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_nick_color8", "color", + "chat_nick_color8", "color", N_("text color #8 for nick"), - NULL, GUI_COLOR_CHAT_NICK8, 0, "lightmagenta", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_NICK8, 0, "lightmagenta", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[8] = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_nick_color9", "color", + "chat_nick_color9", "color", N_("text color #9 for nick"), - NULL, GUI_COLOR_CHAT_NICK9, 0, "lightgreen", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_NICK9, 0, "lightgreen", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[9] = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_nick_color10", "color", + "chat_nick_color10", "color", N_("text color #10 for nick"), - NULL, GUI_COLOR_CHAT_NICK10, 0, "blue", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_NICK10, 0, "blue", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_host = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_host", "color", + "chat_host", "color", N_("text color for hostnames"), - NULL, GUI_COLOR_CHAT_HOST, 0, "cyan", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_HOST, 0, "cyan", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_delimiters = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_delimiters", "color", + "chat_delimiters", "color", N_("text color for delimiters"), - NULL, GUI_COLOR_CHAT_DELIMITERS, 0, "green", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_DELIMITERS, 0, "green", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_highlight = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_highlight", "color", + "chat_highlight", "color", N_("text color for highlighted nick"), - NULL, GUI_COLOR_CHAT_HIGHLIGHT, 0, "yellow", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_HIGHLIGHT, 0, "yellow", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_read_marker = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_read_marker", "color", + "chat_read_marker", "color", N_("text color for unread data marker"), - NULL, GUI_COLOR_CHAT_READ_MARKER, 0, "yellow", &config_change_color, NULL); + NULL, GUI_COLOR_CHAT_READ_MARKER, 0, "yellow", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_read_marker_bg = config_file_new_option ( weechat_config_file, ptr_section, - "color_chat_read_marker_bg", "color", + "chat_read_marker_bg", "color", N_("background color for unread data marker"), - NULL, -1, 0, "magenta", &config_change_color, NULL); + NULL, -1, 0, "magenta", NULL, NULL, &config_change_color, NULL, NULL, NULL); /* status window */ config_color_status = config_file_new_option ( weechat_config_file, ptr_section, - "color_status", "color", + "status", "color", N_("text color for status bar"), - NULL, GUI_COLOR_STATUS, 0, "default", &config_change_color, NULL); + NULL, GUI_COLOR_STATUS, 0, "default", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_bg = config_file_new_option ( weechat_config_file, ptr_section, - "color_status_bg", "color", + "status_bg", "color", N_("background color for status bar"), - NULL, -1, 0, "blue", &config_change_color, NULL); + NULL, -1, 0, "blue", NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_delimiters = config_file_new_option ( weechat_config_file, ptr_section, - "color_status_delimiters", "color", + "status_delimiters", "color", N_("text color for status bar delimiters"), - NULL, GUI_COLOR_STATUS_DELIMITERS, 0, "cyan", &config_change_color, NULL); + NULL, GUI_COLOR_STATUS_DELIMITERS, 0, "cyan", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_number = config_file_new_option ( weechat_config_file, ptr_section, - "color_status_number", "color", + "status_number", "color", N_("text color for current buffer number in status bar"), - NULL, GUI_COLOR_STATUS_NUMBER, 0, "yellow", &config_change_color, NULL); + NULL, GUI_COLOR_STATUS_NUMBER, 0, "yellow", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_category = config_file_new_option ( weechat_config_file, ptr_section, - "color_status_category", "color", + "status_category", "color", N_("text color for current buffer category in status bar"), - NULL, GUI_COLOR_STATUS_CATEGORY, 0, "lightgreen", &config_change_color, NULL); + NULL, GUI_COLOR_STATUS_CATEGORY, 0, "lightgreen", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_name = config_file_new_option ( weechat_config_file, ptr_section, - "color_status_name", "color", + "status_name", "color", N_("text color for current buffer name in status bar"), - NULL, GUI_COLOR_STATUS_NAME, 0, "white", &config_change_color, NULL); + NULL, GUI_COLOR_STATUS_NAME, 0, "white", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_data_msg = config_file_new_option ( weechat_config_file, ptr_section, - "color_status_data_msg", "color", + "status_data_msg", "color", N_("text color for buffer with new messages (status bar)"), - NULL, GUI_COLOR_STATUS_DATA_MSG, 0, "yellow", &config_change_color, NULL); + NULL, GUI_COLOR_STATUS_DATA_MSG, 0, "yellow", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_data_private = config_file_new_option ( weechat_config_file, ptr_section, - "color_status_data_private", "color", + "status_data_private", "color", N_("text color for buffer with private message (status bar)"), - NULL, GUI_COLOR_STATUS_DATA_PRIVATE, 0, "lightgreen", &config_change_color, NULL); + NULL, GUI_COLOR_STATUS_DATA_PRIVATE, 0, "lightgreen", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_data_highlight = config_file_new_option ( weechat_config_file, ptr_section, - "color_status_data_highlight", "color", + "status_data_highlight", "color", N_("text color for buffer with highlight (status bar)"), - NULL, GUI_COLOR_STATUS_DATA_HIGHLIGHT, 0, "lightmagenta", &config_change_color, NULL); + NULL, GUI_COLOR_STATUS_DATA_HIGHLIGHT, 0, "lightmagenta", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_data_other = config_file_new_option ( weechat_config_file, ptr_section, - "color_status_data_other", "color", + "status_data_other", "color", N_("text color for buffer with new data (not messages) " "(status bar)"), - NULL, GUI_COLOR_STATUS_DATA_OTHER, 0, "default", &config_change_color, NULL); + NULL, GUI_COLOR_STATUS_DATA_OTHER, 0, "default", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_more = config_file_new_option ( weechat_config_file, ptr_section, - "color_status_more", "color", + "status_more", "color", N_("text color for buffer with new data (status bar)"), - NULL, GUI_COLOR_STATUS_MORE, 0, "yellow", &config_change_color, NULL); + NULL, GUI_COLOR_STATUS_MORE, 0, "yellow", + NULL, NULL, &config_change_color, NULL, NULL, NULL); /* infobar window */ config_color_infobar = config_file_new_option ( weechat_config_file, ptr_section, - "color_infobar", "color", + "infobar", "color", N_("text color for infobar"), - NULL, GUI_COLOR_INFOBAR, 0, "black", &config_change_color, NULL); + NULL, GUI_COLOR_INFOBAR, 0, "black", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_infobar_bg = config_file_new_option ( weechat_config_file, ptr_section, - "color_infobar_bg", "color", + "infobar_bg", "color", N_("background color for infobar"), - NULL, -1, 0, "cyan", &config_change_color, NULL); + NULL, -1, 0, "cyan", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_infobar_delimiters = config_file_new_option ( weechat_config_file, ptr_section, - "color_infobar_delimiters", "color", + "infobar_delimiters", "color", N_("text color for infobar delimiters"), - NULL, GUI_COLOR_INFOBAR_DELIMITERS, 0, "blue", &config_change_color, NULL); + NULL, GUI_COLOR_INFOBAR_DELIMITERS, 0, "blue", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_infobar_highlight = config_file_new_option ( weechat_config_file, ptr_section, - "color_infobar_highlight", "color", + "infobar_highlight", "color", N_("text color for infobar highlight notification"), - NULL, GUI_COLOR_INFOBAR_HIGHLIGHT, 0, "white", &config_change_color, NULL); + NULL, GUI_COLOR_INFOBAR_HIGHLIGHT, 0, "white", + NULL, NULL, &config_change_color, NULL, NULL, NULL); /* input window */ config_color_input = config_file_new_option ( weechat_config_file, ptr_section, - "color_input", "color", + "input", "color", N_("text color for input line"), - NULL, GUI_COLOR_INPUT, 0, "default", &config_change_color, NULL); + NULL, GUI_COLOR_INPUT, 0, "default", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_input_bg = config_file_new_option ( weechat_config_file, ptr_section, - "color_input_bg", "color", + "input_bg", "color", N_("background color for input line"), - NULL, -1, 0, "default", &config_change_color, NULL); + NULL, -1, 0, "default", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_input_server = config_file_new_option ( weechat_config_file, ptr_section, - "color_input_server", "color", + "input_server", "color", N_("text color for server name in input line"), - NULL, GUI_COLOR_INPUT_SERVER, 0, "brown", &config_change_color, NULL); + NULL, GUI_COLOR_INPUT_SERVER, 0, "brown", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_input_channel = config_file_new_option ( weechat_config_file, ptr_section, - "color_input_channel", "color", + "input_channel", "color", N_("text color for channel name in input line"), - NULL, GUI_COLOR_INPUT_CHANNEL, 0, "white", &config_change_color, NULL); + NULL, GUI_COLOR_INPUT_CHANNEL, 0, "white", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_input_nick = config_file_new_option ( weechat_config_file, ptr_section, - "color_input_nick", "color", + "input_nick", "color", N_("text color for nick name in input line"), - NULL, GUI_COLOR_INPUT_NICK, 0, "lightcyan", &config_change_color, NULL); + NULL, GUI_COLOR_INPUT_NICK, 0, "lightcyan", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_input_delimiters = config_file_new_option ( weechat_config_file, ptr_section, - "color_input_delimiters", "color", + "input_delimiters", "color", N_("text color for delimiters in input line"), - NULL, GUI_COLOR_INPUT_DELIMITERS, 0, "cyan", &config_change_color, NULL); + NULL, GUI_COLOR_INPUT_DELIMITERS, 0, "cyan", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_input_text_not_found = config_file_new_option ( weechat_config_file, ptr_section, - "color_input_text_not_found", "color", + "input_text_not_found", "color", N_("text color for unsucessful text search in input line"), - NULL, GUI_COLOR_INPUT_TEXT_NOT_FOUND, 0, "red", &config_change_color, NULL); + NULL, GUI_COLOR_INPUT_TEXT_NOT_FOUND, 0, "red", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_input_actions = config_file_new_option ( weechat_config_file, ptr_section, - "color_input_actions", "color", + "input_actions", "color", N_("text color for actions in input line"), - NULL, GUI_COLOR_INPUT_ACTIONS, 0, "lightgreen", &config_change_color, NULL); + NULL, GUI_COLOR_INPUT_ACTIONS, 0, "lightgreen", + NULL, NULL, &config_change_color, NULL, NULL, NULL); /* nicklist window */ config_color_nicklist = config_file_new_option ( weechat_config_file, ptr_section, - "color_nicklist", "color", + "nicklist", "color", N_("text color for nicklist"), - NULL, GUI_COLOR_NICKLIST, 0, "default", &config_change_color, NULL); + NULL, GUI_COLOR_NICKLIST, 0, "default", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_bg = config_file_new_option ( weechat_config_file, ptr_section, - "color_nicklist_bg", "color", + "nicklist_bg", "color", N_("background color for nicklist"), - NULL, -1, 0, "default", &config_change_color, NULL); + NULL, -1, 0, "default", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_group = config_file_new_option ( weechat_config_file, ptr_section, - "color_nicklist_group", "color", + "nicklist_group", "color", N_("text color for groups in nicklist"), - NULL, GUI_COLOR_NICKLIST_GROUP, 0, "green", &config_change_color, NULL); + NULL, GUI_COLOR_NICKLIST_GROUP, 0, "green", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_away = config_file_new_option ( weechat_config_file, ptr_section, - "color_nicklist_away", "color", + "nicklist_away", "color", N_("text color for away nicknames"), - NULL, GUI_COLOR_NICKLIST_AWAY, 0, "cyan", &config_change_color, NULL); + NULL, GUI_COLOR_NICKLIST_AWAY, 0, "cyan", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_prefix1 = config_file_new_option ( weechat_config_file, ptr_section, - "color_nicklist_prefix1", "color", + "nicklist_prefix1", "color", N_("text color for prefix #1 in nicklist"), - NULL, GUI_COLOR_NICKLIST_PREFIX1, 0, "lightgreen", &config_change_color, NULL); + NULL, GUI_COLOR_NICKLIST_PREFIX1, 0, "lightgreen", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_prefix2 = config_file_new_option ( weechat_config_file, ptr_section, - "color_nicklist_prefix2", "color", + "nicklist_prefix2", "color", N_("text color for prefix #2 in nicklist"), - NULL, GUI_COLOR_NICKLIST_PREFIX2, 0, "lightmagenta", &config_change_color, NULL); + NULL, GUI_COLOR_NICKLIST_PREFIX2, 0, "lightmagenta", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_prefix3 = config_file_new_option ( weechat_config_file, ptr_section, - "color_nicklist_prefix3", "color", + "nicklist_prefix3", "color", N_("text color for prefix #3 in nicklist"), - NULL, GUI_COLOR_NICKLIST_PREFIX3, 0, "yellow", &config_change_color, NULL); + NULL, GUI_COLOR_NICKLIST_PREFIX3, 0, "yellow", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_prefix4 = config_file_new_option ( weechat_config_file, ptr_section, - "color_nicklist_prefix4", "color", + "nicklist_prefix4", "color", N_("text color for prefix #4 in nicklist"), - NULL, GUI_COLOR_NICKLIST_PREFIX4, 0, "blue", &config_change_color, NULL); + NULL, GUI_COLOR_NICKLIST_PREFIX4, 0, "blue", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_prefix5 = config_file_new_option ( weechat_config_file, ptr_section, - "color_nicklist_prefix5", "color", + "nicklist_prefix5", "color", N_("text color for prefix #5 in nicklist"), - NULL, GUI_COLOR_NICKLIST_PREFIX5, 0, "brown", &config_change_color, NULL); + NULL, GUI_COLOR_NICKLIST_PREFIX5, 0, "brown", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_more = config_file_new_option ( weechat_config_file, ptr_section, - "color_nicklist_more", "color", + "nicklist_more", "color", N_("text color for '+' when scrolling nicks in nicklist"), - NULL, GUI_COLOR_NICKLIST_MORE, 0, "lightmagenta", &config_change_color, NULL); + NULL, GUI_COLOR_NICKLIST_MORE, 0, "lightmagenta", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_separator = config_file_new_option ( weechat_config_file, ptr_section, - "color_nicklist_separator", "color", + "nicklist_separator", "color", N_("text color for nicklist separator"), - NULL, GUI_COLOR_NICKLIST_SEPARATOR, 0, "blue", &config_change_color, NULL); + NULL, GUI_COLOR_NICKLIST_SEPARATOR, 0, "blue", + NULL, NULL, &config_change_color, NULL, NULL, NULL); /* status info */ config_color_info = config_file_new_option ( weechat_config_file, ptr_section, - "color_info", "color", + "info", "color", N_("text color for status info"), - NULL, GUI_COLOR_INFO, 0, "default", &config_change_color, NULL); + NULL, GUI_COLOR_INFO, 0, "default", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_info_bg = config_file_new_option ( weechat_config_file, ptr_section, - "color_info_bg", "color", + "info_bg", "color", N_("background color for status info"), - NULL, -1, 0, "default", &config_change_color, NULL); + NULL, -1, 0, "default", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_info_waiting = config_file_new_option ( weechat_config_file, ptr_section, - "color_info_waiting", "color", + "info_waiting", "color", N_("text color for \"waiting\" status info"), - NULL, GUI_COLOR_INFO_WAITING, 0, "lightcyan", &config_change_color, NULL); + NULL, GUI_COLOR_INFO_WAITING, 0, "lightcyan", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_info_connecting = config_file_new_option ( weechat_config_file, ptr_section, - "color_info_connecting", "color", + "info_connecting", "color", N_("text color for \"connecting\" status info"), - NULL, GUI_COLOR_INFO_CONNECTING, 0, "yellow", &config_change_color, NULL); + NULL, GUI_COLOR_INFO_CONNECTING, 0, "yellow", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_info_active = config_file_new_option ( weechat_config_file, ptr_section, - "color_info_active", "color", + "info_active", "color", N_("text color for \"active\" status info"), - NULL, GUI_COLOR_INFO_ACTIVE, 0, "lightblue", &config_change_color, NULL); + NULL, GUI_COLOR_INFO_ACTIVE, 0, "lightblue", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_info_done = config_file_new_option ( weechat_config_file, ptr_section, - "color_info_done", "color", + "info_done", "color", N_("text color for \"done\" status info"), - NULL, GUI_COLOR_INFO_DONE, 0, "lightgreen", &config_change_color, NULL); + NULL, GUI_COLOR_INFO_DONE, 0, "lightgreen", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_info_failed = config_file_new_option ( weechat_config_file, ptr_section, - "color_info_failed", "color", + "info_failed", "color", N_("text color for \"failed\" status info"), - NULL, GUI_COLOR_INFO_FAILED, 0, "lightred", &config_change_color, NULL); + NULL, GUI_COLOR_INFO_FAILED, 0, "lightred", + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_info_aborted = config_file_new_option ( weechat_config_file, ptr_section, - "color_info_aborted", "color", + "info_aborted", "color", N_("text color for \"aborted\" status info"), - NULL, GUI_COLOR_INFO_ABORTED, 0, "lightred", &config_change_color, NULL); + NULL, GUI_COLOR_INFO_ABORTED, 0, "lightred", + NULL, NULL, &config_change_color, NULL, NULL, NULL); /* history */ ptr_section = config_file_new_section (weechat_config_file, "history", - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -1354,26 +1434,27 @@ config_weechat_init () config_history_max_lines = config_file_new_option ( weechat_config_file, ptr_section, - "history_max_lines", "integer", + "max_lines", "integer", N_("maximum number of lines in history per buffer " "(0 = unlimited)"), - NULL, 0, INT_MAX, "4096", NULL, NULL); + NULL, 0, INT_MAX, "4096", NULL, NULL, NULL, NULL, NULL, NULL); config_history_max_commands = config_file_new_option ( weechat_config_file, ptr_section, - "history_max_commands", "integer", + "max_commands", "integer", N_("maximum number of user commands in history (0 = " "unlimited)"), - NULL, 0, INT_MAX, "100", NULL, NULL); + NULL, 0, INT_MAX, "100", NULL, NULL, NULL, NULL, NULL, NULL); config_history_display_default = config_file_new_option ( weechat_config_file, ptr_section, - "history_display_default", "integer", + "display_default", "integer", N_("maximum number of commands to display by default in " "history listing (0 = unlimited)"), - NULL, 0, INT_MAX, "5", NULL, NULL); + NULL, 0, INT_MAX, "5", NULL, NULL, NULL, NULL, NULL, NULL); /* proxy */ ptr_section = config_file_new_section (weechat_config_file, "proxy", - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -1382,66 +1463,67 @@ config_weechat_init () config_proxy_use = config_file_new_option ( weechat_config_file, ptr_section, - "proxy_use", "boolean", + "use", "boolean", N_("use a proxy server"), - NULL, 0, 0, "off", NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); config_proxy_type = config_file_new_option ( weechat_config_file, ptr_section, - "proxy_type", "integer", + "type", "integer", N_("proxy type (http (default), socks4, socks5)"), - "http|socks4|socks5", 0, 0, "http", NULL, NULL); + "http|socks4|socks5", 0, 0, "http", NULL, NULL, NULL, NULL, NULL, NULL); config_proxy_ipv6 = config_file_new_option ( weechat_config_file, ptr_section, - "proxy_ipv6", "boolean", + "ipv6", "boolean", N_("connect to proxy using ipv6"), - NULL, 0, 0, "off", NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); config_proxy_address = config_file_new_option ( weechat_config_file, ptr_section, - "proxy_address", "string", + "address", "string", N_("proxy server address (IP or hostname)"), - NULL, 0, 0, "", NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); config_proxy_port = config_file_new_option ( weechat_config_file, ptr_section, - "proxy_port", "integer", + "port", "integer", N_("port for connecting to proxy server"), - NULL, 0, 65535, "3128", NULL, NULL); + NULL, 0, 65535, "3128", NULL, NULL, NULL, NULL, NULL, NULL); config_proxy_username = config_file_new_option ( weechat_config_file, ptr_section, - "proxy_username", "string", + "username", "string", N_("username for proxy server"), - NULL, 0, 0, "", NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); config_proxy_password = config_file_new_option ( weechat_config_file, ptr_section, - "proxy_password", "string", + "password", "string", N_("password for proxy server"), - NULL, 0, 0, "", NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); - /* plugins */ - ptr_section = config_file_new_section (weechat_config_file, "plugins", - NULL, NULL, NULL, NULL, NULL, NULL); + /* plugin */ + ptr_section = config_file_new_section (weechat_config_file, "plugin", + NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); return 0; } - config_plugins_path = config_file_new_option ( + config_plugin_path = config_file_new_option ( weechat_config_file, ptr_section, - "plugins_path", "string", + "path", "string", N_("path for searching plugins ('%h' will be replaced by " "WeeChat home, ~/.weechat by default)"), - NULL, 0, 0, "%h/plugins", NULL, NULL); - config_plugins_autoload = config_file_new_option ( + NULL, 0, 0, "%h/plugins", NULL, NULL, NULL, NULL, NULL, NULL); + config_plugin_autoload = config_file_new_option ( weechat_config_file, ptr_section, - "plugins_autoload", "string", + "autoload", "string", N_("comma separated list of plugins to load automatically " "at startup, \"*\" means all plugins found (names may " "be partial, for example \"perl\" is ok for " "\"perl.so\")"), - NULL, 0, 0, "*", NULL, NULL); - config_plugins_extension = config_file_new_option ( + NULL, 0, 0, "*", NULL, NULL, NULL, NULL, NULL, NULL); + config_plugin_extension = config_file_new_option ( weechat_config_file, ptr_section, - "plugins_extension", "string", + "extension", "string", N_("standard plugins extension in filename (for example " "\".so\" under Linux or \".dll\" under Microsoft Windows)"), NULL, 0, 0, @@ -1450,21 +1532,19 @@ config_weechat_init () #else ".so", #endif - NULL, NULL); - config_plugins_save_config_on_unload = config_file_new_option ( + NULL, NULL, NULL, NULL, NULL, NULL); + config_plugin_save_config_on_unload = config_file_new_option ( weechat_config_file, ptr_section, - "plugins_save_config_on_unload", "boolean", + "save_config_on_unload", "boolean", N_("save configuration files when unloading plugins"), - NULL, 0, 0, "on", NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); /* bars */ - ptr_section = config_file_new_section (weechat_config_file, "bars", - &config_weechat_read_bar, - NULL, - &config_weechat_write_bars, - NULL, - &config_weechat_write_bars, - NULL); + ptr_section = config_file_new_section (weechat_config_file, "bar", + &config_weechat_bar_read, NULL, + &config_weechat_bar_write, NULL, + &config_weechat_bar_write, NULL, + NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -1472,13 +1552,11 @@ config_weechat_init () } /* filters */ - ptr_section = config_file_new_section (weechat_config_file, "filters", - &config_weechat_read_filter, - NULL, - &config_weechat_write_filters, - NULL, - &config_weechat_write_filters, - NULL); + ptr_section = config_file_new_section (weechat_config_file, "filter", + &config_weechat_filter_read, NULL, + &config_weechat_filter_write, NULL, + &config_weechat_filter_write, NULL, + NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -1486,13 +1564,11 @@ config_weechat_init () } /* keys */ - ptr_section = config_file_new_section (weechat_config_file, "keys", - &config_weechat_read_key, - NULL, - &config_weechat_write_keys, - NULL, - &config_weechat_write_keys, - NULL); + ptr_section = config_file_new_section (weechat_config_file, "key", + &config_weechat_key_read, NULL, + &config_weechat_key_write, NULL, + &config_weechat_key_write, NULL, + NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); diff --git a/src/core/wee-config.h b/src/core/wee-config.h index fcd464b0c..431e686cf 100644 --- a/src/core/wee-config.h +++ b/src/core/wee-config.h @@ -22,7 +22,7 @@ #include "wee-config-file.h" -#define WEECHAT_CONFIG_FILENAME "weechat.rc" +#define WEECHAT_CONFIG_NAME "weechat" #define CONFIG_LOOK_NICKLIST_LEFT 0 #define CONFIG_LOOK_NICKLIST_RIGHT 1 @@ -42,15 +42,15 @@ extern struct t_config_file *weechat_config_file; -extern struct t_config_option *config_startup_logo; -extern struct t_config_option *config_startup_version; +extern struct t_config_option *config_startup_display_logo; +extern struct t_config_option *config_startup_display_version; extern struct t_config_option *config_startup_command_before_plugins; extern struct t_config_option *config_startup_command_after_plugins; +extern struct t_config_option *config_startup_weechat_slogan; extern struct t_config_option *config_look_color_real_white; extern struct t_config_option *config_look_save_on_exit; extern struct t_config_option *config_look_set_title; -extern struct t_config_option *config_look_weechat_slogan; extern struct t_config_option *config_look_one_server_buffer; extern struct t_config_option *config_look_open_near_server; extern struct t_config_option *config_look_scroll_amount; @@ -166,10 +166,10 @@ extern struct t_config_option *config_proxy_port; extern struct t_config_option *config_proxy_username; extern struct t_config_option *config_proxy_password; -extern struct t_config_option *config_plugins_path; -extern struct t_config_option *config_plugins_autoload; -extern struct t_config_option *config_plugins_extension; -extern struct t_config_option *config_plugins_save_config_on_unload; +extern struct t_config_option *config_plugin_path; +extern struct t_config_option *config_plugin_autoload; +extern struct t_config_option *config_plugin_extension; +extern struct t_config_option *config_plugin_save_config_on_unload; extern int config_weechat_init (); extern int config_weechat_read (); diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c index ba579decb..2855669ce 100644 --- a/src/core/wee-hook.c +++ b/src/core/wee-hook.c @@ -941,7 +941,7 @@ hook_signal_send (char *signal, char *type_data, void *signal_data) */ struct t_hook * -hook_config (struct t_weechat_plugin *plugin, char *type, char *option, +hook_config (struct t_weechat_plugin *plugin, char *option, t_hook_callback_config *callback, void *callback_data) { struct t_hook *new_hook; @@ -961,7 +961,6 @@ hook_config (struct t_weechat_plugin *plugin, char *type, char *option, new_hook->hook_data = new_hook_config; new_hook_config->callback = callback; - new_hook_config->type = (type) ? strdup (type) : strdup (""); new_hook_config->option = (option) ? strdup (option) : strdup (""); hook_add_to_list (new_hook); @@ -974,7 +973,7 @@ hook_config (struct t_weechat_plugin *plugin, char *type, char *option, */ void -hook_config_exec (char *type, char *option, char *value) +hook_config_exec (char *option, char *value) { struct t_hook *ptr_hook, *next_hook; @@ -987,16 +986,13 @@ hook_config_exec (char *type, char *option, char *value) if (!ptr_hook->deleted && !ptr_hook->running - && (!HOOK_CONFIG(ptr_hook, type) - || (string_strcasecmp (HOOK_CONFIG(ptr_hook, type), - type) == 0)) && (!HOOK_CONFIG(ptr_hook, option) || (string_strcasecmp (HOOK_CONFIG(ptr_hook, option), option) == 0))) { ptr_hook->running = 1; (void) (HOOK_CONFIG(ptr_hook, callback)) - (ptr_hook->callback_data, type, option, value); + (ptr_hook->callback_data, option, value); ptr_hook->running = 0; } @@ -1236,8 +1232,6 @@ unhook (struct t_hook *hook) free ((struct t_hook_signal *)hook->hook_data); break; case HOOK_TYPE_CONFIG: - if (HOOK_CONFIG(hook, type)) - free (HOOK_CONFIG(hook, type)); if (HOOK_CONFIG(hook, option)) free (HOOK_CONFIG(hook, option)); free ((struct t_hook_config *)hook->hook_data); @@ -1422,7 +1416,6 @@ hook_print_log () { log_printf (" config data:"); log_printf (" callback . . . . . . : 0x%x", HOOK_CONFIG(ptr_hook, callback)); - log_printf (" type . . . . . . . . : '%s'", HOOK_CONFIG(ptr_hook, type)); log_printf (" option . . . . . . . : '%s'", HOOK_CONFIG(ptr_hook, option)); } break; diff --git a/src/core/wee-hook.h b/src/core/wee-hook.h index a287be2fa..4f17d606e 100644 --- a/src/core/wee-hook.h +++ b/src/core/wee-hook.h @@ -128,13 +128,11 @@ struct t_hook_signal /* with "*", "*" == any signal) */ }; -typedef int (t_hook_callback_config)(void *data, char *type, char *option, - char *value); +typedef int (t_hook_callback_config)(void *data, char *option, char *value); struct t_hook_config { t_hook_callback_config *callback; /* config callback */ - char *type; /* "weechat" or "plugin" */ char *option; /* config option for hook */ /* (NULL = hook for all options) */ }; @@ -209,11 +207,10 @@ extern struct t_hook *hook_signal (struct t_weechat_plugin *plugin, void *callback_data); extern void hook_signal_send (char *signal, char *type_data, void *signal_data); -extern struct t_hook *hook_config (struct t_weechat_plugin *, char *type, - char *option, +extern struct t_hook *hook_config (struct t_weechat_plugin *, char *option, t_hook_callback_config *callback, void *callback_data); -extern void hook_config_exec (char *type, char *option, char *value); +extern void hook_config_exec (char *option, char *value); extern struct t_hook *hook_completion (struct t_weechat_plugin *plugin, char *completion, t_hook_callback_completion *callback, diff --git a/src/core/wee-list.c b/src/core/wee-list.c index ac1e595ab..fc67789f7 100644 --- a/src/core/wee-list.c +++ b/src/core/wee-list.c @@ -231,14 +231,14 @@ weelist_get (struct t_weelist *weelist, int position) */ void -weelist_set (struct t_weelist_item *item, char *new_value) +weelist_set (struct t_weelist_item *item, char *value) { - if (!item || !new_value) + if (!item || !value) return; if (item->data) free (item->data); - item->data = strdup (new_value); + item->data = strdup (value); } /* diff --git a/src/core/wee-list.h b/src/core/wee-list.h index 3562217fe..c992b9b41 100644 --- a/src/core/wee-list.h +++ b/src/core/wee-list.h @@ -43,7 +43,7 @@ extern struct t_weelist_item *weelist_casesearch (struct t_weelist *weelist, char *data); extern struct t_weelist_item *weelist_get (struct t_weelist *weelist, int position); -extern void weelist_set (struct t_weelist_item *item, char *new_value); +extern void weelist_set (struct t_weelist_item *item, char *value); extern struct t_weelist_item *weelist_next (struct t_weelist_item *item); extern struct t_weelist_item *weelist_prev (struct t_weelist_item *item); extern char *weelist_string (struct t_weelist_item *item); diff --git a/src/core/wee-util.c b/src/core/wee-util.c index 8706345b7..5a569f311 100644 --- a/src/core/wee-util.c +++ b/src/core/wee-util.c @@ -220,17 +220,17 @@ util_search_full_lib_name (char *filename, char *sys_directory) return strdup (filename); length = strlen (filename) + 16; - if (CONFIG_STRING(config_plugins_extension) - && CONFIG_STRING(config_plugins_extension)[0]) - length += strlen (CONFIG_STRING(config_plugins_extension)); + if (CONFIG_STRING(config_plugin_extension) + && CONFIG_STRING(config_plugin_extension)[0]) + length += strlen (CONFIG_STRING(config_plugin_extension)); name_with_ext = malloc (length); if (!name_with_ext) return strdup (filename); strcpy (name_with_ext, filename); if (!strchr (filename, '.') - && CONFIG_STRING(config_plugins_extension) - && CONFIG_STRING(config_plugins_extension)[0]) - strcat (name_with_ext, CONFIG_STRING(config_plugins_extension)); + && CONFIG_STRING(config_plugin_extension) + && CONFIG_STRING(config_plugin_extension)[0]) + strcat (name_with_ext, CONFIG_STRING(config_plugin_extension)); /* try WeeChat user's dir */ length = strlen (weechat_home) + strlen (name_with_ext) + diff --git a/src/core/weechat.c b/src/core/weechat.c index 893a752de..f56910e70 100644 --- a/src/core/weechat.c +++ b/src/core/weechat.c @@ -122,7 +122,7 @@ void weechat_display_config_options () { string_iconv_fprintf (stdout, - /* TRANSLATORS: %s is "WeeChat" */ + /* TRANSLATORS: %s is "weechat" */ _("%s configuration options:\n"), PACKAGE_NAME); config_file_print_stdout (weechat_config_file); @@ -136,7 +136,7 @@ void weechat_display_commands () { string_iconv_fprintf (stdout, - /* TRANSLATORS: %s is "WeeChat" */ + /* TRANSLATORS: %s is "weechat" */ _("%s internal commands:\n"), PACKAGE_NAME); string_iconv_fprintf (stdout, "\n"); @@ -176,7 +176,7 @@ weechat_display_keys () char *expanded_name; string_iconv_fprintf (stdout, - /* TRANSLATORS: %s is "WeeChat" */ + /* TRANSLATORS: %s is "weechat" */ _("%s default keys:\n"), PACKAGE_NAME); string_iconv_fprintf (stdout, "\n"); @@ -409,7 +409,7 @@ weechat_init_vars () void weechat_welcome_message () { - if (CONFIG_BOOLEAN(config_startup_logo)) + if (CONFIG_BOOLEAN(config_startup_display_logo)) { gui_chat_printf (NULL, "%s ___ __ ______________ _____ \n" @@ -423,31 +423,31 @@ weechat_welcome_message () GUI_COLOR(GUI_COLOR_CHAT_NICK), GUI_COLOR(GUI_COLOR_CHAT_NICK)); } - if (CONFIG_STRING(config_look_weechat_slogan) - && CONFIG_STRING(config_look_weechat_slogan)[0]) + if (CONFIG_STRING(config_startup_weechat_slogan) + && CONFIG_STRING(config_startup_weechat_slogan)[0]) { gui_chat_printf (NULL, _("%sWelcome to %s%s%s, %s"), - (CONFIG_BOOLEAN(config_startup_logo)) ? + (CONFIG_BOOLEAN(config_startup_display_logo)) ? " " : "", GUI_COLOR(GUI_COLOR_CHAT_BUFFER), PACKAGE_NAME, GUI_NO_COLOR, - CONFIG_STRING(config_look_weechat_slogan)); + CONFIG_STRING(config_startup_weechat_slogan)); } - if (CONFIG_BOOLEAN(config_startup_version)) + if (CONFIG_BOOLEAN(config_startup_display_version)) { gui_chat_printf (NULL, "%s%s%s%s, %s %s %s", - (CONFIG_BOOLEAN(config_startup_logo)) ? + (CONFIG_BOOLEAN(config_startup_display_logo)) ? " " : "", GUI_COLOR(GUI_COLOR_CHAT_BUFFER), PACKAGE_STRING, GUI_NO_COLOR, _("compiled on"), __DATE__, __TIME__); } - if (CONFIG_BOOLEAN(config_startup_logo) || - (CONFIG_STRING(config_look_weechat_slogan) - && CONFIG_STRING(config_look_weechat_slogan)[0]) || - CONFIG_BOOLEAN(config_startup_version)) + if (CONFIG_BOOLEAN(config_startup_display_logo) || + (CONFIG_STRING(config_startup_weechat_slogan) + && CONFIG_STRING(config_startup_weechat_slogan)[0]) || + CONFIG_BOOLEAN(config_startup_display_version)) gui_chat_printf (NULL, "%s-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-", GUI_COLOR(GUI_COLOR_CHAT_NICK)); diff --git a/src/gui/curses/gui-curses-bar.c b/src/gui/curses/gui-curses-bar.c index 3f9b9c355..2b073c0d9 100644 --- a/src/gui/curses/gui-curses-bar.c +++ b/src/gui/curses/gui-curses-bar.c @@ -94,7 +94,6 @@ gui_bar_window_get_size (struct t_gui_bar *bar, struct t_gui_window *window, total_size += ptr_bar_window->width; break; case GUI_BAR_NUM_POSITIONS: - /* make C compiler happy */ break; } if (ptr_bar_window->bar->separator) @@ -209,7 +208,6 @@ gui_bar_window_calculate_pos_size (struct t_gui_bar_window *bar_window, bar_window->height = y2 - y1 + 1; break; case GUI_BAR_NUM_POSITIONS: - /* make C compiler happy */ break; } } @@ -266,7 +264,6 @@ gui_bar_window_create_win (struct t_gui_bar_window *bar_window) bar_window->x - 1); break; case GUI_BAR_NUM_POSITIONS: - /* make C compiler happy */ break; } } @@ -706,7 +703,6 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window, } break; case GUI_BAR_NUM_POSITIONS: - /* make C compiler happy */ break; } x = 0; @@ -806,7 +802,6 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window, bar_window->height); break; case GUI_BAR_NUM_POSITIONS: - /* make C compiler happy */ break; } wnoutrefresh (bar_window->win_separator); diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c index e18c04732..45d709e0c 100644 --- a/src/gui/curses/gui-curses-color.c +++ b/src/gui/curses/gui-curses-color.c @@ -351,7 +351,6 @@ gui_color_init_weechat () gui_color[GUI_COLOR_CHAT] = gui_color_build (GUI_COLOR_CHAT, CONFIG_COLOR(config_color_chat), CONFIG_COLOR(config_color_chat_bg)); gui_color[GUI_COLOR_CHAT_TIME] = gui_color_build (GUI_COLOR_CHAT_TIME, CONFIG_COLOR(config_color_chat_time), CONFIG_COLOR(config_color_chat_bg)); gui_color[GUI_COLOR_CHAT_TIME_DELIMITERS] = gui_color_build (GUI_COLOR_CHAT_TIME_DELIMITERS, CONFIG_COLOR(config_color_chat_time_delimiters), CONFIG_COLOR(config_color_chat_bg)); - gui_color[GUI_COLOR_CHAT_PREFIX_INFO] = gui_color_build (GUI_COLOR_CHAT_PREFIX_INFO, CONFIG_COLOR(config_color_chat_prefix[GUI_CHAT_PREFIX_INFO]), CONFIG_COLOR(config_color_chat_bg)); gui_color[GUI_COLOR_CHAT_PREFIX_ERROR] = 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[GUI_COLOR_CHAT_PREFIX_NETWORK] = 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[GUI_COLOR_CHAT_PREFIX_ACTION] = gui_color_build (GUI_COLOR_CHAT_PREFIX_ACTION, CONFIG_COLOR(config_color_chat_prefix[GUI_CHAT_PREFIX_ACTION]), CONFIG_COLOR(config_color_chat_bg)); diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index 7f266db8c..51fb06960 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -227,8 +227,10 @@ char * gui_buffer_get_string (struct t_gui_buffer *buffer, char *property) { static char value[32]; - - if (string_strcasecmp (property, "category") == 0) + + if (string_strcasecmp (property, "plugin") == 0) + return (buffer->plugin) ? buffer->plugin->name : NULL; + else if (string_strcasecmp (property, "category") == 0) return buffer->category; else if (string_strcasecmp (property, "name") == 0) return buffer->name; diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c index c3b8e0340..16c0d3b82 100644 --- a/src/gui/gui-chat.c +++ b/src/gui/gui-chat.c @@ -47,8 +47,8 @@ #include "gui-window.h" -char *gui_chat_prefix[GUI_CHAT_PREFIX_NUMBER]; /* prefixes */ -char gui_chat_prefix_empty[] = ""; /* empty prefix */ +char *gui_chat_prefix[GUI_CHAT_NUM_PREFIXES]; /* prefixes */ +char gui_chat_prefix_empty[] = ""; /* empty prefix */ int gui_chat_time_length = 0; /* length of time for each line (in chars) */ @@ -60,7 +60,6 @@ int gui_chat_time_length = 0; /* length of time for each line (in chars) */ void gui_chat_prefix_build_empty () { - gui_chat_prefix[GUI_CHAT_PREFIX_INFO] = strdup (gui_chat_prefix_empty); gui_chat_prefix[GUI_CHAT_PREFIX_ERROR] = strdup (gui_chat_prefix_empty); gui_chat_prefix[GUI_CHAT_PREFIX_NETWORK] = strdup (gui_chat_prefix_empty); gui_chat_prefix[GUI_CHAT_PREFIX_ACTION] = strdup (gui_chat_prefix_empty); @@ -79,7 +78,7 @@ gui_chat_prefix_build () char prefix[128]; int i; - for (i = 0; i < GUI_CHAT_PREFIX_NUMBER; i++) + for (i = 0; i < GUI_CHAT_NUM_PREFIXES; i++) { if (gui_chat_prefix[i]) { @@ -89,11 +88,6 @@ gui_chat_prefix_build () } snprintf (prefix, sizeof (prefix), "%s%s\t", - GUI_COLOR(GUI_COLOR_CHAT_PREFIX_INFO), - CONFIG_STRING(config_look_prefix[GUI_CHAT_PREFIX_INFO])); - gui_chat_prefix[GUI_CHAT_PREFIX_INFO] = strdup (prefix); - - snprintf (prefix, sizeof (prefix), "%s%s\t", GUI_COLOR(GUI_COLOR_CHAT_PREFIX_ERROR), CONFIG_STRING(config_look_prefix[GUI_CHAT_PREFIX_ERROR])); gui_chat_prefix[GUI_CHAT_PREFIX_ERROR] = strdup (prefix); @@ -807,6 +801,9 @@ gui_chat_printf_date_tags (struct t_gui_buffer *buffer, time_t date, char *pos, *pos_prefix, *pos_tab, *pos_end; struct t_gui_line *ptr_line; + if (!gui_buffer_valid (buffer)) + return; + if (!message) return; diff --git a/src/gui/gui-chat.h b/src/gui/gui-chat.h index 0db9bf6f9..685d9fb94 100644 --- a/src/gui/gui-chat.h +++ b/src/gui/gui-chat.h @@ -31,17 +31,16 @@ struct t_gui_line; enum t_gui_prefix { - GUI_CHAT_PREFIX_INFO = 0, - GUI_CHAT_PREFIX_ERROR, + GUI_CHAT_PREFIX_ERROR = 0, GUI_CHAT_PREFIX_NETWORK, GUI_CHAT_PREFIX_ACTION, GUI_CHAT_PREFIX_JOIN, GUI_CHAT_PREFIX_QUIT, - GUI_CHAT_PREFIX_NUMBER, + GUI_CHAT_NUM_PREFIXES, }; -extern char *gui_chat_prefix[GUI_CHAT_PREFIX_NUMBER]; +extern char *gui_chat_prefix[GUI_CHAT_NUM_PREFIXES]; extern char gui_chat_prefix_empty[]; extern int gui_chat_time_length; diff --git a/src/gui/gui-color.c b/src/gui/gui-color.c index 45ccf0760..2df69ca80 100644 --- a/src/gui/gui-color.c +++ b/src/gui/gui-color.c @@ -52,11 +52,11 @@ gui_color_search_config (char *color_name) { struct t_config_section *ptr_section; struct t_config_option *ptr_option; - + if (color_name) { ptr_section = config_file_search_section (weechat_config_file, - "colors"); + "color"); if (ptr_section) { for (ptr_option = ptr_section->options; ptr_option; diff --git a/src/gui/gui-color.h b/src/gui/gui-color.h index 83de11aa7..e36660f08 100644 --- a/src/gui/gui-color.h +++ b/src/gui/gui-color.h @@ -32,7 +32,6 @@ enum t_gui_color_enum GUI_COLOR_CHAT, GUI_COLOR_CHAT_TIME, GUI_COLOR_CHAT_TIME_DELIMITERS, - GUI_COLOR_CHAT_PREFIX_INFO, GUI_COLOR_CHAT_PREFIX_ERROR, GUI_COLOR_CHAT_PREFIX_NETWORK, GUI_COLOR_CHAT_PREFIX_ACTION, diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c index e0d9ce8eb..00290b7c6 100644 --- a/src/gui/gui-completion.c +++ b/src/gui/gui-completion.c @@ -329,7 +329,7 @@ gui_completion_list_add_config_files (struct t_gui_completion *completion) for (ptr_config_file = config_files; ptr_config_file; ptr_config_file = ptr_config_file->next_config) { - gui_completion_list_add (completion, ptr_config_file->filename, + gui_completion_list_add (completion, ptr_config_file->name, 0, WEECHAT_LIST_POS_SORT); } } @@ -529,40 +529,41 @@ gui_completion_list_add_nicks (struct t_gui_completion *completion) void gui_completion_list_add_option (struct t_gui_completion *completion) { + struct t_config_file *ptr_config; struct t_config_section *ptr_section; struct t_config_option *ptr_option; - - for (ptr_section = weechat_config_file->sections; ptr_section; - ptr_section = ptr_section->next_section) + int length; + char *option_full_name; + + for (ptr_config = config_files; ptr_config; + ptr_config = ptr_config->next_config) { - for (ptr_option = ptr_section->options; ptr_option; - ptr_option = ptr_option->next_option) + for (ptr_section = ptr_config->sections; ptr_section; + ptr_section = ptr_section->next_section) { - gui_completion_list_add (completion, - ptr_option->name, - 0, WEECHAT_LIST_POS_SORT); + for (ptr_option = ptr_section->options; ptr_option; + ptr_option = ptr_option->next_option) + { + length = strlen (ptr_config->name) + 1 + + strlen (ptr_section->name) + 1 + + strlen (ptr_option->name) + 1; + option_full_name = malloc (length); + if (option_full_name) + { + snprintf (option_full_name, length, "%s.%s.%s", + ptr_config->name, ptr_section->name, + ptr_option->name); + gui_completion_list_add (completion, + option_full_name, + 0, WEECHAT_LIST_POS_SORT); + free (option_full_name); + } + } } } } /* - * gui_completion_list_add_plugin_option: add plugin option to completion list - */ - -void -gui_completion_list_add_plugin_option (struct t_gui_completion *completion) -{ - struct t_config_option *ptr_option; - - for (ptr_option = plugin_options; ptr_option; - ptr_option = ptr_option->next_option) - { - gui_completion_list_add (completion, ptr_option->name, - 0, WEECHAT_LIST_POS_SORT); - } -} - -/* * gui_completion_list_add_plugin: add plugin name to completion list */ @@ -580,104 +581,124 @@ gui_completion_list_add_plugin (struct t_gui_completion *completion) } /* - * gui_completion_list_add_quit: add quit message to completion list - */ - -void -gui_completion_list_add_quit (struct t_gui_completion *completion) -{ - if (CONFIG_STRING(config_look_default_msg_quit) - && CONFIG_STRING(config_look_default_msg_quit)[0]) - gui_completion_list_add (completion, - CONFIG_STRING(config_look_default_msg_quit), - 0, WEECHAT_LIST_POS_SORT); -} - -/* * gui_completion_list_add_option_value: add option value to completion list */ void gui_completion_list_add_option_value (struct t_gui_completion *completion) { - char *pos, *color_name, option_string[2048]; - struct t_config_option *ptr_option; + char *pos_space, *option_full_name, *color_name, *pos_section, *pos_option; + char *file, *section, *value_string; + int length; + struct t_config_file *ptr_config; + struct t_config_section *ptr_section, *section_found; + struct t_config_option *option_found; if (completion->args) { - pos = strchr (completion->args, ' '); - if (pos) - pos[0] = '\0'; - ptr_option = config_file_search_option (weechat_config_file, - NULL, - completion->args); - if (ptr_option) + pos_space = strchr (completion->args, ' '); + if (pos_space) + option_full_name = string_strndup (completion->args, + pos_space - completion->args); + else + option_full_name = strdup (completion->args); + + if (option_full_name) { - switch (ptr_option->type) + file = NULL; + section = NULL; + pos_option = NULL; + + pos_section = strchr (option_full_name, '.'); + pos_option = (pos_section) ? strchr (pos_section + 1, '.') : NULL; + + if (pos_section && pos_option) { - case CONFIG_OPTION_BOOLEAN: - if (CONFIG_BOOLEAN(ptr_option) == CONFIG_BOOLEAN_TRUE) - gui_completion_list_add (completion, "on", - 0, WEECHAT_LIST_POS_SORT); - else - gui_completion_list_add (completion, "off", - 0, WEECHAT_LIST_POS_SORT); - break; - case CONFIG_OPTION_INTEGER: - if (ptr_option->string_values) - snprintf (option_string, sizeof (option_string) - 1, - "%s", - ptr_option->string_values[CONFIG_INTEGER(ptr_option)]); - else - snprintf (option_string, sizeof (option_string) - 1, - "%d", CONFIG_INTEGER(ptr_option)); - gui_completion_list_add (completion, option_string, - 0, WEECHAT_LIST_POS_SORT); - break; - case CONFIG_OPTION_STRING: - snprintf (option_string, sizeof (option_string) - 1, - "\"%s\"", - CONFIG_STRING(ptr_option)); - gui_completion_list_add (completion, option_string, - 0, WEECHAT_LIST_POS_SORT); - break; - case CONFIG_OPTION_COLOR: - color_name = gui_color_get_name (CONFIG_INTEGER(ptr_option)); - if (color_name) - gui_completion_list_add (completion, - color_name, - 0, WEECHAT_LIST_POS_SORT); - break; + file = string_strndup (option_full_name, + pos_section - option_full_name); + section = string_strndup (pos_section + 1, + pos_option - pos_section - 1); + pos_option++; + } + if (file && section && pos_option) + { + ptr_config = config_file_search (file); + if (ptr_config) + { + ptr_section = config_file_search_section (ptr_config, + section); + if (ptr_section) + { + config_file_search_section_option (ptr_config, + ptr_section, + pos_option, + §ion_found, + &option_found); + if (option_found) + { + switch (option_found->type) + { + case CONFIG_OPTION_TYPE_BOOLEAN: + if (CONFIG_BOOLEAN(option_found) == CONFIG_BOOLEAN_TRUE) + gui_completion_list_add (completion, "on", + 0, WEECHAT_LIST_POS_SORT); + else + gui_completion_list_add (completion, "off", + 0, WEECHAT_LIST_POS_SORT); + break; + case CONFIG_OPTION_TYPE_INTEGER: + length = 64; + value_string = malloc (length); + if (value_string) + { + if (option_found->string_values) + snprintf (value_string, length, + "%s", + option_found->string_values[CONFIG_INTEGER(option_found)]); + else + snprintf (value_string, length, + "%d", CONFIG_INTEGER(option_found)); + gui_completion_list_add (completion, + value_string, + 0, WEECHAT_LIST_POS_SORT); + free (value_string); + } + break; + case CONFIG_OPTION_TYPE_STRING: + length = strlen (CONFIG_STRING(option_found)) + 2 + 1; + value_string = malloc (length); + if (value_string) + { + snprintf (value_string, length, + "\"%s\"", + CONFIG_STRING(option_found)); + gui_completion_list_add (completion, + value_string, + 0, WEECHAT_LIST_POS_SORT); + free (value_string); + } + break; + case CONFIG_OPTION_TYPE_COLOR: + color_name = gui_color_get_name (CONFIG_INTEGER(option_found)); + if (color_name) + { + gui_completion_list_add (completion, + color_name, + 0, WEECHAT_LIST_POS_SORT); + } + break; + case CONFIG_NUM_OPTION_TYPES: + break; + } + } + } + } } + if (file) + free (file); + if (section) + free (section); } - if (pos) - pos[0] = ' '; - } -} - -/* - * gui_completion_list_add_plugin_option_value: add plugin option value to completion list - */ - -void -gui_completion_list_add_plugin_option_value (struct t_gui_completion *completion) -{ - char *pos; - struct t_config_option *ptr_option; - - if (completion->args) - { - pos = strchr (completion->args, ' '); - if (pos) - pos[0] = '\0'; - - ptr_option = plugin_config_search_internal (completion->args); - if (ptr_option) - gui_completion_list_add (completion, ptr_option->value, - 0, WEECHAT_LIST_POS_SORT); - - if (pos) - pos[0] = ' '; } } @@ -793,24 +814,15 @@ gui_completion_build_list_template (struct t_gui_completion *completion, case 'o': /* config option */ gui_completion_list_add_option (completion); break; - case 'O': /* plugin option */ - gui_completion_list_add_plugin_option (completion); - break; case 'p': /* plugin name */ gui_completion_list_add_plugin (completion); break; - case 'q': /* quit message */ - gui_completion_list_add_quit (completion); - break; case 'r': /* bar names */ gui_completion_list_add_bars_names (completion); break; case 'v': /* value of config option */ gui_completion_list_add_option_value (completion); break; - case 'V': /* value of plugin option */ - gui_completion_list_add_plugin_option_value (completion); - break; case 'w': /* WeeChat commands */ gui_completion_list_add_weechat_cmd (completion); break; diff --git a/src/plugins/alias/alias.c b/src/plugins/alias/alias.c index c2295ed10..dba460a61 100644 --- a/src/plugins/alias/alias.c +++ b/src/plugins/alias/alias.c @@ -20,6 +20,7 @@ #include <stdlib.h> +#include <stdio.h> #include <string.h> #include "../weechat-plugin.h" @@ -31,12 +32,16 @@ WEECHAT_PLUGIN_DESCRIPTION("Alias plugin for WeeChat"); WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>"); WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION); WEECHAT_PLUGIN_WEECHAT_VERSION(WEECHAT_VERSION); -WEECHAT_PLUGIN_LICENSE("GPL"); +WEECHAT_PLUGIN_LICENSE("GPL3"); + +#define ALIAS_CONFIG_NAME "alias" struct t_weechat_plugin *weechat_alias_plugin = NULL; #define weechat_plugin weechat_alias_plugin struct t_config_file *alias_config_file = NULL; +struct t_config_section *alias_config_section_cmd = NULL; + struct t_alias *alias_list = NULL; struct t_alias *last_alias = NULL; @@ -280,15 +285,34 @@ alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv, } /* + * alias_find_pos: find position for an alias (for sorting aliases) + */ + +struct t_alias * +alias_find_pos (char *name) +{ + struct t_alias *ptr_alias; + + for (ptr_alias = alias_list; ptr_alias; ptr_alias = ptr_alias->next_alias) + { + if (weechat_strcasecmp (name, ptr_alias->name) < 0) + return ptr_alias; + } + + /* position not found (we will add to the end of list) */ + return NULL; +} + +/* * alias_new: create new alias and add it to alias list */ struct t_alias * alias_new (char *name, char *command) { - struct t_alias *new_alias, *ptr_alias; + struct t_alias *new_alias, *ptr_alias, *pos_alias; struct t_hook *new_hook; - + if (!name || !name[0] || !command || !command[0]) return NULL; @@ -321,14 +345,37 @@ alias_new (char *name, char *command) new_alias->name = strdup (name); new_alias->command = strdup (command); new_alias->running = 0; - - new_alias->prev_alias = last_alias; - new_alias->next_alias = NULL; + if (alias_list) - last_alias->next_alias = new_alias; + { + pos_alias = alias_find_pos (name); + if (pos_alias) + { + /* insert alias into the list (before alias found) */ + new_alias->prev_alias = pos_alias->prev_alias; + new_alias->next_alias = pos_alias; + if (pos_alias->prev_alias) + (pos_alias->prev_alias)->next_alias = new_alias; + else + alias_list = new_alias; + pos_alias->prev_alias = new_alias; + } + else + { + /* add alias to end of list */ + new_alias->prev_alias = last_alias; + new_alias->next_alias = NULL; + last_alias->next_alias = new_alias; + last_alias = new_alias; + } + } else + { + new_alias->prev_alias = NULL; + new_alias->next_alias = NULL; alias_list = new_alias; - last_alias = new_alias; + last_alias = new_alias; + } } return new_alias; @@ -375,7 +422,7 @@ void alias_free (struct t_alias *alias) { struct t_alias *new_alias_list; - + /* remove alias from list */ if (last_alias == alias) last_alias = alias->prev_alias; @@ -409,84 +456,71 @@ void alias_free_all () { while (alias_list) + { alias_free (alias_list); + } } /* - * alias_config_reaload: reload alias configuration file + * alias_config_change_cb: callback called when alias option is modified */ -int -alias_config_reload (void *data, struct t_config_file *config_file) +void +alias_config_change_cb (void *data, struct t_config_option *option) { + struct t_alias *ptr_alias; + /* make C compiler happy */ (void) data; - (void) config_file; - alias_free_all (); - return weechat_config_reload (alias_config_file); + ptr_alias = alias_search (weechat_config_option_get_pointer (option, "name")); + if (ptr_alias) + alias_free (ptr_alias); + alias_new (weechat_config_option_get_pointer (option, "name"), + weechat_config_option_get_pointer (option, "value")); } /* - * alias_config_read_line: read an alias in configuration file + * alias_config_delete_cb: callback called when alias option is deleted */ void -alias_config_read_line (void *data, struct t_config_file *config_file, - char *option_name, char *value) +alias_config_delete_cb (void *data, struct t_config_option *option) { + struct t_alias *ptr_alias; + /* make C compiler happy */ (void) data; - (void) config_file; - - if (option_name && value) - { - /* create new alias */ - if (!alias_new (option_name, value)) - { - weechat_printf (NULL, - "%s%s: error creating alias \"%s\" => \"%s\"", - weechat_prefix ("error"), "alias", - option_name, value); - } - } + + ptr_alias = alias_search (weechat_config_option_get_pointer (option, "name")); + if (ptr_alias) + alias_free (ptr_alias); } /* - * alias_config_write_section: write alias section in configuration file - * Return: 0 = successful - * -1 = write error + * alias_config_reload: reload alias configuration file */ -void -alias_config_write_section (void *data, struct t_config_file *config_file, - char *section_name) +int +alias_config_reload (void *data, struct t_config_file *config_file) { - struct t_alias *ptr_alias; - /* make C compiler happy */ (void) data; + + weechat_config_section_free_options (alias_config_section_cmd); + alias_free_all (); - weechat_config_write_line (config_file, section_name, NULL); - - for (ptr_alias = alias_list; ptr_alias; - ptr_alias = ptr_alias->next_alias) - { - weechat_config_write_line (config_file, - ptr_alias->name, - "\"%s\"", - ptr_alias->command); - } + return weechat_config_reload (config_file); } /* - * alias_config_write_default_aliases: write default aliases in configuration file + * alias_config_write_default: write default aliases in configuration file */ void -alias_config_write_default_aliases (void *data, - struct t_config_file *config_file, - char *section_name) +alias_config_write_default (void *data, + struct t_config_file *config_file, + char *section_name) { /* make C compiler happy */ (void) data; @@ -521,6 +555,51 @@ alias_config_write_default_aliases (void *data, } /* + * alias_config_create_option: create an alias + */ + +int +alias_config_create_option (void *data, struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, char *value) +{ + struct t_alias *ptr_alias; + int rc; + + /* make C compiler happy */ + (void) data; + + rc = 0; + + /* create config option */ + weechat_config_new_option ( + config_file, section, + option_name, "string", NULL, + NULL, 0, 0, value, NULL, NULL, + &alias_config_change_cb, NULL, + &alias_config_delete_cb, NULL); + + /* create alias */ + ptr_alias = alias_search (option_name); + if (ptr_alias) + alias_free (ptr_alias); + if (value && value[0]) + rc = (alias_new (option_name, value)) ? 1 : 0; + else + rc = 1; + + if (rc == 0) + { + weechat_printf (NULL, + "%s%s: error creating alias \"%s\" => \"%s\"", + weechat_prefix ("error"), "alias", + option_name, value); + } + + return rc; +} + +/* * alias_config_init: init alias configuration file * return: 1 if ok, 0 if error */ @@ -530,24 +609,24 @@ alias_config_init () { struct t_config_section *ptr_section; - alias_config_file = weechat_config_new (ALIAS_CONFIG_FILENAME, + alias_config_file = weechat_config_new (ALIAS_CONFIG_NAME, &alias_config_reload, NULL); if (!alias_config_file) return 0; - ptr_section = weechat_config_new_section (alias_config_file, "alias", - &alias_config_read_line, - NULL, - &alias_config_write_section, - NULL, - &alias_config_write_default_aliases, - NULL); + ptr_section = weechat_config_new_section (alias_config_file, "cmd", + NULL, NULL, + NULL, NULL, + &alias_config_write_default, NULL, + &alias_config_create_option, NULL); if (!ptr_section) { weechat_config_free (alias_config_file); return 0; } + alias_config_section_cmd = ptr_section; + return 1; } @@ -601,9 +680,17 @@ alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc, alias_name, argv_eol[2]); return WEECHAT_RC_ERROR; } + + /* create config option */ + weechat_config_new_option ( + alias_config_file, alias_config_section_cmd, + alias_name, "string", NULL, + NULL, 0, 0, argv_eol[2], NULL, NULL, + &alias_config_change_cb, NULL, + &alias_config_delete_cb, NULL); + weechat_printf (NULL, - _("%sAlias \"%s\" => \"%s\" created"), - weechat_prefix ("info"), + _("Alias \"%s\" => \"%s\" created"), alias_name, argv_eol[2]); } else @@ -616,14 +703,13 @@ alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc, weechat_printf (NULL, _("Alias:")); weechat_printf (NULL, " %s %s=>%s %s", ptr_alias->name, - weechat_color ("color_chat_delimiters"), - weechat_color ("color_chat"), + weechat_color ("chat_delimiters"), + weechat_color ("chat"), ptr_alias->command); } else weechat_printf (NULL, - _("%sNo alias found."), - weechat_prefix ("info")); + _("No alias found")); } } else @@ -639,8 +725,8 @@ alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc, weechat_printf (NULL, " %s %s=>%s %s", ptr_alias->name, - weechat_color ("color_chat_delimiters"), - weechat_color ("color_chat"), + weechat_color ("chat_delimiters"), + weechat_color ("chat"), ptr_alias->command); } } @@ -661,6 +747,7 @@ unalias_command_cb (void *data, struct t_gui_buffer *buffer, int argc, { char *alias_name; struct t_alias *ptr_alias; + struct t_config_option *ptr_option; /* make C compiler happy */ (void) data; @@ -677,15 +764,24 @@ unalias_command_cb (void *data, struct t_gui_buffer *buffer, int argc, _("%sAlias \"%s\" not found"), weechat_prefix ("error"), alias_name); - return -1; + return WEECHAT_RC_ERROR; } + + /* remove alias */ alias_free (ptr_alias); + + /* remove option */ + ptr_option = weechat_config_search_option (alias_config_file, + alias_config_section_cmd, + alias_name); + if (ptr_option) + weechat_config_option_free (alias_config_section_cmd, ptr_option); + weechat_printf (NULL, - _("%sAlias \"%s\" removed"), - weechat_prefix ("info"), + _("Alias \"%s\" removed"), alias_name); } - return 0; + return WEECHAT_RC_OK; } /* @@ -724,9 +820,8 @@ weechat_plugin_init (struct t_weechat_plugin *plugin) if (!alias_config_init ()) { weechat_printf (NULL, - "%s%s: error creating configuration file \"%s\"", - weechat_prefix("error"), "alias", - ALIAS_CONFIG_FILENAME); + "%s%s: error creating configuration file", + weechat_prefix("error"), "alias"); return WEECHAT_RC_ERROR; } alias_config_read (); diff --git a/src/plugins/alias/alias.h b/src/plugins/alias/alias.h index 2cb840cb5..9aed403ad 100644 --- a/src/plugins/alias/alias.h +++ b/src/plugins/alias/alias.h @@ -20,8 +20,6 @@ #ifndef __WEECHAT_ALIAS_H #define __WEECHAT_ALIAS_H 1 -#define ALIAS_CONFIG_FILENAME "alias.rc" - struct t_alias { struct t_hook *hook; /* command hook */ diff --git a/src/plugins/charset/Makefile.am b/src/plugins/charset/Makefile.am index 0c73d8057..0f5a770bb 100644 --- a/src/plugins/charset/Makefile.am +++ b/src/plugins/charset/Makefile.am @@ -20,6 +20,6 @@ libdir = ${weechat_libdir}/plugins lib_LTLIBRARIES = charset.la -charset_la_SOURCES = charset.c charset.h +charset_la_SOURCES = charset.c charset_la_LDFLAGS = -module charset_la_LIBADD = $(CHARSET_LFLAGS) diff --git a/src/plugins/charset/charset.c b/src/plugins/charset/charset.c index 81e71d6ec..4055d994b 100644 --- a/src/plugins/charset/charset.c +++ b/src/plugins/charset/charset.c @@ -28,7 +28,6 @@ #include <iconv.h> #include "../weechat-plugin.h" -#include "charset.h" WEECHAT_PLUGIN_NAME("charset"); @@ -36,14 +35,18 @@ WEECHAT_PLUGIN_DESCRIPTION("Charset plugin for WeeChat"); WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>"); WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION); WEECHAT_PLUGIN_WEECHAT_VERSION(WEECHAT_VERSION); -WEECHAT_PLUGIN_LICENSE("GPL"); +WEECHAT_PLUGIN_LICENSE("GPL3"); + +#define CHARSET_CONFIG_NAME "charset" struct t_weechat_plugin *weechat_charset_plugin = NULL; #define weechat_plugin weechat_charset_plugin struct t_config_file *charset_config_file = NULL; -struct t_charset *charset_list = NULL; -struct t_charset *last_charset = NULL; +struct t_config_option *charset_default_decode = NULL; +struct t_config_option *charset_default_encode = NULL; +struct t_config_section *charset_config_section_decode = NULL; +struct t_config_section *charset_config_section_encode = NULL; char *charset_terminal = NULL; char *charset_internal = NULL; @@ -65,112 +68,19 @@ charset_debug_cb (void *data, char *signal, char *type_data, void *signal_data) if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0) { if (weechat_strcasecmp ((char *)signal_data, "charset") == 0) + { charset_debug ^= 1; + if (charset_debug) + weechat_printf (NULL, _("%s: debug enabled"), "charset"); + else + weechat_printf (NULL, _("%s: debug disabled"), "charset"); + } } return WEECHAT_RC_OK; } /* - * charset_search: search a charset - */ - -struct t_charset * -charset_search (char *name) -{ - struct t_charset *ptr_charset; - - for (ptr_charset = charset_list; ptr_charset; - ptr_charset = ptr_charset->next_charset) - { - if (strcmp (name, ptr_charset->name) == 0) - return ptr_charset; - } - return NULL; -} - -/* - * charset_new: create new charset and add it to charset list - */ - -struct t_charset * -charset_new (char *name, char *charset) -{ - struct t_charset *new_charset, *ptr_charset; - - if (!name || !name[0] || !charset || !charset[0]) - return NULL; - - ptr_charset = charset_search (name); - if (ptr_charset) - { - if (ptr_charset->charset) - free (ptr_charset->charset); - ptr_charset->charset = strdup (charset); - return ptr_charset; - } - - new_charset = malloc (sizeof (*new_charset)); - { - new_charset->name = strdup (name); - new_charset->charset = strdup (charset); - - new_charset->prev_charset = last_charset; - new_charset->next_charset = NULL; - if (charset_list) - last_charset->next_charset = new_charset; - else - charset_list = new_charset; - last_charset = new_charset; - } - - return new_charset; -} - -/* - * charset_free: free a charset and remove it from list - */ - -void -charset_free (struct t_charset *charset) -{ - struct t_charset *new_charset_list; - - /* remove charset from list */ - if (last_charset == charset) - last_charset = charset->prev_charset; - if (charset->prev_charset) - { - (charset->prev_charset)->next_charset = charset->next_charset; - new_charset_list = charset_list; - } - else - new_charset_list = charset->next_charset; - if (charset->next_charset) - (charset->next_charset)->prev_charset = charset->prev_charset; - - /* free data */ - if (charset->name) - free (charset->name); - if (charset->charset) - free (charset->charset); - free (charset); - - charset_list = new_charset_list; -} - -/* - * charset_free_all: free all charsets - */ - -void -charset_free_all () -{ - while (charset_list) - charset_free (charset_list); -} - -/* * charset_config_reaload: reload charset configuration file */ @@ -179,84 +89,69 @@ charset_config_reload (void *data, struct t_config_file *config_file) { /* make C compiler happy */ (void) data; - (void) config_file; - charset_free_all (); - return weechat_config_reload (charset_config_file); + /* free all decode/encode charsets */ + weechat_config_section_free_options (charset_config_section_decode); + weechat_config_section_free_options (charset_config_section_encode); + + return weechat_config_reload (config_file); } /* - * charset_config_read_line: read a charset in configuration file + * charset_config_set_option: set a charset */ -void -charset_config_read_line (void *data, struct t_config_file *config_file, - char *option_name, char *value) +int +charset_config_create_option (void *data, struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, char *value) { + struct t_config_option *ptr_option; + int rc; + /* make C compiler happy */ (void) data; - (void) config_file; - if (option_name && value) + rc = 0; + + if (option_name) { - /* create new charset */ - if (!charset_new (option_name, value)) + ptr_option = weechat_config_search_option (config_file, section, + option_name); + if (ptr_option) { - weechat_printf (NULL, - _("%s%s: error creating charset \"%s\" => \"%s\""), - weechat_prefix ("error"), "charset", - option_name, value); + if (value && value[0]) + rc = weechat_config_option_set (ptr_option, value, 1); + else + { + weechat_config_option_free (section, ptr_option); + rc = 1; + } + } + else + { + if (value && value[0]) + { + ptr_option = weechat_config_new_option ( + config_file, section, + option_name, "string", NULL, + NULL, 0, 0, value, NULL, NULL, NULL, NULL, NULL, NULL); + rc = (ptr_option) ? 1 : 0; + } + else + rc = 1; } } -} - -/* - * charseet_config_write_section: write charset section in configuration file - * Return: 0 = successful - * -1 = write error - */ - -void -charset_config_write_section (void *data, struct t_config_file *config_file, - char *section_name) -{ - struct t_charset *ptr_charset; - /* make C compiler happy */ - (void) data; - - weechat_config_write_line (config_file, section_name, NULL); - - for (ptr_charset = charset_list; ptr_charset; - ptr_charset = ptr_charset->next_charset) + if (rc == 0) { - weechat_config_write_line (config_file, - ptr_charset->name, - "\"%s\"", - ptr_charset->charset); + weechat_printf (NULL, + _("%s%s: error creating charset \"%s\" => \"%s\""), + weechat_prefix ("error"), "charset", + option_name, value); } -} - -/* - * charset_config_write_default_aliases: write default charsets in configuration file - */ - -void -charset_config_write_default_charsets (void *data, - struct t_config_file *config_file, - char *section_name) -{ - /* make C compiler happy */ - (void) data; - weechat_config_write_line (config_file, section_name, NULL); - - if (charset_terminal && charset_internal - && (strcasecmp (charset_terminal, - charset_internal) != 0)) - weechat_config_write_line (config_file, "decode", "%s", charset_terminal); - else - weechat_config_write_line (config_file, "decode", "%s", "iso-8859-1"); + return rc; } /* @@ -269,24 +164,65 @@ charset_config_init () { struct t_config_section *ptr_section; - charset_config_file = weechat_config_new (CHARSET_CONFIG_FILENAME, + charset_config_file = weechat_config_new (CHARSET_CONFIG_NAME, &charset_config_reload, NULL); if (!charset_config_file) return 0; - ptr_section = weechat_config_new_section (charset_config_file, "charset", - &charset_config_read_line, - NULL, - &charset_config_write_section, - NULL, - &charset_config_write_default_charsets, - NULL); + ptr_section = weechat_config_new_section (charset_config_file, "default", + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL); + if (!ptr_section) + { + weechat_config_free (charset_config_file); + return 0; + } + + charset_default_decode = weechat_config_new_option ( + charset_config_file, ptr_section, + "decode", "string", + N_("global decoding charset"), + NULL, 0, 0, + (charset_terminal && charset_internal + && (strcasecmp (charset_terminal, + charset_internal) != 0)) ? + charset_terminal : "iso-8859-1", + NULL, NULL, NULL, NULL, NULL, NULL); + charset_default_encode = weechat_config_new_option ( + charset_config_file, ptr_section, + "encode", "string", + N_("global encoding charset"), + NULL, 0, 0, "", + NULL, NULL, NULL, NULL, NULL, NULL); + + ptr_section = weechat_config_new_section (charset_config_file, "decode", + NULL, NULL, + NULL, NULL, + NULL, NULL, + &charset_config_create_option, NULL); if (!ptr_section) { weechat_config_free (charset_config_file); return 0; } + charset_config_section_decode = ptr_section; + + ptr_section = weechat_config_new_section (charset_config_file, "encode", + NULL, NULL, + NULL, NULL, + NULL, NULL, + &charset_config_create_option, NULL); + if (!ptr_section) + { + weechat_config_free (charset_config_file); + return 0; + } + + charset_config_section_encode = ptr_section; + return 1; } @@ -332,173 +268,31 @@ charset_check (char *charset) } /* - * charset_parse_irc_msg: return nick, command, channel and position - * of arguments in IRC message - */ - -void -charset_parse_irc_msg (char *message, char **nick, char **command, - char **channel, char **pos_args) -{ - char *pos, *pos2, *pos3, *pos4, *pos_tmp; - - *nick = NULL; - *command = NULL; - *channel = NULL; - *pos_args = NULL; - - if (message[0] == ':') - { - pos = message + 1; - pos_tmp = strchr (pos, ' '); - if (pos_tmp) - pos_tmp[0] = '\0'; - pos2 = strchr (pos, '!'); - if (pos2) - *nick = weechat_strndup (pos, pos2 - pos); - else - { - pos2 = strchr (pos, ' '); - if (pos2) - *nick = weechat_strndup (pos, pos2 - pos); - } - if (pos_tmp) - pos_tmp[0] = ' '; - pos = strchr (message, ' '); - if (!pos) - pos = message; - } - else - pos = message; - - if (pos && pos[0]) - { - while (pos[0] == ' ') - pos++; - pos2 = strchr (pos, ' '); - if (pos2) - { - *command = weechat_strndup (pos, pos2 - pos); - pos2++; - while (pos2[0] == ' ') - pos2++; - *pos_args = pos2; - if (pos2[0] != ':') - { - if ((pos2[0] == '#') || (pos2[0] == '&') - || (pos2[0] == '+') || (pos2[0] == '!')) - { - pos3 = strchr (pos2, ' '); - if (pos3) - *channel = weechat_strndup (pos2, pos3 - pos2); - else - *channel = strdup (pos2); - } - else - { - pos3 = strchr (pos2, ' '); - if (!*nick) - { - if (pos3) - *nick = weechat_strndup (pos2, pos3 - pos2); - else - *nick = strdup (pos2); - } - if (pos3) - { - pos3++; - while (pos3[0] == ' ') - pos3++; - if ((pos3[0] == '#') || (pos3[0] == '&') - || (pos3[0] == '+') || (pos3[0] == '!')) - { - pos4 = strchr (pos3, ' '); - if (pos4) - *channel = weechat_strndup (pos3, pos4 - pos3); - else - *channel = strdup (pos3); - } - } - } - } - } - } -} - -/* - * charset_set: set a charset - * return 1 if ok, 0 if error - */ - -int -charset_set (char *name, char *charset) -{ - struct t_charset *ptr_charset; - - if (charset && charset[0]) - { - if (charset_new (name, charset)) - { - weechat_printf (NULL, - _("%sCharset \"%s\" => \"%s\""), - weechat_prefix ("info"), name, charset); - } - else - { - weechat_printf (NULL, - _("%s%s: error creating charset \"%s\" " - "=> \"%s\""), - weechat_prefix ("error"), "charset", name, charset); - return 0; - } - } - else - { - ptr_charset = charset_search (name); - if (!ptr_charset) - { - weechat_printf (NULL, - _("%s%s: charset \"%s\" not found"), - weechat_prefix ("error"), "charset", name); - return 0; - } - charset_free (ptr_charset); - weechat_printf (NULL, - _("%sCharset \"%s\" removed"), - weechat_prefix ("info"), name); - } - - return 1; -} - -/* * charset_get: read a charset in config file - * type is "decode" or "encode" * we first try with all arguments, then remove one by one * to find charset (from specific to general charset) */ char * -charset_get (char *type, char *name) +charset_get (struct t_config_section *section, char *name, + struct t_config_option *default_charset) { char *option_name, *ptr_end; - struct t_charset *ptr_charset; - int length; - - length = strlen (type) + 1 + strlen (name) + 1; - option_name = malloc (length); + struct t_config_option *ptr_option; + + option_name = strdup (name); if (option_name) { - snprintf (option_name, length, "%s.%s", - type, name); ptr_end = option_name + strlen (option_name); while (ptr_end >= option_name) { - ptr_charset = charset_search (option_name); - if (ptr_charset) + ptr_option = weechat_config_search_option (charset_config_file, + section, + option_name); + if (ptr_option) { free (option_name); - return ptr_charset->charset; + return weechat_config_string (ptr_option); } ptr_end--; while ((ptr_end >= option_name) && (ptr_end[0] != '.')) @@ -508,15 +302,22 @@ charset_get (char *type, char *name) if ((ptr_end >= option_name) && (ptr_end[0] == '.')) ptr_end[0] = '\0'; } - ptr_charset = charset_search (option_name); + ptr_option = weechat_config_search_option (charset_config_file, + section, + option_name); free (option_name); - if (ptr_charset) - return ptr_charset->charset; + if (ptr_option) + return weechat_config_string (ptr_option); } - /* nothing found => no decode/encode for this message! */ + /* nothing found => return default decode/encode charset (if set) */ + if (weechat_config_string (default_charset) + && weechat_config_string (default_charset)[0]) + return weechat_config_string (default_charset); + + /* no default charset set */ return NULL; } @@ -534,7 +335,15 @@ charset_decode (void *data, char *modifier, char *modifier_data, (void) data; (void) modifier; - charset = charset_get ("decode", modifier_data); + charset = charset_get (charset_config_section_decode, modifier_data, + charset_default_decode); + if (charset_debug) + { + weechat_printf (NULL, + "charset: debug: using 'decode' charset: %s " + "(modifier='%s', modifier_data='%s', string='%s')", + charset, modifier, modifier_data, string); + } if (charset && charset[0]) return weechat_iconv_to_internal (charset, string); @@ -555,7 +364,15 @@ charset_encode (void *data, char *modifier, char *modifier_data, (void) data; (void) modifier; - charset = charset_get ("encode", modifier_data); + charset = charset_get (charset_config_section_encode, modifier_data, + charset_default_encode); + if (charset_debug) + { + weechat_printf (NULL, + "charset: debug: using 'encode' charset: %s " + "(modifier='%s', modifier_data='%s', string='%s')", + charset, modifier, modifier_data, string); + } if (charset && charset[0]) return weechat_iconv_from_internal (charset, string); @@ -563,6 +380,29 @@ charset_encode (void *data, char *modifier, char *modifier_data, } /* + * charset_set: set a charset + */ + +void +charset_set (struct t_config_section *section, char *type, + char *name, char *value) +{ + if (charset_config_create_option (NULL, + charset_config_file, + section, + name, + value) > 0) + { + if (value && value[0]) + weechat_printf (NULL, _("Charset: %s, %s => %s"), + type, name, value); + else + weechat_printf (NULL, _("Charset: %s, %s: removed"), + type, name); + } +} + +/* * charset_command_cb: callback for /charset command */ @@ -570,75 +410,98 @@ int charset_command_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { - int charset_found, length, rc; - struct t_charset *ptr_charset; - char *option_name, *ptr_value; + struct t_config_section *ptr_section; + int length; + char *ptr_charset, *option_name, *plugin_name, *category, *name; /* make C compiler happy */ (void) data; - (void) buffer; - if ((argc > 2) && (strcmp (argv[2], "=") == 0)) + if (argc < 2) + { + weechat_printf (NULL, + _("%s%s: missing parameters"), + weechat_prefix ("error"), "charset"); + return WEECHAT_RC_ERROR; + } + + ptr_section = NULL; + + plugin_name = weechat_buffer_get_string (buffer, "plugin"); + category = weechat_buffer_get_string (buffer, "category"); + name = weechat_buffer_get_string (buffer, "name"); + + length = ((plugin_name) ? strlen (plugin_name) : 0) + 1 + + strlen (category) + 1 + strlen (name) + 1; + option_name = malloc (length); + if (!option_name) + return WEECHAT_RC_ERROR; + + snprintf (option_name, length, "%s%s%s.%s", + (plugin_name) ? plugin_name : "", + (plugin_name) ? "." : "", + category, + name); + + if ((argc > 1) && (weechat_strcasecmp (argv[1], "reset") == 0)) { - ptr_value = (argc > 3) ? argv_eol[3] : NULL; - if ((weechat_strncasecmp (argv[1], "decode.", 7) != 0) - && (weechat_strncasecmp (argv[1], "encode.", 7) != 0)) + charset_set (charset_config_section_decode, "decode", option_name, + NULL); + charset_set (charset_config_section_encode, "encode", option_name, + NULL); + } + else + { + if (argc > 2) { - length = strlen (argv[1]) + strlen ("decode.") + 1; - option_name = malloc (length); - if (option_name) + if (weechat_strcasecmp (argv[1], "decode") == 0) { - rc = 1; - snprintf (option_name, length, "decode.%s", argv[1]); - if (!charset_set (option_name, ptr_value)) - rc = 0; - snprintf (option_name, length, "encode.%s", argv[1]); - if (!charset_set (option_name, ptr_value)) - rc = 0; - if (!rc) - return WEECHAT_RC_ERROR; + ptr_section = charset_config_section_decode; + ptr_charset = argv_eol[2]; + } + else if (weechat_strcasecmp (argv[1], "encode") == 0) + { + ptr_section = charset_config_section_encode; + ptr_charset = argv_eol[2]; + } + if (!ptr_section) + { + weechat_printf (NULL, + _("%s%s: wrong charset type (decode or encode " + "expected)"), + weechat_prefix ("error"), "charset"); + if (option_name) + free (option_name); + return WEECHAT_RC_ERROR; } } else + ptr_charset = argv_eol[1]; + + if (!charset_check (ptr_charset)) { - if (!charset_set (argv[1], ptr_value)) - return WEECHAT_RC_ERROR; + weechat_printf (NULL, + _("%s%s: invalid charset: \"%s\""), + weechat_prefix ("error"), "charset", ptr_charset); + if (option_name) + free (option_name); + return WEECHAT_RC_ERROR; } - } - else - { - /* list all charsets */ - if (charset_list) + if (ptr_section) { - weechat_printf (NULL, ""); - if (argc == 1) - weechat_printf (NULL, _("List of charsets:")); - else - weechat_printf (NULL, _("List of charsets with \"%s\":"), - argv_eol[1]); - charset_found = 0; - for (ptr_charset = charset_list; ptr_charset; - ptr_charset = ptr_charset->next_charset) - { - if ((argc < 2) - || (weechat_strcasestr (ptr_charset->name, argv_eol[1]))) - { - charset_found = 1; - weechat_printf (NULL, - " %s %s=>%s %s", - ptr_charset->name, - weechat_color ("color_chat_delimiters"), - weechat_color ("color_chat"), - ptr_charset->charset); - } - } - if (!charset_found) - weechat_printf (NULL, _("No charset found")); + charset_set (ptr_section, argv[1], option_name, ptr_charset); } else - weechat_printf (NULL, _("No charset defined")); + { + charset_set (charset_config_section_decode, "decode", option_name, + ptr_charset); + charset_set (charset_config_section_encode, "encode", option_name, + ptr_charset); + } } + free (option_name); + return WEECHAT_RC_OK; } @@ -657,50 +520,36 @@ weechat_plugin_init (struct t_weechat_plugin *plugin) /* display message */ weechat_printf (NULL, - _("%s%s: terminal: %s, internal: %s"), - weechat_prefix ("info"), "charset", - charset_terminal, charset_internal); + _("%s: terminal: %s, internal: %s"), + "charset", charset_terminal, charset_internal); if (!charset_config_init ()) { weechat_printf (NULL, - _("%s%s: error creating configuration file \"%s\""), - weechat_prefix("error"), "charset", - CHARSET_CONFIG_FILENAME); + _("%s%s: error creating configuration file"), + weechat_prefix("error"), "charset"); return WEECHAT_RC_ERROR; } charset_config_read (); - /* add command handler */ + /* /charset command */ weechat_hook_command ("charset", - _("manage charsets"), - _("[[type.]plugin.string [= charset]]"), - _(" type: \"decode\" or \"encode\" (if type is " - "omitted, then both \"decode\" and \"encode\" are " - "set)\n" - " plugin: plugin name\n" - " string: string specific to plugin (for example " - "a server name or server.channel for IRC plugin)\n" - "charset: charset to use (if empty, then charset " - "is removed)\n\n" - "Examples :\n" - "/charset decode iso-8859-15 => set global " - "decode charset to iso-8859-15\n" - "/charset encode iso-8859-15 => set global " - "encode charset to iso-8859-15\n" - "/charset decode.irc.freenode => set decode " - "charset to iso-8859-15 for IRC server " - "\"freenode\" (all channels)\n" - "/charset decode.irc.freenode.#weechat => set " - "decode charset to iso-8859-15 for IRC channel " - "\"#weechat\" on server \"freenode\""), - "%(charset_name) %(charset)", + _("change charset for current buffer"), + _("[[decode | encode] charset] | [reset]"), + _(" decode: change decoding charset\n" + " encode: change encoding charset\n" + "charset: new charset for current buffer\n" + " reset: reset charsets for current buffer"), + "decode|encode|reset", &charset_command_cb, NULL); - /* add messge modifiers */ + /* modifiers hooks */ weechat_hook_modifier ("charset_decode", &charset_decode, NULL); weechat_hook_modifier ("charset_encode", &charset_encode, NULL); + /* callback for debug */ + weechat_hook_signal ("debug", &charset_debug_cb, NULL); + return WEECHAT_RC_OK; } @@ -715,7 +564,7 @@ weechat_plugin_end (struct t_weechat_plugin *plugin) (void) plugin; charset_config_write (); - charset_free_all (); + weechat_config_free (charset_config_file); return WEECHAT_RC_OK; diff --git a/src/plugins/charset/charset.h b/src/plugins/charset/charset.h deleted file mode 100644 index 248972587..000000000 --- a/src/plugins/charset/charset.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> - * See README for License detail, AUTHORS for developers list. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - - -#ifndef __WEECHAT_CHARSET_H -#define __WEECHAT_CHARSET_H 1 - -#define CHARSET_CONFIG_FILENAME "charset.rc" - -struct t_charset -{ - char *name; /* charset name (identifier) */ - char *charset; /* charset value for name */ - struct t_charset *prev_charset; /* link to previous charset */ - struct t_charset *next_charset; /* link to next charset */ -}; - -#endif /* charset.h */ diff --git a/src/plugins/debug/debug.c b/src/plugins/debug/debug.c index 6a3a5c30e..514b11fc0 100644 --- a/src/plugins/debug/debug.c +++ b/src/plugins/debug/debug.c @@ -30,7 +30,7 @@ WEECHAT_PLUGIN_DESCRIPTION("Debug plugin for WeeChat"); WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>"); WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION); WEECHAT_PLUGIN_WEECHAT_VERSION(WEECHAT_VERSION); -WEECHAT_PLUGIN_LICENSE("GPL"); +WEECHAT_PLUGIN_LICENSE("GPL3"); struct t_weechat_plugin *weechat_debug_plugin = NULL; #define weechat_plugin weechat_debug_plugin diff --git a/src/plugins/demo/demo.c b/src/plugins/demo/demo.c index 36c600868..f8a4620bc 100644 --- a/src/plugins/demo/demo.c +++ b/src/plugins/demo/demo.c @@ -36,7 +36,7 @@ WEECHAT_PLUGIN_DESCRIPTION("Demo plugin for WeeChat"); WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>"); WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION); WEECHAT_PLUGIN_WEECHAT_VERSION(WEECHAT_VERSION); -WEECHAT_PLUGIN_LICENSE("GPL"); +WEECHAT_PLUGIN_LICENSE("GPL3"); struct t_weechat_plugin *weechat_demo_plugin = NULL; #define weechat_plugin weechat_demo_plugin @@ -91,19 +91,16 @@ demo_printf_command_cb (void *data, struct t_gui_buffer *buffer, int argc, weechat_printf (buffer, _("demo message without prefix")); weechat_printf (buffer, - _("%sdemo message with info prefix"), - weechat_prefix ("info")); - weechat_printf (buffer, _("%sdemo message with error prefix"), weechat_prefix ("error")); weechat_printf (buffer, _("colors: %s buffer %s nick1 %s nick2 %s nick3 " "%s nick4"), - weechat_color ("color_chat_buffer"), - weechat_color ("color_chat_nick_color1"), - weechat_color ("color_chat_nick_color2"), - weechat_color ("color_chat_nick_color3"), - weechat_color ("color_chat_nick_color4")); + weechat_color ("chat_buffer"), + weechat_color ("chat_nick_color1"), + weechat_color ("chat_nick_color2"), + weechat_color ("chat_nick_color3"), + weechat_color ("chat_nick_color4")); } return WEECHAT_RC_OK; @@ -342,8 +339,7 @@ demo_info_command_cb (void *data, struct t_gui_buffer *buffer, int argc, (void) argv_eol; if (argc > 1) - weechat_printf (NULL, "%sinfo \"%s\" = \"%s\"", - weechat_prefix ("info"), + weechat_printf (NULL, "info \"%s\" = \"%s\"", argv[1], weechat_info_get (argv[1])); else diff --git a/src/plugins/fifo/fifo.c b/src/plugins/fifo/fifo.c index b79692c15..5e92498ed 100644 --- a/src/plugins/fifo/fifo.c +++ b/src/plugins/fifo/fifo.c @@ -35,7 +35,7 @@ WEECHAT_PLUGIN_DESCRIPTION("Fifo plugin for WeeChat"); WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>"); WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION); WEECHAT_PLUGIN_WEECHAT_VERSION(WEECHAT_VERSION); -WEECHAT_PLUGIN_LICENSE("GPL"); +WEECHAT_PLUGIN_LICENSE("GPL3"); struct t_weechat_plugin *weechat_fifo_plugin = NULL; #define weechat_plugin weechat_fifo_plugin @@ -94,8 +94,8 @@ fifo_create () O_RDONLY | O_NONBLOCK)) != -1) { weechat_printf (NULL, - _("%s%s: pipe open"), - weechat_prefix ("info"), "fifo"), + _("%s: pipe open"), + "fifo"), rc = 1; } else @@ -148,8 +148,8 @@ fifo_remove () } weechat_printf (NULL, - _("%s%s: pipe closed"), - weechat_prefix ("info"), "fifo"); + _("%s: pipe closed"), + "fifo"); } /* @@ -320,11 +320,10 @@ fifo_read () */ int -fifo_config_cb (void *data, char *type, char *option, char *value) +fifo_config_cb (void *data, char *option, char *value) { /* make C compiler happy */ (void) data; - (void) type; (void) option; if (weechat_strcasecmp (value, "on") == 0) @@ -354,7 +353,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin) fifo_fd_hook = weechat_hook_fd (fifo_fd, 1, 0, 0, &fifo_read, NULL); - weechat_hook_config ("plugin", "fifo.fifo", &fifo_config_cb, NULL); + weechat_hook_config ("plugins.var.fifo.fifo", &fifo_config_cb, NULL); return WEECHAT_RC_OK; } diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index a838786a8..f7b6614e1 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -70,15 +70,15 @@ irc_channel_new (struct t_irc_server *server, int channel_type, weechat_buffer_set (new_buffer, "nicklist", "1"); weechat_buffer_set (new_buffer, "nicklist_display_groups", "0"); weechat_nicklist_add_group (new_buffer, NULL, IRC_NICK_GROUP_OP, - "color_nicklist_group", 1); + "nicklist_group", 1); weechat_nicklist_add_group (new_buffer, NULL, IRC_NICK_GROUP_HALFOP, - "color_nicklist_group", 1); + "nicklist_group", 1); weechat_nicklist_add_group (new_buffer, NULL, IRC_NICK_GROUP_VOICE, - "color_nicklist_group", 1); + "nicklist_group", 1); weechat_nicklist_add_group (new_buffer, NULL, IRC_NICK_GROUP_CHANUSER, - "color_nicklist_group", 1); + "nicklist_group", 1); weechat_nicklist_add_group (new_buffer, NULL, IRC_NICK_GROUP_NORMAL, - "color_nicklist_group", 1); + "nicklist_group", 1); } /* initialize new channel */ @@ -324,8 +324,8 @@ irc_channel_check_away (struct t_irc_server *server, if (channel->type == IRC_CHANNEL_TYPE_CHANNEL) { if (force - || (weechat_config_integer (irc_config_irc_away_check_max_nicks) == 0) - || (channel->nicks_count <= weechat_config_integer (irc_config_irc_away_check_max_nicks))) + || (weechat_config_integer (irc_config_network_away_check_max_nicks) == 0) + || (channel->nicks_count <= weechat_config_integer (irc_config_network_away_check_max_nicks))) { channel->checking_away++; irc_server_sendf (server, "WHO %s", channel->name); diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 072068883..7b14bb576 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -269,11 +269,11 @@ irc_command_away_server (struct t_irc_server *server, char *arguments) server->is_away = 1; server->away_time = time (NULL); irc_server_sendf (server, "AWAY :%s", arguments); - if (weechat_config_integer (irc_config_irc_display_away) != IRC_CONFIG_DISPLAY_AWAY_OFF) + if (weechat_config_integer (irc_config_look_display_away) != IRC_CONFIG_DISPLAY_AWAY_OFF) { string = (char *)irc_color_decode ((unsigned char *)arguments, 1, 0); - if (weechat_config_integer (irc_config_irc_display_away) == IRC_CONFIG_DISPLAY_AWAY_LOCAL) + if (weechat_config_integer (irc_config_look_display_away) == IRC_CONFIG_DISPLAY_AWAY_LOCAL) irc_display_away (server, "away", (string) ? string : arguments); else @@ -302,8 +302,8 @@ irc_command_away_server (struct t_irc_server *server, char *arguments) string = (char *)irc_color_decode ((unsigned char *)arguments, 1, 0); weechat_printf (server->buffer, - _("%s%s: future away on %s%s%s: %s"), - weechat_prefix ("info"), "irc", + _("%s: future away on %s%s%s: %s"), + "irc", IRC_COLOR_CHAT_SERVER, server->name, IRC_COLOR_CHAT, @@ -331,9 +331,9 @@ irc_command_away_server (struct t_irc_server *server, char *arguments) elapsed = (time_now >= server->away_time) ? time_now - server->away_time : 0; server->away_time = 0; - if (weechat_config_integer (irc_config_irc_display_away) != IRC_CONFIG_DISPLAY_AWAY_OFF) + if (weechat_config_integer (irc_config_look_display_away) != IRC_CONFIG_DISPLAY_AWAY_OFF) { - if (weechat_config_integer (irc_config_irc_display_away) == IRC_CONFIG_DISPLAY_AWAY_LOCAL) + if (weechat_config_integer (irc_config_look_display_away) == IRC_CONFIG_DISPLAY_AWAY_LOCAL) { snprintf (buffer, sizeof (buffer), "gone %.2ld:%.2ld:%.2ld", @@ -360,8 +360,8 @@ irc_command_away_server (struct t_irc_server *server, char *arguments) /* server not connected, remove away message but do not send anything */ weechat_printf (server->buffer, - _("%s%s: future away on %s%s%s removed"), - weechat_prefix ("info"), "irc", + _("%s: future away on %s%s%s removed"), + "irc", IRC_COLOR_CHAT_SERVER, server->name, IRC_COLOR_CHAT); @@ -624,10 +624,10 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc, if (ptr_server) { weechat_printf (NULL, - _("%s%s: server %s%s%s created " + _("%s: server %s%s%s created " "(temporary server, " "NOT SAVED!)"), - weechat_prefix ("info"), "irc", + "irc", IRC_COLOR_CHAT_SERVER, server_tmp.name, IRC_COLOR_CHAT); @@ -831,9 +831,9 @@ irc_command_cycle (void *data, struct t_gui_buffer *buffer, int argc, } ptr_arg = (pos_args) ? pos_args : - (weechat_config_string (irc_config_irc_default_msg_part) - && weechat_config_string (irc_config_irc_default_msg_part)[0]) ? - weechat_config_string (irc_config_irc_default_msg_part) : NULL; + (weechat_config_string (irc_config_network_default_msg_part) + && weechat_config_string (irc_config_network_default_msg_part)[0]) ? + weechat_config_string (irc_config_network_default_msg_part) : NULL; if (ptr_arg) { @@ -1064,9 +1064,9 @@ irc_command_quit_server (struct t_irc_server *server, char *arguments) if (server->is_connected) { ptr_arg = (arguments) ? arguments : - (weechat_config_string (irc_config_irc_default_msg_quit) - && weechat_config_string (irc_config_irc_default_msg_quit)[0]) ? - weechat_config_string (irc_config_irc_default_msg_quit) : NULL; + (weechat_config_string (irc_config_network_default_msg_quit) + && weechat_config_string (irc_config_network_default_msg_quit)[0]) ? + weechat_config_string (irc_config_network_default_msg_quit) : NULL; if (ptr_arg) { @@ -1105,8 +1105,8 @@ irc_command_disconnect_one_server (struct t_irc_server *server) if (server->reconnect_start > 0) { weechat_printf (server->buffer, - _("%s%s: auto-reconnection is cancelled"), - weechat_prefix ("info"), "irc"); + _("%s: auto-reconnection is cancelled"), + "irc"); } irc_command_quit_server (server, NULL); irc_server_disconnect (server, 0); @@ -2107,9 +2107,9 @@ irc_command_part_channel (struct t_irc_server *server, char *channel_name, char *ptr_arg, *buf, *version; ptr_arg = (part_message) ? part_message : - (weechat_config_string (irc_config_irc_default_msg_part) - && weechat_config_string (irc_config_irc_default_msg_part)[0]) ? - weechat_config_string (irc_config_irc_default_msg_part) : NULL; + (weechat_config_string (irc_config_network_default_msg_part) + && weechat_config_string (irc_config_network_default_msg_part)[0]) ? + weechat_config_string (irc_config_network_default_msg_part) : NULL; if (ptr_arg) { @@ -2560,328 +2560,343 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc, _("No server found with \"%s\""), server_name); } + + return WEECHAT_RC_OK; } - else + + /* TODO: fix server command */ + weechat_printf (NULL, + "%sSome server options are temporarirly disabled in " + "this version, you can use /set irc.server.xxxx.yyyy = zzzz " + "and /reload command to reload options from irc.conf", + weechat_prefix ("error")); + return WEECHAT_RC_ERROR; + + if (weechat_strcasecmp (argv[1], "add") == 0) { - if (weechat_strcasecmp (argv[1], "add") == 0) + if (argc < 4) { - if (argc < 4) - { - IRC_COMMAND_TOO_FEW_ARGUMENTS(NULL, "server add"); - } - if (irc_server_search (argv[2])) - { - weechat_printf (NULL, - _("%s%s: server \"%s\" already exists, " - "can't create it!"), - weechat_prefix ("error"), "irc", argv[2]); - return WEECHAT_RC_ERROR; - } - - /* init server struct */ - irc_server_init (&server_tmp); - - server_tmp.name = strdup (argv[2]); - server_tmp.addresses = strdup (argv[3]); - - /* parse arguments */ - for (i = 4; i < argc; i++) + IRC_COMMAND_TOO_FEW_ARGUMENTS(NULL, "server add"); + } + if (irc_server_search (argv[2])) + { + weechat_printf (NULL, + _("%s%s: server \"%s\" already exists, " + "can't create it!"), + weechat_prefix ("error"), "irc", argv[2]); + return WEECHAT_RC_ERROR; + } + + /* init server struct */ + irc_server_init (&server_tmp); + + server_tmp.name = strdup (argv[2]); + server_tmp.addresses = strdup (argv[3]); + + /* parse arguments */ + for (i = 4; i < argc; i++) + { + if (argv[i][0] == '-') { - if (argv[i][0] == '-') + if (weechat_strcasecmp (argv[i], "-temp") == 0) + server_tmp.temp_server = 1; + if (weechat_strcasecmp (argv[i], "-auto") == 0) + server_tmp.autoconnect = 1; + if (weechat_strcasecmp (argv[i], "-noauto") == 0) + server_tmp.autoconnect = 0; + if (weechat_strcasecmp (argv[i], "-ipv6") == 0) + server_tmp.ipv6 = 1; + if (weechat_strcasecmp (argv[i], "-ssl") == 0) + server_tmp.ssl = 1; + if (weechat_strcasecmp (argv[i], "-pwd") == 0) { - if (weechat_strcasecmp (argv[i], "-temp") == 0) - server_tmp.temp_server = 1; - if (weechat_strcasecmp (argv[i], "-auto") == 0) - server_tmp.autoconnect = 1; - if (weechat_strcasecmp (argv[i], "-noauto") == 0) - server_tmp.autoconnect = 0; - if (weechat_strcasecmp (argv[i], "-ipv6") == 0) - server_tmp.ipv6 = 1; - if (weechat_strcasecmp (argv[i], "-ssl") == 0) - server_tmp.ssl = 1; - if (weechat_strcasecmp (argv[i], "-pwd") == 0) + if (i == (argc - 1)) { - if (i == (argc - 1)) - { - weechat_printf (NULL, - _("%s%s: missing argument for " - "\"%s\" option"), - weechat_prefix ("error"), "irc", - "-pwd"); - irc_server_free_data (&server_tmp); - return WEECHAT_RC_ERROR; - } - server_tmp.password = strdup (argv[++i]); + weechat_printf (NULL, + _("%s%s: missing argument for " + "\"%s\" option"), + weechat_prefix ("error"), "irc", + "-pwd"); + irc_server_free_data (&server_tmp); + return WEECHAT_RC_ERROR; } - if (weechat_strcasecmp (argv[i], "-nicks") == 0) + server_tmp.password = strdup (argv[++i]); + } + if (weechat_strcasecmp (argv[i], "-nicks") == 0) + { + if (i == (argc - 1)) { - if (i == (argc - 1)) - { - weechat_printf (NULL, - _("%s%s: missing argument for " - "\"%s\" option"), - weechat_prefix ("error"), "irc", - "-nicks"); - irc_server_free_data (&server_tmp); - return WEECHAT_RC_ERROR; - } - server_tmp.nicks = strdup (argv[++i]); + weechat_printf (NULL, + _("%s%s: missing argument for " + "\"%s\" option"), + weechat_prefix ("error"), "irc", + "-nicks"); + irc_server_free_data (&server_tmp); + return WEECHAT_RC_ERROR; } - if (weechat_strcasecmp (argv[i], "-username") == 0) + server_tmp.nicks = strdup (argv[++i]); + } + if (weechat_strcasecmp (argv[i], "-username") == 0) + { + if (i == (argc - 1)) { - if (i == (argc - 1)) - { - weechat_printf (NULL, - _("%s%s: missing argument for " - "\"%s\" option"), - weechat_prefix ("error"), "irc", - "-username"); - irc_server_free_data (&server_tmp); - return WEECHAT_RC_ERROR; - } - server_tmp.username = strdup (argv[++i]); + weechat_printf (NULL, + _("%s%s: missing argument for " + "\"%s\" option"), + weechat_prefix ("error"), "irc", + "-username"); + irc_server_free_data (&server_tmp); + return WEECHAT_RC_ERROR; } - if (weechat_strcasecmp (argv[i], "-realname") == 0) + server_tmp.username = strdup (argv[++i]); + } + if (weechat_strcasecmp (argv[i], "-realname") == 0) + { + if (i == (argc - 1)) { - if (i == (argc - 1)) - { - weechat_printf (NULL, - _("%s%s: missing argument for " - "\"%s\" option"), - weechat_prefix ("error"), "irc", - "-realname"); - irc_server_free_data (&server_tmp); - return WEECHAT_RC_ERROR; - } - server_tmp.realname = strdup (argv[++i]); + weechat_printf (NULL, + _("%s%s: missing argument for " + "\"%s\" option"), + weechat_prefix ("error"), "irc", + "-realname"); + irc_server_free_data (&server_tmp); + return WEECHAT_RC_ERROR; } - if (weechat_strcasecmp (argv[i], "-autojoin") == 0) + server_tmp.realname = strdup (argv[++i]); + } + if (weechat_strcasecmp (argv[i], "-autojoin") == 0) + { + if (i == (argc - 1)) { - if (i == (argc - 1)) - { - weechat_printf (NULL, - _("%s%s: missing argument for " - "\"%s\" option"), - weechat_prefix ("error"), "irc", - "-autojoin"); - irc_server_free_data (&server_tmp); - return WEECHAT_RC_ERROR; - } - server_tmp.autojoin = strdup (argv[++i]); + weechat_printf (NULL, + _("%s%s: missing argument for " + "\"%s\" option"), + weechat_prefix ("error"), "irc", + "-autojoin"); + irc_server_free_data (&server_tmp); + return WEECHAT_RC_ERROR; } + server_tmp.autojoin = strdup (argv[++i]); } } - - /* create new server */ - new_server = irc_server_new (server_tmp.name, - server_tmp.autoconnect, - server_tmp.autoreconnect, - server_tmp.autoreconnect_delay, - server_tmp.temp_server, - server_tmp.addresses, - server_tmp.ipv6, - server_tmp.ssl, - server_tmp.password, - server_tmp.nicks, - server_tmp.username, - server_tmp.realname, - server_tmp.hostname, - server_tmp.command, - 1, /* command_delay */ - server_tmp.autojoin, - 1, /* autorejoin */ - NULL); - if (new_server) - { - weechat_printf (NULL, - _("%s%s: server %s%s%s created"), - weechat_prefix ("info"), "irc", - IRC_COLOR_CHAT_SERVER, - server_tmp.name, - IRC_COLOR_CHAT); - } - else - { - weechat_printf (NULL, - _("%s%s: unable to create server"), - weechat_prefix ("error"), "irc"); - irc_server_free_data (&server_tmp); - return WEECHAT_RC_ERROR; - } - - if (new_server->autoconnect) - irc_server_connect (new_server, 0); - + } + + /* create new server */ + new_server = irc_server_new (server_tmp.name, + server_tmp.autoconnect, + server_tmp.autoreconnect, + server_tmp.autoreconnect_delay, + server_tmp.temp_server, + server_tmp.addresses, + server_tmp.ipv6, + server_tmp.ssl, + server_tmp.password, + server_tmp.nicks, + server_tmp.username, + server_tmp.realname, + server_tmp.hostname, + server_tmp.command, + 1, /* command_delay */ + server_tmp.autojoin, + 1, /* autorejoin */ + NULL); + if (new_server) + { + weechat_printf (NULL, + _("%s: server %s%s%s created"), + "irc", + IRC_COLOR_CHAT_SERVER, + server_tmp.name, + IRC_COLOR_CHAT); + } + else + { + weechat_printf (NULL, + _("%s%s: unable to create server"), + weechat_prefix ("error"), "irc"); irc_server_free_data (&server_tmp); + return WEECHAT_RC_ERROR; } - else if (weechat_strcasecmp (argv[1], "copy") == 0) + + if (new_server->autoconnect) + irc_server_connect (new_server, 0); + + irc_server_free_data (&server_tmp); + + return WEECHAT_RC_OK; + } + + if (weechat_strcasecmp (argv[1], "copy") == 0) + { + if (argc < 4) { - if (argc < 4) - { - IRC_COMMAND_TOO_FEW_ARGUMENTS(NULL, "server copy"); - } - - /* look for server by name */ - server_found = irc_server_search (argv[2]); - if (!server_found) - { - weechat_printf (NULL, - _("%s%s: server \"%s\" not found for " - "\"%s\" command"), - weechat_prefix ("error"), "irc", - argv[2], "server copy"); - return WEECHAT_RC_ERROR; - } - - /* check if target name already exists */ - if (irc_server_search (argv[3])) - { - weechat_printf (NULL, - _("%s%s: server \"%s\" already exists for " - "\"%s\" command"), - weechat_prefix ("error"), "irc", - argv[3], "server copy"); - return WEECHAT_RC_ERROR; - } - - /* duplicate server */ - new_server = irc_server_duplicate (server_found, argv[3]); - if (new_server) - { - weechat_printf (NULL, - _("%s%s: Server %s%s%s has been copied to " - "%s%s"), - weechat_prefix ("info"), "irc", - IRC_COLOR_CHAT_SERVER, - argv[2], - IRC_COLOR_CHAT, - IRC_COLOR_CHAT_SERVER, - argv[3]); - //gui_window_redraw_all_buffers (); - return WEECHAT_RC_OK; - } - + IRC_COMMAND_TOO_FEW_ARGUMENTS(NULL, "server copy"); + } + + /* look for server by name */ + server_found = irc_server_search (argv[2]); + if (!server_found) + { + weechat_printf (NULL, + _("%s%s: server \"%s\" not found for " + "\"%s\" command"), + weechat_prefix ("error"), "irc", + argv[2], "server copy"); return WEECHAT_RC_ERROR; } - else if (weechat_strcasecmp (argv[1], "rename") == 0) + + /* check if target name already exists */ + if (irc_server_search (argv[3])) { - if (argc < 4) - { - IRC_COMMAND_TOO_FEW_ARGUMENTS(NULL, "server rename"); - } - - /* look for server by name */ - server_found = irc_server_search (argv[2]); - if (!server_found) - { - weechat_printf (NULL, - _("%s%s: server \"%s\" not found for " - "\"%s\" command"), - weechat_prefix ("error"), "irc", - argv[2], "server rename"); - return WEECHAT_RC_ERROR; - } - - /* check if target name already exists */ - if (irc_server_search (argv[3])) - { - weechat_printf (NULL, - _("%s%s: server \"%s\" already exists for " - "\"%s\" command"), - weechat_prefix ("error"), "irc", - argv[3], "server rename"); - return WEECHAT_RC_ERROR; - } - - /* rename server */ - if (irc_server_rename (server_found, argv[3])) - { - weechat_printf (NULL, - _("%s%s: server %s%s%s has been renamed to " - "%s%s"), - weechat_prefix ("info"), "irc", - IRC_COLOR_CHAT_SERVER, - argv[2], - IRC_COLOR_CHAT, - IRC_COLOR_CHAT_SERVER, - argv[3]); - //gui_window_redraw_all_buffers (); - return WEECHAT_RC_OK; - } - + weechat_printf (NULL, + _("%s%s: server \"%s\" already exists for " + "\"%s\" command"), + weechat_prefix ("error"), "irc", + argv[3], "server copy"); return WEECHAT_RC_ERROR; } - else if (weechat_strcasecmp (argv[1], "keep") == 0) + + /* duplicate server */ + new_server = irc_server_duplicate (server_found, argv[3]); + if (new_server) { - if (argc < 3) - { - IRC_COMMAND_TOO_FEW_ARGUMENTS(NULL, "server rename"); - } - - /* look for server by name */ - server_found = irc_server_search (argv[2]); - if (!server_found) - { - weechat_printf (NULL, - _("%s%s: server \"%s\" not found for " - "\"%s\" command"), - weechat_prefix ("error"), "irc", - argv[2], "server keep"); - return WEECHAT_RC_ERROR; - } - - /* check that it is temporary server */ - if (!server_found->temp_server) - { - weechat_printf (NULL, - _("%s%s: server \"%s\" is not a temporary " - "server"), - weechat_prefix ("error"), "irc", argv[2]); - return WEECHAT_RC_ERROR; - } - - /* remove temporary flag on server */ - server_found->temp_server = 0; - weechat_printf (NULL, - _("%s%s: server %s%s%s is not temporary any " - "more"), - weechat_prefix ("info"), "irc", + _("%s: server %s%s%s has been copied to " + "%s%s"), + "irc", IRC_COLOR_CHAT_SERVER, argv[2], - IRC_COLOR_CHAT); - + IRC_COLOR_CHAT, + IRC_COLOR_CHAT_SERVER, + argv[3]); + //gui_window_redraw_all_buffers (); return WEECHAT_RC_OK; } - else if (weechat_strcasecmp (argv[1], "del") == 0) + + return WEECHAT_RC_ERROR; + } + + if (weechat_strcasecmp (argv[1], "rename") == 0) + { + if (argc < 4) { - if (argc < 3) - { - IRC_COMMAND_TOO_FEW_ARGUMENTS(NULL, "server del"); - } - - /* look for server by name */ - server_found = irc_server_search (argv[2]); - if (!server_found) - { - weechat_printf (NULL, - _("%s%s: server \"%s\" not found for " - "\"%s\" command"), - weechat_prefix ("error"), "irc", - argv[2], "server del"); - return WEECHAT_RC_ERROR; - } - if (server_found->is_connected) - { - weechat_printf (NULL, - _("%s%s: you can not delete server \"%s\" " - "because you are connected to. " - "Try \"/disconnect %s\" before."), - weechat_prefix ("error"), "irc", - argv[2], argv[2]); - return WEECHAT_RC_ERROR; + IRC_COMMAND_TOO_FEW_ARGUMENTS(NULL, "server rename"); + } + + /* look for server by name */ + server_found = irc_server_search (argv[2]); + if (!server_found) + { + weechat_printf (NULL, + _("%s%s: server \"%s\" not found for " + "\"%s\" command"), + weechat_prefix ("error"), "irc", + argv[2], "server rename"); + return WEECHAT_RC_ERROR; + } + + /* check if target name already exists */ + if (irc_server_search (argv[3])) + { + weechat_printf (NULL, + _("%s%s: server \"%s\" already exists for " + "\"%s\" command"), + weechat_prefix ("error"), "irc", + argv[3], "server rename"); + return WEECHAT_RC_ERROR; + } + + /* rename server */ + if (irc_server_rename (server_found, argv[3])) + { + weechat_printf (NULL, + _("%s: server %s%s%s has been renamed to " + "%s%s"), + "irc", + IRC_COLOR_CHAT_SERVER, + argv[2], + IRC_COLOR_CHAT, + IRC_COLOR_CHAT_SERVER, + argv[3]); + //gui_window_redraw_all_buffers (); + return WEECHAT_RC_OK; + } + + return WEECHAT_RC_ERROR; + } + + if (weechat_strcasecmp (argv[1], "keep") == 0) + { + if (argc < 3) + { + IRC_COMMAND_TOO_FEW_ARGUMENTS(NULL, "server rename"); + } + + /* look for server by name */ + server_found = irc_server_search (argv[2]); + if (!server_found) + { + weechat_printf (NULL, + _("%s%s: server \"%s\" not found for " + "\"%s\" command"), + weechat_prefix ("error"), "irc", + argv[2], "server keep"); + return WEECHAT_RC_ERROR; + } + + /* check that it is temporary server */ + if (!server_found->temp_server) + { + weechat_printf (NULL, + _("%s%s: server \"%s\" is not a temporary " + "server"), + weechat_prefix ("error"), "irc", argv[2]); + return WEECHAT_RC_ERROR; + } + + /* remove temporary flag on server */ + server_found->temp_server = 0; + + weechat_printf (NULL, + _("%s: server %s%s%s is not temporary any " + "more"), + "irc", + IRC_COLOR_CHAT_SERVER, + argv[2], + IRC_COLOR_CHAT); + + return WEECHAT_RC_OK; + } + + if (weechat_strcasecmp (argv[1], "del") == 0) + { + if (argc < 3) + { + IRC_COMMAND_TOO_FEW_ARGUMENTS(NULL, "server del"); + } + + /* look for server by name */ + server_found = irc_server_search (argv[2]); + if (!server_found) + { + weechat_printf (NULL, + _("%s%s: server \"%s\" not found for " + "\"%s\" command"), + weechat_prefix ("error"), "irc", + argv[2], "server del"); + return WEECHAT_RC_ERROR; + } + if (server_found->is_connected) + { + weechat_printf (NULL, + _("%s%s: you can not delete server \"%s\" " + "because you are connected to. " + "Try \"/disconnect %s\" before."), + weechat_prefix ("error"), "irc", + argv[2], argv[2]); + return WEECHAT_RC_ERROR; } - + /* for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer) @@ -2894,48 +2909,44 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc, } } */ - - server_name = strdup (server_found->name); - - irc_server_free (server_found); - - weechat_printf (NULL, - _("%s%s: Server %s%s%s has been deleted"), - weechat_prefix ("info"), "irc", - IRC_COLOR_CHAT_SERVER, - (server_name) ? server_name : "???", - IRC_COLOR_CHAT); - if (server_name) - free (server_name); - - //gui_window_redraw_buffer (window->buffer); - - return WEECHAT_RC_OK; - } - else if (weechat_strcasecmp (argv[1], "deloutq") == 0) - { - for (ptr_server = irc_servers; ptr_server; - ptr_server = ptr_server->next_server) - { - irc_server_outqueue_free_all (ptr_server); - } - weechat_printf (NULL, - _("%s%s: messages outqueue DELETED for all " - "servers. Some messages from you or " - "WeeChat may have been lost!"), - weechat_prefix ("info"), "irc"); - return WEECHAT_RC_OK; - } - else + + server_name = strdup (server_found->name); + + irc_server_free (server_found); + + weechat_printf (NULL, + _("%s: Server %s%s%s has been deleted"), + "irc", + IRC_COLOR_CHAT_SERVER, + (server_name) ? server_name : "???", + IRC_COLOR_CHAT); + if (server_name) + free (server_name); + + //gui_window_redraw_buffer (window->buffer); + + return WEECHAT_RC_OK; + } + + if (weechat_strcasecmp (argv[1], "deloutq") == 0) + { + for (ptr_server = irc_servers; ptr_server; + ptr_server = ptr_server->next_server) { - weechat_printf (NULL, - _("%s%s: unknown option for \"%s\" command"), - weechat_prefix ("error"), "irc", "server"); - return WEECHAT_RC_ERROR; + irc_server_outqueue_free_all (ptr_server); } + weechat_printf (NULL, + _("%s: messages outqueue DELETED for all " + "servers. Some messages from you or " + "WeeChat may have been lost!"), + "irc"); + return WEECHAT_RC_OK; } - - return WEECHAT_RC_OK; + + weechat_printf (NULL, + _("%s%s: unknown option for \"%s\" command"), + weechat_prefix ("error"), "irc", "server"); + return WEECHAT_RC_ERROR; } /* diff --git a/src/plugins/irc/irc-completion.c b/src/plugins/irc/irc-completion.c index 4089c3fb5..62a85723d 100644 --- a/src/plugins/irc/irc-completion.c +++ b/src/plugins/irc/irc-completion.c @@ -171,7 +171,7 @@ irc_completion_channel_nicks_cb (void *data, char *completion, } /* add nicks speaking recently on this channel */ - if (weechat_config_boolean (irc_config_irc_nick_completion_smart)) + if (weechat_config_boolean (irc_config_look_nick_completion_smart)) { list_size = weechat_list_size (ptr_channel->nicks_speaking); for (i = 0; i < list_size; i++) @@ -320,11 +320,11 @@ irc_completion_msg_part_cb (void *data, char *completion, (void) completion; (void) buffer; - if (weechat_config_string (irc_config_irc_default_msg_part) - && weechat_config_string (irc_config_irc_default_msg_part)[0]) + if (weechat_config_string (irc_config_network_default_msg_part) + && weechat_config_string (irc_config_network_default_msg_part)[0]) { weechat_list_add (list, - weechat_config_string (irc_config_irc_default_msg_part), + weechat_config_string (irc_config_network_default_msg_part), WEECHAT_LIST_POS_SORT); } diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index 18f857e34..9062a8b60 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -21,6 +21,7 @@ #include <stdlib.h> #include <unistd.h> +#include <stdio.h> #include <string.h> #include <limits.h> #include <pwd.h> @@ -32,30 +33,45 @@ #include "irc-server.h" +char *irc_config_server_option_str[IRC_CONFIG_NUM_SERVER_OPTIONS] = +{ "autoconnect", "autoreconnect", "autoreconnect_delay", "addresses", "ipv6", + "ssl", "password", "nicks", "username", "realname", "hostname", "command", + "command_delay", "autojoin", "autorejoin", "notify_levels" +}; +char *irc_config_server_option_default[IRC_CONFIG_NUM_SERVER_OPTIONS] = +{ "off", "on", "30", "", "off", "off", "", "", "", "", "", "", "0", "", + "off", "" +}; + struct t_config_file *irc_config_file = NULL; +struct t_config_section *irc_config_section_server_default = NULL; struct t_config_section *irc_config_section_server = NULL; -/* config, irc section */ - -struct t_config_option *irc_config_irc_one_server_buffer; -struct t_config_option *irc_config_irc_open_near_server; -struct t_config_option *irc_config_irc_nick_prefix; -struct t_config_option *irc_config_irc_nick_suffix; -struct t_config_option *irc_config_irc_nick_completion_smart; -struct t_config_option *irc_config_irc_display_away; -struct t_config_option *irc_config_irc_show_away_once; -struct t_config_option *irc_config_irc_default_msg_part; -struct t_config_option *irc_config_irc_notice_as_pv; -struct t_config_option *irc_config_irc_away_check; -struct t_config_option *irc_config_irc_away_check_max_nicks; -struct t_config_option *irc_config_irc_lag_check; -struct t_config_option *irc_config_irc_lag_min_show; -struct t_config_option *irc_config_irc_lag_disconnect; -struct t_config_option *irc_config_irc_anti_flood; -struct t_config_option *irc_config_irc_highlight; -struct t_config_option *irc_config_irc_colors_receive; -struct t_config_option *irc_config_irc_colors_send; -struct t_config_option *irc_config_irc_send_unknown_commands; +/* config, look section */ + +struct t_config_option *irc_config_look_one_server_buffer; +struct t_config_option *irc_config_look_open_near_server; +struct t_config_option *irc_config_look_nick_prefix; +struct t_config_option *irc_config_look_nick_suffix; +struct t_config_option *irc_config_look_nick_completion_smart; +struct t_config_option *irc_config_look_display_away; +struct t_config_option *irc_config_look_show_away_once; +struct t_config_option *irc_config_look_notice_as_pv; +struct t_config_option *irc_config_look_highlight; + +/* config, network section */ + +struct t_config_option *irc_config_network_default_msg_part; +struct t_config_option *irc_config_network_default_msg_quit; +struct t_config_option *irc_config_network_away_check; +struct t_config_option *irc_config_network_away_check_max_nicks; +struct t_config_option *irc_config_network_lag_check; +struct t_config_option *irc_config_network_lag_min_show; +struct t_config_option *irc_config_network_lag_disconnect; +struct t_config_option *irc_config_network_anti_flood; +struct t_config_option *irc_config_network_colors_receive; +struct t_config_option *irc_config_network_colors_send; +struct t_config_option *irc_config_network_send_unknown_commands; /* config, dcc section */ @@ -74,36 +90,68 @@ struct t_config_option *irc_config_dcc_auto_resume; /* config, log section */ -struct t_config_option *irc_config_log_auto_server; -struct t_config_option *irc_config_log_auto_channel; -struct t_config_option *irc_config_log_auto_private; +struct t_config_option *irc_config_log_auto_log_server; +struct t_config_option *irc_config_log_auto_log_channel; +struct t_config_option *irc_config_log_auto_log_private; struct t_config_option *irc_config_log_hide_nickserv_pwd; /* config, server section */ -struct t_config_option *irc_config_server_name; -struct t_config_option *irc_config_server_autoconnect; -struct t_config_option *irc_config_server_autoreconnect; -struct t_config_option *irc_config_server_autoreconnect_delay; -struct t_config_option *irc_config_server_addresses; -struct t_config_option *irc_config_server_ipv6; -struct t_config_option *irc_config_server_ssl; -struct t_config_option *irc_config_server_password; -struct t_config_option *irc_config_server_nicks; -struct t_config_option *irc_config_server_username; -struct t_config_option *irc_config_server_realname; -struct t_config_option *irc_config_server_hostname; -struct t_config_option *irc_config_server_command; -struct t_config_option *irc_config_server_command_delay; -struct t_config_option *irc_config_server_autojoin; -struct t_config_option *irc_config_server_autorejoin; -struct t_config_option *irc_config_server_notify_levels; - -struct t_irc_server *irc_config_server = NULL; -int irc_config_reload_flag; +struct t_config_option *irc_config_server_default[IRC_CONFIG_NUM_SERVER_OPTIONS]; /* + * irc_config_search_server_option: search a server option name + * return index of option in array + * "irc_config_server_option_str", or -1 if + * not found + */ + +int +irc_config_search_server_option (char *option_name) +{ + int i; + + if (!option_name) + return -1; + + for (i = 0; i < IRC_CONFIG_NUM_SERVER_OPTIONS; i++) + { + if (weechat_strcasecmp (irc_config_server_option_str[i], + option_name) == 0) + return i; + } + + /* server option not found */ + return -1; +} + +struct t_irc_server * +irc_config_get_server_from_option_name (char *name) +{ + struct t_irc_server *ptr_server; + char *pos_option, *server_name; + + ptr_server = NULL; + + if (name) + { + pos_option = strchr (name, '.'); + if (pos_option) + { + server_name = weechat_strndup (name, pos_option - name); + if (server_name) + { + ptr_server = irc_server_search (server_name); + free (server_name); + } + } + } + + return ptr_server; +} + +/* * irc_config_change_one_server_buffer: called when the "one server buffer" * setting is changed */ @@ -130,7 +178,7 @@ irc_config_change_away_check () weechat_unhook (irc_hook_timer_check_away); irc_hook_timer_check_away = NULL; } - if (weechat_config_integer (irc_config_irc_away_check) == 0) + if (weechat_config_integer (irc_config_network_away_check) == 0) { /* reset away flag for all nicks/chans/servers */ //irc_server_remove_away (); @@ -201,259 +249,598 @@ irc_config_change_notify_levels () } /* + * irc_config_server_default_change_cb: callback called when a default server + * option is modified + */ + +void +irc_config_server_default_change_cb (void *data, struct t_config_option *option) +{ + int index_option, length; + char *option_full_name; + struct t_irc_server *ptr_server; + struct t_config_option *ptr_option; + + index_option = irc_config_search_server_option (data); + if (index_option >= 0) + { + for (ptr_server = irc_servers; ptr_server; + ptr_server = ptr_server->next_server) + { + length = strlen (ptr_server->name) + 1 + strlen (data) + 1; + option_full_name = malloc (length); + if (option_full_name) + { + ptr_option = weechat_config_search_option (irc_config_file, + irc_config_section_server, + option_full_name); + if (!ptr_option) + { + /* option does not exist for server, so we change value + with default value */ + irc_server_set_with_option (ptr_server, index_option, + option); + } + free (option_full_name); + } + } + } +} + +/* + * irc_config_server_change_cb: callback called when a server option is modified + */ + +void +irc_config_server_change_cb (void *data, struct t_config_option *option) +{ + int index_option; + char *name; + struct t_irc_server *ptr_server; + + index_option = irc_config_search_server_option (data); + if (index_option >= 0) + { + name = weechat_config_option_get_pointer (option, "name"); + ptr_server = irc_config_get_server_from_option_name (name); + if (ptr_server) + { + irc_server_set_with_option (ptr_server, index_option, option); + } + } +} + +/* + * irc_config_server_delete_cb: callback called when a server option is deleted + */ + +void +irc_config_server_delete_cb (void *data, struct t_config_option *option) +{ + int index_option; + char *name; + struct t_irc_server *ptr_server; + + index_option = irc_config_search_server_option (data); + if (index_option >= 0) + { + name = weechat_config_option_get_pointer (option, "name"); + ptr_server = irc_config_get_server_from_option_name (name); + if (ptr_server) + { + irc_server_set_with_option (ptr_server, index_option, + irc_config_server_default[index_option]); + } + } +} + +/* + * irc_config_reload_servers_from_config: create/update servers from options + * read in config file + */ + +void +irc_config_reload_servers_from_config () +{ + struct t_plugin_infolist *infolist; + struct t_irc_server *ptr_server; + struct t_config_option *ptr_option; + char *name, *full_name, *server_name, *pos_option; + int i, index_option; + + infolist = weechat_infolist_get ("options", "irc.server.*"); + while (weechat_infolist_next (infolist)) + { + name = weechat_infolist_string (infolist, "name"); + full_name = weechat_infolist_string (infolist, "full_name"); + if (name && full_name) + { + pos_option = strchr (name, '.'); + if (pos_option) + { + server_name = weechat_strndup (name, pos_option - name); + if (server_name) + { + pos_option++; + ptr_server = irc_server_search (server_name); + if (!ptr_server) + { + /* create server, it's first time we see it */ + ptr_server = irc_server_alloc (server_name); + if (!ptr_server) + { + weechat_printf (NULL, + _("%s%s: error creating server " + "\"%s\""), + weechat_prefix ("error"), "irc", + server_name); + } + } + if (ptr_server) + { + index_option = irc_config_search_server_option (pos_option); + if (index_option >= 0) + { + if (!ptr_server->reloaded_from_config) + { + /* it's first time we see server, and we are + reloading config, then initialize server + with default values (will be overwritten + by config later in this function + */ + for (i = 0; i < IRC_CONFIG_NUM_SERVER_OPTIONS; i++) + { + irc_server_set_with_option (ptr_server, + i, + irc_config_server_default[i]); + } + ptr_server->reloaded_from_config = 1; + } + weechat_config_search_with_string (full_name, NULL, + NULL, &ptr_option, + NULL); + if (ptr_option) + { + irc_server_set_with_option (ptr_server, + index_option, + ptr_option); + } + } + } + else + { + weechat_printf (NULL, + _("%s%s: error creating option " + "\"%s\" for server \"%s\" (server " + "not found)"), + weechat_prefix ("error"), "irc", + pos_option, server_name); + } + free (server_name); + } + } + } + } + weechat_infolist_free (infolist); +} + +/* * irc_config_reload: reload IRC configuration file */ int irc_config_reload (void *data, struct t_config_file *config_file) { - struct t_irc_server *ptr_server, *next_server; int rc; + struct t_irc_server *ptr_server, *next_server; /* make C compiler happy */ (void) data; - (void) config_file; - irc_config_server = NULL; - irc_config_reload_flag = 1; + weechat_config_section_free_options (irc_config_section_server); + for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server) { ptr_server->reloaded_from_config = 0; } - rc = weechat_config_reload (irc_config_file); + rc = weechat_config_reload (config_file); if (rc == 0) + irc_config_reload_servers_from_config (1); + + ptr_server = irc_servers; + while (ptr_server) { + next_server = ptr_server->next_server; - if (irc_config_server) - irc_server_init_with_config_options (irc_config_server, - irc_config_section_server, - irc_config_reload_flag); - - ptr_server = irc_servers; - while (ptr_server) + if (!ptr_server->reloaded_from_config) { - next_server = ptr_server->next_server; - - if (!ptr_server->reloaded_from_config) + if (ptr_server->is_connected) { - if (ptr_server->is_connected) - { - weechat_printf (NULL, - _("%s%s: warning: server \"%s\" not found " - "in configuration file, not deleted in " - "memory because it's currently used"), - weechat_prefix ("error"), "irc", - ptr_server->name); - } - else - irc_server_free (ptr_server); + weechat_printf (NULL, + _("%s%s: warning: server \"%s\" not found " + "in configuration file, not deleted in " + "memory because it's currently used"), + weechat_prefix ("error"), "irc", + ptr_server->name); + /* TODO: create options for server in section (options that + are not default one */ + // ... } - - ptr_server = next_server; + else + irc_server_free (ptr_server); } + + ptr_server = next_server; } return rc; } /* - * irc_config_read_server_line: read a server line in configuration file + * irc_config_server_write_default: write default server section in configuration file */ void -irc_config_read_server_line (void *data, struct t_config_file *config_file, - char *option_name, char *value) +irc_config_server_write_default (void *data, struct t_config_file *config_file, + char *section_name) { - struct t_config_option *ptr_option; - int rc; - /* make C compiler happy */ (void) data; - (void) config_file; + + weechat_config_write_line (config_file, section_name, NULL); + + weechat_config_write_line (config_file, "freenode.addresses", + "%s", "\"chat.freenode.net/6667\""); +} - if (option_name && value) - { - if (irc_config_server) - { - ptr_option = weechat_config_search_option (irc_config_file, - irc_config_section_server, - option_name); - if (ptr_option) - { - rc = weechat_config_option_set (ptr_option, value, 0); - switch (rc) - { - case 2: - break; - case 1: - break; - case 0: - weechat_printf (NULL, - _("%s%s: value \"%s\" is invalid " - "for option \"%s\""), - weechat_prefix ("error"), "irc", - value, option_name); - break; - } - } - else - { - weechat_printf (NULL, - _("%s%s: option \"%s\" not found"), - weechat_prefix ("error"), "irc", - option_name); - } - } - } - else +/* + * irc_config_server_new_option: create a new option for a server + */ + +struct t_config_option * +irc_config_server_new_option (struct t_config_file *config_file, + struct t_config_section *section, + int index_option, + char *option_name, char *value, + void *callback_change, + void *callback_change_data, + void *callback_delete, + void *callback_delete_data) +{ + struct t_config_option *new_option; + + new_option = NULL; + + switch (index_option) { - /* beginning of [server] section: save current server and create new - with default values for filling with next lines in file */ - if (irc_config_server) - { - irc_server_init_with_config_options (irc_config_server, - irc_config_section_server, - irc_config_reload_flag); - } - irc_config_server = irc_server_alloc (); - if (!irc_config_server) - { - weechat_printf (NULL, - _("%s%s: error creating server for reading " - "configuration file"), "irc", - weechat_prefix ("error")); - } + case IRC_CONFIG_SERVER_AUTOCONNECT: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "boolean", + N_("automatically connect to server when WeeChat is starting"), + NULL, 0, 0, value, NULL, NULL, + callback_change, callback_change_data, + callback_delete, callback_delete_data); + break; + case IRC_CONFIG_SERVER_AUTORECONNECT: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "boolean", + N_("automatically reconnect to server when disconnected"), + NULL, 0, 0, value, NULL, NULL, + callback_change, callback_change_data, + callback_delete, callback_delete_data); + break; + case IRC_CONFIG_SERVER_AUTORECONNECT_DELAY: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "integer", + N_("delay (in seconds) before trying again to reconnect to server"), + NULL, 0, 65535, value, NULL, NULL, + callback_change, callback_change_data, + callback_delete, callback_delete_data); + break; + case IRC_CONFIG_SERVER_ADDRESSES: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "string", + N_("list of IP/port or hostname/port for server (separated by comma)"), + NULL, 0, 0, value, NULL, NULL, + callback_change, callback_change_data, + callback_delete, callback_delete_data); + break; + case IRC_CONFIG_SERVER_IPV6: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "boolean", + N_("use IPv6 protocol for server communication"), + NULL, 0, 0, value, NULL, NULL, + callback_change, callback_change_data, + callback_delete, callback_delete_data); + break; + case IRC_CONFIG_SERVER_SSL: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "boolean", + N_("use SSL for server communication"), + NULL, 0, 0, value, NULL, NULL, + callback_change, callback_change_data, + callback_delete, callback_delete_data); + break; + case IRC_CONFIG_SERVER_PASSWORD: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "string", + N_("password for IRC server"), + NULL, 0, 0, value, NULL, NULL, + callback_change, callback_change_data, + callback_delete, callback_delete_data); + break; + case IRC_CONFIG_SERVER_NICKS: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "string", + N_("nicknames to use on IRC server (separated by comma)"), + NULL, 0, 0, value, NULL, NULL, + callback_change, callback_change_data, + callback_delete, callback_delete_data); + break; + case IRC_CONFIG_SERVER_USERNAME: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "string", + N_("user name to use on IRC server"), + NULL, 0, 0, value, NULL, NULL, + callback_change, callback_change_data, + callback_delete, callback_delete_data); + break; + case IRC_CONFIG_SERVER_REALNAME: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "string", + N_("real name to use on IRC server"), + NULL, 0, 0, value, NULL, NULL, + callback_change, callback_change_data, + callback_delete, callback_delete_data); + break; + case IRC_CONFIG_SERVER_HOSTNAME: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "string", + N_("custom hostname/IP for server (optional, if empty local hostname " + "is used)"), + NULL, 0, 0, value, NULL, NULL, + callback_change, callback_change_data, + callback_delete, callback_delete_data); + break; + case IRC_CONFIG_SERVER_COMMAND: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "string", + N_("command(s) to run when connected to server (many commands should " + "be separated by ';', use '\\;' for a semicolon, special variables " + "$nick, $channel and $server are replaced by their value)"), + NULL, 0, 0, value, NULL, NULL, + callback_change, callback_change_data, + callback_delete, callback_delete_data); + break; + case IRC_CONFIG_SERVER_COMMAND_DELAY: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "integer", + N_("delay (in seconds) after command was executed (example: give some " + "time for authentication)"), + NULL, 0, 3600, value, NULL, NULL, + callback_change, callback_change_data, + callback_delete, callback_delete_data); + break; + case IRC_CONFIG_SERVER_AUTOJOIN: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "string", + N_("comma separated list of channels to join when connected to server " + "(example: \"#chan1,#chan2,#chan3 key1,key2\")"), + NULL, 0, 0, value, NULL, NULL, + callback_change, callback_change_data, + callback_delete, callback_delete_data); + break; + case IRC_CONFIG_SERVER_AUTOREJOIN: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "boolean", + N_("automatically rejoin channels when kicked"), + NULL, 0, 0, value, NULL, NULL, + callback_change, callback_change_data, + callback_delete, callback_delete_data); + break; + case IRC_CONFIG_SERVER_NOTIFY_LEVELS: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "string", + N_("comma separated list of notify levels for channels of this server " + "(format: #channel:1,..), a channel name '*' is reserved for " + "server default notify level"), + NULL, 0, 0, value, NULL, NULL, + callback_change, callback_change_data, + callback_delete, callback_delete_data); + break; + case IRC_CONFIG_NUM_SERVER_OPTIONS: + break; } + + return new_option; } /* - * irc_config_write_servers: write servers in configuration file + * irc_config_server_create_option: create a server option */ -void -irc_config_write_servers (void *data, struct t_config_file *config_file, - char *section_name) +int +irc_config_server_create_option (void *data, struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, char *value) { + struct t_config_option *ptr_option; struct t_irc_server *ptr_server; + int rc, index_option; + char *pos_option, *server_name; /* make C compiler happy */ (void) data; - for (ptr_server = irc_servers; ptr_server; - ptr_server = ptr_server->next_server) + rc = 0; + + if (option_name) { - if (!ptr_server->temp_server) + pos_option = strchr (option_name, '.'); + if (pos_option) { - weechat_config_write_line (config_file, section_name, NULL); - weechat_config_write_line (config_file, "server_name", "\"%s\"", - ptr_server->name); - weechat_config_write_line (config_file, "server_autoconnect", "%s", - (ptr_server->autoconnect) ? "on" : "off"); - weechat_config_write_line (config_file, "server_autoreconnect", "%s", - (ptr_server->autoreconnect) ? "on" : "off"); - weechat_config_write_line (config_file, "server_autoreconnect_delay", "%d", - ptr_server->autoreconnect_delay); - weechat_config_write_line (config_file, "server_addresses", "\"%s\"", ptr_server->addresses); - weechat_config_write_line (config_file, "server_ipv6", "%s", - (ptr_server->ipv6) ? "on" : "off"); - weechat_config_write_line (config_file, "server_ssl", "%s", - (ptr_server->ssl) ? "on" : "off"); - weechat_config_write_line (config_file, "server_password", "\"%s\"", - (ptr_server->password) ? ptr_server->password : ""); - weechat_config_write_line (config_file, "server_nicks", "\"%s\"", - ptr_server->nicks); - weechat_config_write_line (config_file, "server_username", "\"%s\"", - ptr_server->username); - weechat_config_write_line (config_file, "server_realname", "\"%s\"", - ptr_server->realname); - weechat_config_write_line (config_file, "server_hostname", "\"%s\"", - (ptr_server->hostname) ? ptr_server->hostname : ""); - weechat_config_write_line (config_file, "server_command", "\"%s\"", - (ptr_server->command) ? ptr_server->command : ""); - weechat_config_write_line (config_file, "server_command_delay", "%d", - ptr_server->command_delay); - weechat_config_write_line (config_file, "server_autojoin", "\"%s\"", - (ptr_server->autojoin) ? ptr_server->autojoin : ""); - weechat_config_write_line (config_file, "server_autorejoin", "%s", - (ptr_server->autorejoin) ? "on" : "off"); - weechat_config_write_line (config_file, "server_notify_levels", "\"%s\"", - (ptr_server->notify_levels) ? ptr_server->notify_levels : ""); + server_name = weechat_strndup (option_name, + pos_option - option_name); + pos_option++; + if (server_name) + { + index_option = irc_config_search_server_option (pos_option); + if (index_option >= 0) + { + ptr_server = irc_server_search (server_name); + if (!ptr_server) + ptr_server = irc_server_alloc (server_name); + if (!ptr_server) + { + weechat_printf (NULL, + _("%s%s: error creating server " + "\"%s\""), + weechat_prefix ("error"), "irc", + server_name); + } + ptr_option = weechat_config_search_option (config_file, + section, + option_name); + if (ptr_option) + { + rc = weechat_config_option_set (ptr_option, value, 1); + } + else + { + if (value && value[0] && (index_option >= 0)) + { + ptr_option = irc_config_server_new_option (config_file, + section, + index_option, + option_name, + value, + &irc_config_server_change_cb, + irc_config_server_option_str[index_option], + &irc_config_server_delete_cb, + irc_config_server_option_str[index_option]); + + if (ptr_option) + { + if (ptr_server) + { + irc_server_set_with_option (ptr_server, + index_option, + ptr_option); + } + rc = 1; + } + } + } + } + free (server_name); + } } } + + if (rc == 0) + { + weechat_printf (NULL, + _("%s%s: error creating server option \"%s\""), + weechat_prefix ("error"), "irc", + option_name); + } + + return rc; } /* - * irc_config_write_server_default: write default server in configuration file + * irc_config_server_create_default_options: create default options for servers */ void -irc_config_write_server_default (void *data, struct t_config_file *config_file, - char *section_name) +irc_config_server_create_default_options (struct t_config_section *section) { + int i, length; + char *nicks, *username, *realname, *pos, *default_value; struct passwd *my_passwd; - char *realname, *pos; - /* make C compiler happy */ - (void) data; - - weechat_config_write_line (config_file, section_name, NULL); - - weechat_config_write_line (config_file, "server_name", "%s", "\"freenode\""); - weechat_config_write_line (config_file, "server_autoconnect", "%s", "off"); - weechat_config_write_line (config_file, "server_autoreconnect", "%s", "on"); - weechat_config_write_line (config_file, "server_autoreconnect_delay", "%s", "30"); - weechat_config_write_line (config_file, "server_addresses", "%s", "\"irc.freenode.net/6667\""); - weechat_config_write_line (config_file, "server_ipv6", "%s", "off"); - weechat_config_write_line (config_file, "server_ssl", "%s", "off"); - weechat_config_write_line (config_file, "server_password", "%s", "\"\""); + nicks = NULL; + username = NULL; + realname = NULL; /* Get the user's name from /etc/passwd */ if ((my_passwd = getpwuid (geteuid ())) != NULL) { - weechat_config_write_line (config_file, - "server_nicks", "\"%s,%s1,%s2,%s3,%s4\"", - my_passwd->pw_name, - my_passwd->pw_name, - my_passwd->pw_name, - my_passwd->pw_name, - my_passwd->pw_name); - weechat_config_write_line (config_file, "server_username", "\"%s\"", my_passwd->pw_name); + length = (strlen (my_passwd->pw_name) + 4) * 5; + nicks = malloc (length); + if (nicks) + { + snprintf (nicks, length, "%s,%s1,%s2,%s3,%s4", + my_passwd->pw_name, + my_passwd->pw_name, + my_passwd->pw_name, + my_passwd->pw_name, + my_passwd->pw_name); + } + username = strdup (my_passwd->pw_name); if ((!my_passwd->pw_gecos) || (my_passwd->pw_gecos[0] == '\0') || (my_passwd->pw_gecos[0] == ',') || (my_passwd->pw_gecos[0] == ' ')) - weechat_config_write_line (config_file, "server_realname", "\"%s\"", my_passwd->pw_name); + realname = strdup (my_passwd->pw_name); else { realname = strdup (my_passwd->pw_gecos); pos = strchr (realname, ','); if (pos) pos[0] = '\0'; - weechat_config_write_line (config_file, "server_realname", "\"%s\"", - realname); - if (pos) - pos[0] = ','; - free (realname); } } else { /* default values if /etc/passwd can't be read */ - weechat_config_write_line (config_file, "server_nicks", "%s", - "\"" IRC_SERVER_DEFAULT_NICKS "\""); - weechat_config_write_line (config_file, "server_username", "%s", "\"weechat\""); - weechat_config_write_line (config_file, "server_realname", "%s", "\"weechat\""); + nicks = strdup (IRC_SERVER_DEFAULT_NICKS); + username = strdup ("weechat"); + realname = strdup ("weechat"); } - weechat_config_write_line (config_file, "server_hostname", "%s", "\"\""); - weechat_config_write_line (config_file, "server_command", "%s", "\"\""); - weechat_config_write_line (config_file, "server_command_delay", "%s", "0"); - weechat_config_write_line (config_file, "server_autojoin", "%s", "\"\""); - weechat_config_write_line (config_file, "server_autorejoin", "%s", "on"); - weechat_config_write_line (config_file, "server_notify_levels", "%s", "\"\""); + for (i = 0; i < IRC_CONFIG_NUM_SERVER_OPTIONS; i++) + { + default_value = NULL; + if (i == IRC_CONFIG_SERVER_NICKS) + default_value = nicks; + else if (i == IRC_CONFIG_SERVER_USERNAME) + default_value = username; + else if (i == IRC_CONFIG_SERVER_REALNAME) + default_value = realname; + if (!default_value) + default_value = irc_config_server_option_default[i]; + + irc_config_server_default[i] = irc_config_server_new_option ( + irc_config_file, + section, + i, + irc_config_server_option_str[i], + default_value, + &irc_config_server_default_change_cb, + irc_config_server_option_str[i], + NULL, + NULL); + } } /* @@ -465,131 +852,145 @@ int irc_config_init () { struct t_config_section *ptr_section; - - irc_config_file = weechat_config_new (IRC_CONFIG_FILENAME, + + irc_config_file = weechat_config_new (IRC_CONFIG_NAME, &irc_config_reload, NULL); if (!irc_config_file) return 0; - ptr_section = weechat_config_new_section (irc_config_file, "irc", - NULL, NULL, - NULL, NULL, - NULL, NULL); + ptr_section = weechat_config_new_section (irc_config_file, "look", + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL); if (!ptr_section) { weechat_config_free (irc_config_file); return 0; } - irc_config_irc_one_server_buffer = weechat_config_new_option ( + irc_config_look_one_server_buffer = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_one_server_buffer", "boolean", + "one_server_buffer", "boolean", N_("use same buffer for all servers"), - NULL, 0, 0, "off", &irc_config_change_one_server_buffer, NULL); - irc_config_irc_open_near_server = weechat_config_new_option ( + NULL, 0, 0, "off", NULL, NULL, &irc_config_change_one_server_buffer, NULL, NULL, NULL); + irc_config_look_open_near_server = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_open_near_server", "boolean", + "open_near_server", "boolean", N_("open new channels/privates near server"), - NULL, 0, 0, "off", NULL, NULL); - irc_config_irc_nick_prefix = weechat_config_new_option ( + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_nick_prefix = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_nick_prefix", "string", + "nick_prefix", "string", N_("text to display before nick in chat window"), - NULL, 0, 0, "", NULL, NULL); - irc_config_irc_nick_suffix = weechat_config_new_option ( + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_nick_suffix = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_nick_suffix", "string", + "nick_suffix", "string", N_("text to display after nick in chat window"), - NULL, 0, 0, "", NULL, NULL); - irc_config_irc_nick_completion_smart = weechat_config_new_option ( + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_nick_completion_smart = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_nick_completion_smart", "boolean", + "nick_completion_smart", "boolean", N_("smart completion for nicks (completes with last speakers first)"), - NULL, 0, 0, "on", NULL, NULL); - irc_config_irc_display_away = weechat_config_new_option ( + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_display_away = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_display_away", "integer", + "display_away", "integer", N_("display message when (un)marking as away"), - "off|local|channel", 0, 0, "local", NULL, NULL); - irc_config_irc_show_away_once = weechat_config_new_option ( + "off|local|channel", 0, 0, "local", NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_show_away_once = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_show_away_once", "boolean", + "show_away_once", "boolean", N_("show remote away message only once in private"), - NULL, 0, 0, "on", NULL, NULL); - irc_config_irc_default_msg_part = weechat_config_new_option ( + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_notice_as_pv = weechat_config_new_option ( + irc_config_file, ptr_section, + "notice_as_pv", "boolean", + N_("display notices as private messages"), + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_highlight = weechat_config_new_option ( + irc_config_file, ptr_section, + "highlight", "string", + N_("comma separated list of words to highlight (case insensitive " + "comparison, words may begin or end with \"*\" for partial match)"), + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); + + ptr_section = weechat_config_new_section (irc_config_file, "network", + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL); + if (!ptr_section) + { + weechat_config_free (irc_config_file); + return 0; + } + + irc_config_network_default_msg_part = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_default_msg_part", "string", + "default_msg_part", "string", N_("default part message (leaving channel) ('%v' will be replaced by " "WeeChat version in string)"), - NULL, 0, 0, "WeeChat %v", NULL, NULL); - irc_config_irc_notice_as_pv = weechat_config_new_option ( + NULL, 0, 0, "WeeChat %v", NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_default_msg_quit = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_notice_as_pv", "boolean", - N_("display notices as private messages"), - NULL, 0, 0, "off", NULL, NULL); - irc_config_irc_away_check = weechat_config_new_option ( + "default_msg_quit", "string", + N_("default quit message (disconnecting from server) ('%v' will be " + "replaced by WeeChat version in string)"), + NULL, 0, 0, "WeeChat %v", NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_away_check = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_away_check", "integer", + "away_check", "integer", N_("interval between two checks for away (in minutes, 0 = never " "check)"), - NULL, 0, INT_MAX, "0", &irc_config_change_away_check, NULL); - irc_config_irc_away_check_max_nicks = weechat_config_new_option ( + NULL, 0, INT_MAX, "0", NULL, NULL, &irc_config_change_away_check, NULL, NULL, NULL); + irc_config_network_away_check_max_nicks = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_away_check_max_nicks", "integer", + "away_check_max_nicks", "integer", N_("do not check away nicks on channels with high number of nicks " "(0 = unlimited)"), - NULL, 0, INT_MAX, "0", &irc_config_change_away_check, NULL); - irc_config_irc_lag_check = weechat_config_new_option ( + NULL, 0, INT_MAX, "0", NULL, NULL, &irc_config_change_away_check, NULL, NULL, NULL); + irc_config_network_lag_check = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_lag_check", "integer", + "lag_check", "integer", N_("interval between two checks for lag (in seconds, 0 = never " "check)"), - NULL, 0, INT_MAX, "60", NULL, NULL); - irc_config_irc_lag_min_show = weechat_config_new_option ( + NULL, 0, INT_MAX, "60", NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_lag_min_show = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_lag_min_show", "integer", + "lag_min_show", "integer", N_("minimum lag to show (in seconds)"), - NULL, 0, INT_MAX, "1", NULL, NULL); - irc_config_irc_lag_disconnect = weechat_config_new_option ( + NULL, 0, INT_MAX, "1", NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_lag_disconnect = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_lag_disconnect", "integer", + "lag_disconnect", "integer", N_("disconnect after important lag (in minutes, 0 = never " "disconnect)"), - NULL, 0, INT_MAX, "5", NULL, NULL); - irc_config_irc_anti_flood = weechat_config_new_option ( + NULL, 0, INT_MAX, "5", NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_anti_flood = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_anti_flood", "integer", + "anti_flood", "integer", N_("anti-flood: # seconds between two user messages (0 = no " "anti-flood)"), - NULL, 0, 5, "2", NULL, NULL); - irc_config_irc_highlight = weechat_config_new_option ( + NULL, 0, 5, "2", NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_colors_receive = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_highlight", "string", - N_("comma separated list of words to highlight (case insensitive " - "comparison, words may begin or end with \"*\" for partial match)"), - NULL, 0, 0, "", NULL, NULL); - irc_config_irc_colors_receive = weechat_config_new_option ( - irc_config_file, ptr_section, - "irc_colors_receive", "boolean", + "colors_receive", "boolean", N_("when off, colors codes are ignored in incoming messages"), - NULL, 0, 0, "on", NULL, NULL); - irc_config_irc_colors_send = weechat_config_new_option ( + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_colors_send = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_colors_send", "boolean", + "colors_send", "boolean", N_("allow user to send colors with special codes (^Cb=bold, " "^Ccxx=color, ^Ccxx,yy=color+background, ^Cu=underline, " "^Cr=reverse)"), - NULL, 0, 0, "on", NULL, NULL); - irc_config_irc_send_unknown_commands = weechat_config_new_option ( + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_network_send_unknown_commands = weechat_config_new_option ( irc_config_file, ptr_section, - "irc_send_unknown_commands", "boolean", + "send_unknown_commands", "boolean", N_("send unknown commands to IRC server"), - NULL, 0, 0, "off", NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); ptr_section = weechat_config_new_section (irc_config_file, "dcc", - NULL, NULL, - NULL, NULL, - NULL, NULL); + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL); if (!ptr_section) { weechat_config_free (irc_config_file); @@ -598,109 +999,119 @@ irc_config_init () irc_config_dcc_auto_accept_files = weechat_config_new_option ( irc_config_file, ptr_section, - "dcc_auto_accept_files", "boolean", + "auto_accept_files", "boolean", N_("automatically accept incoming dcc files (use carefully!)"), - NULL, 0, 0, "off", NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); irc_config_dcc_auto_accept_chats = weechat_config_new_option ( irc_config_file, ptr_section, - "dcc_auto_accept_chats", "boolean", + "auto_accept_chats", "boolean", N_("automatically accept dcc chats (use carefully!)"), - NULL, 0, 0, "off", NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); irc_config_dcc_timeout = weechat_config_new_option ( irc_config_file, ptr_section, - "dcc_timeout", "integer", + "timeout", "integer", N_("timeout for dcc request (in seconds)"), - NULL, 5, INT_MAX, "300", NULL, NULL); + NULL, 5, INT_MAX, "300", NULL, NULL, NULL, NULL, NULL, NULL); irc_config_dcc_blocksize = weechat_config_new_option ( irc_config_file, ptr_section, - "dcc_blocksize", "integer", + "blocksize", "integer", N_("block size for dcc packets in bytes"), NULL, IRC_DCC_MIN_BLOCKSIZE, IRC_DCC_MAX_BLOCKSIZE, "65536", - NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL); irc_config_dcc_fast_send = weechat_config_new_option ( irc_config_file, ptr_section, - "dcc_fast_send", "boolean", + "fast_send", "boolean", N_("does not wait for ACK when sending file"), - NULL, 0, 0, "on", NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); irc_config_dcc_port_range = weechat_config_new_option ( irc_config_file, ptr_section, - "dcc_port_range", "string", + "port_range", "string", N_("restricts outgoing dcc to use only ports in the given range " "(useful for NAT) (syntax: a single port, ie. 5000 or a port " "range, ie. 5000-5015, empty value means any port)"), - NULL, 0, 0, "", NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); irc_config_dcc_own_ip = weechat_config_new_option ( irc_config_file, ptr_section, - "dcc_own_ip", "string", + "own_ip", "string", N_("IP or DNS address used for outgoing dcc " "(if empty, local interface IP is used)"), - NULL, 0, 0, "", NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); irc_config_dcc_download_path = weechat_config_new_option ( irc_config_file, ptr_section, - "dcc_download_path", "string", + "download_path", "string", N_("path for writing incoming files with dcc"), - NULL, 0, 0, "%h/dcc", NULL, NULL); + NULL, 0, 0, "%h/dcc", NULL, NULL, NULL, NULL, NULL, NULL); irc_config_dcc_upload_path = weechat_config_new_option ( irc_config_file, ptr_section, - "dcc_upload_path", "string", + "upload_path", "string", N_("path for reading files when sending thru dcc (when no path is " "specified)"), - NULL, 0, 0, "~", NULL, NULL); + NULL, 0, 0, "~", NULL, NULL, NULL, NULL, NULL, NULL); irc_config_dcc_convert_spaces = weechat_config_new_option ( irc_config_file, ptr_section, - "dcc_convert_spaces", "boolean", + "convert_spaces", "boolean", N_("convert spaces to underscores when sending files"), - NULL, 0, 0, "on", NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); irc_config_dcc_auto_rename = weechat_config_new_option ( irc_config_file, ptr_section, - "dcc_auto_rename", "boolean", + "auto_rename", "boolean", N_("rename incoming files if already exists (add '.1', '.2', ...)"), - NULL, 0, 0, "on", NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); irc_config_dcc_auto_resume = weechat_config_new_option ( irc_config_file, ptr_section, - "dcc_auto_resume", "boolean", + "auto_resume", "boolean", N_("automatically resume dcc transfer if connection with remote host " "is loosed"), - NULL, 0, 0, "on", NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); ptr_section = weechat_config_new_section (irc_config_file, "log", - NULL, NULL, - NULL, NULL, - NULL, NULL); + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL); if (!ptr_section) { weechat_config_free (irc_config_file); return 0; } - irc_config_log_auto_server = weechat_config_new_option ( + irc_config_log_auto_log_server = weechat_config_new_option ( irc_config_file, ptr_section, - "log_auto_server", "boolean", + "auto_log_server", "boolean", N_("automatically log server messages"), - NULL, 0, 0, "off", &irc_config_change_log, NULL); - irc_config_log_auto_channel = weechat_config_new_option ( + NULL, 0, 0, "off", NULL, NULL, &irc_config_change_log, NULL, NULL, NULL); + irc_config_log_auto_log_channel = weechat_config_new_option ( irc_config_file, ptr_section, - "log_auto_channel", "boolean", + "auto_log_channel", "boolean", N_("automatically log channel chats"), - NULL, 0, 0, "off", &irc_config_change_log, NULL); - irc_config_log_auto_private = weechat_config_new_option ( + NULL, 0, 0, "off", NULL, NULL, &irc_config_change_log, NULL, NULL, NULL); + irc_config_log_auto_log_private = weechat_config_new_option ( irc_config_file, ptr_section, - "log_auto_private", "boolean", + "auto_log_private", "boolean", N_("automatically log private chats"), - NULL, 0, 0, "off", &irc_config_change_log, NULL); + NULL, 0, 0, "off", NULL, NULL, &irc_config_change_log, NULL, NULL, NULL); irc_config_log_hide_nickserv_pwd = weechat_config_new_option ( irc_config_file, ptr_section, - "log_hide_nickserv_pwd", "boolean", + "hide_nickserv_pwd", "boolean", N_("hide password displayed by nickserv"), - NULL, 0, 0, "on", &irc_config_change_log, NULL); + NULL, 0, 0, "on", NULL, NULL, &irc_config_change_log, NULL, NULL, NULL); + + ptr_section = weechat_config_new_section (irc_config_file, "server_default", + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL); + if (!ptr_section) + { + weechat_config_free (irc_config_file); + return 0; + } + + irc_config_section_server_default = ptr_section; + + irc_config_server_create_default_options (ptr_section); ptr_section = weechat_config_new_section (irc_config_file, "server", - &irc_config_read_server_line, - NULL, - &irc_config_write_servers, - NULL, - &irc_config_write_server_default, - NULL); + NULL, NULL, + NULL, NULL, + &irc_config_server_write_default, NULL, + &irc_config_server_create_option, NULL); if (!ptr_section) { weechat_config_free (irc_config_file); @@ -709,98 +1120,6 @@ irc_config_init () irc_config_section_server = ptr_section; - irc_config_server_name = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_name", "string", - N_("name associated to IRC server (for display only)"), - NULL, 0, 0, "", NULL, NULL); - irc_config_server_autoconnect = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_autoconnect", "boolean", - N_("automatically connect to server when WeeChat is starting"), - NULL, 0, 0, "off", NULL, NULL); - irc_config_server_autoreconnect = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_autoreconnect", "boolean", - N_("automatically reconnect to server when disconnected"), - NULL, 0, 0, "on", NULL, NULL); - irc_config_server_autoreconnect_delay = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_autoreconnect_delay", "integer", - N_("delay (in seconds) before trying again to reconnect to server"), - NULL, 0, 65535, "30", NULL, NULL); - irc_config_server_addresses = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_addresses", "string", - N_("list of IP/port or hostname/port for server (separated by comma)"), - NULL, 0, 0, "", NULL, NULL); - irc_config_server_ipv6 = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_ipv6", "boolean", - N_("use IPv6 protocol for server communication"), - NULL, 0, 0, "on", NULL, NULL); - irc_config_server_ssl = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_ssl", "boolean", - N_("use SSL for server communication"), - NULL, 0, 0, "on", NULL, NULL); - irc_config_server_password = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_password", "string", - N_("password for IRC server"), - NULL, 0, 0, "", NULL, NULL); - irc_config_server_nicks = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_nicks", "string", - N_("nicknames to use on IRC server (separated by comma)"), - NULL, 0, 0, "", NULL, NULL); - irc_config_server_username = weechat_config_new_option ( - irc_config_file, ptr_section, "server_username", "string", - N_("user name to use on IRC server"), - NULL, 0, 0, "", NULL, NULL); - irc_config_server_realname = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_realname", "string", - N_("real name to use on IRC server"), - NULL, 0, 0, "", NULL, NULL); - irc_config_server_hostname = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_hostname", "string", - N_("custom hostname/IP for server (optional, if empty local hostname " - "is used)"), - NULL, 0, 0, "", NULL, NULL); - irc_config_server_command = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_command", "string", - N_("command(s) to run when connected to server (many commands should " - "be separated by ';', use '\\;' for a semicolon, special variables " - "$nick, $channel and $server are replaced by their value)"), - NULL, 0, 0, "", NULL, NULL); - irc_config_server_command_delay = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_command_delay", "integer", - N_("delay (in seconds) after command was executed (example: give some " - "time for authentication)"), - NULL, 0, 3600, "0", NULL, NULL); - irc_config_server_autojoin = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_autojoin", "string", - N_("comma separated list of channels to join when connected to server " - "(example: \"#chan1,#chan2,#chan3 key1,key2\")"), - NULL, 0, 0, "", NULL, NULL); - irc_config_server_autorejoin = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_autorejoin", "string", - N_("automatically rejoin channels when kicked"), - NULL, 0, 0, "on", NULL, NULL); - irc_config_server_notify_levels = weechat_config_new_option ( - irc_config_file, ptr_section, - "server_notify_levels", "string", - N_("comma separated list of notify levels for channels of this server " - "(format: #channel:1,..), a channel name '*' is reserved for " - "server default notify level"), - NULL, 0, 0, "", NULL, NULL); - return 1; } @@ -816,15 +1135,7 @@ irc_config_read () { int rc; - irc_config_server = NULL; - irc_config_reload_flag = 0; - rc = weechat_config_read (irc_config_file); - - if (irc_config_server) - irc_server_init_with_config_options (irc_config_server, - irc_config_section_server, - irc_config_reload_flag); return rc; } diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h index 8127bd6d2..7c3765513 100644 --- a/src/plugins/irc/irc-config.h +++ b/src/plugins/irc/irc-config.h @@ -20,55 +20,90 @@ #ifndef __WEECHAT_IRC_CONFIG_H #define __WEECHAT_IRC_CONFIG_H 1 -#define IRC_CONFIG_FILENAME "irc.rc" +#define IRC_CONFIG_NAME "irc" #define IRC_CONFIG_DISPLAY_AWAY_OFF 0 #define IRC_CONFIG_DISPLAY_AWAY_LOCAL 1 #define IRC_CONFIG_DISPLAY_AWAY_CHANNEL 2 -struct t_config_file *irc_config; +enum t_irc_config_server_option +{ + IRC_CONFIG_SERVER_AUTOCONNECT = 0, + IRC_CONFIG_SERVER_AUTORECONNECT, + IRC_CONFIG_SERVER_AUTORECONNECT_DELAY, + IRC_CONFIG_SERVER_ADDRESSES, + IRC_CONFIG_SERVER_IPV6, + IRC_CONFIG_SERVER_SSL, + IRC_CONFIG_SERVER_PASSWORD, + IRC_CONFIG_SERVER_NICKS, + IRC_CONFIG_SERVER_USERNAME, + IRC_CONFIG_SERVER_REALNAME, + IRC_CONFIG_SERVER_HOSTNAME, + IRC_CONFIG_SERVER_COMMAND, + IRC_CONFIG_SERVER_COMMAND_DELAY, + IRC_CONFIG_SERVER_AUTOJOIN, + IRC_CONFIG_SERVER_AUTOREJOIN, + IRC_CONFIG_SERVER_NOTIFY_LEVELS, + /* number of server options */ + IRC_CONFIG_NUM_SERVER_OPTIONS, +}; -struct t_config_option *irc_config_irc_one_server_buffer; -struct t_config_option *irc_config_irc_open_near_server; -struct t_config_option *irc_config_irc_nick_prefix; -struct t_config_option *irc_config_irc_nick_suffix; -struct t_config_option *irc_config_irc_nick_completion_smart; -struct t_config_option *irc_config_irc_display_away; -struct t_config_option *irc_config_irc_show_away_once; -struct t_config_option *irc_config_irc_default_msg_part; -struct t_config_option *irc_config_irc_default_msg_quit; -struct t_config_option *irc_config_irc_notice_as_pv; -struct t_config_option *irc_config_irc_away_check; -struct t_config_option *irc_config_irc_away_check_max_nicks; -struct t_config_option *irc_config_irc_lag_check; -struct t_config_option *irc_config_irc_lag_min_show; -struct t_config_option *irc_config_irc_lag_disconnect; -struct t_config_option *irc_config_irc_anti_flood; -struct t_config_option *irc_config_irc_highlight; -struct t_config_option *irc_config_irc_colors_receive; -struct t_config_option *irc_config_irc_colors_send; -struct t_config_option *irc_config_irc_send_unknown_commands; +#define IRC_CONFIG_SERVER_DEFAULT_AUTOCONNECT 0 +#define IRC_CONFIG_SERVER_DEFAULT_AUTORECONNECT 1 +#define IRC_CONFIG_SERVER_DEFAULT_AUTORECONNECT_DELAY 30 +#define IRC_CONFIG_SERVER_DEFAULT_IPV6 0 +#define IRC_CONFIG_SERVER_DEFAULT_SSL 0 +#define IRC_CONFIG_SERVER_DEFAULT_COMMAND_DELAY 1 +#define IRC_CONFIG_SERVER_DEFAULT_AUTOREJOIN 0 -struct t_config_option *irc_config_dcc_auto_accept_files; -struct t_config_option *irc_config_dcc_auto_accept_chats; -struct t_config_option *irc_config_dcc_timeout; -struct t_config_option *irc_config_dcc_blocksize; -struct t_config_option *irc_config_dcc_fast_send; -struct t_config_option *irc_config_dcc_port_range; -struct t_config_option *irc_config_dcc_own_ip; -struct t_config_option *irc_config_dcc_download_path; -struct t_config_option *irc_config_dcc_upload_path; -struct t_config_option *irc_config_dcc_convert_spaces; -struct t_config_option *irc_config_dcc_auto_rename; -struct t_config_option *irc_config_dcc_auto_resume; -struct t_config_option *irc_config_log_auto_server; -struct t_config_option *irc_config_log_auto_channel; -struct t_config_option *irc_config_log_auto_private; -struct t_config_option *irc_config_log_hide_nickserv_pwd; +extern char *irc_config_server_option_str[]; +extern struct t_config_file *irc_config; -int irc_config_init (); -int irc_config_read (); -int irc_config_write (); +extern struct t_config_option *irc_config_look_one_server_buffer; +extern struct t_config_option *irc_config_look_open_near_server; +extern struct t_config_option *irc_config_look_nick_prefix; +extern struct t_config_option *irc_config_look_nick_suffix; +extern struct t_config_option *irc_config_look_nick_completion_smart; +extern struct t_config_option *irc_config_look_display_away; +extern struct t_config_option *irc_config_look_show_away_once; +extern struct t_config_option *irc_config_look_notice_as_pv; +extern struct t_config_option *irc_config_look_highlight; + +extern struct t_config_option *irc_config_network_default_msg_part; +extern struct t_config_option *irc_config_network_default_msg_quit; +extern struct t_config_option *irc_config_network_away_check; +extern struct t_config_option *irc_config_network_away_check_max_nicks; +extern struct t_config_option *irc_config_network_lag_check; +extern struct t_config_option *irc_config_network_lag_min_show; +extern struct t_config_option *irc_config_network_lag_disconnect; +extern struct t_config_option *irc_config_network_anti_flood; +extern struct t_config_option *irc_config_network_colors_receive; +extern struct t_config_option *irc_config_network_colors_send; +extern struct t_config_option *irc_config_network_send_unknown_commands; + +extern struct t_config_option *irc_config_dcc_auto_accept_files; +extern struct t_config_option *irc_config_dcc_auto_accept_chats; +extern struct t_config_option *irc_config_dcc_timeout; +extern struct t_config_option *irc_config_dcc_blocksize; +extern struct t_config_option *irc_config_dcc_fast_send; +extern struct t_config_option *irc_config_dcc_port_range; +extern struct t_config_option *irc_config_dcc_own_ip; +extern struct t_config_option *irc_config_dcc_download_path; +extern struct t_config_option *irc_config_dcc_upload_path; +extern struct t_config_option *irc_config_dcc_convert_spaces; +extern struct t_config_option *irc_config_dcc_auto_rename; +extern struct t_config_option *irc_config_dcc_auto_resume; + +extern struct t_config_option *irc_config_log_auto_log_server; +extern struct t_config_option *irc_config_log_auto_log_channel; +extern struct t_config_option *irc_config_log_auto_log_private; +extern struct t_config_option *irc_config_log_hide_nickserv_pwd; + +extern struct t_config_option *irc_config_server_default[]; + +extern int irc_config_init (); +extern int irc_config_read (); +extern int irc_config_write (); #endif /* irc-config.h */ diff --git a/src/plugins/irc/irc-debug.c b/src/plugins/irc/irc-debug.c index d947a6070..a652a4963 100644 --- a/src/plugins/irc/irc-debug.c +++ b/src/plugins/irc/irc-debug.c @@ -83,12 +83,12 @@ irc_debug_printf (struct t_irc_server *server, int send, int modified, weechat_printf (irc_debug_buffer, "%s%s%s%s%s\t%s", - (server) ? weechat_color ("color_chat_server") : "", + (server) ? weechat_color ("chat_server") : "", (server) ? server->name : "", (server) ? " " : "", (send) ? - weechat_color ("color_chat_prefix_quit") : - weechat_color ("color_chat_prefix_join"), + weechat_color ("chat_prefix_quit") : + weechat_color ("chat_prefix_join"), (send) ? ((modified) ? IRC_DEBUG_PREFIX_SEND_MOD : IRC_DEBUG_PREFIX_SEND) : ((modified) ? IRC_DEBUG_PREFIX_RECV_MOD : IRC_DEBUG_PREFIX_RECV), diff --git a/src/plugins/irc/irc-display.c b/src/plugins/irc/irc-display.c index 03c2cbfca..ee213d487 100644 --- a/src/plugins/irc/irc-display.c +++ b/src/plugins/irc/irc-display.c @@ -344,31 +344,31 @@ irc_display_server (struct t_irc_server *server, int with_detail) _("connected") : _("not connected"), IRC_COLOR_CHAT_DELIMITERS); - weechat_printf (NULL, " server_autoconnect . . . . : %s%s", + weechat_printf (NULL, " autoconnect . . . . : %s%s", (server->autoconnect) ? _("on") : _("off"), (server->temp_server) ? _(" (temporary server, will not be saved)") : ""); - weechat_printf (NULL, " server_autoreconnect . . . : %s", + weechat_printf (NULL, " autoreconnect . . . : %s", (server->autoreconnect) ? _("on") : _("off")); - weechat_printf (NULL, " server_autoreconnect_delay : %d %s", + weechat_printf (NULL, " autoreconnect_delay : %d %s", server->autoreconnect_delay, NG_("second", "seconds", server->autoreconnect_delay)); - weechat_printf (NULL, " server_addresses . . . . . : %s", + weechat_printf (NULL, " addresses . . . . . : %s", server->addresses); - weechat_printf (NULL, " server_ipv6 . . . . . . . : %s", + weechat_printf (NULL, " ipv6 . . . . . . . : %s", (server->ipv6) ? _("on") : _("off")); - weechat_printf (NULL, " server_ssl . . . . . . . . : %s", + weechat_printf (NULL, " ssl . . . . . . . . : %s", (server->ssl) ? _("on") : _("off")); - weechat_printf (NULL, " server_password . . . . . : %s", + weechat_printf (NULL, " password . . . . . : %s", (server->password && server->password[0]) ? _("(hidden)") : ""); - weechat_printf (NULL, " server_nicks . . . . . . . : %s", + weechat_printf (NULL, " nicks . . . . . . . : %s", server->nicks); - weechat_printf (NULL, " server_username . . . . . : %s", + weechat_printf (NULL, " username . . . . . : %s", server->username); - weechat_printf (NULL, " server_realname . . . . . : %s", + weechat_printf (NULL, " realname . . . . . : %s", server->realname); - weechat_printf (NULL, " server_hostname . . . . . : %s", + weechat_printf (NULL, " hostname . . . . . : %s", (server->hostname) ? server->hostname : ""); if (server->command && server->command[0]) string = strdup (server->command); @@ -378,21 +378,21 @@ irc_display_server (struct t_irc_server *server, int with_detail) { if (weechat_config_boolean (irc_config_log_hide_nickserv_pwd)) irc_display_hide_password (string, 1); - weechat_printf (NULL, " server_command . . . . . . : %s", + weechat_printf (NULL, " command . . . . . . : %s", string); free (string); } else - weechat_printf (NULL, " server_command . . . . . . : %s", + weechat_printf (NULL, " command . . . . . . : %s", (server->command && server->command[0]) ? server->command : ""); - weechat_printf (NULL, " server_command_delay . . . : %d %s", + weechat_printf (NULL, " command_delay . . . : %d %s", server->command_delay, NG_("second", "seconds", server->command_delay)); - weechat_printf (NULL, " server_autojoin . . . . . : %s", + weechat_printf (NULL, " autojoin . . . . . : %s", (server->autojoin && server->autojoin[0]) ? server->autojoin : ""); - weechat_printf (NULL, " server_notify_levels . . . : %s", + weechat_printf (NULL, " notify_levels . . . : %s", (server->notify_levels && server->notify_levels[0]) ? server->notify_levels : ""); } diff --git a/src/plugins/irc/irc-input.c b/src/plugins/irc/irc-input.c index 537de4c69..586168e7a 100644 --- a/src/plugins/irc/irc-input.c +++ b/src/plugins/irc/irc-input.c @@ -158,7 +158,7 @@ irc_input_data_cb (void *data, struct t_gui_buffer *buffer, char *input_data) if (ptr_channel) { data_with_colors = (char *)irc_color_encode ((unsigned char *)input_data, - weechat_config_boolean (irc_config_irc_colors_send)); + weechat_config_boolean (irc_config_network_colors_send)); if (ptr_channel->dcc_chat) { diff --git a/src/plugins/irc/irc-nick.c b/src/plugins/irc/irc-nick.c index 0ead9034d..862d97c09 100644 --- a/src/plugins/irc/irc-nick.c +++ b/src/plugins/irc/irc-nick.c @@ -51,7 +51,7 @@ irc_nick_find_color (struct t_irc_nick *nick) weechat_config_integer (weechat_config_get_weechat ("look_color_nicks_number"))); snprintf (color_name, sizeof (color_name), - "color_chat_nick_color%d", color); + "chat_nick_color%d", color); return weechat_color (color_name); } @@ -165,7 +165,7 @@ irc_nick_new (struct t_irc_server *server, struct t_irc_channel *channel, irc_nick_get_gui_infos (channel->buffer, ptr_nick, &prefix, &prefix_color, &ptr_group); snprintf (str_prefix_color, sizeof (str_prefix_color), - "color_nicklist_prefix%d", + "nicklist_prefix%d", prefix_color); weechat_nicklist_add_nick (channel->buffer, ptr_group, ptr_nick->name, ptr_nick->color, @@ -211,7 +211,7 @@ irc_nick_new (struct t_irc_server *server, struct t_irc_channel *channel, irc_nick_get_gui_infos (channel->buffer, new_nick, &prefix, &prefix_color, &ptr_group); snprintf (str_prefix_color, sizeof (str_prefix_color), - "color_nicklist_prefix%d", + "nicklist_prefix%d", prefix_color); weechat_nicklist_add_nick (channel->buffer, ptr_group, new_nick->name, new_nick->color, @@ -263,7 +263,7 @@ irc_nick_change (struct t_irc_server *server, struct t_irc_channel *channel, irc_nick_get_gui_infos (channel->buffer, nick, &prefix, &prefix_color, &ptr_group); snprintf (str_prefix_color, sizeof (str_prefix_color), - "color_nicklist_prefix%d", + "nicklist_prefix%d", prefix_color); weechat_nicklist_add_nick (channel->buffer, ptr_group, nick->name, nick->color, @@ -280,8 +280,8 @@ irc_nick_set (struct t_irc_channel *channel, { char prefix, str_prefix_color[64]; int prefix_color; - struct t_gui_nick_group *ptr_group; + /* remove nick from nicklist */ irc_nick_get_gui_infos (channel->buffer, nick, &prefix, &prefix_color, &ptr_group); @@ -297,7 +297,7 @@ irc_nick_set (struct t_irc_channel *channel, irc_nick_get_gui_infos (channel->buffer, nick, &prefix, &prefix_color, &ptr_group); snprintf (str_prefix_color, sizeof (str_prefix_color), - "color_nicklist_prefix%d", + "nicklist_prefix%d", prefix_color); weechat_nicklist_add_nick (channel->buffer, ptr_group, nick->name, nick->color, @@ -481,20 +481,20 @@ irc_nick_as_prefix (struct t_irc_nick *nick, char *nickname, char *force_color) static char result[256]; snprintf (result, sizeof (result), "%s%s%s%s%s%s\t", - (weechat_config_string (irc_config_irc_nick_prefix) - && weechat_config_string (irc_config_irc_nick_prefix)[0]) ? + (weechat_config_string (irc_config_look_nick_prefix) + && weechat_config_string (irc_config_look_nick_prefix)[0]) ? IRC_COLOR_CHAT_DELIMITERS : "", - (weechat_config_string (irc_config_irc_nick_prefix) - && weechat_config_string (irc_config_irc_nick_prefix)[0]) ? - weechat_config_string (irc_config_irc_nick_prefix) : "", + (weechat_config_string (irc_config_look_nick_prefix) + && weechat_config_string (irc_config_look_nick_prefix)[0]) ? + weechat_config_string (irc_config_look_nick_prefix) : "", (force_color) ? force_color : ((nick) ? nick->color : IRC_COLOR_CHAT_NICK), (nick) ? nick->name : nickname, - (weechat_config_string (irc_config_irc_nick_suffix) - && weechat_config_string (irc_config_irc_nick_suffix)[0]) ? + (weechat_config_string (irc_config_look_nick_suffix) + && weechat_config_string (irc_config_look_nick_suffix)[0]) ? IRC_COLOR_CHAT_DELIMITERS : "", - (weechat_config_string (irc_config_irc_nick_suffix) - && weechat_config_string (irc_config_irc_nick_suffix)[0]) ? - weechat_config_string (irc_config_irc_nick_suffix) : ""); + (weechat_config_string (irc_config_look_nick_suffix) + && weechat_config_string (irc_config_look_nick_suffix)[0]) ? + weechat_config_string (irc_config_look_nick_suffix) : ""); return result; } diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index fc8480666..85b21f7c1 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -269,14 +269,14 @@ irc_protocol_is_highlight (char *message, char *nick) } /* no highlight by nickname and "irc_highlight" is empty */ - if (!weechat_config_string (irc_config_irc_highlight) - || !weechat_config_string (irc_config_irc_highlight)[0]) + if (!weechat_config_string (irc_config_look_highlight) + || !weechat_config_string (irc_config_look_highlight)[0]) return 0; /* convert both strings to lower case */ if ((msg = strdup (message)) == NULL) return 0; - highlight = strdup (weechat_config_string (irc_config_irc_highlight)); + highlight = strdup (weechat_config_string (irc_config_look_highlight)); if (!highlight) { free (msg); @@ -955,7 +955,7 @@ irc_protocol_cmd_notice (struct t_irc_server *server, char *command, } else { - if (nick && weechat_config_boolean (irc_config_irc_notice_as_pv)) + if (nick && weechat_config_boolean (irc_config_look_notice_as_pv)) { ptr_channel = irc_channel_search (server, nick); if (!ptr_channel) @@ -1251,7 +1251,7 @@ irc_protocol_cmd_pong (struct t_irc_server *server, char *command, server->lag_check_time.tv_sec = 0; server->lag_check_time.tv_usec = 0; server->lag_next_check = time (NULL) + - weechat_config_integer (irc_config_irc_lag_check); + weechat_config_integer (irc_config_network_lag_check); } return WEECHAT_RC_OK; @@ -1380,7 +1380,7 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *command, if ((look_infobar_delay_highlight > 0) && (ptr_channel->buffer != weechat_current_buffer)) weechat_infobar_printf (look_infobar_delay_highlight, - "color_infobar_highlight", + "infobar_highlight", _("Channel %s: * %s %s"), ptr_channel->name, nick, @@ -1546,7 +1546,7 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *command, if ((look_infobar_delay_highlight > 0) && (ptr_channel->buffer != weechat_current_buffer)) weechat_infobar_printf (look_infobar_delay_highlight, - "color_infobar_highlight", + "infobar_highlight", _("Channel %s: %s> %s"), ptr_channel->name, nick, @@ -2184,7 +2184,7 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *command, if ((look_infobar_delay_highlight > 0) && (ptr_channel->buffer != weechat_current_buffer)) weechat_infobar_printf (look_infobar_delay_highlight, - "color_infobar_highlight", + "infobar_highlight", _("Private %s> %s"), nick, pos_args); highlight_displayed = 1; @@ -2517,7 +2517,7 @@ irc_protocol_cmd_001 (struct t_irc_server *server, char *command, /* connection to IRC server is ok! */ server->is_connected = 1; server->lag_next_check = time (NULL) + - weechat_config_integer (irc_config_irc_lag_check); + weechat_config_integer (irc_config_network_lag_check); /* set away message if user was away (before disconnection for example) */ if (server->away_message && server->away_message[0]) @@ -2670,7 +2670,7 @@ irc_protocol_cmd_301 (struct t_irc_server *server, char *command, /* look for private buffer to display message */ ptr_channel = irc_channel_search (server, argv[3]); - if (!weechat_config_boolean (irc_config_irc_show_away_once) + if (!weechat_config_boolean (irc_config_look_show_away_once) || !ptr_channel || !(ptr_channel->away_message) || (strcmp (ptr_channel->away_message, pos_away_msg) != 0)) @@ -4284,9 +4284,9 @@ irc_protocol_cmd_433 (struct t_irc_server *server, char *command, } weechat_printf (server->buffer, - _("%s%s: nickname \"%s\" is already in use, " + _("%s: nickname \"%s\" is already in use, " "trying nickname #%d (\"%s\")"), - weechat_prefix ("info"), "irc", server->nick, + "irc", server->nick, nick_to_use + 1, server->nicks_array[nick_to_use]); irc_server_set_nick (server, server->nicks_array[nick_to_use]); diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index f7df652b0..13dbf5a7b 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -71,30 +71,222 @@ const int gnutls_cert_type_prio[] = { GNUTLS_CRT_X509, GNUTLS_CRT_OPENPGP, 0 }; /* + * irc_server_set_addresses: set addresses for server + */ + +void +irc_server_set_addresses (struct t_irc_server *server, char *addresses) +{ + int i; + char *pos, *error; + long number; + + /* free data */ + if (server->addresses) + { + free (server->addresses); + server->addresses = NULL; + } + server->addresses_count = 0; + if (server->addresses_array) + { + weechat_string_free_exploded (server->addresses_array); + server->addresses_array = NULL; + } + if (server->ports_array) + { + free (server->ports_array); + server->ports_array = NULL; + } + + /* set new address */ + server->addresses = strdup (addresses); + if (server->addresses) + { + server->addresses_array = weechat_string_explode (server->addresses, + ",", 0, 0, + &server->addresses_count); + server->ports_array = malloc (server->addresses_count * sizeof (server->ports_array[0])); + for (i = 0; i < server->addresses_count; i++) + { + pos = strchr (server->addresses_array[i], '/'); + if (pos) + { + pos[0] = 0; + pos++; + error = NULL; + number = strtol (pos, &error, 10); + server->ports_array[i] = (error && !error[0]) ? + number : IRC_SERVER_DEFAULT_PORT; + } + else + { + server->ports_array[i] = IRC_SERVER_DEFAULT_PORT; + } + } + } +} + +/* + * irc_server_set_nicks: set nicks for server + */ + +void +irc_server_set_nicks (struct t_irc_server *server, char *nicks) +{ + /* free data */ + if (server->nicks) + { + free (server->nicks); + server->nicks = NULL; + } + server->nicks_count = 0; + if (server->nicks_array) + { + weechat_string_free_exploded (server->nicks_array); + server->nicks_array = NULL; + } + + /* set new nicks */ + server->nicks = strdup ((nicks) ? nicks : IRC_SERVER_DEFAULT_NICKS); + if (server->nicks) + { + server->nicks_array = weechat_string_explode (server->nicks, + ",", 0, 0, + &server->nicks_count); + } +} + +/* + * irc_server_set_with_option: set a server option with a config option + */ + +void +irc_server_set_with_option (struct t_irc_server *server, + int index_option, + struct t_config_option *option) +{ + if (!server || !option) + return; + + switch (index_option) + { + case IRC_CONFIG_SERVER_AUTOCONNECT: + server->autoconnect = weechat_config_integer (option); + break; + case IRC_CONFIG_SERVER_AUTORECONNECT: + server->autoreconnect = weechat_config_integer (option); + break; + case IRC_CONFIG_SERVER_AUTORECONNECT_DELAY: + server->autoreconnect_delay = weechat_config_integer (option); + break; + case IRC_CONFIG_SERVER_ADDRESSES: + irc_server_set_addresses (server, weechat_config_string (option)); + break; + case IRC_CONFIG_SERVER_IPV6: + server->ipv6 = weechat_config_integer (option); + break; + case IRC_CONFIG_SERVER_SSL: + server->ssl = weechat_config_integer (option); + break; + case IRC_CONFIG_SERVER_PASSWORD: + if (server->password) + free (server->password); + server->password = strdup (weechat_config_string (option)); + break; + case IRC_CONFIG_SERVER_NICKS: + irc_server_set_nicks (server, weechat_config_string (option)); + break; + case IRC_CONFIG_SERVER_USERNAME: + if (server->username) + free (server->username); + server->username = strdup (weechat_config_string (option)); + break; + case IRC_CONFIG_SERVER_REALNAME: + if (server->realname) + free (server->realname); + server->realname = strdup (weechat_config_string (option)); + break; + case IRC_CONFIG_SERVER_HOSTNAME: + if (server->hostname) + free (server->hostname); + server->hostname = strdup (weechat_config_string (option)); + break; + case IRC_CONFIG_SERVER_COMMAND: + if (server->command) + free (server->command); + server->command = strdup (weechat_config_string (option)); + break; + case IRC_CONFIG_SERVER_COMMAND_DELAY: + server->command_delay = weechat_config_integer (option); + break; + case IRC_CONFIG_SERVER_AUTOJOIN: + if (server->autojoin) + free (server->autojoin); + server->autojoin = strdup (weechat_config_string (option)); + break; + case IRC_CONFIG_SERVER_AUTOREJOIN: + server->autorejoin = weechat_config_integer (option); + break; + case IRC_CONFIG_SERVER_NOTIFY_LEVELS: + if (server->notify_levels) + free (server->notify_levels); + server->notify_levels = strdup (weechat_config_string (option)); + break; + case IRC_CONFIG_NUM_SERVER_OPTIONS: + break; + } +} + +/* + * irc_server_set_nick: set nickname for a server + */ + +void +irc_server_set_nick (struct t_irc_server *server, char *nick) +{ + struct t_irc_channel *ptr_channel; + + if (server->nick) + free (server->nick); + server->nick = (nick) ? strdup (nick) : NULL; + + weechat_buffer_set (server->buffer, "nick", nick); + + for (ptr_channel = server->channels; ptr_channel; + ptr_channel = ptr_channel->next_channel) + { + weechat_buffer_set (ptr_channel->buffer, "nick", nick); + } +} + +/* * irc_server_init: init server struct with default values */ void irc_server_init (struct t_irc_server *server) { + int i; + /* user choices */ server->name = NULL; - server->autoconnect = 0; - server->autoreconnect = 1; - server->autoreconnect_delay = 30; + server->autoconnect = IRC_CONFIG_SERVER_DEFAULT_AUTOCONNECT; + server->autoreconnect = IRC_CONFIG_SERVER_DEFAULT_AUTORECONNECT; + server->autoreconnect_delay = IRC_CONFIG_SERVER_DEFAULT_AUTORECONNECT_DELAY; server->temp_server = 0; server->addresses = NULL; - server->ipv6 = 0; - server->ssl = 0; + server->ipv6 = IRC_CONFIG_SERVER_DEFAULT_IPV6; + server->ssl = IRC_CONFIG_SERVER_DEFAULT_SSL; server->password = NULL; server->nicks = NULL; server->username = NULL; server->realname = NULL; server->hostname = NULL; server->command = NULL; - server->command_delay = 1; + server->command_delay = IRC_CONFIG_SERVER_DEFAULT_COMMAND_DELAY; server->autojoin = NULL; - server->autorejoin = 0; + server->autorejoin = IRC_CONFIG_SERVER_DEFAULT_AUTOREJOIN; server->notify_levels = NULL; /* internal vars */ @@ -127,7 +319,7 @@ irc_server_init (struct t_irc_server *server) server->lag_check_time.tv_sec = 0; server->lag_check_time.tv_usec = 0; server->lag_next_check = time (NULL) + - weechat_config_integer (irc_config_irc_lag_check); + weechat_config_integer (irc_config_network_lag_check); server->cmd_list_regexp = NULL; server->queue_msg = 0; server->last_user_message = 0; @@ -136,6 +328,50 @@ irc_server_init (struct t_irc_server *server) server->buffer = NULL; server->channels = NULL; server->last_channel = NULL; + + /* init with default values from config */ + for (i = 0; i < IRC_CONFIG_NUM_SERVER_OPTIONS; i++) + { + irc_server_set_with_option (server, i, + irc_config_server_default[i]); + } +} + +/* + * irc_server_alloc: allocate a new server and add it to the servers queue + */ + +struct t_irc_server * +irc_server_alloc (char *name) +{ + struct t_irc_server *new_server; + + /* alloc memory for new server */ + if ((new_server = malloc (sizeof (*new_server))) == NULL) + { + weechat_printf (NULL, + _("%s%s: error when allocating new server"), + weechat_prefix ("error"), "irc"); + return NULL; + } + + /* initialize new server */ + irc_server_init (new_server); + + /* set name */ + new_server->name = strdup (name); + + /* add new server to queue */ + new_server->prev_server = last_irc_server; + new_server->next_server = NULL; + if (irc_servers) + last_irc_server->next_server = new_server; + else + irc_servers = new_server; + last_irc_server = new_server; + + /* all is ok, return address of new server */ + return new_server; } /* @@ -265,119 +501,10 @@ irc_server_init_with_url (struct t_irc_server *server, char *irc_url) */ /* - * irc_server_set_addresses: set addresses for server - */ - -void -irc_server_set_addresses (struct t_irc_server *server, char *addresses) -{ - int i; - char *pos, *error; - long number; - - /* free data */ - if (server->addresses) - { - free (server->addresses); - server->addresses = NULL; - } - server->addresses_count = 0; - if (server->addresses_array) - { - weechat_string_free_exploded (server->addresses_array); - server->addresses_array = NULL; - } - if (server->ports_array) - { - free (server->ports_array); - server->ports_array = NULL; - } - - /* set new address */ - server->addresses = strdup (addresses); - if (server->addresses) - { - server->addresses_array = weechat_string_explode (server->addresses, - ",", 0, 0, - &server->addresses_count); - server->ports_array = malloc (server->addresses_count * sizeof (server->ports_array[0])); - for (i = 0; i < server->addresses_count; i++) - { - pos = strchr (server->addresses_array[i], '/'); - if (pos) - { - pos[0] = 0; - pos++; - error = NULL; - number = strtol (pos, &error, 10); - server->ports_array[i] = (error && !error[0]) ? - number : IRC_SERVER_DEFAULT_PORT; - } - else - { - server->ports_array[i] = IRC_SERVER_DEFAULT_PORT; - } - } - } -} - -/* - * irc_server_set_nicks: set nicks for server - */ - -void -irc_server_set_nicks (struct t_irc_server *server, char *nicks) -{ - /* free data */ - if (server->nicks) - { - free (server->nicks); - server->nicks = NULL; - } - server->nicks_count = 0; - if (server->nicks_array) - { - weechat_string_free_exploded (server->nicks_array); - server->nicks_array = NULL; - } - - /* set new nicks */ - server->nicks = strdup ((nicks) ? nicks : IRC_SERVER_DEFAULT_NICKS); - if (server->nicks) - { - server->nicks_array = weechat_string_explode (server->nicks, - ",", 0, 0, - &server->nicks_count); - } -} - -/* - * irc_server_set_nick: set nickname for a server - */ - -void -irc_server_set_nick (struct t_irc_server *server, char *nick) -{ - struct t_irc_channel *ptr_channel; - - if (server->nick) - free (server->nick); - server->nick = (nick) ? strdup (nick) : NULL; - - weechat_buffer_set (server->buffer, "nick", nick); - - for (ptr_channel = server->channels; ptr_channel; - ptr_channel = ptr_channel->next_channel) - { - weechat_buffer_set (ptr_channel->buffer, "nick", nick); - } -} - -/* * irc_server_init_with_config_options: init a server with config options * (called when reading config file) */ - +/* void irc_server_init_with_config_options (struct t_irc_server *server, struct t_config_section *section, @@ -386,7 +513,8 @@ irc_server_init_with_config_options (struct t_irc_server *server, struct t_config_option *ptr_option; struct t_irc_server *ptr_server; - ptr_option = weechat_config_search_option (NULL, section, "server_name"); + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_NAME); if (!ptr_option) { irc_server_free (server); @@ -411,27 +539,30 @@ irc_server_init_with_config_options (struct t_irc_server *server, else ptr_server = server; - /* server internal name */ + // server internal name if (ptr_server->name) free (ptr_server->name); ptr_server->name = strdup (weechat_config_string (ptr_option)); - /* auto-connect */ - ptr_option = weechat_config_search_option (NULL, section, "server_autoconnect"); + // auto-connect + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_AUTOCONNECT); if (ptr_option) ptr_server->autoconnect = weechat_config_integer (ptr_option); - /* auto-reconnect */ - ptr_option = weechat_config_search_option (NULL, section, "server_autoreconnect"); + // auto-reconnect + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_AUTORECONNECT); if (ptr_option) ptr_server->autoreconnect = weechat_config_integer (ptr_option); - /* auto-reconnect delay */ - ptr_option = weechat_config_search_option (NULL, section, "server_autoreconnect_delay"); + // auto-reconnect delay + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_AUTORECONNECT_DELAY); if (ptr_option) ptr_server->autoreconnect_delay = weechat_config_integer (ptr_option); - /* addresses */ + // addresses if (ptr_server->addresses) { free (ptr_server->addresses); @@ -448,31 +579,35 @@ irc_server_init_with_config_options (struct t_irc_server *server, free (ptr_server->ports_array); ptr_server->ports_array = NULL; } - ptr_option = weechat_config_search_option (NULL, section, "server_addresses"); + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_ADDRESSES); if (ptr_option) irc_server_set_addresses (ptr_server, weechat_config_string (ptr_option)); - /* ipv6 */ - ptr_option = weechat_config_search_option (NULL, section, "server_ipv6"); + // ipv6 + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_IPV6); if (ptr_option) ptr_server->ipv6 = weechat_config_integer (ptr_option); - /* SSL */ - ptr_option = weechat_config_search_option (NULL, section, "server_ssl"); + // SSL + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_SSL); if (ptr_option) ptr_server->ssl = weechat_config_integer (ptr_option); - /* password */ + // password if (ptr_server->password) { free (ptr_server->password); ptr_server->password = NULL; } - ptr_option = weechat_config_search_option (NULL, section, "server_password"); + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_PASSWORD); if (ptr_option) ptr_server->password = strdup (weechat_config_string (ptr_option)); - /* nicks */ + // nicks if (ptr_server->nicks) { free (ptr_server->nicks); @@ -484,116 +619,92 @@ irc_server_init_with_config_options (struct t_irc_server *server, weechat_string_free_exploded (ptr_server->nicks_array); ptr_server->nicks_array = NULL; } - ptr_option = weechat_config_search_option (NULL, section, "server_nicks"); + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_NICKS); if (ptr_option) irc_server_set_nicks (ptr_server, weechat_config_string (ptr_option)); - /* username */ + // username if (ptr_server->username) { free (ptr_server->username); ptr_server->username = NULL; } - ptr_option = weechat_config_search_option (NULL, section, "server_username"); + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_USERNAME); if (ptr_option) ptr_server->username = strdup (weechat_config_string (ptr_option)); - /* realname */ + // realname if (ptr_server->realname) { free (ptr_server->realname); ptr_server->realname = NULL; } - ptr_option = weechat_config_search_option (NULL, section, "server_realname"); + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_REALNAME); if (ptr_option) ptr_server->realname = strdup (weechat_config_string (ptr_option)); - /* hostname */ + // hostname if (ptr_server->hostname) { free (ptr_server->hostname); ptr_server->hostname = NULL; } - ptr_option = weechat_config_search_option (NULL, section, "server_hostname"); + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_HOSTNAME); if (ptr_option) ptr_server->hostname = strdup (weechat_config_string (ptr_option)); - /* command */ + // command if (ptr_server->command) { free (ptr_server->command); ptr_server->command = NULL; } - ptr_option = weechat_config_search_option (NULL, section, "server_command"); + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_COMMAND); if (ptr_option) ptr_server->command = strdup (weechat_config_string (ptr_option)); - /* command delay */ - ptr_option = weechat_config_search_option (NULL, section, "server_command_delay"); + // command delay + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_COMMAND_DELAY); if (ptr_option) ptr_server->command_delay = weechat_config_integer (ptr_option); - /* auto-join */ + // auto-join if (ptr_server->autojoin) { free (ptr_server->autojoin); ptr_server->autojoin = NULL; } - ptr_option = weechat_config_search_option (NULL, section, "server_autojoin"); + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_AUTOJOIN); if (ptr_option) ptr_server->autojoin = strdup (weechat_config_string (ptr_option)); - /* auto-rejoin */ - ptr_option = weechat_config_search_option (NULL, section, "server_autorejoin"); + // auto-rejoin + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_AUTOREJOIN); if (ptr_option) ptr_server->autorejoin = weechat_config_integer (ptr_option); - /* notify_levels */ + // notify_levels if (ptr_server->notify_levels) { free (ptr_server->notify_levels); ptr_server->notify_levels = NULL; } - ptr_option = weechat_config_search_option (NULL, section, "server_notify_levels"); + ptr_option = weechat_config_search_option (NULL, section, + IRC_CONFIG_SERVER_NOTIFY_LEVELS); if (ptr_option) ptr_server->notify_levels = strdup (weechat_config_string (ptr_option)); ptr_server->reloaded_from_config = 1; } - -/* - * irc_server_alloc: allocate a new server and add it to the servers queue - */ - -struct t_irc_server * -irc_server_alloc () -{ - struct t_irc_server *new_server; - - /* alloc memory for new server */ - if ((new_server = malloc (sizeof (*new_server))) == NULL) - { - weechat_printf (NULL, - _("%s%s: error when allocating new server"), - weechat_prefix ("error"), "irc"); - return NULL; - } - - /* initialize new server */ - irc_server_init (new_server); - - /* add new server to queue */ - new_server->prev_server = last_irc_server; - new_server->next_server = NULL; - if (irc_servers) - last_irc_server->next_server = new_server; - else - irc_servers = new_server; - last_irc_server = new_server; - - /* all is ok, return address of new server */ - return new_server; -} +*/ /* * irc_server_outqueue_add: add a message in out queue @@ -797,10 +908,10 @@ irc_server_new (char *name, int autoconnect, int autoreconnect, (autorejoin) ? "on" : "off", (notify_levels) ? notify_levels : ""); } - - if ((new_server = irc_server_alloc ())) + + new_server = irc_server_alloc (name); + if (new_server) { - new_server->name = strdup (name); new_server->autoconnect = autoconnect; new_server->autoreconnect = autoreconnect; new_server->autoreconnect_delay = autoreconnect_delay; @@ -828,6 +939,7 @@ irc_server_new (char *name, int autoconnect, int autoreconnect, } else return NULL; + return new_server; } @@ -876,22 +988,46 @@ irc_server_duplicate (struct t_irc_server *server, char *new_name) int irc_server_rename (struct t_irc_server *server, char *new_name) { - char *str; + int length; + char *option_name, *name, *pos_option; + struct t_plugin_infolist *infolist; /* check if another server exists with this name */ if (irc_server_search (new_name)) return 0; - /* rename server */ - str = strdup (new_name); - if (str) - { - if (server->name) - free (server->name); - server->name = str; - return 1; + /* rename options */ + length = 32 + strlen (server->name) + 1; + option_name = malloc (length); + if (!option_name) + return 0; + snprintf (option_name, length, "irc.server.%s.*", server->name); + infolist = weechat_infolist_get ("options", option_name); + free (option_name); + while (weechat_infolist_next (infolist)) + { + name = weechat_infolist_string (infolist, "name"); + pos_option = strchr (name, '.'); + if (pos_option) + { + pos_option++; + length = strlen (new_name) + 1 + strlen (pos_option) + 1; + option_name = malloc (length); + if (option_name) + { + snprintf (option_name, length, "%s.%s", new_name, pos_option); + /* TODO: complete this function */ + free (option_name); + } + } } - return 0; + weechat_infolist_free (infolist); + + /* rename server */ + if (server->name) + free (server->name); + server->name = strdup (new_name); + return 1; } /* @@ -955,7 +1091,7 @@ irc_server_outqueue_send (struct t_irc_server *server) { time_now = time (NULL); if (time_now >= server->last_user_message + - weechat_config_integer (irc_config_irc_anti_flood)) + weechat_config_integer (irc_config_network_anti_flood)) { if (server->outqueue->message_before_mod) { @@ -1158,7 +1294,7 @@ irc_server_send_one_msg (struct t_irc_server *server, char *message) server->name, ptr_chan_nick); } - msg_encoded = weechat_hook_modifier_exec ("charset_decode", + msg_encoded = weechat_hook_modifier_exec ("charset_encode", modifier_data, ptr_msg); @@ -1178,9 +1314,9 @@ irc_server_send_one_msg (struct t_irc_server *server, char *message) queue = 0; if ((server->queue_msg) && ((server->outqueue) - || ((weechat_config_integer (irc_config_irc_anti_flood) > 0) + || ((weechat_config_integer (irc_config_network_anti_flood) > 0) && (time_now - server->last_user_message < - weechat_config_integer (irc_config_irc_anti_flood))))) + weechat_config_integer (irc_config_network_anti_flood))))) queue = 1; /* if queue, then only queue message and send nothing now */ @@ -1638,18 +1774,18 @@ irc_server_timer_cb (void *data) /* lag timeout => disconnect */ if ((ptr_server->lag_check_time.tv_sec != 0) - && (weechat_config_integer (irc_config_irc_lag_disconnect) > 0)) + && (weechat_config_integer (irc_config_network_lag_disconnect) > 0)) { gettimeofday (&tv, NULL); diff = (int) weechat_timeval_diff (&(ptr_server->lag_check_time), &tv); - if (diff / 1000 > weechat_config_integer (irc_config_irc_lag_disconnect) * 60) + if (diff / 1000 > weechat_config_integer (irc_config_network_lag_disconnect) * 60) { weechat_printf (ptr_server->buffer, - _("%s%s: lag is high, " + _("%s: lag is high, " "disconnecting from " "server..."), - weechat_prefix ("info"), "irc"); + "irc"); irc_server_disconnect (ptr_server, 1); } } @@ -1670,7 +1806,7 @@ irc_server_timer_check_away (void *empty) { (void) empty; - if (weechat_config_integer (irc_config_irc_away_check) > 0) + if (weechat_config_integer (irc_config_network_away_check) > 0) irc_server_check_away (); } @@ -1757,8 +1893,8 @@ irc_server_reconnect_schedule (struct t_irc_server *server) { server->reconnect_start = time (NULL); weechat_printf (server->buffer, - _("%s%s: reconnecting to server in %d %s"), - weechat_prefix ("info"), "irc", + _("%s: reconnecting to server in %d %s"), + "irc", server->autoreconnect_delay, NG_("second", "seconds", server->autoreconnect_delay)); @@ -1778,16 +1914,21 @@ irc_server_login (struct t_irc_server *server) irc_server_sendf (server, "PASS %s", server->password); if (!server->nick) - irc_server_set_nick (server, server->nicks_array[0]); + irc_server_set_nick (server, + (server->nicks_array) ? + server->nicks_array[0] : "weechat"); irc_server_sendf (server, "NICK %s\n" "USER %s %s %s :%s", server->nick, - server->username, - server->username, + (server->username && server->username[0]) ? + server->username : "weechat", + (server->username && server->username[0]) ? + server->username : "weechat", server->addresses_array[server->current_address], - server->realname); + (server->realname && server->realname[0]) ? + server->realname : "weechat"); } /* @@ -1803,8 +1944,8 @@ irc_server_switch_address (struct t_irc_server *server) { server->current_address++; weechat_printf (server->buffer, - _("%s%s: switching address to %s/%d"), - weechat_prefix ("info"), "irc", + _("%s: switching address to %s/%d"), + "irc", server->addresses_array[server->current_address], server->ports_array[server->current_address]); irc_server_connect (server, 0); @@ -2233,7 +2374,7 @@ irc_server_pass_socks5proxy (int sock, char *address, int port) /* buffer[3] = address type */ switch (buffer[3]) { - case 1 : + case 1: /* ipv4 * server socks return server bound address and port * address of 4 bytes and port of 2 bytes (= 6 bytes) @@ -2253,7 +2394,7 @@ irc_server_pass_socks5proxy (int sock, char *address, int port) if (recv (sock, buffer, addr_len + 2, 0) != (addr_len + 2)) return 1; break; - case 4 : + case 4: /* ipv6 * server socks return server bound address and port * address of 16 bytes and port of 2 bytes (= 18 bytes) @@ -2462,6 +2603,26 @@ irc_server_connect (struct t_irc_server *server, int disable_autojoin) char *config_proxy_type, *config_proxy_address; int config_proxy_use, config_proxy_ipv6, config_proxy_port; + if (!server->addresses || !server->addresses[0]) + { + weechat_printf (server->buffer, + _("%s%s: addresses not defined for server \"%s\", " + "cannot connect"), + weechat_prefix ("error"), "irc", + server->name); + return 0; + } + + if (!server->nicks || !server->nicks[0]) + { + weechat_printf (server->buffer, + _("%s%s: nicks not defined for server \"%s\", " + "cannot connect"), + weechat_prefix ("error"), "irc", + server->name); + return 0; + } + config_proxy_use = weechat_config_boolean ( weechat_config_get_weechat ("proxy_use")); config_proxy_ipv6 = weechat_config_boolean ( @@ -2498,9 +2659,9 @@ irc_server_connect (struct t_irc_server *server, int disable_autojoin) if (config_proxy_use) { weechat_printf (server->buffer, - _("%s%s: connecting to server %s/%d%s%s via %s " + _("%s: connecting to server %s/%d%s%s via %s " "proxy %s/%d%s..."), - weechat_prefix ("info"), "irc", + "irc", server->addresses_array[server->current_address], server->ports_array[server->current_address], (server->ipv6) ? " (IPv6)" : "", @@ -2521,8 +2682,8 @@ irc_server_connect (struct t_irc_server *server, int disable_autojoin) else { weechat_printf (server->buffer, - _("%s%s: connecting to server %s/%d%s%s..."), - weechat_prefix ("info"), "irc", + _("%s: connecting to server %s/%d%s%s..."), + "irc", server->addresses_array[server->current_address], server->ports_array[server->current_address], (server->ipv6) ? " (IPv6)" : "", @@ -2648,8 +2809,8 @@ void irc_server_reconnect (struct t_irc_server *server) { weechat_printf (server->buffer, - _("%s%s: reconnecting to server..."), - weechat_prefix ("info"), "irc"); + _("%s: reconnecting to server..."), + "irc"); server->reconnect_start = 0; server->current_address = 0; @@ -2696,8 +2857,8 @@ irc_server_disconnect (struct t_irc_server *server, int reconnect) ptr_channel = ptr_channel->next_channel) { weechat_printf (ptr_channel->buffer, - _("%s%s: disconnected from server"), - weechat_prefix ("info"), "irc"); + _("%s: disconnected from server"), + "irc"); } } @@ -2705,8 +2866,8 @@ irc_server_disconnect (struct t_irc_server *server, int reconnect) if (server->buffer) weechat_printf (server->buffer, - _("%s%s: disconnected from server"), - weechat_prefix ("info"), "irc"); + _("%s: disconnected from server"), + "irc"); server->current_address = 0; if (server->nick_modes) @@ -2725,7 +2886,7 @@ irc_server_disconnect (struct t_irc_server *server, int reconnect) server->lag_check_time.tv_sec = 0; server->lag_check_time.tv_usec = 0; server->lag_next_check = time (NULL) + - weechat_config_integer (irc_config_irc_lag_check); + weechat_config_integer (irc_config_network_lag_check); if ((reconnect) && (server->autoreconnect)) irc_server_reconnect_schedule (server); diff --git a/src/plugins/irc/irc-server.h b/src/plugins/irc/irc-server.h index 7febdbc8d..cf18813ab 100644 --- a/src/plugins/irc/irc-server.h +++ b/src/plugins/irc/irc-server.h @@ -138,11 +138,19 @@ extern const int gnutls_prot_prio[]; extern struct t_irc_message *irc_recv_msgq, *irc_msgq_last_msg; +extern void irc_server_set_addresses (struct t_irc_server *server, + char *addresses); +extern void irc_server_set_nicks (struct t_irc_server *server, char *nicks); +extern void irc_server_set_with_option (struct t_irc_server *server, + int index_option, + struct t_config_option *option); extern void irc_server_init (struct t_irc_server *server); -extern struct t_irc_server *irc_server_alloc (); -extern void irc_server_init_with_config_options (struct t_irc_server *server, +extern struct t_irc_server *irc_server_alloc (char *name); + +/*extern void irc_server_init_with_config_options (struct t_irc_server *server, struct t_config_section *section, int config_reload); +*/ extern struct t_irc_server *irc_server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_delay, diff --git a/src/plugins/irc/irc.c b/src/plugins/irc/irc.c index d2df7d2ab..a41d5a503 100644 --- a/src/plugins/irc/irc.c +++ b/src/plugins/irc/irc.c @@ -43,7 +43,7 @@ WEECHAT_PLUGIN_DESCRIPTION("IRC (Internet Relay Chat) plugin for WeeChat"); WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>"); WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION); WEECHAT_PLUGIN_WEECHAT_VERSION(WEECHAT_VERSION); -WEECHAT_PLUGIN_LICENSE("GPL"); +WEECHAT_PLUGIN_LICENSE("GPL3"); struct t_weechat_plugin *weechat_irc_plugin = NULL; @@ -99,7 +99,8 @@ irc_signal_quit_cb (void *data, char *signal, char *type_data, for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server) { - irc_command_quit_server (ptr_server, (char *)signal_data); + irc_command_quit_server (ptr_server, + (signal_data) ? (char *)signal_data : NULL); } } diff --git a/src/plugins/irc/irc.h b/src/plugins/irc/irc.h index a46228a6b..f00c7922f 100644 --- a/src/plugins/irc/irc.h +++ b/src/plugins/irc/irc.h @@ -47,21 +47,21 @@ ptr_server, weechat_buffer_get_string (__buffer, "name")); \ } -#define IRC_COLOR_CHAT weechat_color("color_chat") -#define IRC_COLOR_CHAT_CHANNEL weechat_color("color_chat_channel") -#define IRC_COLOR_CHAT_DELIMITERS weechat_color("color_chat_delimiters") -#define IRC_COLOR_CHAT_HIGHLIGHT weechat_color("color_chat_highlight") -#define IRC_COLOR_CHAT_HOST weechat_color("color_chat_host") -#define IRC_COLOR_CHAT_NICK weechat_color("color_chat_nick") -#define IRC_COLOR_CHAT_NICK_SELF weechat_color("color_chat_nick_self") -#define IRC_COLOR_CHAT_NICK_OTHER weechat_color("color_chat_nick_other") -#define IRC_COLOR_CHAT_SERVER weechat_color("color_chat_server") -#define IRC_COLOR_INFOBAR_HIGHLIGHT weechat_color("color_infobar_highlight") -#define IRC_COLOR_NICKLIST_PREFIX1 weechat_color("color_nicklist_prefix1") -#define IRC_COLOR_NICKLIST_PREFIX2 weechat_color("color_nicklist_prefix2") -#define IRC_COLOR_NICKLIST_PREFIX3 weechat_color("color_nicklist_prefix3") -#define IRC_COLOR_NICKLIST_PREFIX4 weechat_color("color_nicklist_prefix4") -#define IRC_COLOR_NICKLIST_PREFIX5 weechat_color("color_nicklist_prefix5") +#define IRC_COLOR_CHAT weechat_color("chat") +#define IRC_COLOR_CHAT_CHANNEL weechat_color("chat_channel") +#define IRC_COLOR_CHAT_DELIMITERS weechat_color("chat_delimiters") +#define IRC_COLOR_CHAT_HIGHLIGHT weechat_color("chat_highlight") +#define IRC_COLOR_CHAT_HOST weechat_color("chat_host") +#define IRC_COLOR_CHAT_NICK weechat_color("chat_nick") +#define IRC_COLOR_CHAT_NICK_SELF weechat_color("chat_nick_self") +#define IRC_COLOR_CHAT_NICK_OTHER weechat_color("chat_nick_other") +#define IRC_COLOR_CHAT_SERVER weechat_color("chat_server") +#define IRC_COLOR_INFOBAR_HIGHLIGHT weechat_color("infobar_highlight") +#define IRC_COLOR_NICKLIST_PREFIX1 weechat_color("nicklist_prefix1") +#define IRC_COLOR_NICKLIST_PREFIX2 weechat_color("nicklist_prefix2") +#define IRC_COLOR_NICKLIST_PREFIX3 weechat_color("nicklist_prefix3") +#define IRC_COLOR_NICKLIST_PREFIX4 weechat_color("nicklist_prefix4") +#define IRC_COLOR_NICKLIST_PREFIX5 weechat_color("nicklist_prefix5") extern struct t_weechat_plugin *weechat_irc_plugin; extern struct t_hook *irc_hook_timer_check_away; diff --git a/src/plugins/logger/logger.c b/src/plugins/logger/logger.c index c82eb9436..85b05f8c1 100644 --- a/src/plugins/logger/logger.c +++ b/src/plugins/logger/logger.c @@ -44,7 +44,7 @@ WEECHAT_PLUGIN_DESCRIPTION("Logger plugin for WeeChat"); WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>"); WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION); WEECHAT_PLUGIN_WEECHAT_VERSION(WEECHAT_VERSION); -WEECHAT_PLUGIN_LICENSE("GPL"); +WEECHAT_PLUGIN_LICENSE("GPL3"); struct t_weechat_plugin *weechat_logger_plugin = NULL; @@ -642,11 +642,10 @@ logger_print_cb (void *data, struct t_gui_buffer *buffer, time_t date, */ int -logger_config_cb (void *data, char *type, char *option, char *value) +logger_config_cb (void *data, char *option, char *value) { /* make C compiler happy */ (void) data; - (void) type; (void) option; (void) value; @@ -679,16 +678,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin) weechat_hook_print (NULL, NULL, NULL, 1, &logger_print_cb, NULL); - weechat_hook_config ("plugin", "logger." LOGGER_OPTION_PATH, - &logger_config_cb, NULL); - weechat_hook_config ("plugin", "logger." LOGGER_OPTION_NAME_LOWER_CASE, - &logger_config_cb, NULL); - weechat_hook_config ("plugin", "logger." LOGGER_OPTION_TIME_FORMAT, - &logger_config_cb, NULL); - weechat_hook_config ("plugin", "logger." LOGGER_OPTION_INFO_LINES, - &logger_config_cb, NULL); - weechat_hook_config ("plugin", "logger." LOGGER_OPTION_BACKLOG, - &logger_config_cb, NULL); + weechat_hook_config ("plugins.var.logger.*", &logger_config_cb, NULL); return WEECHAT_RC_OK; } diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c index 8b5ebb195..2e942006b 100644 --- a/src/plugins/plugin-api.c +++ b/src/plugins/plugin-api.c @@ -198,8 +198,6 @@ plugin_api_prefix (char *prefix) if (!prefix) return gui_chat_prefix_empty; - if (string_strcasecmp (prefix, "info") == 0) - return gui_chat_prefix[GUI_CHAT_PREFIX_INFO]; if (string_strcasecmp (prefix, "error") == 0) return gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]; if (string_strcasecmp (prefix, "network") == 0) @@ -504,6 +502,77 @@ plugin_api_infolist_get_add_buffer_line (struct t_plugin_infolist *infolist, } /* + * plugin_api_infolist_get_add_options: add config options in a list + * return 1 if ok, 0 if error + */ + +int +plugin_api_infolist_get_add_options (struct t_plugin_infolist *infolist, + char *option_name) +{ + struct t_config_file *ptr_config; + struct t_config_section *ptr_section; + struct t_config_option *ptr_option; + struct t_plugin_infolist_item *ptr_item; + int length; + char *option_full_name; + + if (!infolist) + return 0; + + for (ptr_config = config_files; ptr_config; + ptr_config = ptr_config->next_config) + { + for (ptr_section = ptr_config->sections; ptr_section; + ptr_section = ptr_section->next_section) + { + for (ptr_option = ptr_section->options; ptr_option; + ptr_option = ptr_option->next_option) + { + length = strlen (ptr_config->name) + 1 + + strlen (ptr_section->name) + 1 + + strlen (ptr_option->name) + 1; + option_full_name = malloc (length); + if (option_full_name) + { + snprintf (option_full_name, length, "%s.%s.%s", + ptr_config->name, + ptr_section->name, + ptr_option->name); + if (!option_name || !option_name[0] + || string_match (option_full_name, option_name, 0)) + { + ptr_item = plugin_infolist_new_item (infolist); + if (!ptr_item) + { + free (option_full_name); + return 0; + } + if (!plugin_infolist_new_var_string (ptr_item, + "full_name", + option_full_name)) + { + free (option_full_name); + return 0; + } + if (!plugin_infolist_new_var_string (ptr_item, + "name", + ptr_option->name)) + { + free (option_full_name); + return 0; + } + } + free (option_full_name); + } + } + } + } + + return 1; +} + +/* * plugin_api_infolist_get: get list with infos about WeeChat structures * WARNING: caller has to free string returned * by this function after use, with weechat_infolist_free() @@ -582,6 +651,19 @@ plugin_api_infolist_get (char *name, void *pointer) return ptr_infolist; } } + else if (string_strcasecmp (name, "options") == 0) + { + ptr_infolist = plugin_infolist_new (); + if (ptr_infolist) + { + if (!plugin_api_infolist_get_add_options (ptr_infolist, pointer)) + { + plugin_infolist_free (ptr_infolist); + return NULL; + } + return ptr_infolist; + } + } /* list not found */ return NULL; diff --git a/src/plugins/plugin-config.c b/src/plugins/plugin-config.c index 73a49d80c..1a6b41f1b 100644 --- a/src/plugins/plugin-config.c +++ b/src/plugins/plugin-config.c @@ -32,82 +32,43 @@ #include "../core/weechat.h" #include "../core/wee-config.h" #include "../core/wee-hook.h" +#include "../core/wee-list.h" #include "../core/wee-log.h" #include "../core/wee-string.h" #include "plugin-config.h" +#include "weechat-plugin.h" -struct t_config_file *plugin_config = NULL; -struct t_config_option *plugin_options = NULL; -struct t_config_option *last_plugin_option = NULL; +struct t_config_file *plugin_config_file = NULL; +struct t_config_section *plugin_config_section_var = NULL; /* - * plugin_config_search_internal: search a plugin option (internal function) - * This function should not be called directly. - */ - -struct t_config_option * -plugin_config_search_internal (char *option_name) -{ - struct t_config_option *ptr_option; - - for (ptr_option = plugin_options; ptr_option; - ptr_option = ptr_option->next_option) - { - if (string_strcasecmp (ptr_option->name, option_name) == 0) - { - return ptr_option; - } - } - - /* plugin option not found */ - return NULL; -} - -/* * plugin_config_search: search a plugin option */ struct t_config_option * plugin_config_search (char *plugin_name, char *option_name) { - char *internal_option; + int length; + char *option_full_name; struct t_config_option *ptr_option; - internal_option = malloc (strlen (plugin_name) + strlen (option_name) + 2); - if (!internal_option) - return NULL; - - strcpy (internal_option, plugin_name); - strcat (internal_option, "."); - strcat (internal_option, option_name); - - ptr_option = plugin_config_search_internal (internal_option); - - free (internal_option); - - return ptr_option; -} - -/* - * plugin_config_find_pos: find position for a plugin option (for sorting options) - */ - -struct t_config_option * -plugin_config_find_pos (char *name) -{ - struct t_config_option *ptr_option; + ptr_option = NULL; - for (ptr_option = plugin_options; ptr_option; - ptr_option = ptr_option->next_option) + length = strlen (plugin_name) + 1 + strlen (option_name) + 1; + option_full_name = malloc (length); + if (option_full_name) { - if (string_strcasecmp (name, ptr_option->name) < 0) - return ptr_option; + snprintf (option_full_name, length, "%s.%s", + plugin_name, option_name); + ptr_option = config_file_search_option (plugin_config_file, + plugin_config_section_var, + option_full_name); + free (option_full_name); } - /* position not found (we will add to the end of list) */ - return NULL; + return ptr_option; } /* @@ -119,164 +80,55 @@ plugin_config_find_pos (char *name) int plugin_config_set_internal (char *option, char *value) { - struct t_config_option *ptr_option, *pos_option; int rc; - + struct t_config_option *ptr_option; + rc = 0; - ptr_option = plugin_config_search_internal (option); + ptr_option = config_file_search_option (plugin_config_file, + plugin_config_section_var, + option); if (ptr_option) { - if (!value || !value[0]) - { - /* remove option from list */ - if (ptr_option->prev_option) - (ptr_option->prev_option)->next_option = - ptr_option->next_option; - else - plugin_options = ptr_option->next_option; - if (ptr_option->next_option) - (ptr_option->next_option)->prev_option = - ptr_option->prev_option; - rc = 1; - } - else - { - /* replace old value by new one */ - if (ptr_option->value) - free (ptr_option->value); - ptr_option->value = strdup (value); - rc = 1; - } + rc = config_file_option_set (ptr_option, value, 0); } else { - if (value && value[0]) - { - ptr_option = malloc (sizeof (*ptr_option)); - if (ptr_option) - { - /* create new option */ - ptr_option->name = strdup (option); - string_tolower (ptr_option->name); - ptr_option->type = CONFIG_OPTION_STRING; - ptr_option->description = NULL; - ptr_option->string_values = NULL; - ptr_option->min = 0; - ptr_option->max = 0; - ptr_option->default_value = NULL; - ptr_option->value = strdup (value); - ptr_option->callback_change = NULL; - - if (plugin_options) - { - pos_option = plugin_config_find_pos (ptr_option->name); - if (pos_option) - { - /* insert option into the list (before option found) */ - ptr_option->prev_option = pos_option->prev_option; - ptr_option->next_option = pos_option; - if (pos_option->prev_option) - pos_option->prev_option->next_option = ptr_option; - else - plugin_options = ptr_option; - pos_option->prev_option = ptr_option; - } - else - { - /* add option to the end */ - ptr_option->prev_option = last_plugin_option; - ptr_option->next_option = NULL; - last_plugin_option->next_option = ptr_option; - last_plugin_option = ptr_option; - } - } - else - { - ptr_option->prev_option = NULL; - ptr_option->next_option = NULL; - plugin_options = ptr_option; - last_plugin_option = ptr_option; - } - rc = 1; - } - } - else - rc = 0; + ptr_option = config_file_new_option ( + plugin_config_file, plugin_config_section_var, + option, "string", NULL, + NULL, 0, 0, value, NULL, NULL, NULL, NULL, NULL, NULL); + rc = (ptr_option) ? 1 : 0; } - if (rc) - hook_config_exec ("plugin", option, value); - return rc; } /* * plugin_config_set: set value for a plugin option (create it if not found) - * return: 1 if ok, 0 if error + * Return: 1 if ok, 0 if error */ int plugin_config_set (char *plugin_name, char *option_name, char *value) { - char *internal_option; - int return_code; - - internal_option = malloc (strlen (plugin_name) + strlen (option_name) + 2); - if (!internal_option) - return 0; - - strcpy (internal_option, plugin_name); - strcat (internal_option, "."); - strcat (internal_option, option_name); + int length, rc; + char *option_full_name; - return_code = plugin_config_set_internal (internal_option, value); - free (internal_option); - - return return_code; -} - -/* - * plugin_config_free: free a plugin option and remove it from list - */ - -void -plugin_config_free (struct t_config_option *option) -{ - struct t_config_option *new_plugin_options; + rc = 0; - /* remove option from list */ - if (last_plugin_option == option) - last_plugin_option = option->prev_option; - if (option->prev_option) + length = strlen (plugin_name) + 1 + strlen (option_name) + 1; + option_full_name = malloc (length); + if (option_full_name) { - (option->prev_option)->next_option = option->next_option; - new_plugin_options = plugin_options; + snprintf (option_full_name, length, "%s.%s", + plugin_name, option_name); + string_tolower (option_full_name); + rc = plugin_config_set_internal (option_full_name, value); + free (option_full_name); } - else - new_plugin_options = option->next_option; - - if (option->next_option) - (option->next_option)->prev_option = option->prev_option; - /* free option */ - config_file_option_free_data (option); - free (option); - - plugin_options = new_plugin_options; -} - -/* - * plugin_config_free_all: free all plugin options - */ - -void -plugin_config_free_all () -{ - while (plugin_options) - { - plugin_config_free (plugin_options); - } + return rc; } /* @@ -291,64 +143,34 @@ plugin_config_reload (void *data, struct t_config_file *config_file) { /* make C compiler happy */ (void) data; - (void) config_file; /* remove all plugin options */ - plugin_config_free_all (); + config_file_section_free_options (plugin_config_section_var); /* reload plugins config file */ - return config_file_reload (plugin_config); + return config_file_reload (config_file); } /* - * plugin_config_read_option: read an option in config file - * Return: 0 = successful - * -1 = option not found - * -2 = bad format/value + * plugin_config_create_option: set plugin option */ -void -plugin_config_read_option (void *data, struct t_config_file *config_file, - char *option_name, char *value) -{ - char *value2; - - /* make C compiler happy */ - (void) data; - (void) config_file; - - if (option_name && value) - { - value2 = string_iconv_to_internal (NULL, value); - plugin_config_set_internal (option_name, - (value2) ? value2 : value); - if (value2) - free (value2); - } -} - -/* - * plugin_config_write_options: write plugin options in configuration file - */ - -void -plugin_config_write_options (void *data, struct t_config_file *config_file, - char *section_name) +int +plugin_config_create_option (void *data, struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, char *value) { struct t_config_option *ptr_option; /* make C compiler happy */ (void) data; - config_file_write_line (config_file, section_name, NULL); + ptr_option = config_file_new_option ( + config_file, section, + option_name, "string", NULL, + NULL, 0, 0, value, NULL, NULL, NULL, NULL, NULL, NULL); - for (ptr_option = plugin_options; ptr_option; - ptr_option = ptr_option->next_option) - { - config_file_write_line (config_file, - ptr_option->name, - "%s", ptr_option->value); - } + return (ptr_option) ? 1 : 0; } /* @@ -358,15 +180,19 @@ plugin_config_write_options (void *data, struct t_config_file *config_file, void plugin_config_init () { - plugin_config = config_file_new (NULL, PLUGIN_CONFIG_FILENAME, - &plugin_config_reload, NULL); - if (plugin_config) + plugin_config_file = config_file_new (NULL, PLUGIN_CONFIG_NAME, + &plugin_config_reload, NULL); + if (plugin_config_file) { - config_file_new_section (plugin_config, "plugins", - &plugin_config_read_option, NULL, - &plugin_config_write_options, NULL, - NULL, NULL); + plugin_config_section_var = config_file_new_section ( + plugin_config_file, "var", + NULL, NULL, + NULL, NULL, + NULL, NULL, + &plugin_config_create_option, NULL); } + else + plugin_config_section_var = NULL; } /* @@ -379,7 +205,7 @@ plugin_config_init () int plugin_config_read () { - return config_file_read (plugin_config); + return config_file_read (plugin_config_file); } /* @@ -391,7 +217,7 @@ plugin_config_read () int plugin_config_write () { - return config_file_write (plugin_config); + return config_file_write (plugin_config_file); } /* @@ -402,5 +228,5 @@ void plugin_config_end () { /* free all plugin config options */ - plugin_config_free_all (); + config_file_section_free_options (plugin_config_section_var); } diff --git a/src/plugins/plugin-config.h b/src/plugins/plugin-config.h index 5ad2f3eeb..dac48cd95 100644 --- a/src/plugins/plugin-config.h +++ b/src/plugins/plugin-config.h @@ -20,7 +20,7 @@ #ifndef __WEECHAT_PLUGIN_CONFIG_H #define __WEECHAT_PLUGIN_CONFIG_H 1 -#define PLUGIN_CONFIG_FILENAME "plugins.rc" +#define PLUGIN_CONFIG_NAME "plugins" extern struct t_config_file *plugin_config; extern struct t_config_option *plugin_options; diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c index 07968b405..a4cc64819 100644 --- a/src/plugins/plugin.c +++ b/src/plugins/plugin.c @@ -325,7 +325,11 @@ plugin_load (char *filename) new_plugin->config_search_section = &config_file_search_section; new_plugin->config_new_option = &config_file_new_option; new_plugin->config_search_option = &config_file_search_option; + new_plugin->config_search_section_option = &config_file_search_section_option; + new_plugin->config_search_with_string = &config_file_search_with_string; + new_plugin->config_option_reset = &config_file_option_reset; new_plugin->config_option_set = &config_file_option_set; + new_plugin->config_option_get_pointer = &config_file_option_get_pointer; new_plugin->config_string_to_boolean = &config_file_string_to_boolean; new_plugin->config_boolean = &config_file_option_boolean; new_plugin->config_integer = &config_file_option_integer; @@ -335,6 +339,9 @@ plugin_load (char *filename) new_plugin->config_write = &config_file_write; new_plugin->config_read = &config_file_read; new_plugin->config_reload = &config_file_reload; + new_plugin->config_option_free = &config_file_option_free; + new_plugin->config_section_free_options = &config_file_section_free_options; + new_plugin->config_section_free = &config_file_section_free; new_plugin->config_free = &config_file_free; new_plugin->config_get_weechat = &plugin_api_config_get_weechat; new_plugin->config_get_plugin = &plugin_api_config_get_plugin; @@ -436,8 +443,7 @@ plugin_load (char *filename) } gui_chat_printf (NULL, - _("%sPlugin \"%s\" loaded"), - gui_chat_prefix[GUI_CHAT_PREFIX_INFO], + _("Plugin \"%s\" loaded"), name); free (full_name); @@ -458,14 +464,14 @@ plugin_auto_load_file (void *plugin, char *filename) /* make C compiler happy */ (void) plugin; - if (CONFIG_STRING(config_plugins_extension) - && CONFIG_STRING(config_plugins_extension)[0]) + if (CONFIG_STRING(config_plugin_extension) + && CONFIG_STRING(config_plugin_extension)[0]) { - pos = strstr (filename, CONFIG_STRING(config_plugins_extension)); + pos = strstr (filename, CONFIG_STRING(config_plugin_extension)); if (pos) { if (string_strcasecmp (pos, - CONFIG_STRING(config_plugins_extension)) == 0) + CONFIG_STRING(config_plugin_extension)) == 0) { plugin_load (filename); } @@ -484,34 +490,34 @@ plugin_auto_load_file (void *plugin, char *filename) void plugin_auto_load () { - char *ptr_home, *dir_name, *plugins_path, *plugins_path2; + char *ptr_home, *dir_name, *plugin_path, *plugin_path2; char *list_plugins, *pos, *pos2; - if (CONFIG_STRING(config_plugins_autoload) - && CONFIG_STRING(config_plugins_autoload)[0]) + if (CONFIG_STRING(config_plugin_autoload) + && CONFIG_STRING(config_plugin_autoload)[0]) { - if (string_strcasecmp (CONFIG_STRING(config_plugins_autoload), + if (string_strcasecmp (CONFIG_STRING(config_plugin_autoload), "*") == 0) { /* auto-load plugins in WeeChat home dir */ - if (CONFIG_STRING(config_plugins_path) - && CONFIG_STRING(config_plugins_path)[0]) + if (CONFIG_STRING(config_plugin_path) + && CONFIG_STRING(config_plugin_path)[0]) { ptr_home = getenv ("HOME"); - plugins_path = string_replace (CONFIG_STRING(config_plugins_path), - "~", ptr_home); - plugins_path2 = string_replace ((plugins_path) ? - plugins_path : CONFIG_STRING(config_plugins_path), - "%h", weechat_home); - util_exec_on_files ((plugins_path2) ? - plugins_path2 : ((plugins_path) ? - plugins_path : CONFIG_STRING(config_plugins_path)), + plugin_path = string_replace (CONFIG_STRING(config_plugin_path), + "~", ptr_home); + plugin_path2 = string_replace ((plugin_path) ? + plugin_path : CONFIG_STRING(config_plugin_path), + "%h", weechat_home); + util_exec_on_files ((plugin_path2) ? + plugin_path2 : ((plugin_path) ? + plugin_path : CONFIG_STRING(config_plugin_path)), NULL, &plugin_auto_load_file); - if (plugins_path) - free (plugins_path); - if (plugins_path2) - free (plugins_path2); + if (plugin_path) + free (plugin_path); + if (plugin_path2) + free (plugin_path2); } /* auto-load plugins in WeeChat global lib dir */ @@ -526,7 +532,7 @@ plugin_auto_load () } else { - list_plugins = strdup (CONFIG_STRING(config_plugins_autoload)); + list_plugins = strdup (CONFIG_STRING(config_plugin_autoload)); if (list_plugins) { pos = list_plugins; @@ -635,8 +641,7 @@ plugin_unload (struct t_weechat_plugin *plugin) plugin_remove (plugin); gui_chat_printf (NULL, - _("%sPlugin \"%s\" unloaded"), - gui_chat_prefix[GUI_CHAT_PREFIX_INFO], + _("Plugin \"%s\" unloaded"), (name) ? name : "???"); if (name) free (name); @@ -694,8 +699,7 @@ plugin_reload_name (char *name) { plugin_unload (ptr_plugin); gui_chat_printf (NULL, - _("%sPlugin \"%s\" unloaded"), - gui_chat_prefix[GUI_CHAT_PREFIX_INFO], + _("Plugin \"%s\" unloaded"), name); plugin_load (filename); free (filename); diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c index 1e8b6770d..ad38dc5b1 100644 --- a/src/plugins/scripts/lua/weechat-lua-api.c +++ b/src/plugins/scripts/lua/weechat-lua-api.c @@ -119,10 +119,9 @@ weechat_lua_api_register (lua_State *L) if (lua_current_script) { weechat_printf (NULL, - weechat_gettext ("%s%s: registered script \"%s\", " + weechat_gettext ("%s: registered script \"%s\", " "version %s (%s)"), - weechat_prefix ("info"), "lua", - name, version, description); + "lua", name, version, description); } else { @@ -934,7 +933,7 @@ weechat_lua_api_config_reload_cb (void *data, static int weechat_lua_api_config_new (lua_State *L) { - const char *filename, *function; + const char *name, *function; char *result; int n; @@ -947,7 +946,7 @@ weechat_lua_api_config_new (lua_State *L) LUA_RETURN_EMPTY; } - filename = NULL; + name = NULL; function = NULL; n = lua_gettop (lua_current_interpreter); @@ -958,12 +957,12 @@ weechat_lua_api_config_new (lua_State *L) LUA_RETURN_EMPTY; } - filename = lua_tostring (lua_current_interpreter, -2); + name = lua_tostring (lua_current_interpreter, -2); function = lua_tostring (lua_current_interpreter, -1); result = script_ptr2str (script_api_config_new (weechat_lua_plugin, lua_current_script, - (char *)filename, + (char *)name, &weechat_lua_api_config_reload_cb, (char *)function)); @@ -1072,6 +1071,54 @@ weechat_lua_api_config_section_write_default_cb (void *data, } /* + * weechat_lua_api_config_section_create_option_cb: callback to create an option + */ + +int +weechat_lua_api_config_section_create_option_cb (void *data, + struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, + char *value) +{ + struct t_script_callback *script_callback; + char *lua_argv[5]; + int *rc, ret; + + script_callback = (struct t_script_callback *)data; + + if (script_callback->function && script_callback->function[0]) + { + lua_argv[0] = script_ptr2str (config_file); + lua_argv[1] = script_ptr2str (section); + lua_argv[2] = option_name; + lua_argv[3] = value; + lua_argv[4] = NULL; + + rc = (int *) weechat_lua_exec (script_callback->script, + WEECHAT_SCRIPT_EXEC_INT, + script_callback->function, + lua_argv); + + if (!rc) + ret = WEECHAT_RC_ERROR; + else + { + ret = *rc; + free (rc); + } + if (lua_argv[0]) + free (lua_argv[0]); + if (lua_argv[1]) + free (lua_argv[1]); + + return ret; + } + + return 0; +} + +/* * weechat_lua_api_config_new_section: create a new section in configuration file */ @@ -1079,7 +1126,7 @@ static int weechat_lua_api_config_new_section (lua_State *L) { const char *config_file, *name, *function_read, *function_write; - const char *function_write_default; + const char *function_write_default, *function_create_option; char *result; int n; @@ -1097,20 +1144,22 @@ weechat_lua_api_config_new_section (lua_State *L) function_read = NULL; function_write = NULL; function_write_default = NULL; + function_create_option = NULL; n = lua_gettop (lua_current_interpreter); - if (n < 5) + if (n < 6) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_new_section"); LUA_RETURN_EMPTY; } - config_file = lua_tostring (lua_current_interpreter, -5); - name = lua_tostring (lua_current_interpreter, -4); - function_read = lua_tostring (lua_current_interpreter, -3); - function_write = lua_tostring (lua_current_interpreter, -2); - function_write_default = lua_tostring (lua_current_interpreter, -1); + config_file = lua_tostring (lua_current_interpreter, -6); + name = lua_tostring (lua_current_interpreter, -5); + function_read = lua_tostring (lua_current_interpreter, -4); + function_write = lua_tostring (lua_current_interpreter, -3); + function_write_default = lua_tostring (lua_current_interpreter, -2); + function_create_option = lua_tostring (lua_current_interpreter, -1); result = script_ptr2str (script_api_config_new_section (weechat_lua_plugin, lua_current_script, @@ -1120,8 +1169,10 @@ weechat_lua_api_config_new_section (lua_State *L) (char *)function_read, &weechat_lua_api_config_section_write_cb, (char *)function_write, - &weechat_lua_api_config_section_write_cb, - (char *)function_write_default)); + &weechat_lua_api_config_section_write_default_cb, + (char *)function_write_default, + &weechat_lua_api_config_section_create_option_cb, + (char *)function_create_option)); LUA_RETURN_STRING_FREE(result); } @@ -2553,19 +2604,17 @@ weechat_lua_api_hook_signal_send (lua_State *L) */ int -weechat_lua_api_hook_config_cb (void *data, char *type, char *option, - char *value) +weechat_lua_api_hook_config_cb (void *data, char *option, char *value) { struct t_script_callback *script_callback; - char *lua_argv[4]; + char *lua_argv[3]; int *rc, ret; script_callback = (struct t_script_callback *)data; - lua_argv[0] = type; - lua_argv[1] = option; - lua_argv[2] = value; - lua_argv[3] = NULL; + lua_argv[0] = option; + lua_argv[1] = value; + lua_argv[2] = NULL; rc = (int *) weechat_lua_exec (script_callback->script, WEECHAT_SCRIPT_EXEC_INT, @@ -2596,7 +2645,7 @@ weechat_lua_api_hook_config (lua_State *L) /* make C compiler happy */ (void) L; - + if (!lua_current_script) { WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("hook_config"); @@ -2609,19 +2658,17 @@ weechat_lua_api_hook_config (lua_State *L) n = lua_gettop (lua_current_interpreter); - if (n < 3) + if (n < 2) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_config"); LUA_RETURN_EMPTY; } - type = lua_tostring (lua_current_interpreter, -3); option = lua_tostring (lua_current_interpreter, -2); function = lua_tostring (lua_current_interpreter, -1); result = script_ptr2str (script_api_hook_config (weechat_lua_plugin, lua_current_script, - (char *)type, (char *)option, &weechat_lua_api_hook_config_cb, (char *)function)); diff --git a/src/plugins/scripts/lua/weechat-lua.c b/src/plugins/scripts/lua/weechat-lua.c index 50458c209..f5a799840 100644 --- a/src/plugins/scripts/lua/weechat-lua.c +++ b/src/plugins/scripts/lua/weechat-lua.c @@ -37,7 +37,7 @@ WEECHAT_PLUGIN_DESCRIPTION("Lua plugin for WeeChat"); WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>"); WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION); WEECHAT_PLUGIN_WEECHAT_VERSION(WEECHAT_VERSION); -WEECHAT_PLUGIN_LICENSE("GPL"); +WEECHAT_PLUGIN_LICENSE("GPL3"); struct t_weechat_plugin *weechat_lua_plugin; @@ -142,8 +142,8 @@ weechat_lua_load (char *filename) } weechat_printf (NULL, - weechat_gettext ("%s%s: loading script \"%s\""), - weechat_prefix ("info"), "lua", filename); + weechat_gettext ("%s: loading script \"%s\""), + "lua", filename); lua_current_script = NULL; @@ -259,8 +259,8 @@ weechat_lua_unload (struct t_plugin_script *script) char *lua_argv[1] = { NULL }; weechat_printf (NULL, - weechat_gettext ("%s%s: unloading script \"%s\""), - weechat_prefix ("info"), "lua", script->name); + weechat_gettext ("%s: unloading script \"%s\""), + "lua", script->name); if (script->shutdown_func && script->shutdown_func[0]) { @@ -291,8 +291,8 @@ weechat_lua_unload_name (char *name) { weechat_lua_unload (ptr_script); weechat_printf (NULL, - weechat_gettext ("%s%s: script \"%s\" unloaded"), - weechat_prefix ("info"), "lua", name); + weechat_gettext ("%s: script \"%s\" unloaded"), + "lua", name); } else { diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c index b68577825..3e52ef045 100644 --- a/src/plugins/scripts/perl/weechat-perl-api.c +++ b/src/plugins/scripts/perl/weechat-perl-api.c @@ -110,10 +110,9 @@ static XS (XS_weechat_register) if (perl_current_script) { weechat_printf (NULL, - weechat_gettext ("%s%s: registered script \"%s\", " + weechat_gettext ("%s: registered script \"%s\", " "version %s (%s)"), - weechat_prefix ("info"), "perl", - name, version, description); + "perl", name, version, description); } else { @@ -768,7 +767,7 @@ weechat_perl_api_config_reload_cb (void *data, static XS (XS_weechat_config_new) { - char *result, *filename, *function; + char *result, *name, *function; dXSARGS; /* make C compiler happy */ @@ -786,11 +785,11 @@ static XS (XS_weechat_config_new) PERL_RETURN_EMPTY; } - filename = SvPV (ST (0), PL_na); + name = SvPV (ST (0), PL_na); function = SvPV (ST (1), PL_na); result = script_ptr2str (script_api_config_new (weechat_perl_plugin, perl_current_script, - filename, + name, &weechat_perl_api_config_reload_cb, function)); @@ -899,12 +898,61 @@ weechat_perl_api_config_section_write_default_cb (void *data, } /* + * weechat_perl_api_config_section_create_option_cb: callback to create an option + */ + +int +weechat_perl_api_config_section_create_option_cb (void *data, + struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, + char *value) +{ + struct t_script_callback *script_callback; + char *perl_argv[5]; + int *rc, ret; + + script_callback = (struct t_script_callback *)data; + + if (script_callback->function && script_callback->function[0]) + { + perl_argv[0] = script_ptr2str (config_file); + perl_argv[1] = script_ptr2str (section); + perl_argv[2] = option_name; + perl_argv[3] = value; + perl_argv[4] = NULL; + + rc = (int *) weechat_perl_exec (script_callback->script, + WEECHAT_SCRIPT_EXEC_INT, + script_callback->function, + perl_argv); + + if (!rc) + ret = WEECHAT_RC_ERROR; + else + { + ret = *rc; + free (rc); + } + if (perl_argv[0]) + free (perl_argv[0]); + if (perl_argv[1]) + free (perl_argv[1]); + + return ret; + } + + return 0; +} + +/* * weechat::config_new_section: create a new section in configuration file */ static XS (XS_weechat_config_new_section) { - char *result, *cfg_file, *name, *read_cb, *write_cb, *write_default_db; + char *result, *cfg_file, *name, *function_read, *function_write; + char *function_write_default, *function_create_option; dXSARGS; /* make C compiler happy */ @@ -916,7 +964,7 @@ static XS (XS_weechat_config_new_section) PERL_RETURN_EMPTY; } - if (items < 5) + if (items < 6) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_new_section"); PERL_RETURN_EMPTY; @@ -924,19 +972,22 @@ static XS (XS_weechat_config_new_section) cfg_file = SvPV (ST (0), PL_na); name = SvPV (ST (1), PL_na); - read_cb = SvPV (ST (2), PL_na); - write_cb = SvPV (ST (3), PL_na); - write_default_db = SvPV (ST (4), PL_na); + function_read = SvPV (ST (2), PL_na); + function_write = SvPV (ST (3), PL_na); + function_write_default = SvPV (ST (4), PL_na); + function_create_option = SvPV (ST (5), PL_na); result = script_ptr2str (script_api_config_new_section (weechat_perl_plugin, perl_current_script, script_str2ptr (cfg_file), name, &weechat_perl_api_config_section_read_cb, - read_cb, + function_read, &weechat_perl_api_config_section_write_cb, - write_cb, + function_write, &weechat_perl_api_config_section_write_default_cb, - write_default_db)); + function_write_default, + &weechat_perl_api_config_section_create_option_cb, + function_create_option)); PERL_RETURN_STRING_FREE(result); } @@ -2117,19 +2168,17 @@ static XS (XS_weechat_hook_signal_send) */ int -weechat_perl_api_hook_config_cb (void *data, char *type, char *option, - char *value) +weechat_perl_api_hook_config_cb (void *data, char *option, char *value) { struct t_script_callback *script_callback; - char *perl_argv[4]; + char *perl_argv[3]; int *rc, ret; script_callback = (struct t_script_callback *)data; - perl_argv[0] = type; - perl_argv[1] = option; - perl_argv[2] = value; - perl_argv[3] = NULL; + perl_argv[0] = option; + perl_argv[1] = value; + perl_argv[2] = NULL; rc = (int *) weechat_perl_exec (script_callback->script, WEECHAT_SCRIPT_EXEC_INT, @@ -2153,7 +2202,7 @@ weechat_perl_api_hook_config_cb (void *data, char *type, char *option, static XS (XS_weechat_hook_config) { - char *result, *type, *option, *function; + char *result, *option, *function; dXSARGS; /* make C compiler happy */ @@ -2165,18 +2214,16 @@ static XS (XS_weechat_hook_config) PERL_RETURN_EMPTY; } - if (items < 3) + if (items < 2) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_config"); PERL_RETURN_EMPTY; } - type = SvPV (ST (0), PL_na); - option = SvPV (ST (1), PL_na); - function = SvPV (ST (2), PL_na); + option = SvPV (ST (0), PL_na); + function = SvPV (ST (1), PL_na); result = script_ptr2str (script_api_hook_config (weechat_perl_plugin, perl_current_script, - type, option, &weechat_perl_api_hook_config_cb, function)); diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c index 6766f94f2..d62556baa 100644 --- a/src/plugins/scripts/perl/weechat-perl.c +++ b/src/plugins/scripts/perl/weechat-perl.c @@ -35,7 +35,7 @@ WEECHAT_PLUGIN_DESCRIPTION("Perl plugin for WeeChat"); WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>"); WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION); WEECHAT_PLUGIN_WEECHAT_VERSION(WEECHAT_VERSION); -WEECHAT_PLUGIN_LICENSE("GPL"); +WEECHAT_PLUGIN_LICENSE("GPL3"); struct t_weechat_plugin *weechat_perl_plugin = NULL; @@ -236,8 +236,8 @@ weechat_perl_load (char *filename) } weechat_printf (NULL, - weechat_gettext ("%s%s: loading script \"%s\""), - weechat_prefix ("info"), "perl", filename); + weechat_gettext ("%s: loading script \"%s\""), + "perl", filename); perl_current_script = NULL; @@ -381,8 +381,8 @@ weechat_perl_unload (struct t_plugin_script *script) char *perl_argv[1] = { NULL }; weechat_printf (NULL, - weechat_gettext ("%s%s: unloading script \"%s\""), - weechat_prefix ("info"), "perl", script->name); + weechat_gettext ("%s: unloading script \"%s\""), + "perl", script->name); #ifdef MULTIPLICITY PERL_SET_CONTEXT (script->interpreter); @@ -425,8 +425,8 @@ weechat_perl_unload_name (char *name) { weechat_perl_unload (ptr_script); weechat_printf (NULL, - weechat_gettext ("%s%s: script \"%s\" unloaded"), - weechat_prefix ("info"), "perl", name); + weechat_gettext ("%s: script \"%s\" unloaded"), + "perl", name); } else { diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index 33992d6b9..5b7cfc8f7 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -101,10 +101,9 @@ weechat_python_api_register (PyObject *self, PyObject *args) if (python_current_script) { weechat_printf (NULL, - weechat_gettext ("%s%s: registered script \"%s\", " + weechat_gettext ("%s: registered script \"%s\", " "version %s (%s)"), - weechat_prefix ("info"), "python", - name, version, description); + "python", name, version, description); } else { @@ -811,7 +810,7 @@ weechat_python_api_config_reload_cb (void *data, static PyObject * weechat_python_api_config_new (PyObject *self, PyObject *args) { - char *filename, *function, *result; + char *name, *function, *result; PyObject *object; /* make C compiler happy */ @@ -823,10 +822,10 @@ weechat_python_api_config_new (PyObject *self, PyObject *args) PYTHON_RETURN_EMPTY; } - filename = NULL; + name = NULL; function = NULL; - if (!PyArg_ParseTuple (args, "ss", &filename, &function)) + if (!PyArg_ParseTuple (args, "ss", &name, &function)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_new"); PYTHON_RETURN_EMPTY; @@ -834,7 +833,7 @@ weechat_python_api_config_new (PyObject *self, PyObject *args) result = script_ptr2str (script_api_config_new (weechat_python_plugin, python_current_script, - filename, + name, &weechat_python_api_config_reload_cb, function)); @@ -943,6 +942,54 @@ weechat_python_api_config_section_write_default_cb (void *data, } /* + * weechat_python_api_config_section_create_option_cb: callback to create an option + */ + +int +weechat_python_api_config_section_create_option_cb (void *data, + struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, + char *value) +{ + struct t_script_callback *script_callback; + char *python_argv[5]; + int *rc, ret; + + script_callback = (struct t_script_callback *)data; + + if (script_callback->function && script_callback->function[0]) + { + python_argv[0] = script_ptr2str (config_file); + python_argv[1] = script_ptr2str (section); + python_argv[2] = option_name; + python_argv[3] = value; + python_argv[4] = NULL; + + rc = (int *) weechat_python_exec (script_callback->script, + WEECHAT_SCRIPT_EXEC_INT, + script_callback->function, + python_argv); + + if (!rc) + ret = WEECHAT_RC_ERROR; + else + { + ret = *rc; + free (rc); + } + if (python_argv[0]) + free (python_argv[0]); + if (python_argv[1]) + free (python_argv[1]); + + return ret; + } + + return 0; +} + +/* * weechat_python_api_config_new_section: create a new section in configuration file */ @@ -950,7 +997,8 @@ static PyObject * weechat_python_api_config_new_section (PyObject *self, PyObject *args) { char *config_file, *name, *function_read, *function_write; - char *function_write_default, *result; + char *function_write_default, *function_create_option; + char *result; PyObject *object; /* make C compiler happy */ @@ -967,9 +1015,11 @@ weechat_python_api_config_new_section (PyObject *self, PyObject *args) function_read = NULL; function_write = NULL; function_write_default = NULL; + function_create_option = NULL; - if (!PyArg_ParseTuple (args, "sssss", &config_file, &name, &function_read, - &function_write, &function_write_default)) + if (!PyArg_ParseTuple (args, "ssssss", &config_file, &name, + &function_read, &function_write, + &function_write_default, &function_create_option)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_new_section"); PYTHON_RETURN_EMPTY; @@ -984,7 +1034,9 @@ weechat_python_api_config_new_section (PyObject *self, PyObject *args) &weechat_python_api_config_section_write_cb, function_write, &weechat_python_api_config_section_write_default_cb, - function_write_default)); + function_write_default, + &weechat_python_api_config_section_create_option_cb, + function_create_option)); PYTHON_RETURN_STRING_FREE(result); } @@ -2255,19 +2307,17 @@ weechat_python_api_hook_signal_send (PyObject *self, PyObject *args) */ int -weechat_python_api_hook_config_cb (void *data, char *type, char *option, - char *value) +weechat_python_api_hook_config_cb (void *data, char *option, char *value) { struct t_script_callback *script_callback; - char *python_argv[4]; + char *python_argv[3]; int *rc, ret; script_callback = (struct t_script_callback *)data; - python_argv[0] = type; - python_argv[1] = option; - python_argv[2] = value; - python_argv[3] = NULL; + python_argv[0] = option; + python_argv[1] = value; + python_argv[2] = NULL; rc = (int *) weechat_python_exec (script_callback->script, WEECHAT_SCRIPT_EXEC_INT, @@ -2292,7 +2342,7 @@ weechat_python_api_hook_config_cb (void *data, char *type, char *option, static PyObject * weechat_python_api_hook_config (PyObject *self, PyObject *args) { - char *type, *option, *function, *result; + char *option, *function, *result; PyObject *object; /* make C compiler happy */ @@ -2304,11 +2354,10 @@ weechat_python_api_hook_config (PyObject *self, PyObject *args) PYTHON_RETURN_EMPTY; } - type = NULL; option = NULL; function = NULL; - if (!PyArg_ParseTuple (args, "sss", &type, &option, &function)) + if (!PyArg_ParseTuple (args, "ss", &option, &function)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_config"); PYTHON_RETURN_EMPTY; @@ -2316,7 +2365,6 @@ weechat_python_api_hook_config (PyObject *self, PyObject *args) result = script_ptr2str(script_api_hook_config (weechat_python_plugin, python_current_script, - type, option, &weechat_python_api_hook_config_cb, function)); diff --git a/src/plugins/scripts/python/weechat-python.c b/src/plugins/scripts/python/weechat-python.c index b259427be..f485a6f18 100644 --- a/src/plugins/scripts/python/weechat-python.c +++ b/src/plugins/scripts/python/weechat-python.c @@ -33,7 +33,7 @@ WEECHAT_PLUGIN_DESCRIPTION("Python plugin for WeeChat"); WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>"); WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION); WEECHAT_PLUGIN_WEECHAT_VERSION(WEECHAT_VERSION); -WEECHAT_PLUGIN_LICENSE("GPL"); +WEECHAT_PLUGIN_LICENSE("GPL3"); struct t_weechat_plugin *weechat_python_plugin = NULL; @@ -261,8 +261,8 @@ weechat_python_load (char *filename) } weechat_printf (NULL, - weechat_gettext ("%s%s: loading script \"%s\""), - weechat_prefix ("info"), "python", filename); + weechat_gettext ("%s: loading script \"%s\""), + "python", filename); python_current_script = NULL; @@ -428,8 +428,8 @@ weechat_python_unload (struct t_plugin_script *script) int *r; weechat_printf (NULL, - weechat_gettext ("%s%s: unloading script \"%s\""), - weechat_prefix ("info"), "python", script->name); + weechat_gettext ("%s: unloading script \"%s\""), + "python", script->name); if (script->shutdown_func && script->shutdown_func[0]) { @@ -459,8 +459,8 @@ weechat_python_unload_name (char *name) { weechat_python_unload (ptr_script); weechat_printf (NULL, - weechat_gettext ("%s%s: script \"%s\" unloaded"), - weechat_prefix ("info"), "python", name); + weechat_gettext ("%s: script \"%s\" unloaded"), + "python", name); } else { diff --git a/src/plugins/scripts/ruby/weechat-ruby-api.c b/src/plugins/scripts/ruby/weechat-ruby-api.c index 52108c980..b6f71f7ad 100644 --- a/src/plugins/scripts/ruby/weechat-ruby-api.c +++ b/src/plugins/scripts/ruby/weechat-ruby-api.c @@ -119,10 +119,9 @@ weechat_ruby_api_register (VALUE class, VALUE name, VALUE author, if (ruby_current_script) { weechat_printf (NULL, - weechat_gettext ("%s%s: registered script \"%s\", " + weechat_gettext ("%s: registered script \"%s\", " "version %s (%s)"), - weechat_prefix ("info"), "ruby", - c_name, c_version, c_description); + "ruby", c_name, c_version, c_description); } else { @@ -922,9 +921,9 @@ weechat_ruby_api_config_reload_cb (void *data, */ static VALUE -weechat_ruby_api_config_new (VALUE class, VALUE filename, VALUE function) +weechat_ruby_api_config_new (VALUE class, VALUE name, VALUE function) { - char *c_filename, *c_function, *result; + char *c_name, *c_function, *result; VALUE return_value; /* make C compiler happy */ @@ -936,24 +935,24 @@ weechat_ruby_api_config_new (VALUE class, VALUE filename, VALUE function) RUBY_RETURN_EMPTY; } - c_filename = NULL; + c_name = NULL; c_function = NULL; - if (NIL_P (filename) || NIL_P (function)) + if (NIL_P (name) || NIL_P (function)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_new"); RUBY_RETURN_EMPTY; } - Check_Type (filename, T_STRING); + Check_Type (name, T_STRING); Check_Type (function, T_STRING); - c_filename = STR2CSTR (filename); + c_name = STR2CSTR (name); c_function = STR2CSTR (function); result = script_ptr2str (script_api_config_new (weechat_ruby_plugin, ruby_current_script, - c_filename, + c_name, &weechat_ruby_api_config_reload_cb, c_function)); @@ -1062,6 +1061,54 @@ weechat_ruby_api_config_section_write_default_cb (void *data, } /* + * weechat_ruby_api_config_section_create_option_cb: callback to create an option + */ + +int +weechat_ruby_api_config_section_create_option_cb (void *data, + struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, + char *value) +{ + struct t_script_callback *script_callback; + char *ruby_argv[5]; + int *rc, ret; + + script_callback = (struct t_script_callback *)data; + + if (script_callback->function && script_callback->function[0]) + { + ruby_argv[0] = script_ptr2str (config_file); + ruby_argv[1] = script_ptr2str (section); + ruby_argv[2] = option_name; + ruby_argv[3] = value; + ruby_argv[4] = NULL; + + rc = (int *) weechat_ruby_exec (script_callback->script, + WEECHAT_SCRIPT_EXEC_INT, + script_callback->function, + ruby_argv); + + if (!rc) + ret = WEECHAT_RC_ERROR; + else + { + ret = *rc; + free (rc); + } + if (ruby_argv[0]) + free (ruby_argv[0]); + if (ruby_argv[1]) + free (ruby_argv[1]); + + return ret; + } + + return 0; +} + +/* * weechat_ruby_api_config_new_section: create a new section in configuration file */ @@ -1069,10 +1116,12 @@ static VALUE weechat_ruby_api_config_new_section (VALUE class, VALUE config_file, VALUE name, VALUE function_read, VALUE function_write, - VALUE function_write_default) + VALUE function_write_default, + VALUE function_create_option) { char *c_config_file, *c_name, *c_function_read, *c_function_write; - char *c_function_write_default, *result; + char *c_function_write_default, *c_function_create_option; + char *result; VALUE return_value; /* make C compiler happy */ @@ -1089,9 +1138,11 @@ weechat_ruby_api_config_new_section (VALUE class, VALUE config_file, c_function_read = NULL; c_function_write = NULL; c_function_write_default = NULL; + c_function_create_option = NULL; if (NIL_P (config_file) || NIL_P (name) || NIL_P (function_read) - || NIL_P (function_write) || NIL_P (function_write_default)) + || NIL_P (function_write) || NIL_P (function_write_default) + || NIL_P (function_create_option)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_new_section"); RUBY_RETURN_EMPTY; @@ -1102,12 +1153,14 @@ weechat_ruby_api_config_new_section (VALUE class, VALUE config_file, Check_Type (function_read, T_STRING); Check_Type (function_write, T_STRING); Check_Type (function_write_default, T_STRING); + Check_Type (function_create_option, T_STRING); c_config_file = STR2CSTR (config_file); c_name = STR2CSTR (name); c_function_read = STR2CSTR (function_read); c_function_write = STR2CSTR (function_write); c_function_write_default = STR2CSTR (function_write_default); + c_function_create_option = STR2CSTR (function_create_option); result = script_ptr2str (script_api_config_new_section (weechat_ruby_plugin, ruby_current_script, @@ -1118,7 +1171,9 @@ weechat_ruby_api_config_new_section (VALUE class, VALUE config_file, &weechat_ruby_api_config_section_write_cb, c_function_write, &weechat_ruby_api_config_section_write_default_cb, - c_function_write_default)); + c_function_write_default, + &weechat_ruby_api_config_section_create_option_cb, + c_function_create_option)); RUBY_RETURN_STRING_FREE(result); } @@ -2606,19 +2661,17 @@ weechat_ruby_api_hook_signal_send (VALUE class, VALUE signal, VALUE type_data, */ int -weechat_ruby_api_hook_config_cb (void *data, char *type, char *option, - char *value) +weechat_ruby_api_hook_config_cb (void *data, char *option, char *value) { struct t_script_callback *script_callback; - char *ruby_argv[4]; + char *ruby_argv[3]; int *rc, ret; script_callback = (struct t_script_callback *)data; - ruby_argv[0] = type; - ruby_argv[1] = option; - ruby_argv[2] = value; - ruby_argv[3] = NULL; + ruby_argv[0] = option; + ruby_argv[1] = value; + ruby_argv[2] = NULL; rc = (int *) weechat_ruby_exec (script_callback->script, WEECHAT_SCRIPT_EXEC_INT, @@ -2641,10 +2694,9 @@ weechat_ruby_api_hook_config_cb (void *data, char *type, char *option, */ static VALUE -weechat_ruby_api_hook_config (VALUE class, VALUE type, VALUE option, - VALUE function) +weechat_ruby_api_hook_config (VALUE class, VALUE option, VALUE function) { - char *c_type, *c_option, *c_function, *result; + char *c_option, *c_function, *result; VALUE return_value; /* make C compiler happy */ @@ -2656,27 +2708,23 @@ weechat_ruby_api_hook_config (VALUE class, VALUE type, VALUE option, RUBY_RETURN_EMPTY; } - c_type = NULL; c_option = NULL; c_function = NULL; - if (NIL_P (type) || NIL_P (option) || NIL_P (function)) + if (NIL_P (option) || NIL_P (function)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_config"); RUBY_RETURN_EMPTY; } - Check_Type (type, T_STRING); Check_Type (option, T_STRING); Check_Type (function, T_STRING); - c_type = STR2CSTR (type); c_option = STR2CSTR (option); c_function = STR2CSTR (function); result = script_ptr2str (script_api_hook_config (weechat_ruby_plugin, ruby_current_script, - c_type, c_option, &weechat_ruby_api_hook_config_cb, c_function)); @@ -4388,7 +4436,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat) rb_define_module_function (ruby_mWeechat, "list_remove_all", &weechat_ruby_api_list_remove_all, 1); rb_define_module_function (ruby_mWeechat, "list_free", &weechat_ruby_api_list_free, 1); rb_define_module_function (ruby_mWeechat, "config_new", &weechat_ruby_api_config_new, 2); - rb_define_module_function (ruby_mWeechat, "config_new_section", &weechat_ruby_api_config_new_section, 5); + rb_define_module_function (ruby_mWeechat, "config_new_section", &weechat_ruby_api_config_new_section, 6); rb_define_module_function (ruby_mWeechat, "config_search_section", &weechat_ruby_api_config_search_section, 2); rb_define_module_function (ruby_mWeechat, "config_new_option", &weechat_ruby_api_config_new_option, 10); rb_define_module_function (ruby_mWeechat, "config_search_option", &weechat_ruby_api_config_search_option, 3); @@ -4417,7 +4465,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat) rb_define_module_function (ruby_mWeechat, "hook_print", &weechat_ruby_api_hook_print, 5); rb_define_module_function (ruby_mWeechat, "hook_signal", &weechat_ruby_api_hook_signal, 2); rb_define_module_function (ruby_mWeechat, "hook_signal_send", &weechat_ruby_api_hook_signal_send, 3); - rb_define_module_function (ruby_mWeechat, "hook_config", &weechat_ruby_api_hook_config, 3); + rb_define_module_function (ruby_mWeechat, "hook_config", &weechat_ruby_api_hook_config, 2); rb_define_module_function (ruby_mWeechat, "hook_completion", &weechat_ruby_api_hook_completion, 2); rb_define_module_function (ruby_mWeechat, "hook_modifier", &weechat_ruby_api_hook_modifier, 2); rb_define_module_function (ruby_mWeechat, "hook_modifier_exec", &weechat_ruby_api_hook_modifier_exec, 3); diff --git a/src/plugins/scripts/ruby/weechat-ruby.c b/src/plugins/scripts/ruby/weechat-ruby.c index dc32998c6..d34e8dd16 100644 --- a/src/plugins/scripts/ruby/weechat-ruby.c +++ b/src/plugins/scripts/ruby/weechat-ruby.c @@ -36,7 +36,7 @@ WEECHAT_PLUGIN_DESCRIPTION("Ruby plugin for WeeChat"); WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>"); WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION); WEECHAT_PLUGIN_WEECHAT_VERSION(WEECHAT_VERSION); -WEECHAT_PLUGIN_LICENSE("GPL"); +WEECHAT_PLUGIN_LICENSE("GPL3"); struct t_weechat_plugin *weechat_ruby_plugin = NULL; @@ -306,8 +306,8 @@ weechat_ruby_load (char *filename) } weechat_printf (NULL, - weechat_gettext ("%s%s: loading script \"%s\""), - weechat_prefix ("info"), "ruby", filename); + weechat_gettext ("%s: loading script \"%s\""), + "ruby", filename); ruby_current_script = NULL; @@ -435,8 +435,8 @@ weechat_ruby_unload (struct t_plugin_script *script) char *ruby_argv[1] = { NULL }; weechat_printf (NULL, - weechat_gettext ("%s%s: unloading script \"%s\""), - weechat_prefix ("info"), "ruby", script->name); + weechat_gettext ("%s: unloading script \"%s\""), + "ruby", script->name); if (script->shutdown_func && script->shutdown_func[0]) { @@ -468,8 +468,8 @@ weechat_ruby_unload_name (char *name) { weechat_ruby_unload (ptr_script); weechat_printf (NULL, - weechat_gettext ("%s%s: script \"%s\" unloaded"), - weechat_prefix ("info"), "ruby", name); + weechat_gettext ("%s: script \"%s\" unloaded"), + "ruby", name); } else { diff --git a/src/plugins/scripts/script-api.c b/src/plugins/scripts/script-api.c index f12caa768..ea9821918 100644 --- a/src/plugins/scripts/script-api.c +++ b/src/plugins/scripts/script-api.c @@ -51,7 +51,7 @@ script_api_charset_set (struct t_plugin_script *script, struct t_config_file * script_api_config_new (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *script, - char *filename, + char *name, int (*callback_reload)(void *data, struct t_config_file *config_file), char *function) @@ -65,7 +65,7 @@ script_api_config_new (struct t_weechat_plugin *weechat_plugin, if (!new_script_callback) return NULL; - new_config_file = weechat_config_new (filename, callback_reload, + new_config_file = weechat_config_new (name, callback_reload, new_script_callback); if (!new_config_file) { @@ -82,7 +82,7 @@ script_api_config_new (struct t_weechat_plugin *weechat_plugin, } else { - new_config_file = weechat_config_new (filename, NULL, NULL); + new_config_file = weechat_config_new (name, NULL, NULL); } return new_config_file; @@ -110,19 +110,27 @@ script_api_config_new_section (struct t_weechat_plugin *weechat_plugin, void (*callback_write_default)(void *data, struct t_config_file *config_file, char *section_name), - char *function_write_default) + char *function_write_default, + int (*callback_create_option)(void *data, + struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, + char *value), + char *function_create_option) { struct t_script_callback *new_script_callback1, *new_script_callback2; - struct t_script_callback *new_script_callback3; + struct t_script_callback *new_script_callback3, *new_script_callback4; struct t_config_section *new_section; - void *callback1, *callback2, *callback3; + void *callback1, *callback2, *callback3, *callback4; new_script_callback1 = NULL; new_script_callback2 = NULL; new_script_callback3 = NULL; + new_script_callback4 = NULL; callback1 = NULL; callback2 = NULL; callback3 = NULL; + callback4 = NULL; if (function_read && function_read[0]) { @@ -167,6 +175,31 @@ script_api_config_new_section (struct t_weechat_plugin *weechat_plugin, callback3 = callback_write_default; } + if (function_create_option && function_create_option[0]) + { + new_script_callback4 = script_callback_alloc (); + if (!new_script_callback4) + { + if (new_script_callback1) + { + script_callback_free_data (new_script_callback1); + free (new_script_callback1); + } + if (new_script_callback2) + { + script_callback_free_data (new_script_callback2); + free (new_script_callback2); + } + if (new_script_callback3) + { + script_callback_free_data (new_script_callback3); + free (new_script_callback3); + } + return NULL; + } + callback4 = callback_create_option; + } + new_section = weechat_config_new_section (config_file, name, callback1, @@ -174,7 +207,9 @@ script_api_config_new_section (struct t_weechat_plugin *weechat_plugin, callback2, new_script_callback2, callback3, - new_script_callback3); + new_script_callback3, + callback4, + new_script_callback4); if (!new_section) { if (new_script_callback1) @@ -192,6 +227,11 @@ script_api_config_new_section (struct t_weechat_plugin *weechat_plugin, script_callback_free_data (new_script_callback3); free (new_script_callback3); } + if (new_script_callback4) + { + script_callback_free_data (new_script_callback4); + free (new_script_callback4); + } return NULL; } @@ -222,6 +262,15 @@ script_api_config_new_section (struct t_weechat_plugin *weechat_plugin, script_callback_add (script, new_script_callback3); } + if (new_script_callback4) + { + new_script_callback4->script = script; + new_script_callback4->function = strdup (function_create_option); + new_script_callback4->config_file = config_file; + new_script_callback4->config_section = new_section; + script_callback_add (script, new_script_callback4); + } + return new_section; } @@ -238,43 +287,126 @@ script_api_config_new_option (struct t_weechat_plugin *weechat_plugin, char *name, char *type, char *description, char *string_values, int min, int max, char *default_value, - void (*callback_change)(void *data), - char *function) + void (*callback_check_value)(void *data, + struct t_config_option *option, + char *value), + char *function_check_value, + void (*callback_change)(void *data, + struct t_config_option *option), + char *function_change, + void (*callback_delete)(void *data, + struct t_config_option *option), + char *function_delete) { - struct t_script_callback *new_script_callback; + struct t_script_callback *new_script_callback1, *new_script_callback2; + struct t_script_callback *new_script_callback3; + void *callback1, *callback2, *callback3; struct t_config_option *new_option; - - if (function && function[0]) + + new_script_callback1 = NULL; + new_script_callback2 = NULL; + new_script_callback3 = NULL; + callback1 = NULL; + callback2 = NULL; + callback3 = NULL; + + if (function_check_value && function_check_value[0]) { - new_script_callback = script_callback_alloc (); - if (!new_script_callback) + new_script_callback1 = script_callback_alloc (); + if (!new_script_callback1) return NULL; - - new_option = weechat_config_new_option (config_file, section, name, type, - description, string_values, min, - max, default_value, - callback_change, - new_script_callback); - if (!new_option) + callback1 = callback_check_value; + } + + if (function_change && function_change[0]) + { + new_script_callback2 = script_callback_alloc (); + if (!new_script_callback2) { - script_callback_free_data (new_script_callback); - free (new_script_callback); + if (new_script_callback1) + { + script_callback_free_data (new_script_callback1); + free (new_script_callback1); + } return NULL; } - - new_script_callback->script = script; - new_script_callback->function = strdup (function); - new_script_callback->config_file = config_file; - new_script_callback->config_section = section; - new_script_callback->config_option = new_option; - - script_callback_add (script, new_script_callback); + callback2 = callback_change; } - else + + if (function_delete && function_delete[0]) + { + new_script_callback3 = script_callback_alloc (); + if (!new_script_callback3) + { + if (new_script_callback1) + { + script_callback_free_data (new_script_callback1); + free (new_script_callback1); + } + if (new_script_callback2) + { + script_callback_free_data (new_script_callback2); + free (new_script_callback2); + } + return NULL; + } + callback3 = callback_delete; + } + + new_option = weechat_config_new_option (config_file, section, name, type, + description, string_values, min, + max, default_value, + callback1, new_script_callback1, + callback2, new_script_callback2, + callback3, new_script_callback3); + if (!new_option) { - new_option = weechat_config_new_option (config_file, section, name, type, - description, string_values, min, - max, default_value, NULL, NULL); + if (new_script_callback1) + { + script_callback_free_data (new_script_callback1); + free (new_script_callback1); + } + if (new_script_callback2) + { + script_callback_free_data (new_script_callback2); + free (new_script_callback2); + } + if (new_script_callback3) + { + script_callback_free_data (new_script_callback3); + free (new_script_callback3); + } + return NULL; + } + + if (new_script_callback1) + { + new_script_callback1->script = script; + new_script_callback1->function = strdup (function_check_value); + new_script_callback1->config_file = config_file; + new_script_callback1->config_section = section; + new_script_callback1->config_option = new_option; + script_callback_add (script, new_script_callback1); + } + + if (new_script_callback2) + { + new_script_callback2->script = script; + new_script_callback2->function = strdup (function_check_value); + new_script_callback2->config_file = config_file; + new_script_callback2->config_section = section; + new_script_callback2->config_option = new_option; + script_callback_add (script, new_script_callback2); + } + + if (new_script_callback3) + { + new_script_callback3->script = script; + new_script_callback3->function = strdup (function_check_value); + new_script_callback3->config_file = config_file; + new_script_callback3->config_section = section; + new_script_callback3->config_option = new_option; + script_callback_add (script, new_script_callback3); } return new_option; @@ -638,9 +770,9 @@ script_api_hook_signal (struct t_weechat_plugin *weechat_plugin, struct t_hook * script_api_hook_config (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *script, - char *type, char *option, - int (*callback)(void *data, char *type, - char *option, char *value), + char *option, + int (*callback)(void *data, char *option, + char *value), char *function) { struct t_script_callback *new_script_callback; @@ -650,7 +782,7 @@ script_api_hook_config (struct t_weechat_plugin *weechat_plugin, if (!new_script_callback) return NULL; - new_hook = weechat_hook_config (type, option, callback, new_script_callback); + new_hook = weechat_hook_config (option, callback, new_script_callback); if (!new_hook) { script_callback_free_data (new_script_callback); diff --git a/src/plugins/scripts/script-api.h b/src/plugins/scripts/script-api.h index 98217549a..d27f23ee4 100644 --- a/src/plugins/scripts/script-api.h +++ b/src/plugins/scripts/script-api.h @@ -23,7 +23,7 @@ extern void script_api_charset_set (struct t_plugin_script *script, char *charset); extern struct t_config_file *script_api_config_new (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *script, - char *filename, + char *name, int (*callback_reload)(void *data, struct t_config_file *config_file), char *function); @@ -43,7 +43,13 @@ extern struct t_config_section *script_api_config_new_section (struct t_weechat_ void (*callback_write_default)(void *data, struct t_config_file *config_file, char *section_name), - char *function_write_default); + char *function_write_default, + int (*callback_create_option)(void *data, + struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, + char *value), + char *function_create_option); extern struct t_config_option *script_api_config_new_option (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *script, struct t_config_file *config_file, @@ -125,8 +131,8 @@ extern struct t_hook *script_api_hook_signal (struct t_weechat_plugin *weechat_p char *function); extern struct t_hook *script_api_hook_config (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *script, - char *type, char *option, - int (*callback)(void *data, char *type, + char *option, + int (*callback)(void *data, char *option, char *value), char *function); diff --git a/src/plugins/scripts/script.c b/src/plugins/scripts/script.c index 94dbf42bf..108d0d12a 100644 --- a/src/plugins/scripts/script.c +++ b/src/plugins/scripts/script.c @@ -63,10 +63,9 @@ script_config_read (struct t_weechat_plugin *weechat_plugin) */ int -script_config_cb (void *data, char *type, char *option, char *value) +script_config_cb (void *data, char *option, char *value) { /* make C compiler happy */ - (void) type; (void) option; (void) value; @@ -100,14 +99,13 @@ script_init (struct t_weechat_plugin *weechat_plugin, script_config_read (weechat_plugin); /* add hook for config option */ - length = strlen (weechat_plugin->name) + 32; + length = strlen (weechat_plugin->name) + 64; string = malloc (length); if (string) { - snprintf (string, length, "%s.%s", + snprintf (string, length, "plugins.var.%s.%s", weechat_plugin->name, SCRIPT_OPTION_CHECK_LICENSE); - weechat_hook_config ("plugin", string, - &script_config_cb, weechat_plugin); + weechat_hook_config (string, &script_config_cb, weechat_plugin); free (string); } @@ -427,7 +425,7 @@ script_remove (struct t_weechat_plugin *weechat_plugin, && !ptr_script_callback->config_section && !ptr_script_callback->config_option) { - if (weechat_config_boolean (weechat_config_get_weechat ("plugins_save_config_on_unload"))) + if (weechat_config_boolean (weechat_config_get_weechat ("plugin_save_config_on_unload"))) weechat_config_write (ptr_script_callback->config_file); weechat_config_free (ptr_script_callback->config_file); } @@ -509,9 +507,9 @@ script_display_list (struct t_weechat_plugin *weechat_plugin, { weechat_printf (NULL, " %s%s%s v%s - %s", - weechat_color ("color_chat_buffer"), + weechat_color ("chat_buffer"), ptr_script->name, - weechat_color ("color_chat"), + weechat_color ("chat"), ptr_script->version, ptr_script->description); if (full) diff --git a/src/plugins/trigger/trigger.c b/src/plugins/trigger/trigger.c index 88daa3623..8f5a5974b 100644 --- a/src/plugins/trigger/trigger.c +++ b/src/plugins/trigger/trigger.c @@ -34,7 +34,7 @@ WEECHAT_PLUGIN_DESCRIPTION("Trigger plugin for WeeChat"); WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>"); WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION); WEECHAT_PLUGIN_WEECHAT_VERSION(WEECHAT_VERSION); -WEECHAT_PLUGIN_LICENSE("GPL"); +WEECHAT_PLUGIN_LICENSE("GPL3"); t_weechat_trigger *weechat_trigger_list = NULL; t_weechat_trigger *weechat_trigger_last = NULL; diff --git a/src/plugins/trigger/trigger.h b/src/plugins/trigger/trigger.h index 23d23e5ec..580f07e86 100644 --- a/src/plugins/trigger/trigger.h +++ b/src/plugins/trigger/trigger.h @@ -35,7 +35,7 @@ typedef struct t_weechat_trigger struct t_weechat_trigger *next_trigger; } t_weechat_trigger; -#define CONF_FILE "trigger.rc" +#define CONF_FILE "trigger.conf" #define CONF_SAVE 1 #define CONF_LOAD 2 #define DIR_SEP "/" diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h index 9a4f658b4..9228b099f 100644 --- a/src/plugins/weechat-plugin.h +++ b/src/plugins/weechat-plugin.h @@ -147,7 +147,7 @@ struct t_weechat_plugin char *data); struct t_weelist_item *(*list_get) (struct t_weelist *weelist, int position); - void (*list_set) (struct t_weelist_item *item, char *new_value); + void (*list_set) (struct t_weelist_item *item, char *value); struct t_weelist_item *(*list_next) (struct t_weelist_item *item); struct t_weelist_item *(*list_prev) (struct t_weelist_item *item); char *(*list_string) (struct t_weelist_item *item); @@ -159,16 +159,17 @@ struct t_weechat_plugin /* config files */ struct t_config_file *(*config_new) (struct t_weechat_plugin *plugin, - char *filename, + char *name, int (*callback_reload)(void *data, struct t_config_file *config_file), void *callback_reload_data); struct t_config_section *(*config_new_section) (struct t_config_file *config_file, char *name, - void (*callback_read)(void *data, - struct t_config_file *config_file, - char *option_name, - char *value), + int (*callback_read)(void *data, + struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, + char *value), void *callback_read_data, void (*callback_write)(void *data, struct t_config_file *config_file, @@ -177,7 +178,13 @@ struct t_weechat_plugin void (*callback_write_default)(void *data, struct t_config_file *config_file, char *section_name), - void *callback_write_default_data); + void *callback_write_default_data, + int (*callback_create_option)(void *data, + struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, + char *value), + void *callback_create_option_data); struct t_config_section *(*config_search_section) (struct t_config_file *config_file, char *section_name); struct t_config_option *(*config_new_option) (struct t_config_file *config_file, @@ -187,14 +194,36 @@ struct t_weechat_plugin char *string_values, int min, int max, char *default_value, - void (*callback_change)(void *data), - void *callback_change_data); + int (*callback_check_value)(void *data, + struct t_config_option *option, + char *value), + void *callback_check_value_data, + void (*callback_change)(void *data, + struct t_config_option *option), + void *callback_change_data, + void (*callback_delete)(void *data, + struct t_config_option *option), + void *callback_delete_data); struct t_config_option *(*config_search_option) (struct t_config_file *config_file, struct t_config_section *section, char *option_name); + void (*config_search_section_option) (struct t_config_file *config_file, + struct t_config_section *section, + char *option_name, + struct t_config_section **section_found, + struct t_config_option **option_found); + void (*config_search_with_string) (char *option_name, + struct t_config_file **config_file, + struct t_config_section **section, + struct t_config_option **option, + char **pos_option_name); int (*config_string_to_boolean) (char *text); - int (*config_option_set) (struct t_config_option *option, char *new_value, + int (*config_option_reset) (struct t_config_option *option, + int run_callback); + int (*config_option_set) (struct t_config_option *option, char *value, int run_callback); + void *(*config_option_get_pointer) (struct t_config_option *option, + char *property); int (*config_boolean) (struct t_config_option *option); int (*config_integer) (struct t_config_option *option); char *(*config_string) (struct t_config_option *option); @@ -204,6 +233,11 @@ struct t_weechat_plugin int (*config_write) (struct t_config_file *config_file); int (*config_read) (struct t_config_file *config_file); int (*config_reload) (struct t_config_file *config_file); + void (*config_option_free) (struct t_config_section *section, + struct t_config_option *option); + void (*config_section_free_options) (struct t_config_section *section); + void (*config_section_free) (struct t_config_file *config_file, + struct t_config_section *section); void (*config_free) (struct t_config_file *config_file); struct t_config_option *(*config_get_weechat) (char *option_name); char *(*config_get_plugin) (struct t_weechat_plugin *plugin, @@ -263,9 +297,9 @@ struct t_weechat_plugin void (*hook_signal_send) (char *signal, char *type_data, void *signal_data); struct t_hook *(*hook_config) (struct t_weechat_plugin *plugin, - char *type, char *option, - int (*callback)(void *data, char *type, - char *option, char *value), + char *option, + int (*callback)(void *data, char *option, + char *value), void *callback_data); struct t_hook *(*hook_completion) (struct t_weechat_plugin *plugin, char *completion, @@ -486,8 +520,8 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin); weechat_plugin->list_casesearch(__list, __string) #define weechat_list_get(__list, __index) \ weechat_plugin->list_get(__list, __index) -#define weechat_list_set(__item, __new_value) \ - weechat_plugin->list_set(__item, __new_value) +#define weechat_list_set(__item, __value) \ + weechat_plugin->list_set(__item, __value) #define weechat_list_next(__item) \ weechat_plugin->list_next(__item) #define weechat_list_prev(__item) \ @@ -504,37 +538,65 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin); weechat_plugin->list_free(__list) /* config files */ -#define weechat_config_new(__filename, __callback_reload, \ +#define weechat_config_new(__name, __callback_reload, \ __callback_reload_data) \ - weechat_plugin->config_new(weechat_plugin, __filename, \ + weechat_plugin->config_new(weechat_plugin, __name, \ __callback_reload, \ __callback_reload_data) -#define weechat_config_new_section(__config, __name, __cb_read, \ - __cb_read_data, __cb_write_std, \ - __cb_write_std_data, __cb_write_def, \ - __cb_write_def_data) \ - weechat_plugin->config_new_section(__config, __name, __cb_read, \ - __cb_read_data, __cb_write_std, \ - __cb_write_std_data,\ - __cb_write_def, \ - __cb_write_def_data) +#define weechat_config_new_section(__config, __name, \ + __cb_read, __cb_read_data, \ + __cb_write_std, __cb_write_std_data, \ + __cb_write_def, __cb_write_def_data, \ + __cb_create_option, \ + __cb_create_option_data) \ + weechat_plugin->config_new_section(__config, __name, \ + __cb_read, __cb_read_data, \ + __cb_write_std, \ + __cb_write_std_data, \ + __cb_write_def, \ + __cb_write_def_data, \ + __cb_create_option, \ + __cb_create_option_data) #define weechat_config_search_section(__config, __name) \ weechat_plugin->config_search_section(__config, __name) #define weechat_config_new_option(__config, __section, __name, __type, \ __desc, __string_values, __min, \ - __max, __default, __callback, \ - __callback_data) \ + __max, __default, __callback_check, \ + __callback_check_data, \ + __callback_change, \ + __callback_change_data, \ + __callback_delete, \ + __callback_delete_data) \ weechat_plugin->config_new_option(__config, __section, __name, \ __type, __desc, __string_values, \ __min, __max, __default, \ - __callback, __callback_data) + __callback_check, \ + __callback_check_data, \ + __callback_change, \ + __callback_change_data, \ + __callback_delete, \ + __callback_delete_data) #define weechat_config_search_option(__config, __section, __name) \ weechat_plugin->config_search_option(__config, __section, __name) +#define weechat_config_search_section_option(__config, __section, \ + __name, __section_found, \ + __option_found) \ + weechat_plugin->config_search_section_option(__config, __section, \ + __name, \ + __section_found, \ + __option_found); +#define weechat_config_search_with_string(__name, __config, __section, \ + __option, __pos_option) \ + weechat_plugin->config_search_with_string(__name, __config, \ + __section, __option, \ + __pos_option); #define weechat_config_string_to_boolean(__string) \ weechat_plugin->config_string_to_boolean(__string) #define weechat_config_option_set(__option, __value, __run_callback) \ weechat_plugin->config_option_set(__option, __value, \ __run_callback) +#define weechat_config_option_get_pointer(__option, __property) \ + weechat_plugin->config_option_get_pointer(__option, __property) #define weechat_config_boolean(__option) \ weechat_plugin->config_boolean(__option) #define weechat_config_integer(__option) \ @@ -553,6 +615,12 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin); weechat_plugin->config_read(__config) #define weechat_config_reload(__config) \ weechat_plugin->config_reload(__config) +#define weechat_config_option_free(__section, __option) \ + weechat_plugin->config_option_free(__section, __option) +#define weechat_config_section_free_options(__section) \ + weechat_plugin->config_section_free_options(__section) +#define weechat_config_section_free(__config, __section) \ + weechat_plugin->config_section_free(__config, __section) #define weechat_config_free(__config) \ weechat_plugin->config_free(__config) #define weechat_config_get_weechat(__option) \ @@ -619,9 +687,9 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin); #define weechat_hook_signal_send(__signal, __type_data, __signal_data) \ weechat_plugin->hook_signal_send(__signal, __type_data, \ __signal_data) -#define weechat_hook_config(__type, __option, __callback, __data) \ - weechat_plugin->hook_config(weechat_plugin, __type, __option, \ - __callback, __data) +#define weechat_hook_config(__option, __callback, __data) \ + weechat_plugin->hook_config(weechat_plugin, __option, __callback, \ + __data) #define weechat_hook_completion(__completion, __callback, __data) \ weechat_plugin->hook_completion(weechat_plugin, __completion, \ __callback, __data) |