Commit 2048c2d6 authored by Cosimo Cecchi's avatar Cosimo Cecchi

Finish implement icon boxes in the dialog.

Finish implement icon boxes in the conflict dialog.
Add a main thread runner from inside the file operations, as
the operation itself is done in an I/O worker thread.
parent fee8b509
......@@ -87,9 +87,9 @@ build_dialog_appearance (NautilusFileConflictDialog *fcd)
char *src_name, *dest_name, *dest_dir_name;
char *label_text;
char *size, *date;
//NautilusIconInfo *src_icon, *dest_icon;
//GdkPixbuf *src_pixbuf, *dest_pixbuf;
//GtkWidget *src_image, *dest_image;
NautilusIconInfo *src_icon, *dest_icon;
GdkPixbuf *src_pixbuf, *dest_pixbuf;
GtkWidget *src_image, *dest_image;
GtkWidget *label;
GtkWidget *rename_button;
NautilusFile *src, *dest, *dest_dir;
......@@ -157,7 +157,7 @@ build_dialog_appearance (NautilusFileConflictDialog *fcd)
g_free (primary_text);
g_free (primary_markup);
g_free (secondary_text);
#if 0
/* Set up file icons */
src_icon = nautilus_file_get_icon (src,
......@@ -181,16 +181,15 @@ build_dialog_appearance (NautilusFileConflictDialog *fcd)
dest_pixbuf = nautilus_icon_info_get_pixbuf_at_size (src_icon,
NAUTILUS_ICON_SIZE_STANDARD);
src_image = gtk_image_new ();
dest_image = gtk_image_new ();
gtk_widget_show (src_image);
gtk_widget_show (dest_image);
src_image = gtk_image_new_from_pixbuf (src_pixbuf);
dest_image = gtk_image_new_from_pixbuf (dest_pixbuf);
gtk_box_pack_start (GTK_BOX (details->first_hbox),
src_image, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (details->second_hbox),
dest_image, FALSE, FALSE, 0);
gtk_widget_show (src_image);
gtk_widget_show (dest_image);
#endif
/* Set up labels */
label = gtk_label_new (NULL);
date = nautilus_file_get_string_attribute (src,
......
......@@ -3741,7 +3741,7 @@ static gboolean
test_dir_is_parent (GFile *child, GFile *root)
{
GFile *f;
f = g_file_dup (child);
while (f) {
if (g_file_equal (f, root)) {
......@@ -3750,7 +3750,6 @@ test_dir_is_parent (GFile *child, GFile *root)
}
f = g_file_get_parent (f);
}
if (f) {
g_object_unref (f);
}
......@@ -3831,6 +3830,56 @@ is_trusted_desktop_file (GFile *file,
return res;
}
typedef struct {
GFile *src;
GFile *dest;
GFile *dest_dir;
GtkWindow *parent;
} MyData;
static gboolean
do_run_my_dialog (gpointer _data)
{
MyData *data = _data;
GtkWidget *dialog;
dialog = nautilus_file_conflict_dialog_new (data->parent,
data->src,
data->dest,
data->dest_dir);
gtk_dialog_run (GTK_DIALOG (dialog));
return FALSE;
}
static void
run_my_dialog (CommonJob *job,
GFile *src,
GFile *dest,
GFile *dest_dir)
{
MyData *data;
g_timer_stop (job->time);
data = g_new0 (MyData, 1);
data->parent = job->parent_window;
data->src = src;
data->dest = dest;
data->dest_dir = dest_dir;
nautilus_progress_info_pause (job->progress);
g_io_scheduler_job_send_to_mainloop (job->io_job,
do_run_my_dialog,
data,
NULL);
nautilus_progress_info_resume (job->progress);
g_free (data);
g_timer_continue (job->time);
}
/* Debuting files is non-NULL only for toplevel items */
static void
copy_move_file (CopyMoveJob *copy_job,
......@@ -4042,7 +4091,6 @@ copy_move_file (CopyMoveJob *copy_job,
if (!overwrite &&
IS_IO_ERROR (error, EXISTS)) {
gboolean is_merge;
GtkWidget *dialog;
if (unique_names) {
g_object_unref (dest);
......@@ -4051,10 +4099,7 @@ copy_move_file (CopyMoveJob *copy_job,
goto retry;
}
dialog = nautilus_file_conflict_dialog_new (job->parent_window,
src, dest, dest_dir);
gtk_widget_show (dialog);
run_my_dialog (job, src, dest, dest_dir);
is_merge = FALSE;
#if 0
if (is_dir (dest)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment