3 #include <libnautilus-private/nautilus-file-operations.h>
4 #include <libnautilus-private/nautilus-progress-info.h>
7 copy_done (GHashTable
*debuting_uris
, gpointer data
)
9 g_print ("Copy done\n");
13 changed_cb (NautilusProgressInfo
*info
,
16 g_print ("Changed: %s -- %s\n",
17 nautilus_progress_info_get_status (info
),
18 nautilus_progress_info_get_details (info
));
22 progress_changed_cb (NautilusProgressInfo
*info
,
25 g_print ("Progress changed: %f\n",
26 nautilus_progress_info_get_progress (info
));
30 finished_cb (NautilusProgressInfo
*info
,
33 g_print ("Finished\n");
38 main (int argc
, char* argv
[])
46 NautilusProgressInfo
*progress_info
;
50 test_init (&argc
, &argv
);
53 g_print ("Usage test-copy <sources...> <dest dir>\n");
58 for (i
= 1; i
< argc
- 1; i
++) {
59 source
= g_file_new_for_commandline_arg (argv
[i
]);
60 sources
= g_list_prepend (sources
, source
);
62 sources
= g_list_reverse (sources
);
64 dest
= g_file_new_for_commandline_arg (argv
[i
]);
66 window
= test_window_new ("copy test", 5);
68 gtk_widget_show (window
);
70 nautilus_file_operations_copy (sources
,
71 NULL
/* GArray *relative_item_points */,
76 infos
= nautilus_get_all_progress_info ();
82 progress_info
= NAUTILUS_PROGRESS_INFO (infos
->data
);
84 g_signal_connect (progress_info
, "changed", (GCallback
)changed_cb
, NULL
);
85 g_signal_connect (progress_info
, "progress-changed", (GCallback
)progress_changed_cb
, NULL
);
86 g_signal_connect (progress_info
, "finished", (GCallback
)finished_cb
, NULL
);