aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog14
-rw-r--r--mail/GNOME_Evolution_Mail.oaf.in4
-rw-r--r--mail/GNOME_Evolution_Mail.oafinfo4
-rw-r--r--mail/component-factory.c25
-rw-r--r--mail/evolution-mail.oafinfo4
-rw-r--r--mail/mail-config-gui.c3
-rw-r--r--mail/mail-display.c1
-rw-r--r--mail/mail-summary.c82
8 files changed, 103 insertions, 34 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 8d36c02498..e4959004ba 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,17 @@
+2000-11-21 Iain Holmes <iain@helixcode.com>
+
+ * mail-config-gui.c (mail_config): Don't use the "delete-event"
+ signal.
+
+2000-11-21 Iain Holmes <iain@helixcode.com>
+
+ * mail-display.c (pixbuf_for_mime_type): free fm_icon.
+
+ * component-factory (summary_fn): Remove the configure param.
+ (factory_destroy): Made into a generic function so that the
+ summary_factory can be ref-counted as well as the normal
+ factory.
+
2000-11-21 Dan Winship <danw@helixcode.com>
* Makefile.am: add GPGME_CFLAGS and GPGME_LIBS
diff --git a/mail/GNOME_Evolution_Mail.oaf.in b/mail/GNOME_Evolution_Mail.oaf.in
index b187ffc121..eba585cca8 100644
--- a/mail/GNOME_Evolution_Mail.oaf.in
+++ b/mail/GNOME_Evolution_Mail.oaf.in
@@ -58,7 +58,7 @@
location="evolution-mail">
<oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME:GenericFactory:1.0"/>
+ <item value="IDL:Bonobo/Unknown:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
@@ -70,7 +70,7 @@
location="OAFIID:evolution-executive-summary-component-factory:evolution-mail:be210cba-0eee-4def-84fa-643d50321217">
<oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution:SummaryComponent:1.0"/>
+ <item value="IDL:GNOME/Evolution:Summary:ComponentFactory:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
diff --git a/mail/GNOME_Evolution_Mail.oafinfo b/mail/GNOME_Evolution_Mail.oafinfo
index b187ffc121..eba585cca8 100644
--- a/mail/GNOME_Evolution_Mail.oafinfo
+++ b/mail/GNOME_Evolution_Mail.oafinfo
@@ -58,7 +58,7 @@
location="evolution-mail">
<oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME:GenericFactory:1.0"/>
+ <item value="IDL:Bonobo/Unknown:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
@@ -70,7 +70,7 @@
location="OAFIID:evolution-executive-summary-component-factory:evolution-mail:be210cba-0eee-4def-84fa-643d50321217">
<oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution:SummaryComponent:1.0"/>
+ <item value="IDL:GNOME/Evolution:Summary:ComponentFactory:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
diff --git a/mail/component-factory.c b/mail/component-factory.c
index 111718b5e2..6b6f16cca4 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -44,7 +44,6 @@
#include "component-factory.h"
-#include <executive-summary/evolution-services/executive-summary-component.h>
#include "mail-summary.h"
CamelFolder *drafts_folder = NULL;
@@ -161,17 +160,17 @@ free_storage (gpointer service, gpointer storage, gpointer data)
static void
factory_destroy (BonoboEmbeddable *embeddable,
- gpointer dummy)
+ BonoboObject *destroy_factory)
{
running_objects--;
if (running_objects > 0)
return;
- if (factory)
- bonobo_object_unref (BONOBO_OBJECT (factory));
+ if (destroy_factory)
+ bonobo_object_unref (BONOBO_OBJECT (destroy_factory));
else
g_warning ("Serious ref counting error");
- factory = NULL;
+ destroy_factory = NULL;
g_hash_table_foreach (storages_hash, free_storage, NULL);
g_hash_table_destroy (storages_hash);
@@ -183,11 +182,16 @@ factory_destroy (BonoboEmbeddable *embeddable,
static BonoboObject *
summary_fn (BonoboGenericFactory *factory, void *closure)
{
- ExecutiveSummaryComponent *summary_component;
+ BonoboObject *summary_component_factory;
- summary_component = executive_summary_component_new (create_summary_view,
- NULL, NULL);
- return BONOBO_OBJECT (summary_component);
+ running_objects++;
+
+ summary_component_factory = executive_summary_component_factory_new (create_summary_view,
+ NULL);
+ gtk_signal_connect (GTK_OBJECT (summary_component_factory), "destroy",
+ GTK_SIGNAL_FUNC (factory_destroy), summary_factory);
+
+ return summary_component_factory;
}
static BonoboObject *
@@ -205,7 +209,7 @@ factory_fn (BonoboGenericFactory *factory, void *closure)
NULL);
gtk_signal_connect (GTK_OBJECT (shell_component), "destroy",
- GTK_SIGNAL_FUNC (factory_destroy), NULL);
+ GTK_SIGNAL_FUNC (factory_destroy), factory);
gtk_signal_connect (GTK_OBJECT (shell_component), "owner_set",
GTK_SIGNAL_FUNC (owner_set_cb), NULL);
gtk_signal_connect (GTK_OBJECT (shell_component), "owner_unset",
@@ -222,7 +226,6 @@ component_factory_init (void)
factory = bonobo_generic_factory_new (COMPONENT_FACTORY_ID, factory_fn, NULL);
summary_factory = bonobo_generic_factory_new (SUMMARY_FACTORY_ID, summary_fn, NULL);
-
storages_hash = g_hash_table_new (NULL, NULL);
if (factory == NULL) {
diff --git a/mail/evolution-mail.oafinfo b/mail/evolution-mail.oafinfo
index b187ffc121..eba585cca8 100644
--- a/mail/evolution-mail.oafinfo
+++ b/mail/evolution-mail.oafinfo
@@ -58,7 +58,7 @@
location="evolution-mail">
<oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME:GenericFactory:1.0"/>
+ <item value="IDL:Bonobo/Unknown:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
@@ -70,7 +70,7 @@
location="OAFIID:evolution-executive-summary-component-factory:evolution-mail:be210cba-0eee-4def-84fa-643d50321217">
<oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution:SummaryComponent:1.0"/>
+ <item value="IDL:GNOME/Evolution:Summary:ComponentFactory:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
diff --git a/mail/mail-config-gui.c b/mail/mail-config-gui.c
index 0c6d9c7a74..90e11083f0 100644
--- a/mail/mail-config-gui.c
+++ b/mail/mail-config-gui.c
@@ -2201,9 +2201,6 @@ mail_config (GNOME_Evolution_Shell shell)
gtk_signal_connect (GTK_OBJECT (dialog->dialog), "destroy",
GTK_SIGNAL_FUNC (mail_config_close),
dialog);
- gtk_signal_connect (GTK_OBJECT (dialog->dialog), "delete_event",
- GTK_SIGNAL_FUNC (mail_config_close),
- dialog);
gtk_widget_show (dialog->dialog);
}
diff --git a/mail/mail-display.c b/mail/mail-display.c
index 2934500f63..334933e03d 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -365,6 +365,7 @@ pixbuf_for_mime_type (const char *mime_type)
fm_icon = g_strdup_printf ("mc/%s", icon_name);
filename = gnome_pixmap_file (fm_icon);
}
+ g_free (fm_icon);
}
}
diff --git a/mail/mail-summary.c b/mail/mail-summary.c
index 34f9af55ab..cfbeea9ad5 100644
--- a/mail/mail-summary.c
+++ b/mail/mail-summary.c
@@ -26,6 +26,7 @@
#endif
#include <bonobo.h>
+#include <bonobo/bonobo-property-bag.h>
#include "camel.h"
#include <gnome.h>
@@ -40,7 +41,7 @@
#include "filter/vfolder-context.h"
#include <evolution-services/executive-summary-component.h>
-#include <evolution-services/executive-summary-component-view.h>
+#include <evolution-services/executive-summary-html-view.h>
typedef struct {
CamelFolder *folder;
@@ -51,12 +52,15 @@ typedef struct {
} FolderSummary;
typedef struct {
- ExecutiveSummaryComponent *component;
- ExecutiveSummaryComponentView *view;
+ BonoboObject *component;
+ BonoboObject *view;
GHashTable *folder_to_summary;
FolderSummary **folders;
int numfolders;
+
+ char *title;
+ char *icon;
} MailSummary;
#define SUMMARY_IN() g_print ("IN: %s: %d\n", __FUNCTION__, __LINE__);
@@ -78,6 +82,11 @@ GIOChannel *summary_chan_reader = NULL;
static void do_changed (MailSummary *summary);
+enum {
+ PROPERTY_TITLE,
+ PROPERTY_ICON
+};
+
/* Read a message from the pipe */
static gboolean
read_msg (GIOChannel *source,
@@ -141,7 +150,12 @@ summary_free (MailSummary *summary)
}
g_free (summary->folders);
+ g_free (summary->title);
+ g_free (summary->icon);
+
g_hash_table_destroy (summary->folder_to_summary);
+ bonobo_object_unref (summary->view);
+ bonobo_object_unref (summary->component);
}
static void
@@ -194,7 +208,7 @@ do_changed (MailSummary *summary)
char *ret_html;
ret_html = generate_html_summary (summary);
- executive_summary_component_view_set_html(summary->view, ret_html);
+ executive_summary_html_view_set_html(summary->view, (const char *) ret_html);
g_free (ret_html);
}
@@ -345,18 +359,40 @@ generate_folder_summaries (MailSummary *summary)
gtk_object_destroy (GTK_OBJECT (context));
}
-void
-create_summary_view (ExecutiveSummaryComponent *component,
- ExecutiveSummaryComponentView *view,
+static void
+get_property (BonoboPropertyBag *bag,
+ BonoboArg *arg,
+ guint arg_id,
+ gpointer user_data)
+{
+ MailSummary *summary = (MailSummary *) user_data;
+
+ switch (arg_id) {
+ case PROPERTY_TITLE:
+ BONOBO_ARG_SET_STRING (arg, summary->title);
+ break;
+
+ case PROPERTY_ICON:
+ BONOBO_ARG_SET_STRING (arg, summary->icon);
+ break;
+
+ default:
+ break;
+ }
+}
+
+BonoboObject *
+create_summary_view (ExecutiveSummaryComponentFactory *_factory,
void *closure)
{
+ BonoboObject *component, *view, *bag;
char *html;
MailSummary *summary;
summary = g_new (MailSummary, 1);
- summary->component = component;
summary->folder_to_summary = g_hash_table_new (NULL, NULL);
- summary->view = view;
+ summary->title = g_strdup ("Mail Summary");
+ summary->icon = g_strdup ("envelope.png");
generate_folder_summaries (summary);
@@ -364,10 +400,28 @@ create_summary_view (ExecutiveSummaryComponent *component,
check_compipes ();
- executive_summary_component_view_construct (view, component, NULL, html,
- _("Mailbox summary"),
- "envelope.png");
- gtk_signal_connect (GTK_OBJECT (view), "destroy",
- GTK_SIGNAL_FUNC (view_destroy_cb), summary);
+ component = executive_summary_component_new ();
+ summary->component = component;
+
+ view = executive_summary_html_view_new ();
+ executive_summary_html_view_set_html (EXECUTIVE_SUMMARY_HTML_VIEW (view),
+ html);
+ bonobo_object_add_interface (component, view);
+ summary->view = view;
+
+ bag = bonobo_property_bag_new (get_property, NULL, summary);
+ bonobo_property_bag_add (BONOBO_PROPERTY_BAG (bag),
+ "window_title", PROPERTY_TITLE,
+ BONOBO_ARG_STRING, NULL,
+ "The title of this component's window",
+ BONOBO_PROPERTY_READABLE);
+ bonobo_property_bag_add (BONOBO_PROPERTY_BAG (bag),
+ "window_icon", PROPERTY_ICON,
+ BONOBO_ARG_STRING, NULL,
+ "The icon for this component's window",
+ BONOBO_PROPERTY_READABLE);
+ bonobo_object_add_interface (component, bag);
g_free (html);
+
+ return component;
}