Make the emission of ::end-print and ::done consistent for previews.
2007-04-29 Matthias Clasen <mclasen@redhat.com> Make the emission of ::end-print and ::done consistent for previews. (#347567, Yevgen Muntyan) * gtk/gtkprintoperation.c (preview_iface_end_preview): Set the finished status here. (preview_end_run): ...and not here. (print_pages_idle_done): Emit ::done for a cancelled preview. (print_pages_idle): If a preview has been cancelled, don't emit ::ready, but emit ::end-print. tests/print-editor.c: Use ::end-print to undo allocations from ::begin-print. svn path=/trunk/; revision=17719
This commit is contained in:

committed by
Matthias Clasen

parent
177f9aec9c
commit
b9856ac887
15
ChangeLog
15
ChangeLog
@ -1,3 +1,18 @@
|
|||||||
|
2007-04-29 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
Make the emission of ::end-print and ::done consistent
|
||||||
|
for previews. (#347567, Yevgen Muntyan)
|
||||||
|
|
||||||
|
* gtk/gtkprintoperation.c (preview_iface_end_preview): Set
|
||||||
|
the finished status here.
|
||||||
|
(preview_end_run): ...and not here.
|
||||||
|
(print_pages_idle_done): Emit ::done for a cancelled preview.
|
||||||
|
(print_pages_idle): If a preview has been cancelled, don't
|
||||||
|
emit ::ready, but emit ::end-print.
|
||||||
|
|
||||||
|
tests/print-editor.c: Use ::end-print to undo allocations
|
||||||
|
from ::begin-print.
|
||||||
|
|
||||||
2007-04-29 Matthias Clasen <mclasen@redhat.com>
|
2007-04-29 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkpapersize.c (gtk_paper_size_new): Mark paper sizes
|
* gtk/gtkpapersize.c (gtk_paper_size_new): Mark paper sizes
|
||||||
|
@ -190,8 +190,9 @@ preview_iface_end_preview (GtkPrintOperationPreview *preview)
|
|||||||
if (op->priv->end_run)
|
if (op->priv->end_run)
|
||||||
op->priv->end_run (op, op->priv->is_sync, TRUE);
|
op->priv->end_run (op, op->priv->is_sync, TRUE);
|
||||||
|
|
||||||
g_signal_emit (op, signals[DONE], 0,
|
_gtk_print_operation_set_status (op, GTK_PRINT_STATUS_FINISHED, NULL);
|
||||||
GTK_PRINT_OPERATION_RESULT_APPLY);
|
|
||||||
|
g_signal_emit (op, signals[DONE], 0, GTK_PRINT_OPERATION_RESULT_APPLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -252,8 +253,6 @@ preview_end_run (GtkPrintOperation *op,
|
|||||||
{
|
{
|
||||||
g_free (op->priv->page_ranges);
|
g_free (op->priv->page_ranges);
|
||||||
op->priv->page_ranges = NULL;
|
op->priv->page_ranges = NULL;
|
||||||
|
|
||||||
_gtk_print_operation_set_status (op, GTK_PRINT_STATUS_FINISHED, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1929,7 +1928,7 @@ print_pages_idle_done (gpointer user_data)
|
|||||||
if (priv->rloop && !data->is_preview)
|
if (priv->rloop && !data->is_preview)
|
||||||
g_main_loop_quit (priv->rloop);
|
g_main_loop_quit (priv->rloop);
|
||||||
|
|
||||||
if (!data->is_preview)
|
if (!data->is_preview || priv->cancelled)
|
||||||
g_signal_emit (data->op, signals[DONE], 0,
|
g_signal_emit (data->op, signals[DONE], 0,
|
||||||
priv->cancelled ?
|
priv->cancelled ?
|
||||||
GTK_PRINT_OPERATION_RESULT_CANCEL :
|
GTK_PRINT_OPERATION_RESULT_CANCEL :
|
||||||
@ -2126,7 +2125,7 @@ print_pages_idle (gpointer user_data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->is_preview)
|
if (data->is_preview && !priv->cancelled)
|
||||||
{
|
{
|
||||||
done = TRUE;
|
done = TRUE;
|
||||||
|
|
||||||
@ -2147,7 +2146,7 @@ print_pages_idle (gpointer user_data)
|
|||||||
done = TRUE;
|
done = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (done && !data->is_preview)
|
if (done && (!data->is_preview || priv->cancelled))
|
||||||
{
|
{
|
||||||
g_signal_emit (data->op, signals[END_PRINT], 0, priv->print_context);
|
g_signal_emit (data->op, signals[END_PRINT], 0, priv->print_context);
|
||||||
priv->end_run (data->op, priv->is_sync, priv->cancelled);
|
priv->end_run (data->op, priv->is_sync, priv->cancelled);
|
||||||
|
@ -634,8 +634,6 @@ print_done (GtkPrintOperation *op,
|
|||||||
|
|
||||||
g_free (print_data->text);
|
g_free (print_data->text);
|
||||||
g_free (print_data->font);
|
g_free (print_data->font);
|
||||||
g_list_free (print_data->page_breaks);
|
|
||||||
g_object_unref (print_data->layout);
|
|
||||||
g_free (print_data);
|
g_free (print_data);
|
||||||
|
|
||||||
if (!gtk_print_operation_is_finished (op))
|
if (!gtk_print_operation_is_finished (op))
|
||||||
@ -650,6 +648,15 @@ print_done (GtkPrintOperation *op,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
end_print (GtkPrintOperation *op, GtkPrintContext *context, PrintData *print_data)
|
||||||
|
{
|
||||||
|
g_list_free (print_data->page_breaks);
|
||||||
|
print_data->page_breaks = NULL;
|
||||||
|
g_object_unref (print_data->layout);
|
||||||
|
print_data->layout = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
do_print_or_preview (GtkAction *action, GtkPrintOperationAction print_action)
|
do_print_or_preview (GtkAction *action, GtkPrintOperationAction print_action)
|
||||||
{
|
{
|
||||||
@ -672,6 +679,7 @@ do_print_or_preview (GtkAction *action, GtkPrintOperationAction print_action)
|
|||||||
gtk_print_operation_set_default_page_setup (print, page_setup);
|
gtk_print_operation_set_default_page_setup (print, page_setup);
|
||||||
|
|
||||||
g_signal_connect (print, "begin_print", G_CALLBACK (begin_print), print_data);
|
g_signal_connect (print, "begin_print", G_CALLBACK (begin_print), print_data);
|
||||||
|
g_signal_connect (print, "end-print", G_CALLBACK (end_print), print_data);
|
||||||
g_signal_connect (print, "draw_page", G_CALLBACK (draw_page), print_data);
|
g_signal_connect (print, "draw_page", G_CALLBACK (draw_page), print_data);
|
||||||
g_signal_connect (print, "create_custom_widget", G_CALLBACK (create_custom_widget), print_data);
|
g_signal_connect (print, "create_custom_widget", G_CALLBACK (create_custom_widget), print_data);
|
||||||
g_signal_connect (print, "custom_widget_apply", G_CALLBACK (custom_widget_apply), print_data);
|
g_signal_connect (print, "custom_widget_apply", G_CALLBACK (custom_widget_apply), print_data);
|
||||||
|
Reference in New Issue
Block a user