Add gtk_print_unix_dialog_add_custom_tab
2006-05-23 Alexander Larsson <alexl@redhat.com> * gtk/gtk.symbols: * gtk/gtkprintunixdialog.[ch]: Add gtk_print_unix_dialog_add_custom_tab * gtk/gtkprintoperation-unix.c: Implement custom widgets for unix. Fix some warnings by including cairo-ps/pdf.h * gtk/gtkprintoperation-win32.c: Mark string for translation.
This commit is contained in:

committed by
Alexander Larsson

parent
fdddcbf842
commit
07d2dd1700
@ -30,14 +30,18 @@
|
||||
#include "gtkmarshal.h"
|
||||
#include "gtkmessagedialog.h"
|
||||
|
||||
#include <cairo-pdf.h>
|
||||
#include <cairo-ps.h>
|
||||
#include "gtkprintunixdialog.h"
|
||||
#include "gtkpagesetupunixdialog.h"
|
||||
#include "gtkprintbackend.h"
|
||||
#include "gtkprinter.h"
|
||||
#include "gtkprintjob.h"
|
||||
#include "gtklabel.h"
|
||||
#include "gtkalias.h"
|
||||
#include "gtkintl.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
GtkPrintJob *job; /* the job we are sending to the printer */
|
||||
gulong job_status_changed_tag;
|
||||
@ -169,8 +173,9 @@ get_print_dialog (GtkPrintOperation *op,
|
||||
GtkWindow *parent)
|
||||
{
|
||||
GtkPrintOperationPrivate *priv = op->priv;
|
||||
GtkWidget *pd;
|
||||
GtkWidget *pd, *label;
|
||||
GtkPageSetup *page_setup;
|
||||
const char *app_name;
|
||||
|
||||
pd = gtk_print_unix_dialog_new (NULL, parent);
|
||||
|
||||
@ -186,6 +191,20 @@ get_print_dialog (GtkPrintOperation *op,
|
||||
page_setup);
|
||||
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);
|
||||
}
|
||||
|
||||
return pd;
|
||||
}
|
||||
|
||||
@ -306,6 +325,8 @@ handle_print_response (GtkWidget *dialog,
|
||||
|
||||
settings = gtk_print_unix_dialog_get_settings (GTK_PRINT_UNIX_DIALOG (pd));
|
||||
page_setup = gtk_print_unix_dialog_get_page_setup (GTK_PRINT_UNIX_DIALOG (pd));
|
||||
|
||||
g_signal_emit_by_name (rdata->op, "custom-widget-apply", rdata->op->priv->custom_widget);
|
||||
}
|
||||
|
||||
out:
|
||||
|
Reference in New Issue
Block a user