mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-09-20 05:50:11 +00:00
Add a GtkPrintOperation::show-preview property
This commit is contained in:
parent
ab882a28af
commit
67dc5155af
@ -1,4 +1,10 @@
|
|||||||
2006-06-02 Matthias Clasen <mclasen@redhat.com>
|
2006-06-02 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkprintoperation-private.h:
|
||||||
|
* gtk/gtkprintoperation.h:
|
||||||
|
* gtk/gtkprintoperation.c: Add a show-preview property.
|
||||||
|
|
||||||
|
* gtk/gtkprintoperation-unix.c: Implement it here.
|
||||||
|
|
||||||
* gtk/gtkprintoperation-unix.c: Cleanups
|
* gtk/gtkprintoperation-unix.c: Cleanups
|
||||||
|
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
2006-06-02 Matthias Clasen <mclasen@redhat.com>
|
2006-06-02 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkprintoperation-private.h:
|
||||||
|
* gtk/gtkprintoperation.h:
|
||||||
|
* gtk/gtkprintoperation.c: Add a show-preview property.
|
||||||
|
|
||||||
|
* gtk/gtkprintoperation-unix.c: Implement it here.
|
||||||
|
|
||||||
* gtk/gtkprintoperation-unix.c: Cleanups
|
* gtk/gtkprintoperation-unix.c: Cleanups
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ struct _GtkPrintOperationPrivate
|
|||||||
gchar *pdf_target;
|
gchar *pdf_target;
|
||||||
guint use_full_page : 1;
|
guint use_full_page : 1;
|
||||||
guint show_dialog : 1;
|
guint show_dialog : 1;
|
||||||
|
guint show_preview : 1;
|
||||||
guint track_print_status : 1;
|
guint track_print_status : 1;
|
||||||
guint show_progress : 1;
|
guint show_progress : 1;
|
||||||
guint cancelled : 1;
|
guint cancelled : 1;
|
||||||
|
@ -504,7 +504,10 @@ found_printer (GtkPrinter *printer,
|
|||||||
|
|
||||||
if (printer != NULL)
|
if (printer != NULL)
|
||||||
{
|
{
|
||||||
rdata->result = GTK_PRINT_OPERATION_RESULT_APPLY;
|
if (priv->show_preview)
|
||||||
|
rdata->result = GTK_PRINT_OPERATION_RESULT_PREVIEW;
|
||||||
|
else
|
||||||
|
rdata->result = GTK_PRINT_OPERATION_RESULT_APPLY;
|
||||||
|
|
||||||
rdata->do_print = TRUE;
|
rdata->do_print = TRUE;
|
||||||
|
|
||||||
@ -835,8 +838,11 @@ printer_added_cb (GtkPrintBackend *backend,
|
|||||||
GtkPrinter *printer,
|
GtkPrinter *printer,
|
||||||
PrinterFinder *finder)
|
PrinterFinder *finder)
|
||||||
{
|
{
|
||||||
if (gtk_printer_is_virtual (printer) ||
|
if (finder->found_printer)
|
||||||
finder->found_printer)
|
return;
|
||||||
|
|
||||||
|
/* FIXME this skips "Print to PDF" - is this intentional ? */
|
||||||
|
if (gtk_printer_is_virtual (printer))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (finder->printer_name != NULL &&
|
if (finder->printer_name != NULL &&
|
||||||
|
@ -60,6 +60,7 @@ enum {
|
|||||||
PROP_TRACK_PRINT_STATUS,
|
PROP_TRACK_PRINT_STATUS,
|
||||||
PROP_UNIT,
|
PROP_UNIT,
|
||||||
PROP_SHOW_DIALOG,
|
PROP_SHOW_DIALOG,
|
||||||
|
PROP_SHOW_PREVIEW,
|
||||||
PROP_SHOW_PROGRESS,
|
PROP_SHOW_PROGRESS,
|
||||||
PROP_PDF_TARGET,
|
PROP_PDF_TARGET,
|
||||||
PROP_STATUS,
|
PROP_STATUS,
|
||||||
@ -146,6 +147,7 @@ gtk_print_operation_init (GtkPrintOperation *operation)
|
|||||||
priv->current_page = -1;
|
priv->current_page = -1;
|
||||||
priv->use_full_page = FALSE;
|
priv->use_full_page = FALSE;
|
||||||
priv->show_dialog = TRUE;
|
priv->show_dialog = TRUE;
|
||||||
|
priv->show_preview = FALSE;
|
||||||
priv->show_progress = FALSE;
|
priv->show_progress = FALSE;
|
||||||
priv->pdf_target = NULL;
|
priv->pdf_target = NULL;
|
||||||
priv->track_print_status = FALSE;
|
priv->track_print_status = FALSE;
|
||||||
@ -283,6 +285,9 @@ gtk_print_operation_set_property (GObject *object,
|
|||||||
case PROP_SHOW_DIALOG:
|
case PROP_SHOW_DIALOG:
|
||||||
gtk_print_operation_set_show_dialog (op, g_value_get_boolean (value));
|
gtk_print_operation_set_show_dialog (op, g_value_get_boolean (value));
|
||||||
break;
|
break;
|
||||||
|
case PROP_SHOW_PREVIEW:
|
||||||
|
gtk_print_operation_set_show_preview (op, g_value_get_boolean (value));
|
||||||
|
break;
|
||||||
case PROP_SHOW_PROGRESS:
|
case PROP_SHOW_PROGRESS:
|
||||||
gtk_print_operation_set_show_progress (op, g_value_get_boolean (value));
|
gtk_print_operation_set_show_progress (op, g_value_get_boolean (value));
|
||||||
break;
|
break;
|
||||||
@ -336,6 +341,9 @@ gtk_print_operation_get_property (GObject *object,
|
|||||||
case PROP_SHOW_DIALOG:
|
case PROP_SHOW_DIALOG:
|
||||||
g_value_set_boolean (value, priv->show_dialog);
|
g_value_set_boolean (value, priv->show_dialog);
|
||||||
break;
|
break;
|
||||||
|
case PROP_SHOW_PREVIEW:
|
||||||
|
g_value_set_boolean (value, priv->show_preview);
|
||||||
|
break;
|
||||||
case PROP_SHOW_PROGRESS:
|
case PROP_SHOW_PROGRESS:
|
||||||
g_value_set_boolean (value, priv->show_progress);
|
g_value_set_boolean (value, priv->show_progress);
|
||||||
break;
|
break;
|
||||||
@ -988,8 +996,23 @@ gtk_print_operation_class_init (GtkPrintOperationClass *class)
|
|||||||
P_("TRUE if gtk_print_operation_run() should show the print dialog."),
|
P_("TRUE if gtk_print_operation_run() should show the print dialog."),
|
||||||
TRUE,
|
TRUE,
|
||||||
GTK_PARAM_READWRITE));
|
GTK_PARAM_READWRITE));
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GtkPrintOperation:show-preview:
|
||||||
|
*
|
||||||
|
* Determines whether calling gtk_print_operation_run() will present
|
||||||
|
* the print preview to the user.
|
||||||
|
*
|
||||||
|
* Since: 2.10
|
||||||
|
*/
|
||||||
|
g_object_class_install_property (gobject_class,
|
||||||
|
PROP_SHOW_PREVIEW,
|
||||||
|
g_param_spec_boolean ("show-preview",
|
||||||
|
P_("Show Preview"),
|
||||||
|
P_("TRUE if gtk_print_operation_run() should show the print preview."),
|
||||||
|
TRUE,
|
||||||
|
GTK_PARAM_READWRITE));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GtkPrintOperation:show-progress:
|
* GtkPrintOperation:show-progress:
|
||||||
*
|
*
|
||||||
@ -1573,6 +1596,35 @@ gtk_print_operation_set_show_dialog (GtkPrintOperation *op,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gtk_print_operation_set_show_preview:
|
||||||
|
* @op: a #GtkPrintOperation
|
||||||
|
* @show_preview: %TRUE to show the print preview
|
||||||
|
*
|
||||||
|
* Sets whether calling gtk_print_operation_run() will present
|
||||||
|
* the print preview to the user.
|
||||||
|
*
|
||||||
|
* Since: 2.10
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
gtk_print_operation_set_show_preview (GtkPrintOperation *op,
|
||||||
|
gboolean show_preview)
|
||||||
|
{
|
||||||
|
GtkPrintOperationPrivate *priv;
|
||||||
|
|
||||||
|
g_return_if_fail (GTK_IS_PRINT_OPERATION (op));
|
||||||
|
|
||||||
|
priv = op->priv;
|
||||||
|
|
||||||
|
show_preview = show_preview != FALSE;
|
||||||
|
|
||||||
|
if (priv->show_preview != show_preview)
|
||||||
|
{
|
||||||
|
priv->show_preview = show_preview;
|
||||||
|
|
||||||
|
g_object_notify (G_OBJECT (op), "show-preview");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gtk_print_operation_set_show_progress:
|
* gtk_print_operation_set_show_progress:
|
||||||
|
@ -140,6 +140,8 @@ void gtk_print_operation_set_unit (GtkPrintOper
|
|||||||
GtkUnit unit);
|
GtkUnit unit);
|
||||||
void gtk_print_operation_set_show_dialog (GtkPrintOperation *op,
|
void gtk_print_operation_set_show_dialog (GtkPrintOperation *op,
|
||||||
gboolean show_dialog);
|
gboolean show_dialog);
|
||||||
|
void gtk_print_operation_set_show_preview (GtkPrintOperation *op,
|
||||||
|
gboolean show_preview);
|
||||||
void gtk_print_operation_set_pdf_target (GtkPrintOperation *op,
|
void gtk_print_operation_set_pdf_target (GtkPrintOperation *op,
|
||||||
const gchar *filename);
|
const gchar *filename);
|
||||||
void gtk_print_operation_set_track_print_status (GtkPrintOperation *op,
|
void gtk_print_operation_set_track_print_status (GtkPrintOperation *op,
|
||||||
@ -151,6 +153,8 @@ void gtk_print_operation_set_custom_tab_label (GtkPrintOper
|
|||||||
GtkPrintOperationResult gtk_print_operation_run (GtkPrintOperation *op,
|
GtkPrintOperationResult gtk_print_operation_run (GtkPrintOperation *op,
|
||||||
GtkWindow *parent,
|
GtkWindow *parent,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
void gtk_print_operation_run_preview (GtkPrintOperation *op,
|
||||||
|
GtkWindow *parent);
|
||||||
GtkPrintStatus gtk_print_operation_get_status (GtkPrintOperation *op);
|
GtkPrintStatus gtk_print_operation_get_status (GtkPrintOperation *op);
|
||||||
G_CONST_RETURN gchar * gtk_print_operation_get_status_string (GtkPrintOperation *op);
|
G_CONST_RETURN gchar * gtk_print_operation_get_status_string (GtkPrintOperation *op);
|
||||||
gboolean gtk_print_operation_is_finished (GtkPrintOperation *op);
|
gboolean gtk_print_operation_is_finished (GtkPrintOperation *op);
|
||||||
|
Loading…
Reference in New Issue
Block a user