diff options
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 16 | ||||
-rw-r--r-- | mail/component-factory.c | 30 | ||||
-rw-r--r-- | mail/folder-browser-ui.c | 4 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 27 | ||||
-rw-r--r-- | mail/mail-send-recv.c | 15 | ||||
-rw-r--r-- | mail/mail-send-recv.h | 2 |
6 files changed, 51 insertions, 43 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index c52dd827a9..57e7dfb291 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,21 @@ 2002-03-20 Ettore Perazzoli <ettore@ximian.com> + * component-factory.c (send_receive_cb): New, callback for the + "send_receive" signal on the EvolutionShellComponent. + (create_component): Connect. + + * folder-browser-ui.c: Remove verb "MailGetSend". + + * mail-callbacks.c (send_receive_mail): Removed. + + * mail-send-recv.c: Remove member current_folder from struct + _send_data. + (free_send_data): No need to unref here. + (build_dialogue): Removed arg @current_folder. + (mail_send_receive): Likewise. + +2002-03-20 Ettore Perazzoli <ettore@ximian.com> + * folder-browser.c: Reorder folder_browser_search_menu_items according to #16246. diff --git a/mail/component-factory.c b/mail/component-factory.c index 1e2a652ca4..452cff2c47 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -901,6 +901,33 @@ owner_unset_cb (EvolutionShellComponent *shell_component, gpointer user_data) g_timeout_add(100, idle_quit, NULL); } +static void +send_receive_cb (EvolutionShellComponent *shell_component, + gboolean show_dialog, + void *data) +{ + const MailConfigAccount *account; + + /* FIXME: configure_mail() should be changed to work without a + FolderBrowser, and then we will be able to call configure_mail from + here properly. */ + if (!mail_config_is_configured () /* && !configure_mail (fb) */) + return; + + account = mail_config_get_default_account (); + if (!account || !account->transport) { + GtkWidget *dialog; + + dialog = gnome_error_dialog (_("You have not set a mail transport method")); + gnome_dialog_set_close (GNOME_DIALOG (dialog), TRUE); + gtk_widget_show (dialog); + + return; + } + + mail_send_receive (); +} + static BonoboObject * create_component (void) { @@ -918,6 +945,9 @@ create_component (void) populate_folder_context_menu, get_dnd_selection, NULL); + + gtk_signal_connect (GTK_OBJECT (shell_component), "send_receive", + GTK_SIGNAL_FUNC (send_receive_cb), NULL); destination_interface = evolution_shell_component_dnd_destination_folder_new (destination_folder_handle_motion, destination_folder_handle_drop, diff --git a/mail/folder-browser-ui.c b/mail/folder-browser-ui.c index 36e8cea6f2..6400f6eb35 100644 --- a/mail/folder-browser-ui.c +++ b/mail/folder-browser-ui.c @@ -108,7 +108,6 @@ static BonoboUIVerb global_verbs [] = { BONOBO_UI_UNSAFE_VERB ("EmptyTrash", empty_trash), BONOBO_UI_UNSAFE_VERB ("ForgetPasswords", mail_session_forget_passwords), BONOBO_UI_UNSAFE_VERB ("MailCompose", compose_msg), - BONOBO_UI_UNSAFE_VERB ("MailGetSend", send_receive_mail), BONOBO_UI_UNSAFE_VERB ("MailStop", stop_threads), BONOBO_UI_UNSAFE_VERB ("ToolsFilters", filter_edit), BONOBO_UI_UNSAFE_VERB ("ToolsSettings", providers_config), @@ -166,11 +165,8 @@ static EPixmap list_pixcache [] = { static EPixmap global_pixcache [] = { E_PIXMAP ("/commands/MailCompose", "new-message.xpm"), - E_PIXMAP ("/commands/MailGetSend", "send-receive.xpm"), E_PIXMAP ("/commands/ToolsSettings", "configure_16_mail.xpm"), - E_PIXMAP ("/Toolbar/MailGetSend", "buttons/send-24-receive.png"), - E_PIXMAP_END }; diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 806e2a924c..1dfffd2fbb 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -167,33 +167,6 @@ check_send_configuration (FolderBrowser *fb) return TRUE; } -void -send_receive_mail (GtkWidget *widget, gpointer user_data) -{ - FolderBrowser *fb = FOLDER_BROWSER (user_data); - const MailConfigAccount *account; - - if (FOLDER_BROWSER_IS_DESTROYED (fb)) - return; - - if (!mail_config_is_configured () && !configure_mail (fb)) - return; - - account = mail_config_get_default_account (); - if (!account || !account->transport) { - GtkWidget *dialog; - - dialog = gnome_error_dialog_parented (_("You have not set a mail transport method"), - FB_WINDOW (fb)); - gnome_dialog_set_close (GNOME_DIALOG (dialog), TRUE); - gtk_widget_show (dialog); - - return; - } - - mail_send_receive (fb->folder); -} - static void msgbox_destroyed (GtkWidget *widget, gpointer data) { diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index 3017203e6e..816efa4841 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -78,8 +78,6 @@ struct _send_data { CamelFolder *inbox; /* since we're never asked to update this one, do it ourselves */ time_t inbox_update; - CamelFolder *current_folder; - GMutex *lock; GHashTable *folders; @@ -179,10 +177,7 @@ free_send_data(void) /*camel_folder_thaw (data->inbox); */ camel_object_unref((CamelObject *)data->inbox); } - if (data->current_folder) { - mail_refresh_folder(data->current_folder, NULL, NULL); - camel_object_unref((CamelObject *)data->current_folder); - } + g_list_free(data->infos); g_hash_table_foreach(data->active, (GHFunc)free_send_info, NULL); g_hash_table_destroy(data->active); @@ -274,7 +269,7 @@ static send_info_t get_receive_type(const char *url) } static struct _send_data * -build_dialogue (GSList *sources, CamelFolder *current_folder, CamelFolder *outbox, const char *destination) +build_dialogue (GSList *sources, CamelFolder *outbox, const char *destination) { GnomeDialog *gd; GtkTable *table; @@ -433,8 +428,6 @@ build_dialogue (GSList *sources, CamelFolder *current_folder, CamelFolder *outbo data->infos = list; data->gd = gd; - data->current_folder = current_folder; - camel_object_ref (CAMEL_OBJECT (current_folder)); return data; } @@ -647,7 +640,7 @@ receive_update_got_store (char *uri, CamelStore *store, void *data) } } -void mail_send_receive (CamelFolder *current_folder) +void mail_send_receive (void) { GSList *sources; GList *scan; @@ -674,7 +667,7 @@ void mail_send_receive (CamelFolder *current_folder) Well, probably hook into receive_done or receive_status on the right pop account, and when it is, then kick off the smtp one. */ - data = build_dialogue(sources, current_folder, outbox_folder, account->transport->url); + data = build_dialogue(sources, outbox_folder, account->transport->url); scan = data->infos; while (scan) { struct _send_info *info = scan->data; diff --git a/mail/mail-send-recv.h b/mail/mail-send-recv.h index 19afea853b..7d43d610fb 100644 --- a/mail/mail-send-recv.h +++ b/mail/mail-send-recv.h @@ -31,7 +31,7 @@ extern "C" { #include "mail-config.h" /* send/receive all uri's */ -void mail_send_receive(CamelFolder *current_folder); +void mail_send_receive(void); /* receive a single uri */ void mail_receive_uri(const char *uri, int keep); /* setup auto receive stuff */ |