diff options
author | Stefano Karapetsas <[email protected]> | 2012-09-05 14:44:07 +0200 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2012-09-05 14:44:07 +0200 |
commit | b10e30db918ff889bb06540e129b3f31b2815da2 (patch) | |
tree | d98d7640c4275e4d6496f54926b580e59b9253b7 | |
parent | f82a305cde0842e53d7468ce37b4cd02161838c5 (diff) | |
download | caja-b10e30db918ff889bb06540e129b3f31b2815da2.tar.bz2 caja-b10e30db918ff889bb06540e129b3f31b2815da2.tar.xz |
convert click-policy to gsettings
-rw-r--r-- | libcaja-private/caja-global-preferences.c | 24 | ||||
-rw-r--r-- | libcaja-private/caja-global-preferences.h | 2 | ||||
-rw-r--r-- | libcaja-private/caja-icon-canvas-item.c | 7 | ||||
-rw-r--r-- | src/caja-file-management-properties.c | 8 | ||||
-rw-r--r-- | src/caja-history-sidebar.c | 15 | ||||
-rw-r--r-- | src/file-manager/fm-directory-view.c | 10 | ||||
-rw-r--r-- | src/file-manager/fm-icon-view.c | 2 | ||||
-rw-r--r-- | src/file-manager/fm-list-view.c | 5 |
8 files changed, 27 insertions, 46 deletions
diff --git a/libcaja-private/caja-global-preferences.c b/libcaja-private/caja-global-preferences.c index 00c1e743..e00f42fe 100644 --- a/libcaja-private/caja-global-preferences.c +++ b/libcaja-private/caja-global-preferences.c @@ -104,20 +104,6 @@ static EelEnumerationEntry file_size_enum_entries[] = { "4294967295", N_("4 GB"), 4294967295U } }; -static EelEnumerationEntry click_policy_enum_entries[] = -{ - { - "single", - N_("Activate items with a _single click"), - CAJA_CLICK_POLICY_SINGLE - }, - { - "double", - N_("Activate items with a _double click"), - CAJA_CLICK_POLICY_DOUBLE - } -}; - static EelEnumerationEntry search_bar_type_enum_entries[] = { { @@ -254,13 +240,6 @@ static const PreferenceDefault preference_defaults[] = "speed_tradeoff" }, { - CAJA_PREFERENCES_CLICK_POLICY, - PREFERENCE_STRING, - "double", - NULL, NULL, - "click_policy" - }, - { CAJA_PREFERENCES_INSTALL_MIME_ACTIVATION, PREFERENCE_BOOLEAN, GINT_TO_POINTER (TRUE) @@ -569,9 +548,6 @@ global_preferences_register_enumerations (void) * populate widgets and route preferences changes between the * storage (MateConf) and the displayed values. */ - eel_enumeration_register ("click_policy", - click_policy_enum_entries, - G_N_ELEMENTS (click_policy_enum_entries)); eel_enumeration_register ("default_folder_viewer", default_folder_viewer_enum_entries, G_N_ELEMENTS (default_folder_viewer_enum_entries)); diff --git a/libcaja-private/caja-global-preferences.h b/libcaja-private/caja-global-preferences.h index 45efde91..bb24de7a 100644 --- a/libcaja-private/caja-global-preferences.h +++ b/libcaja-private/caja-global-preferences.h @@ -94,7 +94,7 @@ G_BEGIN_DECLS #define CAJA_PREFERENCES_TREE_SHOW_ONLY_DIRECTORIES "sidebar_panels/tree/show_only_directories" /* Single/Double click preference */ -#define CAJA_PREFERENCES_CLICK_POLICY "preferences/click_policy" +#define CAJA_PREFERENCES_CLICK_POLICY "click-policy" /* Activating executable text files */ #define CAJA_PREFERENCES_EXECUTABLE_TEXT_ACTIVATION "executable-text-activation" diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c index c96cd6ef..db0b5280 100644 --- a/libcaja-private/caja-icon-canvas-item.c +++ b/libcaja-private/caja-icon-canvas-item.c @@ -283,9 +283,10 @@ caja_icon_canvas_item_init (CajaIconCanvasItem *icon_item) if (!setup_auto_enums) { - eel_preferences_add_auto_enum - (CAJA_PREFERENCES_CLICK_POLICY, - &click_policy_auto_value); + eel_g_settings_add_auto_enum + (caja_preferences, + CAJA_PREFERENCES_CLICK_POLICY, + &click_policy_auto_value); setup_auto_enums = TRUE; } diff --git a/src/caja-file-management-properties.c b/src/caja-file-management-properties.c index 5dd9181d..fca7a149 100644 --- a/src/caja-file-management-properties.c +++ b/src/caja-file-management-properties.c @@ -948,10 +948,10 @@ caja_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow *wi CAJA_PREFERENCES_DATE_FORMAT, (const char **) date_format_values); - eel_preferences_builder_connect_string_enum_radio_button (builder, - (const char **) click_behavior_components, - CAJA_PREFERENCES_CLICK_POLICY, - (const char **) click_behavior_values); + bind_builder_radio (builder, caja_preferences, + (const char **) click_behavior_components, + CAJA_PREFERENCES_CLICK_POLICY, + (const char **) click_behavior_values); bind_builder_radio (builder, caja_preferences, (const char **) executable_text_components, CAJA_PREFERENCES_EXECUTABLE_TEXT_ACTIVATION, diff --git a/src/caja-history-sidebar.c b/src/caja-history-sidebar.c index 897d836e..bdcb7c33 100644 --- a/src/caja-history-sidebar.c +++ b/src/caja-history-sidebar.c @@ -219,7 +219,7 @@ update_click_policy (CajaHistorySidebar *sidebar) { int policy; - policy = eel_preferences_get_enum (CAJA_PREFERENCES_CLICK_POLICY); + policy = g_settings_get_enum (caja_preferences, CAJA_PREFERENCES_CLICK_POLICY); eel_gtk_tree_view_set_activate_on_single_click (sidebar->tree_view, policy == CAJA_CLICK_POLICY_SINGLE); @@ -298,9 +298,10 @@ caja_history_sidebar_init (CajaHistorySidebar *sidebar) g_signal_connect (tree_view, "button-press-event", G_CALLBACK (button_press_event_callback), sidebar); - eel_preferences_add_callback (CAJA_PREFERENCES_CLICK_POLICY, - click_policy_changed_callback, - sidebar); + g_signal_connect_swapped (caja_preferences, + "changed::" CAJA_PREFERENCES_CLICK_POLICY, + G_CALLBACK(click_policy_changed_callback), + sidebar); update_click_policy (sidebar); } @@ -311,9 +312,9 @@ caja_history_sidebar_finalize (GObject *object) sidebar = CAJA_HISTORY_SIDEBAR (object); - eel_preferences_remove_callback (CAJA_PREFERENCES_CLICK_POLICY, - click_policy_changed_callback, - sidebar); + g_signal_handlers_disconnect_by_func (caja_preferences, + click_policy_changed_callback, + sidebar); G_OBJECT_CLASS (caja_history_sidebar_parent_class)->finalize (object); } diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c index 5b304f13..db03d79d 100644 --- a/src/file-manager/fm-directory-view.c +++ b/src/file-manager/fm-directory-view.c @@ -2045,8 +2045,10 @@ fm_directory_view_init (FMDirectoryView *view) text_attribute_names_changed_callback, view); eel_preferences_add_callback (CAJA_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS, image_display_policy_changed_callback, view); - eel_preferences_add_callback (CAJA_PREFERENCES_CLICK_POLICY, - click_policy_changed_callback, view); + g_signal_connect_swapped (caja_preferences, + "changed::" CAJA_PREFERENCES_CLICK_POLICY, + G_CALLBACK(click_policy_changed_callback), + view); eel_preferences_add_callback (CAJA_PREFERENCES_SORT_DIRECTORIES_FIRST, sort_directories_first_changed_callback, view); eel_preferences_add_callback (CAJA_PREFERENCES_LOCKDOWN_COMMAND_LINE, @@ -2174,8 +2176,8 @@ fm_directory_view_finalize (GObject *object) text_attribute_names_changed_callback, view); eel_preferences_remove_callback (CAJA_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS, image_display_policy_changed_callback, view); - eel_preferences_remove_callback (CAJA_PREFERENCES_CLICK_POLICY, - click_policy_changed_callback, view); + g_signal_handlers_disconnect_by_func (caja_preferences, + click_policy_changed_callback, view); eel_preferences_remove_callback (CAJA_PREFERENCES_SORT_DIRECTORIES_FIRST, sort_directories_first_changed_callback, view); eel_preferences_remove_callback (CAJA_PREFERENCES_LOCKDOWN_COMMAND_LINE, diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c index 3bd24bd3..5ecf6e8c 100644 --- a/src/file-manager/fm-icon-view.c +++ b/src/file-manager/fm-icon-view.c @@ -2890,7 +2890,7 @@ fm_icon_view_update_click_mode (FMIconView *icon_view) icon_container = get_icon_container (icon_view); g_assert (icon_container != NULL); - click_mode = eel_preferences_get_enum (CAJA_PREFERENCES_CLICK_POLICY); + click_mode = g_settings_get_enum (caja_preferences, CAJA_PREFERENCES_CLICK_POLICY); caja_icon_container_set_single_click_mode (icon_container, click_mode == CAJA_CLICK_POLICY_SINGLE); diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c index 487f3023..2a0aa693 100644 --- a/src/file-manager/fm-list-view.c +++ b/src/file-manager/fm-list-view.c @@ -3288,8 +3288,9 @@ fm_list_view_class_init (FMListViewClass *class) fm_directory_view_class->using_manual_layout = fm_list_view_using_manual_layout; fm_directory_view_class->set_is_active = real_set_is_active; - eel_preferences_add_auto_enum (CAJA_PREFERENCES_CLICK_POLICY, - &click_policy_auto_value); + eel_g_settings_add_auto_enum (caja_preferences, + CAJA_PREFERENCES_CLICK_POLICY, + &click_policy_auto_value); eel_preferences_add_auto_string (CAJA_PREFERENCES_LIST_VIEW_DEFAULT_SORT_ORDER, (const char **) &default_sort_order_auto_value); eel_preferences_add_auto_boolean (CAJA_PREFERENCES_LIST_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER, |