Commit 255986ee authored by Marc-André Lureau's avatar Marc-André Lureau
Browse files

gsettings: complete migration gconf -> gsettings

https://bugzilla.gnome.org/show_bug.cgi?id=625895
parent 8382f550
...@@ -73,7 +73,6 @@ GNOME_DOC_INIT ...@@ -73,7 +73,6 @@ GNOME_DOC_INIT
GLIB_REQUIRED=2.25.11 GLIB_REQUIRED=2.25.11
GTK_REQUIRED=2.99.3 GTK_REQUIRED=2.99.3
GCONF_REQUIRED=2.16.0
GTHREAD_REQUIRED=2.0.0 GTHREAD_REQUIRED=2.0.0
GTK_VNC_REQUIRED=0.4.3 GTK_VNC_REQUIRED=0.4.3
AVAHI_REQUIRED=0.6.26 AVAHI_REQUIRED=0.6.26
...@@ -104,7 +103,6 @@ PKG_CHECK_MODULES(VINAGRE, \ ...@@ -104,7 +103,6 @@ PKG_CHECK_MODULES(VINAGRE, \
gio-2.0 >= $GLIB_REQUIRED \ gio-2.0 >= $GLIB_REQUIRED \
gio-unix-2.0 >= $GLIB_REQUIRED \ gio-unix-2.0 >= $GLIB_REQUIRED \
gtk+-3.0 >= $GTK_REQUIRED \ gtk+-3.0 >= $GTK_REQUIRED \
gconf-2.0 >= $GCONF_REQUIRED \
gthread-2.0 >= $GTHREAD_REQUIRED \ gthread-2.0 >= $GTHREAD_REQUIRED \
gnome-keyring-1 \ gnome-keyring-1 \
libxml-2.0 >= $XML_REQUIRED \ libxml-2.0 >= $XML_REQUIRED \
...@@ -217,13 +215,6 @@ if test "x$enable_applet" = "xyes";then ...@@ -217,13 +215,6 @@ if test "x$enable_applet" = "xyes";then
fi fi
AM_CONDITIONAL(APPLET, test "x$enable_applet" = "xyes") AM_CONDITIONAL(APPLET, test "x$enable_applet" = "xyes")
dnl ================================================================
dnl GConf related settings
dnl ================================================================
AC_PATH_PROG(GCONFTOOL, gconftool-2)
AM_GCONF_SOURCE_2
GLIB_GSETTINGS GLIB_GSETTINGS
dnl Check for bind in libsocket (needed on Solaris) dnl Check for bind in libsocket (needed on Solaris)
......
...@@ -48,31 +48,22 @@ VinagrePluginsEngine *default_engine = NULL; ...@@ -48,31 +48,22 @@ VinagrePluginsEngine *default_engine = NULL;
static void static void
vinagre_plugins_engine_load_extensions (VinagrePluginsEngine *engine) vinagre_plugins_engine_load_extensions (VinagrePluginsEngine *engine)
{ {
GSList *plugins, *l; GStrv plugins;
gchar **loaded_plugins;
gint i;
g_object_get (vinagre_prefs_get_default (), g_object_get (vinagre_prefs_get_default (),
"active-plugins", &plugins, "active-plugins", &plugins,
NULL); NULL);
loaded_plugins = g_new0 (gchar *, g_slist_length (plugins) + 1);
i = 0;
for (l = plugins; l; l = l->next)
loaded_plugins[i++] = (l->data);
engine->priv->loading_plugin_list = TRUE; engine->priv->loading_plugin_list = TRUE;
peas_engine_set_loaded_plugins (PEAS_ENGINE (engine), peas_engine_set_loaded_plugins (PEAS_ENGINE (engine), (const gchar **)plugins);
(const gchar **) loaded_plugins);
engine->priv->loading_plugin_list = FALSE; engine->priv->loading_plugin_list = FALSE;
g_strfreev (loaded_plugins); g_strfreev (plugins);
g_slist_free (plugins);
} }
static void static void
vinagre_plugins_engine_extension_added (PeasExtensionSet *extensions, vinagre_plugins_engine_extension_added (PeasExtensionSet *extensions,
PeasPluginInfo *info, PeasPluginInfo *info,
PeasExtension *exten, PeasExtension *exten,
VinagrePluginsEngine *engine) VinagrePluginsEngine *engine)
{ {
PeasExtension *previous_ext; PeasExtension *previous_ext;
...@@ -97,7 +88,7 @@ vinagre_plugins_engine_extension_added (PeasExtensionSet *extensions, ...@@ -97,7 +88,7 @@ vinagre_plugins_engine_extension_added (PeasExtensionSet *extensions,
static void static void
vinagre_plugins_engine_extension_removed (PeasExtensionSet *extensions, vinagre_plugins_engine_extension_removed (PeasExtensionSet *extensions,
PeasPluginInfo *info, PeasPluginInfo *info,
PeasExtension *exten, PeasExtension *exten,
VinagrePluginsEngine *engine) VinagrePluginsEngine *engine)
{ {
const gchar *protocol = NULL; const gchar *protocol = NULL;
...@@ -190,23 +181,18 @@ static void ...@@ -190,23 +181,18 @@ static void
save_plugin_list (VinagrePluginsEngine *engine) save_plugin_list (VinagrePluginsEngine *engine)
{ {
gchar **loaded_plugins; gchar **loaded_plugins;
GSList *plugins = NULL;
gint i;
loaded_plugins = peas_engine_get_loaded_plugins (PEAS_ENGINE (engine)); loaded_plugins = peas_engine_get_loaded_plugins (PEAS_ENGINE (engine));
for (i = 0; loaded_plugins[i]; i++)
plugins = g_slist_prepend (plugins, loaded_plugins[i]);
g_object_set (vinagre_prefs_get_default (), g_object_set (vinagre_prefs_get_default (),
"active-plugins", plugins, "active-plugins", loaded_plugins,
NULL); NULL);
g_strfreev (loaded_plugins); g_strfreev (loaded_plugins);
g_slist_free (plugins);
} }
static void static void
vinagre_plugins_engine_load_plugin (PeasEngine *engine, vinagre_plugins_engine_load_plugin (PeasEngine *engine,
PeasPluginInfo *info) PeasPluginInfo *info)
{ {
VinagrePluginsEngine *vengine = VINAGRE_PLUGINS_ENGINE (engine); VinagrePluginsEngine *vengine = VINAGRE_PLUGINS_ENGINE (engine);
...@@ -295,7 +281,7 @@ vinagre_plugins_engine_get_default (void) ...@@ -295,7 +281,7 @@ vinagre_plugins_engine_get_default (void)
*/ */
VinagreProtocol * VinagreProtocol *
vinagre_plugins_engine_get_plugin_by_protocol (VinagrePluginsEngine *engine, vinagre_plugins_engine_get_plugin_by_protocol (VinagrePluginsEngine *engine,
const gchar *protocol) const gchar *protocol)
{ {
g_return_val_if_fail (VINAGRE_IS_PLUGINS_ENGINE (engine), NULL); g_return_val_if_fail (VINAGRE_IS_PLUGINS_ENGINE (engine), NULL);
......
...@@ -18,23 +18,21 @@ ...@@ -18,23 +18,21 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <gconf/gconf-client.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include "vinagre-prefs.h" #include "vinagre-prefs.h"
#include "vinagre-utils.h" #include "vinagre-utils.h"
#define VINAGRE_BASE_KEY "/apps/vinagre" #define VINAGRE_SCHEMA_NAME "org.gnome.Vinagre"
#define VM_ALWAYS_SHOW_TABS VINAGRE_BASE_KEY "/always_show_tabs" #define VM_ALWAYS_SHOW_TABS "always-show-tabs"
#define VM_SHOW_ACCELS VINAGRE_BASE_KEY "/show_accels" #define VM_SHOW_ACCELS "show-accels"
#define VM_HISTORY_SIZE VINAGRE_BASE_KEY "/history_size" #define VM_HISTORY_SIZE "history-size"
#define VM_ALWAYS_ENABLE_LISTENING VINAGRE_BASE_KEY "/always_enable_listening" #define VM_ALWAYS_ENABLE_LISTENING "always-enable-listening"
#define VM_SHARED_FLAG VINAGRE_BASE_KEY "/shared_flag" #define VM_SHARED_FLAG "shared-flag"
#define VINAGRE_PLUGINS_DIR VINAGRE_BASE_KEY "/plugins" #define VM_ACTIVE_PLUGINS "active-plugins"
#define VM_ACTIVE_PLUGINS VINAGRE_PLUGINS_DIR "/active-plugins"
struct _VinagrePrefsPrivate struct _VinagrePrefsPrivate
{ {
GConfClient *gconf_client; GSettings *gsettings;
}; };
/* Properties */ /* Properties */
...@@ -42,8 +40,6 @@ enum ...@@ -42,8 +40,6 @@ enum
{ {
PROP_0, PROP_0,
PROP_SHARED_FLAG, PROP_SHARED_FLAG,
PROP_ALWAYS_SHOW_TABS,
PROP_SHOW_ACCELS,
PROP_HISTORY_SIZE, PROP_HISTORY_SIZE,
PROP_ACTIVE_PLUGINS, PROP_ACTIVE_PLUGINS,
PROP_LAST_PROTOCOL, PROP_LAST_PROTOCOL,
...@@ -64,123 +60,21 @@ vinagre_prefs_get_default (void) ...@@ -64,123 +60,21 @@ vinagre_prefs_get_default (void)
{ {
if (G_UNLIKELY (!prefs_singleton)) if (G_UNLIKELY (!prefs_singleton))
prefs_singleton = VINAGRE_PREFS (g_object_new (VINAGRE_TYPE_PREFS, prefs_singleton = VINAGRE_PREFS (g_object_new (VINAGRE_TYPE_PREFS,
NULL)); NULL));
return prefs_singleton; return prefs_singleton;
} }
static gboolean /**
vinagre_prefs_get_bool (VinagrePrefs *prefs, const gchar* key, gboolean def) * vinagre_prefs_get_default_gsettings:
{ *
GError* error = NULL; * Return value: (transfer none):
GConfValue* val; */
GSettings *
val = gconf_client_get (prefs->priv->gconf_client, key, &error); vinagre_prefs_get_default_gsettings (void)
if (val != NULL)
{
gboolean retval = def;
g_return_val_if_fail (error == NULL, retval);
if (val->type == GCONF_VALUE_BOOL)
retval = gconf_value_get_bool (val);
gconf_value_free (val);
return retval;
}
else
return def;
}
static gboolean
vinagre_prefs_get_int (VinagrePrefs *prefs, const gchar* key, gint def)
{
GError* error = NULL;
GConfValue* val;
val = gconf_client_get (prefs->priv->gconf_client, key, &error);
if (val != NULL)
{
gint retval = def;
g_return_val_if_fail (error == NULL, retval);
if (val->type == GCONF_VALUE_INT)
retval = gconf_value_get_int (val);
gconf_value_free (val);
return retval;
}
else
return def;
}
static GSList *
vinagre_prefs_get_list (VinagrePrefs *prefs, const gchar* key)
{
return gconf_client_get_list (prefs->priv->gconf_client,
key,
GCONF_VALUE_STRING,
NULL);
}
static void
vinagre_prefs_set_bool (VinagrePrefs *prefs, const gchar* key, gboolean value)
{
GError *error = NULL;
if (!gconf_client_set_bool (prefs->priv->gconf_client, key, value, &error))
{
g_warning ("Setting key %s failed: %s", key, error->message);
g_error_free (error);
}
}
static void
vinagre_prefs_set_int (VinagrePrefs *prefs, const gchar* key, gint value)
{
GError *error = NULL;
if (!gconf_client_set_int (prefs->priv->gconf_client, key, value, &error))
{
g_warning ("Setting key %s failed: %s", key, error->message);
g_error_free (error);
}
}
static void
vinagre_prefs_set_list (VinagrePrefs *prefs, const gchar* key, GSList *list)
{
GError *error = NULL;
if (!gconf_client_set_list (prefs->priv->gconf_client, key,
GCONF_VALUE_STRING, list,
&error))
{
g_warning ("Setting key %s failed: %s", key, error->message);
g_error_free (error);
}
}
static void
vinagre_prefs_always_show_tabs_notify (GConfClient *client,
guint cnx_id,
GConfEntry *entry,
VinagrePrefs *prefs)
{ {
g_object_notify (G_OBJECT (prefs), "always-show-tabs"); VinagrePrefs *pref = vinagre_prefs_get_default ();
}
static void return pref->priv->gsettings;
vinagre_prefs_show_accels_notify (GConfClient *client,
guint cnx_id,
GConfEntry *entry,
VinagrePrefs *prefs)
{
g_object_notify (G_OBJECT (prefs), "show-accels");
} }
static void static void
...@@ -188,23 +82,10 @@ vinagre_prefs_init (VinagrePrefs *prefs) ...@@ -188,23 +82,10 @@ vinagre_prefs_init (VinagrePrefs *prefs)
{ {
prefs->priv = G_TYPE_INSTANCE_GET_PRIVATE (prefs, VINAGRE_TYPE_PREFS, VinagrePrefsPrivate); prefs->priv = G_TYPE_INSTANCE_GET_PRIVATE (prefs, VINAGRE_TYPE_PREFS, VinagrePrefsPrivate);
prefs->priv->gconf_client = gconf_client_get_default (); prefs->priv->gsettings = g_settings_new (VINAGRE_SCHEMA_NAME);
if (prefs->priv->gconf_client == NULL) if (prefs->priv->gsettings == NULL)
g_critical (_("Cannot initialize preferences manager.")); g_critical (_("Cannot initialize preferences manager."));
gconf_client_add_dir (prefs->priv->gconf_client,
VINAGRE_BASE_KEY,
GCONF_CLIENT_PRELOAD_ONELEVEL,
NULL);
gconf_client_notify_add (prefs->priv->gconf_client,
VM_ALWAYS_SHOW_TABS,
(GConfClientNotifyFunc) vinagre_prefs_always_show_tabs_notify,
prefs, NULL, NULL);
gconf_client_notify_add (prefs->priv->gconf_client,
VM_SHOW_ACCELS,
(GConfClientNotifyFunc) vinagre_prefs_show_accels_notify,
prefs, NULL, NULL);
} }
static void static void
...@@ -215,22 +96,16 @@ vinagre_prefs_set_property (GObject *object, guint prop_id, const GValue *value, ...@@ -215,22 +96,16 @@ vinagre_prefs_set_property (GObject *object, guint prop_id, const GValue *value,
switch (prop_id) switch (prop_id)
{ {
case PROP_SHARED_FLAG: case PROP_SHARED_FLAG:
vinagre_prefs_set_bool (prefs, VM_SHARED_FLAG, g_value_get_boolean (value)); g_settings_set_boolean (prefs->priv->gsettings, VM_SHARED_FLAG, g_value_get_boolean (value));
break;
case PROP_ALWAYS_SHOW_TABS:
vinagre_prefs_set_bool (prefs, VM_ALWAYS_SHOW_TABS, g_value_get_boolean (value));
break;
case PROP_SHOW_ACCELS:
vinagre_prefs_set_bool (prefs, VM_SHOW_ACCELS, g_value_get_boolean (value));
break; break;
case PROP_HISTORY_SIZE: case PROP_HISTORY_SIZE:
vinagre_prefs_set_int (prefs, VM_HISTORY_SIZE, g_value_get_int (value)); g_settings_set_int (prefs->priv->gsettings, VM_HISTORY_SIZE, g_value_get_int (value));
break; break;
case PROP_ACTIVE_PLUGINS: case PROP_ACTIVE_PLUGINS:
vinagre_prefs_set_list (prefs, VM_ACTIVE_PLUGINS, g_value_get_pointer (value)); g_settings_set_strv (prefs->priv->gsettings, VM_ACTIVE_PLUGINS, g_value_get_boxed (value));
break; break;
case PROP_ALWAYS_ENABLE_LISTENING: case PROP_ALWAYS_ENABLE_LISTENING:
vinagre_prefs_set_bool (prefs, VM_ALWAYS_ENABLE_LISTENING, g_value_get_boolean (value)); g_settings_set_boolean (prefs->priv->gsettings, VM_ALWAYS_ENABLE_LISTENING, g_value_get_boolean (value));
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
...@@ -246,22 +121,16 @@ vinagre_prefs_get_property (GObject *object, guint prop_id, GValue *value, GPara ...@@ -246,22 +121,16 @@ vinagre_prefs_get_property (GObject *object, guint prop_id, GValue *value, GPara
switch (prop_id) switch (prop_id)
{ {
case PROP_SHARED_FLAG: case PROP_SHARED_FLAG:
g_value_set_boolean (value, vinagre_prefs_get_bool (prefs, VM_SHARED_FLAG, TRUE)); g_value_set_boolean (value, g_settings_get_boolean (prefs->priv->gsettings, VM_SHARED_FLAG));
break;
case PROP_ALWAYS_SHOW_TABS:
g_value_set_boolean (value, vinagre_prefs_get_bool (prefs, VM_ALWAYS_SHOW_TABS, FALSE));
break;
case PROP_SHOW_ACCELS:
g_value_set_boolean (value, vinagre_prefs_get_bool (prefs, VM_SHOW_ACCELS, TRUE));
break; break;
case PROP_HISTORY_SIZE: case PROP_HISTORY_SIZE:
g_value_set_int (value, vinagre_prefs_get_int (prefs, VM_HISTORY_SIZE, 15)); g_value_set_int (value, g_settings_get_int (prefs->priv->gsettings, VM_HISTORY_SIZE));
break; break;
case PROP_ACTIVE_PLUGINS: case PROP_ACTIVE_PLUGINS:
g_value_set_pointer (value, vinagre_prefs_get_list (prefs, VM_ACTIVE_PLUGINS)); g_value_set_boxed (value, g_settings_get_strv (prefs->priv->gsettings, VM_ACTIVE_PLUGINS));
break; break;
case PROP_ALWAYS_ENABLE_LISTENING: case PROP_ALWAYS_ENABLE_LISTENING:
g_value_set_boolean (value, vinagre_prefs_get_bool (prefs, VM_ALWAYS_ENABLE_LISTENING, FALSE)); g_value_set_boolean (value, g_settings_get_boolean (prefs->priv->gsettings, VM_ALWAYS_ENABLE_LISTENING));
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
...@@ -274,13 +143,10 @@ vinagre_prefs_dispose (GObject *object) ...@@ -274,13 +143,10 @@ vinagre_prefs_dispose (GObject *object)
{ {
VinagrePrefs *prefs = VINAGRE_PREFS (object); VinagrePrefs *prefs = VINAGRE_PREFS (object);
if (prefs->priv->gconf_client) if (prefs->priv->gsettings)
{ {
gconf_client_remove_dir (prefs->priv->gconf_client, g_object_unref (prefs->priv->gsettings);
VINAGRE_BASE_KEY, prefs->priv->gsettings = NULL;
NULL);
g_object_unref (prefs->priv->gconf_client);
prefs->priv->gconf_client = NULL;
} }
G_OBJECT_CLASS (vinagre_prefs_parent_class)->dispose (object); G_OBJECT_CLASS (vinagre_prefs_parent_class)->dispose (object);
...@@ -304,35 +170,22 @@ vinagre_prefs_class_init (VinagrePrefsClass *klass) ...@@ -304,35 +170,22 @@ vinagre_prefs_class_init (VinagrePrefsClass *klass)
"Shared Flag", "Shared Flag",
"Whether we should share the remote connection", "Whether we should share the remote connection",
TRUE, TRUE,
G_PARAM_READWRITE)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_ALWAYS_SHOW_TABS,
g_param_spec_boolean ("always-show-tabs",
"Always show tabs",
"Whether we should show the tabs even when there is ony one active connection",
FALSE,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_SHOW_ACCELS,
g_param_spec_boolean ("show-accels",
"Show menu accelerators",
"Whether we should show the menu accelerators (keyboard shortcuts)",
FALSE,
G_PARAM_READWRITE));
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_HISTORY_SIZE, PROP_HISTORY_SIZE,
g_param_spec_int ("history-size", g_param_spec_int ("history-size",
"History size", "History size",
"Max number of items in history dropdown entry", "Max number of items in history dropdown entry",
0, G_MAXINT, 15, 0, G_MAXINT, 15,
G_PARAM_READWRITE)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_ACTIVE_PLUGINS, PROP_ACTIVE_PLUGINS,
g_param_spec_pointer ("active-plugins", g_param_spec_boxed ("active-plugins",
"Active plugins", "Active plugins",
"The list of active plugins", "The list of active plugins",
G_PARAM_READWRITE)); G_TYPE_STRV,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_ALWAYS_ENABLE_LISTENING, PROP_ALWAYS_ENABLE_LISTENING,
...@@ -340,7 +193,7 @@ vinagre_prefs_class_init (VinagrePrefsClass *klass) ...@@ -340,7 +193,7 @@ vinagre_prefs_class_init (VinagrePrefsClass *klass)
"Always enable listening", "Always enable listening",
"Whether we always should listen for reverse connections", "Whether we always should listen for reverse connections",
FALSE, FALSE,
G_PARAM_READWRITE)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
} }
/* Preferences dialog */ /* Preferences dialog */
...@@ -353,20 +206,6 @@ typedef struct { ...@@ -353,20 +206,6 @@ typedef struct {
GtkWindow *parent; GtkWindow *parent;
} VinagrePrefsDialog; } VinagrePrefsDialog;
static void
vinagre_prefs_dialog_setup (VinagrePrefsDialog *dialog)
{
gboolean show_accels, show_tabs;
g_object_get (vinagre_prefs_get_default (),
"show-accels", &show_accels,
"always-show-tabs", &show_tabs,
NULL);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->show_accels), show_accels);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->show_tabs), show_tabs);
}
static void static void
vinagre_prefs_dialog_response (GtkDialog *d, gint response_id, VinagrePrefsDialog *dialog) vinagre_prefs_dialog_response (GtkDialog *d, gint response_id, VinagrePrefsDialog *dialog)
{ {
...@@ -382,26 +221,11 @@ vinagre_prefs_dialog_response (GtkDialog *d, gint response_id, VinagrePrefsDialo ...@@ -382,26 +221,11 @@ vinagre_prefs_dialog_response (GtkDialog *d, gint response_id, VinagrePrefsDialo
dialog = NULL; dialog = NULL;
} }
static void
vinagre_prefs_dialog_show_tabs_cb (VinagrePrefsDialog *dialog)
{
g_object_set (vinagre_prefs_get_default (),
"always-show-tabs", gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->show_tabs)),
NULL);
}
static void
vinagre_prefs_dialog_show_accels_cb (VinagrePrefsDialog *dialog)
{
g_object_set (vinagre_prefs_get_default (),
"show-accels", gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->show_accels)),
NULL);
}
void void
vinagre_prefs_dialog_show (VinagreWindow *window) vinagre_prefs_dialog_show (VinagreWindow *window)
{ {
VinagrePrefsDialog *dialog; VinagrePrefsDialog *dialog;
VinagrePrefs *pref;
dialog = g_new (VinagrePrefsDialog, 1); dialog = g_new (VinagrePrefsDialog, 1);
...@@ -413,23 +237,15 @@ vinagre_prefs_dialog_show (VinagreWindow *window) ...@@ -413,23 +237,15 @@ vinagre_prefs_dialog_show (VinagreWindow *window)
dialog->show_tabs = GTK_WIDGET (gtk_builder_get_object (dialog->xml, "always_show_tabs_check")); dialog->show_tabs = GTK_WIDGET (gtk_builder_get_object (dialog->xml, "always_show_tabs_check"));
dialog->show_accels = GTK_WIDGET (gtk_builder_get_object (dialog->xml, "show_accels_check")); dialog->show_accels = GTK_WIDGET (gtk_builder_get_object (dialog->xml, "show_accels_check"));
vinagre_prefs_dialog_setup (dialog); pref = vinagre_prefs_get_default ();
g_settings_bind (pref->priv->gsettings, "always-show-tabs", dialog->show_tabs, "active", G_SETTINGS_BIND_DEFAULT);
g_settings_bind (pref->priv->gsettings, "show-accels", dialog->show_accels, "active", G_SETTINGS_BIND_DEFAULT);
g_signal_connect (dialog->dialog, g_signal_connect (dialog->dialog,
"response", "response",
G_CALLBACK (vinagre_prefs_dialog_response), G_CALLBACK (vinagre_prefs_dialog_response),
dialog);