diff options
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 10 | ||||
-rw-r--r-- | mail/component-factory.c | 22 | ||||
-rw-r--r-- | mail/folder-browser-factory.c | 2 | ||||
-rw-r--r-- | mail/mail-config.c | 3 | ||||
-rw-r--r-- | mail/main.c | 6 |
5 files changed, 38 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 2faf5b3493..5a2e0a0c2d 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,13 @@ +2000-08-03 Michael Meeks <michael@helixcode.com> + + * mail-config.c (identity_page_new): only whack the sig in if the + file exists. + + * component-factory.c (factory_fn): count running instances, + attach destroy signal (factory_destroy): add. + + * main.c (main): pass orb around. + 2000-08-03 Jeffrey Stedfast <fejj@helixcode.com> * mail-ops.c (composer_send_cb): Yay, no more compiler warnings diff --git a/mail/component-factory.c b/mail/component-factory.c index 8f25483f0d..595d184551 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -50,6 +50,7 @@ static void real_create_news_storage( gpointer user_data ); #define COMPONENT_FACTORY_ID "OAFIID:evolution-shell-component-factory:evolution-mail:0ea887d5-622b-4b8c-b525-18aa1cbe18a6" static BonoboGenericFactory *factory = NULL; +static gint running_objects = 0; static const EvolutionShellComponentFolderType folder_types[] = { { "mail", "evolution-inbox.png" }, @@ -153,13 +154,30 @@ owner_unset_cb (EvolutionShellComponent *shell_component, gpointer user_data) gtk_main_quit (); } -/* The factory function. */ +static void +factory_destroy (BonoboEmbeddable *embeddable, + gpointer dummy) +{ + running_objects--; + if (running_objects > 0) + return; + + if (factory) + bonobo_object_unref (BONOBO_OBJECT (factory)); + else + g_warning ("Serious ref counting error"); + factory = NULL; + + gtk_main_quit (); +} static BonoboObject * factory_fn (BonoboGenericFactory *factory, void *closure) { EvolutionShellComponent *shell_component; + running_objects++; + shell_component = evolution_shell_component_new (folder_types, create_view, create_folder, @@ -167,6 +185,8 @@ factory_fn (BonoboGenericFactory *factory, void *closure) NULL, NULL); + gtk_signal_connect (GTK_OBJECT (shell_component), "destroy", + GTK_SIGNAL_FUNC (factory_destroy), NULL); 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", diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c index f6ea1d3bd7..b4a705abd0 100644 --- a/mail/folder-browser-factory.c +++ b/mail/folder-browser-factory.c @@ -191,7 +191,7 @@ folder_browser_factory_new_control (const char *uri) control = bonobo_control_new (folder_browser); - if (control == NULL){ + if (control == NULL) { gtk_object_destroy (GTK_OBJECT (folder_browser)); return NULL; } diff --git a/mail/mail-config.c b/mail/mail-config.c index bcc3327460..9fcfbd20ec 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -782,7 +782,8 @@ identity_page_new (const MailConfigIdentity *id) default_sig = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S, ".signature", NULL); - gtk_entry_set_text (GTK_ENTRY (page->sig), default_sig); + if (g_file_exists (default_sig)) + gtk_entry_set_text (GTK_ENTRY (page->sig), default_sig); g_free (default_sig); } diff --git a/mail/main.c b/mail/main.c index f1cc59b384..ff4a475716 100644 --- a/mail/main.c +++ b/mail/main.c @@ -25,6 +25,8 @@ int main (int argc, char *argv []) { + CORBA_ORB orb; + bindtextdomain (PACKAGE, EVOLUTION_LOCALEDIR); textdomain (PACKAGE); @@ -35,9 +37,9 @@ main (int argc, char *argv []) od_assert_using_oaf (); gnome_init_with_popt_table ("evolution-mail-component", VERSION, argc, argv, oaf_popt_options, 0, NULL); - oaf_init (argc, argv); + orb = oaf_init (argc, argv); - if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, + if (bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) { g_error ("Mail component could not initialize Bonobo.\n" "If there was a warning message about the " |