+2006-06-08 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkprintoperation.h (GtkPrintOperationResult): Get
+ rid of GTK_PRINT_OPERATION_RESULT_PREVIEW.
+
+ * gtk/gtkprintoperation-unix.c:
+ * gtk/gtkprintoperation.c: Update all users.
+
2006-06-08 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkevents-win32.c (gdk_event_translate):
+2006-06-08 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkprintoperation.h (GtkPrintOperationResult): Get
+ rid of GTK_PRINT_OPERATION_RESULT_PREVIEW.
+
+ * gtk/gtkprintoperation-unix.c:
+ * gtk/gtkprintoperation.c: Update all users.
+
2006-06-08 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkevents-win32.c (gdk_event_translate):
GMainLoop *loop;
gboolean data_sent;
- /* Real printing (not preview: */
+ /* Real printing (not preview) */
GtkPrintJob *job; /* the job we are sending to the printer */
cairo_surface_t *surface;
gulong job_status_changed_tag;
{
GtkPrintOperation *op;
gboolean do_print;
+ gboolean do_preview;
GtkPrintOperationResult result;
GtkPrintOperationPrintFunc print_cb;
GDestroyNotify destroy;
GtkPrintOperation *op = rdata->op;
GtkPrintOperationPrivate *priv = op->priv;
GtkPrintJob *job;
- gboolean is_preview;
-
- is_preview = rdata->result == GTK_PRINT_OPERATION_RESULT_PREVIEW;
if (rdata->do_print)
{
priv->print_context = _gtk_print_context_new (op);
_gtk_print_context_set_page_setup (priv->print_context, page_setup);
- if (!is_preview)
+ if (!rdata->do_preview)
{
GtkPrintOperationUnix *op_unix;
cairo_t *cr;
if (response == GTK_RESPONSE_OK)
{
- rdata->result = GTK_PRINT_OPERATION_RESULT_APPLY;
-
printer = gtk_print_unix_dialog_get_selected_printer (GTK_PRINT_UNIX_DIALOG (pd));
+
+ rdata->result = GTK_PRINT_OPERATION_RESULT_APPLY;
+ rdata->do_preview = FALSE;
if (printer != NULL)
rdata->do_print = TRUE;
}
else if (response == GTK_RESPONSE_APPLY)
{
/* print preview */
- rdata->result = GTK_PRINT_OPERATION_RESULT_PREVIEW;
+ rdata->result = GTK_PRINT_OPERATION_RESULT_APPLY;
+ rdata->do_preview = TRUE;
rdata->do_print = TRUE;
}
void
_gtk_print_operation_platform_backend_preview_start_page (GtkPrintOperation *op,
- cairo_surface_t *surface,
- cairo_t *cr)
+ cairo_surface_t *surface,
+ cairo_t *cr)
{
}
void
_gtk_print_operation_platform_backend_preview_end_page (GtkPrintOperation *op,
- cairo_surface_t *surface,
- cairo_t *cr)
+ cairo_surface_t *surface,
+ cairo_t *cr)
{
cairo_show_page (cr);
}
gtk_print_operation_preview_render_page (pop->preview, pop->page_nr);
cr = gtk_print_context_get_cairo_context (pop->print_context);
- _gtk_print_operation_platform_backend_preview_end_page (op, pop->surface,
- cr);
+ _gtk_print_operation_platform_backend_preview_end_page (op, pop->surface, cr);
/* TODO: print out sheets not pages and follow ranges */
pop->page_nr++;
_gtk_print_operation_platform_backend_resize_preview_surface (op, page_setup, pop->surface);
cr = gtk_print_context_get_cairo_context (pop->print_context);
- _gtk_print_operation_platform_backend_preview_start_page (op, pop->surface,
- cr);
+ _gtk_print_operation_platform_backend_preview_start_page (op, pop->surface, cr);
}
data = g_new0 (PrintPagesData, 1);
data->op = g_object_ref (op);
- data->is_preview = (result == GTK_PRINT_OPERATION_RESULT_PREVIEW);
+ data->is_preview = (op->priv->action == GTK_PRINT_OPERATION_ACTION_PREVIEW);
if (priv->show_progress)
{
}
else if (action == GTK_PRINT_OPERATION_ACTION_PREVIEW)
{
+ priv->is_sync = !priv->allow_async;
priv->print_context = _gtk_print_context_new (op);
page_setup = create_page_setup (op);
_gtk_print_context_set_page_setup (priv->print_context, page_setup);
g_object_unref (page_setup);
do_print = TRUE;
- result = GTK_PRINT_OPERATION_RESULT_PREVIEW;
-
- priv->is_sync = !priv->allow_async;
+ result = priv->is_sync ? GTK_PRINT_OPERATION_RESULT_APPLY : GTK_PRINT_OPERATION_RESULT_IN_PROGRESS;
}
#ifndef G_OS_WIN32
else if (priv->allow_async)
GTK_PRINT_OPERATION_RESULT_ERROR,
GTK_PRINT_OPERATION_RESULT_APPLY,
GTK_PRINT_OPERATION_RESULT_CANCEL,
- GTK_PRINT_OPERATION_RESULT_PREVIEW,
GTK_PRINT_OPERATION_RESULT_IN_PROGRESS
} GtkPrintOperationResult;