summaryrefslogtreecommitdiff
path: root/gtk/gtkprintoperation-unix.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2006-06-16 16:57:02 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-06-16 16:57:02 +0000
commit0b05edb04fdef579fa268243c391e75c145991b6 (patch)
treec1e99cdfd3c8688febe96759050e2270cdba7c08 /gtk/gtkprintoperation-unix.c
parentd9d210ad2384f858d8866143c88517aaa6f845ec (diff)
downloadgtk+-0b05edb04fdef579fa268243c391e75c145991b6.tar.gz
Move the registration of the gtk-print-preview-command setting from
2006-06-16 Matthias Clasen <mclasen@redhat.com> * gtk/gtkprintoperation-unix.c: * gtk/gtkprintbackend.c: Move the registration of the gtk-print-preview-command setting from gtkprintbackend.c to gtkprintoperation-unix.c, to make sure it is registered before the first use. Also, document the two settings.
Diffstat (limited to 'gtk/gtkprintoperation-unix.c')
-rw-r--r--gtk/gtkprintoperation-unix.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gtk/gtkprintoperation-unix.c b/gtk/gtkprintoperation-unix.c
index 0de8add643..0b7014b84c 100644
--- a/gtk/gtkprintoperation-unix.c
+++ b/gtk/gtkprintoperation-unix.c
@@ -36,6 +36,7 @@
#include <cairo-pdf.h>
#include <cairo-ps.h>
+#include "gtkprivate.h"
#include "gtkprintunixdialog.h"
#include "gtkpagesetupunixdialog.h"
#include "gtkprintbackend.h"
@@ -164,6 +165,34 @@ shell_command_substitute_file (const gchar *cmd,
return result;
}
+static void
+gtk_print_operation_unix_initialize (void)
+{
+ static gboolean initialized = FALSE;
+
+ if (!initialized)
+ {
+ /**
+ * GtkSettings::gtk-print-preview-command:
+ *
+ * A command to run for displaying the print preview. The command
+ * should contain a %f placeholder, which will get replaced by
+ * the path to the pdf file.
+ *
+ * The preview application is responsible for removing the pdf file
+ * when it is done.
+ *
+ * Since: 2.10
+ */
+ gtk_settings_install_property (g_param_spec_string ("gtk-print-preview-command",
+ P_("Default command to run when displaying a print preview"),
+ P_("Command to run when displaying a print preview"),
+ GTK_PRINT_PREVIEW_COMMAND,
+ GTK_PARAM_READWRITE));
+ initialized = TRUE;
+ }
+}
+
void
_gtk_print_operation_platform_backend_launch_preview (GtkPrintOperation *op,
cairo_surface_t *surface,
@@ -179,6 +208,8 @@ _gtk_print_operation_platform_backend_launch_preview (GtkPrintOperation *op,
GdkScreen *screen;
GError *error = NULL;
+ gtk_print_operation_unix_initialize ();
+
cairo_surface_destroy (surface);
settings = gtk_settings_get_default ();