| 1 |
diff -up scim-bridge-0.4.16/agent/scim-bridge-agent.cpp.1-hotkey-help scim-bridge-0.4.16/agent/scim-bridge-agent.cpp
|
| 2 |
--- scim-bridge-0.4.16/agent/scim-bridge-agent.cpp.1-hotkey-help 2009-03-08 23:07:29.000000000 +1000
|
| 3 |
+++ scim-bridge-0.4.16/agent/scim-bridge-agent.cpp 2009-05-02 09:49:03.000000000 +1000
|
| 4 |
@@ -542,6 +542,27 @@ void ScimBridgeAgentImpl::slot_reload_co
|
| 5 |
scim_global_config_flush ();
|
| 6 |
|
| 7 |
scim_keyboard_layout = scim_get_default_keyboard_layout ();
|
| 8 |
+
|
| 9 |
+ // Hot key name, hot key config key.
|
| 10 |
+ // ! Update hotkey_list_length according to updated list length.
|
| 11 |
+ int hotkey_list_length = 6;
|
| 12 |
+ String hotkey_list[][2] = {
|
| 13 |
+ { "Toggle on/off - ", "/Hotkeys/FrontEnd/Trigger" },
|
| 14 |
+ { "Turn on - ", "/Hotkeys/FrontEnd/On" },
|
| 15 |
+ { "Turn off - ", "/Hotkeys/FrontEnd/Off" },
|
| 16 |
+ { "Next input method - ", "/Hotkeys/FrontEnd/NextFactory" },
|
| 17 |
+ { "Previous input method - ", "/Hotkeys/FrontEnd/PreviousFactory" },
|
| 18 |
+ { "Show input method menu - ", "/Hotkeys/FrontEnd/ShowFactoryMenu" }
|
| 19 |
+ };
|
| 20 |
+
|
| 21 |
+ // Undefined hot keys are hidden from help window.
|
| 22 |
+ String help_hotkeys = "\nGlobal Hotkeys:";
|
| 23 |
+ for ( int i = 0; i < hotkey_list_length; i++ ) {
|
| 24 |
+ String tmp_hotkeys = scim_config->read (String (hotkey_list[i][1]), String (""));
|
| 25 |
+ if ( tmp_hotkeys != "" )
|
| 26 |
+ help_hotkeys += "\n" + hotkey_list[i][0] + "<" + tmp_hotkeys + ">";
|
| 27 |
+ }
|
| 28 |
+ ScimBridgeAgentIMContext::set_help_hotkeys (help_hotkeys);
|
| 29 |
}
|
| 30 |
|
| 31 |
|
| 32 |
diff -up scim-bridge-0.4.16/agent/scim-bridge-agent-imcontext.cpp.1-hotkey-help scim-bridge-0.4.16/agent/scim-bridge-agent-imcontext.cpp
|
| 33 |
--- scim-bridge-0.4.16/agent/scim-bridge-agent-imcontext.cpp.1-hotkey-help 2009-02-04 00:36:14.000000000 +1000
|
| 34 |
+++ scim-bridge-0.4.16/agent/scim-bridge-agent-imcontext.cpp 2009-05-02 09:51:26.000000000 +1000
|
| 35 |
@@ -60,6 +60,8 @@ static unsigned int imengine_id = 0;
|
| 36 |
|
| 37 |
static bool on_the_spot_enabled = true;
|
| 38 |
|
| 39 |
+static String help_hotkeys = "";
|
| 40 |
+
|
| 41 |
/* Class definition */
|
| 42 |
class ScimBridgeAgentIMContextImpl: public ScimBridgeAgentIMContext
|
| 43 |
{
|
| 44 |
@@ -274,6 +276,12 @@ void ScimBridgeAgentIMContext::set_on_th
|
| 45 |
}
|
| 46 |
|
| 47 |
|
| 48 |
+void ScimBridgeAgentIMContext::set_help_hotkeys (const String &hotkey_str)
|
| 49 |
+{
|
| 50 |
+ help_hotkeys = hotkey_str;
|
| 51 |
+}
|
| 52 |
+
|
| 53 |
+
|
| 54 |
ScimBridgeAgentIMContextImpl::ScimBridgeAgentIMContextImpl (ScimBridgeAgentClientListener *new_client_listener):
|
| 55 |
client_listener (new_client_listener), imengine (NULL), enabled (false), focused(false) ,preedit_mode (PREEDIT_ANY),
|
| 56 |
preedit_shown (false), preedit_cursor_position (0)
|
| 57 |
@@ -923,9 +931,11 @@ void ScimBridgeAgentIMContextImpl::panel
|
| 58 |
|
| 59 |
void ScimBridgeAgentIMContextImpl::panel_request_help ()
|
| 60 |
{
|
| 61 |
- String help = String ("Smart Common Input Method platform ") +
|
| 62 |
- String (SCIM_VERSION) +
|
| 63 |
- String ("\n(C) 2002-2005 James Su <suzhe@tsinghua.org.cn>\n\n");
|
| 64 |
+ String help = String ("SCIM Bridge") +
|
| 65 |
+ String (VERSION) +
|
| 66 |
+ String ("\n(C) 2006-2008 Ryo Dairiki <ryo-dairiki@users.sourceforge.net>\n") +
|
| 67 |
+ help_hotkeys +
|
| 68 |
+ String ("\n\n");
|
| 69 |
|
| 70 |
IMEngineFactoryPointer factory = scim_backend->get_factory (get_imengine ()->get_factory_uuid ());
|
| 71 |
if (factory.null ()) factory = fallback_imengine_factory;
|
| 72 |
diff -up scim-bridge-0.4.16/agent/scim-bridge-agent-imcontext.h.1-hotkey-help scim-bridge-0.4.16/agent/scim-bridge-agent-imcontext.h
|
| 73 |
--- scim-bridge-0.4.16/agent/scim-bridge-agent-imcontext.h.1-hotkey-help 2008-11-02 16:44:49.000000000 +1000
|
| 74 |
+++ scim-bridge-0.4.16/agent/scim-bridge-agent-imcontext.h 2009-05-02 09:49:03.000000000 +1000
|
| 75 |
@@ -130,6 +130,21 @@ class ScimBridgeAgentIMContext
|
| 76 |
static void set_enabled_by_default (bool enabled);
|
| 77 |
|
| 78 |
/**
|
| 79 |
+ * Get the hotkey help messages.
|
| 80 |
+ *
|
| 81 |
+ * @return help messages about hotkeys.
|
| 82 |
+ */
|
| 83 |
+ static scim::String get_help_hotkeys ();
|
| 84 |
+
|
| 85 |
+ /**
|
| 86 |
+ * Set the hotkey help messages.
|
| 87 |
+ *
|
| 88 |
+ * @param hotkey_str Help message about hotkeys.
|
| 89 |
+ *
|
| 90 |
+ */
|
| 91 |
+ static void set_help_hotkeys (const scim::String &hotkey_str);
|
| 92 |
+
|
| 93 |
+ /**
|
| 94 |
* Destructor.
|
| 95 |
*/
|
| 96 |
virtual ~ScimBridgeAgentIMContext () {}
|