[nautilus] Don't show execute permission checkbox for directories



commit d51023f9aafe3e25de028bdcdeecb5f10209e894
Author: William Jon McCann <jmccann redhat com>
Date:   Fri Aug 17 20:55:48 2012 -0400

    Don't show execute permission checkbox for directories
    
    It is ambigious what it even does. It refers to making files
    executable. You never want to turn execute permission off
    on a directory and lock yourself out of it. This just shows
    it when the selection is a file.

 src/nautilus-properties-window.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 1c6127c..b7d54a0 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -4070,7 +4070,6 @@ create_simple_permissions (NautilusPropertiesWindow *window, GtkGrid *page_grid)
 	gboolean has_file, has_directory;
 	GtkLabel *group_label;
 	GtkLabel *owner_label;
-	GtkLabel *execute_label;
 	GtkWidget *value;
 	GtkComboBox *group_combo_box;
 	GtkComboBox *owner_combo_box;
@@ -4153,15 +4152,17 @@ create_simple_permissions (NautilusPropertiesWindow *window, GtkGrid *page_grid)
 					   !has_directory);
 	}
 
-	append_blank_slim_row (page_grid);
-	
-	execute_label = attach_title_field (page_grid, _("Execute:"));
-	add_permissions_checkbox_with_label (window, page_grid,
-					     GTK_WIDGET (execute_label),
-					     _("Allow _executing file as program"),
-					     UNIX_PERM_USER_EXEC|UNIX_PERM_GROUP_EXEC|UNIX_PERM_OTHER_EXEC,
-					     execute_label, FALSE);
-	
+	if (!has_directory) {
+		GtkLabel *execute_label;
+		append_blank_slim_row (page_grid);
+
+		execute_label = attach_title_field (page_grid, _("Execute:"));
+		add_permissions_checkbox_with_label (window, page_grid,
+						     GTK_WIDGET (execute_label),
+						     _("Allow _executing file as program"),
+						     UNIX_PERM_USER_EXEC|UNIX_PERM_GROUP_EXEC|UNIX_PERM_OTHER_EXEC,
+						     execute_label, FALSE);
+	}
 }
 
 static void



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