Commit 07d2dd17 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

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.
parent fdddcbf8
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.
2006-05-22 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkprintoperation.c (gtk_print_operation_class_init):
......
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.
2006-05-22 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkprintoperation.c (gtk_print_operation_class_init):
......
......@@ -2804,6 +2804,7 @@ gtk_print_unix_dialog_get_current_page
gtk_print_unix_dialog_set_settings
gtk_print_unix_dialog_get_settings
gtk_print_unix_dialog_get_selected_printer
gtk_print_unix_dialog_add_custom_tab
#endif
#endif
#endif
......
......@@ -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:
......
......@@ -1377,7 +1377,7 @@ create_application_page (GtkPrintOperation *op)
page.pResource = template;
app_name = g_get_application_name ();
if (app_name == NULL)
app_name = "Application";
app_name = _("Application");
page.pszTitle = g_utf8_to_utf16 (app_name,
-1, NULL, NULL, NULL);
page.pfnDlgProc = pageDlgProc;
......
......@@ -2637,6 +2637,17 @@ gtk_print_unix_dialog_get_settings (GtkPrintUnixDialog *dialog)
return settings;
}
void
gtk_print_unix_dialog_add_custom_tab (GtkPrintUnixDialog *dialog,
GtkWidget *child,
GtkWidget *tab_label)
{
gtk_notebook_insert_page (GTK_NOTEBOOK (dialog->priv->notebook),
child, tab_label, 2);
gtk_widget_show (child);
gtk_widget_show (tab_label);
}
#define __GTK_PRINT_UNIX_DIALOG_C__
#include "gtkaliasdef.c"
......@@ -74,7 +74,9 @@ void gtk_print_unix_dialog_set_settings (GtkPrintUnixDialog
GtkPrintSettings *settings);
GtkPrintSettings *gtk_print_unix_dialog_get_settings (GtkPrintUnixDialog *dialog);
GtkPrinter * gtk_print_unix_dialog_get_selected_printer (GtkPrintUnixDialog *dialog);
void gtk_print_unix_dialog_add_custom_tab (GtkPrintUnixDialog *dialog,
GtkWidget *child,
GtkWidget *tab_label);
G_END_DECLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment