From f36f2d1fcf5851aa1d00ab8096ca0b362880475b Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Wed, 6 Nov 2002 00:42:52 +0000 Subject: #include . * metar.c: #include . * main.c (main): Use gnome_program_init(). * e-summary-tasks.c (e_summary_tasks_protocol): Use bonobo-activation. * e-summary-table.c (set_value_at): Use g_signal_emit() instead of gtk_signal_emit(). * e-summary-shown.c (e_summary_shown_class_init): GObjectified. (construct_pixmap_button): Use gtk_image_new_from_stock() instead of gnome_stock_pixmap_new(). * e-summary-preferences.c (e_summary_preferences_restore): Use EConfigListener. (add_dialog_clicked_cb): Add some missing consts. (factory_fn): Pass NULL as the domain arg to glade_xml_new(). (factory_fn): Add id arg. (e_summary_preferences_register_config_control_factory): * e-summary-mail.c (e_summary_folder_init_folder_store): Use bonobo-activation. * e-summary-factory.c (control_activate): Pass NULL ev arg to bonobo functions that now need it. (control_deactivate): Likewise. (control_activate_cb): Likewise. (e_summary_factory_new_control): Use g_signal_connect() instead of gtk_signal_connect(). * e-summary-calendar.c (e_summary_calendar_protocol): Use bonobo_activation. * e-summary.c: Update gnome-print #includes. Added some missing #includes. (e_summary_url_clicked): Pass NULL as the error arg to gnome_url_show(). (do_summary_print): Use GnomePrintConfig instead of GnomePrinter et al. * e-cell-tri.h: Removed BEGIN_GNOME_DECLS/END_GNOME_DECLS. * e-summary.c: Removed #include . Ported to e-config-listener.c. * e-cell-tri.h: Removed #include . * component-factory.c: #include . (create_component): Use g_signal_connect. Match prototype with the one required by bonobo_generic_factory(). * Makefile.am: Add @INTLTOOL_SERVER_RULE@. ($(MAIL_GENERATED)): Update with new ORBit rules. svn path=/trunk/; revision=18574 --- my-evolution/e-summary.c | 82 +++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 46 deletions(-) (limited to 'my-evolution/e-summary.c') diff --git a/my-evolution/e-summary.c b/my-evolution/e-summary.c index 4c66167482..072e7c4d5f 100644 --- a/my-evolution/e-summary.c +++ b/my-evolution/e-summary.c @@ -31,9 +31,10 @@ #include #include -#include + #include #include +#include #include #include @@ -48,17 +49,27 @@ #include #include #include -#include -#include #include #include -#include + +#include +#include + +#include #include #include +#include +#include + +#include +#include + +#include "e-util/e-config-listener.h" + #include "e-summary.h" #include "e-summary-preferences.h" #include "my-evolution-html.h" @@ -327,7 +338,7 @@ e_summary_url_clicked (GtkHTML *html, protocol_end = strchr (url, ':'); if (protocol_end == NULL) { /* No url, let gnome work it out */ - gnome_url_show (url); + gnome_url_show (url, NULL); return; } @@ -339,7 +350,7 @@ e_summary_url_clicked (GtkHTML *html, if (protocol_listener == NULL) { /* Again, let gnome work it out */ - gnome_url_show (url); + gnome_url_show (url, NULL); return; } @@ -478,8 +489,7 @@ alarm_fn (gpointer alarm_id, static void e_summary_init (ESummary *summary) { - Bonobo_ConfigDatabase db; - CORBA_Environment ev; + EConfigListener *config_listener; ESummaryPrivate *priv; GdkColor bgcolor = {0, 0xffff, 0xffff, 0xffff}; time_t t, day_end; @@ -520,24 +530,18 @@ e_summary_init (ESummary *summary) priv->protocol_hash = NULL; priv->connections = NULL; - CORBA_exception_init (&ev); - db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev); - if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) { - CORBA_exception_free (&ev); - g_warning ("Error getting Wombat. Using defaults"); - return; - } + config_listener = e_config_listener_new (); - summary->timezone = bonobo_config_get_string_with_default (db, - "/Calendar/Display/Timezone", "UTC", NULL); + summary->timezone = e_config_listener_get_string_with_default (config_listener, + "/Calendar/Display/Timezone", "UTC", + NULL); if (!summary->timezone || !summary->timezone[0]) { g_free (summary->timezone); summary->timezone = g_strdup ("UTC"); } summary->tz = icaltimezone_get_builtin_timezone (summary->timezone); - bonobo_object_release_unref (db, NULL); - CORBA_exception_free (&ev); + g_object_unref (config_listener); t = time (NULL); if (summary->tz == NULL) { @@ -585,53 +589,39 @@ do_summary_print (ESummary *summary, { GnomePrintContext *print_context; GnomePrintMaster *print_master; - GnomePrintDialog *gpd; - GnomePrinter *printer = NULL; - int copies = 1; - int collate = FALSE; + GtkWidget *gpd; + GnomePrintConfig *config = NULL; - if (!preview) { - gpd = GNOME_PRINT_DIALOG (gnome_print_dialog_new (_("Print Summary"), GNOME_PRINT_DIALOG_COPIES)); - gnome_dialog_set_default (GNOME_DIALOG (gpd), GNOME_PRINT_PRINT); + if (! preview) { + gpd = gnome_print_dialog_new (_("Print Summary"), GNOME_PRINT_DIALOG_COPIES); - switch (gnome_dialog_run (GNOME_DIALOG (gpd))) { - case GNOME_PRINT_PRINT: + switch (gtk_dialog_run (GTK_DIALOG (gpd))) { + case GNOME_PRINT_DIALOG_RESPONSE_PRINT: break; - case GNOME_PRINT_PREVIEW: + case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW: preview = TRUE; break; - case -1: - return; - default: - gnome_dialog_close (GNOME_DIALOG (gpd)); + gtk_widget_destroy (gpd); return; } - gnome_print_dialog_get_copies (gpd, &copies, &collate); - printer = gnome_print_dialog_get_printer (gpd); - gnome_dialog_close (GNOME_DIALOG (gpd)); + config = gnome_print_dialog_get_config (GNOME_PRINT_DIALOG (gpd)); } - print_master = gnome_print_master_new (); + print_master = gnome_print_master_new_from_config (config); - if (printer) { - gnome_print_master_set_printer (print_master, printer); - } - gnome_print_master_set_copies (print_master, copies, collate); print_context = gnome_print_master_get_context (print_master); gtk_html_print (GTK_HTML (summary->priv->html), print_context); gnome_print_master_close (print_master); if (preview) { - gboolean landscape = FALSE; - GnomePrintMasterPreview *preview; + GtkWidget *preview; - preview = gnome_print_master_preview_new_with_orientation ( - print_master, _("Print Preview"), landscape); - gtk_widget_show (GTK_WIDGET (preview)); + preview = gnome_print_master_preview_new (print_master, _("Print Preview")); + gtk_widget_show (preview); } else { int result = gnome_print_master_print (print_master); -- cgit v1.2.3