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 498506 - Add dbus interface for common file operations
Add dbus interface for common file operations
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Scripts facilities
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 497008 547479 626479 (view as bug list)
Depends on:
Blocks: 350261 453758 525263 533962 534794 544136 556774 592788 598581 610408 612795 632154
 
 
Reported: 2007-11-20 14:24 UTC by Bastien Nocera
Modified: 2010-12-02 02:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Added basic dbus interfaces to application and window (29.55 KB, patch)
2009-10-10 15:52 UTC, Peter Goetz
needs-work Details | Review
Add support for copying files on the command-line (6.04 KB, patch)
2010-06-20 14:24 UTC, Bastien Nocera
none Details | Review
Add support for copying files on the command-line (6.03 KB, patch)
2010-06-22 17:16 UTC, Bastien Nocera
needs-work Details | Review

Description Bastien Nocera 2007-11-20 14:24:33 UTC
This would allow applications to better integrate with nautilus, eg. having nautilus-sendto be able to copy a file to a usb disk.

Alex also mentioned:
- opening new windows (rather than the Bonobo-using command-line interface)
- copying/moving/deleting/moving to trash files (could be useful for applications like Rhythmbox that handle libraries of files)
- selecting a specific file in a window (better "reveal in file manager" for download managers, file-roller)
- "copying" a file (Edit -> Copy)
Comment 1 Reinout van Schouwen 2008-09-03 20:26:37 UTC
(In reply to comment #0)

> - selecting a specific file in a window (better "reveal in file manager" for
> download managers, file-roller)

That's something that would be very nice in Epiphany. When auto-opening the download folder after download complete, we'd like to be able to put the downloaded file into view.
Comment 2 Alex Launi 2009-01-01 00:28:11 UTC
We over in the GNOME Do project would love this, and will buy who ever implements it a case of their favourite beverage.
Comment 3 Cosimo Cecchi 2009-02-20 00:02:57 UTC
*** Bug 547479 has been marked as a duplicate of this bug. ***
Comment 4 Matthew Barnes 2009-04-01 22:07:46 UTC
Also, requesting thumbnails without having to link to libgnome-desktop.
I'd like that for the attachment UI in Evolution.
Comment 5 Pierre Slamich 2009-05-01 19:25:29 UTC
The Gloobus devs (a instant preview system for files in Gnome) would need this to reduce the number of shortcuts from 2 to 1 for preview.
We thus would have a much needed equivalent to MacOS's Quickview.
Comment 6 Peter Goetz 2009-10-10 15:52:22 UTC
Created attachment 145216 [details] [review]
Added basic dbus interfaces to application and window

Hi,

I started adding dbus interfaces to nautilus. So far it's only for NautilusApplication and NautilusWindow. But I'm willing to add more, if people are interested. Further additions are also dependent on the help I'll get, since some things in Nautilus still confuse me ;-)

Feedback is very welcome!

Cheers
Comment 7 Christian Neumair 2009-10-10 17:21:03 UTC
> I started adding dbus interfaces to nautilus. So far it's only for
> NautilusApplication and NautilusWindow. But I'm willing to add more, if people
> are interested.

This is a good idea, thanks for your efforts. Actually, I started working towards the same functionality just a few hours ago. However, my approach was to add some code from Epiphany which handles the case where the D-Bus connection drops, and tries to reconnect afterwards (cf. src/ephy-dbus.[ch]). I also decided to put the D-Bus application, windows and views into separate objects (nautilus-dbus-*) because the concept we plan to expose slightly differs from the internal window, slot and view concept. A D-Bus view would map to a slot rather than a view, at least in the current design.
Comment 8 A. Walton 2009-10-11 22:26:17 UTC
Comment on attachment 145216 [details] [review]
Added basic dbus interfaces to application and window

Patch needs a great deal of work before it could be accepted (generated code, bad formatting, fails to check errors, leaks GFiles and strings, open window should take a 'Screen' parameter rather than assuming the default, etc).

Setting patch status as needs-work, but may be obsoleted by Christian's patch soon.
Comment 9 Peter Goetz 2009-10-13 21:43:18 UTC
(In reply to comment #7)
> also decided to put the D-Bus application, windows and views into separate
> objects (nautilus-dbus-*) because the concept we plan to expose slightly
> differs from the internal window, slot and view concept. A D-Bus view would map
> to a slot rather than a view, at least in the current design.

That's how I planned to do it, too. This simplifies nautilus interface fom a DBus perspective. So it totally makes sense to put it in separate classes.

It's good to hear that you're working on it. It seemed to me before, that nobody followed up on this, although it was suggested several times.


(In reply to comment #8)
> (From update of attachment 145216 [details] [review])
> Patch needs a great deal of work before it could be accepted (generated code,
> bad formatting, fails to check errors, leaks GFiles and strings, open window
> should take a 'Screen' parameter rather than assuming the default, etc).

That's right. The reason for submitting it in such an unfinished status was to demonstrate that I started working on it and that it works (hate to only talk about things). But I also submitted it so early, because I wanted to see if someone's already working on it. And as it turned out it is. 

> Setting patch status as needs-work, but may be obsoleted by Christian's patch
> soon.

Probability is very high, since Christian seems to have much more experience with Nautilus than I have and can accomplish it faster.
Comment 10 Bastien Nocera 2010-06-20 14:24:58 UTC
Created attachment 164147 [details] [review]
Add support for copying files on the command-line
Comment 11 Bastien Nocera 2010-06-20 14:25:40 UTC
Note that it's not even compile-tested as my devel env is a couple of days too old :)
Comment 12 Bastien Nocera 2010-06-22 17:16:44 UTC
Created attachment 164324 [details] [review]
Add support for copying files on the command-line
Comment 13 Cosimo Cecchi 2010-07-26 13:50:47 UTC
Review of attachment 164324 [details] [review]:

I finally managed to review this :)

Looks mostly fine, I inlined some comments below.

::: src/nautilus-application.c
@@ +824,3 @@
 	}
+
+	if (g_strcmp0 (name, COMMAND_COPY) == 0) {

I'd merge this following code with COMMAND_OPEN, and then add an if block later to see if you should copy or open.

@@ +859,3 @@
+		}
+
+		for (i = 0; urls[i+1] != NULL; i++)

Missing curly braces around the for cycle declaration (here and in the for cycle below).

::: src/nautilus-main.c
@@ +520,3 @@
+			if (copy_uris && uris_array->len < 2) {
+				/* FIXME print out an error that we're missing
+				 * arguments */

Could you please fix this FIXME? Or remove it completely, since you will warn out anyway later?
Comment 14 A. Walton 2010-08-10 07:04:44 UTC
*** Bug 626479 has been marked as a duplicate of this bug. ***
Comment 15 A. Walton 2010-08-10 07:06:48 UTC
*** Bug 497008 has been marked as a duplicate of this bug. ***
Comment 16 Bastien Nocera 2010-10-14 15:12:03 UTC
Cosimo, what's the plan wrt this patch?

Should we:
- use dbus-glib for it and fix the build?
- port the existing patch to GDbus?
- wait until GApplication is sorted (don't like this idea)
- use libunique instead?

Note that I'd also like that patch to include "empty-trash", with the possible confirmation dialogue.
Comment 17 Cosimo Cecchi 2010-12-02 01:50:15 UTC
(In reply to comment #16)

> - port the existing patch to GDbus?

I went for this, it allows a very easy extendibility.

I committed to master a patch that implements a very basic FileOperations dbus interface, with just one method (for now), which is

CopyURIs (as: source_uris, s: destination_uri).

> Note that I'd also like that patch to include "empty-trash", with the possible
> confirmation dialogue.

It's indeed a good idea to add more operations to this interface, but I don't want to expose everything over the bus, so I'd like to hear some use cases first (which is yours for emptying the trash by the way?)

I'd like to close this bug, which is old enough; I opened bug 636269 for the other request of this bug.
Comment 18 Cosimo Cecchi 2010-12-02 02:00:10 UTC
I read some use cases for EmptyTrash in the dependencies of this report, so I added that to master too.