summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-07-22 13:49:12 +0200
committerAlexander Larsson <alexl@redhat.com>2010-07-23 12:22:54 +0200
commite3777c0e025815fd40908ea826f0091ecfe84fb0 (patch)
tree9b85dc3a4b46aa3e4fd2f0158625738b7a39edcc
parent202b69146a1fb42e147d1ca6f8694b27d8ada28b (diff)
downloadnautilus-e3777c0e025815fd40908ea826f0091ecfe84fb0.tar.gz
Convert mouse prefs to gsettings
-rw-r--r--libnautilus-private/nautilus-global-preferences.c12
-rw-r--r--libnautilus-private/nautilus-global-preferences.h6
-rw-r--r--src/nautilus-navigation-window.c32
3 files changed, 20 insertions, 30 deletions
diff --git a/libnautilus-private/nautilus-global-preferences.c b/libnautilus-private/nautilus-global-preferences.c
index 7561554e2..ca2390573 100644
--- a/libnautilus-private/nautilus-global-preferences.c
+++ b/libnautilus-private/nautilus-global-preferences.c
@@ -470,18 +470,6 @@ static const PreferenceDefault preference_defaults[] = {
PREFERENCE_INTEGER,
GINT_TO_POINTER (3)
},
- { NAUTILUS_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS,
- PREFERENCE_BOOLEAN,
- GINT_TO_POINTER (TRUE)
- },
- { NAUTILUS_PREFERENCES_MOUSE_FORWARD_BUTTON,
- PREFERENCE_INTEGER,
- GINT_TO_POINTER (9)
- },
- { NAUTILUS_PREFERENCES_MOUSE_BACK_BUTTON,
- PREFERENCE_INTEGER,
- GINT_TO_POINTER (8)
- },
{ NAUTILUS_PREFERENCES_LOCKDOWN_COMMAND_LINE,
PREFERENCE_BOOLEAN,
GINT_TO_POINTER (FALSE)
diff --git a/libnautilus-private/nautilus-global-preferences.h b/libnautilus-private/nautilus-global-preferences.h
index 4eb9e1734..13227506d 100644
--- a/libnautilus-private/nautilus-global-preferences.h
+++ b/libnautilus-private/nautilus-global-preferences.h
@@ -72,9 +72,9 @@ G_BEGIN_DECLS
#define NAUTILUS_PREFERENCES_DATE_FORMAT "date-format"
/* Mouse */
-#define NAUTILUS_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS "preferences/mouse_use_extra_buttons"
-#define NAUTILUS_PREFERENCES_MOUSE_FORWARD_BUTTON "preferences/mouse_forward_button"
-#define NAUTILUS_PREFERENCES_MOUSE_BACK_BUTTON "preferences/mouse_back_button"
+#define NAUTILUS_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS "mouse-use-extra-buttons"
+#define NAUTILUS_PREFERENCES_MOUSE_FORWARD_BUTTON "mouse-forward-button"
+#define NAUTILUS_PREFERENCES_MOUSE_BACK_BUTTON "mouse-back-button"
typedef enum
{
diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c
index c7c4a4cfe..0d05e0327 100644
--- a/src/nautilus-navigation-window.c
+++ b/src/nautilus-navigation-window.c
@@ -237,9 +237,9 @@ always_use_browser_changed (gpointer callback_data)
static void
mouse_back_button_changed (gpointer callback_data)
{
- int new_back_button;
+ int new_back_button;
- new_back_button = eel_preferences_get_integer (NAUTILUS_PREFERENCES_MOUSE_BACK_BUTTON);
+ new_back_button = g_settings_get_int (nautilus_preferences, NAUTILUS_PREFERENCES_MOUSE_BACK_BUTTON);
/* Bounds checking */
if (new_back_button < 6 || new_back_button > UPPER_MOUSE_LIMIT)
@@ -251,9 +251,9 @@ mouse_back_button_changed (gpointer callback_data)
static void
mouse_forward_button_changed (gpointer callback_data)
{
- int new_forward_button;
+ int new_forward_button;
- new_forward_button = eel_preferences_get_integer (NAUTILUS_PREFERENCES_MOUSE_FORWARD_BUTTON);
+ new_forward_button = g_settings_get_int (nautilus_preferences, NAUTILUS_PREFERENCES_MOUSE_FORWARD_BUTTON);
/* Bounds checking */
if (new_forward_button < 6 || new_forward_button > UPPER_MOUSE_LIMIT)
@@ -265,7 +265,7 @@ mouse_forward_button_changed (gpointer callback_data)
static void
use_extra_mouse_buttons_changed (gpointer callback_data)
{
- mouse_extra_buttons = eel_preferences_get_boolean (NAUTILUS_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS);
+ mouse_extra_buttons = g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS);
}
void
@@ -1205,18 +1205,20 @@ nautilus_navigation_window_class_init (NautilusNavigationWindowClass *class)
g_type_class_add_private (G_OBJECT_CLASS (class), sizeof (NautilusNavigationWindowDetails));
+ g_signal_connect_swapped (nautilus_preferences,
+ "changed::" NAUTILUS_PREFERENCES_MOUSE_BACK_BUTTON,
+ G_CALLBACK(mouse_back_button_changed),
+ NULL);
- eel_preferences_add_callback (NAUTILUS_PREFERENCES_MOUSE_BACK_BUTTON,
- mouse_back_button_changed,
- NULL);
+ g_signal_connect_swapped (nautilus_preferences,
+ "changed::" NAUTILUS_PREFERENCES_MOUSE_FORWARD_BUTTON,
+ G_CALLBACK(mouse_forward_button_changed),
+ NULL);
- eel_preferences_add_callback (NAUTILUS_PREFERENCES_MOUSE_FORWARD_BUTTON,
- mouse_forward_button_changed,
- NULL);
-
- eel_preferences_add_callback (NAUTILUS_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS,
- use_extra_mouse_buttons_changed,
- NULL);
+ g_signal_connect_swapped (nautilus_preferences,
+ "changed::" NAUTILUS_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS,
+ G_CALLBACK(use_extra_mouse_buttons_changed),
+ NULL);
}
static NautilusWindowSlot *