[nautilus] Really don't show the new document menu item when there are no templates
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Really don't show the new document menu item when there are no templates
- Date: Sun, 15 Jul 2012 17:43:26 +0000 (UTC)
commit bcc67ddf90b7b41d4535343f3c5a124ed0c917c0
Author: William Jon McCann <jmccann redhat com>
Date: Sun Jul 15 08:05:20 2012 -0400
Really don't show the new document menu item when there are no templates
https://bugzilla.gnome.org/show_bug.cgi?id=676838
src/nautilus-view.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index f90452e..fe42875 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -224,6 +224,7 @@ struct NautilusViewDetails
gboolean menu_states_untrustworthy;
gboolean scripts_invalid;
gboolean templates_invalid;
+ gboolean templates_present;
gboolean reported_load_error;
/* flag to indicate that no file updates should be dispatched to subclasses.
@@ -5640,7 +5641,6 @@ update_templates_menu (NautilusView *view)
NautilusDirectory *directory;
GtkUIManager *ui_manager;
char *uri;
- GtkAction *action;
char *templates_directory_uri;
if (nautilus_should_use_templates_directory ()) {
@@ -5683,8 +5683,7 @@ update_templates_menu (NautilusView *view)
}
nautilus_directory_list_free (sorted_copy);
- action = gtk_action_group_get_action (view->details->dir_action_group, NAUTILUS_ACTION_NEW_DOCUMENTS);
- gtk_action_set_visible (action, any_templates);
+ view->details->templates_present = any_templates;
g_free (templates_directory_uri);
}
@@ -8898,14 +8897,15 @@ real_update_menus (NautilusView *view)
update_scripts_menu (view);
}
+ if (can_create_files
+ && !selection_contains_recent
+ && view->details->templates_invalid) {
+ update_templates_menu (view);
+ }
action = gtk_action_group_get_action (view->details->dir_action_group,
NAUTILUS_ACTION_NEW_DOCUMENTS);
gtk_action_set_sensitive (action, can_create_files);
- gtk_action_set_visible (action, !selection_contains_recent);
-
- if (can_create_files && view->details->templates_invalid) {
- update_templates_menu (view);
- }
+ gtk_action_set_visible (action, !selection_contains_recent && view->details->templates_present);
action = gtk_action_group_get_action (view->details->dir_action_group,
NAUTILUS_ACTION_COPY_TO);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]