[nautilus/remove_background_leftovers: 3/4] dnd: remove support for property/bgimage as DND type.



commit 69760297516461187782ff3a6fa93d75bdda7eb7
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Sep 28 14:49:29 2010 +0200

    dnd: remove support for property/bgimage as DND type.
    
    That was used for tiled backgrounds in the 'Backgrounds and Emblems'
    dialog.

 libnautilus-private/nautilus-dnd.c      |   54 -------------------------------
 libnautilus-private/nautilus-dnd.h      |    3 --
 libnautilus-private/nautilus-file-dnd.c |    5 ---
 libnautilus-private/nautilus-icon-dnd.c |   53 ------------------------------
 4 files changed, 0 insertions(+), 115 deletions(-)
---
diff --git a/libnautilus-private/nautilus-dnd.c b/libnautilus-private/nautilus-dnd.c
index 2c4051a..7858bc3 100644
--- a/libnautilus-private/nautilus-dnd.c
+++ b/libnautilus-private/nautilus-dnd.c
@@ -823,60 +823,6 @@ nautilus_drag_drop_action_ask (GtkWidget *widget,
 	return damd.chosen;
 }
 
-GdkDragAction
-nautilus_drag_drop_background_ask (GtkWidget *widget, 
-				   GdkDragAction actions)
-{
-	GtkWidget *menu;
-	GtkWidget *menu_item;
-	DropActionMenuData damd;
-	
-	/* Create the menu and set the sensitivity of the items based on the
-	 * allowed actions.
-	 */
-	menu = gtk_menu_new ();
-	gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget));
-	
-	append_drop_action_menu_item (menu, _("Set as background for _all folders"),
-				      NAUTILUS_DND_ACTION_SET_AS_GLOBAL_BACKGROUND,
-				      (actions & NAUTILUS_DND_ACTION_SET_AS_GLOBAL_BACKGROUND) != 0,
-				      &damd);
-
-	append_drop_action_menu_item (menu, _("Set as background for _this folder"),
-				      NAUTILUS_DND_ACTION_SET_AS_FOLDER_BACKGROUND,
-				      (actions & NAUTILUS_DND_ACTION_SET_AS_FOLDER_BACKGROUND) != 0,
-				      &damd);
-
-	eel_gtk_menu_append_separator (GTK_MENU (menu));
-	
-	menu_item = gtk_menu_item_new_with_mnemonic (_("Cancel"));
-	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
-	gtk_widget_show (menu_item);
-	
-	damd.chosen = 0;
-	damd.loop = g_main_loop_new (NULL, FALSE);
-
-	g_signal_connect (menu, "deactivate",
-			  G_CALLBACK (menu_deactivate_callback),
-			  &damd);
-	
-	gtk_grab_add (menu);
-	
-	gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
-			NULL, NULL, 0, GDK_CURRENT_TIME);
-	
-	g_main_loop_run (damd.loop);
-
-	gtk_grab_remove (menu);
-	
-	g_main_loop_unref (damd.loop);
-
-	g_object_ref_sink (menu);
-	g_object_unref (menu);
-
-	return damd.chosen;	
-}
-
 gboolean
 nautilus_drag_autoscroll_in_scroll_region (GtkWidget *widget)
 {
diff --git a/libnautilus-private/nautilus-dnd.h b/libnautilus-private/nautilus-dnd.h
index 0f5d5c4..bb231ef 100644
--- a/libnautilus-private/nautilus-dnd.h
+++ b/libnautilus-private/nautilus-dnd.h
@@ -52,7 +52,6 @@ typedef enum {
 	NAUTILUS_ICON_DND_GNOME_ICON_LIST,
 	NAUTILUS_ICON_DND_URI_LIST,
 	NAUTILUS_ICON_DND_NETSCAPE_URL,
-	NAUTILUS_ICON_DND_BGIMAGE,
 	NAUTILUS_ICON_DND_TEXT,
 	NAUTILUS_ICON_DND_XDNDDIRECTSAVE,
 	NAUTILUS_ICON_DND_RAW,
@@ -167,8 +166,6 @@ int			    nautilus_drag_modifier_based_action		(int				       default_action,
 
 GdkDragAction		    nautilus_drag_drop_action_ask		(GtkWidget			      *widget,
 									 GdkDragAction			       possible_actions);
-GdkDragAction		    nautilus_drag_drop_background_ask		(GtkWidget			      *widget,
-									 GdkDragAction			       possible_actions);
 
 gboolean		    nautilus_drag_autoscroll_in_scroll_region	(GtkWidget			      *widget);
 void			    nautilus_drag_autoscroll_calculate_delta	(GtkWidget			      *widget,
diff --git a/libnautilus-private/nautilus-file-dnd.c b/libnautilus-private/nautilus-file-dnd.c
index e42dadc..6176604 100644
--- a/libnautilus-private/nautilus-file-dnd.c
+++ b/libnautilus-private/nautilus-file-dnd.c
@@ -30,7 +30,6 @@
 #include "nautilus-dnd.h"
 #include "nautilus-directory.h"
 #include "nautilus-file-utilities.h"
-#include <eel/eel-glib-extensions.h>
 #include <string.h>
 
 static gboolean
@@ -128,10 +127,6 @@ nautilus_drag_can_accept_info (NautilusFile *drop_target_item,
 		case NAUTILUS_ICON_DND_ROOTWINDOW_DROP:
 			return FALSE;
 
-		/* TODO return TRUE for folders as soon as drop handling is implemented */
-		case NAUTILUS_ICON_DND_BGIMAGE:
-			return FALSE;
-
 		default:
 			g_assert_not_reached ();
 			return FALSE;
diff --git a/libnautilus-private/nautilus-icon-dnd.c b/libnautilus-private/nautilus-icon-dnd.c
index 6b37f31..3e2a6a4 100644
--- a/libnautilus-private/nautilus-icon-dnd.c
+++ b/libnautilus-private/nautilus-icon-dnd.c
@@ -70,7 +70,6 @@ static const GtkTargetEntry drop_types [] = {
 	/* prefer "_NETSCAPE_URL" over "text/uri-list" to satisfy web browsers. */
 	{ NAUTILUS_ICON_DND_NETSCAPE_URL_TYPE, 0, NAUTILUS_ICON_DND_NETSCAPE_URL },
 	{ NAUTILUS_ICON_DND_URI_LIST_TYPE, 0, NAUTILUS_ICON_DND_URI_LIST },
-	{ NAUTILUS_ICON_DND_BGIMAGE_TYPE, 0, NAUTILUS_ICON_DND_BGIMAGE },
 	{ NAUTILUS_ICON_DND_XDNDDIRECTSAVE_TYPE, 0, NAUTILUS_ICON_DND_XDNDDIRECTSAVE }, /* XDS Protocol Type */
 	{ NAUTILUS_ICON_DND_RAW_TYPE, 0, NAUTILUS_ICON_DND_RAW },
 	/* Must be last: */
@@ -598,50 +597,6 @@ nautilus_icon_container_selection_items_local (NautilusIconContainer *container,
 	return result;
 }
 
-static GdkDragAction 
-get_background_drag_action (NautilusIconContainer *container, 
-			    GdkDragAction action)
-{
-	/* FIXME: This function is very FMDirectoryView specific, and
-	 * should be moved out of nautilus-icon-dnd.c */
-	GdkDragAction valid_actions;
-
-	if (action == GDK_ACTION_ASK) {
-		valid_actions = NAUTILUS_DND_ACTION_SET_AS_FOLDER_BACKGROUND;
-		if (!eel_background_is_desktop (eel_get_widget_background (GTK_WIDGET (container)))) {
-			valid_actions |= NAUTILUS_DND_ACTION_SET_AS_GLOBAL_BACKGROUND;
-		}
-
-		action = nautilus_drag_drop_background_ask 
-			(GTK_WIDGET (container), valid_actions);
-	}
-
-	return action;
-}
-
-/* handle dropped tile images */
-static void
-receive_dropped_tile_image (NautilusIconContainer *container, GdkDragAction action, GtkSelectionData *data)
-{
-	g_assert (data != NULL);
-
-	action = get_background_drag_action (container, action);
-
-	if (action > 0) {
-		char *uri;
-
-		uri = get_container_uri (container);
-		nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
-				    "dropped tile image on icon container displaying %s", uri);
-		g_free (uri);
-
-		eel_background_receive_dropped_background_image
-			(eel_get_widget_background (GTK_WIDGET (container)), 
-			 action, 
-			 gtk_selection_data_get_data (data));
-	}
-}
-
 /* handle dropped url */
 static void
 receive_dropped_netscape_url (NautilusIconContainer *container, const char *encoded_url, GdkDragContext *context, int x, int y)
@@ -1249,7 +1204,6 @@ nautilus_icon_container_get_drop_action (NautilusIconContainer *container,
 		*action = nautilus_drag_default_drop_action_for_netscape_url (context);
 		break;
 
-	case NAUTILUS_ICON_DND_BGIMAGE:
 	case NAUTILUS_ICON_DND_ROOTWINDOW_DROP:
 		*action = gdk_drag_context_get_suggested_action (context);
 		break;
@@ -1669,7 +1623,6 @@ drag_data_received_callback (GtkWidget *widget,
 	case NAUTILUS_ICON_DND_GNOME_ICON_LIST:
 		nautilus_icon_container_dropped_icon_feedback (widget, data, x, y);
 		break;
-	case NAUTILUS_ICON_DND_BGIMAGE:	
 	case NAUTILUS_ICON_DND_URI_LIST:
 	case NAUTILUS_ICON_DND_TEXT:
 	case NAUTILUS_ICON_DND_XDNDDIRECTSAVE:
@@ -1705,12 +1658,6 @@ drag_data_received_callback (GtkWidget *widget,
 				(NAUTILUS_ICON_CONTAINER (widget),
 				 context, x, y);
 			break;
-		case NAUTILUS_ICON_DND_BGIMAGE:
-			receive_dropped_tile_image
-				(NAUTILUS_ICON_CONTAINER (widget),
-				 gdk_drag_context_get_selected_action (context),
-				 data);
-			break;
 		case NAUTILUS_ICON_DND_NETSCAPE_URL:
 			receive_dropped_netscape_url
 				(NAUTILUS_ICON_CONTAINER (widget),



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