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
1=== modified file 'configure.ac'
2--- configure.ac 2014-08-29 10:26:05 +0000
3+++ configure.ac 2015-02-12 16:27:19 +0000
4@@ -86,6 +86,23 @@
5 IBUS_MODULE=
6 fi
7
8+# Fcitx support
9+
10+AC_ARG_ENABLE(fcitx,
11+ AS_HELP_STRING([--disable-fcitx],
12+ [Disable Fcitx support]),
13+ enable_fcitx=$enableval,
14+ enable_fcitx=yes)
15+
16+if test "x$enable_fcitx" = "xyes" ; then
17+ FCITX_MODULE="fcitx-config fcitx-gclient"
18+ AC_DEFINE(HAVE_FCITX, 1, [Defined if Fcitx support is enabled])
19+else
20+ FCITX_MODULE=
21+fi
22+
23+AM_CONDITIONAL(HAVE_FCITX, test "x$enable_fcitx" == "xyes")
24+
25 dnl ==============================================
26 dnl Check that we meet the dependencies
27 dnl ==============================================
28@@ -140,6 +157,7 @@
29 polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION
30 gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED_VERSION
31 $IBUS_MODULE
32+ $FCITX_MODULE
33 x11)
34 PKG_CHECK_MODULES(SCREEN_PANEL, $COMMON_MODULES)
35 PKG_CHECK_MODULES(SOUND_PANEL, $COMMON_MODULES libxml-2.0
36@@ -514,4 +532,9 @@
37 else
38 AC_MSG_NOTICE([ Region panel IBus support disabled])
39 fi
40+if test "x$enable_fcitx" == "xyes"; then
41+ AC_MSG_NOTICE([** Fcitx (Region panel Fcitx support)])
42+else
43+ AC_MSG_NOTICE([ Region panel Fcitx support disabled])
44+fi
45 AC_MSG_NOTICE([End options])
46
47=== modified file 'debian/control'
48--- debian/control 2015-02-03 12:17:16 +0000
49+++ debian/control 2015-02-12 16:27:19 +0000
50@@ -8,6 +8,7 @@
51 debhelper (>= 9),
52 dh-migrations,
53 desktop-file-utils,
54+ fcitx-libs-dev,
55 gtk-doc-tools,
56 gnome-common,
57 gnome-pkg-tools (>= 0.10),
58@@ -67,6 +68,7 @@
59 accountsservice,
60 apg,
61 desktop-file-utils,
62+ fcitx-data,
63 gkbd-capplet (>= 3.5.90),
64 gnome-desktop3-data,
65 adwaita-icon-theme,
66
67=== modified file 'panels/region/Makefile.am'
68--- panels/region/Makefile.am 2013-12-18 22:19:53 +0000
69+++ panels/region/Makefile.am 2015-02-12 16:27:19 +0000
70@@ -44,7 +44,8 @@
71 uidir = $(pkgdatadir)/ui
72 ui_DATA = \
73 gnome-region-panel.ui \
74- unity-region-panel.ui \
75+ unity-region-panel-ibus.ui \
76+ unity-region-panel-fcitx.ui \
77 gnome-region-panel-input-chooser.ui \
78 $(NULL)
79
80
81=== modified file 'panels/region/cc-region-panel.c'
82--- panels/region/cc-region-panel.c 2014-02-20 09:30:01 +0000
83+++ panels/region/cc-region-panel.c 2015-02-12 16:27:19 +0000
84@@ -57,6 +57,12 @@
85 }
86
87 static gboolean
88+is_fcitx_active (void)
89+{
90+ return g_strcmp0 (g_getenv ("GTK_IM_MODULE"), "fcitx") == 0;
91+}
92+
93+static gboolean
94 has_indicator_keyboard (void)
95 {
96 GSettingsSchema *schema;
97@@ -168,10 +174,17 @@
98
99 priv->builder = gtk_builder_new ();
100
101- if (has_indicator_keyboard ())
102- gtk_builder_add_from_file (priv->builder,
103- GNOMECC_UI_DIR "/unity-region-panel.ui",
104- &error);
105+ if (has_indicator_keyboard ()) {
106+ if (is_fcitx_active ()) {
107+ gtk_builder_add_from_file (priv->builder,
108+ GNOMECC_UI_DIR "/unity-region-panel-fcitx.ui",
109+ &error);
110+ } else {
111+ gtk_builder_add_from_file (priv->builder,
112+ GNOMECC_UI_DIR "/unity-region-panel-ibus.ui",
113+ &error);
114+ }
115+ }
116 else
117 gtk_builder_add_from_file (priv->builder,
118 GNOMECC_UI_DIR "/gnome-region-panel.ui",
119
120=== modified file 'panels/region/gnome-region-panel-input-chooser.ui'
121--- panels/region/gnome-region-panel-input-chooser.ui 2012-06-01 17:46:38 +0000
122+++ panels/region/gnome-region-panel-input-chooser.ui 2015-02-12 16:27:19 +0000
123@@ -9,6 +9,8 @@
124 <column type="gchararray"/>
125 <!-- type specific identifier -->
126 <column type="gchararray"/>
127+ <!-- text colour -->
128+ <column type="GdkRGBA"/>
129 </columns>
130 </object>
131 <object class="GtkTreeModelFilter" id="filtered_input_source_model">
132
133=== modified file 'panels/region/gnome-region-panel-input.c'
134--- panels/region/gnome-region-panel-input.c 2014-03-07 18:13:40 +0000
135+++ panels/region/gnome-region-panel-input.c 2015-02-12 16:27:19 +0000
136@@ -34,6 +34,12 @@
137 #include <ibus.h>
138 #endif
139
140+#ifdef HAVE_FCITX
141+#include <fcitx-config/fcitx-config.h>
142+#include <fcitx-gclient/fcitxinputmethod.h>
143+#include <fcitx-gclient/fcitxkbd.h>
144+#endif
145+
146 #include "gdm-languages.h"
147 #include "gnome-region-panel-input.h"
148 #include "keyboard-shortcuts.h"
149@@ -46,6 +52,12 @@
150 #define KEY_INPUT_SOURCES "sources"
151 #define INPUT_SOURCE_TYPE_XKB "xkb"
152 #define INPUT_SOURCE_TYPE_IBUS "ibus"
153+#define INPUT_SOURCE_TYPE_FCITX "fcitx"
154+#define FCITX_XKB_PREFIX "fcitx-keyboard-"
155+
156+#define ENV_GTK_IM_MODULE "GTK_IM_MODULE"
157+#define GTK_IM_MODULE_IBUS "ibus"
158+#define GTK_IM_MODULE_FCITX "fcitx"
159
160 #define MEDIA_KEYS_SCHEMA_ID "org.gnome.desktop.wm.keybindings"
161 #define KEY_PREV_INPUT_SOURCE "switch-input-source-backward"
162@@ -71,6 +83,7 @@
163 NAME_COLUMN,
164 TYPE_COLUMN,
165 ID_COLUMN,
166+ COLOUR_COLUMN,
167 SETUP_COLUMN,
168 LEGACY_SETUP_COLUMN,
169 N_COLUMNS
170@@ -86,15 +99,41 @@
171 static GtkWidget *input_chooser = NULL; /* weak pointer */
172 static CcRegionKeyboardItem *prev_source_item = NULL;
173 static CcRegionKeyboardItem *next_source_item = NULL;
174+static GdkRGBA active_colour;
175+static GdkRGBA inactive_colour;
176
177 #ifdef HAVE_IBUS
178 static IBusBus *ibus = NULL;
179 static GHashTable *ibus_engines = NULL;
180 static GCancellable *ibus_cancellable = NULL;
181 static guint shell_name_watch_id = 0;
182-
183+static gboolean is_ibus_active = FALSE;
184 #endif /* HAVE_IBUS */
185
186+#ifdef HAVE_FCITX
187+static FcitxInputMethod *fcitx = NULL;
188+static FcitxKbd *fcitx_keyboard = NULL;
189+static GHashTable *fcitx_engines = NULL;
190+static GCancellable *fcitx_cancellable = NULL;
191+static gboolean is_fcitx_active = FALSE;
192+
193+struct _FcitxShareStateConfig
194+{
195+ FcitxGenericConfig config;
196+ gint share_state;
197+};
198+
199+typedef struct _FcitxShareStateConfig FcitxShareStateConfig;
200+
201+static CONFIG_BINDING_BEGIN (FcitxShareStateConfig)
202+CONFIG_BINDING_REGISTER ("Program", "ShareStateAmongWindow", share_state)
203+CONFIG_BINDING_END ()
204+
205+static CONFIG_DESC_DEFINE (get_fcitx_config_desc, "config.desc")
206+
207+static FcitxShareStateConfig fcitx_config;
208+#endif /* HAVE_FCITX */
209+
210 static void populate_model (GtkListStore *store,
211 GtkListStore *active_sources_store);
212 static GtkWidget *input_chooser_new (GtkWindow *main_window,
213@@ -439,19 +478,23 @@
214 GDesktopAppInfo *app_info = NULL;
215 gchar *legacy_setup = NULL;
216 gchar *display_name = NULL;
217+ gchar *name = NULL;
218
219 engine_desc = g_hash_table_lookup (ibus_engines, id);
220 if (engine_desc)
221 {
222 display_name = engine_get_display_name (engine_desc);
223+ name = g_strdup_printf ("%s (IBus)", display_name);
224 app_info = setup_app_info_for_id (id);
225 legacy_setup = legacy_setup_for_id (id);
226
227 gtk_list_store_set (GTK_LIST_STORE (model), &iter,
228- NAME_COLUMN, display_name,
229+ NAME_COLUMN, name,
230+ COLOUR_COLUMN, is_ibus_active ? &active_colour : &inactive_colour,
231 SETUP_COLUMN, app_info,
232 LEGACY_SETUP_COLUMN, legacy_setup,
233 -1);
234+ g_free (name);
235 g_free (display_name);
236 g_free (legacy_setup);
237 if (app_info)
238@@ -597,7 +640,11 @@
239
240 fetch_ibus_engines (builder);
241
242+#ifdef HAVE_FCITX
243+ if (has_indicator_keyboard () && !is_fcitx_active)
244+#else
245 if (has_indicator_keyboard ())
246+#endif
247 update_source_radios (builder);
248
249 /* We've got everything we needed, don't want to be called again. */
250@@ -681,6 +728,7 @@
251 NAME_COLUMN, name,
252 TYPE_COLUMN, INPUT_SOURCE_TYPE_XKB,
253 ID_COLUMN, tmp->data,
254+ COLOUR_COLUMN, &active_colour,
255 -1);
256 }
257 g_free (source_id);
258@@ -691,6 +739,7 @@
259 if (ibus_engines)
260 {
261 gchar *display_name;
262+ gchar *name;
263
264 sources = g_hash_table_get_keys (ibus_engines);
265
266@@ -704,13 +753,16 @@
267 continue;
268
269 display_name = engine_get_display_name (g_hash_table_lookup (ibus_engines, tmp->data));
270+ name = g_strdup_printf ("%s (IBus)", display_name);
271
272 gtk_list_store_append (store, &iter);
273 gtk_list_store_set (store, &iter,
274- NAME_COLUMN, display_name,
275+ NAME_COLUMN, name,
276 TYPE_COLUMN, INPUT_SOURCE_TYPE_IBUS,
277 ID_COLUMN, tmp->data,
278+ COLOUR_COLUMN, is_ibus_active ? &active_colour : &inactive_colour,
279 -1);
280+ g_free (name);
281 g_free (display_name);
282 }
283 g_free (source_id);
284@@ -719,6 +771,44 @@
285 }
286 #endif
287
288+#ifdef HAVE_FCITX
289+ if (fcitx_engines)
290+ {
291+ GHashTableIter engines_iter;
292+ gpointer key;
293+ gpointer value;
294+
295+ g_hash_table_iter_init (&engines_iter, fcitx_engines);
296+ while (g_hash_table_iter_next (&engines_iter, &key, &value))
297+ {
298+ const gchar *id = key;
299+ const FcitxIMItem *engine = value;
300+
301+ if (g_str_has_prefix (id, FCITX_XKB_PREFIX))
302+ continue;
303+
304+ source_id = g_strconcat (INPUT_SOURCE_TYPE_FCITX, id, NULL);
305+
306+ if (!g_hash_table_contains (active_sources_table, source_id))
307+ {
308+ gchar *name = g_strdup_printf ("%s (Fcitx)", engine->name);
309+
310+ gtk_list_store_append (store, &iter);
311+ gtk_list_store_set (store, &iter,
312+ TYPE_COLUMN, INPUT_SOURCE_TYPE_FCITX,
313+ ID_COLUMN, id,
314+ NAME_COLUMN, name,
315+ COLOUR_COLUMN, is_fcitx_active ? &active_colour : &inactive_colour,
316+ -1);
317+
318+ g_free (name);
319+ }
320+
321+ g_free (source_id);
322+ }
323+ }
324+#endif
325+
326 g_hash_table_destroy (active_sources_table);
327 }
328
329@@ -734,6 +824,7 @@
330 GDesktopAppInfo *app_info;
331 gchar *legacy_setup;
332 GtkTreeIter tree_iter;
333+ gboolean active;
334
335 sources = g_settings_get_value (input_sources_settings, KEY_INPUT_SOURCES);
336
337@@ -743,6 +834,7 @@
338 display_name = NULL;
339 app_info = NULL;
340 legacy_setup = NULL;
341+ active = FALSE;
342
343 if (g_str_equal (type, INPUT_SOURCE_TYPE_XKB))
344 {
345@@ -753,6 +845,7 @@
346 continue;
347 }
348 display_name = g_strdup (name);
349+ active = TRUE;
350 }
351 else if (g_str_equal (type, INPUT_SOURCE_TYPE_IBUS))
352 {
353@@ -764,15 +857,36 @@
354
355 if (engine_desc)
356 {
357- display_name = engine_get_display_name (engine_desc);
358+ gchar *engine_name = engine_get_display_name (engine_desc);
359+ display_name = g_strdup_printf ("%s (IBus)", engine_name);
360 app_info = setup_app_info_for_id (id);
361 legacy_setup = legacy_setup_for_id (id);
362+ active = is_ibus_active;
363+ g_free (engine_name);
364 }
365 #else
366 g_warning ("IBus input source type specified but IBus support was not compiled");
367 continue;
368 #endif
369 }
370+ else if (g_str_equal (type, INPUT_SOURCE_TYPE_FCITX))
371+ {
372+#ifdef HAVE_FCITX
373+ if (fcitx_engines)
374+ {
375+ const FcitxIMItem *engine = g_hash_table_lookup (fcitx_engines, id);
376+
377+ if (engine)
378+ {
379+ display_name = g_strdup_printf ("%s (Fcitx)", engine->name);
380+ active = is_fcitx_active;
381+ }
382+ }
383+#else
384+ g_warning ("Fcitx input source type specified but Fcitx support was not compiled");
385+ continue;
386+#endif
387+ }
388 else
389 {
390 g_warning ("Unknown input source type '%s'", type);
391@@ -784,6 +898,7 @@
392 NAME_COLUMN, display_name,
393 TYPE_COLUMN, type,
394 ID_COLUMN, id,
395+ COLOUR_COLUMN, active ? &active_colour : &inactive_colour,
396 SETUP_COLUMN, app_info,
397 LEGACY_SETUP_COLUMN, legacy_setup,
398 -1);
399@@ -901,6 +1016,7 @@
400 gboolean settings_sensitive;
401 GDesktopAppInfo *app_info;
402 gchar *legacy_setup;
403+ gchar *type;
404
405 remove_button = WID("input_source_remove");
406 show_button = WID("input_source_show");
407@@ -915,6 +1031,7 @@
408 {
409 index = idx_from_model_iter (model, &iter);
410 gtk_tree_model_get (model, &iter,
411+ TYPE_COLUMN, &type,
412 SETUP_COLUMN, &app_info,
413 LEGACY_SETUP_COLUMN, &legacy_setup,
414 -1);
415@@ -922,11 +1039,16 @@
416 else
417 {
418 index = -1;
419+ type = NULL;
420 app_info = NULL;
421 legacy_setup = NULL;
422 }
423
424+#ifdef HAVE_FCITX
425+ settings_sensitive = (index >= 0 && (app_info != NULL || legacy_setup != NULL || g_strcmp0 (type, INPUT_SOURCE_TYPE_FCITX) == 0));
426+#else
427 settings_sensitive = (index >= 0 && (app_info != NULL || legacy_setup != NULL));
428+#endif
429
430 if (app_info)
431 g_object_unref (app_info);
432@@ -1171,6 +1293,8 @@
433 gchar *kbd_viewer_args;
434 const gchar *xkb_layout;
435 const gchar *xkb_variant;
436+ gchar *layout = NULL;
437+ gchar *variant = NULL;
438
439 g_debug ("show selected layout");
440
441@@ -1215,22 +1339,40 @@
442 goto exit;
443 #endif
444 }
445+ else if (g_str_equal (type, INPUT_SOURCE_TYPE_FCITX))
446+ {
447+#ifdef HAVE_FCITX
448+ if (fcitx_keyboard)
449+ {
450+ fcitx_kbd_get_layout_for_im (fcitx_keyboard, id, &layout, &variant);
451+ xkb_layout = layout;
452+ xkb_variant = variant;
453+ }
454+#else
455+ g_warning ("Fcitx input source type specified but Fcitx support was not compiled");
456+ goto exit;
457+#endif
458+ }
459 else
460 {
461 g_warning ("Unknown input source type '%s'", type);
462 goto exit;
463 }
464
465- if (xkb_variant[0])
466+ if (xkb_variant != NULL && xkb_variant[0])
467 kbd_viewer_args = g_strdup_printf ("gkbd-keyboard-display -l \"%s\t%s\"",
468 xkb_layout, xkb_variant);
469- else
470+ else if (xkb_layout != NULL && xkb_layout[0])
471 kbd_viewer_args = g_strdup_printf ("gkbd-keyboard-display -l %s",
472 xkb_layout);
473+ else
474+ kbd_viewer_args = g_strdup ("gkbd-keyboard-display -g 1");
475
476 g_spawn_command_line_async (kbd_viewer_args, NULL);
477
478 g_free (kbd_viewer_args);
479+ g_free (variant);
480+ g_free (layout);
481 exit:
482 g_free (type);
483 g_free (id);
484@@ -1245,6 +1387,7 @@
485 GdkAppLaunchContext *ctx;
486 GDesktopAppInfo *app_info;
487 gchar *legacy_setup;
488+ gchar *type;
489 gchar *id;
490 GError *error = NULL;
491
492@@ -1253,18 +1396,21 @@
493 if (!get_selected_iter (builder, &model, &iter))
494 return;
495
496- gtk_tree_model_get (model, &iter, SETUP_COLUMN, &app_info, LEGACY_SETUP_COLUMN, &legacy_setup, -1);
497+ gtk_tree_model_get (model, &iter,
498+ ID_COLUMN, &id,
499+ TYPE_COLUMN, &type,
500+ SETUP_COLUMN, &app_info,
501+ LEGACY_SETUP_COLUMN, &legacy_setup,
502+ -1);
503
504 if (app_info)
505 {
506 ctx = gdk_display_get_app_launch_context (gdk_display_get_default ());
507 gdk_app_launch_context_set_timestamp (ctx, gtk_get_current_event_time ());
508
509- gtk_tree_model_get (model, &iter, ID_COLUMN, &id, -1);
510 g_app_launch_context_setenv (G_APP_LAUNCH_CONTEXT (ctx),
511 "IBUS_ENGINE_NAME",
512 id);
513- g_free (id);
514
515 if (!g_app_info_launch (G_APP_INFO (app_info), NULL, G_APP_LAUNCH_CONTEXT (ctx), &error))
516 {
517@@ -1283,6 +1429,10 @@
518 g_error_free (error);
519 }
520 }
521+#ifdef HAVE_FCITX
522+ else if (g_strcmp0 (type, INPUT_SOURCE_TYPE_FCITX) == 0 && fcitx)
523+ fcitx_input_method_configure_im (fcitx, id);
524+#endif
525
526 g_free (legacy_setup);
527 }
528@@ -1386,7 +1536,11 @@
529 gchar *key,
530 gpointer user_data)
531 {
532+#ifdef HAVE_FCITX
533+ if (!is_fcitx_active && (g_strcmp0 (key, KEY_GROUP_PER_WINDOW) == 0 || g_strcmp0 (key, KEY_DEFAULT_GROUP) == 0))
534+#else
535 if (g_strcmp0 (key, KEY_GROUP_PER_WINDOW) == 0 || g_strcmp0 (key, KEY_DEFAULT_GROUP) == 0)
536+#endif
537 update_source_radios (user_data);
538 }
539
540@@ -1451,6 +1605,22 @@
541 return edited ? GTK_ENTRY_ACCEL_UPDATE : GTK_ENTRY_ACCEL_IGNORE;
542 }
543
544+#ifdef HAVE_FCITX
545+static void
546+clear_fcitx (void)
547+{
548+ FcitxConfigFree (&fcitx_config.config);
549+
550+ if (fcitx_cancellable)
551+ g_cancellable_cancel (fcitx_cancellable);
552+
553+ g_clear_pointer (&fcitx_engines, g_hash_table_unref);
554+ g_clear_object (&fcitx_cancellable);
555+ g_clear_object (&fcitx_keyboard);
556+ g_clear_object (&fcitx);
557+}
558+#endif
559+
560 static void
561 builder_finalized (gpointer data,
562 GObject *where_the_object_was)
563@@ -1465,6 +1635,10 @@
564 g_clear_object (&next_source_item);
565 g_clear_object (&prev_source_item);
566
567+#ifdef HAVE_FCITX
568+ clear_fcitx ();
569+#endif
570+
571 #ifdef HAVE_IBUS
572 clear_ibus ();
573 #endif
574@@ -1502,6 +1676,113 @@
575 return ret;
576 }
577
578+#ifdef HAVE_FCITX
579+static void
580+fcitx_init (void)
581+{
582+ GError *error = NULL;
583+
584+ fcitx_cancellable = g_cancellable_new ();
585+ fcitx = fcitx_input_method_new (G_BUS_TYPE_SESSION,
586+ G_DBUS_PROXY_FLAGS_NONE,
587+ 0,
588+ fcitx_cancellable,
589+ &error);
590+ g_clear_object (&fcitx_cancellable);
591+
592+ if (fcitx)
593+ {
594+ GPtrArray *engines = fcitx_input_method_get_imlist_nofree (fcitx);
595+
596+ if (engines)
597+ {
598+ guint i;
599+
600+ fcitx_engines = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) fcitx_im_item_free);
601+
602+ for (i = 0; i < engines->len; i++)
603+ {
604+ FcitxIMItem *engine = g_ptr_array_index (engines, i);
605+ g_hash_table_insert (fcitx_engines, engine->unique_name, engine);
606+ }
607+
608+ g_ptr_array_unref (engines);
609+ }
610+ }
611+ else
612+ {
613+ g_warning ("Fcitx input method framework unavailable: %s", error->message);
614+ g_clear_error (&error);
615+ }
616+
617+ fcitx_cancellable = g_cancellable_new ();
618+ fcitx_keyboard = fcitx_kbd_new (G_BUS_TYPE_SESSION,
619+ G_DBUS_PROXY_FLAGS_NONE,
620+ 0,
621+ fcitx_cancellable,
622+ &error);
623+ g_clear_object (&fcitx_cancellable);
624+
625+ if (!fcitx_keyboard)
626+ {
627+ g_warning ("Fcitx keyboard module unavailable: %s", error->message);
628+ g_clear_error (&error);
629+ }
630+}
631+
632+static void
633+save_fcitx_config (void)
634+{
635+ FILE *file = FcitxXDGGetFileUserWithPrefix (NULL, "config", "w", NULL);
636+ FcitxConfigSaveConfigFileFp (file, &fcitx_config.config, get_fcitx_config_desc ());
637+
638+ if (file)
639+ fclose (file);
640+
641+ fcitx_input_method_reload_config (fcitx);
642+}
643+
644+static void
645+load_fcitx_config (void)
646+{
647+ static gboolean loaded = FALSE;
648+
649+ if (loaded)
650+ return;
651+
652+ FILE *file = FcitxXDGGetFileUserWithPrefix (NULL, "config", "r", NULL);
653+ FcitxConfigFile *config_file = FcitxConfigParseConfigFileFp (file, get_fcitx_config_desc ());
654+ FcitxShareStateConfigConfigBind (&fcitx_config, config_file, get_fcitx_config_desc ());
655+ FcitxConfigBindSync (&fcitx_config.config);
656+
657+ if (file)
658+ fclose (file);
659+
660+ loaded = TRUE;
661+}
662+
663+static void
664+set_share_state (gint share_state)
665+{
666+ if (share_state != fcitx_config.share_state)
667+ {
668+ fcitx_config.share_state = share_state;
669+ save_fcitx_config ();
670+ }
671+}
672+
673+static void
674+share_state_radio_toggled (GtkToggleButton *widget,
675+ gpointer user_data)
676+{
677+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("share-state-no-radio"))))
678+ set_share_state (0);
679+ else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("share-state-all-radio"))))
680+ set_share_state (1);
681+ else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("share-state-per-program-radio"))))
682+ set_share_state (2);
683+}
684+#endif
685
686 void
687 setup_input_tabs (GtkBuilder *builder_,
688@@ -1513,6 +1794,8 @@
689 GtkListStore *store;
690 GtkTreeModel *filtered_store;
691 GtkTreeSelection *selection;
692+ GtkStyleContext *context;
693+ const gchar *module;
694
695 builder = builder_;
696
697@@ -1531,12 +1814,14 @@
698 cell = gtk_cell_renderer_text_new ();
699 gtk_tree_view_column_pack_start (column, cell, TRUE);
700 gtk_tree_view_column_add_attribute (column, cell, "text", NAME_COLUMN);
701+ gtk_tree_view_column_add_attribute (column, cell, "foreground-rgba", COLOUR_COLUMN);
702 gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
703
704 store = gtk_list_store_new (N_COLUMNS,
705 G_TYPE_STRING,
706 G_TYPE_STRING,
707 G_TYPE_STRING,
708+ GDK_TYPE_RGBA,
709 G_TYPE_DESKTOP_APP_INFO,
710 G_TYPE_STRING);
711
712@@ -1549,8 +1834,15 @@
713 if (!xkb_info)
714 xkb_info = gnome_xkb_info_new ();
715
716+ context = gtk_widget_get_style_context (treeview);
717+ gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &active_colour);
718+ gtk_style_context_get_color (context, GTK_STATE_FLAG_INSENSITIVE, &inactive_colour);
719+
720+ module = g_getenv (ENV_GTK_IM_MODULE);
721+
722 #ifdef HAVE_IBUS
723 ibus_init ();
724+ is_ibus_active = g_strcmp0 (module, GTK_IM_MODULE_IBUS) == 0;
725 shell_name_watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
726 "org.gnome.Shell",
727 G_BUS_NAME_WATCHER_FLAGS_NONE,
728@@ -1560,6 +1852,11 @@
729 NULL);
730 #endif
731
732+#ifdef HAVE_FCITX
733+ fcitx_init ();
734+ is_fcitx_active = g_strcmp0 (module, GTK_IM_MODULE_FCITX) == 0;
735+#endif
736+
737 populate_with_active_sources (store);
738
739 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
740@@ -1604,33 +1901,73 @@
741 media_key_settings = g_settings_new (MEDIA_KEYS_SCHEMA_ID);
742 indicator_settings = g_settings_new (INDICATOR_KEYBOARD_SCHEMA_ID);
743
744- update_source_radios (builder);
745-
746 g_settings_bind (indicator_settings,
747 KEY_VISIBLE,
748 WID ("show-indicator-check"),
749 "active",
750 G_SETTINGS_BIND_DEFAULT);
751- g_settings_bind (ibus_panel_settings,
752- IBUS_ORIENTATION_KEY,
753- WID ("orientation-combo"),
754- "active",
755- G_SETTINGS_BIND_DEFAULT);
756- g_settings_bind (ibus_panel_settings,
757- IBUS_USE_CUSTOM_FONT_KEY,
758- WID ("custom-font-check"),
759- "active",
760- G_SETTINGS_BIND_DEFAULT);
761- g_settings_bind (ibus_panel_settings,
762- IBUS_USE_CUSTOM_FONT_KEY,
763- WID ("custom-font-button"),
764- "sensitive",
765- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY);
766- g_settings_bind (ibus_panel_settings,
767- IBUS_CUSTOM_FONT_KEY,
768- WID ("custom-font-button"),
769- "font-name",
770- G_SETTINGS_BIND_DEFAULT | G_SETTINGS_BIND_NO_SENSITIVITY);
771+
772+#ifdef HAVE_FCITX
773+ if (is_fcitx_active)
774+ {
775+ load_fcitx_config ();
776+
777+ switch (fcitx_config.share_state)
778+ {
779+ case 0:
780+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("share-state-no-radio")), TRUE);
781+ break;
782+ case 1:
783+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("share-state-all-radio")), TRUE);
784+ break;
785+ case 2:
786+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("share-state-per-program-radio")), TRUE);
787+ break;
788+ }
789+
790+ g_signal_connect (WID ("share-state-all-radio"), "toggled",
791+ G_CALLBACK (share_state_radio_toggled), builder);
792+ g_signal_connect (WID ("share-state-no-radio"), "toggled",
793+ G_CALLBACK (share_state_radio_toggled), builder);
794+ g_signal_connect (WID ("share-state-per-program-radio"), "toggled",
795+ G_CALLBACK (share_state_radio_toggled), builder);
796+ }
797+ else
798+#endif /* HAVE_FCITX */
799+ {
800+ update_source_radios (builder);
801+
802+ g_settings_bind (ibus_panel_settings,
803+ IBUS_ORIENTATION_KEY,
804+ WID ("orientation-combo"),
805+ "active",
806+ G_SETTINGS_BIND_DEFAULT);
807+ g_settings_bind (ibus_panel_settings,
808+ IBUS_USE_CUSTOM_FONT_KEY,
809+ WID ("custom-font-check"),
810+ "active",
811+ G_SETTINGS_BIND_DEFAULT);
812+ g_settings_bind (ibus_panel_settings,
813+ IBUS_USE_CUSTOM_FONT_KEY,
814+ WID ("custom-font-button"),
815+ "sensitive",
816+ G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY);
817+ g_settings_bind (ibus_panel_settings,
818+ IBUS_CUSTOM_FONT_KEY,
819+ WID ("custom-font-button"),
820+ "font-name",
821+ G_SETTINGS_BIND_DEFAULT | G_SETTINGS_BIND_NO_SENSITIVITY);
822+
823+ g_signal_connect (WID ("same-source-radio"), "toggled",
824+ G_CALLBACK (source_radio_toggled), builder);
825+ g_signal_connect (WID ("different-source-radio"), "toggled",
826+ G_CALLBACK (source_radio_toggled), builder);
827+ g_signal_connect (WID ("default-source-radio"), "toggled",
828+ G_CALLBACK (source_radio_toggled), builder);
829+ g_signal_connect (WID ("current-source-radio"), "toggled",
830+ G_CALLBACK (source_radio_toggled), builder);
831+ }
832+
833 g_settings_bind_with_mapping (media_key_settings,
834 KEY_PREV_INPUT_SOURCE,
835 WID ("prev-source-entry"),
836@@ -1652,14 +1989,6 @@
837 G_CALLBACK (shortcut_key_pressed), builder);
838 g_signal_connect (WID ("next-source-entry"), "key-pressed",
839 G_CALLBACK (shortcut_key_pressed), builder);
840- g_signal_connect (WID ("same-source-radio"), "toggled",
841- G_CALLBACK (source_radio_toggled), builder);
842- g_signal_connect (WID ("different-source-radio"), "toggled",
843- G_CALLBACK (source_radio_toggled), builder);
844- g_signal_connect (WID ("default-source-radio"), "toggled",
845- G_CALLBACK (source_radio_toggled), builder);
846- g_signal_connect (WID ("current-source-radio"), "toggled",
847- G_CALLBACK (source_radio_toggled), builder);
848 g_signal_connect (libgnomekbd_settings,
849 "changed",
850 G_CALLBACK (libgnomekbd_settings_changed),
851@@ -1848,6 +2177,7 @@
852 gtk_tree_view_column_new_with_attributes ("Input Sources",
853 gtk_cell_renderer_text_new (),
854 "text", NAME_COLUMN,
855+ "foreground-rgba", COLOUR_COLUMN,
856 NULL);
857
858 gtk_window_set_transient_for (GTK_WINDOW (chooser), main_window);
859
860=== added file 'panels/region/unity-region-panel-fcitx.ui'
861--- panels/region/unity-region-panel-fcitx.ui 1970-01-01 00:00:00 +0000
862+++ panels/region/unity-region-panel-fcitx.ui 2015-02-12 16:27:19 +0000
863@@ -0,0 +1,560 @@
864+<?xml version="1.0" encoding="UTF-8"?>
865+<interface>
866+ <!-- interface-requires gtk+ 3.0 -->
867+ <object class="GtkAdjustment" id="adjustment1">
868+ <property name="lower">100</property>
869+ <property name="upper">2000</property>
870+ <property name="value">500</property>
871+ <property name="step_increment">10</property>
872+ <property name="page_increment">10</property>
873+ </object>
874+ <object class="GtkAdjustment" id="adjustment10">
875+ <property name="lower">1</property>
876+ <property name="upper">100000</property>
877+ <property name="value">1</property>
878+ <property name="step_increment">1</property>
879+ <property name="page_increment">10</property>
880+ </object>
881+ <object class="GtkAdjustment" id="adjustment2">
882+ <property name="lower">10</property>
883+ <property name="upper">110</property>
884+ <property name="value">30</property>
885+ <property name="step_increment">10</property>
886+ <property name="page_increment">10</property>
887+ </object>
888+ <object class="GtkAdjustment" id="adjustment3">
889+ <property name="lower">100</property>
890+ <property name="upper">2500</property>
891+ <property name="value">1000</property>
892+ <property name="step_increment">200</property>
893+ <property name="page_increment">200</property>
894+ </object>
895+ <object class="GtkAdjustment" id="adjustment4">
896+ <property name="upper">500</property>
897+ <property name="value">0.5</property>
898+ <property name="step_increment">10</property>
899+ <property name="page_increment">10</property>
900+ </object>
901+ <object class="GtkAdjustment" id="adjustment5">
902+ <property name="upper">900</property>
903+ <property name="value">0.5</property>
904+ <property name="step_increment">10</property>
905+ <property name="page_increment">10</property>
906+ </object>
907+ <object class="GtkAdjustment" id="adjustment6">
908+ <property name="upper">3000</property>
909+ <property name="value">1800</property>
910+ <property name="step_increment">10</property>
911+ <property name="page_increment">10</property>
912+ </object>
913+ <object class="GtkAdjustment" id="adjustment7">
914+ <property name="lower">10</property>
915+ <property name="upper">1000</property>
916+ <property name="value">300</property>
917+ <property name="step_increment">10</property>
918+ <property name="page_increment">10</property>
919+ </object>
920+ <object class="GtkAdjustment" id="adjustment8">
921+ <property name="lower">10</property>
922+ <property name="upper">2000</property>
923+ <property name="value">300</property>
924+ <property name="step_increment">10</property>
925+ <property name="page_increment">10</property>
926+ </object>
927+ <object class="GtkAdjustment" id="adjustment9">
928+ <property name="lower">1</property>
929+ <property name="upper">100000</property>
930+ <property name="value">1</property>
931+ <property name="step_increment">1</property>
932+ <property name="page_increment">10</property>
933+ </object>
934+ <object class="GtkListStore" id="display_language_liststore"/>
935+ <object class="GtkDialog" id="region_dialog">
936+ <property name="can_focus">False</property>
937+ <property name="border_width">5</property>
938+ <property name="title" translatable="yes">Region and Language</property>
939+ <property name="default_width">600</property>
940+ <property name="default_height">430</property>
941+ <property name="type_hint">dialog</property>
942+ <child internal-child="vbox">
943+ <object class="GtkBox" id="dialog-vbox1">
944+ <property name="visible">True</property>
945+ <property name="can_focus">False</property>
946+ <property name="orientation">vertical</property>
947+ <property name="spacing">2</property>
948+ <child internal-child="action_area">
949+ <object class="GtkButtonBox" id="dialog-action_area1">
950+ <property name="can_focus">False</property>
951+ </object>
952+ <packing>
953+ <property name="expand">False</property>
954+ <property name="fill">True</property>
955+ <property name="pack_type">end</property>
956+ <property name="position">0</property>
957+ </packing>
958+ </child>
959+ <child>
960+ <object class="GtkVBox" id="region_vbox">
961+ <property name="visible">True</property>
962+ <property name="can_focus">False</property>
963+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
964+ <property name="border_width">5</property>
965+ <property name="spacing">12</property>
966+ <child>
967+ <object class="GtkVBox" id="vbox5">
968+ <property name="visible">True</property>
969+ <property name="can_focus">False</property>
970+ <property name="border_width">12</property>
971+ <property name="spacing">12</property>
972+ <child>
973+ <object class="GtkHBox" id="hbox3">
974+ <property name="visible">True</property>
975+ <property name="can_focus">False</property>
976+ <property name="spacing">12</property>
977+ <child>
978+ <object class="GtkVBox" id="vbox6">
979+ <property name="visible">True</property>
980+ <property name="can_focus">False</property>
981+ <property name="margin_right">5</property>
982+ <child>
983+ <object class="GtkLabel" id="label2">
984+ <property name="visible">True</property>
985+ <property name="can_focus">False</property>
986+ <property name="margin_bottom">5</property>
987+ <property name="xalign">0</property>
988+ <property name="label" translatable="yes">Input sources to use:</property>
989+ </object>
990+ <packing>
991+ <property name="expand">False</property>
992+ <property name="fill">True</property>
993+ <property name="position">0</property>
994+ </packing>
995+ </child>
996+ <child>
997+ <object class="GtkScrolledWindow" id="input_sources_swindow">
998+ <property name="visible">True</property>
999+ <property name="can_focus">True</property>
1000+ <property name="shadow_type">in</property>
1001+ <child>
1002+ <object class="GtkTreeView" id="active_input_sources">
1003+ <property name="visible">True</property>
1004+ <property name="can_focus">True</property>
1005+ <property name="headers_visible">False</property>
1006+ <child internal-child="selection">
1007+ <object class="GtkTreeSelection" id="treeview-selection3"/>
1008+ </child>
1009+ </object>
1010+ </child>
1011+ </object>
1012+ <packing>
1013+ <property name="expand">True</property>
1014+ <property name="fill">True</property>
1015+ <property name="position">1</property>
1016+ </packing>
1017+ </child>
1018+ <child>
1019+ <object class="GtkToolbar" id="input-toolbar">
1020+ <property name="visible">True</property>
1021+ <property name="can_focus">False</property>
1022+ <property name="toolbar_style">icons</property>
1023+ <property name="show_arrow">False</property>
1024+ <property name="icon_size">1</property>
1025+ <style>
1026+ <class name="inline-toolbar"/>
1027+ </style>
1028+ <child>
1029+ <object class="GtkToolItem" id="i_s_ar_item">
1030+ <property name="visible">True</property>
1031+ <property name="can_focus">False</property>
1032+ <child>
1033+ <object class="GtkBox" id="i_s_ar_box">
1034+ <property name="visible">True</property>
1035+ <property name="can_focus">False</property>
1036+ <child>
1037+ <object class="GtkButton" id="input_source_add">
1038+ <property name="visible">True</property>
1039+ <property name="can_focus">False</property>
1040+ <property name="receives_default">False</property>
1041+ <child>
1042+ <object class="GtkImage" id="i_s_a_image">
1043+ <property name="visible">True</property>
1044+ <property name="can_focus">False</property>
1045+ <property name="icon_name">list-add-symbolic</property>
1046+ <property name="icon-size">1</property>
1047+ </object>
1048+ </child>
1049+ </object>
1050+ <packing>
1051+ <property name="expand">False</property>
1052+ <property name="fill">True</property>
1053+ <property name="position">0</property>
1054+ </packing>
1055+ </child>
1056+ <child>
1057+ <object class="GtkButton" id="input_source_remove">
1058+ <property name="visible">True</property>
1059+ <property name="can_focus">False</property>
1060+ <property name="receives_default">False</property>
1061+ <child>
1062+ <object class="GtkImage" id="i_s_r_image">
1063+ <property name="visible">True</property>
1064+ <property name="can_focus">False</property>
1065+ <property name="icon_name">list-remove-symbolic</property>
1066+ <property name="icon-size">1</property>
1067+ </object>
1068+ </child>
1069+ </object>
1070+ <packing>
1071+ <property name="expand">False</property>
1072+ <property name="fill">True</property>
1073+ <property name="position">1</property>
1074+ </packing>
1075+ </child>
1076+ </object>
1077+ </child>
1078+ </object>
1079+ <packing>
1080+ <property name="expand">False</property>
1081+ </packing>
1082+ </child>
1083+ <child>
1084+ <object class="GtkSeparatorToolItem" id="sep1">
1085+ <property name="visible">True</property>
1086+ <property name="can_focus">False</property>
1087+ <property name="draw">False</property>
1088+ </object>
1089+ <packing>
1090+ <property name="expand">True</property>
1091+ </packing>
1092+ </child>
1093+ <child>
1094+ <object class="GtkToolItem" id="i_s_ud_item">
1095+ <property name="visible">True</property>
1096+ <property name="can_focus">False</property>
1097+ <child>
1098+ <object class="GtkBox" id="i_s_ud_box">
1099+ <property name="visible">True</property>
1100+ <property name="can_focus">False</property>
1101+ <child>
1102+ <object class="GtkButton" id="input_source_move_up">
1103+ <property name="visible">True</property>
1104+ <property name="can_focus">False</property>
1105+ <property name="receives_default">False</property>
1106+ <child>
1107+ <object class="GtkImage" id="i_s_u_image">
1108+ <property name="visible">True</property>
1109+ <property name="can_focus">False</property>
1110+ <property name="icon_name">go-up-symbolic</property>
1111+ <property name="icon-size">1</property>
1112+ </object>
1113+ </child>
1114+ </object>
1115+ <packing>
1116+ <property name="expand">False</property>
1117+ <property name="fill">True</property>
1118+ <property name="position">0</property>
1119+ </packing>
1120+ </child>
1121+ <child>
1122+ <object class="GtkButton" id="input_source_move_down">
1123+ <property name="visible">True</property>
1124+ <property name="can_focus">False</property>
1125+ <property name="receives_default">False</property>
1126+ <child>
1127+ <object class="GtkImage" id="i_s_d_image">
1128+ <property name="visible">True</property>
1129+ <property name="can_focus">False</property>
1130+ <property name="icon_name">go-down-symbolic</property>
1131+ <property name="icon-size">1</property>
1132+ </object>
1133+ </child>
1134+ </object>
1135+ <packing>
1136+ <property name="expand">False</property>
1137+ <property name="fill">True</property>
1138+ <property name="position">1</property>
1139+ </packing>
1140+ </child>
1141+ </object>
1142+ </child>
1143+ </object>
1144+ <packing>
1145+ <property name="expand">False</property>
1146+ </packing>
1147+ </child>
1148+ <child>
1149+ <object class="GtkSeparatorToolItem" id="sep2">
1150+ <property name="visible">True</property>
1151+ <property name="can_focus">False</property>
1152+ <property name="hexpand">True</property>
1153+ <property name="draw">False</property>
1154+ </object>
1155+ <packing>
1156+ <property name="expand">True</property>
1157+ </packing>
1158+ </child>
1159+ <child>
1160+ <object class="GtkToolItem" id="i_s_sp_item">
1161+ <property name="visible">True</property>
1162+ <property name="can_focus">False</property>
1163+ <child>
1164+ <object class="GtkBox" id="i_s_sp_box">
1165+ <property name="visible">True</property>
1166+ <property name="can_focus">False</property>
1167+ <child>
1168+ <object class="GtkButton" id="input_source_settings">
1169+ <property name="visible">True</property>
1170+ <property name="can_focus">False</property>
1171+ <property name="receives_default">False</property>
1172+ <child>
1173+ <object class="GtkImage" id="i_s_s_image">
1174+ <property name="visible">True</property>
1175+ <property name="can_focus">False</property>
1176+ <property name="pixel_size">16</property>
1177+ <property name="icon_name">preferences-system-symbolic</property>
1178+ <property name="icon-size">1</property>
1179+ </object>
1180+ </child>
1181+ </object>
1182+ <packing>
1183+ <property name="expand">False</property>
1184+ <property name="fill">True</property>
1185+ <property name="position">0</property>
1186+ </packing>
1187+ </child>
1188+ <child>
1189+ <object class="GtkButton" id="input_source_show">
1190+ <property name="visible">True</property>
1191+ <property name="can_focus">False</property>
1192+ <property name="receives_default">False</property>
1193+ <child>
1194+ <object class="GtkImage" id="i_s_p_image">
1195+ <property name="visible">True</property>
1196+ <property name="can_focus">False</property>
1197+ <property name="icon_name">input-keyboard-symbolic</property>
1198+ <property name="icon-size">1</property>
1199+ </object>
1200+ </child>
1201+ </object>
1202+ <packing>
1203+ <property name="expand">False</property>
1204+ <property name="fill">True</property>
1205+ <property name="position">1</property>
1206+ </packing>
1207+ </child>
1208+ </object>
1209+ </child>
1210+ </object>
1211+ <packing>
1212+ <property name="expand">False</property>
1213+ </packing>
1214+ </child>
1215+ </object>
1216+ <packing>
1217+ <property name="expand">False</property>
1218+ <property name="fill">True</property>
1219+ <property name="position">2</property>
1220+ </packing>
1221+ </child>
1222+ </object>
1223+ <packing>
1224+ <property name="expand">True</property>
1225+ <property name="fill">True</property>
1226+ <property name="position">0</property>
1227+ </packing>
1228+ </child>
1229+ <child>
1230+ <object class="GtkBox" id="box2">
1231+ <property name="visible">True</property>
1232+ <property name="can_focus">False</property>
1233+ <property name="orientation">vertical</property>
1234+ <child>
1235+ <object class="GtkLabel" id="label22">
1236+ <property name="visible">True</property>
1237+ <property name="can_focus">False</property>
1238+ <property name="margin_bottom">5</property>
1239+ <property name="xalign">0</property>
1240+ <property name="label" translatable="yes">Switch to next source using:</property>
1241+ </object>
1242+ <packing>
1243+ <property name="expand">False</property>
1244+ <property name="fill">True</property>
1245+ <property name="position">0</property>
1246+ </packing>
1247+ </child>
1248+ <child>
1249+ <object class="GtkEntryAccel" id="next-source-entry">
1250+ <property name="visible">True</property>
1251+ <property name="can_focus">True</property>
1252+ <property name="margin_bottom">5</property>
1253+ <property name="invisible_char">•</property>
1254+ </object>
1255+ <packing>
1256+ <property name="expand">False</property>
1257+ <property name="fill">True</property>
1258+ <property name="position">1</property>
1259+ </packing>
1260+ </child>
1261+ <child>
1262+ <object class="GtkLabel" id="label24">
1263+ <property name="visible">True</property>
1264+ <property name="can_focus">False</property>
1265+ <property name="margin_bottom">5</property>
1266+ <property name="xalign">0</property>
1267+ <property name="label" translatable="yes">Switch to previous source using:</property>
1268+ </object>
1269+ <packing>
1270+ <property name="expand">False</property>
1271+ <property name="fill">True</property>
1272+ <property name="position">2</property>
1273+ </packing>
1274+ </child>
1275+ <child>
1276+ <object class="GtkEntryAccel" id="prev-source-entry">
1277+ <property name="visible">True</property>
1278+ <property name="can_focus">True</property>
1279+ <property name="margin_bottom">15</property>
1280+ <property name="invisible_char">•</property>
1281+ </object>
1282+ <packing>
1283+ <property name="expand">False</property>
1284+ <property name="fill">True</property>
1285+ <property name="position">3</property>
1286+ </packing>
1287+ </child>
1288+ <child>
1289+ <object class="GtkBox" id="per-window-box">
1290+ <property name="visible">True</property>
1291+ <property name="can_focus">False</property>
1292+ <property name="orientation">vertical</property>
1293+ <child>
1294+ <object class="GtkRadioButton" id="share-state-all-radio">
1295+ <property name="label" translatable="yes">Use the same source for all windows</property>
1296+ <property name="visible">True</property>
1297+ <property name="can_focus">False</property>
1298+ <property name="receives_default">False</property>
1299+ <property name="xalign">0</property>
1300+ <property name="active">False</property>
1301+ <property name="draw_indicator">True</property>
1302+ </object>
1303+ <packing>
1304+ <property name="expand">False</property>
1305+ <property name="fill">True</property>
1306+ <property name="position">0</property>
1307+ </packing>
1308+ </child>
1309+ <child>
1310+ <object class="GtkRadioButton" id="share-state-no-radio">
1311+ <property name="label" translatable="yes">Allow different sources for each window</property>
1312+ <property name="visible">True</property>
1313+ <property name="can_focus">False</property>
1314+ <property name="receives_default">False</property>
1315+ <property name="xalign">0</property>
1316+ <property name="active">True</property>
1317+ <property name="draw_indicator">True</property>
1318+ <property name="group">share-state-all-radio</property>
1319+ </object>
1320+ <packing>
1321+ <property name="expand">False</property>
1322+ <property name="fill">True</property>
1323+ <property name="position">1</property>
1324+ </packing>
1325+ </child>
1326+ <child>
1327+ <object class="GtkRadioButton" id="share-state-per-program-radio">
1328+ <property name="label" translatable="yes">Allow different sources for each application</property>
1329+ <property name="visible">True</property>
1330+ <property name="can_focus">False</property>
1331+ <property name="receives_default">False</property>
1332+ <property name="xalign">0</property>
1333+ <property name="active">False</property>
1334+ <property name="draw_indicator">True</property>
1335+ <property name="group">share-state-all-radio</property>
1336+ </object>
1337+ <packing>
1338+ <property name="expand">False</property>
1339+ <property name="fill">True</property>
1340+ <property name="position">2</property>
1341+ </packing>
1342+ </child>
1343+ </object>
1344+ <packing>
1345+ <property name="expand">True</property>
1346+ <property name="fill">True</property>
1347+ <property name="position">4</property>
1348+ </packing>
1349+ </child>
1350+ </object>
1351+ <packing>
1352+ <property name="expand">True</property>
1353+ <property name="fill">True</property>
1354+ <property name="position">1</property>
1355+ </packing>
1356+ </child>
1357+ </object>
1358+ <packing>
1359+ <property name="expand">True</property>
1360+ <property name="fill">True</property>
1361+ <property name="position">0</property>
1362+ </packing>
1363+ </child>
1364+ <child>
1365+ <object class="GtkBox" id="box1">
1366+ <property name="visible">True</property>
1367+ <property name="can_focus">False</property>
1368+ <property name="valign">end</property>
1369+ <child>
1370+ <object class="GtkCheckButton" id="show-indicator-check">
1371+ <property name="label" translatable="yes">Show current input source in the menu bar</property>
1372+ <property name="visible">True</property>
1373+ <property name="can_focus">False</property>
1374+ <property name="receives_default">False</property>
1375+ <property name="hexpand">True</property>
1376+ <property name="xalign">0</property>
1377+ <property name="draw_indicator">True</property>
1378+ </object>
1379+ <packing>
1380+ <property name="expand">False</property>
1381+ <property name="fill">True</property>
1382+ <property name="position">0</property>
1383+ </packing>
1384+ </child>
1385+ <child>
1386+ <object class="GtkLinkButton" id="jump-to-shortcuts">
1387+ <property name="label" translatable="yes">Keyboard Settings...</property>
1388+ <property name="visible">True</property>
1389+ <property name="can_focus">True</property>
1390+ <property name="receives_default">True</property>
1391+ <property name="has_tooltip">True</property>
1392+ <property name="halign">end</property>
1393+ <property name="relief">none</property>
1394+ </object>
1395+ <packing>
1396+ <property name="expand">False</property>
1397+ <property name="fill">True</property>
1398+ <property name="position">1</property>
1399+ </packing>
1400+ </child>
1401+ </object>
1402+ <packing>
1403+ <property name="expand">False</property>
1404+ <property name="fill">True</property>
1405+ <property name="position">1</property>
1406+ </packing>
1407+ </child>
1408+ </object>
1409+ <packing>
1410+ <property name="position">3</property>
1411+ </packing>
1412+ </child>
1413+ </object>
1414+ <packing>
1415+ <property name="expand">False</property>
1416+ <property name="fill">True</property>
1417+ <property name="position">1</property>
1418+ </packing>
1419+ </child>
1420+ </object>
1421+ </child>
1422+ </object>
1423+</interface>
1424
1425=== renamed file 'panels/region/unity-region-panel.ui' => 'panels/region/unity-region-panel-ibus.ui'
1426--- panels/region/unity-region-panel.ui 2013-11-28 06:02:43 +0000
1427+++ panels/region/unity-region-panel-ibus.ui 2015-02-12 16:27:19 +0000
1428@@ -423,76 +423,88 @@
1429 </packing>
1430 </child>
1431 <child>
1432- <object class="GtkRadioButton" id="same-source-radio">
1433- <property name="label" translatable="yes">Use the same source for all windows</property>
1434+ <object class="GtkBox" id="per-window-box">
1435 <property name="visible">True</property>
1436 <property name="can_focus">False</property>
1437- <property name="receives_default">False</property>
1438- <property name="xalign">0</property>
1439- <property name="active">True</property>
1440- <property name="draw_indicator">True</property>
1441+ <property name="orientation">vertical</property>
1442+ <child>
1443+ <object class="GtkRadioButton" id="same-source-radio">
1444+ <property name="label" translatable="yes">Use the same source for all windows</property>
1445+ <property name="visible">True</property>
1446+ <property name="can_focus">False</property>
1447+ <property name="receives_default">False</property>
1448+ <property name="xalign">0</property>
1449+ <property name="active">True</property>
1450+ <property name="draw_indicator">True</property>
1451+ </object>
1452+ <packing>
1453+ <property name="expand">False</property>
1454+ <property name="fill">True</property>
1455+ <property name="position">0</property>
1456+ </packing>
1457+ </child>
1458+ <child>
1459+ <object class="GtkRadioButton" id="different-source-radio">
1460+ <property name="label" translatable="yes">Allow different sources for each window</property>
1461+ <property name="visible">True</property>
1462+ <property name="can_focus">False</property>
1463+ <property name="receives_default">False</property>
1464+ <property name="xalign">0</property>
1465+ <property name="active">True</property>
1466+ <property name="draw_indicator">True</property>
1467+ <property name="group">same-source-radio</property>
1468+ </object>
1469+ <packing>
1470+ <property name="expand">False</property>
1471+ <property name="fill">True</property>
1472+ <property name="position">1</property>
1473+ </packing>
1474+ </child>
1475+ <child>
1476+ <object class="GtkRadioButton" id="default-source-radio">
1477+ <property name="label" translatable="yes">New windows use the default source</property>
1478+ <property name="visible">True</property>
1479+ <property name="can_focus">False</property>
1480+ <property name="receives_default">False</property>
1481+ <property name="margin_left">25</property>
1482+ <property name="xalign">0</property>
1483+ <property name="active">True</property>
1484+ <property name="draw_indicator">True</property>
1485+ </object>
1486+ <packing>
1487+ <property name="expand">False</property>
1488+ <property name="fill">True</property>
1489+ <property name="position">2</property>
1490+ </packing>
1491+ </child>
1492+ <child>
1493+ <object class="GtkRadioButton" id="current-source-radio">
1494+ <property name="label" translatable="yes">New windows use the current source</property>
1495+ <property name="visible">True</property>
1496+ <property name="can_focus">False</property>
1497+ <property name="receives_default">False</property>
1498+ <property name="margin_left">25</property>
1499+ <property name="margin_bottom">15</property>
1500+ <property name="xalign">0</property>
1501+ <property name="active">True</property>
1502+ <property name="draw_indicator">True</property>
1503+ <property name="group">default-source-radio</property>
1504+ </object>
1505+ <packing>
1506+ <property name="expand">False</property>
1507+ <property name="fill">True</property>
1508+ <property name="position">3</property>
1509+ </packing>
1510+ </child>
1511 </object>
1512 <packing>
1513- <property name="expand">False</property>
1514+ <property name="expand">True</property>
1515 <property name="fill">True</property>
1516 <property name="position">4</property>
1517 </packing>
1518 </child>
1519 <child>
1520- <object class="GtkRadioButton" id="different-source-radio">
1521- <property name="label" translatable="yes">Allow different sources for each window</property>
1522- <property name="visible">True</property>
1523- <property name="can_focus">False</property>
1524- <property name="receives_default">False</property>
1525- <property name="xalign">0</property>
1526- <property name="active">True</property>
1527- <property name="draw_indicator">True</property>
1528- <property name="group">same-source-radio</property>
1529- </object>
1530- <packing>
1531- <property name="expand">False</property>
1532- <property name="fill">True</property>
1533- <property name="position">5</property>
1534- </packing>
1535- </child>
1536- <child>
1537- <object class="GtkRadioButton" id="default-source-radio">
1538- <property name="label" translatable="yes">New windows use the default source</property>
1539- <property name="visible">True</property>
1540- <property name="can_focus">False</property>
1541- <property name="receives_default">False</property>
1542- <property name="margin_left">25</property>
1543- <property name="xalign">0</property>
1544- <property name="active">True</property>
1545- <property name="draw_indicator">True</property>
1546- </object>
1547- <packing>
1548- <property name="expand">False</property>
1549- <property name="fill">True</property>
1550- <property name="position">6</property>
1551- </packing>
1552- </child>
1553- <child>
1554- <object class="GtkRadioButton" id="current-source-radio">
1555- <property name="label" translatable="yes">New windows use the current source</property>
1556- <property name="visible">True</property>
1557- <property name="can_focus">False</property>
1558- <property name="receives_default">False</property>
1559- <property name="margin_left">25</property>
1560- <property name="margin_bottom">15</property>
1561- <property name="xalign">0</property>
1562- <property name="active">True</property>
1563- <property name="draw_indicator">True</property>
1564- <property name="group">default-source-radio</property>
1565- </object>
1566- <packing>
1567- <property name="expand">False</property>
1568- <property name="fill">True</property>
1569- <property name="position">7</property>
1570- </packing>
1571- </child>
1572- <child>
1573- <object class="GtkGrid" id="grid1">
1574+ <object class="GtkGrid" id="ibus-grid">
1575 <property name="visible">True</property>
1576 <property name="can_focus">False</property>
1577 <child>
1578@@ -570,7 +582,7 @@
1579 <packing>
1580 <property name="expand">False</property>
1581 <property name="fill">True</property>
1582- <property name="position">8</property>
1583+ <property name="position">5</property>
1584 </packing>
1585 </child>
1586 </object>
1587@@ -626,7 +638,7 @@
1588 </child>
1589 </object>
1590 <packing>
1591- <property name="expand">True</property>
1592+ <property name="expand">False</property>
1593 <property name="fill">True</property>
1594 <property name="position">1</property>
1595 </packing>
1596
1597=== modified file 'po/POTFILES.in'
1598--- po/POTFILES.in 2014-02-21 18:13:23 +0000
1599+++ po/POTFILES.in 2015-02-12 16:27:19 +0000
1600@@ -75,7 +75,8 @@
1601 panels/printers/pp-ppd-selection-dialog.c
1602 [type: gettext/glade]panels/printers/printers.ui
1603 panels/region/unity-region-panel.desktop.in.in
1604-[type: gettext/glade]panels/region/unity-region-panel.ui
1605+[type: gettext/glade]panels/region/unity-region-panel-fcitx.ui
1606+[type: gettext/glade]panels/region/unity-region-panel-ibus.ui
1607 panels/region/gnome-region-panel-formats.c
1608 [type: gettext/glade]panels/region/gnome-region-panel-input-chooser.ui
1609 panels/region/gnome-region-panel-system.c

Subscribers

People subscribed via source and target branches