summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-09-06 15:41:51 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2012-09-06 16:08:09 -0400
commit5075f0f52bb0ff7eda12e43b15563d4bb4eb1280 (patch)
tree9f88178b17a9dd8ccf7fa881cf1abe0c2b6ad82f /src
parentf9e731285590283d80a975c7756b7f4afda178e7 (diff)
downloadnautilus-5075f0f52bb0ff7eda12e43b15563d4bb4eb1280.tar.gz
canvas-view: move Clean Up action to the desktop
Since that's the only place where it's used.
Diffstat (limited to 'src')
-rw-r--r--src/nautilus-canvas-view-ui.xml1
-rw-r--r--src/nautilus-canvas-view.c25
-rw-r--r--src/nautilus-canvas-view.h1
-rw-r--r--src/nautilus-desktop-canvas-view.c14
4 files changed, 17 insertions, 24 deletions
diff --git a/src/nautilus-canvas-view-ui.xml b/src/nautilus-canvas-view-ui.xml
index a5da23bc8..11cf91447 100644
--- a/src/nautilus-canvas-view-ui.xml
+++ b/src/nautilus-canvas-view-ui.xml
@@ -11,7 +11,6 @@
</placeholder>
<separator name="Layout separator"/>
<menuitem name="Reversed Order" action="Reversed Order"/>
- <menuitem name="Clean Up" action="Clean Up"/>
<menuitem name="Keep Aligned" action="Keep Aligned"/>
</placeholder>
<separator/>
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index 0be8b63aa..1c593c9dc 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -348,8 +348,8 @@ action_unstretch_callback (GtkAction *action,
(get_canvas_container (NAUTILUS_CANVAS_VIEW (callback_data)));
}
-static void
-nautilus_canvas_view_clean_up (NautilusCanvasView *canvas_view)
+void
+nautilus_canvas_view_clean_up_by_name (NautilusCanvasView *canvas_view)
{
NautilusCanvasContainer *canvas_container;
gboolean saved_sort_reversed;
@@ -368,12 +368,6 @@ nautilus_canvas_view_clean_up (NautilusCanvasView *canvas_view)
set_sort_reversed (canvas_view, saved_sort_reversed, FALSE);
}
-static void
-action_clean_up_callback (GtkAction *action, gpointer callback_data)
-{
- nautilus_canvas_view_clean_up (NAUTILUS_CANVAS_VIEW (callback_data));
-}
-
static gboolean
nautilus_canvas_view_using_auto_layout (NautilusCanvasView *canvas_view)
{
@@ -621,17 +615,6 @@ update_layout_menus (NautilusCanvasView *view)
gtk_action_set_visible (action,
nautilus_canvas_view_supports_manual_layout (view));
- /* Clean Up is only relevant for manual layout */
- action = gtk_action_group_get_action (view->details->canvas_action_group,
- NAUTILUS_ACTION_CLEAN_UP);
- gtk_action_set_sensitive (action, !is_auto_layout);
- gtk_action_set_visible (action,
- nautilus_canvas_view_supports_manual_layout (view));
-
- if (NAUTILUS_IS_DESKTOP_CANVAS_VIEW (view)) {
- gtk_action_set_label (action, _("_Organize Desktop by Name"));
- }
-
action = gtk_action_group_get_action (view->details->canvas_action_group,
NAUTILUS_ACTION_KEEP_ALIGNED);
gtk_action_set_visible (action,
@@ -1197,10 +1180,6 @@ static const GtkActionEntry canvas_view_entries[] = {
/* label, accelerator */ N_("Restore Icons' Original Si_zes"), NULL,
/* tooltip */ N_("Restore each selected icons to its original size"),
G_CALLBACK (action_unstretch_callback) },
- /* name, stock id */ { "Clean Up", NULL,
- /* label, accelerator */ N_("_Organize by Name"), NULL,
- /* tooltip */ N_("Reposition icons to better fit in the window and avoid overlapping"),
- G_CALLBACK (action_clean_up_callback) },
};
static const GtkToggleActionEntry canvas_view_toggle_entries[] = {
diff --git a/src/nautilus-canvas-view.h b/src/nautilus-canvas-view.h
index c1bec5eca..313e4e0d1 100644
--- a/src/nautilus-canvas-view.h
+++ b/src/nautilus-canvas-view.h
@@ -64,6 +64,7 @@ int nautilus_canvas_view_compare_files (NautilusCanvasView *canvas_view,
NautilusFile *b);
void nautilus_canvas_view_filter_by_screen (NautilusCanvasView *canvas_view,
gboolean filter);
+void nautilus_canvas_view_clean_up_by_name (NautilusCanvasView *canvas_view);
void nautilus_canvas_view_register (void);
diff --git a/src/nautilus-desktop-canvas-view.c b/src/nautilus-desktop-canvas-view.c
index bf9122e63..1129bb4f9 100644
--- a/src/nautilus-desktop-canvas-view.c
+++ b/src/nautilus-desktop-canvas-view.c
@@ -678,6 +678,13 @@ trash_link_is_selection (NautilusView *view)
}
static void
+action_clean_up_callback (GtkAction *action,
+ gpointer callback_data)
+{
+ nautilus_canvas_view_clean_up_by_name (NAUTILUS_CANVAS_VIEW (callback_data));
+}
+
+static void
real_update_menus (NautilusView *view)
{
NautilusDesktopCanvasView *desktop_view;
@@ -721,6 +728,13 @@ static const GtkActionEntry desktop_view_entries[] = {
/* tooltip */
N_("Delete all items in the Trash"),
G_CALLBACK (action_empty_trash_conditional_callback) },
+ /* name, stock id */
+ { NAUTILUS_ACTION_CLEAN_UP, NULL,
+ /* label, accelerator */
+ N_("_Organize Desktop by Name"), NULL,
+ /* tooltip */
+ N_("Reposition icons to better fit in the window and avoid overlapping"),
+ G_CALLBACK (action_clean_up_callback) },
};
static void