aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-send-recv.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-01-08 09:39:21 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-01-08 09:39:21 +0800
commitfb6caf533c7629ff9a7ffbdfa1eafd9afd5e7817 (patch)
tree032f32319f3465855cce2e52944838c9b63a471b /mail/mail-send-recv.c
parent235dc4e759f1781b34a985233c6b707613db41ad (diff)
downloadgsoc2013-evolution-fb6caf533c7629ff9a7ffbdfa1eafd9afd5e7817.tar.gz
gsoc2013-evolution-fb6caf533c7629ff9a7ffbdfa1eafd9afd5e7817.tar.zst
gsoc2013-evolution-fb6caf533c7629ff9a7ffbdfa1eafd9afd5e7817.zip
Use gconf to get the paned size. (folder_browser_set_message_preview):
2003-01-07 Jeffrey Stedfast <fejj@ximian.com> * folder-browser.c (save_cursor_pos): Use gconf to get the paned size. (folder_browser_set_message_preview): Same. (folder_browser_toggle_hide_deleted): Use gconf to set the hide-deleted state. (folder_browser_set_message_display_style): Same but for the message_display_style. (fb_resize_cb): Save the paned_size via gconf. (paned_size_changed): Callback for when the paned_size gets changed. Change the folder-browser's paned size to the new setting. (folder_browser_gui_init): Listen to changes to the paned_size and also get the initial size from gconf. * message-list.c (message_list_set_folder): Use gconf. (regen_list_regen): Use gconf. * message-browser.c (transfer_msg_done): Use gconf to get the hide_deleted setting. * mail-account-gui.c (sig_add_new_signature): Use gconf. * folder-browser-ui.c (folder_browser_ui_add_list): Use gconf. * folder-browser.c (save_cursor_pos): Use gconf. (folder_browser_set_message_preview): Same. (folder_browser_toggle_hide_deleted): Here too. (folder_browser_set_message_display_style): And here. (folder_browser_gui_init): Here too. (done_message_selected): And here. * mail-config.c (mail_config_get_thread_subject): Removed. (mail_config_set_thread_subject): Removed. (mail_config_get_empty_trash_on_exit): Removed. (mail_config_set_empty_trash_on_exit): Removed. (mail_config_get_last_filesel_dir): Removed. (mail_config_set_last_filesel_dir): Removed. (mail_config_get_hide_deleted): Removed. (mail_config_set_hide_deleted): Removed. (mail_config_get_paned_size): Removed. (mail_config_set_paned_size): Removed. (mail_config_get_send_html): Removed. (mail_config_set_send_html): Removed. (mail_config_get_confirm_unwanted_html): Removed. (mail_config_set_confirm_unwanted_html): Removed. (mail_config_get_citation_highlight): Removed. (mail_config_set_citation_highlight): Removed. (mail_config_get_citation_color): Removed. (mail_config_set_citation_color): Removed. (mail_config_get_do_seen_timeout): Removed. (mail_config_set_do_seen_timeout): Removed. (mail_config_get_mark_as_seen_timeout): Removed. (mail_config_set_mark_as_seen_timeout): Removed. (mail_config_get_prompt_empty_subject): Removed. (mail_config_set_prompt_empty_subject): Removed. (mail_config_get_prompt_only_bcc): Removed. (mail_config_set_prompt_only_bcc): Removed. (mail_config_get_confirm_expunge): Removed. (mail_config_set_confirm_expunge): Removed. (mail_config_get_confirm_goto_next_folder): Removed. (mail_config_set_confirm_goto_next_folder): Removed. (mail_config_get_goto_next_folder): Removed. (mail_config_set_goto_next_folder): Removed. (mail_config_get_http_mode): Removed. (mail_config_set_http_mode): Removed. (mail_config_get_default_forward_style): Removed. (mail_config_set_default_forward_style): Removed. (mail_config_get_default_reply_style): Removed. (mail_config_set_default_reply_style): Removed. (mail_config_get_message_display_style): Removed. (mail_config_set_message_display_style): Removed. (mail_config_get_default_charset): Removed. (mail_config_set_default_charset): Removed. (mail_config_get_x_mailer_display_style): Removed. (mail_config_set_x_mailer_display_style): Removed. * subscribe-dialog.c (populate_store_list): Use the list of accounts. We can't get the list of sources anymore. (populate_store_foreach): Updated. * mail-callbacks.c (guess_me_from_accounts): Use account->enabled. (mail_generate_reply): Same. (empty_trash): Here too. * mail-accounts.c (account_delete_clicked): Use account->enabled rather than source->enabled. (account_able_clicked): Same. (account_cursor_change): Here too. (mail_accounts_load): And here. * component-factory.c (owner_unset_cb): Use gconf empty-on-exit settings. (mail_load_storages): Use account->enabled rather than account->source->enabled. The struct changed. * mail-composer-prefs.c (sig_add): Get the send_html pref from gconf. * message-tag-followup.c (target_date_new): Use gconf. * mail-config.c (mail_config_get_week_start_day): Removed. * mail-tools.c (mail_tool_quote_message): Use gconf here too, but we don't need to parse the colour - just use it as a raw string. (mail_tool_forward_message): Use gconf. * mail-format.c (mail_format_data_wrapper_write_to_stream): Use gconf. (write_headers): Use gconf. (handle_text_plain): Same. * mail-display.c (mail_text_write): Updated to use gconf and parse GdkColour strings. (on_url_requested): Updated to use gconf. * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): Use gconf rather than the old mail-config APIs which will be removed. (ask_confirm_for_empty_subject): Same. (ask_confirm_for_only_bcc): Here too. (composer_get_message): And here. (create_msg_composer): Same. (transfer_msg_done): Again here. (delete_msg): Here too. (confirm_expunge): And finally here. * mail-config.c (mail_config_write): Use gconf. (mail_config_get_sources): Removed. * mail-account-gui.c (mail_account_gui_save): No need to save enabled-state anymore for a source. * mail-config-druid.c (wizard_finish_cb): Instead of setting account->source->enabled to TRUE, just set account->enabled to TRUE. The structures changed a bit. * mail-send-recv.c (mail_send_receive): Get the list of accounts instead of sources, and pass them along to build_dialogue. I'm trying to get rid of the mail_config_get_sources() api. (mail_autoreceive_setup): Here too. * mail-config.c (mail_config_get_filter_log): Removed. (mail_config_set_filter_log): Removed. (mail_config_get_filter_log_path): Removed. (mail_config_set_filter_log_path): Removed. (mail_config_get_new_mail_notify): Removed. (mail_config_set_new_mail_notify): Removed. (mail_config_get_new_mail_notify_sound_file): Removed. (mail_config_set_new_mail_notify_sound_file): Removed. * mail-session.c (main_get_filter_driver): Updated to use the gconf settings. svn path=/trunk/; revision=19271
Diffstat (limited to 'mail/mail-send-recv.c')
-rw-r--r--mail/mail-send-recv.c83
1 files changed, 50 insertions, 33 deletions
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index fc8b05a750..81f2eaf8c2 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -280,11 +280,11 @@ static send_info_t get_receive_type(const char *url)
}
static struct _send_data *
-build_dialogue (GSList *sources, CamelFolder *outbox, const char *destination)
+build_dialogue (const GSList *accounts, CamelFolder *outbox, const char *destination)
{
GtkDialog *gd;
GtkTable *table;
- int row;
+ int row, num_sources;
GList *list = NULL;
struct _send_data *data;
GtkWidget *send_icon, *recv_icon;
@@ -294,7 +294,8 @@ build_dialogue (GSList *sources, CamelFolder *outbox, const char *destination)
GtkHSeparator *line;
struct _send_info *info;
char *pretty_url;
-
+ const GSList *l;
+
gd = (GtkDialog *)send_recv_dialogue = gtk_dialog_new_with_buttons(_("Send & Receive Mail"), NULL, 0, NULL);
stop = (GtkButton *)gtk_button_new_from_stock(GTK_STOCK_CANCEL);
gtk_button_set_label(stop, _("Cancel All"));
@@ -302,18 +303,31 @@ build_dialogue (GSList *sources, CamelFolder *outbox, const char *destination)
g_object_set(gd, "resizable", FALSE, NULL);
gnome_window_icon_set_from_file (GTK_WINDOW (gd), EVOLUTION_ICONSDIR "/send-receive.xpm");
- table = (GtkTable *)gtk_table_new (g_slist_length (sources), 4, FALSE);
+ num_sources = 0;
+ l = accounts;
+ while (l != NULL) {
+ MailConfigAccount *account = l->data;
+
+ if (account->source && account->source->url)
+ num_sources++;
+
+ l = l->next;
+ }
+
+ table = (GtkTable *)gtk_table_new (num_sources, 4, FALSE);
gtk_box_pack_start (GTK_BOX (gd->vbox), GTK_WIDGET (table), TRUE, TRUE, 0);
-
+
/* must bet setup after send_recv_dialogue as it may re-trigger send-recv button */
data = setup_send_data ();
row = 0;
- while (sources) {
- MailConfigService *source = sources->data;
+ while (accounts) {
+ MailConfigAccount *account = accounts->data;
+ MailConfigService *source;
- if (!source->url || !source->enabled) {
- sources = sources->next;
+ source = account->source;
+ if (!account->enabled || !source || !source->url) {
+ accounts = accounts->next;
continue;
}
@@ -324,12 +338,13 @@ build_dialogue (GSList *sources, CamelFolder *outbox, const char *destination)
type = get_receive_type (source->url);
if (type == SEND_INVALID) {
- sources = sources->next;
+ accounts = accounts->next;
continue;
}
info = g_malloc0 (sizeof (*info));
info->type = type;
+
d(printf("adding source %s\n", source->url));
info->uri = g_strdup (source->url);
@@ -342,7 +357,7 @@ build_dialogue (GSList *sources, CamelFolder *outbox, const char *destination)
list = g_list_prepend (list, info);
} else if (info->bar != NULL) {
/* incase we get the same source pop up again */
- sources = sources->next;
+ accounts = accounts->next;
continue;
} else if (info->timeout_id == 0)
info->timeout_id = gtk_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info);
@@ -375,7 +390,7 @@ build_dialogue (GSList *sources, CamelFolder *outbox, const char *destination)
info->data = data;
g_signal_connect(stop, "clicked", G_CALLBACK(receive_cancel), info);
- sources = sources->next;
+ accounts = accounts->next;
row = row + 2;
}
@@ -650,12 +665,12 @@ receive_update_got_store (char *uri, CamelStore *store, void *data)
void mail_send_receive (void)
{
- GSList *sources;
+ const GSList *accounts;
GList *scan;
struct _send_data *data;
extern CamelFolder *outbox_folder;
const MailConfigAccount *account;
-
+
if (send_recv_dialogue != NULL) {
if (GTK_WIDGET_REALIZED(send_recv_dialogue)) {
gdk_window_show(send_recv_dialogue->window);
@@ -667,18 +682,18 @@ void mail_send_receive (void)
if (!camel_session_is_online (session))
return;
- sources = mail_config_get_sources();
- if (!sources)
+ if (!(accounts = mail_config_get_accounts ()))
return;
- account = mail_config_get_default_account();
+
+ account = mail_config_get_default_account ();
if (!account || !account->transport)
return;
- data = build_dialogue(sources, outbox_folder, account->transport->url);
+ data = build_dialogue (accounts, outbox_folder, account->transport->url);
scan = data->infos;
while (scan) {
struct _send_info *info = scan->data;
-
+
switch(info->type) {
case SEND_RECEIVE:
mail_fetch_mail(info->uri, info->keep,
@@ -748,26 +763,28 @@ void
mail_autoreceive_setup (void)
{
GHashTable *set_hash;
- GSList *sources;
-
- sources = mail_config_get_sources();
+ const GSList *accounts;
- if (!sources)
+ if (!(accounts = mail_config_get_accounts ()))
return;
-
+
if (auto_active == NULL)
auto_active = g_hash_table_new(g_str_hash, g_str_equal);
-
+
set_hash = g_hash_table_new(g_str_hash, g_str_equal);
g_hash_table_foreach(auto_active, (GHFunc)auto_setup_set, set_hash);
-
- while (sources) {
- MailConfigService *source = sources->data;
- if (source->url && source->auto_check && source->enabled) {
+
+ while (accounts) {
+ MailConfigAccount *account = accounts->data;
+ MailConfigService *source;
+
+ source = account->source;
+
+ if (account->enabled && source && source->url && source->auto_check) {
struct _auto_data *info;
-
+
d(printf("setting up auto-receive mail for : %s\n", source->url));
-
+
g_hash_table_remove(set_hash, source->url);
info = g_hash_table_lookup(auto_active, source->url);
if (info) {
@@ -789,8 +806,8 @@ mail_autoreceive_setup (void)
/*mail_receive_uri(source->url, source->keep_on_server);*/
}
}
-
- sources = sources->next;
+
+ accounts = accounts->next;
}
g_hash_table_foreach(set_hash, (GHFunc)auto_clean_set, auto_active);