diff options
-rw-r--r-- | doc/de/autogen/user/weechat_commands.txt | 1 | ||||
-rw-r--r-- | doc/en/autogen/user/weechat_commands.txt | 1 | ||||
-rw-r--r-- | doc/fr/autogen/user/weechat_commands.txt | 1 | ||||
-rw-r--r-- | doc/it/autogen/user/weechat_commands.txt | 1 | ||||
-rw-r--r-- | po/cs.po | 5 | ||||
-rw-r--r-- | po/de.po | 5 | ||||
-rw-r--r-- | po/es.po | 5 | ||||
-rw-r--r-- | po/fr.po | 10 | ||||
-rw-r--r-- | po/hu.po | 5 | ||||
-rw-r--r-- | po/it.po | 5 | ||||
-rw-r--r-- | po/pl.po | 5 | ||||
-rw-r--r-- | po/pt_BR.po | 5 | ||||
-rw-r--r-- | po/ru.po | 5 | ||||
-rw-r--r-- | po/weechat.pot | 5 | ||||
-rw-r--r-- | src/core/wee-command.c | 5 | ||||
-rw-r--r-- | src/gui/gui-key.c | 74 |
16 files changed, 98 insertions, 40 deletions
diff --git a/doc/de/autogen/user/weechat_commands.txt b/doc/de/autogen/user/weechat_commands.txt index 1594561b3..169740040 100644 --- a/doc/de/autogen/user/weechat_commands.txt +++ b/doc/de/autogen/user/weechat_commands.txt @@ -364,6 +364,7 @@ For context "mouse" (possible in context "cursor" too), key has format: "@area:k item(*): any bar item item(xxx): bar item "xxx" The key can start or end with '*' to match many mouse events. +A special value for command wit format "hsignal:name" can be used for context mouse, this will send the hsignal "name" with the focus hashtable as argument. Examples: key alt-x to toggle nicklist bar: diff --git a/doc/en/autogen/user/weechat_commands.txt b/doc/en/autogen/user/weechat_commands.txt index 479424eac..3e8fd768a 100644 --- a/doc/en/autogen/user/weechat_commands.txt +++ b/doc/en/autogen/user/weechat_commands.txt @@ -364,6 +364,7 @@ For context "mouse" (possible in context "cursor" too), key has format: "@area:k item(*): any bar item item(xxx): bar item "xxx" The key can start or end with '*' to match many mouse events. +A special value for command wit format "hsignal:name" can be used for context mouse, this will send the hsignal "name" with the focus hashtable as argument. Examples: key alt-x to toggle nicklist bar: diff --git a/doc/fr/autogen/user/weechat_commands.txt b/doc/fr/autogen/user/weechat_commands.txt index 0fb576cbe..9fa5d9d57 100644 --- a/doc/fr/autogen/user/weechat_commands.txt +++ b/doc/fr/autogen/user/weechat_commands.txt @@ -364,6 +364,7 @@ Pour le contexte "mouse" (possible aussi pour le contexte "cursor"), la touche a item(*): n'importe quel objet de barre item(xxx): l'objet de barre "xxx" La touche peut commencer ou se terminer par '*' pour plusieurs évènements de la souris. +Une valeur spéciale pour la commande avec le format "hsignal:nom" peut être utilisée dans le contexte "mouse", cela enverra le signal "nom" avec la hashtable du focus comme paramètre. Exemples: touche alt-x pour activer/désactiver la liste des pseudos: diff --git a/doc/it/autogen/user/weechat_commands.txt b/doc/it/autogen/user/weechat_commands.txt index 47c8a1576..42b971913 100644 --- a/doc/it/autogen/user/weechat_commands.txt +++ b/doc/it/autogen/user/weechat_commands.txt @@ -364,6 +364,7 @@ For context "mouse" (possible in context "cursor" too), key has format: "@area:k item(*): any bar item item(xxx): bar item "xxx" The key can start or end with '*' to match many mouse events. +A special value for command wit format "hsignal:name" can be used for context mouse, this will send the hsignal "name" with the focus hashtable as argument. Examples: key alt-x to toggle nicklist bar: @@ -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-08 16:53+0200\n" +"POT-Creation-Date: 2011-08-09 12:39+0200\n" "PO-Revision-Date: 2011-07-05 15:37+0200\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1469,6 +1469,9 @@ msgid "" " item(*): any bar item\n" " item(xxx): bar item \"xxx\"\n" "The key can start or end with '*' to match many mouse events.\n" +"A special value for command wit format \"hsignal:name\" can be used for " +"context mouse, this will send the hsignal \"name\" with the focus hashtable " +"as argument.\n" "\n" "Examples:\n" " key alt-x to toggle nicklist bar:\n" @@ -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-08 16:53+0200\n" +"POT-Creation-Date: 2011-08-09 12:39+0200\n" "PO-Revision-Date: 2011-07-14 20:53+0100\n" "Last-Translator: Nils Görs\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1520,6 +1520,9 @@ msgid "" " item(*): any bar item\n" " item(xxx): bar item \"xxx\"\n" "The key can start or end with '*' to match many mouse events.\n" +"A special value for command wit format \"hsignal:name\" can be used for " +"context mouse, this will send the hsignal \"name\" with the focus hashtable " +"as argument.\n" "\n" "Examples:\n" " key alt-x to toggle nicklist bar:\n" @@ -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-08 16:53+0200\n" +"POT-Creation-Date: 2011-08-09 12:39+0200\n" "PO-Revision-Date: 2011-07-05 15:37+0200\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1479,6 +1479,9 @@ msgid "" " item(*): any bar item\n" " item(xxx): bar item \"xxx\"\n" "The key can start or end with '*' to match many mouse events.\n" +"A special value for command wit format \"hsignal:name\" can be used for " +"context mouse, this will send the hsignal \"name\" with the focus hashtable " +"as argument.\n" "\n" "Examples:\n" " key alt-x to toggle nicklist bar:\n" @@ -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-08 16:53+0200\n" -"PO-Revision-Date: 2011-08-08 16:53+0200\n" +"POT-Creation-Date: 2011-08-09 12:39+0200\n" +"PO-Revision-Date: 2011-08-09 12:40+0200\n" "Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: French\n" @@ -1510,6 +1510,9 @@ msgid "" " item(*): any bar item\n" " item(xxx): bar item \"xxx\"\n" "The key can start or end with '*' to match many mouse events.\n" +"A special value for command wit format \"hsignal:name\" can be used for " +"context mouse, this will send the hsignal \"name\" with the focus hashtable " +"as argument.\n" "\n" "Examples:\n" " key alt-x to toggle nicklist bar:\n" @@ -1560,6 +1563,9 @@ msgstr "" " item(xxx): l'objet de barre \"xxx\"\n" "La touche peut commencer ou se terminer par '*' pour plusieurs évènements de " "la souris.\n" +"Une valeur spéciale pour la commande avec le format \"hsignal:nom\" peut " +"être utilisée dans le contexte \"mouse\", cela enverra le signal \"nom\" " +"avec la hashtable du focus comme paramètre.\n" "\n" "Exemples:\n" " touche alt-x pour activer/désactiver la liste des pseudos:\n" @@ -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-08 16:53+0200\n" +"POT-Creation-Date: 2011-08-09 12:39+0200\n" "PO-Revision-Date: 2011-05-15 10:51+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1305,6 +1305,9 @@ msgid "" " item(*): any bar item\n" " item(xxx): bar item \"xxx\"\n" "The key can start or end with '*' to match many mouse events.\n" +"A special value for command wit format \"hsignal:name\" can be used for " +"context mouse, this will send the hsignal \"name\" with the focus hashtable " +"as argument.\n" "\n" "Examples:\n" " key alt-x to toggle nicklist bar:\n" @@ -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-08 16:53+0200\n" +"POT-Creation-Date: 2011-08-09 12:39+0200\n" "PO-Revision-Date: 2011-07-16 11:32+0200\n" "Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1485,6 +1485,9 @@ msgid "" " item(*): any bar item\n" " item(xxx): bar item \"xxx\"\n" "The key can start or end with '*' to match many mouse events.\n" +"A special value for command wit format \"hsignal:name\" can be used for " +"context mouse, this will send the hsignal \"name\" with the focus hashtable " +"as argument.\n" "\n" "Examples:\n" " key alt-x to toggle nicklist bar:\n" @@ -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-08 16:53+0200\n" +"POT-Creation-Date: 2011-08-09 12:39+0200\n" "PO-Revision-Date: 2011-07-05 15:38+0200\n" "Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1483,6 +1483,9 @@ msgid "" " item(*): any bar item\n" " item(xxx): bar item \"xxx\"\n" "The key can start or end with '*' to match many mouse events.\n" +"A special value for command wit format \"hsignal:name\" can be used for " +"context mouse, this will send the hsignal \"name\" with the focus hashtable " +"as argument.\n" "\n" "Examples:\n" " key alt-x to toggle nicklist bar:\n" diff --git a/po/pt_BR.po b/po/pt_BR.po index f062e6d2b..e27216aca 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-08 16:53+0200\n" +"POT-Creation-Date: 2011-08-09 12:39+0200\n" "PO-Revision-Date: 2011-05-15 10:52+0200\n" "Last-Translator: Ivan Sichmann Freitas <ivansichfreitas@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1476,6 +1476,9 @@ msgid "" " item(*): any bar item\n" " item(xxx): bar item \"xxx\"\n" "The key can start or end with '*' to match many mouse events.\n" +"A special value for command wit format \"hsignal:name\" can be used for " +"context mouse, this will send the hsignal \"name\" with the focus hashtable " +"as argument.\n" "\n" "Examples:\n" " key alt-x to toggle nicklist bar:\n" @@ -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-08 16:53+0200\n" +"POT-Creation-Date: 2011-08-09 12:39+0200\n" "PO-Revision-Date: 2011-05-15 10:52+0200\n" "Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1313,6 +1313,9 @@ msgid "" " item(*): any bar item\n" " item(xxx): bar item \"xxx\"\n" "The key can start or end with '*' to match many mouse events.\n" +"A special value for command wit format \"hsignal:name\" can be used for " +"context mouse, this will send the hsignal \"name\" with the focus hashtable " +"as argument.\n" "\n" "Examples:\n" " key alt-x to toggle nicklist bar:\n" diff --git a/po/weechat.pot b/po/weechat.pot index ab4dc2d32..4b02ad5b7 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-08 16:53+0200\n" +"POT-Creation-Date: 2011-08-09 12:39+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" @@ -1157,6 +1157,9 @@ msgid "" " item(*): any bar item\n" " item(xxx): bar item \"xxx\"\n" "The key can start or end with '*' to match many mouse events.\n" +"A special value for command wit format \"hsignal:name\" can be used for " +"context mouse, this will send the hsignal \"name\" with the focus hashtable " +"as argument.\n" "\n" "Examples:\n" " key alt-x to toggle nicklist bar:\n" diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 069cd3941..5ad50b6ee 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -5677,7 +5677,10 @@ command_init () " item(*): any bar item\n" " item(xxx): bar item \"xxx\"\n" "The key can start or end with '*' to match many mouse " - "events.\n\n" + "events.\n" + "A special value for command wit format \"hsignal:name\" " + "can be used for context mouse, this will send the hsignal " + "\"name\" with the focus hashtable as argument.\n\n" "Examples:\n" " key alt-x to toggle nicklist bar:\n" " /key bind meta-x /bar toggle nicklist\n" diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c index 32a7879d4..6e70d072a 100644 --- a/src/gui/gui-key.c +++ b/src/gui/gui-key.c @@ -739,10 +739,13 @@ gui_key_focus_command (const char *key, int context, struct t_gui_focus_info *focus_info2) { struct t_gui_key *ptr_key; - int i, errors, matching, area_type; + int i, errors, matching, area_type, debug; char *pos, *command, **commands, *area_name; struct t_hashtable *hashtable; + debug = ((gui_cursor_debug && (context == GUI_KEY_CONTEXT_CURSOR)) + || (gui_mouse_debug && (context == GUI_KEY_CONTEXT_MOUSE))); + for (ptr_key = gui_keys[context]; ptr_key; ptr_key = ptr_key->next_key) { @@ -771,49 +774,64 @@ gui_key_focus_command (const char *key, int context, hashtable = hook_focus_get_data (focus_info1, focus_info2, key); - if (gui_cursor_debug || gui_mouse_debug) + if (debug) { gui_chat_printf (NULL, "Hashtable focus: %s", hashtable_get_string (hashtable, "keys_values_sorted")); } - command = string_replace_with_hashtable (ptr_key->command, - hashtable, - &errors); - if (command) + if (string_strncasecmp (ptr_key->command, "hsignal:", 8) == 0) { - if (errors == 0) + if (ptr_key->command[8]) { - if (gui_cursor_debug || gui_mouse_debug) - { - gui_chat_printf (NULL, - "Command executed: %s (%s)", - command, ptr_key->command); - } - if ((context == GUI_KEY_CONTEXT_CURSOR) && gui_cursor_debug) + if (debug) { - gui_input_delete_line (gui_current_window->buffer); + gui_chat_printf (NULL, "Sending hsignal \"%s\"", + ptr_key->command + 8); } - commands = string_split_command (command, ';'); - if (commands) + hook_hsignal_send (ptr_key->command + 8, hashtable); + } + } + else + { + command = string_replace_with_hashtable (ptr_key->command, + hashtable, + &errors); + if (command) + { + if (errors == 0) { - for (i = 0; commands[i]; i++) + if (debug) { - input_data (gui_current_window->buffer, commands[i]); + 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++) + { + input_data (gui_current_window->buffer, commands[i]); + } + string_free_split_command (commands); } - string_free_split_command (commands); } - } - else - { - if (gui_cursor_debug || gui_mouse_debug) + else { - gui_chat_printf (NULL, - "Command NOT executed (%s)", - ptr_key->command); + if (debug) + { + gui_chat_printf (NULL, + "Command NOT executed (%s)", + ptr_key->command); + } } + free (command); } - free (command); } if (hashtable) hashtable_free (hashtable); |