Commit bdb1a8e7 authored by Andy Hertzfeld's avatar Andy Hertzfeld
Browse files

implemented task 2078, we need a better drag and drop based way to delete


	implemented task 2078, we need a better drag and drop based way
	to delete emblems, by adding a special "erase" emblem and adding
	code to special-case it to delete the emblems.
parent c29c4732
2000-08-17 Andy Hertzfeld <andy@eazel.com>
* libnautilus-extensions/nautilus-icon-dnd.c:
(receive_dropped_keyword):
implemented task 2078, we need a better drag and drop-based way to
delete emblems, by adding an "erase emblems" emblem and special-casing
it to erase the emblems.
* data/emblems/Makefile.am:
* data/emblems/erase.png:
added Susan's erase emblem image
2000-08-17 Andy Hertzfeld <andy@eazel.com>
* libnautilus-extensions/nautilus-image.c: (ensure_buffer_size),
......
......@@ -6,6 +6,7 @@ emblems_DATA = \
confidential.gif \
distinguished.png \
draft.png \
erase.png \
favorite.png \
important.png \
new.png \
......
......@@ -48,6 +48,7 @@
#include "nautilus-background.h"
#include "nautilus-graphic-effects.h"
#include "nautilus-stock-dialogs.h"
#include "nautilus-string.h"
#include "nautilus-icon-private.h"
......@@ -100,6 +101,8 @@ static GtkTargetEntry drop_types [] = {
/* the largest amount of auto scroll used when we are right over the view
* edge
*/
/* special reserved name for the erase emblem */
#define ERASE_KEYWORD "erase"
static GnomeCanvasItem *
create_selection_shadow (NautilusIconContainer *container,
......@@ -519,20 +522,24 @@ receive_dropped_keyword (NautilusIconContainer *container, char* keyword, int x,
file = nautilus_file_get (uri);
g_free (uri);
keywords = nautilus_file_get_keywords (file);
word = g_list_find_custom (keywords, keyword, (GCompareFunc) strcmp);
if (word == NULL) {
keywords = g_list_append (keywords, g_strdup (keyword));
/* special case the erase emblem */
if (!nautilus_strcmp (keyword, ERASE_KEYWORD)) {
keywords = NULL;
} else {
keywords = g_list_remove_link (keywords, word);
g_free (word->data);
g_list_free (word);
keywords = nautilus_file_get_keywords (file);
word = g_list_find_custom (keywords, keyword, (GCompareFunc) strcmp);
if (word == NULL) {
keywords = g_list_append (keywords, g_strdup (keyword));
} else {
keywords = g_list_remove_link (keywords, word);
g_free (word->data);
g_list_free (word);
}
}
nautilus_file_set_keywords (file, keywords);
nautilus_file_unref (file);
nautilus_icon_container_update_icon (container, drop_target_icon);
}
static int
......
......@@ -48,6 +48,7 @@
#include "nautilus-background.h"
#include "nautilus-graphic-effects.h"
#include "nautilus-stock-dialogs.h"
#include "nautilus-string.h"
#include "nautilus-icon-private.h"
......@@ -100,6 +101,8 @@ static GtkTargetEntry drop_types [] = {
/* the largest amount of auto scroll used when we are right over the view
* edge
*/
/* special reserved name for the erase emblem */
#define ERASE_KEYWORD "erase"
static GnomeCanvasItem *
create_selection_shadow (NautilusIconContainer *container,
......@@ -519,20 +522,24 @@ receive_dropped_keyword (NautilusIconContainer *container, char* keyword, int x,
file = nautilus_file_get (uri);
g_free (uri);
keywords = nautilus_file_get_keywords (file);
word = g_list_find_custom (keywords, keyword, (GCompareFunc) strcmp);
if (word == NULL) {
keywords = g_list_append (keywords, g_strdup (keyword));
/* special case the erase emblem */
if (!nautilus_strcmp (keyword, ERASE_KEYWORD)) {
keywords = NULL;
} else {
keywords = g_list_remove_link (keywords, word);
g_free (word->data);
g_list_free (word);
keywords = nautilus_file_get_keywords (file);
word = g_list_find_custom (keywords, keyword, (GCompareFunc) strcmp);
if (word == NULL) {
keywords = g_list_append (keywords, g_strdup (keyword));
} else {
keywords = g_list_remove_link (keywords, word);
g_free (word->data);
g_list_free (word);
}
}
nautilus_file_set_keywords (file, keywords);
nautilus_file_unref (file);
nautilus_icon_container_update_icon (container, drop_target_icon);
}
static int
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment