diff options
author | Stefano Karapetsas <[email protected]> | 2012-09-05 20:43:59 +0200 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2012-09-05 20:43:59 +0200 |
commit | e13142565949e577ae589c0e93527b6698614281 (patch) | |
tree | e0901b68fe0de61118f9aa605d945b794a8ce39e /src/file-manager/fm-icon-view.c | |
parent | db145cb919be1242260d06095660405f415774d6 (diff) | |
download | caja-e13142565949e577ae589c0e93527b6698614281.tar.bz2 caja-e13142565949e577ae589c0e93527b6698614281.tar.xz |
convert list-view preferences to gsettings
also move the sort order prefs from view-specific to common prefs
we already only have one UI setting that controls both, so it makes
no sense to have two settings.
(from nautilus 3.0)
Diffstat (limited to 'src/file-manager/fm-icon-view.c')
-rw-r--r-- | src/file-manager/fm-icon-view.c | 82 |
1 files changed, 12 insertions, 70 deletions
diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c index 1e643bb2..eee45185 100644 --- a/src/file-manager/fm-icon-view.c +++ b/src/file-manager/fm-icon-view.c @@ -198,7 +198,6 @@ static CajaFileSortType get_default_sort_order (CajaFile static void default_sort_order_changed_callback (gpointer callback_data); static void default_sort_in_reverse_order_changed_callback (gpointer callback_data); static void default_use_tighter_layout_changed_callback (gpointer callback_data); -static void default_use_manual_layout_changed_callback (gpointer callback_data); static void default_zoom_level_changed_callback (gpointer callback_data); static void labels_beside_icons_changed_callback (gpointer callback_data); static void all_columns_same_width_changed_callback (gpointer callback_data); @@ -251,19 +250,16 @@ fm_icon_view_finalize (GObject *object) g_free (icon_view->details); - g_signal_handlers_disconnect_by_func (caja_icon_view_preferences, + g_signal_handlers_disconnect_by_func (caja_preferences, default_sort_order_changed_callback, icon_view); - g_signal_handlers_disconnect_by_func (caja_icon_view_preferences, + g_signal_handlers_disconnect_by_func (caja_preferences, default_sort_in_reverse_order_changed_callback, icon_view); g_signal_handlers_disconnect_by_func (caja_icon_view_preferences, default_use_tighter_layout_changed_callback, icon_view); g_signal_handlers_disconnect_by_func (caja_icon_view_preferences, - default_use_manual_layout_changed_callback, - icon_view); - g_signal_handlers_disconnect_by_func (caja_icon_view_preferences, default_zoom_level_changed_callback, icon_view); g_signal_handlers_disconnect_by_func (caja_icon_view_preferences, @@ -830,11 +826,11 @@ get_default_sort_order (CajaFile *file, gboolean *reversed) if (auto_storaged_added == FALSE) { auto_storaged_added = TRUE; - eel_g_settings_add_auto_enum (caja_icon_view_preferences, - CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER, + eel_g_settings_add_auto_enum (caja_preferences, + CAJA_PREFERENCES_DEFAULT_SORT_ORDER, (int *) &default_sort_order); - eel_g_settings_add_auto_boolean (caja_icon_view_preferences, - CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER, + eel_g_settings_add_auto_boolean (caja_preferences, + CAJA_PREFERENCES_DEFAULT_SORT_IN_REVERSE_ORDER, &default_sort_in_reverse_order); } @@ -990,25 +986,6 @@ fm_icon_view_set_directory_keep_aligned (FMIconView *icon_view, keep_aligned); } -/* maintainence of auto layout boolean */ -static gboolean default_directory_manual_layout = FALSE; - -static gboolean -get_default_directory_manual_layout (void) -{ - static gboolean auto_storaged_added = FALSE; - - if (auto_storaged_added == FALSE) - { - auto_storaged_added = TRUE; - eel_g_settings_add_auto_boolean (caja_icon_view_preferences, - CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_MANUAL_LAYOUT, - &default_directory_manual_layout); - } - - return default_directory_manual_layout; -} - static gboolean fm_icon_view_get_directory_auto_layout (FMIconView *icon_view, CajaFile *file) @@ -1035,7 +1012,7 @@ fm_icon_view_real_get_directory_auto_layout (FMIconView *icon_view, return caja_file_get_boolean_metadata - (file, CAJA_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT, !get_default_directory_manual_layout ()); + (file, CAJA_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT, TRUE); } static void @@ -1065,7 +1042,7 @@ fm_icon_view_real_set_directory_auto_layout (FMIconView *icon_view, caja_file_set_boolean_metadata (file, CAJA_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT, - !get_default_directory_manual_layout (), + TRUE, auto_layout); } /* maintainence of tighter layout boolean */ @@ -1970,15 +1947,6 @@ fm_icon_view_reset_to_defaults (FMDirectoryView *view) caja_icon_container_sort (icon_container); - /* Switch to manual layout of the default calls for it. - * This needs to happen last for the sort order menus - * to be in sync. - */ - if (get_default_directory_manual_layout ()) - { - switch_to_manual_layout (icon_view); - } - update_layout_menus (icon_view); fm_icon_view_restore_default_zoom_level (view); @@ -2792,28 +2760,6 @@ default_use_tighter_layout_changed_callback (gpointer callback_data) } static void -default_use_manual_layout_changed_callback (gpointer callback_data) -{ - FMIconView *icon_view; - CajaFile *file; - CajaIconContainer *icon_container; - - g_return_if_fail (FM_IS_ICON_VIEW (callback_data)); - - icon_view = FM_ICON_VIEW (callback_data); - - file = fm_directory_view_get_directory_as_file (FM_DIRECTORY_VIEW (icon_view)); - icon_container = get_icon_container (icon_view); - g_return_if_fail (CAJA_IS_ICON_CONTAINER (icon_container)); - - caja_icon_container_set_auto_layout ( - icon_container, - fm_icon_view_get_directory_auto_layout (icon_view, file)); - - caja_icon_container_request_update_all (icon_container); -} - -static void default_zoom_level_changed_callback (gpointer callback_data) { FMIconView *icon_view; @@ -3326,12 +3272,12 @@ fm_icon_view_init (FMIconView *icon_view) setup_sound_preview = TRUE; } - g_signal_connect_swapped (caja_icon_view_preferences, - "changed::" CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER, + g_signal_connect_swapped (caja_preferences, + "changed::" CAJA_PREFERENCES_DEFAULT_SORT_ORDER, G_CALLBACK (default_sort_order_changed_callback), icon_view); - g_signal_connect_swapped (caja_icon_view_preferences, - "changed::" CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER, + g_signal_connect_swapped (caja_preferences, + "changed::" CAJA_PREFERENCES_DEFAULT_SORT_IN_REVERSE_ORDER, G_CALLBACK (default_sort_in_reverse_order_changed_callback), icon_view); g_signal_connect_swapped (caja_icon_view_preferences, @@ -3339,10 +3285,6 @@ fm_icon_view_init (FMIconView *icon_view) G_CALLBACK (default_use_tighter_layout_changed_callback), icon_view); g_signal_connect_swapped (caja_icon_view_preferences, - "changed::" CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_MANUAL_LAYOUT, - G_CALLBACK (default_use_manual_layout_changed_callback), - icon_view); - g_signal_connect_swapped (caja_icon_view_preferences, "changed::" CAJA_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL, G_CALLBACK (default_zoom_level_changed_callback), icon_view); |