Bumped to 1.5.4

This commit is contained in:
Takao Fujiwara 2013-09-21 19:30:20 +09:00
parent 28399e7f1a
commit 1faf033457
8 changed files with 367 additions and 307 deletions

20
.gitignore vendored
View File

@ -1,12 +1,3 @@
ibus-1.3.6.tar.gz
/ibus-1.3.7.tar.gz
/ibus-1.3.8.tar.gz
/ibus-1.3.9.tar.gz
/ibus-1.4.0.tar.gz
/ibus-1.4.1.tar.gz
/ibus-1.5.1.tar.gz
/ibus-1.5.2.tar.gz
/ibus-1.5.3.tar.gz
/ibus-gjs-3.0.2.20110823.tar.gz
/ibus-gjs-3.1.4.20110823.tar.gz
/ibus-gjs-3.0.2.20110908.tar.gz
@ -33,3 +24,14 @@ ibus-1.3.6.tar.gz
/ibus-gjs-3.4.1.20120518.tar.gz
/ibus-gjs-3.4.1.20120815.tar.gz
/ibus-gjs-3.4.1.20130115.tar.gz
/ibus-xkb-1.5.0.tar.gz
ibus-1.3.6.tar.gz
/ibus-1.3.7.tar.gz
/ibus-1.3.8.tar.gz
/ibus-1.3.9.tar.gz
/ibus-1.4.0.tar.gz
/ibus-1.4.1.tar.gz
/ibus-1.5.1.tar.gz
/ibus-1.5.2.tar.gz
/ibus-1.5.3.tar.gz
/ibus-1.5.4.tar.gz

View File

@ -1,31 +1,31 @@
From 38a22f910f28d0babadd79d8430b2854281f705e Mon Sep 17 00:00:00 2001
From d566bc83a4672b88a38fa5de25741b99ebaeae62 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Fri, 26 Jul 2013 11:28:51 +0900
Date: Fri, 20 Sep 2013 17:20:09 +0900
Subject: [PATCH] Reload preload engines until users customize the list.
The idea is, if users don't customize the preload_engines with ibus-setup,
users would prefer to load the system default engines again by login.
The gconf value 'preload_engine_mode' is
The gsettings value 'preload-engine-mode' is
IBUS_PRELOAD_ENGINE_MODE_USER by default but set
IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE for the initial login.
If preload_engine_mode is IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE,
If 'preload-engine-mode' is IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE,
ibus-daemon loads the system preload engines by langs.
If preload_engine_mode is IBUS_PRELOAD_ENGINE_MODE_USER,
ibus-daemon do not update the gconf value preload_engines.
If 'preload-engine-mode' is IBUS_PRELOAD_ENGINE_MODE_USER,
ibus-daemon do not update the gsettings value 'preload-engines'
On the other hand, if users enable the customized engine checkbutton
on ibus-setup, ibus-setup sets 'preload_engine_mode' as
on ibus-setup, ibus-setup sets 'preload-engine-mode' as
IBUS_PRELOAD_ENGINE_MODE_USER and users can customize the value
'preload_engines'.
'preload-engines'.
---
data/ibus.schemas.in | 24 +++++++++
setup/main.py | 73 ++++++++++++++++++++++++---
setup/setup.ui | 22 +++++++--
src/ibustypes.h | 10 ++++
ui/gtk3/panel.vala | 136 +++++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 254 insertions(+), 11 deletions(-)
data/ibus.schemas.in | 24 ++++++++++++++
setup/main.py | 70 +++++++++++++++++++++++++++++++++++----
setup/setup.ui | 22 +++++++++++--
src/ibustypes.h | 10 ++++++
ui/gtk3/panel.vala | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 210 insertions(+), 9 deletions(-)
diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in
index d0b3db8..52ece27 100644
index 88a287f..b6709fd 100644
--- a/data/ibus.schemas.in
+++ b/data/ibus.schemas.in
@@ -2,6 +2,30 @@
@ -60,26 +60,29 @@ index d0b3db8..52ece27 100644
<applyto>/desktop/ibus/general/preload_engines</applyto>
<owner>ibus</owner>
diff --git a/setup/main.py b/setup/main.py
index 9703d5e..b39a044 100644
index d3f4414..235ef9c 100644
--- a/setup/main.py
+++ b/setup/main.py
@@ -189,16 +189,27 @@ class Setup(object):
self.__checkbutton_use_global_engine.connect("toggled",
self.__checkbutton_use_global_engine_toggled_cb)
@@ -187,16 +187,30 @@ class Setup(object):
'active',
Gio.SettingsBindFlags.DEFAULT)
+ # set preload mode
+ preload_engine_mode = IBus.PreloadEngineMode.USER
+ variant = self.__config.get_value("general", "preload_engine_mode")
+ if variant != None:
+ preload_engine_mode = variant.get_int32()
+ preload_engine_mode = \
+ self.__settings_general.get_int('preload-engine-mode')
+ button = self.__builder.get_object("checkbutton_preload_engine_mode")
+ hbox = self.__builder.get_object("hbox_customize_active_input_methods")
+ if preload_engine_mode == IBus.PreloadEngineMode.USER:
+ button.set_active(True)
+ self.__builder.get_object("hbox_customize_active_input_methods").set_sensitive(True)
+ hbox.set_sensitive(True)
+ else:
+ button.set_active(False)
+ self.__builder.get_object("hbox_customize_active_input_methods").set_sensitive(False)
+ button.connect("toggled", self.__checkbutton_preload_engine_mode_toggled_cb)
+ hbox.set_sensitive(False)
+ button.connect('toggled',
+ self.__checkbutton_preload_engine_mode_toggled_cb)
+
+ self.__settings_general.connect('changed::preload-engines',
+ self.__settings_general_preload_engines_cb)
+
# init engine page
self.__engines = self.__bus.list_engines()
@ -89,21 +92,13 @@ index 9703d5e..b39a044 100644
- tmp_dict = {}
- for e in self.__engines:
- tmp_dict[e.get_name()] = e
engine_names = values.get("preload_engines", [])
engine_names = self.__settings_general.get_strv('preload-engines')
- engines = [tmp_dict[name] for name in engine_names if name in tmp_dict]
+ engines = self.__get_engine_descs_from_names(engine_names)
self.__treeview = self.__builder.get_object("treeview_engines")
self.__treeview.set_engines(engines)
@@ -242,6 +253,7 @@ class Setup(object):
self.__checkbutton_auto_start_toggled_cb)
self.__config = self.__bus.get_config()
+ self.__config.connect("value-changed", self.__config_value_changed_cb)
self.__init_hotkey()
self.__init_panel()
@@ -250,8 +262,8 @@ class Setup(object):
@@ -246,8 +260,8 @@ class Setup(object):
def __combobox_notify_active_engine_cb(self, combobox, property):
engine = self.__combobox.get_active_engine()
button = self.__builder.get_object("button_engine_add")
@ -114,7 +109,7 @@ index 9703d5e..b39a044 100644
def __get_engine_setup_exec_args(self, engine):
args = []
@@ -271,6 +283,13 @@ class Setup(object):
@@ -267,6 +281,13 @@ class Setup(object):
args.append(path.basename(setup_path))
return args
@ -128,18 +123,17 @@ index 9703d5e..b39a044 100644
def __treeview_notify_cb(self, treeview, prop):
if prop.name not in ("active-engine", "engines"):
return
@@ -323,6 +342,34 @@ class Setup(object):
@@ -318,6 +339,43 @@ class Setup(object):
del self.__engine_setup_exec_list[name]
self.__engine_setup_exec_list[name] = os.spawnl(os.P_NOWAIT, *args)
+ def __checkbutton_preload_engine_mode_toggled_cb(self, button):
+ if button.get_active():
+ variant = GLib.Variant.new_int32(IBus.PreloadEngineMode.USER)
+ self.__config.set_value("general",
+ "preload_engine_mode",
+ variant)
+ self.__builder.get_object("hbox_customize_active_input_methods").set_sensitive(True)
+ self.__treeview.notify("engines")
+ self.__settings_general.set_int('preload-engine-mode',
+ IBus.PreloadEngineMode.USER)
+ self.__builder.get_object(
+ "hbox_customize_active_input_methods").set_sensitive(True)
+ self.__treeview.notify('engines')
+ else:
+ message = _("The list of your saved input methods will be " \
+ "cleared immediately and the list will be " \
@ -154,38 +148,27 @@ index 9703d5e..b39a044 100644
+ if id != Gtk.ResponseType.YES:
+ button.set_active(True)
+ return
+ variant = GLib.Variant.new_int32(IBus.PreloadEngineMode.LANG_RELATIVE)
+ self.__config.set_value("general",
+ "preload_engine_mode",
+ variant)
+ self.__builder.get_object("hbox_customize_active_input_methods").set_sensitive(False)
+ self.__settings_general.set_int(
+ 'preload-engine-mode',
+ IBus.PreloadEngineMode.LANG_RELATIVE)
+ self.__builder.get_object(
+ "hbox_customize_active_input_methods").set_sensitive(False)
+
+ def __settings_general_preload_engines_cb(self, settings, key):
+ engine_names = self.__settings_general.get_strv('preload-engines')
+ engines = self.__get_engine_descs_from_names(engine_names)
+ current_engines = self.__treeview.get_engines()
+ engines_csv = str.join(',', map(lambda e: e.get_name(), engines))
+ current_engines_csv = \
+ str.join(',', map(lambda e: e.get_name(), current_engines))
+ if engines_csv != current_engines_csv:
+ self.__treeview.set_engines(engines)
+
def __init_bus(self):
self.__bus = IBus.Bus()
if self.__bus.is_connected():
@@ -541,8 +588,18 @@ class Setup(object):
value = GLib.Variant.new_boolean(value)
self.__config.set_value("general", "use_global_engine", value)
- def __config_value_changed_cb(self, bus, section, name, value):
- pass
+ def __config_value_changed_cb(self, bus, section, name, variant):
+ if section == 'general' and name == 'preload_engines':
+ value = []
+ if variant != None:
+ value = variant.unpack()
+ engines = self.__get_engine_descs_from_names(value)
+ current_engines = self.__treeview.get_engines()
+ engines_csv = str.join(',', map(lambda e: e.get_name(), engines))
+ current_engines_csv = \
+ str.join(',', map(lambda e: e.get_name(), current_engines))
+ if engines_csv != current_engines_csv:
+ self.__treeview.set_engines(engines)
def __config_reloaded_cb(self, bus):
pass
diff --git a/setup/setup.ui b/setup/setup.ui
index 2042263..33827f1 100644
index 1638abb..72a5d57 100644
--- a/setup/setup.ui
+++ b/setup/setup.ui
@@ -669,7 +669,23 @@
@ -232,7 +215,7 @@ index 2042263..33827f1 100644
</child>
</object>
diff --git a/src/ibustypes.h b/src/ibustypes.h
index 737b3e2..8ce5a16 100644
index 6d30a86..dac7f8f 100644
--- a/src/ibustypes.h
+++ b/src/ibustypes.h
@@ -204,6 +204,16 @@ typedef enum {
@ -253,73 +236,55 @@ index 737b3e2..8ce5a16 100644
* @x: x coordinate.
* @y: y coordinate.
diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
index fb012c3..54251e7 100644
index c08f6f4..9c1fef5 100644
--- a/ui/gtk3/panel.vala
+++ b/ui/gtk3/panel.vala
@@ -413,6 +413,8 @@ class Panel : IBus.PanelService {
if (m_config != null) {
m_config.value_changed.connect(config_value_changed_cb);
m_config.watch("general", "preload_engines");
+ m_config.watch("general", "preload_engines_inited");
+ m_config.watch("general", "preload_engine_mode");
m_config.watch("general", "embed_preedit_text");
m_config.watch("general", "engines_order");
m_config.watch("general", "switcher_delay_time");
@@ -487,7 +489,136 @@ class Panel : IBus.PanelService {
@@ -130,6 +130,10 @@ class Panel : IBus.PanelService {
null);
});
+ m_settings_general.changed["preload-engine-mode"].connect((key) => {
+ update_im_engines();
+ });
+
m_settings_general.changed["switcher-delay-time"].connect((key) => {
set_switcher_delay_time();
});
@@ -476,7 +480,96 @@ class Panel : IBus.PanelService {
init_gkbd();
}
+ GLib.Variant var_engines =
+ m_config.get_value("general", "preload_engines");
+ string[] preload_engines = {};
+ string[] preload_engines =
+ m_settings_general.get_strv("preload-engines");
+
+ if (var_engines != null) {
+ preload_engines = var_engines.dup_strv();
+ }
+
+ bool preload_engines_inited = false;
+ GLib.Variant var_preload_engines_inited =
+ m_config.get_value("general", "preload_engines_inited");
+
+ if (var_preload_engines_inited != null) {
+ preload_engines_inited = var_preload_engines_inited.get_boolean();
+ }
+ bool preload_engines_inited =
+ m_settings_general.get_boolean("preload-engines-inited");
+
+ // Set preload_engines_inited = true for back compatibility
+ if (preload_engines.length != 0 && !preload_engines_inited) {
+ preload_engines_inited = true;
+ m_config.set_value("general",
+ "preload_engines_inited",
+ new GLib.Variant.boolean(true));
+ m_settings_general.set_boolean("preload-engines-inited", true);
+ }
+
update_xkb_engines();
+
+ // Before update preload_engine_mode, update_xkb_engines() is called
+ // because config_value_changed_cb() calls update_im_engines().
+ if (!preload_engines_inited) {
+ GLib.Variant variant = new GLib.Variant.int32(
+ IBus.PreloadEngineMode.LANG_RELATIVE);
+ m_config.set_value("general",
+ "preload_engine_mode",
+ variant);
+ }
+ // because "preload-engine-mode" signal calls update_im_engines().
+ if (!preload_engines_inited)
+ m_settings_general.set_int("preload-engine-mode",
+ IBus.PreloadEngineMode.LANG_RELATIVE);
+
+ update_im_engines();
+
+ if (!preload_engines_inited) {
+ m_config.set_value("general",
+ "preload_engines_inited",
+ new GLib.Variant.boolean(true));
+ }
+ if (!preload_engines_inited)
+ m_settings_general.set_boolean("preload-engines-inited", true);
+ }
+
+ private bool set_lang_relative_preload_engines() {
+ string locale = Intl.setlocale(LocaleCategory.CTYPE, null);
+
+ if (locale == null) {
+ if (locale == null)
+ locale = "C";
+ }
+
+ string lang = locale.split(".")[0];
+ GLib.List<IBus.EngineDesc> engines = m_bus.list_engines();
@ -329,10 +294,8 @@ index fb012c3..54251e7 100644
+ p != null;
+ p = p.next) {
+ unowned IBus.EngineDesc engine = p.data;
+ if (engine.get_language() == lang &&
+ engine.get_rank() > 0) {
+ if (engine.get_language() == lang && engine.get_rank() > 0)
+ im_engines += engine.get_name();
+ }
+ }
+
+ lang = lang.split("_")[0];
@ -341,79 +304,49 @@ index fb012c3..54251e7 100644
+ p != null;
+ p = p.next) {
+ unowned IBus.EngineDesc engine = p.data;
+ if (engine.get_language() == lang &&
+ engine.get_rank() > 0) {
+ if (engine.get_language() == lang && engine.get_rank() > 0)
+ im_engines += engine.get_name();
+ }
+ }
+ }
+
+ if (im_engines.length == 0) {
+ if (im_engines.length == 0)
+ return false;
+ }
+
+ GLib.Variant var_engines =
+ m_config.get_value("general", "preload_engines");
+ string[] orig_preload_engines = {};
+ string[] orig_preload_engines =
+ m_settings_general.get_strv("preload-engines");
+ string[] preload_engines = {};
+
+ if (var_engines != null) {
+ orig_preload_engines = var_engines.dup_strv();
+ }
+
+ // clear input method engines
+ foreach (string name in orig_preload_engines) {
+ if (name.ascii_ncasecmp("xkb:", 4) != 0) {
+ if (name.ascii_ncasecmp("xkb:", 4) != 0)
+ continue;
+ }
+
+ preload_engines += name;
+ }
+
+ foreach (string name in im_engines) {
+ if (!(name in preload_engines)) {
+ if (!(name in preload_engines))
+ preload_engines += name;
+ }
+ }
+
+ if ("".joinv(",", orig_preload_engines) !=
+ "".joinv(",", preload_engines)) {
+ m_config.set_value("general",
+ "preload_engines",
+ new GLib.Variant.strv(preload_engines));
+ }
+ "".joinv(",", preload_engines))
+ m_settings_general.set_strv("preload-engines", preload_engines);
+
+ return true;
+ }
+
+ private void update_im_engines() {
+ int preload_engine_mode = IBus.PreloadEngineMode.USER;
+ GLib.Variant var_preload_engine_mode =
+ m_config.get_value("general", "preload_engine_mode");
+ int preload_engine_mode =
+ m_settings_general.get_int("preload-engine-mode");
+
+ if (var_preload_engine_mode != null) {
+ preload_engine_mode = var_preload_engine_mode.get_int32();
+ }
+
+ if (preload_engine_mode == IBus.PreloadEngineMode.USER) {
+ if (preload_engine_mode == IBus.PreloadEngineMode.USER)
+ return;
+ }
+
+ set_lang_relative_preload_engines();
}
private void update_xkb_engines() {
@@ -704,6 +835,11 @@ class Panel : IBus.PanelService {
string section,
string name,
Variant variant) {
+ if (section == "general" && name == "preload_engine_mode") {
+ update_im_engines();
+ return;
+ }
+
if (section == "general" && name == "preload_engines") {
update_engines(variant, null);
return;
--
1.8.0

View File

@ -1,6 +1,6 @@
From 53928ed24b12912fdec8e279f5e739b251a5084a Mon Sep 17 00:00:00 2001
From 5c8ce9720f607512c2734f08d3e7141d8f5b9e99 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Fri, 26 Jul 2013 11:27:37 +0900
Date: Fri, 20 Sep 2013 17:16:56 +0900
Subject: [PATCH] Add libgnomekbd and load preload engines.
---
@ -19,9 +19,9 @@ Subject: [PATCH] Add libgnomekbd and load preload engines.
ui/gtk3/Makefile.am | 36 ++++
ui/gtk3/gkbdlayout.vala.false | 63 ++++++
ui/gtk3/gkbdlayout.vala.true | 108 ++++++++++
ui/gtk3/panel.vala | 216 ++++++++++++++++++-
ui/gtk3/xkblayout.vala | 431 +++++++++++++++++++++++++++++++++++++
17 files changed, 1645 insertions(+), 4 deletions(-)
ui/gtk3/panel.vala | 196 ++++++++++++++++-
ui/gtk3/xkblayout.vala | 429 ++++++++++++++++++++++++++++++++++++
17 files changed, 1623 insertions(+), 4 deletions(-)
create mode 100644 bindings/vala/Gkbd-3.0.metadata
create mode 100644 bindings/vala/Xkl-1.0.metadata
create mode 100644 bindings/vala/gkbd.deps
@ -39,7 +39,7 @@ index 0000000..661e6fd
@@ -0,0 +1 @@
+Configuration cheader_filename="libgnomekbd/gkbd-configuration.h"
diff --git a/bindings/vala/Makefile.am b/bindings/vala/Makefile.am
index be45e41..44b3e61 100644
index 84aa1b4..4d8aae4 100644
--- a/bindings/vala/Makefile.am
+++ b/bindings/vala/Makefile.am
@@ -28,8 +28,6 @@ vapi_deps = \
@ -105,11 +105,11 @@ index 0000000..172632c
+glib-2.0
+gmodule-2.0
diff --git a/configure.ac b/configure.ac
index 45c195a..79cae77 100644
index e8fde49..d084c8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -242,6 +242,45 @@ else
enable_xim="no (disabled, use --enable-xim to enable)"
@@ -261,6 +261,45 @@ else
enable_wayland="no (disabled, use --enable-wayland to enable)"
fi
+# Option for XKB command.
@ -154,7 +154,7 @@ index 45c195a..79cae77 100644
# GObject introspection
GOBJECT_INTROSPECTION_CHECK([0.6.8])
@@ -595,6 +634,7 @@ Build options:
@@ -619,6 +658,7 @@ Build options:
Panel icon "$IBUS_ICON_KEYBOARD"
Enable surrounding-text $enable_surrounding_text
Enable libnotify $enable_libnotify
@ -163,7 +163,7 @@ index 45c195a..79cae77 100644
])
diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in
index 9cfe83b..d0b3db8 100644
index 2779139..88a287f 100644
--- a/data/ibus.schemas.in
+++ b/data/ibus.schemas.in
@@ -56,6 +56,52 @@
@ -296,7 +296,7 @@ index 334f37e..2017af9 100644
# make -C po update-gmo
diff --git a/src/Makefile.am b/src/Makefile.am
index 74b6838..2645314 100644
index 811d097..912b75c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -201,6 +201,9 @@ typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
@ -310,7 +310,7 @@ index 74b6838..2645314 100644
ibusenumtypes.h: $(ibus_headers) ibusenumtypes.h.template
$(AM_V_GEN) ( top_builddir=`cd $(top_builddir) && pwd`; \
diff --git a/src/ibus.h b/src/ibus.h
index e27f845..4b3919c 100644
index d8e226e..f0a9456 100644
--- a/src/ibus.h
+++ b/src/ibus.h
@@ -47,6 +47,7 @@
@ -987,7 +987,7 @@ index 0000000..5aa486d
+G_END_DECLS
+#endif
diff --git a/ui/gtk3/Makefile.am b/ui/gtk3/Makefile.am
index 97c915c..5d53836 100644
index 547ef53..4b32d7e 100644
--- a/ui/gtk3/Makefile.am
+++ b/ui/gtk3/Makefile.am
@@ -44,6 +44,8 @@ AM_CPPFLAGS = \
@ -1254,10 +1254,10 @@ index 0000000..a6e0f8d
+ */
+}
diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
index 39aca08..fb012c3 100644
index 82b9ee5..c08f6f4 100644
--- a/ui/gtk3/panel.vala
+++ b/ui/gtk3/panel.vala
@@ -49,6 +49,13 @@ class Panel : IBus.PanelService {
@@ -57,6 +57,13 @@ class Panel : IBus.PanelService {
private Gtk.CssProvider m_css_provider;
private int m_switcher_delay_time = 400;
private bool m_use_system_keyboard_layout = false;
@ -1268,10 +1268,10 @@ index 39aca08..fb012c3 100644
+ private int m_fallback_lock_id = -1;
+ private bool m_changed_xkb_option = false;
+ private GLib.Timer m_changed_layout_timer;
private const string ACCELERATOR_SWITCH_IME_FOREWARD = "<Super>space";
private GLib.List<Keybinding> m_keybindings = new GLib.List<Keybinding>();
@@ -91,6 +98,14 @@ class Panel : IBus.PanelService {
@@ -102,6 +109,14 @@ class Panel : IBus.PanelService {
~Panel() {
unbind_switch_shortcut();
@ -1285,17 +1285,17 @@ index 39aca08..fb012c3 100644
+ m_xkblayout = null;
}
private void keybinding_manager_bind(KeybindingManager keybinding_manager,
@@ -405,6 +420,7 @@ class Panel : IBus.PanelService {
m_config.watch("general/hotkey", "triggers");
m_config.watch("panel", "custom_font");
m_config.watch("panel", "use_custom_font");
+ init_engines_order();
// Update m_use_system_keyboard_layout before update_engines()
// is called.
set_use_system_keyboard_layout(null);
@@ -422,6 +438,204 @@ class Panel : IBus.PanelService {
}
private void init_settings() {
@@ -399,6 +414,7 @@ class Panel : IBus.PanelService {
}
public void load_settings() {
+ init_engines_order();
// Update m_use_system_keyboard_layout before update_engines()
// is called.
set_use_system_keyboard_layout();
@@ -415,6 +431,184 @@ class Panel : IBus.PanelService {
set_version();
}
+ private void gkbdlayout_changed_cb() {
@ -1334,11 +1334,7 @@ index 39aca08..fb012c3 100644
+ }
+
+ private void init_engines_order() {
+ if (m_config == null) {
+ return;
+ }
+
+ m_xkblayout = new XKBLayout(m_config);
+ m_xkblayout = new XKBLayout();
+ string session = Environment.get_variable("DESKTOP_SESSION");
+
+ if (HAVE_IBUS_GKBD &&
@ -1389,15 +1385,10 @@ index 39aca08..fb012c3 100644
+ var_xkb_engine_names += "%s:%s:%s".printf("xkb", name, lang);
+ }
+
+ GLib.Variant var_engines =
+ m_config.get_value("general", "preload_engines");
+ string[] engine_names = {};
+ string[] engine_names =
+ m_settings_general.get_strv("preload-engines");
+ bool updated_engine_names = false;
+
+ if (var_engines != null) {
+ engine_names = var_engines.dup_strv();
+ }
+
+ foreach (string name in var_xkb_engine_names) {
+ if (name in engine_names)
+ continue;
@ -1405,21 +1396,13 @@ index 39aca08..fb012c3 100644
+ engine_names += name;
+ }
+
+ if (updated_engine_names) {
+ m_config.set_value("general",
+ "preload_engines",
+ new GLib.Variant.strv(engine_names));
+ }
+ if (updated_engine_names)
+ m_settings_general.set_strv("preload-engines", engine_names);
+
+ GLib.Variant var_order =
+ m_config.get_value("general", "engines_order");
+ string[] order_names = {};
+ string[] order_names =
+ m_settings_general.get_strv("engines-order");
+ bool updated_order_names = false;
+
+ if (var_order != null) {
+ order_names = var_order.dup_strv();
+ }
+
+ foreach (var name in var_xkb_engine_names) {
+ if (name in order_names)
+ continue;
@ -1427,11 +1410,8 @@ index 39aca08..fb012c3 100644
+ updated_order_names = true;
+ }
+
+ if (updated_order_names) {
+ m_config.set_value("general",
+ "engines_order",
+ new GLib.Variant.strv(order_names));
+ }
+ if (updated_order_names)
+ m_settings_general.set_strv("engines-order", order_names);
+ }
+
+ private void set_xkb_group_layout(IBus.EngineDesc engine) {
@ -1499,21 +1479,21 @@ index 39aca08..fb012c3 100644
private void exec_setxkbmap(IBus.EngineDesc engine) {
string layout = engine.get_layout();
string variant = engine.get_layout_variant();
@@ -482,7 +696,7 @@ class Panel : IBus.PanelService {
}
@@ -480,7 +674,7 @@ class Panel : IBus.PanelService {
// set xkb layout
if (!m_use_system_keyboard_layout) {
if (!m_use_system_keyboard_layout)
- exec_setxkbmap(engine);
+ set_layout(engine);
}
}
engine_contexts_insert(engine);
}
diff --git a/ui/gtk3/xkblayout.vala b/ui/gtk3/xkblayout.vala
new file mode 100644
index 0000000..b4b54ff
index 0000000..b7dfb3e
--- /dev/null
+++ b/ui/gtk3/xkblayout.vala
@@ -0,0 +1,431 @@
@@ -0,0 +1,429 @@
+/* vim:set et sts=4 sw=4:
+ *
+ * ibus - The Input Bus
@ -1544,7 +1524,7 @@ index 0000000..b4b54ff
+class XKBLayout
+{
+ string m_xkb_command = "setxkbmap";
+ IBus.Config m_config = null;
+ GLib.Settings m_settings_general;
+ string[] m_xkb_latin_layouts = {};
+ GLib.Pid m_xkb_pid = -1;
+ GLib.Pid m_xmodmap_pid = -1;
@ -1556,18 +1536,16 @@ index 0000000..b4b54ff
+ string m_default_variant = "";
+ string m_default_option = "";
+
+ public XKBLayout(IBus.Config? config) {
+ m_config = config;
+ public XKBLayout() {
+ m_settings_general = new GLib.Settings("org.freedesktop.ibus.general");
+
+ if (config != null) {
+ var value = config.get_value("general", "xkb_latin_layouts");
+ for (int i = 0; value != null && i < value.n_children(); i++) {
+ m_xkb_latin_layouts +=
+ value.get_child_value(i).dup_string();
+ }
+ if (m_use_xmodmap) {
+ m_use_xmodmap = config.get_value("general", "use_xmodmap").get_boolean();
+ }
+ var value = m_settings_general.get_value("xkb-latin-layouts");
+ for (int i = 0; value != null && i < value.n_children(); i++) {
+ m_xkb_latin_layouts +=
+ value.get_child_value(i).dup_string();
+ }
+ if (m_use_xmodmap) {
+ m_use_xmodmap = m_settings_general.get_boolean("use-xmodmap");
+ }
+ }
+

View File

@ -0,0 +1,23 @@
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
index eef062c..d644d69 100644
--- a/client/gtk2/ibusimcontext.c
+++ b/client/gtk2/ibusimcontext.c
@@ -845,6 +845,18 @@ ibus_im_context_focus_in (GtkIMContext *context)
return;
/* don't set focus on password entry */
+#if GTK_CHECK_VERSION (3, 6, 0)
+ {
+ GtkInputPurpose purpose;
+
+ g_object_get (G_OBJECT (context),
+ "input-purpose", &purpose,
+ NULL);
+
+ if (purpose == GTK_INPUT_PURPOSE_PASSWORD)
+ return;
+ }
+#endif
if (ibusimcontext->client_window != NULL) {
GtkWidget *widget;

View File

@ -1,17 +1,16 @@
From c9d8db44583262f49adf7588fe0adbf0842a995a Mon Sep 17 00:00:00 2001
From 0e3608c614c2dee3c504a21cf5054ff621633585 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 31 Jan 2013 17:31:55 +0900
Date: Fri, 20 Sep 2013 17:20:23 +0900
Subject: [PATCH] Enable ibus-setup to show the frequently used languages
only in IME list.
---
data/ibus.schemas.in | 168 ++++++++++++++++++++++++++++++++++++++++++++++++
setup/enginecombobox.py | 155 +++++++++++++++++++++++++++++++++++++-------
setup/main.py | 1 +
3 files changed, 300 insertions(+), 24 deletions(-)
setup/enginecombobox.py | 148 +++++++++++++++++++++++++++++++++++-------
2 files changed, 292 insertions(+), 24 deletions(-)
diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in
index 52ece27..007fc66 100644
index b6709fd..e6cfaaa 100644
--- a/data/ibus.schemas.in
+++ b/data/ibus.schemas.in
@@ -339,6 +339,174 @@ se,si,sk,sy,sy(ku),th,tj,tr,ua,uz,vn
@ -190,20 +189,29 @@ index 52ece27..007fc66 100644
<applyto>/desktop/ibus/panel/custom_font</applyto>
<owner>ibus</owner>
diff --git a/setup/enginecombobox.py b/setup/enginecombobox.py
index 0f8a6ae..9828ee6 100644
index b45ad56..830f0e8 100644
--- a/setup/enginecombobox.py
+++ b/setup/enginecombobox.py
@@ -45,6 +45,9 @@ class EngineComboBox(Gtk.ComboBox):
@@ -22,6 +22,7 @@
import locale
+from gi.repository import Gio
from gi.repository import GObject
from gi.repository import Gtk
from gi.repository import IBus
@@ -45,6 +46,10 @@ class EngineComboBox(Gtk.ComboBox):
self.connect("notify::active", self.__notify_active_cb)
self.__model = None
+ self.__all_model = None
+ self.__config = None
+ self.__show_sub_lang = False
+ self.__settings_xkblayoutconfig = Gio.Settings(
+ "org.freedesktop.ibus.general.xkblayoutconfig");
renderer = Gtk.CellRendererPixbuf()
renderer.set_property("xalign", 0)
@@ -58,20 +61,51 @@ class EngineComboBox(Gtk.ComboBox):
@@ -58,20 +63,45 @@ class EngineComboBox(Gtk.ComboBox):
self.pack_start(renderer, True)
self.set_cell_data_func(renderer, self.__name_cell_data_cb, None)
@ -211,8 +219,6 @@ index 0f8a6ae..9828ee6 100644
- self.__model = Gtk.TreeStore(object)
+ def __gconf_get_lang_list_from_locale(self):
+ common_list = ['en', 'Other']
+ if self.__config == None:
+ return None
+ loc = None
+ try:
+ loc = locale.setlocale (locale.LC_ALL)
@ -223,18 +229,14 @@ index 0f8a6ae..9828ee6 100644
+ current_lang = IBus.get_language_name(loc)
+ if current_lang == None:
+ return common_list
+ group_list = self.__config.get_value("general/xkblayoutconfig",
+ "group_list")
+ if group_list == None:
+ group_list = self.__settings_xkblayoutconfig.get_strv('group-list')
+ if len(group_list) == 0:
+ return [loc] + common_list
+ group_list = list(group_list)
+ lang_list = None
+ for group in group_list:
+ group = str(group)
+ langs = list(self.__config.get_value("general/xkblayoutconfig",
+ group))
+ group = group.replace('_', '-')
+ langs = self.__settings_xkblayoutconfig.get_strv(group)
+ for lang in langs:
+ lang = str(lang)
+ if current_lang == IBus.get_language_name(lang):
+ lang_list = langs
+ break
@ -267,7 +269,7 @@ index 0f8a6ae..9828ee6 100644
keys = langs.keys()
keys.sort(locale.strcoll)
loc = locale.getlocale()[0]
@@ -89,29 +123,86 @@ class EngineComboBox(Gtk.ComboBox):
@@ -89,29 +119,86 @@ class EngineComboBox(Gtk.ComboBox):
keys.remove(IBus.get_language_name("Other"))
keys += [IBus.get_language_name("Other")]
for l in keys:
@ -288,7 +290,8 @@ index 0f8a6ae..9828ee6 100644
+
+ def set_engines(self, engines):
+ self.__model = Gtk.TreeStore(object)
+
- self.set_model(self.__model)
+ iter1 = self.__model.append(None)
+ self.__model.set(iter1, 0, 0)
+ lang_list = self.__gconf_get_lang_list_from_locale()
@ -319,8 +322,7 @@ index 0f8a6ae..9828ee6 100644
+ self.__model_append_langs(self.__all_model, sub_lang, False)
+
+ self.__toggle_sub_lang()
- self.set_model(self.__model)
+
+ def __toggle_sub_lang(self):
+ self.set_model(None)
+ if self.__show_sub_lang:
@ -362,7 +364,7 @@ index 0f8a6ae..9828ee6 100644
else:
renderer.set_property("visible", True)
renderer.set_property("sensitive", True)
@@ -119,7 +210,8 @@ class EngineComboBox(Gtk.ComboBox):
@@ -119,7 +206,8 @@ class EngineComboBox(Gtk.ComboBox):
renderer.set_property("pixbuf", pixbuf)
def __name_cell_data_cb(self, celllayout, renderer, model, iter, data):
@ -372,7 +374,7 @@ index 0f8a6ae..9828ee6 100644
if isinstance (engine, str) or isinstance (engine, unicode):
renderer.set_property("sensitive", False)
@@ -127,8 +219,15 @@ class EngineComboBox(Gtk.ComboBox):
@@ -127,8 +215,15 @@ class EngineComboBox(Gtk.ComboBox):
renderer.set_property("weight", Pango.Weight.NORMAL)
elif isinstance(engine, int):
renderer.set_property("sensitive", True)
@ -390,7 +392,7 @@ index 0f8a6ae..9828ee6 100644
else:
renderer.set_property("sensitive", True)
renderer.set_property("text", engine.get_longname())
@@ -144,10 +243,18 @@ class EngineComboBox(Gtk.ComboBox):
@@ -144,7 +239,12 @@ class EngineComboBox(Gtk.ComboBox):
if i == 0 or i == -1:
return None
iter = self.get_active_iter()
@ -404,24 +406,6 @@ index 0f8a6ae..9828ee6 100644
else:
raise AttributeError, 'unknown property %s' % property.name
+ def set_config(self, config):
+ self.__config = config
+
def get_active_engine(self):
return self.get_property("active-engine")
diff --git a/setup/main.py b/setup/main.py
index b39a044..5b077a8 100644
--- a/setup/main.py
+++ b/setup/main.py
@@ -206,6 +206,7 @@ class Setup(object):
# init engine page
self.__engines = self.__bus.list_engines()
self.__combobox = self.__builder.get_object("combobox_engines")
+ self.__combobox.set_config(self.__config)
self.__combobox.set_engines(self.__engines)
engine_names = values.get("preload_engines", [])
--
1.8.0

73
ibus.conf.5 Normal file
View File

@ -0,0 +1,73 @@
.\" This file is distributed under the same license as the ibus
.\" package.
.\" Copyright (C) Takao Fujiwara <takao.fujiwara1@gmail.com>, 2013.
.\"
.TH IBUS.CONF "5" "August 2013" "1.5.3" "User Commands"
.SH NAME
.B ibus.conf
\- X input preload/configuration file for ibus
.SH SYNOPSIS
.B /etc/X11/xinit/xinput.d/ibus.conf
.SH DESCRIPTION
.PP
IBus is an Intelligent Input Bus. It is a new input framework for Linux
OS. It provides full featured and user friendly input method user
interface. It also may help developers to develop input method easily.
.PP
.B ibus.conf
is a configuration file containing X input setting values to be read in
and set by /etc/X11/xinit/xinitrc\-common.
.I imsettings-switch(1)
is called from XDG auto\-start and invokes
xinitrc\-common.
.LP
If this file is the alias of
.I /etc/X11/xinit/xinputrc
for the system setting
or
.I [$XDG_CONFIG_HOME|$HOME/.config]/imsettings/xinputrc
for the user setting, the setting can be default.
.I im\-chooser(1)
can choose the user setting.
.LP
The configuration options are:
.TP
\fBXIM\fP
XIM name for XMODIFIERS
.TP
\fBXIM_PROGRAM\fP
XIM executable program name
.TP
\fBXIM_ARGS\fP
XIM arguments for XIM_PROGRAM
.TP
\fBSHORT_DESC\fP
XIM human readable name for
.I im\-chooser(1)
.TP
\fBICON\fP
icon file for
.I im\-chooser(1)
.TP
\fBPREFERENCE_PROGRAM\fP
XIM setup program for
.I im\-chooser(1)
.TP
\fBGTK_IM_MODULE\fP
IM environment valuable for GTK+ applications.
.TP
\fBQT_IM_MODULE\fP
IM environment valuable for QT applications.
.SH BUGS
If you find a bug, please report it at http://code.google.com/p/ibus/issues/list
.SH "SEE ALSO"
.BR ibus\-daemon (1)
.BR imsettings\-switch (1)
.BR im\-chooser (1)
.BR X (7)

View File

@ -10,7 +10,14 @@
%global with_python_pkg 0
%endif
%if (0%{?fedora} > 19 || 0%{?rhel} > 7)
%global with_wayland 1
%else
%global with_wayland 0
%endif
%global ibus_api_version 1.0
%global ibus_xkb_version 1.5.0
%if %with_pkg_config
%{!?gtk2_binary_version: %global gtk2_binary_version %(pkg-config --variable=gtk_binary_version gtk+-2.0)}
@ -25,7 +32,7 @@
%global dbus_python_version 0.83.0
Name: ibus
Version: 1.5.3
Version: 1.5.4
Release: 1%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+
@ -33,8 +40,12 @@ Group: System Environment/Libraries
URL: http://code.google.com/p/ibus/
Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz
Source1: %{name}-xinput
Source2: %{name}.conf.5
# Actual path is https://github.com/.../%%{ibus_xkb_version}.tar.gz
# Renamed %%{ibus_xkb_version}.tar.gz to ibus-xkb-%%{ibus_xkb_version}.tar.gz
Source3: https://github.com/ibus/ibus-xkb/archive/ibus-xkb-%{ibus_xkb_version}.tar.gz
# Upstreamed patches.
# Patch0: %{name}-HEAD.patch
# Patch0: %%{name}-HEAD.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=810211
Patch1: %{name}-810211-no-switch-by-no-trigger.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=541492
@ -48,6 +59,10 @@ Patch4: %{name}-xx-setup-frequent-lang.patch
# Keep the default triggers for the back compatiblity.
Patch95: %{name}-xx-ctrl-space.patch
%endif
%if (0%{?fedora} < 20 && 0%{?rhel} < 8)
# Disable IME on gnome-shell password for the back compatiblity.
Patch96: %{name}-xx-f19-password.patch
%endif
BuildRequires: gettext-devel
@ -69,6 +84,9 @@ BuildRequires: GConf2-devel
BuildRequires: intltool
BuildRequires: iso-codes-devel
BuildRequires: libnotify-devel
%if %with_wayland
BuildRequires: libwayland-client-devel
%endif
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: %{name}-gtk2%{?_isa} = %{version}-%{release}
@ -76,6 +94,9 @@ Requires: %{name}-gtk3%{?_isa} = %{version}-%{release}
%if %with_python_pkg
Requires: %{name}-setup = %{version}-%{release}
%endif
%if %with_wayland
Requires: %{name}-wayland%{?_isa} = %{version}-%{release}
%endif
Requires: iso-codes
Requires: dbus-python >= %{dbus_python_version}
@ -173,6 +194,17 @@ and this package will be deprecated.
%endif
%endif
%if %with_wayland
%package wayland
Summary: IBus im module for Wayland
Group: System Environment/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description wayland
This package contains IBus im module for Wayland
%endif
%package devel
Summary: Development tools for ibus
Group: Development/Libraries
@ -201,9 +233,12 @@ The ibus-devel-docs package contains developer documentation for ibus
%prep
%setup -q
# %%patch0 -p1
%if (0%{?fedora} < 20 && 0%{?rhel} < 8)
%patch96 -p1 -b .passwd
%endif
cp client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c ||
%patch1 -p1 -b .noswitch
%if %with_preload_xkb_engine
%patch2 -p1 -b .preload-xkb
@ -217,6 +252,14 @@ rm -f data/dconf/00-upstream-settings
%patch95 -p1 -b .ctrl
%endif
zcat %SOURCE3 | tar xf -
POS=`(cd ibus-xkb-%ibus_xkb_version/po; ls *.po)`
for PO in $POS
do
cp po/$PO po/$PO.orig
msgcat --use-first po/$PO ibus-xkb-%ibus_xkb_version/po/$PO -o po/$PO
done
%build
%if %with_preload_xkb_engine
autoreconf -f -i -v
@ -231,6 +274,9 @@ autoreconf -f -i -v
--enable-surrounding-text \
%if %with_pygobject2
--enable-python-library \
%endif
%if %with_wayland
--enable-wayland \
%endif
--enable-introspection
@ -246,12 +292,21 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libibus-%{ibus_api_version}.la
rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-2.0/%{gtk2_binary_version}/immodules/im-ibus.la
rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-3.0/%{gtk3_binary_version}/immodules/im-ibus.la
# install man page
for S in %{SOURCE2}
do
cp $S .
MP=`basename $S`
gzip $MP
install -pm 644 -D ${MP}.gz $RPM_BUILD_ROOT%{_datadir}/man/man5/${MP}.gz
done
# install xinput config file
install -pm 644 -D %{SOURCE1} $RPM_BUILD_ROOT%{_xinputconf}
# install .desktop files
echo "NoDisplay=true" >> $RPM_BUILD_ROOT%{_datadir}/applications/ibus-setup.desktop
#echo "X-GNOME-Autostart-enabled=false" >> $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/ibus.desktop
#echo "X-GNOME-Autostart-enabled=false" >> $RPM_BUILD_ROOT%%{_sysconfdir}/xdg/autostart/ibus.desktop
desktop-file-install --delete-original \
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
@ -278,23 +333,20 @@ if [ "$1" -eq 0 ]; then
glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || :
# 'dconf update' sometimes does not update the db...
dconf update
if [ -f %{_sysconfdir}/dconf/db/ibus ] ; then
rm -f %{_sysconfdir}/dconf/db/ibus
fi
dconf update || :
[ -f %{_sysconfdir}/dconf/db/ibus ] && \
rm %{_sysconfdir}/dconf/db/ibus || :
# 'ibus write-cache --system' updates the system cache.
if [ -f /var/cache/ibus/bus/registry ] ; then
rm -f /var/cache/ibus/bus/registry
fi
[ -f /var/cache/ibus/bus/registry ] && \
rm /var/cache/ibus/bus/registry || :
fi
%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || :
dconf update
if [ %{_bindir}/ibus ] ; then
dconf update || :
[ -x %{_bindir}/ibus ] && \
%{_bindir}/ibus write-cache --system &>/dev/null || :
fi
%post libs -p /sbin/ldconfig
@ -325,7 +377,6 @@ fi
%dir %{_datadir}/ibus/
%{_bindir}/ibus
%{_bindir}/ibus-daemon
%{_datadir}/applications/*
%{_datadir}/bash-completion/completions/ibus.bash
%{_datadir}/GConf/gsettings/*
%{_datadir}/glib-2.0/schemas/*.xml
@ -335,6 +386,7 @@ fi
%{_datadir}/icons/hicolor/*/apps/*
%{_datadir}/man/man1/ibus.1.gz
%{_datadir}/man/man1/ibus-daemon.1.gz
%{_datadir}/man/man5/ibus.conf.5.gz
%{_libexecdir}/ibus-engine-simple
%{_libexecdir}/ibus-dconf
%{_libexecdir}/ibus-ui-gtk3
@ -346,6 +398,7 @@ fi
%if ! %with_python_pkg
%if %with_pygobject3
%{_bindir}/ibus-setup
%{_datadir}/applications/ibus-setup.desktop
%{_datadir}/ibus/setup
%{_datadir}/man/man1/ibus-setup.1.gz
%endif
@ -369,6 +422,7 @@ fi
%if %with_pygobject3
%files setup
%{_bindir}/ibus-setup
%{_datadir}/applications/ibus-setup.desktop
%{_datadir}/ibus/setup
%{_datadir}/man/man1/ibus-setup.1.gz
%endif
@ -380,6 +434,11 @@ fi
%endif
%endif
%if %with_wayland
%files wayland
%{_libexecdir}/ibus-wayland
%endif
%files devel
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*
@ -392,6 +451,13 @@ fi
%{_datadir}/gtk-doc/html/*
%changelog
* Fri Sep 20 2013 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.4-1
- Bumped to 1.5.4
- Added ibus.conf.5
- Added ibus-xkb-1.5.0.tar.gz for po files.
- Added ibus-xx-f19-password.patch for back compatibility.
- Added ibus-wayland in f20 or later.
* Fri Jul 26 2013 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.3-1
- Bumped to 1.5.3
- Deleted ibus-xx-g-s-disable-preedit.patch as EOL.

View File

@ -1 +1,2 @@
fdde74794d8a1874f97294e0cd581d14 ibus-1.5.3.tar.gz
6ce27a692d2d4881e9898f3798dcf91c ibus-1.5.4.tar.gz
7d1eaa22dd374f453de4308bcad647c3 ibus-xkb-1.5.0.tar.gz