+2006-05-24 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkprintoperation.h:
+ * gtk/gtkprintoperation-private.h:
+ * gtk/gtk.symbols:
+ * gtk/gtkprintoperation.c: Add a custom-tab-label property.
+
+ * gtk/gtkprintoperation-unix.c (get_print_dialog): Use it
+ here. (#342752, Yevgen Muntyan)
+
2006-05-24 Alexander Larsson <alexl@redhat.com>
* gtk/gtk.symbols:
+2006-05-24 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkprintoperation.h:
+ * gtk/gtkprintoperation-private.h:
+ * gtk/gtk.symbols:
+ * gtk/gtkprintoperation.c: Add a custom-tab-label property.
+
+ * gtk/gtkprintoperation-unix.c (get_print_dialog): Use it
+ here. (#342752, Yevgen Muntyan)
+
2006-05-24 Alexander Larsson <alexl@redhat.com>
* gtk/gtk.symbols:
gtk_print_operation_set_pdf_target
gtk_print_operation_set_show_progress
gtk_print_operation_set_track_print_status
+gtk_print_operation_set_custom_tab_label
gtk_print_operation_run_async
gtk_print_operation_cancel
gtk_print_operation_get_status
gtk_print_operation_set_pdf_target
gtk_print_operation_set_track_print_status
gtk_print_operation_set_show_progress
+gtk_print_operation_set_custom_tab_label
gtk_print_operation_run
gtk_print_operation_run_async
gtk_print_operation_get_status
double manual_scale;
GtkPageSet manual_page_set;
GtkWidget *custom_widget;
+ gchar *custom_tab_label;
gpointer platform_data;
GDestroyNotify free_platform_data;
GtkPrintOperationPrivate *priv = op->priv;
GtkWidget *pd, *label;
GtkPageSetup *page_setup;
- const char *app_name;
+ const gchar *custom_tab_label;
pd = gtk_print_unix_dialog_new (NULL, parent);
g_object_unref (page_setup);
g_signal_emit_by_name (op, "create-custom-widget",
- &op->priv->custom_widget);
-
- if (op->priv->custom_widget) {
- app_name = g_get_application_name ();
- if (app_name == NULL)
- app_name = _("Application");
-
- label = gtk_label_new (app_name);
-
- gtk_print_unix_dialog_add_custom_tab (GTK_PRINT_UNIX_DIALOG (pd),
- op->priv->custom_widget, label);
- }
+ &priv->custom_widget);
+
+ if (priv->custom_widget)
+ {
+ custom_tab_label = priv->custom_tab_label;
+
+ if (custom_tab_label == NULL)
+ {
+ custom_tab_label = g_get_application_name ();
+ if (custom_tab_label == NULL)
+ custom_tab_label = _("Application");
+ }
+
+ label = gtk_label_new (custom_tab_label);
+
+ gtk_print_unix_dialog_add_custom_tab (GTK_PRINT_UNIX_DIALOG (pd),
+ op->priv->custom_widget, label);
+ }
return pd;
}
PROP_SHOW_PROGRESS,
PROP_PDF_TARGET,
PROP_STATUS,
- PROP_STATUS_STRING
+ PROP_STATUS_STRING,
+ PROP_CUSTOM_TAB_LABEL
};
static guint signals[LAST_SIGNAL] = { 0 };
g_free (priv->pdf_target);
g_free (priv->job_name);
+ g_free (priv->custom_tab_label);
if (priv->print_pages_idle_id > 0)
g_source_remove (priv->print_pages_idle_id);
case PROP_PDF_TARGET:
gtk_print_operation_set_pdf_target (op, g_value_get_string (value));
break;
+ case PROP_CUSTOM_TAB_LABEL:
+ gtk_print_operation_set_custom_tab_label (op, g_value_get_string (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_STATUS_STRING:
g_value_set_string (value, priv->status_string);
break;
+ case PROP_CUSTOM_TAB_LABEL:
+ g_value_set_string (value, priv->custom_tab_label);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
GTK_PARAM_READABLE));
+ /**
+ * GtkPrintOperation:custom-tab-label:
+ *
+ * Used as the label of the tab containing custom widgets.
+ * Note that this property may be ignored on some platforms.
+ *
+ * If this is %NULL, GTK+ uses a default label.
+ *
+ * Since: 2.10
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_CUSTOM_TAB_LABEL,
+ g_param_spec_string ("custom-tab-label",
+ P_("Custom tab label"),
+ P_("Label for the tab containing custom widgets."),
+ NULL,
+ GTK_PARAM_READWRITE));
+
}
/**
}
}
+/**
+ * gtk_print_operation_set_custom_tag_label:
+ * @op: a #GtkPrintOperation
+ * @label: the label to use, or %NULL to use the default label
+ *
+ * Sets the label for the tab holding custom widgets.
+ *
+ * Since: 2.10
+ */
+void
+gtk_print_operation_set_custom_tab_label (GtkPrintOperation *op,
+ const gchar *label)
+{
+ GtkPrintOperationPrivate *priv;
+
+ g_return_if_fail (GTK_IS_PRINT_OPERATION (op));
+
+ priv = op->priv;
+
+ g_free (priv->custom_tab_label);
+ priv->custom_tab_label = g_strdup (label);
+
+ g_object_notify (G_OBJECT (op), "custom-tab-label");
+}
+
+
/**
* gtk_print_operation_set_pdf_target:
* @op: a #GtkPrintOperation
gboolean track_status);
void gtk_print_operation_set_show_progress (GtkPrintOperation *op,
gboolean show_progress);
+void gtk_print_operation_set_custom_tab_label (GtkPrintOperation *op,
+ const gchar *label);
GtkPrintOperationResult gtk_print_operation_run (GtkPrintOperation *op,
GtkWindow *parent,
GError **error);
{
GtkWidget *vbox, *hbox, *font, *label;
+ gtk_print_operation_set_custom_tab_label (operation, "Other");
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);