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