Correctly read/write/use the output filename setting.
2006-04-03 Alexander Larsson <alexl@redhat.com> * modules/printbackends/pdf/gtkprintbackendpdf.c: * modules/printbackends/pdf/gtkprinterpdf.[ch]: Correctly read/write/use the output filename setting.
This commit is contained in:
committed by
Alexander Larsson
parent
61cd8faf53
commit
350d262b5f
@@ -1,3 +1,9 @@
|
||||
2006-04-03 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* modules/printbackends/pdf/gtkprintbackendpdf.c:
|
||||
* modules/printbackends/pdf/gtkprinterpdf.[ch]:
|
||||
Correctly read/write/use the output filename setting.
|
||||
|
||||
2006-04-03 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkpagesetupunixdialog.c:
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2006-04-03 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* modules/printbackends/pdf/gtkprintbackendpdf.c:
|
||||
* modules/printbackends/pdf/gtkprinterpdf.[ch]:
|
||||
Correctly read/write/use the output filename setting.
|
||||
|
||||
2006-04-03 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkpagesetupunixdialog.c:
|
||||
|
||||
@@ -17,7 +17,6 @@ Lowlevel API:
|
||||
PDF backend:
|
||||
* Change to using a GtkFileChooserEntry to get file names when we move to
|
||||
GTK. It is a private object in GTK right now.
|
||||
* Reload old filename from settings when opening the dialog again.
|
||||
|
||||
Win32:
|
||||
* Use threads for the dialog, to allow repaints of other windows while they are up
|
||||
@@ -29,22 +28,20 @@ Cups/Unix print dialog:
|
||||
* Actually get default printer from somewhere
|
||||
* "Page Setup" used both as tab and dialog name
|
||||
|
||||
* Don't select default for a short while, so that we can avoid flashing if the selected printer appears
|
||||
* Add nicer scaling to print dialog (scale to fit page size)
|
||||
|
||||
General:
|
||||
* should base64 move to glib ?
|
||||
* Add API docs
|
||||
* tutorial
|
||||
* update win32 port
|
||||
* don't enforce paper size in portrait mode
|
||||
* use filechooserentry => J5
|
||||
* get the right DPI from the printer into cairo
|
||||
* gets errors on alex laptop
|
||||
* general print to file module (ps+pdf)
|
||||
|
||||
Page setting dialog:
|
||||
* insensitive margins-from-printer if list is empty
|
||||
Print dialog wishlist:
|
||||
* Don't select default for a short while, so that we can avoid flashing if the selected printer appears
|
||||
* Add nicer scaling to print dialog (scale to fit page size)
|
||||
|
||||
Page setting dialog wishlist:
|
||||
* sort paper lists
|
||||
* nicer unit editor than spinbutton
|
||||
|
||||
@@ -337,18 +337,15 @@ gtk_print_backend_pdf_print_stream (GtkPrintBackend *print_backend,
|
||||
|
||||
error = NULL;
|
||||
|
||||
#if 0
|
||||
/* FIXME */
|
||||
gtk_print_settings_foreach (settings, add_pdf_options, request);
|
||||
#endif
|
||||
|
||||
filename = gtk_print_settings_get (settings, "pdf-filename");
|
||||
if (filename == NULL)
|
||||
filename = "output.pdf";
|
||||
|
||||
ps = g_new0 (_PrintStreamData, 1);
|
||||
ps->callback = callback;
|
||||
ps->user_data = user_data;
|
||||
ps->job = g_object_ref (job);
|
||||
|
||||
filename = pdf_printer->file_option->value;
|
||||
|
||||
ps->target_fd = creat (filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
|
||||
ps->backend = print_backend;
|
||||
|
||||
@@ -371,7 +368,6 @@ gtk_print_backend_pdf_print_stream (GtkPrintBackend *print_backend,
|
||||
G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP,
|
||||
(GIOFunc) pdf_write,
|
||||
ps);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -447,6 +443,7 @@ pdf_printer_get_options (GtkPrinter *printer,
|
||||
GtkPrinterPdf *pdf_printer;
|
||||
GtkPrinterOptionSet *set;
|
||||
GtkPrinterOption *option;
|
||||
const char *filename;
|
||||
char *n_up[] = {"1" };
|
||||
|
||||
pdf_printer = GTK_PRINTER_PDF (printer);
|
||||
@@ -460,16 +457,14 @@ pdf_printer_get_options (GtkPrinter *printer,
|
||||
gtk_printer_option_set_add (set, option);
|
||||
g_object_unref (option);
|
||||
|
||||
/* TODO: read initial value from settings if != NULL */
|
||||
option = gtk_printer_option_new ("gtk-main-page-custom-input", _("File"), GTK_PRINTER_OPTION_TYPE_FILESAVE);
|
||||
gtk_printer_option_set (option, "output.pdf");
|
||||
option->group = g_strdup ("GtkPrintDialogExtention");
|
||||
gtk_printer_option_set_add (set, option);
|
||||
|
||||
if (pdf_printer->file_option)
|
||||
g_object_unref (pdf_printer->file_option);
|
||||
|
||||
pdf_printer->file_option = option;
|
||||
if (settings != NULL &&
|
||||
(filename = gtk_print_settings_get (settings, "pdf-filename"))!= NULL)
|
||||
gtk_printer_option_set (option, filename);
|
||||
|
||||
return set;
|
||||
}
|
||||
@@ -487,7 +482,10 @@ pdf_printer_get_settings_from_options (GtkPrinter *printer,
|
||||
GtkPrinterOptionSet *options,
|
||||
GtkPrintSettings *settings)
|
||||
{
|
||||
|
||||
GtkPrinterOption *option;
|
||||
|
||||
option = gtk_printer_option_set_lookup (options, "gtk-main-page-custom-input");
|
||||
gtk_print_settings_set (settings, "pdf-filename", option->value);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -73,8 +73,6 @@ gtk_printer_pdf_init (GtkPrinterPdf *printer)
|
||||
|
||||
parent = GTK_PRINTER (printer);
|
||||
|
||||
printer->file_option = NULL;
|
||||
|
||||
parent->priv->has_details = TRUE;
|
||||
parent->priv->is_virtual = TRUE;
|
||||
|
||||
@@ -87,9 +85,6 @@ gtk_printer_pdf_finalize (GObject *object)
|
||||
|
||||
GtkPrinterPdf *printer = GTK_PRINTER_PDF (object);
|
||||
|
||||
if (printer->file_option)
|
||||
g_object_unref (printer->file_option);
|
||||
|
||||
if (G_OBJECT_CLASS (gtk_printer_pdf_parent_class)->finalize)
|
||||
G_OBJECT_CLASS (gtk_printer_pdf_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
@@ -42,8 +42,6 @@ typedef struct _GtkPrinterPdfPrivate GtkPrinterPdfPrivate;
|
||||
struct _GtkPrinterPdf
|
||||
{
|
||||
GtkPrinter parent_instance;
|
||||
|
||||
GtkPrinterOption *file_option;
|
||||
};
|
||||
|
||||
struct _GtkPrinterPdfClass
|
||||
|
||||
Reference in New Issue
Block a user