]> Pileus Git - ~andy/gtk/commitdiff
Move a few settings to gtksettings.c to make sure they show up in the
authorMatthias Clasen <mclasen@redhat.com>
Sun, 31 Dec 2006 05:54:46 +0000 (05:54 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 31 Dec 2006 05:54:46 +0000 (05:54 +0000)
2006-12-30  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkprintoperation-unix.c:
        * gtk/gtkprintbackend.c:
        * gtk/gtkfilechooserdefault.c:
        * gtk/gtksettings.c: Move a few settings to gtksettings.c
        to make sure they show up in the docs.  (#365364, Christian
        Persch)

svn path=/trunk/; revision=16992

gtk/gtkfilechooserdefault.c
gtk/gtkprintbackend.c
gtk/gtkprintoperation-unix.c
gtk/gtksettings.c

index d2abc315e29dd7f6e138dcc5a9ad404d8f89e3b7..f029996091a5278aeaffb79c53a4e5273a192308 100644 (file)
@@ -607,12 +607,6 @@ _gtk_file_chooser_default_class_init (GtkFileChooserDefaultClass *class)
                                  1, G_TYPE_INT, i);
 
   _gtk_file_chooser_install_properties (gobject_class);
-
-  gtk_settings_install_property (g_param_spec_string ("gtk-file-chooser-backend",
-                                                     P_("Default file chooser backend"),
-                                                     P_("Name of the GtkFileChooser backend to use by default"),
-                                                     NULL,
-                                                     GTK_PARAM_READWRITE));
 }
 
 static void
index 96b65016c87b6a0bff7871c919f5305b03ca4644..8be27d2f407f6889ba9b9f6f77ce577814a9f141 100644 (file)
@@ -241,34 +241,6 @@ _gtk_print_backend_create (const gchar *backend_name)
   return pb;
 }
 
-static void
-gtk_print_backend_initialize (void)
-{
-  static gboolean initialized = FALSE;
-
-  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",
-                                                         P_("Default print backend"),
-                                                         P_("List of the GtkPrintBackend backends to use by default"),
-                                                         GTK_PRINT_BACKENDS,
-                                                         GTK_PARAM_READWRITE));
-
-      initialized = TRUE;
-    }
-}
-
-
-
 GList *
 gtk_print_backend_load_modules (void)
 {
@@ -281,8 +253,6 @@ gtk_print_backend_load_modules (void)
 
   result = NULL;
 
-  gtk_print_backend_initialize ();
-  
   settings = gtk_settings_get_default ();
   if (settings)
     g_object_get (settings, "gtk-print-backends", &setting, NULL);
index 4c72940c56810ae4d9220a37c9c5482994330832..5e4f42279457cb8887aa30a202730965a3da12dc 100644 (file)
@@ -165,34 +165,6 @@ 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,
@@ -208,8 +180,6 @@ _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 ();
index 707139af68f97c044cc61d4523c52af288e88ce1..2db01ccf05bec56f389979ce78c9b80af1b01729 100644 (file)
@@ -97,7 +97,10 @@ enum {
   PROP_KEYNAV_CURSOR_ONLY,
   PROP_KEYNAV_WRAP_AROUND,
   PROP_ERROR_BELL,
-  PROP_COLOR_HASH
+  PROP_COLOR_HASH,
+  PROP_FILE_CHOOSER_BACKEND,
+  PROP_PRINT_BACKENDS,
+  PROP_PRINT_PREVIEW_COMMAND
 };
 
 
@@ -624,8 +627,55 @@ gtk_settings_class_init (GtkSettingsClass *class)
                                                       P_("A hash table representation of the color scheme."),
                                                       G_TYPE_HASH_TABLE,
                                                       GTK_PARAM_READABLE));
-
   class_n_properties++;
+
+  result = settings_install_property_parser (class, 
+                                             g_param_spec_string ("gtk-file-chooser-backend",
+                                                                  P_("Default file chooser backend"),
+                                                                  P_("Name of the GtkFileChooser backend to use by default"),
+                                                                  NULL,
+                                                                  GTK_PARAM_READWRITE),
+                                             NULL);
+  g_assert (result == PROP_FILE_CHOOSER_BACKEND);
+
+  /**
+   * 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
+   */
+  result = settings_install_property_parser (class,
+                                             g_param_spec_string ("gtk-print-backends",
+                                                                  P_("Default print backend"),
+                                                                  P_("List of the GtkPrintBackend backends to use by default"),
+                                                                  GTK_PRINT_BACKENDS,
+                                                                  GTK_PARAM_READWRITE),
+                                             NULL);
+  g_assert (result == PROP_PRINT_BACKENDS);
+
+  /**
+   * 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
+   */
+  result = settings_install_property_parser (class,
+                                             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),
+                                             NULL); 
+  g_assert (result == PROP_PRINT_PREVIEW_COMMAND);
 }
 
 static void