Re: [PATCH] Allow to remove computer, home folder, trash from desktop by dragging them to trash



Am Dienstag, den 12.07.2005, 23:22 +0200 schrieb Christian Neumair:
> From bug 155771 [1]:
> 
> "Removal of computer/desktop/trash icons from desktop unintuitive
> 
> For example: Removing the Wastebasket/Trash icon. The only reason I
> managed to find out how to get rid of it was looking at bugzilla."
> 
> Note that I'm strduping the name of the desktop items instead of using
> predefined names like "Trash", "Computer" or "Home" because people
> complained in bugzilla that if they name their trash foobar it should be
> referred to as foobar elsewhere.
> 
> [1] http://bugzilla.gnome.org/show_bug.cgi?id=155771

Attached: patch #2 ("Remote" typo correction).

-- 
Christian Neumair <chris gnome-de org>
? libnautilus-private/2
Index: libnautilus-private/nautilus-desktop-link-monitor.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-desktop-link-monitor.c,v
retrieving revision 1.13
diff -u -p -r1.13 nautilus-desktop-link-monitor.c
--- libnautilus-private/nautilus-desktop-link-monitor.c	11 Jul 2005 09:53:38 -0000	1.13
+++ libnautilus-private/nautilus-desktop-link-monitor.c	12 Jul 2005 21:16:11 -0000
@@ -140,6 +140,44 @@ volume_delete_dialog (GtkWidget *parent_
 	}
 }
 
+static void
+special_link_delete_dialog (GtkWidget *parent_view,
+			    NautilusDesktopLink *link)
+{
+	char *name, *msg;
+	const char *key;
+	int res;
+
+	name = nautilus_desktop_link_get_display_name (link);
+	msg = g_strdup_printf (_("Remove \"%s\" Permanently From Desktop?"), name);
+	g_free (name);
+
+	res = eel_run_simple_dialog (parent_view, FALSE,
+				     GTK_MESSAGE_QUESTION,
+				     msg, NULL, NULL,
+				     GTK_STOCK_CANCEL, _("_Remove"), NULL);
+	g_free (msg);
+
+	if (res != 0) {
+		switch (nautilus_desktop_link_get_link_type (link)) {
+		case NAUTILUS_DESKTOP_LINK_HOME:
+			key = NAUTILUS_PREFERENCES_DESKTOP_HOME_VISIBLE;
+			break;
+		case NAUTILUS_DESKTOP_LINK_COMPUTER:
+			key = NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_VISIBLE;
+			break;
+		case NAUTILUS_DESKTOP_LINK_TRASH:
+			key = NAUTILUS_PREFERENCES_DESKTOP_TRASH_VISIBLE;
+			break;
+		default:
+			g_assert_not_reached ();
+		}
+
+		eel_preferences_set_boolean (key, FALSE);
+	}
+
+}
+
 void
 nautilus_desktop_link_monitor_delete_link (NautilusDesktopLinkMonitor *monitor,
 					   NautilusDesktopLink *link,
@@ -149,6 +187,7 @@ nautilus_desktop_link_monitor_delete_lin
 	case NAUTILUS_DESKTOP_LINK_HOME:
 	case NAUTILUS_DESKTOP_LINK_COMPUTER:
 	case NAUTILUS_DESKTOP_LINK_TRASH:
+		special_link_delete_dialog (parent_view, link);
 		/* just ignore. We don't allow you to delete these */
 		break;
 	default:

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



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