93 lines
2.7 KiB
Diff
93 lines
2.7 KiB
Diff
From e64b6ec09ec934e506d566174ac6524c61336228 Mon Sep 17 00:00:00 2001
|
|
From: Peng Wu <alexepico@gmail.com>
|
|
Date: Fri, 6 Mar 2015 15:34:43 +0800
|
|
Subject: [PATCH 1/2] fixes shortcut keys in setup dialog
|
|
|
|
---
|
|
setup/main2.py | 6 +++---
|
|
setup/shortcuteditor.py | 2 ++
|
|
2 files changed, 5 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/setup/main2.py b/setup/main2.py
|
|
index 20a2dac..0103804 100644
|
|
--- a/setup/main2.py
|
|
+++ b/setup/main2.py
|
|
@@ -437,12 +437,12 @@ class PreferencesDialog:
|
|
self.__shortcut_editor.set_orientation(Gtk.Orientation.VERTICAL)
|
|
self.__shortcut_editor.show()
|
|
|
|
- # set shortcuts
|
|
- self.__shortcut_editor.update_shortcuts(self.__values)
|
|
-
|
|
# connect "shortcut-changed" signal
|
|
self.__shortcut_editor.connect("shortcut-changed", self.__shortcut_changed_cb)
|
|
|
|
+ # set shortcuts
|
|
+ self.__shortcut_editor.update_shortcuts(self.__values)
|
|
+
|
|
def __shortcut_changed_cb(self, editor, key, value):
|
|
self.__set_value(key, value)
|
|
|
|
diff --git a/setup/shortcuteditor.py b/setup/shortcuteditor.py
|
|
index 3ef76f1..fafb3c5 100644
|
|
--- a/setup/shortcuteditor.py
|
|
+++ b/setup/shortcuteditor.py
|
|
@@ -215,6 +215,8 @@ class ShortcutEditor(Gtk.Box):
|
|
for label, keyname, defvalue in accelerators:
|
|
value = values[keyname] if keyname in values else defvalue
|
|
self.__shortcut_treeview.set_shortcut_value(keyname, value)
|
|
+ # store the default value
|
|
+ self.emit_shortcut_changed(keyname, value)
|
|
|
|
class ShortcutEditorDialog(Gtk.Dialog):
|
|
def __init__(self, title = None, transient_for = None, flags = 0):
|
|
--
|
|
2.1.0
|
|
|
|
|
|
From cc5b6765c3ce22fc7876a48c2ffc292cae6aceb0 Mon Sep 17 00:00:00 2001
|
|
From: Peng Wu <alexepico@gmail.com>
|
|
Date: Mon, 9 Mar 2015 13:21:40 +0800
|
|
Subject: [PATCH 2/2] fixes default values
|
|
|
|
---
|
|
src/PYConfig.cc | 5 +++++
|
|
src/PYPConfig.cc | 5 +++++
|
|
2 files changed, 10 insertions(+)
|
|
|
|
diff --git a/src/PYConfig.cc b/src/PYConfig.cc
|
|
index ca419ce..4a3c0a7 100644
|
|
--- a/src/PYConfig.cc
|
|
+++ b/src/PYConfig.cc
|
|
@@ -64,6 +64,11 @@ Config::initDefaultValues (void)
|
|
m_special_phrases = TRUE;
|
|
|
|
m_dictionaries = "2";
|
|
+
|
|
+ m_main_switch = "<Shift>";
|
|
+ m_letter_switch = "";
|
|
+ m_punct_switch = "<Control>period";
|
|
+ m_trad_switch = "<Control><Shift>f";
|
|
}
|
|
|
|
|
|
diff --git a/src/PYPConfig.cc b/src/PYPConfig.cc
|
|
index ff897ea..b33038a 100644
|
|
--- a/src/PYPConfig.cc
|
|
+++ b/src/PYPConfig.cc
|
|
@@ -110,6 +110,11 @@ LibPinyinConfig::initDefaultValues (void)
|
|
m_special_phrases = TRUE;
|
|
|
|
m_dictionaries = "2";
|
|
+
|
|
+ m_main_switch = "<Shift>";
|
|
+ m_letter_switch = "";
|
|
+ m_punct_switch = "<Control>period";
|
|
+ m_trad_switch = "<Control><Shift>f";
|
|
}
|
|
|
|
static const struct {
|
|
--
|
|
2.1.0
|
|
|