Merge lp:~attente/unity-control-center/fcitx-transition into lp:unity-control-center

Proposed by William Hua on 2015-02-12
Status: Merged
Approved by: Sebastien Bacher on 2015-03-10
Approved revision: 12797
Merged at revision: 12808
Proposed branch: lp:~attente/unity-control-center/fcitx-transition
Merge into: lp:unity-control-center
Diff against target: 1609 lines (+1052/-108)
9 files modified
configure.ac (+23/-0)
debian/control (+2/-0)
panels/region/Makefile.am (+2/-1)
panels/region/cc-region-panel.c (+17/-4)
panels/region/gnome-region-panel-input-chooser.ui (+2/-0)
panels/region/gnome-region-panel-input.c (+369/-39)
panels/region/unity-region-panel-fcitx.ui (+560/-0)
panels/region/unity-region-panel-ibus.ui (+75/-63)
po/POTFILES.in (+2/-1)
To merge this branch: bzr merge lp:~attente/unity-control-center/fcitx-transition
Reviewer Review Type Date Requested Status
Sebastien Bacher 2015-02-12 Approve on 2015-03-10
Review via email: mp+249523@code.launchpad.net

Commit message

Basic Fcitx support.

Description of the change

Basic Fcitx support.

To post a comment you must log in.
Sebastien Bacher (seb128) wrote :

Thanks, seems like we don't have anyone available to do a detailed review, so based on a read of the changes and testing in a ppa let's approve that, if there are issues we can sort them out with another landing

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2014-08-29 10:26:05 +0000
+++ configure.ac 2015-02-12 16:27:19 +0000
@@ -86,6 +86,23 @@
86 IBUS_MODULE=86 IBUS_MODULE=
87fi87fi
8888
89# Fcitx support
90
91AC_ARG_ENABLE(fcitx,
92 AS_HELP_STRING([--disable-fcitx],
93 [Disable Fcitx support]),
94 enable_fcitx=$enableval,
95 enable_fcitx=yes)
96
97if test "x$enable_fcitx" = "xyes" ; then
98 FCITX_MODULE="fcitx-config fcitx-gclient"
99 AC_DEFINE(HAVE_FCITX, 1, [Defined if Fcitx support is enabled])
100else
101 FCITX_MODULE=
102fi
103
104AM_CONDITIONAL(HAVE_FCITX, test "x$enable_fcitx" == "xyes")
105
89dnl ==============================================106dnl ==============================================
90dnl Check that we meet the dependencies107dnl Check that we meet the dependencies
91dnl ==============================================108dnl ==============================================
@@ -140,6 +157,7 @@
140 polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION157 polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION
141 gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED_VERSION158 gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED_VERSION
142 $IBUS_MODULE159 $IBUS_MODULE
160 $FCITX_MODULE
143 x11)161 x11)
144PKG_CHECK_MODULES(SCREEN_PANEL, $COMMON_MODULES)162PKG_CHECK_MODULES(SCREEN_PANEL, $COMMON_MODULES)
145PKG_CHECK_MODULES(SOUND_PANEL, $COMMON_MODULES libxml-2.0163PKG_CHECK_MODULES(SOUND_PANEL, $COMMON_MODULES libxml-2.0
@@ -514,4 +532,9 @@
514else532else
515 AC_MSG_NOTICE([ Region panel IBus support disabled])533 AC_MSG_NOTICE([ Region panel IBus support disabled])
516fi534fi
535if test "x$enable_fcitx" == "xyes"; then
536 AC_MSG_NOTICE([** Fcitx (Region panel Fcitx support)])
537else
538 AC_MSG_NOTICE([ Region panel Fcitx support disabled])
539fi
517AC_MSG_NOTICE([End options])540AC_MSG_NOTICE([End options])
518541
=== modified file 'debian/control'
--- debian/control 2015-02-03 12:17:16 +0000
+++ debian/control 2015-02-12 16:27:19 +0000
@@ -8,6 +8,7 @@
8 debhelper (>= 9),8 debhelper (>= 9),
9 dh-migrations,9 dh-migrations,
10 desktop-file-utils,10 desktop-file-utils,
11 fcitx-libs-dev,
11 gtk-doc-tools,12 gtk-doc-tools,
12 gnome-common,13 gnome-common,
13 gnome-pkg-tools (>= 0.10),14 gnome-pkg-tools (>= 0.10),
@@ -67,6 +68,7 @@
67 accountsservice,68 accountsservice,
68 apg,69 apg,
69 desktop-file-utils,70 desktop-file-utils,
71 fcitx-data,
70 gkbd-capplet (>= 3.5.90),72 gkbd-capplet (>= 3.5.90),
71 gnome-desktop3-data,73 gnome-desktop3-data,
72 adwaita-icon-theme,74 adwaita-icon-theme,
7375
=== modified file 'panels/region/Makefile.am'
--- panels/region/Makefile.am 2013-12-18 22:19:53 +0000
+++ panels/region/Makefile.am 2015-02-12 16:27:19 +0000
@@ -44,7 +44,8 @@
44uidir = $(pkgdatadir)/ui44uidir = $(pkgdatadir)/ui
45ui_DATA = \45ui_DATA = \
46 gnome-region-panel.ui \46 gnome-region-panel.ui \
47 unity-region-panel.ui \47 unity-region-panel-ibus.ui \
48 unity-region-panel-fcitx.ui \
48 gnome-region-panel-input-chooser.ui \49 gnome-region-panel-input-chooser.ui \
49 $(NULL)50 $(NULL)
5051
5152
=== modified file 'panels/region/cc-region-panel.c'
--- panels/region/cc-region-panel.c 2014-02-20 09:30:01 +0000
+++ panels/region/cc-region-panel.c 2015-02-12 16:27:19 +0000
@@ -57,6 +57,12 @@
57}57}
5858
59static gboolean59static gboolean
60is_fcitx_active (void)
61{
62 return g_strcmp0 (g_getenv ("GTK_IM_MODULE"), "fcitx") == 0;
63}
64
65static gboolean
60has_indicator_keyboard (void)66has_indicator_keyboard (void)
61{67{
62 GSettingsSchema *schema;68 GSettingsSchema *schema;
@@ -168,10 +174,17 @@
168174
169 priv->builder = gtk_builder_new ();175 priv->builder = gtk_builder_new ();
170176
171 if (has_indicator_keyboard ())177 if (has_indicator_keyboard ()) {
172 gtk_builder_add_from_file (priv->builder,178 if (is_fcitx_active ()) {
173 GNOMECC_UI_DIR "/unity-region-panel.ui",179 gtk_builder_add_from_file (priv->builder,
174 &error);180 GNOMECC_UI_DIR "/unity-region-panel-fcitx.ui",
181 &error);
182 } else {
183 gtk_builder_add_from_file (priv->builder,
184 GNOMECC_UI_DIR "/unity-region-panel-ibus.ui",
185 &error);
186 }
187 }
175 else188 else
176 gtk_builder_add_from_file (priv->builder,189 gtk_builder_add_from_file (priv->builder,
177 GNOMECC_UI_DIR "/gnome-region-panel.ui",190 GNOMECC_UI_DIR "/gnome-region-panel.ui",
178191
=== modified file 'panels/region/gnome-region-panel-input-chooser.ui'
--- panels/region/gnome-region-panel-input-chooser.ui 2012-06-01 17:46:38 +0000
+++ panels/region/gnome-region-panel-input-chooser.ui 2015-02-12 16:27:19 +0000
@@ -9,6 +9,8 @@
9 <column type="gchararray"/>9 <column type="gchararray"/>
10 <!-- type specific identifier -->10 <!-- type specific identifier -->
11 <column type="gchararray"/>11 <column type="gchararray"/>
12 <!-- text colour -->
13 <column type="GdkRGBA"/>
12 </columns>14 </columns>
13 </object>15 </object>
14 <object class="GtkTreeModelFilter" id="filtered_input_source_model">16 <object class="GtkTreeModelFilter" id="filtered_input_source_model">
1517
=== modified file 'panels/region/gnome-region-panel-input.c'
--- panels/region/gnome-region-panel-input.c 2014-03-07 18:13:40 +0000
+++ panels/region/gnome-region-panel-input.c 2015-02-12 16:27:19 +0000
@@ -34,6 +34,12 @@
34#include <ibus.h>34#include <ibus.h>
35#endif35#endif
3636
37#ifdef HAVE_FCITX
38#include <fcitx-config/fcitx-config.h>
39#include <fcitx-gclient/fcitxinputmethod.h>
40#include <fcitx-gclient/fcitxkbd.h>
41#endif
42
37#include "gdm-languages.h"43#include "gdm-languages.h"
38#include "gnome-region-panel-input.h"44#include "gnome-region-panel-input.h"
39#include "keyboard-shortcuts.h"45#include "keyboard-shortcuts.h"
@@ -46,6 +52,12 @@
46#define KEY_INPUT_SOURCES "sources"52#define KEY_INPUT_SOURCES "sources"
47#define INPUT_SOURCE_TYPE_XKB "xkb"53#define INPUT_SOURCE_TYPE_XKB "xkb"
48#define INPUT_SOURCE_TYPE_IBUS "ibus"54#define INPUT_SOURCE_TYPE_IBUS "ibus"
55#define INPUT_SOURCE_TYPE_FCITX "fcitx"
56#define FCITX_XKB_PREFIX "fcitx-keyboard-"
57
58#define ENV_GTK_IM_MODULE "GTK_IM_MODULE"
59#define GTK_IM_MODULE_IBUS "ibus"
60#define GTK_IM_MODULE_FCITX "fcitx"
4961
50#define MEDIA_KEYS_SCHEMA_ID "org.gnome.desktop.wm.keybindings"62#define MEDIA_KEYS_SCHEMA_ID "org.gnome.desktop.wm.keybindings"
51#define KEY_PREV_INPUT_SOURCE "switch-input-source-backward"63#define KEY_PREV_INPUT_SOURCE "switch-input-source-backward"
@@ -71,6 +83,7 @@
71 NAME_COLUMN,83 NAME_COLUMN,
72 TYPE_COLUMN,84 TYPE_COLUMN,
73 ID_COLUMN,85 ID_COLUMN,
86 COLOUR_COLUMN,
74 SETUP_COLUMN,87 SETUP_COLUMN,
75 LEGACY_SETUP_COLUMN,88 LEGACY_SETUP_COLUMN,
76 N_COLUMNS89 N_COLUMNS
@@ -86,15 +99,41 @@
86static GtkWidget *input_chooser = NULL; /* weak pointer */99static GtkWidget *input_chooser = NULL; /* weak pointer */
87static CcRegionKeyboardItem *prev_source_item = NULL;100static CcRegionKeyboardItem *prev_source_item = NULL;
88static CcRegionKeyboardItem *next_source_item = NULL;101static CcRegionKeyboardItem *next_source_item = NULL;
102static GdkRGBA active_colour;
103static GdkRGBA inactive_colour;
89104
90#ifdef HAVE_IBUS105#ifdef HAVE_IBUS
91static IBusBus *ibus = NULL;106static IBusBus *ibus = NULL;
92static GHashTable *ibus_engines = NULL;107static GHashTable *ibus_engines = NULL;
93static GCancellable *ibus_cancellable = NULL;108static GCancellable *ibus_cancellable = NULL;
94static guint shell_name_watch_id = 0;109static guint shell_name_watch_id = 0;
95110static gboolean is_ibus_active = FALSE;
96#endif /* HAVE_IBUS */111#endif /* HAVE_IBUS */
97112
113#ifdef HAVE_FCITX
114static FcitxInputMethod *fcitx = NULL;
115static FcitxKbd *fcitx_keyboard = NULL;
116static GHashTable *fcitx_engines = NULL;
117static GCancellable *fcitx_cancellable = NULL;
118static gboolean is_fcitx_active = FALSE;
119
120struct _FcitxShareStateConfig
121{
122 FcitxGenericConfig config;
123 gint share_state;
124};
125
126typedef struct _FcitxShareStateConfig FcitxShareStateConfig;
127
128static CONFIG_BINDING_BEGIN (FcitxShareStateConfig)
129CONFIG_BINDING_REGISTER ("Program", "ShareStateAmongWindow", share_state)
130CONFIG_BINDING_END ()
131
132static CONFIG_DESC_DEFINE (get_fcitx_config_desc, "config.desc")
133
134static FcitxShareStateConfig fcitx_config;
135#endif /* HAVE_FCITX */
136
98static void populate_model (GtkListStore *store,137static void populate_model (GtkListStore *store,
99 GtkListStore *active_sources_store);138 GtkListStore *active_sources_store);
100static GtkWidget *input_chooser_new (GtkWindow *main_window,139static GtkWidget *input_chooser_new (GtkWindow *main_window,
@@ -439,19 +478,23 @@
439 GDesktopAppInfo *app_info = NULL;478 GDesktopAppInfo *app_info = NULL;
440 gchar *legacy_setup = NULL;479 gchar *legacy_setup = NULL;
441 gchar *display_name = NULL;480 gchar *display_name = NULL;
481 gchar *name = NULL;
442482
443 engine_desc = g_hash_table_lookup (ibus_engines, id);483 engine_desc = g_hash_table_lookup (ibus_engines, id);
444 if (engine_desc)484 if (engine_desc)
445 {485 {
446 display_name = engine_get_display_name (engine_desc);486 display_name = engine_get_display_name (engine_desc);
487 name = g_strdup_printf ("%s (IBus)", display_name);
447 app_info = setup_app_info_for_id (id);488 app_info = setup_app_info_for_id (id);
448 legacy_setup = legacy_setup_for_id (id);489 legacy_setup = legacy_setup_for_id (id);
449490
450 gtk_list_store_set (GTK_LIST_STORE (model), &iter,491 gtk_list_store_set (GTK_LIST_STORE (model), &iter,
451 NAME_COLUMN, display_name,492 NAME_COLUMN, name,
493 COLOUR_COLUMN, is_ibus_active ? &active_colour : &inactive_colour,
452 SETUP_COLUMN, app_info,494 SETUP_COLUMN, app_info,
453 LEGACY_SETUP_COLUMN, legacy_setup,495 LEGACY_SETUP_COLUMN, legacy_setup,
454 -1);496 -1);
497 g_free (name);
455 g_free (display_name);498 g_free (display_name);
456 g_free (legacy_setup);499 g_free (legacy_setup);
457 if (app_info)500 if (app_info)
@@ -597,7 +640,11 @@
597640
598 fetch_ibus_engines (builder);641 fetch_ibus_engines (builder);
599642
643#ifdef HAVE_FCITX
644 if (has_indicator_keyboard () && !is_fcitx_active)
645#else
600 if (has_indicator_keyboard ())646 if (has_indicator_keyboard ())
647#endif
601 update_source_radios (builder);648 update_source_radios (builder);
602649
603 /* We've got everything we needed, don't want to be called again. */650 /* We've got everything we needed, don't want to be called again. */
@@ -681,6 +728,7 @@
681 NAME_COLUMN, name,728 NAME_COLUMN, name,
682 TYPE_COLUMN, INPUT_SOURCE_TYPE_XKB,729 TYPE_COLUMN, INPUT_SOURCE_TYPE_XKB,
683 ID_COLUMN, tmp->data,730 ID_COLUMN, tmp->data,
731 COLOUR_COLUMN, &active_colour,
684 -1);732 -1);
685 }733 }
686 g_free (source_id);734 g_free (source_id);
@@ -691,6 +739,7 @@
691 if (ibus_engines)739 if (ibus_engines)
692 {740 {
693 gchar *display_name;741 gchar *display_name;
742 gchar *name;
694743
695 sources = g_hash_table_get_keys (ibus_engines);744 sources = g_hash_table_get_keys (ibus_engines);
696745
@@ -704,13 +753,16 @@
704 continue;753 continue;
705754
706 display_name = engine_get_display_name (g_hash_table_lookup (ibus_engines, tmp->data));755 display_name = engine_get_display_name (g_hash_table_lookup (ibus_engines, tmp->data));
756 name = g_strdup_printf ("%s (IBus)", display_name);
707757
708 gtk_list_store_append (store, &iter);758 gtk_list_store_append (store, &iter);
709 gtk_list_store_set (store, &iter,759 gtk_list_store_set (store, &iter,
710 NAME_COLUMN, display_name,760 NAME_COLUMN, name,
711 TYPE_COLUMN, INPUT_SOURCE_TYPE_IBUS,761 TYPE_COLUMN, INPUT_SOURCE_TYPE_IBUS,
712 ID_COLUMN, tmp->data,762 ID_COLUMN, tmp->data,
763 COLOUR_COLUMN, is_ibus_active ? &active_colour : &inactive_colour,
713 -1);764 -1);
765 g_free (name);
714 g_free (display_name);766 g_free (display_name);
715 }767 }
716 g_free (source_id);768 g_free (source_id);
@@ -719,6 +771,44 @@
719 }771 }
720#endif772#endif
721773
774#ifdef HAVE_FCITX
775 if (fcitx_engines)
776 {
777 GHashTableIter engines_iter;
778 gpointer key;
779 gpointer value;
780
781 g_hash_table_iter_init (&engines_iter, fcitx_engines);
782 while (g_hash_table_iter_next (&engines_iter, &key, &value))
783 {
784 const gchar *id = key;
785 const FcitxIMItem *engine = value;
786
787 if (g_str_has_prefix (id, FCITX_XKB_PREFIX))
788 continue;
789
790 source_id = g_strconcat (INPUT_SOURCE_TYPE_FCITX, id, NULL);
791
792 if (!g_hash_table_contains (active_sources_table, source_id))
793 {
794 gchar *name = g_strdup_printf ("%s (Fcitx)", engine->name);
795
796 gtk_list_store_append (store, &iter);
797 gtk_list_store_set (store, &iter,
798 TYPE_COLUMN, INPUT_SOURCE_TYPE_FCITX,
799 ID_COLUMN, id,
800 NAME_COLUMN, name,
801 COLOUR_COLUMN, is_fcitx_active ? &active_colour : &inactive_colour,
802 -1);
803
804 g_free (name);
805 }
806
807 g_free (source_id);
808 }
809 }
810#endif
811
722 g_hash_table_destroy (active_sources_table);812 g_hash_table_destroy (active_sources_table);
723}813}
724814
@@ -734,6 +824,7 @@
734 GDesktopAppInfo *app_info;824 GDesktopAppInfo *app_info;
735 gchar *legacy_setup;825 gchar *legacy_setup;
736 GtkTreeIter tree_iter;826 GtkTreeIter tree_iter;
827 gboolean active;
737828
738 sources = g_settings_get_value (input_sources_settings, KEY_INPUT_SOURCES);829 sources = g_settings_get_value (input_sources_settings, KEY_INPUT_SOURCES);
739830
@@ -743,6 +834,7 @@
743 display_name = NULL;834 display_name = NULL;
744 app_info = NULL;835 app_info = NULL;
745 legacy_setup = NULL;836 legacy_setup = NULL;
837 active = FALSE;
746838
747 if (g_str_equal (type, INPUT_SOURCE_TYPE_XKB))839 if (g_str_equal (type, INPUT_SOURCE_TYPE_XKB))
748 {840 {
@@ -753,6 +845,7 @@
753 continue;845 continue;
754 }846 }
755 display_name = g_strdup (name);847 display_name = g_strdup (name);
848 active = TRUE;
756 }849 }
757 else if (g_str_equal (type, INPUT_SOURCE_TYPE_IBUS))850 else if (g_str_equal (type, INPUT_SOURCE_TYPE_IBUS))
758 {851 {
@@ -764,15 +857,36 @@
764857
765 if (engine_desc)858 if (engine_desc)
766 {859 {
767 display_name = engine_get_display_name (engine_desc);860 gchar *engine_name = engine_get_display_name (engine_desc);
861 display_name = g_strdup_printf ("%s (IBus)", engine_name);
768 app_info = setup_app_info_for_id (id);862 app_info = setup_app_info_for_id (id);
769 legacy_setup = legacy_setup_for_id (id);863 legacy_setup = legacy_setup_for_id (id);
864 active = is_ibus_active;
865 g_free (engine_name);
770 }866 }
771#else867#else
772 g_warning ("IBus input source type specified but IBus support was not compiled");868 g_warning ("IBus input source type specified but IBus support was not compiled");
773 continue;869 continue;
774#endif870#endif
775 }871 }
872 else if (g_str_equal (type, INPUT_SOURCE_TYPE_FCITX))
873 {
874#ifdef HAVE_FCITX
875 if (fcitx_engines)
876 {
877 const FcitxIMItem *engine = g_hash_table_lookup (fcitx_engines, id);
878
879 if (engine)
880 {
881 display_name = g_strdup_printf ("%s (Fcitx)", engine->name);
882 active = is_fcitx_active;
883 }
884 }
885#else
886 g_warning ("Fcitx input source type specified but Fcitx support was not compiled");
887 continue;
888#endif
889 }
776 else890 else
777 {891 {
778 g_warning ("Unknown input source type '%s'", type);892 g_warning ("Unknown input source type '%s'", type);
@@ -784,6 +898,7 @@
784 NAME_COLUMN, display_name,898 NAME_COLUMN, display_name,
785 TYPE_COLUMN, type,899 TYPE_COLUMN, type,
786 ID_COLUMN, id,900 ID_COLUMN, id,
901 COLOUR_COLUMN, active ? &active_colour : &inactive_colour,
787 SETUP_COLUMN, app_info,902 SETUP_COLUMN, app_info,
788 LEGACY_SETUP_COLUMN, legacy_setup,903 LEGACY_SETUP_COLUMN, legacy_setup,
789 -1);904 -1);
@@ -901,6 +1016,7 @@
901 gboolean settings_sensitive;1016 gboolean settings_sensitive;
902 GDesktopAppInfo *app_info;1017 GDesktopAppInfo *app_info;
903 gchar *legacy_setup;1018 gchar *legacy_setup;
1019 gchar *type;
9041020
905 remove_button = WID("input_source_remove");1021 remove_button = WID("input_source_remove");
906 show_button = WID("input_source_show");1022 show_button = WID("input_source_show");
@@ -915,6 +1031,7 @@
915 {1031 {
916 index = idx_from_model_iter (model, &iter);1032 index = idx_from_model_iter (model, &iter);
917 gtk_tree_model_get (model, &iter,1033 gtk_tree_model_get (model, &iter,
1034 TYPE_COLUMN, &type,
918 SETUP_COLUMN, &app_info,1035 SETUP_COLUMN, &app_info,
919 LEGACY_SETUP_COLUMN, &legacy_setup,1036 LEGACY_SETUP_COLUMN, &legacy_setup,
920 -1);1037 -1);
@@ -922,11 +1039,16 @@
922 else1039 else
923 {1040 {
924 index = -1;1041 index = -1;
1042 type = NULL;
925 app_info = NULL;1043 app_info = NULL;
926 legacy_setup = NULL;1044 legacy_setup = NULL;
927 }1045 }
9281046
1047#ifdef HAVE_FCITX
1048 settings_sensitive = (index >= 0 && (app_info != NULL || legacy_setup != NULL || g_strcmp0 (type, INPUT_SOURCE_TYPE_FCITX) == 0));
1049#else
929 settings_sensitive = (index >= 0 && (app_info != NULL || legacy_setup != NULL));1050 settings_sensitive = (index >= 0 && (app_info != NULL || legacy_setup != NULL));
1051#endif
9301052
931 if (app_info)1053 if (app_info)
932 g_object_unref (app_info);1054 g_object_unref (app_info);
@@ -1171,6 +1293,8 @@
1171 gchar *kbd_viewer_args;1293 gchar *kbd_viewer_args;
1172 const gchar *xkb_layout;1294 const gchar *xkb_layout;
1173 const gchar *xkb_variant;1295 const gchar *xkb_variant;
1296 gchar *layout = NULL;
1297 gchar *variant = NULL;
11741298
1175 g_debug ("show selected layout");1299 g_debug ("show selected layout");
11761300
@@ -1215,22 +1339,40 @@
1215 goto exit;1339 goto exit;
1216#endif1340#endif
1217 }1341 }
1342 else if (g_str_equal (type, INPUT_SOURCE_TYPE_FCITX))
1343 {
1344#ifdef HAVE_FCITX
1345 if (fcitx_keyboard)
1346 {
1347 fcitx_kbd_get_layout_for_im (fcitx_keyboard, id, &layout, &variant);
1348 xkb_layout = layout;
1349 xkb_variant = variant;
1350 }
1351#else
1352 g_warning ("Fcitx input source type specified but Fcitx support was not compiled");
1353 goto exit;
1354#endif
1355 }
1218 else1356 else
1219 {1357 {
1220 g_warning ("Unknown input source type '%s'", type);1358 g_warning ("Unknown input source type '%s'", type);
1221 goto exit;1359 goto exit;
1222 }1360 }
12231361
1224 if (xkb_variant[0])1362 if (xkb_variant != NULL && xkb_variant[0])
1225 kbd_viewer_args = g_strdup_printf ("gkbd-keyboard-display -l \"%s\t%s\"",1363 kbd_viewer_args = g_strdup_printf ("gkbd-keyboard-display -l \"%s\t%s\"",
1226 xkb_layout, xkb_variant);1364 xkb_layout, xkb_variant);
1227 else1365 else if (xkb_layout != NULL && xkb_layout[0])
1228 kbd_viewer_args = g_strdup_printf ("gkbd-keyboard-display -l %s",1366 kbd_viewer_args = g_strdup_printf ("gkbd-keyboard-display -l %s",
1229 xkb_layout);1367 xkb_layout);
1368 else
1369 kbd_viewer_args = g_strdup ("gkbd-keyboard-display -g 1");
12301370
1231 g_spawn_command_line_async (kbd_viewer_args, NULL);1371 g_spawn_command_line_async (kbd_viewer_args, NULL);
12321372
1233 g_free (kbd_viewer_args);1373 g_free (kbd_viewer_args);
1374 g_free (variant);
1375 g_free (layout);
1234 exit:1376 exit:
1235 g_free (type);1377 g_free (type);
1236 g_free (id);1378 g_free (id);
@@ -1245,6 +1387,7 @@
1245 GdkAppLaunchContext *ctx;1387 GdkAppLaunchContext *ctx;
1246 GDesktopAppInfo *app_info;1388 GDesktopAppInfo *app_info;
1247 gchar *legacy_setup;1389 gchar *legacy_setup;
1390 gchar *type;
1248 gchar *id;1391 gchar *id;
1249 GError *error = NULL;1392 GError *error = NULL;
12501393
@@ -1253,18 +1396,21 @@
1253 if (!get_selected_iter (builder, &model, &iter))1396 if (!get_selected_iter (builder, &model, &iter))
1254 return;1397 return;
12551398
1256 gtk_tree_model_get (model, &iter, SETUP_COLUMN, &app_info, LEGACY_SETUP_COLUMN, &legacy_setup, -1);1399 gtk_tree_model_get (model, &iter,
1400 ID_COLUMN, &id,
1401 TYPE_COLUMN, &type,
1402 SETUP_COLUMN, &app_info,
1403 LEGACY_SETUP_COLUMN, &legacy_setup,
1404 -1);
12571405
1258 if (app_info)1406 if (app_info)
1259 {1407 {
1260 ctx = gdk_display_get_app_launch_context (gdk_display_get_default ());1408 ctx = gdk_display_get_app_launch_context (gdk_display_get_default ());
1261 gdk_app_launch_context_set_timestamp (ctx, gtk_get_current_event_time ());1409 gdk_app_launch_context_set_timestamp (ctx, gtk_get_current_event_time ());
12621410
1263 gtk_tree_model_get (model, &iter, ID_COLUMN, &id, -1);
1264 g_app_launch_context_setenv (G_APP_LAUNCH_CONTEXT (ctx),1411 g_app_launch_context_setenv (G_APP_LAUNCH_CONTEXT (ctx),
1265 "IBUS_ENGINE_NAME",1412 "IBUS_ENGINE_NAME",
1266 id);1413 id);
1267 g_free (id);
12681414
1269 if (!g_app_info_launch (G_APP_INFO (app_info), NULL, G_APP_LAUNCH_CONTEXT (ctx), &error))1415 if (!g_app_info_launch (G_APP_INFO (app_info), NULL, G_APP_LAUNCH_CONTEXT (ctx), &error))
1270 {1416 {
@@ -1283,6 +1429,10 @@
1283 g_error_free (error);1429 g_error_free (error);
1284 }1430 }
1285 }1431 }
1432#ifdef HAVE_FCITX
1433 else if (g_strcmp0 (type, INPUT_SOURCE_TYPE_FCITX) == 0 && fcitx)
1434 fcitx_input_method_configure_im (fcitx, id);
1435#endif
12861436
1287 g_free (legacy_setup);1437 g_free (legacy_setup);
1288}1438}
@@ -1386,7 +1536,11 @@
1386 gchar *key,1536 gchar *key,
1387 gpointer user_data)1537 gpointer user_data)
1388{1538{
1539#ifdef HAVE_FCITX
1540 if (!is_fcitx_active && (g_strcmp0 (key, KEY_GROUP_PER_WINDOW) == 0 || g_strcmp0 (key, KEY_DEFAULT_GROUP) == 0))
1541#else
1389 if (g_strcmp0 (key, KEY_GROUP_PER_WINDOW) == 0 || g_strcmp0 (key, KEY_DEFAULT_GROUP) == 0)1542 if (g_strcmp0 (key, KEY_GROUP_PER_WINDOW) == 0 || g_strcmp0 (key, KEY_DEFAULT_GROUP) == 0)
1543#endif
1390 update_source_radios (user_data);1544 update_source_radios (user_data);
1391}1545}
13921546
@@ -1451,6 +1605,22 @@
1451 return edited ? GTK_ENTRY_ACCEL_UPDATE : GTK_ENTRY_ACCEL_IGNORE;1605 return edited ? GTK_ENTRY_ACCEL_UPDATE : GTK_ENTRY_ACCEL_IGNORE;
1452}1606}
14531607
1608#ifdef HAVE_FCITX
1609static void
1610clear_fcitx (void)
1611{
1612 FcitxConfigFree (&fcitx_config.config);
1613
1614 if (fcitx_cancellable)
1615 g_cancellable_cancel (fcitx_cancellable);
1616
1617 g_clear_pointer (&fcitx_engines, g_hash_table_unref);
1618 g_clear_object (&fcitx_cancellable);
1619 g_clear_object (&fcitx_keyboard);
1620 g_clear_object (&fcitx);
1621}
1622#endif
1623
1454static void1624static void
1455builder_finalized (gpointer data,1625builder_finalized (gpointer data,
1456 GObject *where_the_object_was)1626 GObject *where_the_object_was)
@@ -1465,6 +1635,10 @@
1465 g_clear_object (&next_source_item);1635 g_clear_object (&next_source_item);
1466 g_clear_object (&prev_source_item);1636 g_clear_object (&prev_source_item);
14671637
1638#ifdef HAVE_FCITX
1639 clear_fcitx ();
1640#endif
1641
1468#ifdef HAVE_IBUS1642#ifdef HAVE_IBUS
1469 clear_ibus ();1643 clear_ibus ();
1470#endif1644#endif
@@ -1502,6 +1676,113 @@
1502 return ret;1676 return ret;
1503}1677}
15041678
1679#ifdef HAVE_FCITX
1680static void
1681fcitx_init (void)
1682{
1683 GError *error = NULL;
1684
1685 fcitx_cancellable = g_cancellable_new ();
1686 fcitx = fcitx_input_method_new (G_BUS_TYPE_SESSION,
1687 G_DBUS_PROXY_FLAGS_NONE,
1688 0,
1689 fcitx_cancellable,
1690 &error);
1691 g_clear_object (&fcitx_cancellable);
1692
1693 if (fcitx)
1694 {
1695 GPtrArray *engines = fcitx_input_method_get_imlist_nofree (fcitx);
1696
1697 if (engines)
1698 {
1699 guint i;
1700
1701 fcitx_engines = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) fcitx_im_item_free);
1702
1703 for (i = 0; i < engines->len; i++)
1704 {
1705 FcitxIMItem *engine = g_ptr_array_index (engines, i);
1706 g_hash_table_insert (fcitx_engines, engine->unique_name, engine);
1707 }
1708
1709 g_ptr_array_unref (engines);
1710 }
1711 }
1712 else
1713 {
1714 g_warning ("Fcitx input method framework unavailable: %s", error->message);
1715 g_clear_error (&error);
1716 }
1717
1718 fcitx_cancellable = g_cancellable_new ();
1719 fcitx_keyboard = fcitx_kbd_new (G_BUS_TYPE_SESSION,
1720 G_DBUS_PROXY_FLAGS_NONE,
1721 0,
1722 fcitx_cancellable,
1723 &error);
1724 g_clear_object (&fcitx_cancellable);
1725
1726 if (!fcitx_keyboard)
1727 {
1728 g_warning ("Fcitx keyboard module unavailable: %s", error->message);
1729 g_clear_error (&error);
1730 }
1731}
1732
1733static void
1734save_fcitx_config (void)
1735{
1736 FILE *file = FcitxXDGGetFileUserWithPrefix (NULL, "config", "w", NULL);
1737 FcitxConfigSaveConfigFileFp (file, &fcitx_config.config, get_fcitx_config_desc ());
1738
1739 if (file)
1740 fclose (file);
1741
1742 fcitx_input_method_reload_config (fcitx);
1743}
1744
1745static void
1746load_fcitx_config (void)
1747{
1748 static gboolean loaded = FALSE;
1749
1750 if (loaded)
1751 return;
1752
1753 FILE *file = FcitxXDGGetFileUserWithPrefix (NULL, "config", "r", NULL);
1754 FcitxConfigFile *config_file = FcitxConfigParseConfigFileFp (file, get_fcitx_config_desc ());
1755 FcitxShareStateConfigConfigBind (&fcitx_config, config_file, get_fcitx_config_desc ());
1756 FcitxConfigBindSync (&fcitx_config.config);
1757
1758 if (file)
1759 fclose (file);
1760
1761 loaded = TRUE;
1762}
1763
1764static void
1765set_share_state (gint share_state)
1766{
1767 if (share_state != fcitx_config.share_state)
1768 {
1769 fcitx_config.share_state = share_state;
1770 save_fcitx_config ();
1771 }
1772}
1773
1774static void
1775share_state_radio_toggled (GtkToggleButton *widget,
1776 gpointer user_data)
1777{
1778 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("share-state-no-radio"))))
1779 set_share_state (0);
1780 else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("share-state-all-radio"))))
1781 set_share_state (1);
1782 else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("share-state-per-program-radio"))))
1783 set_share_state (2);
1784}
1785#endif
15051786
1506void1787void
1507setup_input_tabs (GtkBuilder *builder_,1788setup_input_tabs (GtkBuilder *builder_,
@@ -1513,6 +1794,8 @@
1513 GtkListStore *store;1794 GtkListStore *store;
1514 GtkTreeModel *filtered_store;1795 GtkTreeModel *filtered_store;
1515 GtkTreeSelection *selection;1796 GtkTreeSelection *selection;
1797 GtkStyleContext *context;
1798 const gchar *module;
15161799
1517 builder = builder_;1800 builder = builder_;
15181801
@@ -1531,12 +1814,14 @@
1531 cell = gtk_cell_renderer_text_new ();1814 cell = gtk_cell_renderer_text_new ();
1532 gtk_tree_view_column_pack_start (column, cell, TRUE);1815 gtk_tree_view_column_pack_start (column, cell, TRUE);
1533 gtk_tree_view_column_add_attribute (column, cell, "text", NAME_COLUMN);1816 gtk_tree_view_column_add_attribute (column, cell, "text", NAME_COLUMN);
1817 gtk_tree_view_column_add_attribute (column, cell, "foreground-rgba", COLOUR_COLUMN);
1534 gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);1818 gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
15351819
1536 store = gtk_list_store_new (N_COLUMNS,1820 store = gtk_list_store_new (N_COLUMNS,
1537 G_TYPE_STRING,1821 G_TYPE_STRING,
1538 G_TYPE_STRING,1822 G_TYPE_STRING,
1539 G_TYPE_STRING,1823 G_TYPE_STRING,
1824 GDK_TYPE_RGBA,
1540 G_TYPE_DESKTOP_APP_INFO,1825 G_TYPE_DESKTOP_APP_INFO,
1541 G_TYPE_STRING);1826 G_TYPE_STRING);
15421827
@@ -1549,8 +1834,15 @@
1549 if (!xkb_info)1834 if (!xkb_info)
1550 xkb_info = gnome_xkb_info_new ();1835 xkb_info = gnome_xkb_info_new ();
15511836
1837 context = gtk_widget_get_style_context (treeview);
1838 gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &active_colour);
1839 gtk_style_context_get_color (context, GTK_STATE_FLAG_INSENSITIVE, &inactive_colour);
1840
1841 module = g_getenv (ENV_GTK_IM_MODULE);
1842
1552#ifdef HAVE_IBUS1843#ifdef HAVE_IBUS
1553 ibus_init ();1844 ibus_init ();
1845 is_ibus_active = g_strcmp0 (module, GTK_IM_MODULE_IBUS) == 0;
1554 shell_name_watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION,1846 shell_name_watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
1555 "org.gnome.Shell",1847 "org.gnome.Shell",
1556 G_BUS_NAME_WATCHER_FLAGS_NONE,1848 G_BUS_NAME_WATCHER_FLAGS_NONE,
@@ -1560,6 +1852,11 @@
1560 NULL);1852 NULL);
1561#endif1853#endif
15621854
1855#ifdef HAVE_FCITX
1856 fcitx_init ();
1857 is_fcitx_active = g_strcmp0 (module, GTK_IM_MODULE_FCITX) == 0;
1858#endif
1859
1563 populate_with_active_sources (store);1860 populate_with_active_sources (store);
15641861
1565 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));1862 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
@@ -1604,33 +1901,73 @@
1604 media_key_settings = g_settings_new (MEDIA_KEYS_SCHEMA_ID);1901 media_key_settings = g_settings_new (MEDIA_KEYS_SCHEMA_ID);
1605 indicator_settings = g_settings_new (INDICATOR_KEYBOARD_SCHEMA_ID);1902 indicator_settings = g_settings_new (INDICATOR_KEYBOARD_SCHEMA_ID);
16061903
1607 update_source_radios (builder);
1608
1609 g_settings_bind (indicator_settings,1904 g_settings_bind (indicator_settings,
1610 KEY_VISIBLE,1905 KEY_VISIBLE,
1611 WID ("show-indicator-check"),1906 WID ("show-indicator-check"),
1612 "active",1907 "active",
1613 G_SETTINGS_BIND_DEFAULT);1908 G_SETTINGS_BIND_DEFAULT);
1614 g_settings_bind (ibus_panel_settings,1909
1615 IBUS_ORIENTATION_KEY,1910#ifdef HAVE_FCITX
1616 WID ("orientation-combo"),1911 if (is_fcitx_active)
1617 "active",1912 {
1618 G_SETTINGS_BIND_DEFAULT);1913 load_fcitx_config ();
1619 g_settings_bind (ibus_panel_settings,1914
1620 IBUS_USE_CUSTOM_FONT_KEY,1915 switch (fcitx_config.share_state)
1621 WID ("custom-font-check"),1916 {
1622 "active",1917 case 0:
1623 G_SETTINGS_BIND_DEFAULT);1918 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("share-state-no-radio")), TRUE);
1624 g_settings_bind (ibus_panel_settings,1919 break;
1625 IBUS_USE_CUSTOM_FONT_KEY,1920 case 1:
1626 WID ("custom-font-button"),1921 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("share-state-all-radio")), TRUE);
1627 "sensitive",1922 break;
1628 G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY);1923 case 2:
1629 g_settings_bind (ibus_panel_settings,1924 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("share-state-per-program-radio")), TRUE);
1630 IBUS_CUSTOM_FONT_KEY,1925 break;
1631 WID ("custom-font-button"),1926 }
1632 "font-name",1927
1633 G_SETTINGS_BIND_DEFAULT | G_SETTINGS_BIND_NO_SENSITIVITY);1928 g_signal_connect (WID ("share-state-all-radio"), "toggled",
1929 G_CALLBACK (share_state_radio_toggled), builder);
1930 g_signal_connect (WID ("share-state-no-radio"), "toggled",
1931 G_CALLBACK (share_state_radio_toggled), builder);
1932 g_signal_connect (WID ("share-state-per-program-radio"), "toggled",
1933 G_CALLBACK (share_state_radio_toggled), builder);
1934 }
1935 else
1936#endif /* HAVE_FCITX */
1937 {
1938 update_source_radios (builder);
1939
1940 g_settings_bind (ibus_panel_settings,
1941 IBUS_ORIENTATION_KEY,
1942 WID ("orientation-combo"),
1943 "active",
1944 G_SETTINGS_BIND_DEFAULT);
1945 g_settings_bind (ibus_panel_settings,
1946 IBUS_USE_CUSTOM_FONT_KEY,
1947 WID ("custom-font-check"),
1948 "active",
1949 G_SETTINGS_BIND_DEFAULT);
1950 g_settings_bind (ibus_panel_settings,
1951 IBUS_USE_CUSTOM_FONT_KEY,
1952 WID ("custom-font-button"),
1953 "sensitive",
1954 G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY);
1955 g_settings_bind (ibus_panel_settings,
1956 IBUS_CUSTOM_FONT_KEY,
1957 WID ("custom-font-button"),
1958 "font-name",
1959 G_SETTINGS_BIND_DEFAULT | G_SETTINGS_BIND_NO_SENSITIVITY);
1960
1961 g_signal_connect (WID ("same-source-radio"), "toggled",
1962 G_CALLBACK (source_radio_toggled), builder);
1963 g_signal_connect (WID ("different-source-radio"), "toggled",
1964 G_CALLBACK (source_radio_toggled), builder);
1965 g_signal_connect (WID ("default-source-radio"), "toggled",
1966 G_CALLBACK (source_radio_toggled), builder);
1967 g_signal_connect (WID ("current-source-radio"), "toggled",
1968 G_CALLBACK (source_radio_toggled), builder);
1969 }
1970
1634 g_settings_bind_with_mapping (media_key_settings,1971 g_settings_bind_with_mapping (media_key_settings,
1635 KEY_PREV_INPUT_SOURCE,1972 KEY_PREV_INPUT_SOURCE,
1636 WID ("prev-source-entry"),1973 WID ("prev-source-entry"),
@@ -1652,14 +1989,6 @@
1652 G_CALLBACK (shortcut_key_pressed), builder);1989 G_CALLBACK (shortcut_key_pressed), builder);
1653 g_signal_connect (WID ("next-source-entry"), "key-pressed",1990 g_signal_connect (WID ("next-source-entry"), "key-pressed",
1654 G_CALLBACK (shortcut_key_pressed), builder);1991 G_CALLBACK (shortcut_key_pressed), builder);
1655 g_signal_connect (WID ("same-source-radio"), "toggled",
1656 G_CALLBACK (source_radio_toggled), builder);
1657 g_signal_connect (WID ("different-source-radio"), "toggled",
1658 G_CALLBACK (source_radio_toggled), builder);
1659 g_signal_connect (WID ("default-source-radio"), "toggled",
1660 G_CALLBACK (source_radio_toggled), builder);
1661 g_signal_connect (WID ("current-source-radio"), "toggled",
1662 G_CALLBACK (source_radio_toggled), builder);
1663 g_signal_connect (libgnomekbd_settings,1992 g_signal_connect (libgnomekbd_settings,
1664 "changed",1993 "changed",
1665 G_CALLBACK (libgnomekbd_settings_changed),1994 G_CALLBACK (libgnomekbd_settings_changed),
@@ -1848,6 +2177,7 @@
1848 gtk_tree_view_column_new_with_attributes ("Input Sources",2177 gtk_tree_view_column_new_with_attributes ("Input Sources",
1849 gtk_cell_renderer_text_new (),2178 gtk_cell_renderer_text_new (),
1850 "text", NAME_COLUMN,2179 "text", NAME_COLUMN,
2180 "foreground-rgba", COLOUR_COLUMN,
1851 NULL);2181 NULL);
18522182
1853 gtk_window_set_transient_for (GTK_WINDOW (chooser), main_window);2183 gtk_window_set_transient_for (GTK_WINDOW (chooser), main_window);
18542184
=== added file 'panels/region/unity-region-panel-fcitx.ui'
--- panels/region/unity-region-panel-fcitx.ui 1970-01-01 00:00:00 +0000
+++ panels/region/unity-region-panel-fcitx.ui 2015-02-12 16:27:19 +0000
@@ -0,0 +1,560 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<interface>
3 <!-- interface-requires gtk+ 3.0 -->
4 <object class="GtkAdjustment" id="adjustment1">
5 <property name="lower">100</property>
6 <property name="upper">2000</property>
7 <property name="value">500</property>
8 <property name="step_increment">10</property>
9 <property name="page_increment">10</property>
10 </object>
11 <object class="GtkAdjustment" id="adjustment10">
12 <property name="lower">1</property>
13 <property name="upper">100000</property>
14 <property name="value">1</property>
15 <property name="step_increment">1</property>
16 <property name="page_increment">10</property>
17 </object>
18 <object class="GtkAdjustment" id="adjustment2">
19 <property name="lower">10</property>
20 <property name="upper">110</property>
21 <property name="value">30</property>
22 <property name="step_increment">10</property>
23 <property name="page_increment">10</property>
24 </object>
25 <object class="GtkAdjustment" id="adjustment3">
26 <property name="lower">100</property>
27 <property name="upper">2500</property>
28 <property name="value">1000</property>
29 <property name="step_increment">200</property>
30 <property name="page_increment">200</property>
31 </object>
32 <object class="GtkAdjustment" id="adjustment4">
33 <property name="upper">500</property>
34 <property name="value">0.5</property>
35 <property name="step_increment">10</property>
36 <property name="page_increment">10</property>
37 </object>
38 <object class="GtkAdjustment" id="adjustment5">
39 <property name="upper">900</property>
40 <property name="value">0.5</property>
41 <property name="step_increment">10</property>
42 <property name="page_increment">10</property>
43 </object>
44 <object class="GtkAdjustment" id="adjustment6">
45 <property name="upper">3000</property>
46 <property name="value">1800</property>
47 <property name="step_increment">10</property>
48 <property name="page_increment">10</property>
49 </object>
50 <object class="GtkAdjustment" id="adjustment7">
51 <property name="lower">10</property>
52 <property name="upper">1000</property>
53 <property name="value">300</property>
54 <property name="step_increment">10</property>
55 <property name="page_increment">10</property>
56 </object>
57 <object class="GtkAdjustment" id="adjustment8">
58 <property name="lower">10</property>
59 <property name="upper">2000</property>
60 <property name="value">300</property>
61 <property name="step_increment">10</property>
62 <property name="page_increment">10</property>
63 </object>
64 <object class="GtkAdjustment" id="adjustment9">
65 <property name="lower">1</property>
66 <property name="upper">100000</property>
67 <property name="value">1</property>
68 <property name="step_increment">1</property>
69 <property name="page_increment">10</property>
70 </object>
71 <object class="GtkListStore" id="display_language_liststore"/>
72 <object class="GtkDialog" id="region_dialog">
73 <property name="can_focus">False</property>
74 <property name="border_width">5</property>
75 <property name="title" translatable="yes">Region and Language</property>
76 <property name="default_width">600</property>
77 <property name="default_height">430</property>
78 <property name="type_hint">dialog</property>
79 <child internal-child="vbox">
80 <object class="GtkBox" id="dialog-vbox1">
81 <property name="visible">True</property>
82 <property name="can_focus">False</property>
83 <property name="orientation">vertical</property>
84 <property name="spacing">2</property>
85 <child internal-child="action_area">
86 <object class="GtkButtonBox" id="dialog-action_area1">
87 <property name="can_focus">False</property>
88 </object>
89 <packing>
90 <property name="expand">False</property>
91 <property name="fill">True</property>
92 <property name="pack_type">end</property>
93 <property name="position">0</property>
94 </packing>
95 </child>
96 <child>
97 <object class="GtkVBox" id="region_vbox">
98 <property name="visible">True</property>
99 <property name="can_focus">False</property>
100 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
101 <property name="border_width">5</property>
102 <property name="spacing">12</property>
103 <child>
104 <object class="GtkVBox" id="vbox5">
105 <property name="visible">True</property>
106 <property name="can_focus">False</property>
107 <property name="border_width">12</property>
108 <property name="spacing">12</property>
109 <child>
110 <object class="GtkHBox" id="hbox3">
111 <property name="visible">True</property>
112 <property name="can_focus">False</property>
113 <property name="spacing">12</property>
114 <child>
115 <object class="GtkVBox" id="vbox6">
116 <property name="visible">True</property>
117 <property name="can_focus">False</property>
118 <property name="margin_right">5</property>
119 <child>
120 <object class="GtkLabel" id="label2">
121 <property name="visible">True</property>
122 <property name="can_focus">False</property>
123 <property name="margin_bottom">5</property>
124 <property name="xalign">0</property>
125 <property name="label" translatable="yes">Input sources to use:</property>
126 </object>
127 <packing>
128 <property name="expand">False</property>
129 <property name="fill">True</property>
130 <property name="position">0</property>
131 </packing>
132 </child>
133 <child>
134 <object class="GtkScrolledWindow" id="input_sources_swindow">
135 <property name="visible">True</property>
136 <property name="can_focus">True</property>
137 <property name="shadow_type">in</property>
138 <child>
139 <object class="GtkTreeView" id="active_input_sources">
140 <property name="visible">True</property>
141 <property name="can_focus">True</property>
142 <property name="headers_visible">False</property>
143 <child internal-child="selection">
144 <object class="GtkTreeSelection" id="treeview-selection3"/>
145 </child>
146 </object>
147 </child>
148 </object>
149 <packing>
150 <property name="expand">True</property>
151 <property name="fill">True</property>
152 <property name="position">1</property>
153 </packing>
154 </child>
155 <child>
156 <object class="GtkToolbar" id="input-toolbar">
157 <property name="visible">True</property>
158 <property name="can_focus">False</property>
159 <property name="toolbar_style">icons</property>
160 <property name="show_arrow">False</property>
161 <property name="icon_size">1</property>
162 <style>
163 <class name="inline-toolbar"/>
164 </style>
165 <child>
166 <object class="GtkToolItem" id="i_s_ar_item">
167 <property name="visible">True</property>
168 <property name="can_focus">False</property>
169 <child>
170 <object class="GtkBox" id="i_s_ar_box">
171 <property name="visible">True</property>
172 <property name="can_focus">False</property>
173 <child>
174 <object class="GtkButton" id="input_source_add">
175 <property name="visible">True</property>
176 <property name="can_focus">False</property>
177 <property name="receives_default">False</property>
178 <child>
179 <object class="GtkImage" id="i_s_a_image">
180 <property name="visible">True</property>
181 <property name="can_focus">False</property>
182 <property name="icon_name">list-add-symbolic</property>
183 <property name="icon-size">1</property>
184 </object>
185 </child>
186 </object>
187 <packing>
188 <property name="expand">False</property>
189 <property name="fill">True</property>
190 <property name="position">0</property>
191 </packing>
192 </child>
193 <child>
194 <object class="GtkButton" id="input_source_remove">
195 <property name="visible">True</property>
196 <property name="can_focus">False</property>
197 <property name="receives_default">False</property>
198 <child>
199 <object class="GtkImage" id="i_s_r_image">
200 <property name="visible">True</property>
201 <property name="can_focus">False</property>
202 <property name="icon_name">list-remove-symbolic</property>
203 <property name="icon-size">1</property>
204 </object>
205 </child>
206 </object>
207 <packing>
208 <property name="expand">False</property>
209 <property name="fill">True</property>
210 <property name="position">1</property>
211 </packing>
212 </child>
213 </object>
214 </child>
215 </object>
216 <packing>
217 <property name="expand">False</property>
218 </packing>
219 </child>
220 <child>
221 <object class="GtkSeparatorToolItem" id="sep1">
222 <property name="visible">True</property>
223 <property name="can_focus">False</property>
224 <property name="draw">False</property>
225 </object>
226 <packing>
227 <property name="expand">True</property>
228 </packing>
229 </child>
230 <child>
231 <object class="GtkToolItem" id="i_s_ud_item">
232 <property name="visible">True</property>
233 <property name="can_focus">False</property>
234 <child>
235 <object class="GtkBox" id="i_s_ud_box">
236 <property name="visible">True</property>
237 <property name="can_focus">False</property>
238 <child>
239 <object class="GtkButton" id="input_source_move_up">
240 <property name="visible">True</property>
241 <property name="can_focus">False</property>
242 <property name="receives_default">False</property>
243 <child>
244 <object class="GtkImage" id="i_s_u_image">
245 <property name="visible">True</property>
246 <property name="can_focus">False</property>
247 <property name="icon_name">go-up-symbolic</property>
248 <property name="icon-size">1</property>
249 </object>
250 </child>
251 </object>
252 <packing>
253 <property name="expand">False</property>
254 <property name="fill">True</property>
255 <property name="position">0</property>
256 </packing>
257 </child>
258 <child>
259 <object class="GtkButton" id="input_source_move_down">
260 <property name="visible">True</property>
261 <property name="can_focus">False</property>
262 <property name="receives_default">False</property>
263 <child>
264 <object class="GtkImage" id="i_s_d_image">
265 <property name="visible">True</property>
266 <property name="can_focus">False</property>
267 <property name="icon_name">go-down-symbolic</property>
268 <property name="icon-size">1</property>
269 </object>
270 </child>
271 </object>
272 <packing>
273 <property name="expand">False</property>
274 <property name="fill">True</property>
275 <property name="position">1</property>
276 </packing>
277 </child>
278 </object>
279 </child>
280 </object>
281 <packing>
282 <property name="expand">False</property>
283 </packing>
284 </child>
285 <child>
286 <object class="GtkSeparatorToolItem" id="sep2">
287 <property name="visible">True</property>
288 <property name="can_focus">False</property>
289 <property name="hexpand">True</property>
290 <property name="draw">False</property>
291 </object>
292 <packing>
293 <property name="expand">True</property>
294 </packing>
295 </child>
296 <child>
297 <object class="GtkToolItem" id="i_s_sp_item">
298 <property name="visible">True</property>
299 <property name="can_focus">False</property>
300 <child>
301 <object class="GtkBox" id="i_s_sp_box">
302 <property name="visible">True</property>
303 <property name="can_focus">False</property>
304 <child>
305 <object class="GtkButton" id="input_source_settings">
306 <property name="visible">True</property>
307 <property name="can_focus">False</property>
308 <property name="receives_default">False</property>
309 <child>
310 <object class="GtkImage" id="i_s_s_image">
311 <property name="visible">True</property>
312 <property name="can_focus">False</property>
313 <property name="pixel_size">16</property>
314 <property name="icon_name">preferences-system-symbolic</property>
315 <property name="icon-size">1</property>
316 </object>
317 </child>
318 </object>
319 <packing>
320 <property name="expand">False</property>
321 <property name="fill">True</property>
322 <property name="position">0</property>
323 </packing>
324 </child>
325 <child>
326 <object class="GtkButton" id="input_source_show">
327 <property name="visible">True</property>
328 <property name="can_focus">False</property>
329 <property name="receives_default">False</property>
330 <child>
331 <object class="GtkImage" id="i_s_p_image">
332 <property name="visible">True</property>
333 <property name="can_focus">False</property>
334 <property name="icon_name">input-keyboard-symbolic</property>
335 <property name="icon-size">1</property>
336 </object>
337 </child>
338 </object>
339 <packing>
340 <property name="expand">False</property>
341 <property name="fill">True</property>
342 <property name="position">1</property>
343 </packing>
344 </child>
345 </object>
346 </child>
347 </object>
348 <packing>
349 <property name="expand">False</property>
350 </packing>
351 </child>
352 </object>
353 <packing>
354 <property name="expand">False</property>
355 <property name="fill">True</property>
356 <property name="position">2</property>
357 </packing>
358 </child>
359 </object>
360 <packing>
361 <property name="expand">True</property>
362 <property name="fill">True</property>
363 <property name="position">0</property>
364 </packing>
365 </child>
366 <child>
367 <object class="GtkBox" id="box2">
368 <property name="visible">True</property>
369 <property name="can_focus">False</property>
370 <property name="orientation">vertical</property>
371 <child>
372 <object class="GtkLabel" id="label22">
373 <property name="visible">True</property>
374 <property name="can_focus">False</property>
375 <property name="margin_bottom">5</property>
376 <property name="xalign">0</property>
377 <property name="label" translatable="yes">Switch to next source using:</property>
378 </object>
379 <packing>
380 <property name="expand">False</property>
381 <property name="fill">True</property>
382 <property name="position">0</property>
383 </packing>
384 </child>
385 <child>
386 <object class="GtkEntryAccel" id="next-source-entry">
387 <property name="visible">True</property>
388 <property name="can_focus">True</property>
389 <property name="margin_bottom">5</property>
390 <property name="invisible_char">•</property>
391 </object>
392 <packing>
393 <property name="expand">False</property>
394 <property name="fill">True</property>
395 <property name="position">1</property>
396 </packing>
397 </child>
398 <child>
399 <object class="GtkLabel" id="label24">
400 <property name="visible">True</property>
401 <property name="can_focus">False</property>
402 <property name="margin_bottom">5</property>
403 <property name="xalign">0</property>
404 <property name="label" translatable="yes">Switch to previous source using:</property>
405 </object>
406 <packing>
407 <property name="expand">False</property>
408 <property name="fill">True</property>
409 <property name="position">2</property>
410 </packing>
411 </child>
412 <child>
413 <object class="GtkEntryAccel" id="prev-source-entry">
414 <property name="visible">True</property>
415 <property name="can_focus">True</property>
416 <property name="margin_bottom">15</property>
417 <property name="invisible_char">•</property>
418 </object>
419 <packing>
420 <property name="expand">False</property>
421 <property name="fill">True</property>
422 <property name="position">3</property>
423 </packing>
424 </child>
425 <child>
426 <object class="GtkBox" id="per-window-box">
427 <property name="visible">True</property>
428 <property name="can_focus">False</property>
429 <property name="orientation">vertical</property>
430 <child>
431 <object class="GtkRadioButton" id="share-state-all-radio">
432 <property name="label" translatable="yes">Use the same source for all windows</property>
433 <property name="visible">True</property>
434 <property name="can_focus">False</property>
435 <property name="receives_default">False</property>
436 <property name="xalign">0</property>
437 <property name="active">False</property>
438 <property name="draw_indicator">True</property>
439 </object>
440 <packing>
441 <property name="expand">False</property>
442 <property name="fill">True</property>
443 <property name="position">0</property>
444 </packing>
445 </child>
446 <child>
447 <object class="GtkRadioButton" id="share-state-no-radio">
448 <property name="label" translatable="yes">Allow different sources for each window</property>
449 <property name="visible">True</property>
450 <property name="can_focus">False</property>
451 <property name="receives_default">False</property>
452 <property name="xalign">0</property>
453 <property name="active">True</property>
454 <property name="draw_indicator">True</property>
455 <property name="group">share-state-all-radio</property>
456 </object>
457 <packing>
458 <property name="expand">False</property>
459 <property name="fill">True</property>
460 <property name="position">1</property>
461 </packing>
462 </child>
463 <child>
464 <object class="GtkRadioButton" id="share-state-per-program-radio">
465 <property name="label" translatable="yes">Allow different sources for each application</property>
466 <property name="visible">True</property>
467 <property name="can_focus">False</property>
468 <property name="receives_default">False</property>
469 <property name="xalign">0</property>
470 <property name="active">False</property>
471 <property name="draw_indicator">True</property>
472 <property name="group">share-state-all-radio</property>
473 </object>
474 <packing>
475 <property name="expand">False</property>
476 <property name="fill">True</property>
477 <property name="position">2</property>
478 </packing>
479 </child>
480 </object>
481 <packing>
482 <property name="expand">True</property>
483 <property name="fill">True</property>
484 <property name="position">4</property>
485 </packing>
486 </child>
487 </object>
488 <packing>
489 <property name="expand">True</property>
490 <property name="fill">True</property>
491 <property name="position">1</property>
492 </packing>
493 </child>
494 </object>
495 <packing>
496 <property name="expand">True</property>
497 <property name="fill">True</property>
498 <property name="position">0</property>
499 </packing>
500 </child>
501 <child>
502 <object class="GtkBox" id="box1">
503 <property name="visible">True</property>
504 <property name="can_focus">False</property>
505 <property name="valign">end</property>
506 <child>
507 <object class="GtkCheckButton" id="show-indicator-check">
508 <property name="label" translatable="yes">Show current input source in the menu bar</property>
509 <property name="visible">True</property>
510 <property name="can_focus">False</property>
511 <property name="receives_default">False</property>
512 <property name="hexpand">True</property>
513 <property name="xalign">0</property>
514 <property name="draw_indicator">True</property>
515 </object>
516 <packing>
517 <property name="expand">False</property>
518 <property name="fill">True</property>
519 <property name="position">0</property>
520 </packing>
521 </child>
522 <child>
523 <object class="GtkLinkButton" id="jump-to-shortcuts">
524 <property name="label" translatable="yes">Keyboard Settings...</property>
525 <property name="visible">True</property>
526 <property name="can_focus">True</property>
527 <property name="receives_default">True</property>
528 <property name="has_tooltip">True</property>
529 <property name="halign">end</property>
530 <property name="relief">none</property>
531 </object>
532 <packing>
533 <property name="expand">False</property>
534 <property name="fill">True</property>
535 <property name="position">1</property>
536 </packing>
537 </child>
538 </object>
539 <packing>
540 <property name="expand">False</property>
541 <property name="fill">True</property>
542 <property name="position">1</property>
543 </packing>
544 </child>
545 </object>
546 <packing>
547 <property name="position">3</property>
548 </packing>
549 </child>
550 </object>
551 <packing>
552 <property name="expand">False</property>
553 <property name="fill">True</property>
554 <property name="position">1</property>
555 </packing>
556 </child>
557 </object>
558 </child>
559 </object>
560</interface>
0561
=== renamed file 'panels/region/unity-region-panel.ui' => 'panels/region/unity-region-panel-ibus.ui'
--- panels/region/unity-region-panel.ui 2013-11-28 06:02:43 +0000
+++ panels/region/unity-region-panel-ibus.ui 2015-02-12 16:27:19 +0000
@@ -423,76 +423,88 @@
423 </packing>423 </packing>
424 </child>424 </child>
425 <child>425 <child>
426 <object class="GtkRadioButton" id="same-source-radio">426 <object class="GtkBox" id="per-window-box">
427 <property name="label" translatable="yes">Use the same source for all windows</property>
428 <property name="visible">True</property>427 <property name="visible">True</property>
429 <property name="can_focus">False</property>428 <property name="can_focus">False</property>
430 <property name="receives_default">False</property>429 <property name="orientation">vertical</property>
431 <property name="xalign">0</property>430 <child>
432 <property name="active">True</property>431 <object class="GtkRadioButton" id="same-source-radio">
433 <property name="draw_indicator">True</property>432 <property name="label" translatable="yes">Use the same source for all windows</property>
433 <property name="visible">True</property>
434 <property name="can_focus">False</property>
435 <property name="receives_default">False</property>
436 <property name="xalign">0</property>
437 <property name="active">True</property>
438 <property name="draw_indicator">True</property>
439 </object>
440 <packing>
441 <property name="expand">False</property>
442 <property name="fill">True</property>
443 <property name="position">0</property>
444 </packing>
445 </child>
446 <child>
447 <object class="GtkRadioButton" id="different-source-radio">
448 <property name="label" translatable="yes">Allow different sources for each window</property>
449 <property name="visible">True</property>
450 <property name="can_focus">False</property>
451 <property name="receives_default">False</property>
452 <property name="xalign">0</property>
453 <property name="active">True</property>
454 <property name="draw_indicator">True</property>
455 <property name="group">same-source-radio</property>
456 </object>
457 <packing>
458 <property name="expand">False</property>
459 <property name="fill">True</property>
460 <property name="position">1</property>
461 </packing>
462 </child>
463 <child>
464 <object class="GtkRadioButton" id="default-source-radio">
465 <property name="label" translatable="yes">New windows use the default source</property>
466 <property name="visible">True</property>
467 <property name="can_focus">False</property>
468 <property name="receives_default">False</property>
469 <property name="margin_left">25</property>
470 <property name="xalign">0</property>
471 <property name="active">True</property>
472 <property name="draw_indicator">True</property>
473 </object>
474 <packing>
475 <property name="expand">False</property>
476 <property name="fill">True</property>
477 <property name="position">2</property>
478 </packing>
479 </child>
480 <child>
481 <object class="GtkRadioButton" id="current-source-radio">
482 <property name="label" translatable="yes">New windows use the current source</property>
483 <property name="visible">True</property>
484 <property name="can_focus">False</property>
485 <property name="receives_default">False</property>
486 <property name="margin_left">25</property>
487 <property name="margin_bottom">15</property>
488 <property name="xalign">0</property>
489 <property name="active">True</property>
490 <property name="draw_indicator">True</property>
491 <property name="group">default-source-radio</property>
492 </object>
493 <packing>
494 <property name="expand">False</property>
495 <property name="fill">True</property>
496 <property name="position">3</property>
497 </packing>
498 </child>
434 </object>499 </object>
435 <packing>500 <packing>
436 <property name="expand">False</property>501 <property name="expand">True</property>
437 <property name="fill">True</property>502 <property name="fill">True</property>
438 <property name="position">4</property>503 <property name="position">4</property>
439 </packing>504 </packing>
440 </child>505 </child>
441 <child>506 <child>
442 <object class="GtkRadioButton" id="different-source-radio">507 <object class="GtkGrid" id="ibus-grid">
443 <property name="label" translatable="yes">Allow different sources for each window</property>
444 <property name="visible">True</property>
445 <property name="can_focus">False</property>
446 <property name="receives_default">False</property>
447 <property name="xalign">0</property>
448 <property name="active">True</property>
449 <property name="draw_indicator">True</property>
450 <property name="group">same-source-radio</property>
451 </object>
452 <packing>
453 <property name="expand">False</property>
454 <property name="fill">True</property>
455 <property name="position">5</property>
456 </packing>
457 </child>
458 <child>
459 <object class="GtkRadioButton" id="default-source-radio">
460 <property name="label" translatable="yes">New windows use the default source</property>
461 <property name="visible">True</property>
462 <property name="can_focus">False</property>
463 <property name="receives_default">False</property>
464 <property name="margin_left">25</property>
465 <property name="xalign">0</property>
466 <property name="active">True</property>
467 <property name="draw_indicator">True</property>
468 </object>
469 <packing>
470 <property name="expand">False</property>
471 <property name="fill">True</property>
472 <property name="position">6</property>
473 </packing>
474 </child>
475 <child>
476 <object class="GtkRadioButton" id="current-source-radio">
477 <property name="label" translatable="yes">New windows use the current source</property>
478 <property name="visible">True</property>
479 <property name="can_focus">False</property>
480 <property name="receives_default">False</property>
481 <property name="margin_left">25</property>
482 <property name="margin_bottom">15</property>
483 <property name="xalign">0</property>
484 <property name="active">True</property>
485 <property name="draw_indicator">True</property>
486 <property name="group">default-source-radio</property>
487 </object>
488 <packing>
489 <property name="expand">False</property>
490 <property name="fill">True</property>
491 <property name="position">7</property>
492 </packing>
493 </child>
494 <child>
495 <object class="GtkGrid" id="grid1">
496 <property name="visible">True</property>508 <property name="visible">True</property>
497 <property name="can_focus">False</property>509 <property name="can_focus">False</property>
498 <child>510 <child>
@@ -570,7 +582,7 @@
570 <packing>582 <packing>
571 <property name="expand">False</property>583 <property name="expand">False</property>
572 <property name="fill">True</property>584 <property name="fill">True</property>
573 <property name="position">8</property>585 <property name="position">5</property>
574 </packing>586 </packing>
575 </child>587 </child>
576 </object>588 </object>
@@ -626,7 +638,7 @@
626 </child>638 </child>
627 </object>639 </object>
628 <packing>640 <packing>
629 <property name="expand">True</property>641 <property name="expand">False</property>
630 <property name="fill">True</property>642 <property name="fill">True</property>
631 <property name="position">1</property>643 <property name="position">1</property>
632 </packing>644 </packing>
633645
=== modified file 'po/POTFILES.in'
--- po/POTFILES.in 2014-02-21 18:13:23 +0000
+++ po/POTFILES.in 2015-02-12 16:27:19 +0000
@@ -75,7 +75,8 @@
75panels/printers/pp-ppd-selection-dialog.c75panels/printers/pp-ppd-selection-dialog.c
76[type: gettext/glade]panels/printers/printers.ui76[type: gettext/glade]panels/printers/printers.ui
77panels/region/unity-region-panel.desktop.in.in77panels/region/unity-region-panel.desktop.in.in
78[type: gettext/glade]panels/region/unity-region-panel.ui78[type: gettext/glade]panels/region/unity-region-panel-fcitx.ui
79[type: gettext/glade]panels/region/unity-region-panel-ibus.ui
79panels/region/gnome-region-panel-formats.c80panels/region/gnome-region-panel-formats.c
80[type: gettext/glade]panels/region/gnome-region-panel-input-chooser.ui81[type: gettext/glade]panels/region/gnome-region-panel-input-chooser.ui
81panels/region/gnome-region-panel-system.c82panels/region/gnome-region-panel-system.c

Subscribers

People subscribed via source and target branches