summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-09-05 14:13:02 +0200
committerStefano Karapetsas <[email protected]>2012-09-05 14:13:02 +0200
commitf3fda69cae01b52e65a5608ed7c86d2abbb8f80a (patch)
tree606ee69064e291e4957a81ad434efd3d913e1ab0
parent8e8764286d4a3f65839dfdd4019b4f22fe3eabe4 (diff)
downloadcaja-f3fda69cae01b52e65a5608ed7c86d2abbb8f80a.tar.bz2
caja-f3fda69cae01b52e65a5608ed7c86d2abbb8f80a.tar.xz
convert mouse preferences to gsettings
-rw-r--r--libcaja-private/caja-global-preferences.c15
-rw-r--r--libcaja-private/caja-global-preferences.h6
-rw-r--r--src/caja-navigation-window.c28
3 files changed, 18 insertions, 31 deletions
diff --git a/libcaja-private/caja-global-preferences.c b/libcaja-private/caja-global-preferences.c
index 703a4c29..98b96e46 100644
--- a/libcaja-private/caja-global-preferences.c
+++ b/libcaja-private/caja-global-preferences.c
@@ -535,21 +535,6 @@ static const PreferenceDefault preference_defaults[] =
GINT_TO_POINTER (3)
},
{
- CAJA_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS,
- PREFERENCE_BOOLEAN,
- GINT_TO_POINTER (TRUE)
- },
- {
- CAJA_PREFERENCES_MOUSE_FORWARD_BUTTON,
- PREFERENCE_INTEGER,
- GINT_TO_POINTER (9)
- },
- {
- CAJA_PREFERENCES_MOUSE_BACK_BUTTON,
- PREFERENCE_INTEGER,
- GINT_TO_POINTER (8)
- },
- {
CAJA_PREFERENCES_LOCKDOWN_COMMAND_LINE,
PREFERENCE_BOOLEAN,
GINT_TO_POINTER (FALSE)
diff --git a/libcaja-private/caja-global-preferences.h b/libcaja-private/caja-global-preferences.h
index cb99bddb..03c02175 100644
--- a/libcaja-private/caja-global-preferences.h
+++ b/libcaja-private/caja-global-preferences.h
@@ -72,9 +72,9 @@ G_BEGIN_DECLS
#define CAJA_PREFERENCES_DATE_FORMAT "date-format"
/* Mouse */
-#define CAJA_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS "preferences/mouse_use_extra_buttons"
-#define CAJA_PREFERENCES_MOUSE_FORWARD_BUTTON "preferences/mouse_forward_button"
-#define CAJA_PREFERENCES_MOUSE_BACK_BUTTON "preferences/mouse_back_button"
+#define CAJA_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS "mouse-use-extra-buttons"
+#define CAJA_PREFERENCES_MOUSE_FORWARD_BUTTON "mouse-forward-button"
+#define CAJA_PREFERENCES_MOUSE_BACK_BUTTON "mouse-back-button"
typedef enum
{
diff --git a/src/caja-navigation-window.c b/src/caja-navigation-window.c
index 7043e2d7..827ba154 100644
--- a/src/caja-navigation-window.c
+++ b/src/caja-navigation-window.c
@@ -245,7 +245,7 @@ mouse_back_button_changed (gpointer callback_data)
{
int new_back_button;
- new_back_button = eel_preferences_get_integer (CAJA_PREFERENCES_MOUSE_BACK_BUTTON);
+ new_back_button = g_settings_get_int (caja_preferences, CAJA_PREFERENCES_MOUSE_BACK_BUTTON);
/* Bounds checking */
if (new_back_button < 6 || new_back_button > UPPER_MOUSE_LIMIT)
@@ -259,7 +259,7 @@ mouse_forward_button_changed (gpointer callback_data)
{
int new_forward_button;
- new_forward_button = eel_preferences_get_integer (CAJA_PREFERENCES_MOUSE_FORWARD_BUTTON);
+ new_forward_button = g_settings_get_int (caja_preferences, CAJA_PREFERENCES_MOUSE_FORWARD_BUTTON);
/* Bounds checking */
if (new_forward_button < 6 || new_forward_button > UPPER_MOUSE_LIMIT)
@@ -271,7 +271,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 (CAJA_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS);
+ mouse_extra_buttons = g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS);
}
void
@@ -1286,18 +1286,20 @@ caja_navigation_window_class_init (CajaNavigationWindowClass *class)
g_type_class_add_private (G_OBJECT_CLASS (class), sizeof (CajaNavigationWindowDetails));
+ g_signal_connect_swapped (caja_preferences,
+ "changed::" CAJA_PREFERENCES_MOUSE_BACK_BUTTON,
+ G_CALLBACK(mouse_back_button_changed),
+ NULL);
- eel_preferences_add_callback (CAJA_PREFERENCES_MOUSE_BACK_BUTTON,
- mouse_back_button_changed,
- NULL);
+ g_signal_connect_swapped (caja_preferences,
+ "changed::" CAJA_PREFERENCES_MOUSE_FORWARD_BUTTON,
+ G_CALLBACK(mouse_forward_button_changed),
+ NULL);
- eel_preferences_add_callback (CAJA_PREFERENCES_MOUSE_FORWARD_BUTTON,
- mouse_forward_button_changed,
- NULL);
-
- eel_preferences_add_callback (CAJA_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS,
- use_extra_mouse_buttons_changed,
- NULL);
+ g_signal_connect_swapped (caja_preferences,
+ "changed::" CAJA_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS,
+ G_CALLBACK(use_extra_mouse_buttons_changed),
+ NULL);
}
static CajaWindowSlot *