From 4f28e61c24105cfa657fe35730cd0d3f1d4fcc63 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 11 Oct 2004 12:35:11 +0000 Subject: reviewed by: Christian Persch 2004-10-11 Marco Pesenti Gritti reviewed by: Christian Persch === Release 1.4.4 === * NEWS: * configure.in: Update for the release. * embed/print-dialog.c: (get_printer_name), (ephy_print_get_print_info): Ensure the printer name is sane. * lib/ephy-dialog.c: (set_combo_box_from_value): Mark the value sane also when we fallback to the first item in the list because there is not matching item in the model. --- ChangeLog | 22 ++++++++++++++++++++++ NEWS | 11 +++++++++++ configure.in | 2 +- doc/reference/tmpl/ephy-embed.sgml | 2 ++ embed/mozilla/EphyUtils.cpp | 9 ++++++--- embed/print-dialog.c | 31 ++++++++++++++++++++++++++++++- lib/ephy-dialog.c | 2 +- 7 files changed, 73 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index d461f8781..aa1afcac2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2004-10-11 Marco Pesenti Gritti + + reviewed by: Christian Persch + + === Release 1.4.4 === + + * NEWS: + * configure.in: + + Update for the release. + + * embed/print-dialog.c: (get_printer_name), + (ephy_print_get_print_info): + + Ensure the printer name is sane. + + * lib/ephy-dialog.c: (set_combo_box_from_value): + + Mark the value sane also when we fallback to + the first item in the list because there is not + matching item in the model. + 2004-10-10 Marco Pesenti Gritti reviewed by: Christian Persch diff --git a/NEWS b/NEWS index 32374f433..3c87b1077 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,14 @@ +============== +Epiphany 1.4.4 +============== + +Bug fixes + + * Add a list of printers to the print dialog. Fix printing + in several recent ditributions. (Marco) + * Remove duplicate AC_PROG_INTLTOOL (Christian) [#155028] + * Fix a crash when rebuilding bookmarks menu (Christian) [#154805] + ============== Epiphany 1.4.3 ============== diff --git a/configure.in b/configure.in index 4e6f4cdf6..1faedf2bd 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([GNOME Web browser], [1.4.3.90], +AC_INIT([GNOME Web browser], [1.4.4], [http://bugzilla.gnome.org/enter_bug.cgi?product=epiphany],[epiphany]) GNOME_COMMON_INIT diff --git a/doc/reference/tmpl/ephy-embed.sgml b/doc/reference/tmpl/ephy-embed.sgml index da9a9e933..4de48067c 100644 --- a/doc/reference/tmpl/ephy-embed.sgml +++ b/doc/reference/tmpl/ephy-embed.sgml @@ -154,6 +154,8 @@ be done by casting). @: @: @: +@: +@: @: diff --git a/embed/mozilla/EphyUtils.cpp b/embed/mozilla/EphyUtils.cpp index c5e0bf666..89afedb40 100644 --- a/embed/mozilla/EphyUtils.cpp +++ b/embed/mozilla/EphyUtils.cpp @@ -174,9 +174,12 @@ EphyUtils::CollatePrintSettings (const EmbedPrintInfo *info, NS_CSTRING_ENCODING_UTF8, tmp); options->SetToFileName (tmp.get()); - NS_CStringToUTF16 (nsEmbedCString(info->printer), - NS_CSTRING_ENCODING_UTF8, tmp); - options->SetPrinterName (tmp.get()); + if (info->printer != NULL) + { + NS_CStringToUTF16 (nsEmbedCString(info->printer), + NS_CSTRING_ENCODING_UTF8, tmp); + options->SetPrinterName (tmp.get()); + } /** * Work around a mozilla bug where paper size & orientation are ignored diff --git a/embed/print-dialog.c b/embed/print-dialog.c index db25e54f7..00335f74f 100755 --- a/embed/print-dialog.c +++ b/embed/print-dialog.c @@ -43,6 +43,7 @@ #include #include #include +#include #define CONF_PRINT_PRINTER "/apps/epiphany/dialogs/print_printer_name" #define CONF_PRINT_FILE "/apps/epiphany/dialogs/print_file" @@ -209,6 +210,34 @@ sanitize_filename (const char *input) return filename; } +static char * +get_printer_name (void) +{ + EphyEmbedSingle *single; + GList *printers; + char *printer; + + single = EPHY_EMBED_SINGLE (ephy_embed_shell_get_embed_single (embed_shell)); + printers = ephy_embed_single_get_printer_list (single); + if (printers == NULL) + { + return NULL; + } + + printer = eel_gconf_get_string (print_props[PRINTER_PROP].pref); + if (printer == NULL || + !g_list_find_custom (printers, printer, (GCompareFunc)strcmp)) + { + g_free (printer); + printer = g_strdup (printers->data); + } + + g_list_foreach (printers, (GFunc)g_free, NULL); + g_list_free (printers); + + return printer; +} + EmbedPrintInfo * ephy_print_get_print_info (void) { @@ -244,7 +273,7 @@ ephy_print_get_print_info (void) g_free (fname); } - info->printer = eel_gconf_get_string (print_props[PRINTER_PROP].pref); + info->printer = get_printer_name (); info->pages = eel_gconf_get_integer (print_props[ALL_PAGES_PROP].pref); info->from_page = eel_gconf_get_integer (print_props[FROM_PROP].pref); diff --git a/lib/ephy-dialog.c b/lib/ephy-dialog.c index 09ead6a75..89eab6127 100644 --- a/lib/ephy-dialog.c +++ b/lib/ephy-dialog.c @@ -590,7 +590,7 @@ set_combo_box_from_value (PropertyInfo *info, const GValue *value) gtk_combo_box_set_active (GTK_COMBO_BOX (info->widget), 0); } - info->sane_state = found; + info->sane_state = TRUE; } else if (info->data_type == G_TYPE_INT) { -- cgit v1.2.3