[Goodies-commits] r6593 - in xfce4-xkb-plugin/trunk: . panel-plugin po
Alexander Iliev
sasoiliev at xfce.org
Wed Jan 28 19:54:15 CET 2009
Author: sasoiliev
Date: 2009-01-28 18:54:15 +0000 (Wed, 28 Jan 2009)
New Revision: 6593
Modified:
xfce4-xkb-plugin/trunk/configure.in.in
xfce4-xkb-plugin/trunk/panel-plugin/xfce4-xkb-plugin.c
xfce4-xkb-plugin/trunk/panel-plugin/xfce4-xkb-plugin.h
xfce4-xkb-plugin/trunk/panel-plugin/xkb-config.c
xfce4-xkb-plugin/trunk/panel-plugin/xkb-config.h
xfce4-xkb-plugin/trunk/panel-plugin/xkb-settings-dialog.c
xfce4-xkb-plugin/trunk/po/bg.po
xfce4-xkb-plugin/trunk/po/xfce4-xkb-plugin.pot
Log:
Implemented Compose key position selection feature (bug #4870)
Version bumped to 0.5.3
Updated the bulgarian translation
Modified: xfce4-xkb-plugin/trunk/configure.in.in
===================================================================
--- xfce4-xkb-plugin/trunk/configure.in.in 2009-01-28 18:18:39 UTC (rev 6592)
+++ xfce4-xkb-plugin/trunk/configure.in.in 2009-01-28 18:54:15 UTC (rev 6593)
@@ -10,7 +10,7 @@
dnl ***************************
m4_define([xkb_version_major], [0])
m4_define([xkb_version_minor], [5])
-m4_define([xkb_version_micro], [2])
+m4_define([xkb_version_micro], [3])
m4_define([xkb_version], [xkb_version_major().xkb_version_minor().xkb_version_micro()])
dnl ***************************
Modified: xfce4-xkb-plugin/trunk/panel-plugin/xfce4-xkb-plugin.c
===================================================================
--- xfce4-xkb-plugin/trunk/panel-plugin/xfce4-xkb-plugin.c 2009-01-28 18:18:39 UTC (rev 6592)
+++ xfce4-xkb-plugin/trunk/panel-plugin/xfce4-xkb-plugin.c 2009-01-28 18:54:15 UTC (rev 6593)
@@ -269,6 +269,7 @@
xfce_rc_write_entry (rcfile, "layouts", xkb->settings->kbd_config->layouts);
xfce_rc_write_entry (rcfile, "variants", xkb->settings->kbd_config->variants);
xfce_rc_write_entry (rcfile, "options", xkb->settings->kbd_config->toggle_option);
+ xfce_rc_write_entry (rcfile, "compose_key_position", xkb->settings->kbd_config->compose_key_position);
}
xfce_rc_close (rcfile);
@@ -301,6 +302,16 @@
xkb->settings->kbd_config->layouts = g_strdup (xfce_rc_read_entry (rcfile, "layouts", NULL));
xkb->settings->kbd_config->variants = g_strdup (xfce_rc_read_entry (rcfile, "variants", NULL));
xkb->settings->kbd_config->options = g_strdup (xfce_rc_read_entry (rcfile, "options", NULL));
+ xkb->settings->kbd_config->compose_key_position = g_strdup (xfce_rc_read_entry (rcfile, "compose_key_position", NULL));
+ if (xkb->settings->kbd_config->compose_key_position
+ && strlen (xkb->settings->kbd_config->compose_key_position) > 0)
+ {
+ gchar *tmp = xkb->settings->kbd_config->options;
+ xkb->settings->kbd_config->options =
+ g_strconcat (xkb->settings->kbd_config->options,
+ ",", xkb->settings->kbd_config->compose_key_position, NULL);
+ g_free (tmp);
+ }
xfce_rc_close (rcfile);
Modified: xfce4-xkb-plugin/trunk/panel-plugin/xfce4-xkb-plugin.h
===================================================================
--- xfce4-xkb-plugin/trunk/panel-plugin/xfce4-xkb-plugin.h 2009-01-28 18:18:39 UTC (rev 6592)
+++ xfce4-xkb-plugin/trunk/panel-plugin/xfce4-xkb-plugin.h 2009-01-28 18:54:15 UTC (rev 6593)
@@ -72,6 +72,9 @@
GtkWidget *toggle_options_combo;
GtkListStore *toggle_options_store;
+ GtkWidget *compose_key_options_combo;
+ GtkListStore *compose_key_options_store;
+
GtkWidget *add_layout_btn;
GtkWidget *rm_layout_btn;
GtkWidget *edit_layout_btn;
Modified: xfce4-xkb-plugin/trunk/panel-plugin/xkb-config.c
===================================================================
--- xfce4-xkb-plugin/trunk/panel-plugin/xkb-config.c 2009-01-28 18:18:39 UTC (rev 6592)
+++ xfce4-xkb-plugin/trunk/panel-plugin/xkb-config.c 2009-01-28 18:54:15 UTC (rev 6593)
@@ -144,9 +144,6 @@
config->group_count++;
}
- //config->group_count = xkl_engine_get_num_groups (config->engine);
-
-
xkb_config_free ();
config->window_map = g_hash_table_new (g_direct_hash, NULL);
@@ -293,15 +290,18 @@
/* select the first "grp" option and use it (should be fixed to support more options) */
opt = config->config_rec->options;
- //settings->kbd_config->options;
while (opt && *opt)
{
prefix = g_strsplit(*opt, ":", 2);
- if (prefix && strcmp(*prefix, "grp") == 0)
+ if (settings->kbd_config->toggle_option == NULL
+ && prefix && strcmp(*prefix, "grp") == 0)
{
settings->kbd_config->toggle_option = *opt;
- break;
}
+ else if (prefix && strcmp(*prefix, "compose") == 0)
+ {
+ settings->kbd_config->compose_key_position = *opt;
+ }
opt++;
}
Modified: xfce4-xkb-plugin/trunk/panel-plugin/xkb-config.h
===================================================================
--- xfce4-xkb-plugin/trunk/panel-plugin/xkb-config.h 2009-01-28 18:18:39 UTC (rev 6592)
+++ xfce4-xkb-plugin/trunk/panel-plugin/xkb-config.h 2009-01-28 18:54:15 UTC (rev 6593)
@@ -48,6 +48,7 @@
gchar* variants;
gchar* options;
gchar* toggle_option;
+ gchar* compose_key_position;
} t_xkb_kbd_config;
typedef struct
Modified: xfce4-xkb-plugin/trunk/panel-plugin/xkb-settings-dialog.c
===================================================================
--- xfce4-xkb-plugin/trunk/panel-plugin/xkb-settings-dialog.c 2009-01-28 18:18:39 UTC (rev 6592)
+++ xfce4-xkb-plugin/trunk/panel-plugin/xkb-settings-dialog.c 2009-01-28 18:54:15 UTC (rev 6593)
@@ -98,8 +98,8 @@
char *
xci_desc_to_utf8 (XklConfigItem * ci)
{
- char *sd = g_strstrip (ci->description);
- return sd[0] == 0 ? g_strdup (ci->name) : g_strdup(sd);
+ char *sd = g_strstrip (ci->description);
+ return sd[0] == 0 ? g_strdup (ci->name) : g_strdup(sd);
}
/**/
@@ -139,6 +139,19 @@
}
static void
+xkb_settings_add_combo_key_position_options_to_list (XklConfigRegistry * config_registry,
+ XklConfigItem * config_item,
+ t_xkb *xkb)
+{
+ char *utf_option_name = xci_desc_to_utf8 (config_item);
+ gtk_list_store_append (xkb->compose_key_options_store, &iter);
+ gtk_list_store_set (xkb->compose_key_options_store, &iter,
+ DESC, utf_option_name,
+ NOM, config_item->name, -1);
+ g_free (utf_option_name);
+}
+
+static void
xkb_settings_add_kbd_model_to_list (XklConfigRegistry * config_registry,
XklConfigItem * config_item,
t_xkb *xkb)
@@ -184,7 +197,41 @@
}
g_free (id);
+}
+void
+xkb_settings_set_compose_key_position_combo_default_value (t_xkb *xkb)
+{
+ gchar *id;
+
+ t_xkb_kbd_config *config = xkb->settings->kbd_config;
+
+ if (config->compose_key_position == NULL)
+ return;
+
+ model = GTK_TREE_MODEL (xkb->compose_key_options_store);
+ gtk_tree_model_get_iter_first (model, &iter);
+ gtk_tree_model_get (model, &iter, NOM, &id, -1);
+ XKB_DEBUG ("COMPOSE KEY: ", config->compose_key_position);
+ if (strcmp (id, config->compose_key_position) == 0)
+ {
+ gtk_combo_box_set_active_iter (GTK_COMBO_BOX (xkb->compose_key_options_combo), &iter);
+ }
+ else
+ {
+ while (gtk_tree_model_iter_next (model, &iter))
+ {
+ gtk_tree_model_get (model, &iter, NOM, &id, -1);
+
+ if (strcmp (id, config->compose_key_position) == 0)
+ {
+ gtk_combo_box_set_active_iter (GTK_COMBO_BOX (xkb->compose_key_options_combo), &iter);
+ break;
+ }
+ }
+ }
+
+ g_free (id);
}
void
@@ -400,6 +447,7 @@
xkb->combo_store = gtk_list_store_new (COMBO_NUM, G_TYPE_STRING, G_TYPE_STRING);
xkb->toggle_options_store = gtk_list_store_new (COMBO_NUM, G_TYPE_STRING, G_TYPE_STRING);
+ xkb->compose_key_options_store = gtk_list_store_new (COMBO_NUM, G_TYPE_STRING, G_TYPE_STRING);
vbox1 = gtk_vbox_new (FALSE, 5);
gtk_container_add (GTK_CONTAINER (vbox), vbox1);
@@ -429,6 +477,7 @@
g_object_set (G_OBJECT (xkb->kbd_model_combo), "has-tooltip", TRUE, NULL);
g_signal_connect (xkb->kbd_model_combo, "query-tooltip", G_CALLBACK (xkb_settings_config_modification_disabled_tooltip), xkb);
+ /* toggle layout option */
frame = xfce_framebox_new (_("Change layout option:"), TRUE);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
gtk_widget_show (frame);
@@ -440,11 +489,11 @@
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (xkb->toggle_options_combo), renderer, TRUE);
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (xkb->toggle_options_combo), renderer, "text", 0);
xkl_config_registry_foreach_option (registry,
- "grp",
- (ConfigItemProcessFunc) xkb_settings_add_toggle_options_to_list,
- xkb);
+ "grp",
+ (ConfigItemProcessFunc) xkb_settings_add_toggle_options_to_list,
+ xkb);
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (xkb->toggle_options_store),
- 0, GTK_SORT_ASCENDING);
+ 0, GTK_SORT_ASCENDING);
xkb_settings_set_toggle_option_combo_default_value (xkb);
gtk_widget_show (xkb->toggle_options_combo);
@@ -452,7 +501,35 @@
gtk_widget_set_sensitive (GTK_WIDGET (xkb->toggle_options_combo), !xkb->settings->never_modify_config);
g_object_set (G_OBJECT (xkb->toggle_options_combo), "has-tooltip", TRUE, NULL);
g_signal_connect (xkb->toggle_options_combo, "query-tooltip", G_CALLBACK (xkb_settings_config_modification_disabled_tooltip), xkb);
+
+ /* compose key position option */
+ frame = xfce_framebox_new (_("Compose key position:"), TRUE);
+ gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
+ gtk_widget_show (frame);
+ gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
+
+ xkb->compose_key_options_combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (xkb->compose_key_options_store));
+ gtk_widget_set_size_request (xkb->compose_key_options_combo, 230, -1);
+ xfce_framebox_add (XFCE_FRAMEBOX (frame), xkb->compose_key_options_combo);
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (xkb->compose_key_options_combo), renderer, TRUE);
+ gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (xkb->compose_key_options_combo), renderer, "text", 0);
+ xkl_config_registry_foreach_option (registry,
+ "Compose key",
+ (ConfigItemProcessFunc) xkb_settings_add_combo_key_position_options_to_list,
+ xkb);
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (xkb->compose_key_options_store),
+ 0, GTK_SORT_ASCENDING);
+
+ XKB_DEBUG ("compose key: ", xkb->settings->kbd_config->compose_key_position);
+ xkb_settings_set_compose_key_position_combo_default_value (xkb);
+ gtk_widget_show (xkb->compose_key_options_combo);
+
+ gtk_widget_set_sensitive (GTK_WIDGET (xkb->compose_key_options_combo), !xkb->settings->never_modify_config);
+ g_object_set (G_OBJECT (xkb->compose_key_options_combo), "has-tooltip", TRUE, NULL);
+ g_signal_connect (xkb->compose_key_options_combo, "query-tooltip", G_CALLBACK (xkb_settings_config_modification_disabled_tooltip), xkb);
+
+ /* the actual layouts */
frame = xfce_framebox_new (_("Keyboard layouts:"), TRUE);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
gtk_widget_show (frame);
@@ -719,7 +796,8 @@
void
xkb_settings_update_from_ui (t_xkb *xkb)
{
- gchar *layouts, *variants, *kbdmodel, *toggle_option;
+ gchar *layouts, *variants, *kbdmodel, *toggle_option,
+ *compose_key_position, *tmp;
t_xkb_kbd_config *config = xkb->settings->kbd_config;
gboolean is_default;
gint i = 0;
@@ -737,6 +815,20 @@
config->options = toggle_option;
}
+ model = GTK_TREE_MODEL (xkb->compose_key_options_store);
+ if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (xkb->compose_key_options_combo), &iter))
+ {
+ gtk_tree_model_get (model, &iter, NOM, &compose_key_position, -1);
+ config->compose_key_position = compose_key_position;
+ if (config->options)
+ {
+ tmp = config->options;
+ config->options = g_strconcat (config->options, ",", compose_key_position, NULL);
+ g_free (tmp);
+ }
+ else config->options = compose_key_position;
+ }
+
model = GTK_TREE_MODEL (xkb->layout_store);
gtk_tree_model_get_iter_first (model, &iter);
gtk_tree_model_get (model, &iter, DEFAULT_LAYOUT, &is_default, LAYOUTS, &layouts, VARIANTS, &variants, -1);
Modified: xfce4-xkb-plugin/trunk/po/bg.po
===================================================================
--- xfce4-xkb-plugin/trunk/po/bg.po 2009-01-28 18:18:39 UTC (rev 6592)
+++ xfce4-xkb-plugin/trunk/po/bg.po 2009-01-28 18:54:15 UTC (rev 6593)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: xfce4-xkb-plugin 0.5.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-09-24 16:14+0300\n"
+"POT-Creation-Date: 2009-01-28 20:43+0200\n"
"PO-Revision-Date: 2008-09-24 16:16+0300\n"
"Last-Translator: Alexander Iliev <sasoiliev at mamul.org>\n"
"Language-Team: Bulgarian <sasoiliev at mamul.org>\n"
@@ -15,7 +15,7 @@
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: ../panel-plugin/xkb-settings-dialog.c:361
+#: ../panel-plugin/xkb-settings-dialog.c:408
msgid ""
"XKB configuration modifications are\n"
"disabled from the config file.\n"
@@ -27,67 +27,74 @@
"\n"
"За повече информация вижте README файла."
-#: ../panel-plugin/xkb-settings-dialog.c:387
+#: ../panel-plugin/xkb-settings-dialog.c:434
#: ../panel-plugin/xkb-plugin.desktop.in.in.h:1
msgid "Keyboard Layouts"
msgstr "Клавиатурна подредба"
-#: ../panel-plugin/xkb-settings-dialog.c:408
+#: ../panel-plugin/xkb-settings-dialog.c:456
msgid "Keyboard model:"
msgstr "Модел клавиатура:"
-#: ../panel-plugin/xkb-settings-dialog.c:432
+#. toggle layout option
+#: ../panel-plugin/xkb-settings-dialog.c:481
msgid "Change layout option:"
msgstr "Промяна на подредбата:"
-#: ../panel-plugin/xkb-settings-dialog.c:456
+#. compose key position option
+#: ../panel-plugin/xkb-settings-dialog.c:506
+msgid "Compose key position:"
+msgstr "Позиция на клавиша Compose:"
+
+#. the actual layouts
+#: ../panel-plugin/xkb-settings-dialog.c:533
msgid "Keyboard layouts:"
msgstr "Клавиатурни подредби:"
#. ***
-#: ../panel-plugin/xkb-settings-dialog.c:528
+#: ../panel-plugin/xkb-settings-dialog.c:605
msgid "Show layout as:"
msgstr "Показване на подредбата като:"
-#: ../panel-plugin/xkb-settings-dialog.c:533
+#: ../panel-plugin/xkb-settings-dialog.c:610
msgid "image"
msgstr "картинка"
-#: ../panel-plugin/xkb-settings-dialog.c:534
+#: ../panel-plugin/xkb-settings-dialog.c:611
msgid "text"
msgstr "текст"
-#: ../panel-plugin/xkb-settings-dialog.c:538
+#: ../panel-plugin/xkb-settings-dialog.c:615
msgid "Manage layout:"
msgstr "Помни подредбата:"
-#: ../panel-plugin/xkb-settings-dialog.c:543
+#: ../panel-plugin/xkb-settings-dialog.c:620
msgid "globally"
msgstr "глобално"
-#: ../panel-plugin/xkb-settings-dialog.c:544
+#: ../panel-plugin/xkb-settings-dialog.c:621
msgid "per window"
msgstr "за всеки прозорец"
-#: ../panel-plugin/xkb-settings-dialog.c:545
+#: ../panel-plugin/xkb-settings-dialog.c:622
msgid "per application"
msgstr "за всяко приложение"
-#: ../panel-plugin/xkb-settings-dialog.c:584
+#: ../panel-plugin/xkb-settings-dialog.c:661
msgid "Keyboard Layouts Plugin"
msgstr "Клавиатурна подредба"
-#: ../panel-plugin/xkb-settings-dialog.c:590
+#: ../panel-plugin/xkb-settings-dialog.c:667
msgid "Allows you to configure and use multiple keyboard layouts."
msgstr ""
"Позволява Ви да конфигурирате и използвате повече от една клавиатурни "
"подредби."
-#: ../panel-plugin/xkb-settings-dialog.c:594
+#: ../panel-plugin/xkb-settings-dialog.c:671
msgid "Other plugins available here"
msgstr "Тук ще намерите други плъгини"
-#: ../panel-plugin/xkb-settings-dialog.c:643
+#: ../panel-plugin/xkb-settings-dialog.c:720
msgid "Add layout"
msgstr "Добави подредба"
Modified: xfce4-xkb-plugin/trunk/po/xfce4-xkb-plugin.pot
===================================================================
--- xfce4-xkb-plugin/trunk/po/xfce4-xkb-plugin.pot 2009-01-28 18:18:39 UTC (rev 6592)
+++ xfce4-xkb-plugin/trunk/po/xfce4-xkb-plugin.pot 2009-01-28 18:54:15 UTC (rev 6593)
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-09-24 16:14+0300\n"
+"POT-Creation-Date: 2009-01-28 20:43+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
@@ -16,7 +16,7 @@
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: ../panel-plugin/xkb-settings-dialog.c:361
+#: ../panel-plugin/xkb-settings-dialog.c:408
msgid ""
"XKB configuration modifications are\n"
"disabled from the config file.\n"
@@ -24,65 +24,72 @@
"See the README file for more information."
msgstr ""
-#: ../panel-plugin/xkb-settings-dialog.c:387
+#: ../panel-plugin/xkb-settings-dialog.c:434
#: ../panel-plugin/xkb-plugin.desktop.in.in.h:1
msgid "Keyboard Layouts"
msgstr ""
-#: ../panel-plugin/xkb-settings-dialog.c:408
+#: ../panel-plugin/xkb-settings-dialog.c:456
msgid "Keyboard model:"
msgstr ""
-#: ../panel-plugin/xkb-settings-dialog.c:432
+#. toggle layout option
+#: ../panel-plugin/xkb-settings-dialog.c:481
msgid "Change layout option:"
msgstr ""
-#: ../panel-plugin/xkb-settings-dialog.c:456
+#. compose key position option
+#: ../panel-plugin/xkb-settings-dialog.c:506
+msgid "Compose key position:"
+msgstr ""
+
+#. the actual layouts
+#: ../panel-plugin/xkb-settings-dialog.c:533
msgid "Keyboard layouts:"
msgstr ""
#. ***
-#: ../panel-plugin/xkb-settings-dialog.c:528
+#: ../panel-plugin/xkb-settings-dialog.c:605
msgid "Show layout as:"
msgstr ""
-#: ../panel-plugin/xkb-settings-dialog.c:533
+#: ../panel-plugin/xkb-settings-dialog.c:610
msgid "image"
msgstr ""
-#: ../panel-plugin/xkb-settings-dialog.c:534
+#: ../panel-plugin/xkb-settings-dialog.c:611
msgid "text"
msgstr ""
-#: ../panel-plugin/xkb-settings-dialog.c:538
+#: ../panel-plugin/xkb-settings-dialog.c:615
msgid "Manage layout:"
msgstr ""
-#: ../panel-plugin/xkb-settings-dialog.c:543
+#: ../panel-plugin/xkb-settings-dialog.c:620
msgid "globally"
msgstr ""
-#: ../panel-plugin/xkb-settings-dialog.c:544
+#: ../panel-plugin/xkb-settings-dialog.c:621
msgid "per window"
msgstr ""
-#: ../panel-plugin/xkb-settings-dialog.c:545
+#: ../panel-plugin/xkb-settings-dialog.c:622
msgid "per application"
msgstr ""
-#: ../panel-plugin/xkb-settings-dialog.c:584
+#: ../panel-plugin/xkb-settings-dialog.c:661
msgid "Keyboard Layouts Plugin"
msgstr ""
-#: ../panel-plugin/xkb-settings-dialog.c:590
+#: ../panel-plugin/xkb-settings-dialog.c:667
msgid "Allows you to configure and use multiple keyboard layouts."
msgstr ""
-#: ../panel-plugin/xkb-settings-dialog.c:594
+#: ../panel-plugin/xkb-settings-dialog.c:671
msgid "Other plugins available here"
msgstr ""
-#: ../panel-plugin/xkb-settings-dialog.c:643
+#: ../panel-plugin/xkb-settings-dialog.c:720
msgid "Add layout"
msgstr ""
More information about the Goodies-commits
mailing list