summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-09-05 12:36:04 +0200
committerStefano Karapetsas <[email protected]>2012-09-05 12:36:04 +0200
commit6f15dc7cc1be8b98bbc1f5edd963ff89076295ee (patch)
tree04a0b2971e10ce57880360f63147b2d137b84b2a /src
parent373da58a33a4242f3d91771fd304ba8bb3d55e61 (diff)
downloadcaja-6f15dc7cc1be8b98bbc1f5edd963ff89076295ee.tar.bz2
caja-6f15dc7cc1be8b98bbc1f5edd963ff89076295ee.tar.xz
start migration to gsettings
Diffstat (limited to 'src')
-rw-r--r--src/caja-application.c23
-rw-r--r--src/caja-emblem-sidebar.h2
-rw-r--r--src/caja-file-management-properties-main.c2
-rw-r--r--src/caja-file-management-properties.c61
-rw-r--r--src/caja-history-sidebar.h2
-rw-r--r--src/caja-information-panel.c70
-rw-r--r--src/caja-information-panel.h2
-rw-r--r--src/caja-main.c8
-rw-r--r--src/caja-navigation-window.c25
-rw-r--r--src/caja-notes-viewer.h2
-rw-r--r--src/caja-pathbar.c10
-rw-r--r--src/caja-places-sidebar.c11
-rw-r--r--src/caja-places-sidebar.h2
-rw-r--r--src/caja-property-browser.c21
-rw-r--r--src/caja-window-menus.c10
-rw-r--r--src/file-manager/Makefile.am2
-rw-r--r--src/file-manager/fm-desktop-icon-view.c12
-rw-r--r--src/file-manager/fm-directory-view.c36
-rw-r--r--src/file-manager/fm-tree-model.c4
-rw-r--r--src/file-manager/fm-tree-view.c22
-rw-r--r--src/file-manager/fm-tree-view.h2
21 files changed, 152 insertions, 177 deletions
diff --git a/src/caja-application.c b/src/caja-application.c
index 50c28a25..54023ec9 100644
--- a/src/caja-application.c
+++ b/src/caja-application.c
@@ -234,7 +234,7 @@ automount_all_volumes (CajaApplication *application)
GMount *mount;
GVolume *volume;
- if (eel_preferences_get_boolean (CAJA_PREFERENCES_MEDIA_AUTOMOUNT))
+ if (g_settings_get_boolean (caja_media_preferences, CAJA_PREFERENCES_MEDIA_AUTOMOUNT))
{
/* automount all mountable volumes at start-up */
volumes = g_volume_monitor_get_volumes (application->volume_monitor);
@@ -974,7 +974,7 @@ caja_application_startup (CajaApplication *application,
char *accel_map_filename;
if (!no_desktop &&
- !eel_preferences_get_boolean (CAJA_PREFERENCES_SHOW_DESKTOP))
+ !g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_SHOW_DESKTOP))
{
no_desktop = TRUE;
}
@@ -999,18 +999,15 @@ caja_application_startup (CajaApplication *application,
}
/* Monitor the preference to show or hide the desktop */
- eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_SHOW_DESKTOP,
- desktop_changed_callback,
- application,
- G_OBJECT (application));
+ g_signal_connect_swapped (caja_preferences, "changed::" CAJA_PREFERENCES_SHOW_DESKTOP,
+ G_CALLBACK(desktop_changed_callback),
+ G_OBJECT (application));
/* Monitor the preference to have the desktop */
/* point to the Unix home folder */
- eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_DESKTOP_IS_HOME_DIR,
- desktop_location_changed_callback,
- NULL,
- G_OBJECT (application));
-
+ g_signal_connect_swapped (caja_preferences, "changed::" CAJA_PREFERENCES_DESKTOP_IS_HOME_DIR,
+ G_CALLBACK(desktop_location_changed_callback),
+ G_OBJECT (application));
/* Create the other windows. */
if (urls != NULL || !no_default_window)
{
@@ -1613,7 +1610,7 @@ desktop_changed_callback (gpointer user_data)
CajaApplication *application;
application = CAJA_APPLICATION (user_data);
- if ( eel_preferences_get_boolean (CAJA_PREFERENCES_SHOW_DESKTOP))
+ if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_SHOW_DESKTOP))
{
caja_application_open_desktop (application);
}
@@ -1639,7 +1636,7 @@ volume_added_callback (GVolumeMonitor *monitor,
GVolume *volume,
CajaApplication *application)
{
- if (eel_preferences_get_boolean (CAJA_PREFERENCES_MEDIA_AUTOMOUNT) &&
+ if (g_settings_get_boolean (caja_media_preferences, CAJA_PREFERENCES_MEDIA_AUTOMOUNT) &&
g_volume_should_automount (volume) &&
g_volume_can_mount (volume))
{
diff --git a/src/caja-emblem-sidebar.h b/src/caja-emblem-sidebar.h
index 249484d1..19238a26 100644
--- a/src/caja-emblem-sidebar.h
+++ b/src/caja-emblem-sidebar.h
@@ -41,7 +41,7 @@
#define CAJA_EMBLEM_SIDEBAR_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), CAJA_TYPE_EMBLEM_SIDEBAR, CajaEmblemSidebarClass))
-#define CAJA_EMBLEM_SIDEBAR_ID "CajaEmblemSidebar"
+#define CAJA_EMBLEM_SIDEBAR_ID "emblems"
typedef struct CajaEmblemSidebarDetails CajaEmblemSidebarDetails;
diff --git a/src/caja-file-management-properties-main.c b/src/caja-file-management-properties-main.c
index ba5ee984..41bf34af 100644
--- a/src/caja-file-management-properties-main.c
+++ b/src/caja-file-management-properties-main.c
@@ -28,6 +28,7 @@
#include <glib/gi18n.h>
#include <libcaja-private/caja-module.h>
+#include <libcaja-private/caja-global-preferences.h>
#include <eel/eel-preferences.h>
@@ -53,6 +54,7 @@ main (int argc, char *argv[])
gtk_init (&argc, &argv);
eel_preferences_init ("/apps/caja");
+ caja_global_preferences_init ();
caja_module_setup ();
diff --git a/src/caja-file-management-properties.c b/src/caja-file-management-properties.c
index ade5e081..ec187c1e 100644
--- a/src/caja-file-management-properties.c
+++ b/src/caja-file-management-properties.c
@@ -172,6 +172,8 @@ static const char * const icon_captions_components[] =
NULL
};
+static void caja_file_management_properties_dialog_update_media_sensitivity (GtkBuilder *builder);
+
static void
caja_file_management_properties_size_group_create (GtkBuilder *builder,
char *prefix,
@@ -268,6 +270,9 @@ caja_file_management_properties_dialog_response_cb (GtkDialog *parent,
eel_mateconf_monitor_remove ("/apps/caja/list_view");
eel_mateconf_monitor_remove ("/apps/caja/preferences");
eel_mateconf_monitor_remove ("/desktop/mate/file_views");
+ g_signal_handlers_disconnect_by_func (caja_media_preferences,
+ caja_file_management_properties_dialog_update_media_sensitivity,
+ builder);
}
}
@@ -551,7 +556,7 @@ static void
caja_file_management_properties_dialog_update_media_sensitivity (GtkBuilder *builder)
{
gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "media_handling_vbox")),
- ! eel_preferences_get_boolean (CAJA_PREFERENCES_MEDIA_AUTORUN_NEVER));
+ ! g_settings_get_boolean (caja_media_preferences, CAJA_PREFERENCES_MEDIA_AUTORUN_NEVER));
}
static void
@@ -699,6 +704,17 @@ skip:
caja_file_management_properties_dialog_update_media_sensitivity (builder);
}
+static void
+bind_builder_bool (GtkBuilder *builder,
+ GSettings *settings,
+ const char *widget_name,
+ const char *prefs)
+{
+ g_settings_bind (settings, prefs,
+ gtk_builder_get_object (builder, widget_name),
+ "active", G_SETTINGS_BIND_DEFAULT);
+}
+
static void
caja_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow *window)
{
@@ -745,25 +761,23 @@ caja_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow *wi
CAJA_FILE_MANAGEMENT_PROPERTIES_ALWAYS_USE_BROWSER_WIDGET,
CAJA_PREFERENCES_ALWAYS_USE_BROWSER);
- eel_preferences_builder_connect_bool (builder,
- CAJA_FILE_MANAGEMENT_PROPERTIES_MEDIA_AUTOMOUNT_OPEN,
- CAJA_PREFERENCES_MEDIA_AUTOMOUNT_OPEN);
- eel_preferences_builder_connect_bool (builder,
- CAJA_FILE_MANAGEMENT_PROPERTIES_MEDIA_AUTORUN_NEVER,
- CAJA_PREFERENCES_MEDIA_AUTORUN_NEVER);
-
- eel_preferences_builder_connect_bool (builder,
- CAJA_FILE_MANAGEMENT_PROPERTIES_TRASH_CONFIRM_WIDGET,
- CAJA_PREFERENCES_CONFIRM_TRASH);
- eel_preferences_builder_connect_bool (builder,
- CAJA_FILE_MANAGEMENT_PROPERTIES_TRASH_DELETE_WIDGET,
- CAJA_PREFERENCES_ENABLE_DELETE);
- eel_preferences_builder_connect_bool (builder,
- CAJA_FILE_MANAGEMENT_PROPERTIES_SHOW_HIDDEN_WIDGET,
- CAJA_PREFERENCES_SHOW_HIDDEN_FILES);
- eel_preferences_builder_connect_bool_slave (builder,
- CAJA_FILE_MANAGEMENT_PROPERTIES_SHOW_HIDDEN_WIDGET,
- CAJA_PREFERENCES_SHOW_BACKUP_FILES);
+ bind_builder_bool (builder, caja_media_preferences,
+ CAJA_FILE_MANAGEMENT_PROPERTIES_MEDIA_AUTOMOUNT_OPEN,
+ CAJA_PREFERENCES_MEDIA_AUTOMOUNT_OPEN);
+ bind_builder_bool (builder, caja_media_preferences,
+ CAJA_FILE_MANAGEMENT_PROPERTIES_MEDIA_AUTORUN_NEVER,
+ CAJA_PREFERENCES_MEDIA_AUTORUN_NEVER);
+
+ bind_builder_bool (builder, caja_preferences,
+ CAJA_FILE_MANAGEMENT_PROPERTIES_TRASH_CONFIRM_WIDGET,
+ CAJA_PREFERENCES_CONFIRM_TRASH);
+
+ bind_builder_bool (builder, caja_preferences,
+ CAJA_FILE_MANAGEMENT_PROPERTIES_TRASH_DELETE_WIDGET,
+ CAJA_PREFERENCES_ENABLE_DELETE);
+ bind_builder_bool (builder, caja_preferences,
+ CAJA_FILE_MANAGEMENT_PROPERTIES_SHOW_HIDDEN_WIDGET,
+ CAJA_PREFERENCES_SHOW_HIDDEN_FILES);
eel_preferences_builder_connect_bool (builder,
CAJA_FILE_MANAGEMENT_PROPERTIES_TREE_VIEW_FOLDERS_WIDGET,
CAJA_PREFERENCES_TREE_SHOW_ONLY_DIRECTORIES);
@@ -831,9 +845,10 @@ caja_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow *wi
caja_file_management_properties_dialog_setup_list_column_page (builder);
caja_file_management_properties_dialog_setup_media_page (builder);
- eel_preferences_add_callback (CAJA_PREFERENCES_MEDIA_AUTORUN_NEVER,
- (EelPreferencesCallback ) caja_file_management_properties_dialog_update_media_sensitivity,
- g_object_ref (builder));
+ g_signal_connect_swapped (caja_media_preferences,
+ "changed::" CAJA_PREFERENCES_MEDIA_AUTORUN_NEVER,
+ G_CALLBACK(caja_file_management_properties_dialog_update_media_sensitivity),
+ builder);
/* UI callbacks */
diff --git a/src/caja-history-sidebar.h b/src/caja-history-sidebar.h
index b7e3cb40..45740e24 100644
--- a/src/caja-history-sidebar.h
+++ b/src/caja-history-sidebar.h
@@ -31,7 +31,7 @@
#include <libcaja-private/caja-view.h>
#include <libcaja-private/caja-window-info.h>
-#define CAJA_HISTORY_SIDEBAR_ID "CajaHistorySidebar"
+#define CAJA_HISTORY_SIDEBAR_ID "history"
#define CAJA_TYPE_HISTORY_SIDEBAR caja_history_sidebar_get_type()
#define CAJA_HISTORY_SIDEBAR(obj) \
diff --git a/src/caja-information-panel.c b/src/caja-information-panel.c
index a7a978fb..35df28ca 100644
--- a/src/caja-information-panel.c
+++ b/src/caja-information-panel.c
@@ -84,7 +84,9 @@ static void caja_information_panel_drag_data_received (GtkWidget
static void caja_information_panel_read_defaults (CajaInformationPanel *information_panel);
static void caja_information_panel_style_set (GtkWidget *widget,
GtkStyle *previous_style);
-static void caja_information_panel_theme_changed (gpointer user_data);
+static void caja_information_panel_theme_changed (GSettings *settings,
+ const gchar *key,
+ gpointer user_data);
static void caja_information_panel_update_appearance (CajaInformationPanel *information_panel);
static void caja_information_panel_update_buttons (CajaInformationPanel *information_panel);
static void background_metadata_changed_callback (CajaInformationPanel *information_panel);
@@ -273,9 +275,18 @@ caja_information_panel_init (CajaInformationPanel *information_panel)
make_button_box (information_panel);
/* add a callback for when the theme changes */
- eel_preferences_add_callback (CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_SET, caja_information_panel_theme_changed, information_panel);
- eel_preferences_add_callback (CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_COLOR, caja_information_panel_theme_changed, information_panel);
- eel_preferences_add_callback (CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_FILENAME, caja_information_panel_theme_changed, information_panel);
+ g_signal_connect (caja_preferences,
+ "changed::" CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_SET,
+ G_CALLBACK(caja_information_panel_theme_changed),
+ information_panel);
+ g_signal_connect (caja_preferences,
+ "changed::" CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_COLOR,
+ G_CALLBACK(caja_information_panel_theme_changed),
+ information_panel);
+ g_signal_connect (caja_preferences,
+ "changed::" CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_URI,
+ G_CALLBACK(caja_information_panel_theme_changed),
+ information_panel);
/* prepare ourselves to receive dropped objects */
gtk_drag_dest_set (GTK_WIDGET (information_panel),
@@ -303,15 +314,9 @@ caja_information_panel_finalize (GObject *object)
g_free (information_panel->details->current_background_image);
g_free (information_panel->details);
- eel_preferences_remove_callback (CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_SET,
- caja_information_panel_theme_changed,
- information_panel);
- eel_preferences_remove_callback (CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_COLOR,
- caja_information_panel_theme_changed,
- information_panel);
- eel_preferences_remove_callback (CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_FILENAME,
- caja_information_panel_theme_changed,
- information_panel);
+ g_signal_handlers_disconnect_by_func (caja_preferences,
+ caja_information_panel_theme_changed,
+ information_panel);
EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
@@ -375,14 +380,14 @@ caja_information_panel_read_defaults (CajaInformationPanel *information_panel)
gboolean background_set;
char *background_color, *background_image;
- background_set = eel_preferences_get_boolean (CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_SET);
+ background_set = g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_SET);
background_color = NULL;
background_image = NULL;
if (background_set)
{
- background_color = eel_preferences_get (CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_COLOR);
- background_image = eel_preferences_get (CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_FILENAME);
+ background_color = g_settings_get_string (caja_preferences, CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_COLOR);
+ background_image = g_settings_get_string (caja_preferences, CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_URI);
}
g_free (information_panel->details->default_background_color);
@@ -409,7 +414,9 @@ caja_information_panel_read_defaults (CajaInformationPanel *information_panel)
/* handler for handling theme changes */
static void
-caja_information_panel_theme_changed (gpointer user_data)
+caja_information_panel_theme_changed (GSettings *settings,
+ const gchar *key,
+ gpointer user_data)
{
CajaInformationPanel *information_panel;
@@ -737,12 +744,18 @@ background_settings_changed_callback (EelBackground *background, GdkDragAction a
NULL,
NULL);
- eel_preferences_set
- (CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_COLOR, color ? color : "");
- eel_preferences_set
- (CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_FILENAME, image ? image : "");
- eel_preferences_set_boolean
- (CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_SET, TRUE);
+ g_signal_handlers_block_by_func (caja_preferences,
+ G_CALLBACK(caja_information_panel_theme_changed),
+ information_panel);
+ g_settings_set_string (caja_preferences,
+ CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_COLOR, color ? color : "");
+ g_settings_set_string (caja_preferences,
+ CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_URI, image ? image : "");
+ g_settings_set_boolean (caja_preferences,
+ CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_SET, TRUE);
+ g_signal_handlers_unblock_by_func (caja_preferences,
+ G_CALLBACK(caja_information_panel_theme_changed),
+ information_panel);
}
else
{
@@ -819,7 +832,14 @@ background_reset_callback (EelBackground *background, CajaInformationPanel *info
}
else
{
- eel_preferences_set_boolean (CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_SET, FALSE);
+ g_signal_handlers_block_by_func (caja_preferences,
+ G_CALLBACK(caja_information_panel_theme_changed),
+ information_panel);
+ g_settings_set_boolean (caja_preferences,
+ CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_SET, FALSE);
+ g_signal_handlers_unblock_by_func (caja_preferences,
+ G_CALLBACK(caja_information_panel_theme_changed),
+ information_panel);
}
g_signal_handlers_unblock_by_func (information_panel->details->file,
@@ -1149,7 +1169,7 @@ caja_information_panel_style_set (GtkWidget *widget, GtkStyle *previous_style)
information_panel = CAJA_INFORMATION_PANEL (widget);
- caja_information_panel_theme_changed (information_panel);
+ caja_information_panel_theme_changed (NULL, NULL, information_panel);
}
static void
diff --git a/src/caja-information-panel.h b/src/caja-information-panel.h
index b6df023d..75bcfcbb 100644
--- a/src/caja-information-panel.h
+++ b/src/caja-information-panel.h
@@ -44,7 +44,7 @@
typedef struct CajaInformationPanelDetails CajaInformationPanelDetails;
-#define CAJA_INFORMATION_PANEL_ID "CajaInformationPanel"
+#define CAJA_INFORMATION_PANEL_ID "information"
typedef struct
{
diff --git a/src/caja-main.c b/src/caja-main.c
index 4e6f27f1..52b208b9 100644
--- a/src/caja-main.c
+++ b/src/caja-main.c
@@ -496,14 +496,6 @@ main (int argc, char *argv[])
/* exit_with_last_window being FALSE, caja can run without window. */
exit_with_last_window = eel_preferences_get_boolean (CAJA_PREFERENCES_EXIT_WITH_LAST_WINDOW);
- if (no_desktop)
- {
- eel_preferences_set_is_invisible
- (CAJA_PREFERENCES_SHOW_DESKTOP, TRUE);
- eel_preferences_set_is_invisible
- (CAJA_PREFERENCES_DESKTOP_IS_HOME_DIR, TRUE);
- }
-
application = NULL;
/* Do either the self-check or the real work. */
diff --git a/src/caja-navigation-window.c b/src/caja-navigation-window.c
index ee6de1c1..7043e2d7 100644
--- a/src/caja-navigation-window.c
+++ b/src/caja-navigation-window.c
@@ -89,7 +89,6 @@ enum
ARG_APP
};
-static int side_pane_width_auto_value = 0;
/* Forward and back buttons on the mouse */
@@ -382,11 +381,11 @@ side_pane_size_allocate_callback (GtkWidget *widget,
if (allocation->width != window->details->side_pane_width)
{
window->details->side_pane_width = allocation->width;
- if (eel_preferences_key_is_writable (CAJA_PREFERENCES_SIDEBAR_WIDTH))
+ if (g_settings_is_writable (caja_preferences, CAJA_PREFERENCES_SIDEBAR_WIDTH))
{
- eel_preferences_set_integer
- (CAJA_PREFERENCES_SIDEBAR_WIDTH,
- allocation->width <= 1 ? 0 : allocation->width);
+ g_settings_set_int (caja_preferences,
+ CAJA_PREFERENCES_SIDEBAR_WIDTH,
+ allocation->width <= 1 ? 0 : allocation->width);
}
}
}
@@ -394,22 +393,14 @@ side_pane_size_allocate_callback (GtkWidget *widget,
static void
setup_side_pane_width (CajaNavigationWindow *window)
{
- static gboolean setup_auto_value= TRUE;
-
g_return_if_fail (window->sidebar != NULL);
- if (setup_auto_value)
- {
- setup_auto_value = FALSE;
- eel_preferences_add_auto_integer
- (CAJA_PREFERENCES_SIDEBAR_WIDTH,
- &side_pane_width_auto_value);
- }
-
- window->details->side_pane_width = side_pane_width_auto_value;
+ window->details->side_pane_width =
+ g_settings_get_int (caja_preferences,
+ CAJA_PREFERENCES_SIDEBAR_WIDTH);
gtk_paned_set_position (GTK_PANED (window->details->content_paned),
- side_pane_width_auto_value);
+ window->details->side_pane_width);
}
static void
diff --git a/src/caja-notes-viewer.h b/src/caja-notes-viewer.h
index b5a4d7c7..ab5965f5 100644
--- a/src/caja-notes-viewer.h
+++ b/src/caja-notes-viewer.h
@@ -30,7 +30,7 @@
#include <libcaja-private/caja-view.h>
#include <libcaja-private/caja-window-info.h>
-#define CAJA_NOTES_SIDEBAR_ID "CajaNotesSidebar"
+#define CAJA_NOTES_SIDEBAR_ID "notes"
#define CAJA_TYPE_NOTES_VIEWER caja_notes_viewer_get_type()
#define CAJA_NOTES_VIEWER(obj) \
diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c
index 1e43bd35..e3e2a1a8 100644
--- a/src/caja-pathbar.c
+++ b/src/caja-pathbar.c
@@ -317,10 +317,9 @@ caja_path_bar_init (CajaPathBar *path_bar)
path_bar->root_path = g_file_new_for_path ("/");
desktop_is_home = g_file_equal (path_bar->home_path, path_bar->desktop_path);
- eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_DESKTOP_IS_HOME_DIR,
- desktop_location_changed_callback,
- path_bar,
- G_OBJECT (path_bar));
+ g_signal_connect_swapped (caja_preferences, "changed::" CAJA_PREFERENCES_DESKTOP_IS_HOME_DIR,
+ G_CALLBACK(desktop_location_changed_callback),
+ path_bar);
g_signal_connect_swapped (path_bar->up_slider_button, "clicked", G_CALLBACK (caja_path_bar_scroll_up), path_bar);
g_signal_connect_swapped (path_bar->down_slider_button, "clicked", G_CALLBACK (caja_path_bar_scroll_down), path_bar);
@@ -444,6 +443,9 @@ caja_path_bar_finalize (GObject *object)
g_signal_handlers_disconnect_by_func (caja_trash_monitor_get (),
trash_state_changed_cb, path_bar);
+ g_signal_handlers_disconnect_by_func (caja_preferences,
+ desktop_location_changed_callback,
+ path_bar);
G_OBJECT_CLASS (caja_path_bar_parent_class)->finalize (object);
}
diff --git a/src/caja-places-sidebar.c b/src/caja-places-sidebar.c
index dff9618a..ae63fa25 100644
--- a/src/caja-places-sidebar.c
+++ b/src/caja-places-sidebar.c
@@ -2854,10 +2854,9 @@ caja_places_sidebar_init (CajaPlacesSidebar *sidebar)
eel_gtk_tree_view_set_activate_on_single_click (sidebar->tree_view,
TRUE);
- eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_DESKTOP_IS_HOME_DIR,
- desktop_location_changed_callback,
- sidebar,
- G_OBJECT (sidebar));
+ g_signal_connect_swapped (caja_preferences, "changed::" CAJA_PREFERENCES_DESKTOP_IS_HOME_DIR,
+ G_CALLBACK(desktop_location_changed_callback),
+ sidebar);
g_signal_connect_object (caja_trash_monitor_get (),
"trash_state_changed",
@@ -2900,6 +2899,10 @@ caja_places_sidebar_dispose (GObject *object)
eel_remove_weak_pointer (&(sidebar->go_to_after_mount_slot));
+ g_signal_handlers_disconnect_by_func (caja_preferences,
+ desktop_location_changed_callback,
+ sidebar);
+
G_OBJECT_CLASS (caja_places_sidebar_parent_class)->dispose (object);
}
diff --git a/src/caja-places-sidebar.h b/src/caja-places-sidebar.h
index 81527524..e4d36a9f 100644
--- a/src/caja-places-sidebar.h
+++ b/src/caja-places-sidebar.h
@@ -28,7 +28,7 @@
#include <libcaja-private/caja-window-info.h>
#include <gtk/gtk.h>
-#define CAJA_PLACES_SIDEBAR_ID "CajaPlacesSidebar"
+#define CAJA_PLACES_SIDEBAR_ID "places"
#define CAJA_TYPE_PLACES_SIDEBAR caja_places_sidebar_get_type()
#define CAJA_PLACES_SIDEBAR(obj) \
diff --git a/src/caja-property-browser.c b/src/caja-property-browser.c
index 5c5830d3..c74177d3 100644
--- a/src/caja-property-browser.c
+++ b/src/caja-property-browser.c
@@ -155,7 +155,6 @@ static void caja_property_browser_drag_data_get (GtkWidget
GtkSelectionData *selection_data,
guint info,
guint32 time);
-static void caja_property_browser_theme_changed (gpointer user_data);
static void emit_emblems_changed_signal (void);
static void emblems_changed_callback (GObject *signaller,
CajaPropertyBrowser *property_browser);
@@ -390,11 +389,6 @@ caja_property_browser_init (GtkObject *object)
/* the actual contents are created when necessary */
property_browser->details->content_frame = NULL;
- /* add a callback for when the theme changes */
- eel_preferences_add_callback (CAJA_PREFERENCES_THEME,
- caja_property_browser_theme_changed,
- property_browser);
-
g_signal_connect (property_browser, "delete_event",
G_CALLBACK (caja_property_browser_delete_event_callback), NULL);
g_signal_connect (property_browser, "hide",
@@ -454,10 +448,6 @@ caja_property_browser_destroy (GtkObject *object)
g_free (property_browser->details);
- eel_preferences_remove_callback (CAJA_PREFERENCES_THEME,
- caja_property_browser_theme_changed,
- property_browser);
-
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
@@ -2072,17 +2062,6 @@ make_properties_from_xml_node (CajaPropertyBrowser *property_browser,
}
}
-/* handle theme changes by updating the browser contents */
-
-static void
-caja_property_browser_theme_changed (gpointer user_data)
-{
- CajaPropertyBrowser *property_browser;
-
- property_browser = CAJA_PROPERTY_BROWSER(user_data);
- caja_property_browser_update_contents (property_browser);
-}
-
/* make_category generates widgets corresponding all of the objects in the passed in directory */
static void
make_category(CajaPropertyBrowser *property_browser, const char* path, const char* mode, xmlNodePtr node, const char *description)
diff --git a/src/caja-window-menus.c b/src/caja-window-menus.c
index 01fd7291..06aa51ff 100644
--- a/src/caja-window-menus.c
+++ b/src/caja-window-menus.c
@@ -437,7 +437,7 @@ show_hidden_files_preference_callback (gpointer callback_data)
/* update button */
g_signal_handlers_block_by_func (action, action_show_hidden_files_callback, window);
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
- eel_preferences_get_boolean (CAJA_PREFERENCES_SHOW_HIDDEN_FILES));
+ g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_SHOW_HIDDEN_FILES));
g_signal_handlers_unblock_by_func (action, action_show_hidden_files_callback, window);
/* inform views */
@@ -992,13 +992,13 @@ caja_window_initialize_menus (CajaWindow *window)
action = gtk_action_group_get_action (action_group, CAJA_ACTION_SHOW_HIDDEN_FILES);
g_signal_handlers_block_by_func (action, action_show_hidden_files_callback, window);
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
- eel_preferences_get_boolean (CAJA_PREFERENCES_SHOW_HIDDEN_FILES));
+ g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_SHOW_HIDDEN_FILES));
g_signal_handlers_unblock_by_func (action, action_show_hidden_files_callback, window);
- eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_SHOW_HIDDEN_FILES,
- show_hidden_files_preference_callback,
- window, G_OBJECT (window));
+ g_signal_connect_swapped (caja_preferences, "changed::" CAJA_PREFERENCES_SHOW_HIDDEN_FILES,
+ G_CALLBACK(show_hidden_files_preference_callback),
+ window);
window->details->ui_manager = gtk_ui_manager_new ();
ui_manager = window->details->ui_manager;
diff --git a/src/file-manager/Makefile.am b/src/file-manager/Makefile.am
index 4090fc91..e73afbed 100644
--- a/src/file-manager/Makefile.am
+++ b/src/file-manager/Makefile.am
@@ -12,8 +12,6 @@ INCLUDES = \
$(DISABLE_DEPRECATED_CFLAGS) \
$(NULL)
-
-
libcaja_file_manager_la_SOURCES = \
fm-actions.h \
fm-desktop-icon-view.c \
diff --git a/src/file-manager/fm-desktop-icon-view.c b/src/file-manager/fm-desktop-icon-view.c
index 65ee3e12..86d1cce6 100644
--- a/src/file-manager/fm-desktop-icon-view.c
+++ b/src/file-manager/fm-desktop-icon-view.c
@@ -308,6 +308,10 @@ fm_desktop_icon_view_finalize (GObject *object)
lockdown_disable_command_line_changed_callback,
icon_view);
+ g_signal_handlers_disconnect_by_func (caja_preferences,
+ desktop_directory_changed_callback,
+ NULL);
+
g_free (icon_view->details);
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -531,7 +535,7 @@ fm_desktop_icon_view_update_icon_container_fonts (FMDesktopIconView *icon_view)
icon_container = get_icon_container (icon_view);
g_assert (icon_container != NULL);
- font = eel_preferences_get (CAJA_PREFERENCES_DESKTOP_FONT);
+ font = g_settings_get_string (caja_preferences, CAJA_PREFERENCES_DESKTOP_FONT);
caja_icon_container_set_font (icon_container, font);
@@ -547,9 +551,9 @@ fm_desktop_icon_view_init (FMDesktopIconView *desktop_icon_view)
if (desktop_directory == NULL)
{
- eel_preferences_add_callback (CAJA_PREFERENCES_DESKTOP_IS_HOME_DIR,
- desktop_directory_changed_callback,
- NULL);
+ g_signal_connect_swapped (caja_preferences, "changed::" CAJA_PREFERENCES_DESKTOP_IS_HOME_DIR,
+ G_CALLBACK(desktop_directory_changed_callback),
+ NULL);
desktop_directory_changed_callback (NULL);
}
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index a6598e2e..5b304f13 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -152,9 +152,6 @@ static guint signals[LAST_SIGNAL];
static GdkAtom copied_files_atom;
-static gboolean show_delete_command_auto_value;
-static gboolean confirm_trash_auto_value;
-
static char *scripts_directory_uri;
static int scripts_directory_uri_length;
@@ -235,7 +232,6 @@ struct FMDirectoryViewDetails
gboolean show_foreign_files;
gboolean show_hidden_files;
- gboolean show_backup_files;
gboolean ignore_hidden_file_preferences;
gboolean batching_selection_level;
@@ -1766,7 +1762,7 @@ add_directory_to_directory_list (FMDirectoryView *view,
CAJA_FILE_ATTRIBUTE_DIRECTORY_ITEM_COUNT;
caja_directory_file_monitor_add (directory, directory_list,
- FALSE, FALSE, attributes,
+ FALSE, attributes,
(CajaDirectoryCallback)changed_callback, view);
g_signal_connect_object (directory, "files_added",
@@ -1987,19 +1983,10 @@ fm_directory_view_init_view_iface (CajaViewIface *iface)
static void
fm_directory_view_init (FMDirectoryView *view)
{
- static gboolean setup_autos = FALSE;
CajaDirectory *scripts_directory;
CajaDirectory *templates_directory;
char *templates_uri;
- if (!setup_autos) {
- setup_autos = TRUE;
- eel_preferences_add_auto_boolean (CAJA_PREFERENCES_CONFIRM_TRASH,
- &confirm_trash_auto_value);
- eel_preferences_add_auto_boolean (CAJA_PREFERENCES_ENABLE_DELETE,
- &show_delete_command_auto_value);
- }
-
view->details = g_new0 (FMDirectoryViewDetails, 1);
/* Default to true; desktop-icon-view sets to false */
@@ -2052,8 +2039,6 @@ fm_directory_view_init (FMDirectoryView *view)
gtk_widget_show (GTK_WIDGET (view));
- eel_preferences_add_callback (CAJA_PREFERENCES_CONFIRM_TRASH,
- schedule_update_menus_callback, view);
eel_preferences_add_callback (CAJA_PREFERENCES_ENABLE_DELETE,
schedule_update_menus_callback, view);
eel_preferences_add_callback (CAJA_PREFERENCES_ICON_VIEW_CAPTIONS,
@@ -2183,8 +2168,6 @@ fm_directory_view_finalize (GObject *object)
view = FM_DIRECTORY_VIEW (object);
- eel_preferences_remove_callback (CAJA_PREFERENCES_CONFIRM_TRASH,
- schedule_update_menus_callback, view);
eel_preferences_remove_callback (CAJA_PREFERENCES_ENABLE_DELETE,
schedule_update_menus_callback, view);
eel_preferences_remove_callback (CAJA_PREFERENCES_ICON_VIEW_CAPTIONS,
@@ -3421,7 +3404,6 @@ fm_directory_view_add_subdirectory (FMDirectoryView *view,
caja_directory_file_monitor_add (directory,
&view->details->model,
view->details->show_hidden_files,
- view->details->show_backup_files,
attributes,
files_added_callback, view);
@@ -5521,7 +5503,7 @@ update_directory_in_scripts_menu (FMDirectoryView *view, CajaDirectory *director
g_free (escaped_path);
file_list = caja_directory_get_file_list (directory);
- filtered = caja_file_list_filter_hidden_and_backup (file_list, FALSE, FALSE);
+ filtered = caja_file_list_filter_hidden (file_list, FALSE);
caja_file_list_free (file_list);
file_list = caja_file_list_sort_by_display_name (filtered);
@@ -5775,7 +5757,7 @@ update_directory_in_templates_menu (FMDirectoryView *view,
g_free (escaped_path);
file_list = caja_directory_get_file_list (directory);
- filtered = caja_file_list_filter_hidden_and_backup (file_list, FALSE, FALSE);
+ filtered = caja_file_list_filter_hidden (file_list, FALSE);
caja_file_list_free (file_list);
file_list = caja_file_list_sort_by_display_name (filtered);
@@ -7197,21 +7179,18 @@ fm_directory_view_init_show_hidden_files (FMDirectoryView *view)
mode = caja_window_info_get_hidden_files_mode (view->details->window);
if (mode == CAJA_WINDOW_SHOW_HIDDEN_FILES_DEFAULT) {
- show_hidden_default_setting = eel_preferences_get_boolean (CAJA_PREFERENCES_SHOW_HIDDEN_FILES);
+ show_hidden_default_setting = g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_SHOW_HIDDEN_FILES);
if (show_hidden_default_setting != view->details->show_hidden_files) {
view->details->show_hidden_files = show_hidden_default_setting;
- view->details->show_backup_files = show_hidden_default_setting;
show_hidden_changed = TRUE;
}
} else {
if (mode == CAJA_WINDOW_SHOW_HIDDEN_FILES_ENABLE) {
show_hidden_changed = !view->details->show_hidden_files;
view->details->show_hidden_files = TRUE;
- view->details->show_backup_files = TRUE;
} else {
show_hidden_changed = view->details->show_hidden_files;
view->details->show_hidden_files = FALSE;
- view->details->show_backup_files = FALSE;
}
}
@@ -8566,7 +8545,7 @@ real_update_location_menu (FMDirectoryView *view)
} else {
label = _("Mo_ve to Trash");
tip = _("Move the open folder to the Trash");
- show_separate_delete_command = show_delete_command_auto_value;
+ show_separate_delete_command = g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_ENABLE_DELETE);
}
action = gtk_action_group_get_action (view->details->dir_action_group,
@@ -8891,7 +8870,7 @@ real_update_menus (FMDirectoryView *view)
} else {
label = _("Mo_ve to Trash");
tip = _("Move each selected item to the Trash");
- show_separate_delete_command = show_delete_command_auto_value;
+ show_separate_delete_command = g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_ENABLE_DELETE);
}
action = gtk_action_group_get_action (view->details->dir_action_group,
@@ -9552,7 +9531,6 @@ finish_loading (FMDirectoryView *view)
caja_directory_file_monitor_add (view->details->model,
&view->details->model,
view->details->show_hidden_files,
- view->details->show_backup_files,
attributes,
files_added_callback, view);
@@ -9948,7 +9926,6 @@ fm_directory_view_should_show_file (FMDirectoryView *view, CajaFile *file)
{
return caja_file_should_show (file,
view->details->show_hidden_files,
- view->details->show_backup_files,
view->details->show_foreign_files);
}
@@ -10061,7 +10038,6 @@ fm_directory_view_ignore_hidden_file_preferences (FMDirectoryView *view)
}
view->details->show_hidden_files = FALSE;
- view->details->show_backup_files = FALSE;
view->details->ignore_hidden_file_preferences = TRUE;
}
diff --git a/src/file-manager/fm-tree-model.c b/src/file-manager/fm-tree-model.c
index bbcdbb42..15071b8c 100644
--- a/src/file-manager/fm-tree-model.c
+++ b/src/file-manager/fm-tree-model.c
@@ -101,7 +101,6 @@ struct FMTreeModelDetails
guint monitoring_update_idle_id;
gboolean show_hidden_files;
- gboolean show_backup_files;
gboolean show_only_directories;
GList *highlighted_files;
@@ -989,7 +988,6 @@ should_show_file (FMTreeModel *model, CajaFile *file)
should = caja_file_should_show (file,
model->details->show_hidden_files,
- model->details->show_backup_files,
TRUE);
if (should
@@ -1226,7 +1224,6 @@ start_monitoring_directory (FMTreeModel *model, TreeNode *node)
attributes = get_tree_monitor_attributes ();
caja_directory_file_monitor_add (directory, model,
model->details->show_hidden_files,
- model->details->show_backup_files,
attributes, files_changed_callback, node->root);
}
@@ -1890,7 +1887,6 @@ fm_tree_model_set_show_hidden_files (FMTreeModel *model,
return;
}
model->details->show_hidden_files = show_hidden_files;
- model->details->show_backup_files = show_hidden_files;
stop_monitoring (model);
if (!show_hidden_files)
{
diff --git a/src/file-manager/fm-tree-view.c b/src/file-manager/fm-tree-view.c
index 53b1f85a..d56f5a6e 100644
--- a/src/file-manager/fm-tree-view.c
+++ b/src/file-manager/fm-tree-view.c
@@ -118,7 +118,6 @@ typedef struct
} PrependURIParameters;
static GdkAtom copied_files_atom;
-static gboolean show_delete_command_auto_value;
static void fm_tree_view_iface_init (CajaSidebarIface *iface);
static void sidebar_provider_iface_init (CajaSidebarProviderIface *iface);
@@ -811,7 +810,7 @@ button_pressed_callback (GtkTreeView *treeview, GdkEventButton *event,
can_move_file_to_trash = caja_file_can_trash (view->details->popup_file);
gtk_widget_set_sensitive (view->details->popup_trash, can_move_file_to_trash);
- if (show_delete_command_auto_value)
+ if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_ENABLE_DELETE))
{
parent_file_is_writable = is_parent_writable (view->details->popup_file);
file_is_home_or_desktop = caja_file_is_home (view->details->popup_file)
@@ -1137,7 +1136,7 @@ fm_tree_view_delete_cb (GtkWidget *menu_item,
{
GList *location_list;
- if (!show_delete_command_auto_value)
+ if (!g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_ENABLE_DELETE))
{
return;
}
@@ -1533,7 +1532,7 @@ update_filtering_from_preferences (FMTreeView *view)
{
fm_tree_model_set_show_hidden_files
(view->details->child_model,
- eel_preferences_get_boolean (CAJA_PREFERENCES_SHOW_HIDDEN_FILES));
+ g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_SHOW_HIDDEN_FILES));
}
else
{
@@ -1600,10 +1599,10 @@ fm_tree_view_init (FMTreeView *view)
view->details->selecting = FALSE;
- eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_SHOW_HIDDEN_FILES,
- filtering_changed_callback, view, G_OBJECT (view));
- eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_SHOW_BACKUP_FILES,
- filtering_changed_callback, view, G_OBJECT (view));
+ g_signal_connect_swapped (caja_preferences,
+ "changed::" CAJA_PREFERENCES_SHOW_HIDDEN_FILES,
+ G_CALLBACK(filtering_changed_callback),
+ view);
eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_TREE_SHOW_ONLY_DIRECTORIES,
filtering_changed_callback, view, G_OBJECT (view));
@@ -1679,6 +1678,10 @@ fm_tree_view_dispose (GObject *object)
view->details->volume_monitor = NULL;
}
+ g_signal_handlers_disconnect_by_func (caja_preferences,
+ G_CALLBACK(filtering_changed_callback),
+ view);
+
view->details->window = NULL;
G_OBJECT_CLASS (parent_class)->dispose (object);
@@ -1703,9 +1706,6 @@ fm_tree_view_class_init (FMTreeViewClass *class)
G_OBJECT_CLASS (class)->finalize = fm_tree_view_finalize;
copied_files_atom = gdk_atom_intern ("x-special/mate-copied-files", FALSE);
-
- eel_preferences_add_auto_boolean (CAJA_PREFERENCES_ENABLE_DELETE,
- &show_delete_command_auto_value);
}
static const char *
diff --git a/src/file-manager/fm-tree-view.h b/src/file-manager/fm-tree-view.h
index d78d85e3..c79057b8 100644
--- a/src/file-manager/fm-tree-view.h
+++ b/src/file-manager/fm-tree-view.h
@@ -43,7 +43,7 @@
#define FM_TREE_VIEW_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), FM_TYPE_TREE_VIEW, FMTreeViewClass))
-#define TREE_SIDEBAR_ID "CajaTreeSidebar"
+#define TREE_SIDEBAR_ID "tree"
typedef struct FMTreeViewDetails FMTreeViewDetails;