1717
1818const Gio = imports . gi . Gio ;
1919const GLib = imports . gi . GLib ;
20- var NautilusFileOperations2Proxy ;
20+ var NautilusFileOperationsProxy ;
2121var FreeDesktopFileManagerProxy ;
2222var GnomeNautilusPreviewProxy ;
2323var SwitcherooControlProxyClass ;
@@ -26,51 +26,37 @@ var discreteGpuAvailable;
2626var GnomeArchiveManagerProxy ;
2727var GtkVfsMetadataProxy ;
2828
29- const NautilusFileOperations2Interface = `<node>
30- <interface name='org.gnome.Nautilus.FileOperations2 '>
29+ const NautilusFileOperationsInterface = `<node>
30+ <interface name='org.gnome.Nautilus.FileOperations '>
3131 <method name='CopyURIs'>
32- <arg type='as' name='sources' direction='in'/>
33- <arg type='s' name='destination' direction='in'/>
34- <arg type='a{sv}' name='platform_data' direction='in'/>
32+ <arg name='URIs' type='as' direction='in'/>
33+ <arg name='Destination' type='s' direction='in'/>
3534 </method>
3635 <method name='MoveURIs'>
37- <arg type='as' name='sources' direction='in'/>
38- <arg type='s' name='destination' direction='in'/>
39- <arg type='a{sv}' name='platform_data' direction='in'/>
36+ <arg name='URIs' type='as' direction='in'/>
37+ <arg name='Destination' type='s' direction='in'/>
4038 </method>
4139 <method name='EmptyTrash'>
42- <arg type="b" name="ask_confirmation" direction='in'/>
43- <arg type='a{sv}' name='platform_data' direction='in'/>
4440 </method>
45- <method name='TrashURIs'>
46- <arg type='as' name='uris' direction='in'/>
47- <arg type='a{sv}' name='platform_data' direction='in'/>
48- </method>
49- <method name='DeleteURIs'>
50- <arg type='as' name='uris' direction='in'/>
51- <arg type='a{sv}' name='platform_data' direction='in'/>
41+ <method name='TrashFiles'>
42+ <arg name='URIs' type='as' direction='in'/>
5243 </method>
5344 <method name='CreateFolder'>
54- <arg type='s' name='parent_uri' direction='in'/>
55- <arg type='s' name='new_folder_name' direction='in'/>
56- <arg type='a{sv}' name='platform_data' direction='in'/>
45+ <arg name='URI' type='s' direction='in'/>
5746 </method>
58- <method name='RenameURI'>
59- <arg type='s' name='uri' direction='in'/>
60- <arg type='s' name='new_name' direction='in'/>
61- <arg type='a{sv}' name='platform_data' direction='in'/>
47+ <method name='RenameFile'>
48+ <arg name='URI' type='s' direction='in'/>
49+ <arg name='NewName' type='s' direction='in'/>
6250 </method>
6351 <method name='Undo'>
64- <arg type='a{sv}' name='platform_data' direction='in'/>
6552 </method>
6653 <method name='Redo'>
67- <arg type='a{sv}' name='platform_data' direction='in'/>
6854 </method>
6955 <property name="UndoStatus" type="i" access="read"/>
7056</interface>
7157</node>` ;
7258
73- const NautilusFileOperations2ProxyInterface = Gio . DBusProxy . makeProxyWrapper ( NautilusFileOperations2Interface ) ;
59+ const NautilusFileOperationsProxyInterface = Gio . DBusProxy . makeProxyWrapper ( NautilusFileOperationsInterface ) ;
7460
7561const FreeDesktopFileManagerInterface = `<node>
7662<interface name='org.freedesktop.FileManager1'>
@@ -254,58 +240,17 @@ const GtkVfsMetadataInterface = `<node>
254240const GtkVfsMetadataProxyInterface = Gio . DBusProxy . makeProxyWrapper ( GtkVfsMetadataInterface ) ;
255241
256242function init ( ) {
257- NautilusFileOperations2Proxy = new NautilusFileOperations2ProxyInterface (
243+ NautilusFileOperationsProxy = new NautilusFileOperationsProxyInterface (
258244 Gio . DBus . session ,
259245 'org.gnome.Nautilus' ,
260- '/org/gnome/Nautilus/FileOperations2 ' ,
246+ '/org/gnome/Nautilus' ,
261247 ( proxy , error ) => {
262248 if ( error ) {
263249 log ( 'Error connecting to Nautilus' ) ;
264250 }
265251 }
266252 ) ;
267253
268- NautilusFileOperations2Proxy . platformData = params => {
269- const inShell = typeof global !== 'undefined' ;
270- const defaultParams = {
271- timestamp : inShell ? global . get_current_time ( ) :
272- imports . gi . Gtk . get_current_event_time ( ) ,
273- parentWindow : inShell ? null :
274- imports . gi . Gtk . get_current_event ( ) . get_window ( ) ,
275- windowPosition : 'center' ,
276- } ;
277- const { parentWindow, timestamp, windowPosition } = {
278- ...defaultParams ,
279- ...params ,
280- } ;
281-
282- let { parentHandle } = params ?? { parentHandle : '' } ;
283- if ( ! parentHandle && parentWindow ) {
284- try {
285- imports . gi . versions . GdkX11 = '3.0' ;
286- const { GdkX11 } = imports . gi ;
287- const topLevel = parentWindow . get_effective_toplevel ( ) ;
288-
289- if ( topLevel . constructor . $gtype === GdkX11 . X11Window . $gtype ) {
290- const xid = GdkX11 . X11Window . prototype . get_xid . call ( topLevel ) ;
291- parentHandle = `x11:${ xid } ` ;
292- } /* else if (topLevel instanceof GdkWayland.Toplevel) {
293- FIXME: Need Gtk4 to use GdkWayland
294- const handle = GdkWayland.Toplevel.prototype.export_handle.call(topLevel);
295- parentHandle = `wayland:${handle}`;
296- } */
297- } catch ( e ) {
298- logError ( e , 'Impossible to determine the parent window' ) ;
299- }
300- }
301-
302- return {
303- 'parent-handle' : new GLib . Variant ( 's' , parentHandle ) ,
304- 'timestamp' : new GLib . Variant ( 'u' , timestamp ) ,
305- 'window-position' : new GLib . Variant ( 's' , windowPosition ) ,
306- } ;
307- }
308-
309254 FreeDesktopFileManagerProxy = new FreeDesktopFileManagerProxyInterface (
310255 Gio . DBus . session ,
311256 'org.freedesktop.FileManager1' ,
0 commit comments