383
384
BatchTransformation *bt_data = data;
385
if (bt_data->scan == NULL) {
386
gtk_widget_destroy (bt_data->dialog);
386
if ((bt_data->cancel == TRUE) || (bt_data->scan == NULL)) {
387
if (GTK_IS_WIDGET (bt_data->dialog))
388
gtk_widget_destroy (bt_data->dialog);
387
389
g_object_unref (bt_data->gui);
389
391
if (bt_data->data->dialog == NULL)
403
405
FileData *file = bt_data->scan->data;
406
name = basename_for_display (file->path);
407
_gtk_label_set_filename_text (GTK_LABEL (bt_data->label), name);
410
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (bt_data->bar),
411
(gdouble) (bt_data->i + 0.5) / bt_data->n);
413
apply_transformation (bt_data->dialog, bt_data->data, bt_data->scan, FALSE, apply_transformation_to_all_continue, bt_data);
408
if (bt_data->cancel == FALSE) {
409
name = basename_for_display (file->path);
410
_gtk_label_set_filename_text (GTK_LABEL (bt_data->label), name);
413
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (bt_data->bar),
414
(gdouble) (bt_data->i + 0.5) / bt_data->n);
416
apply_transformation (bt_data->dialog, bt_data->data, bt_data->scan, FALSE, apply_transformation_to_all_continue, bt_data);
416
420
bt_data->scan = bt_data->scan->next;
424
cancel_cb (GtkWidget *dialog,
426
BatchTransformation *bt_data)
428
/* Close-dialog and cancel-button do the same thing, and
429
there are no other buttons, so any response to this
430
dialog causes a cancel action. */
431
bt_data->cancel = TRUE;
421
436
apply_transformation_to_all (DialogData *data)
423
438
BatchTransformation *bt_data;
439
GtkWidget *progress_cancel;
425
441
bt_data = g_new0 (BatchTransformation, 1);
426
442
bt_data->data= data;
431
447
bt_data->label = glade_xml_get_widget (bt_data->gui, "progress_info");
432
448
bt_data->bar = glade_xml_get_widget (bt_data->gui, "progress_progressbar");
450
progress_cancel = glade_xml_get_widget (bt_data->gui, "progress_cancel");
451
bt_data->cancel = FALSE;
434
453
if (data->dialog == NULL)
435
454
gtk_window_set_transient_for (GTK_WINDOW (bt_data->dialog),
436
455
GTK_WINDOW (data->window));
439
458
gtk_window_set_transient_for (GTK_WINDOW (bt_data->dialog),
440
459
GTK_WINDOW (data->dialog));
462
g_signal_connect (G_OBJECT (bt_data->dialog),
464
G_CALLBACK (cancel_cb),
442
467
gtk_window_set_modal (GTK_WINDOW (bt_data->dialog), TRUE);
443
468
gtk_widget_show (bt_data->dialog);