[gnome-control-center] dependency on libxklavier 4.0, optional load/display of extra layouts
- From: Sergey V. Udaltsov <svu src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-control-center] dependency on libxklavier 4.0, optional load/display of extra layouts
- Date: Mon, 29 Jun 2009 00:04:28 +0000 (UTC)
commit 1e58245df014b7459d24fb0a9f9e45ccceeaaddd
Author: Sergey V. Udaltsov <svu gnome org>
Date: Mon Jun 29 01:04:10 2009 +0100
dependency on libxklavier 4.0, optional load/display of extra layouts
ChangeLog | 4 +
capplets/keyboard/ChangeLog | 6 +
capplets/keyboard/gnome-keyboard-properties-xkb.c | 9 ++-
.../keyboard/gnome-keyboard-properties-xkbltadd.c | 126 ++++++++++++++------
configure.in | 2 +-
5 files changed, 106 insertions(+), 41 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 23c8dfb..fdad572 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-06-29 Sergey Udaltsov <svu gnome org>
+
+ * configure.in: Dependency on libxklavier 4.0
+
2009-05-28 Jens Granseuer <jensgr gmx net>
* font-viewer/font-thumbnailer.c (main): Timeout value was supposed
diff --git a/capplets/keyboard/ChangeLog b/capplets/keyboard/ChangeLog
index 60bb0eb..c95ab43 100644
--- a/capplets/keyboard/ChangeLog
+++ b/capplets/keyboard/ChangeLog
@@ -1,3 +1,9 @@
+2009-06-29 Sergey Udaltsov <svu gnome org>
+
+ * gnome-keyboard-properties-xkb.c,
+ gnome-keyboard-properties-xkbltadd.c: optionally load extras layouts
+ from xk-c (feature of libxklavier 4.0)
+
==================== 2.25.92 ====================
2009-02-27 Jens Granseuer <jensgr gmx net>
diff --git a/capplets/keyboard/gnome-keyboard-properties-xkb.c b/capplets/keyboard/gnome-keyboard-properties-xkb.c
index a0171ac..65a048f 100644
--- a/capplets/keyboard/gnome-keyboard-properties-xkb.c
+++ b/capplets/keyboard/gnome-keyboard-properties-xkb.c
@@ -42,6 +42,7 @@ XklEngine *engine;
XklConfigRegistry *config_registry;
GkbdKeyboardConfig initial_config;
+GkbdDesktopConfig desktop_config;
GConfClient *xkb_gconf_client;
@@ -114,6 +115,7 @@ setup_model_entry (GladeXML * dialog)
static void
cleanup_xkb_tabs (GladeXML * dialog)
{
+ gkbd_desktop_config_term (&desktop_config);
gkbd_keyboard_config_term (&initial_config);
g_object_unref (G_OBJECT (config_registry));
config_registry = NULL;
@@ -155,7 +157,12 @@ setup_xkb_tabs (GladeXML * dialog, GConfChangeSet * changeset)
engine = xkl_engine_get_instance (GDK_DISPLAY ());
config_registry = xkl_config_registry_get_instance (engine);
- xkl_config_registry_load (config_registry);
+
+ gkbd_desktop_config_init (&desktop_config, xkb_gconf_client, engine);
+ gkbd_desktop_config_load_from_gconf (&desktop_config);
+
+ xkl_config_registry_load (config_registry,
+ desktop_config.load_extra_items);
gkbd_keyboard_config_init (&initial_config, xkb_gconf_client,
engine);
diff --git a/capplets/keyboard/gnome-keyboard-properties-xkbltadd.c b/capplets/keyboard/gnome-keyboard-properties-xkbltadd.c
index 858e69a..c97d55c 100644
--- a/capplets/keyboard/gnome-keyboard-properties-xkbltadd.c
+++ b/capplets/keyboard/gnome-keyboard-properties-xkbltadd.c
@@ -40,7 +40,8 @@
#define DEFAULT_VARIANT_ID "__default__"
enum {
- COMBO_BOX_MODEL_COL_DESCRIPTION,
+ COMBO_BOX_MODEL_COL_SORT,
+ COMBO_BOX_MODEL_COL_VISIBLE,
COMBO_BOX_MODEL_COL_XKB_ID,
COMBO_BOX_MODEL_COL_REAL_ID
};
@@ -54,24 +55,44 @@ typedef struct {
} AddVariantData;
static void
- xkb_layout_chooser_available_layouts_fill (GladeXML * chooser_dialog,
- const gchar cblid[],
- const gchar cbvid[],
- LayoutIterFunc layout_iterator,
- ConfigItemProcessFunc
- layout_handler,
- GCallback
- combo_changed_notify);
-static void
- xkb_layout_chooser_available_language_variants_fill (GladeXML *
- chooser_dialog);
+
+
+
+
+
+
+xkb_layout_chooser_available_layouts_fill (GladeXML * chooser_dialog,
+ const gchar cblid[],
+ const gchar cbvid[],
+ LayoutIterFunc layout_iterator,
+ ConfigItemProcessFunc
+ layout_handler,
+ GCallback combo_changed_notify);
static void
- xkb_layout_chooser_available_country_variants_fill (GladeXML *
+
+
+
+
+
+
+
+xkb_layout_chooser_available_language_variants_fill (GladeXML *
chooser_dialog);
static void
+
+
+
+
+
+
+
+xkb_layout_chooser_available_country_variants_fill (GladeXML *
+ chooser_dialog);
+
+static void
xkb_layout_chooser_add_variant_to_available_country_variants
(XklConfigRegistry * config_registry,
XklConfigItem * parent_config_item, XklConfigItem * config_item,
@@ -85,15 +106,31 @@ static void
const gchar *xkb_id =
config_item ?
gkbd_keyboard_config_merge_items (parent_config_item->name,
- config_item->
- name) : parent_config_item->
- name;
-
- gtk_list_store_insert_with_values (data->list_store, &iter, -1,
- COMBO_BOX_MODEL_COL_DESCRIPTION,
- utf_variant_name,
- COMBO_BOX_MODEL_COL_XKB_ID,
- xkb_id, -1);
+ config_item->name) :
+ parent_config_item->name;
+
+ if (config_item && g_object_get_data
+ (G_OBJECT (config_item), XCI_PROP_EXTRA_ITEM)) {
+ gchar *buf =
+ g_strdup_printf ("<i>%s</i>", utf_variant_name);
+ gtk_list_store_insert_with_values (data->list_store, &iter,
+ -1,
+ COMBO_BOX_MODEL_COL_SORT,
+ utf_variant_name,
+ COMBO_BOX_MODEL_COL_VISIBLE,
+ buf,
+ COMBO_BOX_MODEL_COL_XKB_ID,
+ xkb_id, -1);
+ g_free (buf);
+ } else
+ gtk_list_store_insert_with_values (data->list_store, &iter,
+ -1,
+ COMBO_BOX_MODEL_COL_SORT,
+ utf_variant_name,
+ COMBO_BOX_MODEL_COL_VISIBLE,
+ utf_variant_name,
+ COMBO_BOX_MODEL_COL_XKB_ID,
+ xkb_id, -1);
g_free (utf_variant_name);
}
@@ -115,7 +152,9 @@ xkb_layout_chooser_add_language_to_available_languages (XklConfigRegistry *
list_store)
{
gtk_list_store_insert_with_values (list_store, NULL, -1,
- COMBO_BOX_MODEL_COL_DESCRIPTION,
+ COMBO_BOX_MODEL_COL_SORT,
+ config_item->description,
+ COMBO_BOX_MODEL_COL_VISIBLE,
config_item->description,
COMBO_BOX_MODEL_COL_REAL_ID,
config_item->name, -1);
@@ -130,7 +169,9 @@ xkb_layout_chooser_add_country_to_available_countries (XklConfigRegistry *
list_store)
{
gtk_list_store_insert_with_values (list_store, NULL, -1,
- COMBO_BOX_MODEL_COL_DESCRIPTION,
+ COMBO_BOX_MODEL_COL_SORT,
+ config_item->description,
+ COMBO_BOX_MODEL_COL_VISIBLE,
config_item->description,
COMBO_BOX_MODEL_COL_REAL_ID,
config_item->name, -1);
@@ -196,7 +237,8 @@ xkb_layout_chooser_available_language_variants_fill (GladeXML *
GtkTreeIter liter;
list_store = gtk_list_store_new
- (3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
+ (4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+ G_TYPE_STRING);
if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (cbl), &liter)) {
GtkTreeModel *lm =
@@ -220,7 +262,7 @@ xkb_layout_chooser_available_language_variants_fill (GladeXML *
/* Turn on sorting after filling the store, since that's faster */
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE
(list_store),
- COMBO_BOX_MODEL_COL_DESCRIPTION,
+ COMBO_BOX_MODEL_COL_SORT,
GTK_SORT_ASCENDING);
gtk_combo_box_set_model (GTK_COMBO_BOX (cbv),
@@ -238,7 +280,8 @@ xkb_layout_chooser_available_country_variants_fill (GladeXML *
GtkTreeIter liter;
list_store = gtk_list_store_new
- (3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
+ (4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+ G_TYPE_STRING);
if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (cbl), &liter)) {
GtkTreeModel *lm =
@@ -261,7 +304,7 @@ xkb_layout_chooser_available_country_variants_fill (GladeXML *
/* Turn on sorting after filling the store, since that's faster */
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE
(list_store),
- COMBO_BOX_MODEL_COL_DESCRIPTION,
+ COMBO_BOX_MODEL_COL_SORT,
GTK_SORT_ASCENDING);
gtk_combo_box_set_model (GTK_COMBO_BOX (cbv),
@@ -282,9 +325,11 @@ xkb_layout_chooser_available_layouts_fill (GladeXML *
GtkWidget *cbl = CWID (cblid);
GtkWidget *cbev = CWID (cbvid);
GtkCellRenderer *renderer;
- GtkListStore *list_store =
- gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_STRING);
+ GtkListStore *list_store;
+
+ list_store = gtk_list_store_new
+ (4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+ G_TYPE_STRING);
gtk_combo_box_set_model (GTK_COMBO_BOX (cbl),
GTK_TREE_MODEL (list_store));
@@ -293,15 +338,14 @@ xkb_layout_chooser_available_layouts_fill (GladeXML *
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (cbl), renderer, TRUE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (cbl),
renderer, "markup",
- COMBO_BOX_MODEL_COL_DESCRIPTION,
- NULL);
+ COMBO_BOX_MODEL_COL_VISIBLE, NULL);
layout_iterator (config_registry, layout_handler, list_store);
/* Turn on sorting after filling the model since that's faster */
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE
(list_store),
- COMBO_BOX_MODEL_COL_DESCRIPTION,
+ COMBO_BOX_MODEL_COL_SORT,
GTK_SORT_ASCENDING);
g_signal_connect_swapped (G_OBJECT (cbl), "changed",
@@ -313,8 +357,7 @@ xkb_layout_chooser_available_layouts_fill (GladeXML *
renderer, TRUE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (cbev),
renderer, "markup",
- COMBO_BOX_MODEL_COL_DESCRIPTION,
- NULL);
+ COMBO_BOX_MODEL_COL_VISIBLE, NULL);
g_signal_connect_swapped (G_OBJECT (cbev), "changed",
G_CALLBACK
@@ -460,12 +503,17 @@ xkb_layout_choose (GladeXML * dialog)
(xkb_layout_chooser_page_changed),
chooser_dialog);
- gtk_combo_box_set_active (CWID ("xkb_countries_available"), 0);
+ gtk_combo_box_set_active (GTK_COMBO_BOX
+ (CWID ("xkb_countries_available")),
+ FALSE);
if (gtk_tree_model_iter_n_children
(gtk_combo_box_get_model (GTK_COMBO_BOX (lang_chooser)),
NULL)) {
- gtk_combo_box_set_active (CWID ("xkb_languages_available"), 0);
+ gtk_combo_box_set_active (GTK_COMBO_BOX
+ (CWID
+ ("xkb_languages_available")),
+ FALSE);
} else {
/* If language info is not available - remove the corresponding tab,
pretend there is no notebook at all */
@@ -512,7 +560,7 @@ xkb_layout_choose (GladeXML * dialog)
}
}
- xkb_layout_preview_update (chooser_dialog);
+ xkb_layout_preview_update (chooser_dialog);
gtk_dialog_run (GTK_DIALOG (chooser));
gtk_widget_destroy (chooser);
}
diff --git a/configure.in b/configure.in
index 515f053..1eb0d91 100644
--- a/configure.in
+++ b/configure.in
@@ -180,7 +180,7 @@ CAPPLET_LIBS="$CAPPLET_LIBS $XCURSOR_LIBS"
dnl ==============
dnl gswitchit
dnl ==============
-PKG_CHECK_MODULES(LIBGNOMEKBD, [libgnomekbd >= 2.21.4.1 libxklavier >= 3.6])
+PKG_CHECK_MODULES(LIBGNOMEKBD, [libgnomekbd >= 2.21.4.1 libxklavier >= 4.0])
AC_SUBST(LIBGNOMEKBD_CFLAGS)
AC_SUBST(LIBGNOMEKBD_LIBS)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]