diff options
| author | Sergey Udaltsov <sergey.udaltsov@gmail.com> | 2010-04-03 22:29:19 (GMT) |
|---|---|---|
| committer | Sergey Udaltsov <sergey.udaltsov@gmail.com> | 2010-04-03 22:29:19 (GMT) |
| commit | d5fc6ca9440417a0fd66a30733b9d73470edb45d (patch) | |
| tree | 0703716b01a4a56a8d30ff168bef5f0cbdea5b3f | |
| parent | 5f459ce411888779833862f8e651fdfaa03697d5 (diff) | |
| download | gnome-settings-daemon-d5fc6ca9440417a0fd66a30733b9d73470edb45d.zip gnome-settings-daemon-d5fc6ca9440417a0fd66a30733b9d73470edb45d.tar.xz | |
Introduce gconf key that allows hiding the indicator
https://bugzilla.gnome.org/show_bug.cgi?id=612240
| -rw-r--r-- | plugins/keyboard/gsd-keyboard-xkb.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/plugins/keyboard/gsd-keyboard-xkb.c b/plugins/keyboard/gsd-keyboard-xkb.c index 753af39..16d2e64 100644 --- a/plugins/keyboard/gsd-keyboard-xkb.c +++ b/plugins/keyboard/gsd-keyboard-xkb.c @@ -66,6 +66,9 @@ static void *pa_callback_user_data = NULL; static const char KNOWN_FILES_KEY[] = "/desktop/gnome/peripherals/keyboard/general/known_file_list"; +static const char DISABLE_INDICATOR_KEY[] = + "/desktop/gnome/peripherals/keyboard/general/disable_indicator"; + static const char *gdm_keyboard_layout = NULL; static GtkStatusIcon *icon = NULL; @@ -447,6 +450,16 @@ show_hide_icon () { if (g_slist_length (current_kbd_config.layouts_variants) > 1) { if (icon == NULL) { + GConfClient *conf_client = + gconf_client_get_default (); + gboolean disable = + gconf_client_get_bool (conf_client, + DISABLE_INDICATOR_KEY, + NULL); + g_object_unref (conf_client); + if (disable) + return; + xkl_debug (150, "Creating new icon\n"); icon = gkbd_status_new (); g_signal_connect (icon, "popup-menu", @@ -541,8 +554,8 @@ filter_xkb_config (void) current_kbd_config.layouts_variants = g_slist_delete_link - (current_kbd_config.layouts_variants, - filtered); + (current_kbd_config. + layouts_variants, filtered); any_change = TRUE; continue; } @@ -590,10 +603,12 @@ apply_xkb_settings (void) GSList *found_node; int max_groups; - max_groups = MAX (xkl_engine_get_max_num_groups (xkl_engine), 1); - layouts = gconf_client_get_list (conf_client, - GKBD_KEYBOARD_CONFIG_KEY_LAYOUTS, - GCONF_VALUE_STRING, NULL); + max_groups = + MAX (xkl_engine_get_max_num_groups (xkl_engine), 1); + layouts = + gconf_client_get_list (conf_client, + GKBD_KEYBOARD_CONFIG_KEY_LAYOUTS, + GCONF_VALUE_STRING, NULL); /* Use system layouts as a default if we do not have * user configuration */ @@ -601,7 +616,8 @@ apply_xkb_settings (void) GSList *i; int len; - for (i = initial_sys_kbd_config.layouts_variants; i; i = g_slist_next (i)) { + for (i = initial_sys_kbd_config.layouts_variants; + i; i = g_slist_next (i)) { s = g_strdup (i->data); /* chop off empty variants to avoid duplicates */ |
