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.
This commit is contained in:
		
				
					committed by
					
						
						Matthias Clasen
					
				
			
			
				
	
			
			
			
						parent
						
							d9d210ad23
						
					
				
				
					commit
					0b05edb04f
				
			@ -1,5 +1,11 @@
 | 
				
			|||||||
2006-06-16  Matthias Clasen  <mclasen@redhat.com>
 | 
					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.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* tests/print-editor.c: Add a "Preview" menu item.
 | 
						* tests/print-editor.c: Add a "Preview" menu item.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* gtk/gtkprintoperation-unix.c (handle_print_response): When starting
 | 
						* gtk/gtkprintoperation-unix.c (handle_print_response): When starting
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,11 @@
 | 
				
			|||||||
2006-06-16  Matthias Clasen  <mclasen@redhat.com>
 | 
					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.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* tests/print-editor.c: Add a "Preview" menu item.
 | 
						* tests/print-editor.c: Add a "Preview" menu item.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* gtk/gtkprintoperation-unix.c (handle_print_response): When starting
 | 
						* gtk/gtkprintoperation-unix.c (handle_print_response): When starting
 | 
				
			||||||
 | 
				
			|||||||
@ -248,17 +248,21 @@ gtk_print_backend_initialize (void)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  if (!initialized)
 | 
					  if (!initialized)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					      /**
 | 
				
			||||||
 | 
					       * GtkSettings::gtk-print-backends:
 | 
				
			||||||
 | 
					       *
 | 
				
			||||||
 | 
					       * A comma-separated list of print backends to use in the print
 | 
				
			||||||
 | 
					       * dialog. Available print backends depend on the GTK+ installation,
 | 
				
			||||||
 | 
					       * and may include "pdf", "cups" or "lpr".
 | 
				
			||||||
 | 
					       *
 | 
				
			||||||
 | 
					       * Since: 2.10
 | 
				
			||||||
 | 
					       */
 | 
				
			||||||
      gtk_settings_install_property (g_param_spec_string ("gtk-print-backends",
 | 
					      gtk_settings_install_property (g_param_spec_string ("gtk-print-backends",
 | 
				
			||||||
							  P_("Default print backend"),
 | 
												  P_("Default print backend"),
 | 
				
			||||||
							  P_("List of the GtkPrintBackend backends to use by default"),
 | 
												  P_("List of the GtkPrintBackend backends to use by default"),
 | 
				
			||||||
							  GTK_PRINT_BACKENDS,
 | 
												  GTK_PRINT_BACKENDS,
 | 
				
			||||||
							  GTK_PARAM_READWRITE));
 | 
												  GTK_PARAM_READWRITE));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      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;
 | 
					      initialized = TRUE;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -36,6 +36,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <cairo-pdf.h>
 | 
					#include <cairo-pdf.h>
 | 
				
			||||||
#include <cairo-ps.h>
 | 
					#include <cairo-ps.h>
 | 
				
			||||||
 | 
					#include "gtkprivate.h"
 | 
				
			||||||
#include "gtkprintunixdialog.h"
 | 
					#include "gtkprintunixdialog.h"
 | 
				
			||||||
#include "gtkpagesetupunixdialog.h"
 | 
					#include "gtkpagesetupunixdialog.h"
 | 
				
			||||||
#include "gtkprintbackend.h"
 | 
					#include "gtkprintbackend.h"
 | 
				
			||||||
@ -164,6 +165,34 @@ shell_command_substitute_file (const gchar *cmd,
 | 
				
			|||||||
  return result;
 | 
					  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
 | 
					void
 | 
				
			||||||
_gtk_print_operation_platform_backend_launch_preview (GtkPrintOperation *op,
 | 
					_gtk_print_operation_platform_backend_launch_preview (GtkPrintOperation *op,
 | 
				
			||||||
						      cairo_surface_t   *surface,
 | 
											      cairo_surface_t   *surface,
 | 
				
			||||||
@ -179,6 +208,8 @@ _gtk_print_operation_platform_backend_launch_preview (GtkPrintOperation *op,
 | 
				
			|||||||
  GdkScreen *screen;
 | 
					  GdkScreen *screen;
 | 
				
			||||||
  GError *error = NULL;
 | 
					  GError *error = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  gtk_print_operation_unix_initialize ();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  cairo_surface_destroy (surface);
 | 
					  cairo_surface_destroy (surface);
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
  settings = gtk_settings_get_default ();
 | 
					  settings = gtk_settings_get_default ();
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user