diff options
author | Matthias Clasen <mclasen@redhat.com> | 2007-04-29 18:55:12 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2007-04-29 18:55:12 +0000 |
commit | 86b19df30c5cabb4f1efb51ec6e8eb4e0dddde6d (patch) | |
tree | 37b4d740b82bf293095a5a825873382709bb4f32 /gtk/gtkprintoperation.c | |
parent | 4a37a344c19a89d1d47a2713e311ec9cd86b5751 (diff) | |
download | gtk+-86b19df30c5cabb4f1efb51ec6e8eb4e0dddde6d.tar.gz |
Document that a print operation can be run only once, and add a
2007-04-29 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkprintoperation.c (gtk_print_operation_run): Document
that a print operation can be run only once, and add a
corresponding g_return_if_fail(). (#379399, Masao Mutoh)
svn path=/trunk/; revision=17715
Diffstat (limited to 'gtk/gtkprintoperation.c')
-rw-r--r-- | gtk/gtkprintoperation.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gtk/gtkprintoperation.c b/gtk/gtkprintoperation.c index 80a773c573..77362b4302 100644 --- a/gtk/gtkprintoperation.c +++ b/gtk/gtkprintoperation.c @@ -2305,8 +2305,7 @@ gtk_print_operation_get_error (GtkPrintOperation *op, * @error: Return location for errors, or %NULL * * Runs the print operation, by first letting the user modify - * print settings in the print dialog, and then print the - * document. + * print settings in the print dialog, and then print the document. * * Normally that this function does not return until the rendering of all * pages is complete. You can connect to the ::status-changed signal on @@ -2354,6 +2353,9 @@ gtk_print_operation_get_error (GtkPrintOperation *op, * } * </programlisting></informalexample> * + * Note that gtk_print_operation_run() can only be called once on a + * given #GtkPrintOperation. + * * Return value: the result of the print operation. A return value of * %GTK_PRINT_OPERATION_RESULT_APPLY indicates that the printing was * completed successfully. In this case, it is a good idea to obtain @@ -2378,9 +2380,10 @@ gtk_print_operation_run (GtkPrintOperation *op, g_return_val_if_fail (GTK_IS_PRINT_OPERATION (op), GTK_PRINT_OPERATION_RESULT_ERROR); - + g_return_val_if_fail (op->priv->status == GTK_PRINT_STATUS_INITIAL, + GTK_PRINT_OPERATION_RESULT_ERROR); priv = op->priv; - + run_print_pages = TRUE; do_print = FALSE; priv->error = NULL; |