From f841333609ab91b011dbe29099078f7599be0f2d Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Wed, 10 Aug 2011 12:24:23 +0200 Subject: [PATCH] core: allow mix of commands and hsignals for keys in context "mouse" --- po/cs.po | 18 +++++++++++- po/de.po | 18 +++++++++++- po/es.po | 18 +++++++++++- po/fr.po | 20 +++++++++++-- po/hu.po | 18 +++++++++++- po/it.po | 18 +++++++++++- po/pl.po | 18 +++++++++++- po/pt_BR.po | 18 +++++++++++- po/ru.po | 18 +++++++++++- po/weechat.pot | 18 +++++++++++- src/gui/gui-key.c | 73 ++++++++++++++++++++++------------------------- 11 files changed, 205 insertions(+), 50 deletions(-) diff --git a/po/cs.po b/po/cs.po index 48a861afc..86da93b88 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-09 12:39+0200\n" +"POT-Creation-Date: 2011-08-10 12:16+0200\n" "PO-Revision-Date: 2011-07-05 15:37+0200\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -3234,6 +3234,22 @@ msgstr "Chyba: nemohu napojit kalávesu \"%s\"" msgid "Error: not enough memory for key binding" msgstr "Chyba: nedostatek paměti pro klávesovou zkratku" +#, fuzzy, c-format +msgid "Hashtable focus: %s" +msgstr "Hash tabulka (výstup)" + +#, c-format +msgid "Command for key: \"%s\"" +msgstr "" + +#, c-format +msgid "Sending hsignal: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Executing command: \"%s\"" +msgstr "výchozí příkaz:" + msgid "Not enough memory for new line" msgstr "Nedostatek paměti pro nový řádek" diff --git a/po/de.po b/po/de.po index 1b54d2106..9c8bbd58c 100644 --- a/po/de.po +++ b/po/de.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-09 12:39+0200\n" +"POT-Creation-Date: 2011-08-10 12:16+0200\n" "PO-Revision-Date: 2011-07-14 20:53+0100\n" "Last-Translator: Nils Görs\n" "Language-Team: weechat-dev \n" @@ -3408,6 +3408,22 @@ msgstr "Fehler: kann die Taste \"%s\" nicht zuordnen" msgid "Error: not enough memory for key binding" msgstr "Fehler: nicht genügend Speicher für Tastenzuordnung" +#, fuzzy, c-format +msgid "Hashtable focus: %s" +msgstr "Hashtable (Ausgabe)" + +#, c-format +msgid "Command for key: \"%s\"" +msgstr "" + +#, c-format +msgid "Sending hsignal: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Executing command: \"%s\"" +msgstr "Standardbefehl:" + msgid "Not enough memory for new line" msgstr "Nicht genügend Speicher für eine neue Zeile" diff --git a/po/es.po b/po/es.po index 5ff005f9a..fea95d69c 100644 --- a/po/es.po +++ b/po/es.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-09 12:39+0200\n" +"POT-Creation-Date: 2011-08-10 12:16+0200\n" "PO-Revision-Date: 2011-07-05 15:37+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -3295,6 +3295,22 @@ msgstr "Error: no es posible crear el atajo \"%s\"" msgid "Error: not enough memory for key binding" msgstr "Error: no hay suficiente memoria para crear el atajo" +#, fuzzy, c-format +msgid "Hashtable focus: %s" +msgstr "Tabla hash (salida)" + +#, c-format +msgid "Command for key: \"%s\"" +msgstr "" + +#, c-format +msgid "Sending hsignal: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Executing command: \"%s\"" +msgstr "comando predeterminado:" + msgid "Not enough memory for new line" msgstr "No hay suficiente memoria para una línea nueva" diff --git a/po/fr.po b/po/fr.po index 79b4f8b69..d37439828 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-09 12:39+0200\n" -"PO-Revision-Date: 2011-08-09 12:40+0200\n" +"POT-Creation-Date: 2011-08-10 12:16+0200\n" +"PO-Revision-Date: 2011-08-10 12:17+0200\n" "Last-Translator: Sebastien Helleu \n" "Language-Team: weechat-dev \n" "Language: French\n" @@ -3401,6 +3401,22 @@ msgstr "Erreur: impossible de créer la touche \"%s\"" msgid "Error: not enough memory for key binding" msgstr "Erreur: pas assez de mémoire pour la touche" +#, c-format +msgid "Hashtable focus: %s" +msgstr "Hashtable focus: %s" + +#, c-format +msgid "Command for key: \"%s\"" +msgstr "Commande pour la touche: \"%s\"" + +#, c-format +msgid "Sending hsignal: \"%s\"" +msgstr "Envoi du hsignal: \"%s\"" + +#, c-format +msgid "Executing command: \"%s\"" +msgstr "Lancement de la commande: \"%s\"" + msgid "Not enough memory for new line" msgstr "Pas assez de mémoire pour une nouvelle ligne" diff --git a/po/hu.po b/po/hu.po index 25a476ff5..c9f8ad0f2 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-09 12:39+0200\n" +"POT-Creation-Date: 2011-08-10 12:16+0200\n" "PO-Revision-Date: 2011-05-15 10:51+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -2917,6 +2917,22 @@ msgstr "%s nem sikerült a(z) \"%s\" billentyűt hozzárendelni\n" msgid "Error: not enough memory for key binding" msgstr "%s nincs elég memória a billentyűhozzárendeléshez\n" +#, c-format +msgid "Hashtable focus: %s" +msgstr "" + +#, c-format +msgid "Command for key: \"%s\"" +msgstr "" + +#, c-format +msgid "Sending hsignal: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Executing command: \"%s\"" +msgstr "%s belső parancsok:\n" + #, fuzzy msgid "Not enough memory for new line" msgstr "Nincs elég memória az új sorhoz\n" diff --git a/po/it.po b/po/it.po index 7c9ab6c8c..9b928ba10 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-09 12:39+0200\n" +"POT-Creation-Date: 2011-08-10 12:16+0200\n" "PO-Revision-Date: 2011-07-16 11:32+0200\n" "Last-Translator: Marco Paolone \n" "Language-Team: weechat-dev \n" @@ -3316,6 +3316,22 @@ msgstr "Errore: impossibile associare il testo \"%s\"" msgid "Error: not enough memory for key binding" msgstr "Errore: memoria non sufficiente per l'associazione tasti" +#, fuzzy, c-format +msgid "Hashtable focus: %s" +msgstr "Tabella hash (output)" + +#, c-format +msgid "Command for key: \"%s\"" +msgstr "" + +#, c-format +msgid "Sending hsignal: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Executing command: \"%s\"" +msgstr "comando predefinito:" + msgid "Not enough memory for new line" msgstr "Memoria non sufficiente per una nuova riga" diff --git a/po/pl.po b/po/pl.po index a33b63be4..ee2a56ae6 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-09 12:39+0200\n" +"POT-Creation-Date: 2011-08-10 12:16+0200\n" "PO-Revision-Date: 2011-07-05 15:38+0200\n" "Last-Translator: Krzysztof Koroscik \n" "Language-Team: weechat-dev \n" @@ -3272,6 +3272,22 @@ msgstr "Błąd: nie można przypisać klawisza \"%s\"" msgid "Error: not enough memory for key binding" msgstr "Błąd: za mało pamięci do przypisania klawisza" +#, fuzzy, c-format +msgid "Hashtable focus: %s" +msgstr "Hashtable (wyjście)" + +#, c-format +msgid "Command for key: \"%s\"" +msgstr "" + +#, c-format +msgid "Sending hsignal: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Executing command: \"%s\"" +msgstr "domyślna komenda:" + msgid "Not enough memory for new line" msgstr "Za mało pamięci na nowy wiersz" diff --git a/po/pt_BR.po b/po/pt_BR.po index e27216aca..90a2eff51 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-09 12:39+0200\n" +"POT-Creation-Date: 2011-08-10 12:16+0200\n" "PO-Revision-Date: 2011-05-15 10:52+0200\n" "Last-Translator: Ivan Sichmann Freitas \n" "Language-Team: weechat-dev \n" @@ -3171,6 +3171,22 @@ msgstr "" msgid "Error: not enough memory for key binding" msgstr "" +#, c-format +msgid "Hashtable focus: %s" +msgstr "" + +#, c-format +msgid "Command for key: \"%s\"" +msgstr "" + +#, c-format +msgid "Sending hsignal: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Executing command: \"%s\"" +msgstr "comando padrão:" + msgid "Not enough memory for new line" msgstr "" diff --git a/po/ru.po b/po/ru.po index 19ec1e88a..2e683877e 100644 --- a/po/ru.po +++ b/po/ru.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-09 12:39+0200\n" +"POT-Creation-Date: 2011-08-10 12:16+0200\n" "PO-Revision-Date: 2011-05-15 10:52+0200\n" "Last-Translator: Pavel Shevchuk \n" "Language-Team: weechat-dev \n" @@ -2937,6 +2937,22 @@ msgstr "%s не могу установить клавишу \"%s\"\n" msgid "Error: not enough memory for key binding" msgstr "%s недостаточно памяти для установки клавиши\n" +#, c-format +msgid "Hashtable focus: %s" +msgstr "" + +#, c-format +msgid "Command for key: \"%s\"" +msgstr "" + +#, c-format +msgid "Sending hsignal: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Executing command: \"%s\"" +msgstr "Внутренние команды %s:\n" + #, fuzzy msgid "Not enough memory for new line" msgstr "Недостаточно памяти для новой строчки\n" diff --git a/po/weechat.pot b/po/weechat.pot index 4b02ad5b7..cd110cde9 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-09 12:39+0200\n" +"POT-Creation-Date: 2011-08-10 12:16+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2554,6 +2554,22 @@ msgstr "" msgid "Error: not enough memory for key binding" msgstr "" +#, c-format +msgid "Hashtable focus: %s" +msgstr "" + +#, c-format +msgid "Command for key: \"%s\"" +msgstr "" + +#, c-format +msgid "Sending hsignal: \"%s\"" +msgstr "" + +#, c-format +msgid "Executing command: \"%s\"" +msgstr "" + msgid "Not enough memory for new line" msgstr "" diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c index 6e70d072a..959060f87 100644 --- a/src/gui/gui-key.c +++ b/src/gui/gui-key.c @@ -771,67 +771,62 @@ gui_key_focus_command (const char *key, int context, if (!matching) continue; + if ((context == GUI_KEY_CONTEXT_CURSOR) && gui_cursor_debug) + { + gui_input_delete_line (gui_current_window->buffer); + } + hashtable = hook_focus_get_data (focus_info1, focus_info2, key); if (debug) { - gui_chat_printf (NULL, "Hashtable focus: %s", + gui_chat_printf (NULL, _("Hashtable focus: %s"), hashtable_get_string (hashtable, "keys_values_sorted")); + gui_chat_printf (NULL, _("Command for key: \"%s\""), + ptr_key->command); } - if (string_strncasecmp (ptr_key->command, "hsignal:", 8) == 0) + commands = string_split_command (ptr_key->command, ';'); + if (commands) { - if (ptr_key->command[8]) + for (i = 0; commands[i]; i++) { - if (debug) + if (string_strncasecmp (commands[i], "hsignal:", 8) == 0) { - gui_chat_printf (NULL, "Sending hsignal \"%s\"", - ptr_key->command + 8); - } - hook_hsignal_send (ptr_key->command + 8, hashtable); - } - } - else - { - command = string_replace_with_hashtable (ptr_key->command, - hashtable, - &errors); - if (command) - { - if (errors == 0) - { - if (debug) + if (commands[i][8]) { - gui_chat_printf (NULL, - "Executing command: %s (%s)", - command, ptr_key->command); - } - if ((context == GUI_KEY_CONTEXT_CURSOR) && gui_cursor_debug) - { - gui_input_delete_line (gui_current_window->buffer); - } - commands = string_split_command (command, ';'); - if (commands) - { - for (i = 0; commands[i]; i++) + if (debug) { - input_data (gui_current_window->buffer, commands[i]); + gui_chat_printf (NULL, + _("Sending hsignal: \"%s\""), + commands[i] + 8); } - string_free_split_command (commands); + hook_hsignal_send (commands[i] + 8, hashtable); } } else { - if (debug) + command = string_replace_with_hashtable (commands[i], + hashtable, + &errors); + if (command) { - gui_chat_printf (NULL, - "Command NOT executed (%s)", - ptr_key->command); + if (errors == 0) + { + if (debug) + { + gui_chat_printf (NULL, + _("Executing command: \"%s\""), + command); + } + input_data (gui_current_window->buffer, command); + } + free (command); } } - free (command); } + string_free_split_command (commands); } if (hashtable) hashtable_free (hashtable);