nautilus r14404 - in trunk: . src/file-manager
- From: cneumair svn gnome org
- To: svn-commits-list gnome org
- Subject: nautilus r14404 - in trunk: . src/file-manager
- Date: Tue, 22 Jul 2008 14:02:52 +0000 (UTC)
Author: cneumair
Date: Tue Jul 22 14:02:52 2008
New Revision: 14404
URL: http://svn.gnome.org/viewvc/nautilus?rev=14404&view=rev
Log:
2008-07-22  Christian Neumair  <cneumair gnome org>
	* src/file-manager/fm-directory-view.c (reset_open_with_menu):
	Display submenu for more than two associated applications when all
	files are folders.
Modified:
   trunk/ChangeLog
   trunk/src/file-manager/fm-directory-view.c
Modified: trunk/src/file-manager/fm-directory-view.c
==============================================================================
--- trunk/src/file-manager/fm-directory-view.c	(original)
+++ trunk/src/file-manager/fm-directory-view.c	Tue Jul 22 14:02:52 2008
@@ -329,6 +329,8 @@
 static void     update_templates_directory                     (FMDirectoryView *view);
 static void     user_dirs_changed                              (FMDirectoryView *view);
 
+static gboolean file_list_all_are_folders                      (GList *file_list);
+
 static void action_open_scripts_folder_callback    (GtkAction *action,
 						    gpointer   callback_data);
 static void action_cut_files_callback              (GtkAction *action,
@@ -4400,6 +4402,12 @@
 
 
 	num_applications = g_list_length (applications);
+
+	if (file_list_all_are_folders (selection)) {
+		submenu_visible = (num_applications > 2);
+	} else {
+		submenu_visible = (num_applications > 3);
+	}
 	
 	for (node = applications, index = 0; node != NULL; node = node->next, index++) {
 		GAppInfo *application;
@@ -4412,7 +4420,7 @@
 			continue;
 		}
 
-		if (num_applications > 3) {
+		if (submenu_visible) {
 			menu_path = FM_DIRECTORY_VIEW_MENU_PATH_APPLICATIONS_SUBMENU_PLACEHOLDER;
 			popup_path = FM_DIRECTORY_VIEW_POPUP_PATH_APPLICATIONS_SUBMENU_PLACEHOLDER;
 		} else {
@@ -4439,8 +4447,6 @@
 		g_object_unref (default_app);
 	}
 
-	submenu_visible = (num_applications > 3);
-
 	open_with_chooser_visible = other_applications_visible &&
 				    g_list_length (selection) == 1;
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]