--- libnautilus-private/nautilus-mime-application-chooser.c	2009-03-07 06:39:35 +0300
+++ libnautilus-private/nautilus-mime-application-chooser.fixed.c	2009-03-08 17:41:12 +0300
@@ -487,6 +487,7 @@ refresh_model (NautilusMimeApplicationCh
 	GList *l;
 	GtkTreeSelection *selection;
 	GtkTreeViewColumn *column;
+    gboolean show_defhandler_toggle;
 
 	column = gtk_tree_view_get_column (GTK_TREE_VIEW (chooser->details->treeview), 0);
 	gtk_tree_view_column_set_visible (column, TRUE);
@@ -525,9 +526,12 @@ refresh_model (NautilusMimeApplicationCh
 	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (chooser->details->treeview));
 	
 	if (applications) {
-		g_object_set (chooser->details->toggle_renderer,
-			      "visible", TRUE, 
-			      NULL);
+        /* Disallow changing the default handler for directories. */
+        show_defhandler_toggle =
+            eel_strcmp (chooser->details->content_type, "inode/directory") != 0;
+        g_object_set (chooser->details->toggle_renderer,
+                "visible", show_defhandler_toggle, 
+                NULL);
 		gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
 	} else {
 		GtkTreeIter iter;
@@ -583,6 +587,7 @@ set_uri_and_type (NautilusMimeApplicatio
 		  const char *mime_type)
 {
 	char *label;
+	char *label_format_str;
 	char *name;
 	char *emname;
 	char *extension;
@@ -601,10 +606,18 @@ set_uri_and_type (NautilusMimeApplicatio
 				       extension, mime_type);
 	g_free (extension);
 
+	/* Check whether the MIME type corresponds to a directory; if it does,
+	 * we'll forbid changing the default handler in refresh_model(),
+	 * so reflect it in the prompt. */
+	if (eel_strcmp (mime_type, "inode/directory")) {
+		label_format_str = _("Select an application to open %s and other files of type \"%s\"");
+	} else {
+		label_format_str = _("Open %s and other files of type \"%s\" with");
+	}
 	/* first %s is filename, second %s is mime-type description */
 	emname = g_strdup_printf ("<i>%s</i>", name);
-	label = g_strdup_printf (_("Select an application to open %s and other files of type \"%s\""),
-				 emname, chooser->details->type_description);
+	label = g_strdup_printf (label_format_str,
+				emname, chooser->details->type_description);
 	g_free (emname);
 	
 	gtk_label_set_markup (GTK_LABEL (chooser->details->label), label);
