After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 503763 - drag-and-drop save
drag-and-drop save
Status: RESOLVED DUPLICATE of bug 321211
Product: gtk+
Classification: Platform
Component: Widget: Other
2.12.x
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-12-15 18:10 UTC by Robert Pollak
Modified: 2007-12-16 21:51 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20



Description Robert Pollak 2007-12-15 18:10:13 UTC
The "Save As" dialog should provide a file icon that can be dragged into a nautilus folder to save the file (and close the dialog).

Similar behavior already exists in gnome-screenshot: The thumbnail displayed in the save dialog can be dragged into a nautilus folder.

(I am using Ubuntu Gutsy.)
Comment 1 Matthias Clasen 2007-12-16 04:32:00 UTC
Having the draggable icon in the save-as dialog somewhat defeats the purpose of 
the whole drag-to-save idea, namely to avoid save dialogs... 

It would make more sense to have a file icon that can be embedded somewhere in the app window, e.g. in the notebook tab for the document.
Comment 2 Mathias Hasselmann (IRC: tbf) 2007-12-16 09:33:44 UTC
What about making GtkToolButtons created with GTK_STOCK_SAVE/GTK_STOCK_SAVE_AS draggable? This of course still raises the question how signal the drop event. 

And when thinking about this: How would you figure out, which folder is represented by the window that received the dragged icon? Is there a specification for such stuff somewhere?
Comment 3 Mathias Hasselmann (IRC: tbf) 2007-12-16 10:02:26 UTC
Ok, the relevant "specification" seems to be http://freedesktop.org/wiki/Specifications/XDS - quite sketch and hard to comprehend - sometimes I wish Freedesktop.org would have some kind of quality control.

But one problem I've found there: Were to get the initial filename from, when dragging from some save I icon? Well, and I am pretty convinced this stuff has to working without any additional dialogs, since otherwise there is no convenience gain over our existing file dialog.
Comment 4 Robert Pollak 2007-12-16 13:09:44 UTC
> Where to get the initial filename from, when dragging from some save icon? 

That's why I proposed to use the save-as dialog with its filename input field.
The save-as dialog certainly has to stay anyway for accessability reasons.

On the other hand giving the name _after_ dragging is probably better.
(The concept could in future be extended to drag a file into another application. In that case no filename is necessary.)

Drag-save without save-as dialog could behave as follows:

- If the app knows a current file name (e.g. "foo"):
    - If a file "foo" already exists at the target location:
        - A (Nautilus?) dialog asks whether to
          (a) select a different name or
          (b) replace the file.
          (c) cancel the operation.
        - If (a):
            - The file is saved, using a unique generated name ("foo 1").
            - The Nautilus "rename" mode is entered for the saved file.
        - If (b):
            - The previous file is replaced.
    - Else save "foo".
- Else (saving a newly created document):
    - The file is saved, using a unique generated name
      ("new file", "new file 1").
    - The Nautilus "rename" mode is entered for the saved file.

Does that make sense?
(I hope the pseudocode is readable.)
Comment 5 Dan Winship 2007-12-16 14:47:54 UTC
(In reply to comment #3)
> Ok, the relevant "specification" seems to be
> http://freedesktop.org/wiki/Specifications/XDS - quite sketch and hard to
> comprehend - sometimes I wish Freedesktop.org would have some kind of quality
> control.

IIRC, the spec was written by ROX (http://roscidus.com/desktop/), so when in
doubt, check what they do.
Comment 6 Mathias Hasselmann (IRC: tbf) 2007-12-16 15:42:10 UTC
(In reply to comment #4)
> Does that make sense?
> (I hope the pseudocode is readable.)

To me this sounds doable. Let's get some opinion from Alex Larsson.
Comment 7 Matthias Clasen 2007-12-16 16:51:59 UTC
There are existing xds implementations, both in nautilus (iirc) and as gtk patches . Search for XDS in this bugzilla.
Comment 8 Mathias Hasselmann (IRC: tbf) 2007-12-16 21:51:31 UTC

*** This bug has been marked as a duplicate of 321211 ***