[nautilus/wip/gaction_: 1/10] nautilus-view: drop reset to defaults



commit 7c212eb3d4056745f07f60bf7af6befdb6ae46a8
Author: Carlos Soriano <carlos sorian89 gmail com>
Date:   Mon Jan 5 13:46:55 2015 +0100

    nautilus-view: drop reset to defaults
    
    With the upcomming UI rework the user won't need to reset to defaults,
    since the UI will be straighforward and not need to this item.

 src/nautilus-actions.h             |    1 -
 src/nautilus-canvas-view.c         |   21 -------------------
 src/nautilus-directory-view-ui.xml |    1 -
 src/nautilus-empty-view.c          |    7 ------
 src/nautilus-list-view.c           |   37 -----------------------------------
 src/nautilus-view.c                |   38 ------------------------------------
 src/nautilus-view.h                |    6 -----
 7 files changed, 0 insertions(+), 111 deletions(-)
---
diff --git a/src/nautilus-actions.h b/src/nautilus-actions.h
index c5d5a68..0d848d7 100644
--- a/src/nautilus-actions.h
+++ b/src/nautilus-actions.h
@@ -90,7 +90,6 @@
 #define NAUTILUS_ACTION_LOCATION_RESTORE_FROM_TRASH "LocationRestoreFromTrash"
 #define NAUTILUS_ACTION_UNDO "Undo"
 #define NAUTILUS_ACTION_REDO "Redo"
-#define NAUTILUS_ACTION_RESET_TO_DEFAULTS "Reset to Defaults"
 #define NAUTILUS_ACTION_MOUNT_VOLUME "Mount Volume"
 #define NAUTILUS_ACTION_UNMOUNT_VOLUME "Unmount Volume"
 #define NAUTILUS_ACTION_EJECT_VOLUME "Eject Volume"
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index 184a635..e676199 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -1220,26 +1220,6 @@ nautilus_canvas_view_update_menus (NautilusView *view)
 }
 
 static void
-nautilus_canvas_view_reset_to_defaults (NautilusView *view)
-{
-       NautilusCanvasContainer *canvas_container;
-       NautilusCanvasView *canvas_view;
-
-       canvas_view = NAUTILUS_CANVAS_VIEW (view);
-       canvas_container = get_canvas_container (canvas_view);
-
-       clear_sort_criterion (canvas_view);
-       nautilus_canvas_container_set_keep_aligned 
-               (canvas_container, get_default_directory_keep_aligned ());
-
-       nautilus_canvas_container_sort (canvas_container);
-
-       update_layout_menus (canvas_view);
-
-       nautilus_canvas_view_restore_default_zoom_level (view);
-}
-
-static void
 nautilus_canvas_view_select_all (NautilusView *view)
 {
        NautilusCanvasContainer *canvas_container;
@@ -2061,7 +2041,6 @@ nautilus_canvas_view_class_init (NautilusCanvasViewClass *klass)
        nautilus_view_class->get_selection_for_file_transfer = nautilus_canvas_view_get_selection;
        nautilus_view_class->is_empty = nautilus_canvas_view_is_empty;
        nautilus_view_class->remove_file = nautilus_canvas_view_remove_file;
-       nautilus_view_class->reset_to_defaults = nautilus_canvas_view_reset_to_defaults;
        nautilus_view_class->restore_default_zoom_level = nautilus_canvas_view_restore_default_zoom_level;
        nautilus_view_class->reveal_selection = nautilus_canvas_view_reveal_selection;
        nautilus_view_class->select_all = nautilus_canvas_view_select_all;
diff --git a/src/nautilus-directory-view-ui.xml b/src/nautilus-directory-view-ui.xml
index 0f06fc6..184249b 100644
--- a/src/nautilus-directory-view-ui.xml
+++ b/src/nautilus-directory-view-ui.xml
@@ -6,7 +6,6 @@
 <accelerator action="RenameSelectAll"/>
 <popup name="ViewMenu" accelerators="true">
   <placeholder name="View Details">
-    <menuitem name="Reset to Defaults" action="Reset to Defaults"/>
     <menuitem name="Show Hidden Files" action="Show Hidden Files"/>
   </placeholder>
 </popup>
diff --git a/src/nautilus-empty-view.c b/src/nautilus-empty-view.c
index f72a615..a57080c 100644
--- a/src/nautilus-empty-view.c
+++ b/src/nautilus-empty-view.c
@@ -140,12 +140,6 @@ nautilus_empty_view_update_menus (NautilusView *view)
        NAUTILUS_VIEW_CLASS (nautilus_empty_view_parent_class)->update_menus (view);
 }
 
-/* Reset sort criteria and zoom level to match defaults */
-static void
-nautilus_empty_view_reset_to_defaults (NautilusView *view)
-{
-}
-
 static void
 nautilus_empty_view_bump_zoom_level (NautilusView *view, int zoom_increment)
 {
@@ -265,7 +259,6 @@ nautilus_empty_view_class_init (NautilusEmptyViewClass *class)
        nautilus_view_class->remove_file = nautilus_empty_view_remove_file;
        nautilus_view_class->merge_menus = nautilus_empty_view_merge_menus;
        nautilus_view_class->update_menus = nautilus_empty_view_update_menus;
-       nautilus_view_class->reset_to_defaults = nautilus_empty_view_reset_to_defaults;
        nautilus_view_class->restore_default_zoom_level = nautilus_empty_view_restore_default_zoom_level;
        nautilus_view_class->reveal_selection = nautilus_empty_view_reveal_selection;
        nautilus_view_class->select_all = nautilus_empty_view_select_all;
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index e65fd61..1c06d7f 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -3091,42 +3091,6 @@ nautilus_list_view_update_menus (NautilusView *view)
        NAUTILUS_VIEW_CLASS (nautilus_list_view_parent_class)->update_menus (view);
 }
 
-/* Reset sort criteria and zoom level to match defaults */
-static void
-nautilus_list_view_reset_to_defaults (NautilusView *view)
-{
-       NautilusFile *file;
-       const gchar *default_sort_order;
-       gboolean default_sort_reversed;
-       char **default_columns;
-       char **default_order;
-
-       file = nautilus_view_get_directory_as_file (view);
-
-       nautilus_file_set_metadata (file, NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_COLUMN, NULL, NULL);
-       nautilus_file_set_metadata (file, NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_REVERSED, NULL, NULL);
-       nautilus_file_set_metadata_list (file, NAUTILUS_METADATA_KEY_LIST_VIEW_COLUMN_ORDER, NULL);
-       nautilus_file_set_metadata_list (file, NAUTILUS_METADATA_KEY_LIST_VIEW_VISIBLE_COLUMNS, NULL);
-
-       default_sort_order = get_default_sort_order (file, &default_sort_reversed);
-
-       gtk_tree_sortable_set_sort_column_id
-               (GTK_TREE_SORTABLE (NAUTILUS_LIST_VIEW (view)->details->model),
-                nautilus_list_model_get_sort_column_id_from_attribute (NAUTILUS_LIST_VIEW 
(view)->details->model,
-                                                                 g_quark_from_string (default_sort_order)),
-                default_sort_reversed ? GTK_SORT_DESCENDING : GTK_SORT_ASCENDING);
-
-       nautilus_list_view_set_zoom_level (NAUTILUS_LIST_VIEW (view), get_default_zoom_level (), FALSE);
-
-       default_columns = get_default_visible_columns (NAUTILUS_LIST_VIEW (view));
-       default_order = get_default_column_order (NAUTILUS_LIST_VIEW (view));
-
-       apply_columns_settings (NAUTILUS_LIST_VIEW (view), default_order, default_columns);
-
-       g_strfreev (default_columns);
-       g_strfreev (default_order);
-}
-
 static void
 nautilus_list_view_set_zoom_level (NautilusListView *view,
                                   NautilusListZoomLevel new_level,
@@ -3597,7 +3561,6 @@ nautilus_list_view_class_init (NautilusListViewClass *class)
        nautilus_view_class->merge_menus = nautilus_list_view_merge_menus;
        nautilus_view_class->unmerge_menus = nautilus_list_view_unmerge_menus;
        nautilus_view_class->update_menus = nautilus_list_view_update_menus;
-       nautilus_view_class->reset_to_defaults = nautilus_list_view_reset_to_defaults;
        nautilus_view_class->restore_default_zoom_level = nautilus_list_view_restore_default_zoom_level;
        nautilus_view_class->reveal_selection = nautilus_list_view_reveal_selection;
        nautilus_view_class->select_all = nautilus_list_view_select_all;
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 9bc22b0..1367db0 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -453,25 +453,6 @@ nautilus_view_reveal_selection (NautilusView *view)
        NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->reveal_selection (view);
 }
 
-/**
- * nautilus_view_reset_to_defaults:
- *
- * set sorting order, zoom level, etc. to match defaults
- * 
- **/
-static void
-nautilus_view_reset_to_defaults (NautilusView *view)
-{
-       GtkAction *action;
-
-       action = gtk_action_group_get_action (view->details->dir_action_group,
-                                             NAUTILUS_ACTION_SHOW_HIDDEN_FILES);
-       gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
-                                     g_settings_get_boolean (gtk_filechooser_preferences, 
NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES));
-
-        NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->reset_to_defaults (view);
-}
-
 static gboolean
 nautilus_view_using_manual_layout (NautilusView  *view)
 {
@@ -1502,15 +1483,6 @@ action_select_pattern_callback (GtkAction *action,
 }
 
 static void
-action_reset_to_defaults_callback (GtkAction *action, 
-                                  gpointer callback_data)
-{
-       g_assert (NAUTILUS_IS_VIEW (callback_data));
-
-       nautilus_view_reset_to_defaults (callback_data);
-}
-
-static void
 action_save_search_callback (GtkAction *action,
                             gpointer callback_data)
 {                
@@ -7194,16 +7166,6 @@ static const GtkActionEntry directory_view_entries[] = {
  /* label, accelerator */        N_("_Redo"), "<shift><control>Z",
  /* tooltip */                   N_("Redo the last undone action"),
                                  G_CALLBACK (action_redo_callback) },
-  /*
-   * multiview-TODO: decide whether "Reset to Defaults" should
-   * be window-wide, and not just view-wide.
-   * Since this also resets the "Show hidden files" mode,
-   * it is a mixture of both ATM.
-   */
-  /* name, stock id */         { NAUTILUS_ACTION_RESET_TO_DEFAULTS, NULL,
-  /* label, accelerator */       N_("Reset View to _Defaults"), NULL,
-  /* tooltip */                  N_("Reset sorting order and zoom level to match preferences for this view"),
-                                G_CALLBACK (action_reset_to_defaults_callback) },
   /* name, stock id */         { NAUTILUS_ACTION_MOUNT_VOLUME, NULL,
   /* label, accelerator */       N_("_Mount"), NULL,
   /* tooltip */                  N_("Mount the selected volume"),
diff --git a/src/nautilus-view.h b/src/nautilus-view.h
index d10b493..aabfa8f 100644
--- a/src/nautilus-view.h
+++ b/src/nautilus-view.h
@@ -131,12 +131,6 @@ struct NautilusViewClass {
 
        /* Function pointers that don't have corresponding signals */
 
-        /* reset_to_defaults is a function pointer that subclasses must 
-         * override to set sort order, zoom level, etc to match default
-         * values. 
-         */
-        void     (* reset_to_defaults)          (NautilusView *view);
-
        /* get_backing uri is a function pointer for subclasses to
         * override. Subclasses may replace it with a function that
         * returns the URI for the location where to create new folders,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]