reflect libgswitchit changes
This commit is contained in:
parent
452593fafd
commit
f5fb13632f
8 changed files with 68 additions and 55 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2004-12-13 Sergey V. Udaltsov <svu@gnome.org>
|
||||||
|
|
||||||
|
* gnome-keyboard-properties-xkb.c,
|
||||||
|
gnome-keyboard-properties-xkb.h,
|
||||||
|
gnome-keyboard-properties-xkblt.c,
|
||||||
|
gnome-keyboard-properties-xkbmc.c,
|
||||||
|
gnome-keyboard-properties-xkbot.c: reflect massive changes in libgswitchit
|
||||||
|
|
||||||
|
|
||||||
2004-12-09 Sergey V. Udaltsov <svu@gnome.org>
|
2004-12-09 Sergey V. Udaltsov <svu@gnome.org>
|
||||||
|
|
||||||
* gnome-keyboard-properties-xkblt.c: using of the XklGetMaxNumGroups
|
* gnome-keyboard-properties-xkblt.c: using of the XklGetMaxNumGroups
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include <gconf/gconf-client.h>
|
#include <gconf/gconf-client.h>
|
||||||
#include <glade/glade.h>
|
#include <glade/glade.h>
|
||||||
|
|
||||||
#include "libgswitchit/gswitchit_xkb_config.h"
|
#include "libgswitchit/gswitchit_config.h"
|
||||||
|
|
||||||
#include "capplet-util.h"
|
#include "capplet-util.h"
|
||||||
#include "gconf-property-editor.h"
|
#include "gconf-property-editor.h"
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
#define CWID(s) glade_xml_get_widget (chooserDialog, s)
|
#define CWID(s) glade_xml_get_widget (chooserDialog, s)
|
||||||
|
|
||||||
static GSwitchItXkbConfig initialConfig;
|
static GSwitchItKbdConfig initialConfig;
|
||||||
|
|
||||||
char *
|
char *
|
||||||
xci_desc_to_utf8 (XklConfigItem * ci)
|
xci_desc_to_utf8 (XklConfigItem * ci)
|
||||||
|
@ -101,7 +101,7 @@ model_to_widget (GConfPropertyEditor * peditor, GConfValue * value)
|
||||||
static void
|
static void
|
||||||
cleanup_xkb_tabs (GladeXML * dialog)
|
cleanup_xkb_tabs (GladeXML * dialog)
|
||||||
{
|
{
|
||||||
GSwitchItXkbConfigTerm (&initialConfig);
|
GSwitchItKbdConfigTerm (&initialConfig);
|
||||||
XklConfigFreeRegistry ();
|
XklConfigFreeRegistry ();
|
||||||
XklConfigTerm ();
|
XklConfigTerm ();
|
||||||
XklTerm ();
|
XklTerm ();
|
||||||
|
@ -111,7 +111,7 @@ static void
|
||||||
reset_to_defaults (GtkWidget * button, GladeXML * dialog)
|
reset_to_defaults (GtkWidget * button, GladeXML * dialog)
|
||||||
{
|
{
|
||||||
gconf_client_set_bool (gconf_client_get_default (),
|
gconf_client_set_bool (gconf_client_get_default (),
|
||||||
GSWITCHIT_CONFIG_XKB_KEY_OVERRIDE_SETTINGS,
|
GSWITCHIT_KBD_CONFIG_KEY_OVERRIDE_SETTINGS,
|
||||||
TRUE, NULL);
|
TRUE, NULL);
|
||||||
/* all the rest is g-s-d's business */
|
/* all the rest is g-s-d's business */
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ setup_xkb_tabs (GladeXML * dialog, GConfChangeSet * changeset)
|
||||||
// fill_models_option_menu (dialog);
|
// fill_models_option_menu (dialog);
|
||||||
|
|
||||||
gconf_peditor_new_string
|
gconf_peditor_new_string
|
||||||
(changeset, (gchar *) GSWITCHIT_CONFIG_XKB_KEY_MODEL,
|
(changeset, (gchar *) GSWITCHIT_KBD_CONFIG_KEY_MODEL,
|
||||||
WID ("xkb_model"),
|
WID ("xkb_model"),
|
||||||
"conv-to-widget-cb", model_to_widget,
|
"conv-to-widget-cb", model_to_widget,
|
||||||
"conv-from-widget-cb", model_from_widget, NULL);
|
"conv-from-widget-cb", model_from_widget, NULL);
|
||||||
|
@ -179,13 +179,13 @@ setup_xkb_tabs (GladeXML * dialog, GConfChangeSet * changeset)
|
||||||
"destroy", G_CALLBACK (cleanup_xkb_tabs), dialog);
|
"destroy", G_CALLBACK (cleanup_xkb_tabs), dialog);
|
||||||
|
|
||||||
gconf_client_notify_add (gconf_client_get_default (),
|
gconf_client_notify_add (gconf_client_get_default (),
|
||||||
GSWITCHIT_CONFIG_XKB_KEY_MODEL,
|
GSWITCHIT_KBD_CONFIG_KEY_MODEL,
|
||||||
(GConfClientNotifyFunc)
|
(GConfClientNotifyFunc)
|
||||||
update_model, dialog, NULL, NULL);
|
update_model, dialog, NULL, NULL);
|
||||||
|
|
||||||
GSwitchItXkbConfigInit (&initialConfig, confClient);
|
GSwitchItKbdConfigInit (&initialConfig, confClient);
|
||||||
g_object_unref (confClient);
|
g_object_unref (confClient);
|
||||||
GSwitchItXkbConfigLoadInitial (&initialConfig);
|
GSwitchItKbdConfigLoadInitial (&initialConfig);
|
||||||
|
|
||||||
enable_disable_restoring (dialog);
|
enable_disable_restoring (dialog);
|
||||||
|
|
||||||
|
@ -203,16 +203,16 @@ setup_xkb_tabs (GladeXML * dialog, GConfChangeSet * changeset)
|
||||||
void
|
void
|
||||||
enable_disable_restoring (GladeXML * dialog)
|
enable_disable_restoring (GladeXML * dialog)
|
||||||
{
|
{
|
||||||
GSwitchItXkbConfig gswic;
|
GSwitchItKbdConfig gswic;
|
||||||
GConfClient *confClient = gconf_client_get_default ();
|
GConfClient *confClient = gconf_client_get_default ();
|
||||||
gboolean enable;
|
gboolean enable;
|
||||||
|
|
||||||
GSwitchItXkbConfigInit (&gswic, confClient);
|
GSwitchItKbdConfigInit (&gswic, confClient);
|
||||||
g_object_unref (confClient);
|
g_object_unref (confClient);
|
||||||
GSwitchItXkbConfigLoad (&gswic);
|
GSwitchItKbdConfigLoad (&gswic);
|
||||||
|
|
||||||
enable = !GSwitchItXkbConfigEquals (&gswic, &initialConfig);
|
enable = !GSwitchItKbdConfigEquals (&gswic, &initialConfig);
|
||||||
|
|
||||||
GSwitchItXkbConfigTerm (&gswic);
|
GSwitchItKbdConfigTerm (&gswic);
|
||||||
gtk_widget_set_sensitive (WID ("xkb_reset_to_defaults"), enable);
|
gtk_widget_set_sensitive (WID ("xkb_reset_to_defaults"), enable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,22 +64,22 @@ extern void choose_model (GladeXML * dialog);
|
||||||
|
|
||||||
#define get_selected_layouts_list() \
|
#define get_selected_layouts_list() \
|
||||||
gconf_client_get_list (gconf_client_get_default (), \
|
gconf_client_get_list (gconf_client_get_default (), \
|
||||||
GSWITCHIT_CONFIG_XKB_KEY_LAYOUTS, \
|
GSWITCHIT_KBD_CONFIG_KEY_LAYOUTS, \
|
||||||
GCONF_VALUE_STRING, NULL)
|
GCONF_VALUE_STRING, NULL)
|
||||||
|
|
||||||
#define set_selected_layouts_list(list) \
|
#define set_selected_layouts_list(list) \
|
||||||
gconf_client_set_list (gconf_client_get_default (), \
|
gconf_client_set_list (gconf_client_get_default (), \
|
||||||
GSWITCHIT_CONFIG_XKB_KEY_LAYOUTS, \
|
GSWITCHIT_KBD_CONFIG_KEY_LAYOUTS, \
|
||||||
GCONF_VALUE_STRING, (list), NULL)
|
GCONF_VALUE_STRING, (list), NULL)
|
||||||
|
|
||||||
#define get_selected_options_list() \
|
#define get_selected_options_list() \
|
||||||
gconf_client_get_list (gconf_client_get_default (), \
|
gconf_client_get_list (gconf_client_get_default (), \
|
||||||
GSWITCHIT_CONFIG_XKB_KEY_OPTIONS, \
|
GSWITCHIT_KBD_CONFIG_KEY_OPTIONS, \
|
||||||
GCONF_VALUE_STRING, NULL)
|
GCONF_VALUE_STRING, NULL)
|
||||||
|
|
||||||
#define set_selected_options_list(list) \
|
#define set_selected_options_list(list) \
|
||||||
gconf_client_set_list (gconf_client_get_default (), \
|
gconf_client_set_list (gconf_client_get_default (), \
|
||||||
GSWITCHIT_CONFIG_XKB_KEY_OPTIONS, \
|
GSWITCHIT_KBD_CONFIG_KEY_OPTIONS, \
|
||||||
GCONF_VALUE_STRING, (list), NULL)
|
GCONF_VALUE_STRING, (list), NULL)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include <gconf/gconf-client.h>
|
#include <gconf/gconf-client.h>
|
||||||
#include <glade/glade.h>
|
#include <glade/glade.h>
|
||||||
|
|
||||||
#include "libgswitchit/gswitchit_xkb_config.h"
|
#include "libgswitchit/gswitchit_config.h"
|
||||||
|
|
||||||
#include "capplet-util.h"
|
#include "capplet-util.h"
|
||||||
#include "gconf-property-editor.h"
|
#include "gconf-property-editor.h"
|
||||||
|
@ -67,7 +67,7 @@ add_variant_to_available_layouts_tree (const XklConfigItemPtr
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
GtkTreeStore *treeStore =
|
GtkTreeStore *treeStore =
|
||||||
GTK_TREE_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (layoutsTree)));
|
GTK_TREE_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (layoutsTree)));
|
||||||
const gchar *fullLayoutName = GSwitchItConfigMergeItems (current1stLevelId,
|
const gchar *fullLayoutName = GSwitchItKbdConfigMergeItems (current1stLevelId,
|
||||||
configItem->name);
|
configItem->name);
|
||||||
char *utfVariantName = xci_desc_to_utf8 (configItem);
|
char *utfVariantName = xci_desc_to_utf8 (configItem);
|
||||||
|
|
||||||
|
@ -189,8 +189,8 @@ fill_selected_layouts_tree (GladeXML * dialog)
|
||||||
char *v1, *utfVisible;
|
char *v1, *utfVisible;
|
||||||
const char *visible = (char *) curLayout->data;
|
const char *visible = (char *) curLayout->data;
|
||||||
gtk_list_store_append (listStore, &iter);
|
gtk_list_store_append (listStore, &iter);
|
||||||
if (GSwitchItConfigGetDescriptions (visible, &sl, &l, &sv, &v))
|
if (GSwitchItKbdConfigGetDescriptions (visible, &sl, &l, &sv, &v))
|
||||||
visible = GSwitchItConfigFormatFullLayout (l, v);
|
visible = GSwitchItKbdConfigFormatFullLayout (l, v);
|
||||||
v1 = g_strdup (visible);
|
v1 = g_strdup (visible);
|
||||||
utfVisible = g_locale_to_utf8 (g_strstrip (v1), -1, NULL, NULL, NULL);
|
utfVisible = g_locale_to_utf8 (g_strstrip (v1), -1, NULL, NULL, NULL);
|
||||||
gtk_list_store_set (listStore, &iter,
|
gtk_list_store_set (listStore, &iter,
|
||||||
|
@ -280,7 +280,7 @@ add_selected_layout (GtkWidget * button, GladeXML * dialog)
|
||||||
while (option != NULL)
|
while (option != NULL)
|
||||||
{
|
{
|
||||||
char *g, *o;
|
char *g, *o;
|
||||||
if (GSwitchItConfigSplitItems (option->data, &g, &o))
|
if (GSwitchItKbdConfigSplitItems (option->data, &g, &o))
|
||||||
{
|
{
|
||||||
if (!g_ascii_strcasecmp (g, GROUP_SWITCHERS_GROUP))
|
if (!g_ascii_strcasecmp (g, GROUP_SWITCHERS_GROUP))
|
||||||
{
|
{
|
||||||
|
@ -298,7 +298,7 @@ add_selected_layout (GtkWidget * button, GladeXML * dialog)
|
||||||
&ci ))
|
&ci ))
|
||||||
|
|
||||||
{
|
{
|
||||||
const gchar* id = GSwitchItConfigMergeItems (GROUP_SWITCHERS_GROUP, DEFAULT_GROUP_SWITCH);
|
const gchar* id = GSwitchItKbdConfigMergeItems (GROUP_SWITCHERS_GROUP, DEFAULT_GROUP_SWITCH);
|
||||||
optionsList = g_slist_append (optionsList, g_strdup (id));
|
optionsList = g_slist_append (optionsList, g_strdup (id));
|
||||||
set_selected_options_list (optionsList);
|
set_selected_options_list (optionsList);
|
||||||
}
|
}
|
||||||
|
@ -392,7 +392,7 @@ void
|
||||||
register_layouts_gconf_listener (GladeXML * dialog)
|
register_layouts_gconf_listener (GladeXML * dialog)
|
||||||
{
|
{
|
||||||
gconf_client_notify_add (gconf_client_get_default (),
|
gconf_client_notify_add (gconf_client_get_default (),
|
||||||
GSWITCHIT_CONFIG_XKB_KEY_LAYOUTS,
|
GSWITCHIT_KBD_CONFIG_KEY_LAYOUTS,
|
||||||
(GConfClientNotifyFunc)
|
(GConfClientNotifyFunc)
|
||||||
update_layouts_list, dialog, NULL, NULL);
|
update_layouts_list, dialog, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include <gconf/gconf-client.h>
|
#include <gconf/gconf-client.h>
|
||||||
#include <glade/glade.h>
|
#include <glade/glade.h>
|
||||||
|
|
||||||
#include "libgswitchit/gswitchit_xkb_config.h"
|
#include "libgswitchit/gswitchit_config.h"
|
||||||
|
|
||||||
#include "capplet-util.h"
|
#include "capplet-util.h"
|
||||||
#include "gconf-property-editor.h"
|
#include "gconf-property-editor.h"
|
||||||
|
@ -118,7 +118,7 @@ xkb_model_chooser_response (GtkDialog *dialog,
|
||||||
1, &modelName, -1);
|
1, &modelName, -1);
|
||||||
|
|
||||||
gconf_client_set_string (gconf_client_get_default (),
|
gconf_client_set_string (gconf_client_get_default (),
|
||||||
GSWITCHIT_CONFIG_XKB_KEY_MODEL,
|
GSWITCHIT_KBD_CONFIG_KEY_MODEL,
|
||||||
modelName, NULL);
|
modelName, NULL);
|
||||||
g_free(modelName);
|
g_free(modelName);
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ choose_model(GladeXML * dialog)
|
||||||
GtkWidget* chooser = CWID ( "xkb_model_chooser");
|
GtkWidget* chooser = CWID ( "xkb_model_chooser");
|
||||||
gtk_window_set_transient_for (GTK_WINDOW (chooser), GTK_WINDOW (WID ("keyboard_dialog")));
|
gtk_window_set_transient_for (GTK_WINDOW (chooser), GTK_WINDOW (WID ("keyboard_dialog")));
|
||||||
currentModelName = gconf_client_get_string (gconf_client_get_default (),
|
currentModelName = gconf_client_get_string (gconf_client_get_default (),
|
||||||
GSWITCHIT_CONFIG_XKB_KEY_MODEL, NULL);
|
GSWITCHIT_KBD_CONFIG_KEY_MODEL, NULL);
|
||||||
fill_models_list (chooserDialog);
|
fill_models_list (chooserDialog);
|
||||||
g_signal_connect (G_OBJECT (chooser),
|
g_signal_connect (G_OBJECT (chooser),
|
||||||
"response", G_CALLBACK (xkb_model_chooser_response), chooserDialog);
|
"response", G_CALLBACK (xkb_model_chooser_response), chooserDialog);
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include <gconf/gconf-client.h>
|
#include <gconf/gconf-client.h>
|
||||||
#include <glade/glade.h>
|
#include <glade/glade.h>
|
||||||
|
|
||||||
#include "libgswitchit/gswitchit_xkb_config.h"
|
#include "libgswitchit/gswitchit_config.h"
|
||||||
|
|
||||||
#include "capplet-util.h"
|
#include "capplet-util.h"
|
||||||
#include "gconf-property-editor.h"
|
#include "gconf-property-editor.h"
|
||||||
|
@ -91,7 +91,7 @@ can_add_option (GladeXML * dialog)
|
||||||
gtk_tree_model_get (availableOptionsModel, &aiter, 1,
|
gtk_tree_model_get (availableOptionsModel, &aiter, 1,
|
||||||
&selectedFullOptionId, -1);
|
&selectedFullOptionId, -1);
|
||||||
|
|
||||||
if (!GSwitchItConfigSplitItems
|
if (!GSwitchItKbdConfigSplitItems
|
||||||
(selectedFullOptionId, &selectedGroupId, &selectedOptionId))
|
(selectedFullOptionId, &selectedGroupId, &selectedOptionId))
|
||||||
{
|
{
|
||||||
gtk_tree_path_free (groupPath);
|
gtk_tree_path_free (groupPath);
|
||||||
|
@ -125,7 +125,7 @@ can_add_option (GladeXML * dialog)
|
||||||
// look for options within same group
|
// look for options within same group
|
||||||
char *sgid = NULL, *soid = NULL;
|
char *sgid = NULL, *soid = NULL;
|
||||||
gtk_tree_model_get (selectedOptionsModel, &siter, 1, &sid, -1);
|
gtk_tree_model_get (selectedOptionsModel, &siter, 1, &sid, -1);
|
||||||
if (GSwitchItConfigSplitItems
|
if (GSwitchItKbdConfigSplitItems
|
||||||
(sid, &sgid, &soid)
|
(sid, &sgid, &soid)
|
||||||
&& !g_strcasecmp (sgid, selectedGroupId))
|
&& !g_strcasecmp (sgid, selectedGroupId))
|
||||||
{
|
{
|
||||||
|
@ -247,7 +247,7 @@ add_option_to_available_options_tree (const XklConfigItemPtr
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
GtkTreeStore *treeStore =
|
GtkTreeStore *treeStore =
|
||||||
GTK_TREE_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (optionsTree)));
|
GTK_TREE_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (optionsTree)));
|
||||||
const gchar *fullOptionName = GSwitchItConfigMergeItems (current1stLevelId,
|
const gchar *fullOptionName = GSwitchItKbdConfigMergeItems (current1stLevelId,
|
||||||
configItem->name);
|
configItem->name);
|
||||||
char *utfOptionName = xci_desc_to_utf8 (configItem);
|
char *utfOptionName = xci_desc_to_utf8 (configItem);
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ fill_selected_options_tree (GladeXML * dialog)
|
||||||
char *groupName, *optionName;
|
char *groupName, *optionName;
|
||||||
const char *visible = (char *) curOption->data;
|
const char *visible = (char *) curOption->data;
|
||||||
|
|
||||||
if (GSwitchItConfigSplitItems (visible, &groupName, &optionName))
|
if (GSwitchItKbdConfigSplitItems (visible, &groupName, &optionName))
|
||||||
{
|
{
|
||||||
XklConfigItem citem;
|
XklConfigItem citem;
|
||||||
char *v1, *utfVisible;
|
char *v1, *utfVisible;
|
||||||
|
@ -372,7 +372,7 @@ void
|
||||||
register_options_gconf_listener (GladeXML * dialog)
|
register_options_gconf_listener (GladeXML * dialog)
|
||||||
{
|
{
|
||||||
gconf_client_notify_add (gconf_client_get_default (),
|
gconf_client_notify_add (gconf_client_get_default (),
|
||||||
GSWITCHIT_CONFIG_XKB_KEY_OPTIONS,
|
GSWITCHIT_KBD_CONFIG_KEY_OPTIONS,
|
||||||
(GConfClientNotifyFunc)
|
(GConfClientNotifyFunc)
|
||||||
update_options_list, dialog, NULL, NULL);
|
update_options_list, dialog, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2004-12-18 Sergey V. Udaltsov <svu@gnome.org>
|
||||||
|
|
||||||
|
* gnome-settings-keyboard-xkb.c: reflect changes in libgswitchit
|
||||||
|
|
||||||
2004-12-16 Bastien Nocera <hadess@hadess.net>
|
2004-12-16 Bastien Nocera <hadess@hadess.net>
|
||||||
|
|
||||||
* actions/acme-volume-alsa.c: (acme_volume_alsa_set_mute): mute
|
* actions/acme-volume-alsa.c: (acme_volume_alsa_set_mute): mute
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <glib/gstrfuncs.h>
|
//#include <glib/gstrfuncs.h>
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdk.h>
|
||||||
#include <gdk/gdkx.h>
|
#include <gdk/gdkx.h>
|
||||||
#include <gconf/gconf-client.h>
|
#include <gconf/gconf-client.h>
|
||||||
|
@ -38,12 +38,12 @@
|
||||||
|
|
||||||
#include <libxklavier/xklavier.h>
|
#include <libxklavier/xklavier.h>
|
||||||
#include <libxklavier/xklavier_config.h>
|
#include <libxklavier/xklavier_config.h>
|
||||||
#include <libgswitchit/gswitchit_xkb_config.h>
|
#include <libgswitchit/gswitchit_config.h>
|
||||||
|
|
||||||
#include "gnome-settings-keyboard-xkb.h"
|
#include "gnome-settings-keyboard-xkb.h"
|
||||||
#include "gnome-settings-daemon.h"
|
#include "gnome-settings-daemon.h"
|
||||||
|
|
||||||
static GSwitchItXkbConfig gswic;
|
static GSwitchItKbdConfig gswic;
|
||||||
static gboolean initedOk;
|
static gboolean initedOk;
|
||||||
|
|
||||||
static PostActivationCallback paCallback = NULL;
|
static PostActivationCallback paCallback = NULL;
|
||||||
|
@ -116,17 +116,17 @@ apply_settings (void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
confClient = gconf_client_get_default ();
|
confClient = gconf_client_get_default ();
|
||||||
GSwitchItXkbConfigInit (&gswic, confClient);
|
GSwitchItKbdConfigInit (&gswic, confClient);
|
||||||
g_object_unref (confClient);
|
g_object_unref (confClient);
|
||||||
GSwitchItXkbConfigLoad (&gswic);
|
GSwitchItKbdConfigLoad (&gswic);
|
||||||
|
|
||||||
if (gswic.overrideSettings) {
|
if (gswic.overrideSettings) {
|
||||||
/* initialization - from the system settings */
|
/* initialization - from the system settings */
|
||||||
GSwitchItXkbConfigLoadInitial (&gswic);
|
GSwitchItKbdConfigLoadInitial (&gswic);
|
||||||
gswic.overrideSettings = FALSE;
|
gswic.overrideSettings = FALSE;
|
||||||
GSwitchItXkbConfigSave (&gswic);
|
GSwitchItKbdConfigSave (&gswic);
|
||||||
} else {
|
} else {
|
||||||
if (GSwitchItXkbConfigActivate (&gswic)) {
|
if (GSwitchItKbdConfigActivate (&gswic)) {
|
||||||
if (paCallback != NULL) {
|
if (paCallback != NULL) {
|
||||||
(*paCallback) (paCallbackUserData);
|
(*paCallback) (paCallbackUserData);
|
||||||
}
|
}
|
||||||
|
@ -137,26 +137,26 @@ apply_settings (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GSwitchItXkbConfigTerm (&gswic);
|
GSwitchItKbdConfigTerm (&gswic);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gnome_settings_keyboard_xkb_sysconfig_changed_response (GtkDialog * dialog,
|
gnome_settings_keyboard_xkb_sysconfig_changed_response (GtkDialog * dialog,
|
||||||
SysConfigChangedMsgResponse
|
SysConfigChangedMsgResponse
|
||||||
what2do,
|
what2do,
|
||||||
GSwitchItXkbConfig
|
GSwitchItKbdConfig
|
||||||
* pgswicNow)
|
* pgswicNow)
|
||||||
{
|
{
|
||||||
switch (what2do) {
|
switch (what2do) {
|
||||||
case RESPONSE_USE_X:
|
case RESPONSE_USE_X:
|
||||||
GSwitchItXkbConfigSave (pgswicNow);
|
GSwitchItKbdConfigSave (pgswicNow);
|
||||||
break;
|
break;
|
||||||
case RESPONSE_USE_GNOME:
|
case RESPONSE_USE_GNOME:
|
||||||
/* Do absolutely nothing - just keep things the way they are */
|
/* Do absolutely nothing - just keep things the way they are */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
gtk_widget_destroy (GTK_WIDGET (dialog));
|
gtk_widget_destroy (GTK_WIDGET (dialog));
|
||||||
GSwitchItXkbConfigTerm (pgswicNow);
|
GSwitchItKbdConfigTerm (pgswicNow);
|
||||||
g_free (pgswicNow);
|
g_free (pgswicNow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,21 +164,21 @@ static void
|
||||||
gnome_settings_keyboard_xkb_analyze_sysconfig (void)
|
gnome_settings_keyboard_xkb_analyze_sysconfig (void)
|
||||||
{
|
{
|
||||||
GConfClient *confClient;
|
GConfClient *confClient;
|
||||||
GSwitchItXkbConfig gswicWas, *pgswicNow;
|
GSwitchItKbdConfig gswicWas, *pgswicNow;
|
||||||
gboolean isConfigChanged;
|
gboolean isConfigChanged;
|
||||||
|
|
||||||
if (!initedOk)
|
if (!initedOk)
|
||||||
return;
|
return;
|
||||||
pgswicNow = g_new (GSwitchItXkbConfig, 1);
|
pgswicNow = g_new (GSwitchItKbdConfig, 1);
|
||||||
confClient = gconf_client_get_default ();
|
confClient = gconf_client_get_default ();
|
||||||
GSwitchItXkbConfigInit (&gswicWas, confClient);
|
GSwitchItKbdConfigInit (&gswicWas, confClient);
|
||||||
GSwitchItXkbConfigInit (pgswicNow, confClient);
|
GSwitchItKbdConfigInit (pgswicNow, confClient);
|
||||||
g_object_unref (confClient);
|
g_object_unref (confClient);
|
||||||
GSwitchItXkbConfigLoadSysBackup (&gswicWas);
|
GSwitchItKbdConfigLoadSysBackup (&gswicWas);
|
||||||
GSwitchItXkbConfigLoadInitial (pgswicNow);
|
GSwitchItKbdConfigLoadInitial (pgswicNow);
|
||||||
|
|
||||||
isConfigChanged = g_slist_length (gswicWas.layouts) &&
|
isConfigChanged = g_slist_length (gswicWas.layouts) &&
|
||||||
!GSwitchItXkbConfigEquals (pgswicNow, &gswicWas);
|
!GSwitchItKbdConfigEquals (pgswicNow, &gswicWas);
|
||||||
/* config was changed!!! */
|
/* config was changed!!! */
|
||||||
if (isConfigChanged) {
|
if (isConfigChanged) {
|
||||||
GtkWidget *msg = gtk_message_dialog_new_with_markup (NULL,
|
GtkWidget *msg = gtk_message_dialog_new_with_markup (NULL,
|
||||||
|
@ -202,10 +202,10 @@ gnome_settings_keyboard_xkb_analyze_sysconfig (void)
|
||||||
pgswicNow);
|
pgswicNow);
|
||||||
gtk_widget_show (msg);
|
gtk_widget_show (msg);
|
||||||
}
|
}
|
||||||
GSwitchItXkbConfigSaveSysBackup (pgswicNow);
|
GSwitchItKbdConfigSaveSysBackup (pgswicNow);
|
||||||
if (!isConfigChanged)
|
if (!isConfigChanged)
|
||||||
g_free (pgswicNow);
|
g_free (pgswicNow);
|
||||||
GSwitchItXkbConfigTerm (&gswicWas);
|
GSwitchItKbdConfigTerm (&gswicWas);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue