summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nautilus-view-context-menus.xml7
-rw-r--r--src/nautilus-view.c17
2 files changed, 24 insertions, 0 deletions
diff --git a/src/nautilus-view-context-menus.xml b/src/nautilus-view-context-menus.xml
index 7e8cfcb8e..35fbe4d14 100644
--- a/src/nautilus-view-context-menus.xml
+++ b/src/nautilus-view-context-menus.xml
@@ -207,6 +207,13 @@
</item>
</section>
<section>
+ <item>
+ <attribute name="label" translatable="yes">_Remove from Recent</attribute>
+ <attribute name="action">view.remove-from-recent</attribute>
+ <attribute name="hidden-when">action-disabled</attribute>
+ </item>
+ </section>
+ <section>
<attribute name="id">extensions</attribute>
</section>
<section>
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index c786886a0..ecef39de5 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -1144,6 +1144,17 @@ action_move_to_trash (GSimpleAction *action,
}
static void
+action_remove_from_recent (GSimpleAction *action,
+ GVariant *state,
+ gpointer user_data)
+{
+ /* TODO:implement a set of functions for this, is very confusing to
+ * call trash_or_delete_file to remove from recent, even if it does like
+ * that not deleting/moving the files to trash */
+ trash_or_delete_selected_files (NAUTILUS_VIEW (user_data));
+}
+
+static void
delete_selected_files (NautilusView *view)
{
GList *selection;
@@ -5829,6 +5840,7 @@ const GActionEntry view_entries[] = {
* shortcut. */
{ "delete-permanently-shortcut", action_delete },
{ "delete-permanently-menu-item", action_delete },
+ { "remove-from-recent", action_remove_from_recent },
{ "restore-from-trash", action_restore_from_trash},
{ "paste-into", action_paste_files_into },
{ "rename", action_rename},
@@ -6251,6 +6263,11 @@ real_update_actions_state (NautilusView *view)
!selection_all_in_trash && !selection_contains_recent);
action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group),
+ "remove-from-recent");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
+ selection_contains_recent && selection_count > 0);
+
+ action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group),
"cut");
g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
can_move_files && !selection_contains_recent);