diff --git a/ChangeLog b/ChangeLog index cbdc95c9e..196413da7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,8 @@ Version 0.3.9 (under dev!) * irc: reallow names beginning with "#" for servers * lua: fix crash when unloading a script without pointer to interpreter * python: fix crash when unloading a script without pointer to interpreter +* scripts: ignore call to "register" (with a warning) if script is already + registered Version 0.3.8 (2012-06-03) -------------------------- diff --git a/po/cs.po b/po/cs.po index 223c2b828..400a18956 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-06-10 09:48+0200\n" +"POT-Creation-Date: 2012-06-10 22:58+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -7695,6 +7695,10 @@ msgstr "" "jméno rmodifikátoru (může začínat nebo končit \"*\" jako zástupným znakem) " "(volitelné)" +#, fuzzy, c-format +msgid "%s%s: script \"%s\" already registered (register ignored)" +msgstr "%s%s: server \"%s\" již existuje, nemohu jej vytvořít!" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " diff --git a/po/de.po b/po/de.po index d4f46c94c..c57736e4d 100644 --- a/po/de.po +++ b/po/de.po @@ -23,7 +23,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-06-10 09:48+0200\n" +"POT-Creation-Date: 2012-06-10 22:58+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -8226,6 +8226,12 @@ msgstr "" "rmodifier Name (darf mit einem \"*\" als Platzhalter beginnen oder enden) " "(optional)" +#, fuzzy, c-format +msgid "%s%s: script \"%s\" already registered (register ignored)" +msgstr "" +"%s%s: Der Server \"%s\" existiert bereits und kann daher nicht angelegt " +"werden!" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " diff --git a/po/es.po b/po/es.po index 5bfd13779..f3a03dadf 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-06-10 09:48+0200\n" +"POT-Creation-Date: 2012-06-10 22:58+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -7964,6 +7964,10 @@ msgstr "" "nombre del modificador regular (puede empezar o terminar con \"*\" como " "comodín) (opcional)" +#, fuzzy, c-format +msgid "%s%s: script \"%s\" already registered (register ignored)" +msgstr "%s%s: el servidor \"%s\" ya existe, ¡no se puede crear!" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " diff --git a/po/fr.po b/po/fr.po index 54298c14e..def445cfd 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-06-10 09:48+0200\n" -"PO-Revision-Date: 2012-06-10 09:31+0200\n" +"POT-Creation-Date: 2012-06-10 22:58+0200\n" +"PO-Revision-Date: 2012-06-10 23:00+0200\n" "Last-Translator: Sebastien Helleu \n" "Language-Team: weechat-dev \n" "Language: French\n" @@ -8011,6 +8011,10 @@ msgstr "" "nom du rmodifier (peut démarrer ou se terminer par \"*\" comme caractère " "joker) (optionnel)" +#, c-format +msgid "%s%s: script \"%s\" already registered (register ignored)" +msgstr "%s%s: script \"%s\" déjà enregistré (register ignoré)" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " diff --git a/po/hu.po b/po/hu.po index 984c6337f..12654fac7 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-06-10 09:48+0200\n" +"POT-Creation-Date: 2012-06-10 22:58+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -7195,6 +7195,10 @@ msgstr "Beállítások mentése a lemezre\n" msgid "rmodifier name (can start or end with \"*\" as joker) (optional)" msgstr "" +#, fuzzy, c-format +msgid "%s%s: script \"%s\" already registered (register ignored)" +msgstr "%s a \"%s\" szerver már létezik, nem hozhatja létre!\n" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " diff --git a/po/it.po b/po/it.po index ad834f0a8..41940b3bc 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-06-10 09:48+0200\n" +"POT-Creation-Date: 2012-06-10 22:58+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: Marco Paolone \n" "Language-Team: weechat-dev \n" @@ -7945,6 +7945,10 @@ msgstr "" "nome rmodifier (può iniziare o terminare con \"*\" come carattere jolly) " "(opzionale)" +#, fuzzy, c-format +msgid "%s%s: script \"%s\" already registered (register ignored)" +msgstr "%s%s: il server \"%s\" esiste già, impossibile crearlo!" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " diff --git a/po/ja.po b/po/ja.po index a06f02d9d..3b5c1eaac 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-06-10 09:48+0200\n" +"POT-Creation-Date: 2012-06-10 22:58+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" @@ -7746,6 +7746,10 @@ msgstr "rmodifier ポインタ (オプション)" msgid "rmodifier name (can start or end with \"*\" as joker) (optional)" msgstr "rmodifier 名 (ジョーカーとして \"*\" で始めるか終われる) (オプション)" +#, fuzzy, c-format +msgid "%s%s: script \"%s\" already registered (register ignored)" +msgstr "%s%s: サーバ \"%s\" は既に存在しており、作成できません" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " diff --git a/po/pl.po b/po/pl.po index ba68bb6e5..2d29783cf 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-06-10 09:48+0200\n" +"POT-Creation-Date: 2012-06-10 22:58+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -7885,6 +7885,10 @@ msgstr "wskaźnik rmodifier (opcjonalny)" msgid "rmodifier name (can start or end with \"*\" as joker) (optional)" msgstr "nazwa rmodifier (może się zaczynać lub kończyć \"*\") (opcjonalne)" +#, fuzzy, c-format +msgid "%s%s: script \"%s\" already registered (register ignored)" +msgstr "%s%s: serwer \"%s\" już istnieje, nie mogę go utworzyć!" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " diff --git a/po/pt_BR.po b/po/pt_BR.po index 553d57e3e..afc18b7a5 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-06-10 09:48+0200\n" +"POT-Creation-Date: 2012-06-10 22:58+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: Sergio Durigan Junior \n" "Language-Team: weechat-dev \n" @@ -7326,6 +7326,10 @@ msgstr "" "nome do rmodifier (pode começar ou terminar com \"*\" como um coringa) " "(opcional)" +#, c-format +msgid "%s%s: script \"%s\" already registered (register ignored)" +msgstr "" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " diff --git a/po/ru.po b/po/ru.po index 10310ac3e..dae903504 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-06-10 09:48+0200\n" +"POT-Creation-Date: 2012-06-10 22:58+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -7217,6 +7217,10 @@ msgstr "Сохраняю конфигурацию\n" msgid "rmodifier name (can start or end with \"*\" as joker) (optional)" msgstr "" +#, fuzzy, c-format +msgid "%s%s: script \"%s\" already registered (register ignored)" +msgstr "%s сервер \"%s\" уже существует, не могу создать его!\n" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " diff --git a/po/weechat.pot b/po/weechat.pot index 1aacbcf99..366ee9816 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: 2012-06-10 09:48+0200\n" +"POT-Creation-Date: 2012-06-10 22:58+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -6313,6 +6313,10 @@ msgstr "" msgid "rmodifier name (can start or end with \"*\" as joker) (optional)" msgstr "" +#, c-format +msgid "%s%s: script \"%s\" already registered (register ignored)" +msgstr "" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " diff --git a/src/plugins/scripts/guile/weechat-guile-api.c b/src/plugins/scripts/guile/weechat-guile-api.c index 95b309b08..fe5e3c49e 100644 --- a/src/plugins/scripts/guile/weechat-guile-api.c +++ b/src/plugins/scripts/guile/weechat-guile-api.c @@ -87,6 +87,16 @@ weechat_guile_api_register (SCM name, SCM author, SCM version, SCM license, SCM description, SCM shutdown_func, SCM charset) { API_FUNC(0, "register", API_RETURN_ERROR); + if (guile_registered_script) + { + /* script already registered */ + weechat_printf (NULL, + weechat_gettext ("%s%s: script \"%s\" already " + "registered (register ignored)"), + weechat_prefix ("error"), GUILE_PLUGIN_NAME, + guile_registered_script->name); + API_RETURN_ERROR; + } guile_current_script = NULL; guile_registered_script = NULL; if (!scm_is_string (name) || !scm_is_string (author) @@ -98,7 +108,7 @@ weechat_guile_api_register (SCM name, SCM author, SCM version, SCM license, if (script_search (weechat_guile_plugin, guile_scripts, scm_i_string_chars (name))) { - /* error: another scripts already exists with this name! */ + /* another script already exists with same name */ weechat_printf (NULL, weechat_gettext ("%s%s: unable to register script " "\"%s\" (another script already " diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c index 29668aa11..85a91076b 100644 --- a/src/plugins/scripts/lua/weechat-lua-api.c +++ b/src/plugins/scripts/lua/weechat-lua-api.c @@ -94,6 +94,16 @@ weechat_lua_api_register (lua_State *L) const char *shutdown_func, *charset; API_FUNC(0, "register", API_RETURN_ERROR); + if (lua_registered_script) + { + /* script already registered */ + weechat_printf (NULL, + weechat_gettext ("%s%s: script \"%s\" already " + "registered (register ignored)"), + weechat_prefix ("error"), LUA_PLUGIN_NAME, + lua_registered_script->name); + API_RETURN_ERROR; + } lua_current_script = NULL; lua_registered_script = NULL; if (lua_gettop (lua_current_interpreter) < 7) @@ -109,6 +119,7 @@ weechat_lua_api_register (lua_State *L) if (script_search (weechat_lua_plugin, lua_scripts, name)) { + /* another script already exists with same name */ weechat_printf (NULL, weechat_gettext ("%s%s: unable to register script " "\"%s\" (another script already " diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c index c2f7a8162..ccd1a6a2d 100644 --- a/src/plugins/scripts/perl/weechat-perl-api.c +++ b/src/plugins/scripts/perl/weechat-perl-api.c @@ -107,6 +107,16 @@ XS (XS_weechat_api_register) (void) items; API_FUNC(0, "register", API_RETURN_ERROR); + if (perl_registered_script) + { + /* script already registered */ + weechat_printf (NULL, + weechat_gettext ("%s%s: script \"%s\" already " + "registered (register ignored)"), + weechat_prefix ("error"), PERL_PLUGIN_NAME, + perl_registered_script->name); + API_RETURN_ERROR; + } perl_current_script = NULL; perl_registered_script = NULL; @@ -123,7 +133,7 @@ XS (XS_weechat_api_register) if (script_search (weechat_perl_plugin, perl_scripts, name)) { - /* error: another script already exists with this name! */ + /* another script already exists with same name */ weechat_printf (NULL, weechat_gettext ("%s%s: unable to register script " "\"%s\" (another script already " diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index bc1076fb0..a382ef062 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -90,6 +90,16 @@ weechat_python_api_register (PyObject *self, PyObject *args) char *charset; API_FUNC(0, "register", API_RETURN_ERROR); + if (python_registered_script) + { + /* script already registered */ + weechat_printf (NULL, + weechat_gettext ("%s%s: script \"%s\" already " + "registered (register ignored)"), + weechat_prefix ("error"), PYTHON_PLUGIN_NAME, + python_registered_script->name); + API_RETURN_ERROR; + } python_current_script = NULL; python_registered_script = NULL; name = NULL; @@ -105,7 +115,7 @@ weechat_python_api_register (PyObject *self, PyObject *args) if (script_search (weechat_python_plugin, python_scripts, name)) { - /* error: another scripts already exists with this name! */ + /* another script already exists with same name */ weechat_printf (NULL, weechat_gettext ("%s%s: unable to register script " "\"%s\" (another script already " diff --git a/src/plugins/scripts/ruby/weechat-ruby-api.c b/src/plugins/scripts/ruby/weechat-ruby-api.c index 1bc01b1fd..3cef992ae 100644 --- a/src/plugins/scripts/ruby/weechat-ruby-api.c +++ b/src/plugins/scripts/ruby/weechat-ruby-api.c @@ -91,6 +91,16 @@ weechat_ruby_api_register (VALUE class, VALUE name, VALUE author, char *c_shutdown_func, *c_charset; API_FUNC(0, "register", API_RETURN_ERROR); + if (ruby_registered_script) + { + /* script already registered */ + weechat_printf (NULL, + weechat_gettext ("%s%s: script \"%s\" already " + "registered (register ignored)"), + weechat_prefix ("error"), RUBY_PLUGIN_NAME, + ruby_registered_script->name); + API_RETURN_ERROR; + } ruby_current_script = NULL; ruby_registered_script = NULL; if (NIL_P (name) || NIL_P (author) || NIL_P (version) @@ -116,7 +126,7 @@ weechat_ruby_api_register (VALUE class, VALUE name, VALUE author, if (script_search (weechat_ruby_plugin, ruby_scripts, c_name)) { - /* error: another scripts already exists with this name! */ + /* another script already exists with same name */ weechat_printf (NULL, weechat_gettext ("%s%s: unable to register script " "\"%s\" (another script already " diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c index c282242e4..6762516b5 100644 --- a/src/plugins/scripts/tcl/weechat-tcl-api.c +++ b/src/plugins/scripts/tcl/weechat-tcl-api.c @@ -218,6 +218,16 @@ weechat_tcl_api_register (ClientData clientData, Tcl_Interp *interp, int objc, int i; API_FUNC(0, "register", API_RETURN_ERROR); + if (tcl_registered_script) + { + /* script already registered */ + weechat_printf (NULL, + weechat_gettext ("%s%s: script \"%s\" already " + "registered (register ignored)"), + weechat_prefix ("error"), TCL_PLUGIN_NAME, + tcl_registered_script->name); + API_RETURN_ERROR; + } tcl_current_script = NULL; tcl_registered_script = NULL; @@ -234,7 +244,7 @@ weechat_tcl_api_register (ClientData clientData, Tcl_Interp *interp, int objc, if (script_search (weechat_tcl_plugin, tcl_scripts, name)) { - /* error: another script already exists with this name! */ + /* another script already exists with same name */ weechat_printf (NULL, weechat_gettext ("%s%s: unable to register script " "\"%s\" (another script already "