Re: [PATCH] Fixed drag and drop between Nautilus and Mozilla



On Sun, 2005-01-09 at 21:27 +0100, Jorn Baayen wrote:
> Hi,
> 
> Not entirely unmotivated by the bounty I have been working on #127553,
> "Drag and Drop between Gnome and Mozilla". I got the thing mostly
> solved, but the code could use some reviewing, and I need some
> directions for solving the last remaining issue:
> 
> nautilus_link_local_create just overwrites any file without asking. So,
> we need an overwrite confirmation dialog. However, the standard one is
> nested in nautilus-file-operations.c:handle_transfer_overwrite. I could
> move it into its own function, which could then be used in
> nautilus_link_local_create as well. Another option would be
> link_local_creating the links in tmp files, and then using
> fm_directory_view_move_copy_items to move them to the right place.
> 
> I'll attach the patch to this mail as well for increased reviewing
> convenience.

Thanks. Btw. I once wrote up how i wanted this to work for another
bounty seeker:
http://mail.gnome.org/archives/nautilus-list/2004-February/msg00074.html
Did you read that?

Anyway, back to the patch:

+if (eel_is_remote_uri (uri)) {
+/* Create a list of remote uris, so that we only
+ * once have to ask what to do
+ */

This isn't right. eel_is_remote_uri uses gnome_vfs_uri_is_local() which
does some magic to check the "localness" of the file, such that e.g.
files on NFS partitions are not local. Use 
eel_vfs_has_capability (uri, EEL_VFS_CAPABILITY_IS_REMOTE_AND_SLOW)
instead to match the rest of the function. (although the capabilities
stuff was never really finished well it should work for this.)

nautilus_link_local_create_from_gnome_entry (entry, container_uri, 
-                                             (n_links > 0) ? NULL: &point, screen_num);
+                                             &point, screen_num);

Why this change? Doesn't that mean all the icons will be placed in the
same position? Maybe we should just use &point for the first item in the
list?

+if (n_symlink_uris > 0) {
+fm_directory_view_move_copy_items (symlink_uri_list, points,
+   container_uri,
+   GDK_ACTION_LINK, x, y, FM_DIRECTORY_VIEW (view));
+g_list_free (symlink_uri_list);
+}

Why use GDK_ACTION_LINK here? Shouldn't you use "action" as specified by
the user? (or as returned by nautilus_drag_drop_action_ask earlier in
the function).

+ if (strcmp (scheme, "http") == 0) {
+  if (n_uris > 1) {
+   prompt = _("Download the links?");
+   detail = _("You can download the links or create bookmarks.");
+  } else {
+   prompt = _("Download the link?");
+   detail = _("You can download the link or create a bookmark.");
+  }
+
+  link_action = _("_Bookmark");
+  copy_action = _("_Download");

I'm not sure bookmark is the best term here. It has a very specific
meaning in the context of web browsers, and making a deskop file link is
not it.

Also, the general handling of dnd modifiers seems wrong to me. If you
hold down ctrl-shift to force a link, or ctrl to force a copy you should
never ask the user what they want, since they explicitly requested a
specific operation. I'm not sure if mozilla supports the ASK action, but
if ASK is used and specified by the user, it looks like this code will
ask twice, which strikes me as strange.

While I was looking at this i took the opportunity to remove the old
"historic" links support and remove some unused nautilus-link stuff. The
changes conflict (very slightly) with your patch (one argument removed
from nautilus_link_local_create).

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a globe-trotting Jewish jungle king on the hunt for the last specimen of 
a great and near-mythical creature. She's a provocative motormouth snake 
charmer with the power to see death. They fight crime! 




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