[nautilus] Make trash keybindings only work if the action is sensitive
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [nautilus] Make trash keybindings only work if the action is sensitive
- Date: Tue, 15 Dec 2009 08:58:34 +0000 (UTC)
commit 9c7c2c9d2cc0a8648abf2dbc851e9efec3e3df1c
Author: Alexander Larsson <alexl redhat com>
Date: Tue Dec 15 09:56:56 2009 +0100
Make trash keybindings only work if the action is sensitive
This fixes https://bugzilla.gnome.org/show_bug.cgi?id=603413 in
a way not causing regressions.
src/file-manager/fm-directory-view.c | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index 09d4ff8..21e1b55 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -999,8 +999,16 @@ trash_or_delete_selected_files (FMDirectoryView *view)
static gboolean
real_trash (FMDirectoryView *view)
{
- trash_or_delete_selected_files (view);
- return TRUE;
+ GtkAction *action;
+
+ action = gtk_action_group_get_action (view->details->dir_action_group,
+ FM_ACTION_TRASH);
+ if (gtk_action_get_sensitive (action) &&
+ gtk_action_get_visible (action)) {
+ trash_or_delete_selected_files (view);
+ return TRUE;
+ }
+ return FALSE;
}
static void
@@ -1072,11 +1080,16 @@ action_restore_from_trash_callback (GtkAction *action,
static gboolean
real_delete (FMDirectoryView *view)
{
- if (!show_delete_command_auto_value) {
- return FALSE;
+ GtkAction *action;
+
+ action = gtk_action_group_get_action (view->details->dir_action_group,
+ FM_ACTION_DELETE);
+ if (gtk_action_get_sensitive (action) &&
+ gtk_action_get_visible (action)) {
+ delete_selected_files (view);
+ return TRUE;
}
- delete_selected_files (view);
- return TRUE;
+ return FALSE;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]