aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2009-05-22 20:00:14 +0800
committerSrinivasa Ragavan <sragavan@novell.com>2009-05-22 20:13:57 +0800
commit6d70e07d0842496327e1ca74f93047693ddc545c (patch)
tree01b40699c5371af70e97c81f3918eda6e3ae7ec1
parentff25805086bbd20226e4684f028912bdb29f0ae1 (diff)
downloadgsoc2013-evolution-6d70e07d0842496327e1ca74f93047693ddc545c.tar
gsoc2013-evolution-6d70e07d0842496327e1ca74f93047693ddc545c.tar.gz
gsoc2013-evolution-6d70e07d0842496327e1ca74f93047693ddc545c.tar.bz2
gsoc2013-evolution-6d70e07d0842496327e1ca74f93047693ddc545c.tar.lz
gsoc2013-evolution-6d70e07d0842496327e1ca74f93047693ddc545c.tar.xz
gsoc2013-evolution-6d70e07d0842496327e1ca74f93047693ddc545c.tar.zst
gsoc2013-evolution-6d70e07d0842496327e1ca74f93047693ddc545c.zip
Mail changes required for Anjal.
-rw-r--r--mail/Makefile.am145
-rw-r--r--mail/em-account-editor.c200
-rw-r--r--mail/em-account-editor.h8
-rw-r--r--mail/em-composer-utils.c74
-rw-r--r--mail/em-composer-utils.h10
-rw-r--r--mail/em-folder-tree.c17
-rw-r--r--mail/em-folder-tree.h2
-rw-r--r--mail/mail-component.c2
-rw-r--r--mail/mail-ops.c13
-rw-r--r--mail/mail-ops.h2
10 files changed, 378 insertions, 95 deletions
diff --git a/mail/Makefile.am b/mail/Makefile.am
index 793d5c3a1e..d66eb6f944 100644
--- a/mail/Makefile.am
+++ b/mail/Makefile.am
@@ -31,7 +31,9 @@ INCLUDES = \
-DPREFIX=\""$(prefix)"\" \
-DG_LOG_DOMAIN=\"evolution-mail\"
-component_LTLIBRARIES = libevolution-mail.la
+component_LTLIBRARIES = libevolution-mail-shared.la \
+ libevolution-mail.la
+
# Mail.idl
MAIL_IDL = Evolution-Mail.idl
@@ -55,10 +57,17 @@ idl_DATA = $(MAIL_IDL)
mailinclude_HEADERS = \
$(MAIL_IDL_GENERATED_H) \
e-mail-attachment-bar.h \
+ e-searching-tokenizer.h \
+ em-account-editor.h \
e-mail-search-bar.h \
em-composer-utils.h \
em-config.h \
em-event.h \
+ em-filter-context.h \
+ em-filter-editor.h \
+ em-filter-folder-element.h \
+ em-filter-rule.h \
+ em-filter-source-element.h \
em-folder-browser.h \
em-folder-tree-model.h \
em-folder-tree.h \
@@ -77,14 +86,17 @@ mailinclude_HEADERS = \
em-menu.h \
em-message-browser.h \
em-popup.h \
+ em-search-context.h \
em-stripsig-filter.h \
em-sync-stream.h \
em-utils.h \
mail-autofilter.h \
mail-component.h \
mail-config.h \
+ mail-folder-cache.h \
mail-mt.h \
mail-ops.h \
+ mail-send-recv.h \
mail-session.h \
mail-tools.h \
message-list.h \
@@ -100,16 +112,77 @@ libevolution_mail_la_SOURCES = \
e-mail-attachment-bar.c \
e-mail-search-bar.c \
e-searching-tokenizer.c \
- e-searching-tokenizer.h \
- em-account-editor.c \
- em-account-editor.h \
em-account-prefs.c \
em-account-prefs.h \
em-composer-prefs.c \
em-composer-prefs.h \
- em-composer-utils.c \
- em-config.c \
+ em-folder-browser.c \
+ em-folder-view.c \
+ em-format-hook.c \
+ em-format-html-display.c \
+ em-format-html-print.c \
+ em-format-html.c \
+ em-html-stream.c \
+ em-junk-hook.c \
+ em-mailer-prefs.c \
+ em-mailer-prefs.h \
+ em-menu.c \
+ em-message-browser.c \
+ em-migrate.c \
+ em-migrate.h \
+ em-network-prefs.c \
+ em-network-prefs.h \
+ em-subscribe-editor.c \
+ em-subscribe-editor.h \
+ mail-component-factory.c \
+ mail-component.c \
+ mail-config-factory.c \
+ mail-config-factory.h \
+ mail-signature-editor.c \
+ mail-signature-editor.h \
+ mail-types.h \
+ message-list.c
+if ENABLE_SMIME
+SMIME_LIBS = \
+ $(top_builddir)/smime/lib/libessmime.la \
+ $(top_builddir)/smime/gui/libevolution-smime.la
+endif
+
+
+libevolution_mail_la_LIBADD = \
+ $(top_builddir)/mail/libevolution-mail-shared.la \
+ $(top_builddir)/e-util/libeutil.la \
+ $(top_builddir)/shell/libeshell.la \
+ $(top_builddir)/widgets/table/libetable.la \
+ $(top_builddir)/widgets/text/libetext.la \
+ $(top_builddir)/widgets/misc/libemiscwidgets.la \
+ $(top_builddir)/widgets/misc/libefilterbar.la \
+ $(top_builddir)/filter/libfilter.la \
+ $(top_builddir)/widgets/menus/libmenus.la \
+ $(top_builddir)/addressbook/util/libeabutil.la \
+ $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \
+ $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.la \
+ $(top_builddir)/mail/importers/libevolution-mail-importers.la \
+ $(SMIME_LIBS) \
+ $(EVOLUTION_MAIL_LIBS) \
+ $(GTKHTML_LIBS) \
+ $(REGEX_LIBS) \
+ $(THREADS_LIBS)
+
+libevolution_mail_la_LDFLAGS = \
+ -avoid-version -module $(NO_UNDEFINED)
+
+libevolution_mail_la_DEPENDENCIES = em-filter-i18n.h
+
+# .server files
+
+libevolution_mail_shared_la_SOURCES = \
+ em-account-editor.c \
+ em-account-editor.h \
em-event.c \
+ em-config.c \
+ em-composer-utils.c \
+ em-composer-utils.h \
em-filter-context.c \
em-filter-context.h \
em-filter-editor.c \
@@ -120,7 +193,8 @@ libevolution_mail_la_SOURCES = \
em-filter-rule.h \
em-filter-source-element.c \
em-filter-source-element.h \
- em-folder-browser.c \
+ em-folder-tree-model.c \
+ em-folder-tree.c \
em-folder-properties.c \
em-folder-properties.h \
em-folder-selection-button.c \
@@ -129,34 +203,15 @@ libevolution_mail_la_SOURCES = \
em-folder-selection.h \
em-folder-selector.c \
em-folder-selector.h \
- em-folder-tree-model.c \
- em-folder-tree.c \
em-folder-utils.c \
- em-folder-view.c \
- em-format-hook.c \
- em-format-html-display.c \
- em-format-html-print.c \
- em-format-html.c \
em-format-quote.c \
em-format.c \
- em-html-stream.c \
em-icon-stream.c \
em-inline-filter.c \
- em-junk-hook.c \
- em-mailer-prefs.c \
- em-mailer-prefs.h \
- em-menu.c \
- em-message-browser.c \
- em-migrate.c \
- em-migrate.h \
- em-network-prefs.c \
- em-network-prefs.h \
em-popup.c \
em-search-context.c \
em-search-context.h \
em-stripsig-filter.c \
- em-subscribe-editor.c \
- em-subscribe-editor.h \
em-sync-stream.c \
em-utils.c \
em-vfolder-context.c \
@@ -166,63 +221,41 @@ libevolution_mail_la_SOURCES = \
em-vfolder-rule.c \
em-vfolder-rule.h \
mail-autofilter.c \
- mail-component-factory.c \
- mail-component.c \
- mail-config-factory.c \
- mail-config-factory.h \
mail-config.c \
mail-crypto.c \
mail-crypto.h \
mail-folder-cache.c \
mail-folder-cache.h \
- mail-mt.c \
mail-ops.c \
+ mail-mt.c \
mail-send-recv.c \
mail-send-recv.h \
mail-session.c \
- mail-signature-editor.c \
- mail-signature-editor.h \
mail-tools.c \
- mail-types.h \
mail-vfolder.c \
- message-list.c \
message-tag-editor.c \
message-tag-editor.h \
message-tag-followup.c \
message-tag-followup.h
-if ENABLE_SMIME
-SMIME_LIBS = \
- $(top_builddir)/smime/lib/libessmime.la \
- $(top_builddir)/smime/gui/libevolution-smime.la
-endif
-libevolution_mail_la_LIBADD = \
+
+
+
+
+libevolution_mail_shared_la_LIBADD = \
$(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/shell/libeshell.la \
- $(top_builddir)/composer/libcomposer.la \
- $(top_builddir)/widgets/table/libetable.la \
- $(top_builddir)/widgets/text/libetext.la \
$(top_builddir)/widgets/misc/libemiscwidgets.la \
- $(top_builddir)/widgets/misc/libefilterbar.la \
+ $(top_builddir)/composer/libcomposer.la \
$(top_builddir)/filter/libfilter.la \
$(top_builddir)/widgets/menus/libmenus.la \
- $(top_builddir)/addressbook/util/libeabutil.la \
- $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \
- $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.la \
- $(top_builddir)/mail/importers/libevolution-mail-importers.la \
$(SMIME_LIBS) \
- $(EVOLUTION_MAIL_LIBS) \
- $(GTKHTML_LIBS) \
- $(REGEX_LIBS) \
$(THREADS_LIBS)
-libevolution_mail_la_LDFLAGS = \
+libevolution_mail_shared_la_LDFLAGS = \
-avoid-version -module $(NO_UNDEFINED)
-libevolution_mail_la_DEPENDENCIES = em-filter-i18n.h
-# .server files
server_in_files = GNOME_Evolution_Mail.server.in.in
server_DATA = $(server_in_files:.server.in.in=.server)
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index b9850bd052..991add424d 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -276,6 +276,26 @@ EMAccountEditor *em_account_editor_new(EAccount *account, em_account_editor_t ty
return emae;
}
+/**
+ * em_account_editor_new_for_pages:
+ * @account:
+ * @type:
+ *
+ * Create a new account editor. If @account is NULL then this is to
+ * create a new account, else @account is copied to a working
+ * structure and is for editing an existing account.
+ *
+ * Return value:
+ **/
+EMAccountEditor *em_account_editor_new_for_pages(EAccount *account, em_account_editor_t type, char *id, GtkWidget **pages)
+{
+ EMAccountEditor *emae = g_object_new(em_account_editor_get_type(), NULL);
+ emae->pages = pages;
+ em_account_editor_construct(emae, account, type, id);
+
+ return emae;
+}
+
/* ********************************************************************** */
static struct {
@@ -401,7 +421,7 @@ emae_display_license(EMAccountEditor *emae, CamelProvider *prov)
gtk_text_view_set_editable((GtkTextView *)w, FALSE);
response = gtk_dialog_run((GtkDialog *)dialog);
} else {
- e_error_run((GtkWindow *)gtk_widget_get_toplevel(emae->editor),
+ e_error_run(emae->editor ? (GtkWindow *)gtk_widget_get_toplevel(emae->editor) : NULL,
"mail:no-load-license", prov->license_file, NULL);
}
@@ -1018,7 +1038,8 @@ emae_url_set_hostport(CamelURL *url, const char *txt)
}
g_strstrip(host);
- camel_url_set_host(url, host);
+ if (txt && *txt)
+ camel_url_set_host(url, host);
g_free(host);
}
@@ -1381,7 +1402,8 @@ emae_refresh_providers(EMAccountEditor *emae, EMAccountEditorService *service)
int active = 0, i;
struct _service_info *info = &emae_service_info[service->type];
const char *uri = e_account_get_string(account, info->account_uri_key);
- char *current = NULL;
+ char *current = NULL, *tmp;
+ CamelURL *url;
dropdown = service->providers;
gtk_widget_show((GtkWidget *)dropdown);
@@ -1396,8 +1418,10 @@ emae_refresh_providers(EMAccountEditor *emae, EMAccountEditorService *service)
memcpy(current, uri, len);
current[len] = 0;
}
+ } else {
+ current = g_strdup("imap");
}
-
+
store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
i = 0;
@@ -1423,7 +1447,7 @@ emae_refresh_providers(EMAccountEditor *emae, EMAccountEditorService *service)
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter, 0, provider->name, 1, provider, -1);
-
+
/* find the displayed and set default */
if (i == 0 || (current && strcmp(provider->protocol, current) == 0)) {
service->provider = provider;
@@ -1441,13 +1465,30 @@ emae_refresh_providers(EMAccountEditor *emae, EMAccountEditorService *service)
i++;
}
+
+ gtk_cell_layout_clear((GtkCellLayout *)dropdown);
gtk_combo_box_set_model(dropdown, (GtkTreeModel *)store);
gtk_cell_layout_pack_start((GtkCellLayout *)dropdown, cell, TRUE);
gtk_cell_layout_set_attributes((GtkCellLayout *)dropdown, cell, "text", 0, NULL);
+ g_signal_handlers_disconnect_by_func(dropdown, emae_provider_changed, service);
gtk_combo_box_set_active(dropdown, -1); /* needed for gtkcombo bug(?) */
gtk_combo_box_set_active(dropdown, active);
g_signal_connect(dropdown, "changed", G_CALLBACK(emae_provider_changed), service);
+
+ if (!uri || (url = camel_url_new(uri, NULL)) == NULL) {
+ return;
+ }
+
+ tmp = (char *)camel_url_get_param(url, "use_ssl");
+ if (tmp == NULL)
+ tmp = "never";
+ for (i=0;i<num_ssl_options;i++) {
+ if (!strcmp(ssl_options[i].value, tmp)) {
+ gtk_combo_box_set_active(service->use_ssl, i);
+ break;
+ }
+ }
}
static void
@@ -1603,11 +1644,12 @@ static void emae_check_authtype(GtkWidget *w, EMAccountEditorService *service)
uri = e_account_get_string(emae->account, emae_service_info[service->type].account_uri_key);
g_object_ref(emae);
- service->check_dialog = e_error_new((GtkWindow *)gtk_widget_get_toplevel(emae->editor),
+ service->check_dialog = e_error_new(emae->editor ? (GtkWindow *)gtk_widget_get_toplevel(emae->editor) : NULL,
"mail:checking-service", NULL);
g_signal_connect(service->check_dialog, "response", G_CALLBACK(emae_check_authtype_response), service);
gtk_widget_show(service->check_dialog);
- gtk_widget_set_sensitive(emae->editor, FALSE);
+ if (emae->editor)
+ gtk_widget_set_sensitive(emae->editor, FALSE);
service->check_id = mail_check_service(uri, service->type, emae_check_authtype_done, service);
}
@@ -1621,7 +1663,6 @@ emae_setup_service(EMAccountEditor *emae, EMAccountEditorService *service, Glade
int i;
service->provider = uri?camel_provider_get(uri, NULL):NULL;
-
service->frame = glade_xml_get_widget(xml, info->frame);
service->container = glade_xml_get_widget(xml, info->container);
service->description = GTK_LABEL (glade_xml_get_widget (xml, info->description));
@@ -1650,8 +1691,9 @@ emae_setup_service(EMAccountEditor *emae, EMAccountEditorService *service, Glade
} else
gtk_entry_set_text(service->hostname, url->host);
}
- if (url->user)
+ if (url->user && *url->user) {
gtk_entry_set_text(service->username, url->user);
+ }
if (service->pathentry) {
GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER;
@@ -1789,7 +1831,9 @@ emae_identity_page(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, st
}
w = glade_xml_get_widget(xml, item->label);
- if (((EConfig *)gui->config)->type == E_CONFIG_DRUID) {
+ if (emae->type == EMAE_PAGES) {
+ gtk_box_pack_start ((GtkBox *)emae->pages[0], w, TRUE, TRUE, 0);
+ } else if (((EConfig *)gui->config)->type == E_CONFIG_DRUID) {
GladeXML *druidxml;
GtkWidget *page;
@@ -1838,7 +1882,9 @@ emae_receive_page(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str
emae_setup_service(emae, &gui->source, xml);
w = glade_xml_get_widget(xml, item->label);
- if (((EConfig *)gui->config)->type == E_CONFIG_DRUID) {
+ if (emae->type == EMAE_PAGES) {
+ gtk_box_pack_start ((GtkBox *)emae->pages[1], w, TRUE, TRUE, 0);
+ } else if (((EConfig *)gui->config)->type == E_CONFIG_DRUID) {
GladeXML *druidxml;
GtkWidget *page;
@@ -2306,7 +2352,9 @@ emae_send_page(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct
emae_setup_service(emae, &gui->transport, xml);
w = glade_xml_get_widget(xml, item->label);
- if (((EConfig *)gui->config)->type == E_CONFIG_DRUID) {
+ if (emae->type == EMAE_PAGES) {
+ gtk_box_pack_start ((GtkBox *)emae->pages[2], w, TRUE, TRUE, 0);
+ } else if (((EConfig *)gui->config)->type == E_CONFIG_DRUID) {
GladeXML *druidxml;
GtkWidget *page;
@@ -2321,7 +2369,7 @@ emae_send_page(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct
gtk_box_pack_start((GtkBox*)((GnomeDruidPageStandard *)page)->vbox, w, TRUE, TRUE, 0);
w = page;
g_object_unref(druidxml);
- gnome_druid_append_page((GnomeDruid *)parent, (GnomeDruidPage *)page);
+ gnome_druid_append_page((GnomeDruid *)parent, (GnomeDruidPage *)page);
} else {
gtk_notebook_append_page((GtkNotebook *)parent, w, gtk_label_new(_("Sending Email")));
}
@@ -2542,6 +2590,10 @@ emae_widget_druid_glade(EConfig *ec, EConfigItem *item, struct _GtkWidget *paren
GladeXML *druidxml;
GtkWidget *w;
char *gladefile;
+ EMAccountEditor *emae = (EMAccountEditor *)data;
+
+ if (emae->type == EMAE_PAGES)
+ return NULL;
gladefile = g_build_filename (EVOLUTION_GLADEDIR,
"mail-config.glade",
@@ -2631,10 +2683,12 @@ emae_service_complete(EMAccountEditor *emae, EMAccountEditorService *service)
if (uri == NULL || (url = camel_url_new(uri, NULL)) == NULL)
return FALSE;
- if (CAMEL_PROVIDER_NEEDS(service->provider, CAMEL_URL_PART_HOST)
- && (url->host == NULL || url->host[0] == 0))
- ok = FALSE;
-
+ if (CAMEL_PROVIDER_NEEDS(service->provider, CAMEL_URL_PART_HOST)) {
+ if (url->host == NULL || url->host[0] == 0)
+ ok = FALSE;
+ else
+ gtk_entry_set_text(service->hostname, url->host);
+ }
/* We only need the user if the service needs auth as well, i think */
if (ok
&& (service->needs_auth == NULL
@@ -2654,6 +2708,37 @@ emae_service_complete(EMAccountEditor *emae, EMAccountEditorService *service)
return ok;
}
+enum {
+ GMAIL = 0,
+ YAHOO,
+ AOL
+};
+struct _server_prefill {
+ char *key;
+ char *recv;
+ char *send;
+ char *proto;
+ char *ssl;
+} mail_servers [] = {
+ {"gmail", "imap.gmail.com", "smtp.gmail.com", "imap", "always"},
+ {"yahoo", "pop3.yahoo.com", "smtp.yahoo.com", "pop", "never"},
+ {"aol", "imap.aol.com", "smtp.aol.com", "pop", "never"},
+ {"msn", "pop3.email.msn.com", "smtp.email.msn.com", "pop", "never"}
+};
+
+static int
+check_servers (char *server)
+{
+ int len = G_N_ELEMENTS(mail_servers), i;
+
+ for (i=0; i<len; i++) {
+ if (strstr(server, mail_servers[i].key) != NULL)
+ return i;
+ }
+
+ return -1;
+}
+
static gboolean
emae_check_complete(EConfig *ec, const char *pageid, void *data)
{
@@ -2661,6 +2746,7 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
int ok = TRUE;
const char *tmp;
EAccount *ea;
+ gboolean refresh = FALSE;
/* We use the page-check of various pages to 'prepare' or
pre-load their values, only in the druid */
@@ -2684,16 +2770,68 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
} else if (!strcmp(pageid, "10.receive")) {
if (!emae->priv->receive_set) {
char *user, *at;
+ int index;
+ char *uri = (char *)e_account_get_string(emae->account, E_ACCOUNT_SOURCE_URL);
+ CamelURL *url;
emae->priv->receive_set = 1;
- tmp = e_account_get_string(emae->account, E_ACCOUNT_ID_ADDRESS);
+ tmp = (char *)e_account_get_string(emae->account, E_ACCOUNT_ID_ADDRESS);
at = strchr(tmp, '@');
user = g_alloca(at-tmp+1);
memcpy(user, tmp, at-tmp);
user[at-tmp] = 0;
+ at++;
+
+ index = check_servers(at);
gtk_entry_set_text(emae->priv->source.username, user);
gtk_entry_set_text(emae->priv->transport.username, user);
+ if (uri && (url = camel_url_new(uri, NULL)) != NULL) {
+ refresh = TRUE;
+ camel_url_set_protocol(url, mail_servers[index].proto);
+ camel_url_set_param(url, "use_ssl", mail_servers[index].ssl);
+ camel_url_set_host (url, mail_servers[index].recv);
+ camel_url_set_user (url, user);
+ gtk_entry_set_text(emae->priv->source.hostname, mail_servers[index].recv);
+ gtk_entry_set_text(emae->priv->transport.hostname, mail_servers[index].send);
+ uri = camel_url_to_string(url, 0);
+ e_account_set_string(emae->account, E_ACCOUNT_SOURCE_URL, uri);
+
+ g_free(uri);
+ camel_url_free(url);
+ } else {
+ g_warning("buz1\n");
+ }
+
}
+ } else if (!strcmp(pageid, "30.send")) {
+ CamelURL *url;
+ char *at, *user;
+ int index;
+ char *uri = (char *)e_account_get_string(emae->account, E_ACCOUNT_TRANSPORT_URL);
+
+ tmp = e_account_get_string(emae->account, E_ACCOUNT_ID_ADDRESS);
+ at = strchr(tmp, '@');
+ user = g_alloca(at-tmp+1);
+ memcpy(user, tmp, at-tmp);
+ user[at-tmp] = 0;
+ at++;
+
+ index = check_servers(at);
+ if (uri && (url = camel_url_new(uri, NULL)) != NULL) {
+ refresh = TRUE;
+ camel_url_set_protocol (url, "smtp");
+ camel_url_set_param(url, "use_ssl", mail_servers[index].ssl);
+ camel_url_set_host (url, mail_servers[index].send);
+ camel_url_set_user (url, user);
+ uri = camel_url_to_string(url, 0);
+ e_account_set_string(emae->account, E_ACCOUNT_TRANSPORT_URL, uri);
+ g_free(uri);
+ camel_url_free(url);
+ } else {
+ g_warning("buz2\n");
+ }
+
+
} else if (!strcmp(pageid, "20.receive_options")) {
if (emae->priv->source.provider
&& emae->priv->extra_provider != emae->priv->source.provider) {
@@ -2740,12 +2878,18 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
}
if (ok && (pageid == NULL || !strcmp(pageid, "10.receive"))) {
+ if (emae->type == EMAE_PAGES && refresh) {
+ emae_refresh_providers(emae, &emae->priv->source);
+ }
ok = emae_service_complete(emae, &emae->priv->source);
if (!ok)
d(printf("receive page incomplete\n"));
}
if (ok && (pageid == NULL || !strcmp(pageid, "30.send"))) {
+ if (emae->type == EMAE_PAGES && refresh) {
+ emae_refresh_providers(emae, &emae->priv->transport);
+ }
ok = emae_service_complete(emae, &emae->priv->transport);
if (!ok)
d(printf("send page incomplete\n"));
@@ -2763,6 +2907,12 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
return ok;
}
+void
+em_account_editor_check (EMAccountEditor *emae, const char *page)
+{
+ emae_check_complete((EConfig *)emae->config, page, emae);
+}
+
/* HACK: FIXME: the component should listen to the account object directly */
static void
add_new_store (char *uri, CamelStore *store, void *user_data)
@@ -2809,6 +2959,12 @@ emae_commit(EConfig *ec, GSList *items, void *data)
e_account_list_save(accounts);
}
+void
+em_account_editor_commit (EMAccountEditor *emae)
+{
+ emae_commit ((EConfig *)emae->config, NULL, emae);
+}
+
static void
emae_editor_destroyed(GtkWidget *dialog, EMAccountEditor *emae)
{
@@ -2928,7 +3084,11 @@ em_account_editor_construct(EMAccountEditor *emae, EAccount *account, em_account
target = em_config_target_new_account(ec, emae->account);
e_config_set_target((EConfig *)ec, (EConfigTarget *)target);
- emae->editor = e_config_create_window((EConfig *)ec, NULL, type==EMAE_NOTEBOOK?_("Account Editor"):_("Evolution Account Assistant"));
- g_signal_connect(emae->editor, "destroy", G_CALLBACK(emae_editor_destroyed), emae);
+ if (type != EMAE_PAGES) {
+ emae->editor = e_config_create_window((EConfig *)ec, NULL, type==EMAE_NOTEBOOK?_("Account Editor"):_("Evolution Account Assistant"));
+ g_signal_connect(emae->editor, "destroy", G_CALLBACK(emae_editor_destroyed), emae);
+ } else {
+ e_config_create_widget((EConfig *)ec);
+ }
}
diff --git a/mail/em-account-editor.h b/mail/em-account-editor.h
index 43e5c0652c..41da661089 100644
--- a/mail/em-account-editor.h
+++ b/mail/em-account-editor.h
@@ -38,7 +38,8 @@ typedef struct _EMAccountEditorClass EMAccountEditorClass;
typedef enum {
EMAE_NOTEBOOK,
- EMAE_DRUID
+ EMAE_DRUID,
+ EMAE_PAGES
} em_account_editor_t;
struct _EMAccountEditor {
@@ -54,6 +55,8 @@ struct _EMAccountEditor {
struct _EAccount *account; /* working account, must instant apply to this */
struct _EAccount *original; /* original account, not changed unless commit is invoked */
+ GtkWidget **pages; /* Pages for Anjal's page type editor */
+
guint do_signature:1; /* allow editing signature */
};
@@ -64,6 +67,9 @@ struct _EMAccountEditorClass {
GType em_account_editor_get_type(void);
EMAccountEditor *em_account_editor_new(struct _EAccount *account, em_account_editor_t type, char *id);
+EMAccountEditor *em_account_editor_new_for_pages(struct _EAccount *account, em_account_editor_t type, char *id, struct _GtkWidget **pages);
+void em_account_editor_commit (EMAccountEditor *emae);
+void em_account_editor_check (EMAccountEditor *emae, const char *page);
gboolean em_account_editor_save (EMAccountEditor *gui);
void em_account_editor_destroy (EMAccountEditor *gui);
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index f427feca6d..79dae420e8 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -653,13 +653,16 @@ em_composer_utils_setup_callbacks (EMsgComposer *composer,
/* Composing messages... */
static EMsgComposer *
-create_new_composer (const char *subject, const char *fromuri, gboolean use_default_callbacks)
+create_new_composer (const char *subject, const char *fromuri, gboolean use_default_callbacks, gboolean lite)
{
EMsgComposer *composer;
EComposerHeaderTable *table;
EAccount *account = NULL;
- composer = e_msg_composer_new ();
+ if (lite)
+ composer = e_msg_composer_lite_new ();
+ else
+ composer = e_msg_composer_new ();
table = e_msg_composer_get_header_table (composer);
if (fromuri != NULL) {
@@ -692,7 +695,7 @@ em_utils_compose_new_message (const char *fromuri)
{
GtkWidget *composer;
- composer = (GtkWidget *) create_new_composer ("", fromuri, TRUE);
+ composer = (GtkWidget *) create_new_composer ("", fromuri, TRUE, FALSE);
if (composer == NULL)
return;
@@ -702,6 +705,26 @@ em_utils_compose_new_message (const char *fromuri)
}
/**
+ * em_utils_compose_lite_new_message:
+ *
+ * Opens a new composer window as a child window of @parent's toplevel
+ * window.
+ **/
+struct _EMsgComposer *
+em_utils_compose_lite_new_message (const char *fromuri)
+{
+ GtkWidget *composer;
+
+ composer = (GtkWidget *) create_new_composer ("", fromuri, TRUE, TRUE);
+ if (composer == NULL)
+ return NULL;
+
+ composer_set_no_change (E_MSG_COMPOSER (composer), TRUE, TRUE);
+
+ return (struct _EMsgComposer *)composer;
+}
+
+/**
* em_utils_compose_new_message_with_mailto:
* @url: mailto url
*
@@ -1002,7 +1025,7 @@ forward_attached (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages, Cam
{
EMsgComposer *composer;
- composer = create_new_composer (subject, fromuri, TRUE);
+ composer = create_new_composer (subject, fromuri, TRUE, FALSE);
if (composer == NULL)
return;
@@ -1081,7 +1104,7 @@ forward_non_attached (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages,
text = em_utils_message_to_html (message, _("-------- Forwarded Message --------"), flags, &len, NULL, NULL);
if (text) {
- composer = create_new_composer (subject, fromuri, !uids || !uids->pdata [i]);
+ composer = create_new_composer (subject, fromuri, !uids || !uids->pdata [i], FALSE);
if (composer) {
if (CAMEL_IS_MULTIPART(camel_medium_get_content_object((CamelMedium *)message)))
@@ -1642,7 +1665,7 @@ generate_account_hash (void)
return account_hash;
}
-static EDestination **
+EDestination **
em_utils_camel_address_to_destination (CamelInternetAddress *iaddr)
{
EDestination *dest, **destv;
@@ -1846,6 +1869,12 @@ get_reply_sender (CamelMimeMessage *message, CamelInternetAddress *to, CamelNNTP
}
}
+void
+em_utils_get_reply_sender (CamelMimeMessage *message, CamelInternetAddress *to, CamelNNTPAddress *postto)
+{
+ get_reply_sender (message, to, postto);
+}
+
static gboolean
get_reply_list (CamelMimeMessage *message, CamelInternetAddress *to)
{
@@ -1959,6 +1988,13 @@ get_reply_all (CamelMimeMessage *message, CamelInternetAddress *to, CamelInterne
g_hash_table_destroy (rcpt_hash);
}
+void
+em_utils_get_reply_all (CamelMimeMessage *message, CamelInternetAddress *to, CamelInternetAddress *cc, CamelNNTPAddress *postto)
+{
+ get_reply_all (message, to, cc, postto);
+}
+
+
enum {
ATTRIB_UNKNOWN,
ATTRIB_CUSTOM,
@@ -2216,6 +2252,21 @@ struct _reply_data {
int mode;
};
+char *
+em_utils_construct_composer_text (CamelMimeMessage *message, EMFormat *source)
+{
+ char *text, *credits;
+ ssize_t len = 0;
+ gboolean start_bottom = 0;
+
+ credits = attribution_format (ATTRIBUTION, message);
+ text = em_utils_message_to_html (message, credits, EM_FORMAT_QUOTE_CITE, &len, source, start_bottom ? "<BR>" : NULL);
+
+ g_free (credits);
+ return text;
+}
+
+
static void
reply_to_message(CamelFolder *folder, const char *uid, CamelMimeMessage *message, void *user_data)
{
@@ -2246,7 +2297,7 @@ reply_to_message(CamelFolder *folder, const char *uid, CamelMimeMessage *message
* may be supplied in order to update the message flags once it has
* been replied to.
**/
-void
+struct _EMsgComposer *
em_utils_reply_to_message(CamelFolder *folder, const char *uid, CamelMimeMessage *message, int mode, EMFormat *source)
{
CamelInternetAddress *to, *cc;
@@ -2266,10 +2317,10 @@ em_utils_reply_to_message(CamelFolder *folder, const char *uid, CamelMimeMessage
g_object_ref(rd->source);
mail_get_message(folder, uid, reply_to_message, rd, mail_msg_unordered_push);
- return;
+ return NULL;
}
- g_return_if_fail(message != NULL);
+ g_return_val_if_fail(message != NULL, NULL);
/** @Event: message.replying
* @Title: Message being replied to
@@ -2324,5 +2375,8 @@ em_utils_reply_to_message(CamelFolder *folder, const char *uid, CamelMimeMessage
composer_set_no_change (composer, TRUE, FALSE);
- gtk_widget_show (GTK_WIDGET (composer));
+ if (!e_msg_composer_get_lite())
+ gtk_widget_show (GTK_WIDGET (composer));
+
+ return composer;
}
diff --git a/mail/em-composer-utils.h b/mail/em-composer-utils.h
index c46f808879..bbdb73d9c1 100644
--- a/mail/em-composer-utils.h
+++ b/mail/em-composer-utils.h
@@ -34,9 +34,12 @@ extern "C" {
struct _CamelFolder;
struct _CamelMimeMessage;
struct _CamelException;
+struct _CamelInternetAddress;
+struct _CamelNNTPAddress;
struct _EMsgComposer;
struct _EMFormat;
struct _EAccount;
+struct _EDestination;
void em_composer_utils_setup_callbacks (struct _EMsgComposer *composer, struct _CamelFolder *folder, const char *uid,
guint32 flags, guint32 set, struct _CamelFolder *drafts, const char *drafts_uid);
@@ -47,6 +50,7 @@ void em_utils_composer_send_cb(struct _EMsgComposer *composer, gpointer user_dat
void em_utils_composer_save_draft_cb(struct _EMsgComposer *composer, gpointer user_data);
void em_utils_compose_new_message (const char *fromuri);
+struct _EMsgComposer * em_utils_compose_lite_new_message (const char *fromuri);
/* FIXME: mailto? url? should make up its mind what its called. imho use 'uri' */
void em_utils_compose_new_message_with_mailto (const char *url, const char *fromuri);
@@ -75,7 +79,11 @@ enum {
REPLY_MODE_LIST
};
-void em_utils_reply_to_message (struct _CamelFolder *, const char *uid, struct _CamelMimeMessage *message, int mode, struct _EMFormat *source);
+char *em_utils_construct_composer_text (struct _CamelMimeMessage *message, struct _EMFormat *source);
+void em_utils_get_reply_sender (struct _CamelMimeMessage *message, struct _CamelInternetAddress *to, struct _CamelNNTPAddress *postto);
+void em_utils_get_reply_all (struct _CamelMimeMessage *message, struct _CamelInternetAddress *to, struct _CamelInternetAddress *cc, struct _CamelNNTPAddress *postto);
+struct _EMsgComposer * em_utils_reply_to_message (struct _CamelFolder *, const char *uid, struct _CamelMimeMessage *message, int mode, struct _EMFormat *source);
+struct _EDestination ** em_utils_camel_address_to_destination (struct _CamelInternetAddress *iaddr);
#ifdef __cplusplus
}
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index e7063e9fed..4393b2bb73 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -109,6 +109,7 @@ struct _EMFolderTreePrivate {
guint loaded_row_id;
GtkTreeRowReference *drag_row;
+ gboolean skip_double_click;
};
enum {
@@ -436,6 +437,7 @@ em_folder_tree_init (EMFolderTree *emft)
priv->treeview = NULL;
priv->model = NULL;
priv->drag_row = NULL;
+ priv->skip_double_click = FALSE;
emft->priv = priv;
}
@@ -2291,6 +2293,9 @@ emft_tree_button_press (GtkTreeView *treeview, GdkEventButton *event, EMFolderTr
gtk_tree_view_set_cursor (treeview, tree_path, NULL, FALSE);
if (event->button == 1 && event->type == GDK_2BUTTON_PRESS) {
+ if (emft->priv->skip_double_click) {
+ return FALSE;
+ }
emft_tree_row_activated (treeview, tree_path, NULL, emft);
gtk_tree_path_free (tree_path);
return TRUE;
@@ -2643,3 +2648,15 @@ emft_queue_save_state (EMFolderTree *emft)
priv->save_state_id = g_timeout_add_seconds (1, (GSourceFunc) emft_save_state, emft);
}
+
+GtkWidget *
+em_folder_tree_get_tree_view (EMFolderTree *emft)
+{
+ return (GtkWidget *)emft->priv->treeview;
+}
+
+void
+em_folder_tree_set_skip_double_click (EMFolderTree *emft, gboolean skip)
+{
+ emft->priv->skip_double_click = skip;
+}
diff --git a/mail/em-folder-tree.h b/mail/em-folder-tree.h
index e89be47506..b02a4d88cd 100644
--- a/mail/em-folder-tree.h
+++ b/mail/em-folder-tree.h
@@ -94,6 +94,8 @@ EMFolderTreeModel *em_folder_tree_get_model (EMFolderTree *emft);
EMFolderTreeModelStoreInfo *em_folder_tree_get_model_storeinfo (EMFolderTree *emft, CamelStore *store);
gboolean em_folder_tree_create_folder (EMFolderTree *emft, const char *full_name, const char *uri);
+GtkWidget * em_folder_tree_get_tree_view (EMFolderTree *emft);
+void em_folder_tree_set_skip_double_click (EMFolderTree *emft, gboolean skip);
#ifdef __cplusplus
}
diff --git a/mail/mail-component.c b/mail/mail-component.c
index 556715d662..7d7547cb53 100644
--- a/mail/mail-component.c
+++ b/mail/mail-component.c
@@ -106,7 +106,7 @@ static void view_changed_timeout_remove (EComponentView *component_view);
#define PARENT_TYPE evolution_component_get_type ()
static BonoboObjectClass *parent_class = NULL;
-
+const char *x_mailer = "Evolution " VERSION SUB_VERSION " " VERSION_COMMENT;
#define OFFLINE 0
#define ONLINE 1
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 6feadd5b9c..24628a5f91 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -72,6 +72,8 @@
#define w(x)
#define d(x)
+extern const char *x_mailer;
+
/* used for both just filtering a folder + uid's, and for filtering a whole folder */
/* used both for fetching mail, and for filtering mail */
struct _filter_mail_msg {
@@ -461,7 +463,7 @@ mail_send_message(CamelFolder *queue, const char *uid, const char *destination,
if (!message)
return;
- camel_medium_set_header (CAMEL_MEDIUM (message), "X-Mailer", "Evolution " VERSION SUB_VERSION " " VERSION_COMMENT);
+ camel_medium_set_header (CAMEL_MEDIUM (message), "X-Mailer", x_mailer);
err = g_string_new("");
xev = mail_tool_remove_xevolution_headers (message);
@@ -918,8 +920,7 @@ mail_append_mail (CamelFolder *folder, CamelMimeMessage *message, CamelMessageIn
g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message));
if (!camel_medium_get_header (CAMEL_MEDIUM (message), "X-Mailer"))
- camel_medium_set_header (CAMEL_MEDIUM (message), "X-Mailer",
- "Evolution " VERSION SUB_VERSION " " VERSION_COMMENT);
+ camel_medium_set_header (CAMEL_MEDIUM (message), "X-Mailer", x_mailer);
m = mail_msg_new (&append_mail_info);
m->folder = folder;
@@ -1878,7 +1879,7 @@ typedef void (*get_done)(CamelFolder *folder, const char *uid, CamelMimeMessage
static void
get_messagex_done (struct _get_message_msg *m)
{
- if (m->done) {
+ if (m->done && !camel_operation_cancel_check (m->cancel)) {
get_done done = (get_done)m->done;
done(m->folder, m->uid, m->message, m->data, &m->base.ex);
}
@@ -1894,7 +1895,7 @@ static MailMsgInfo get_messagex_info = {
/* This is temporary, to avoid having to rewrite everything that uses
mail_get_message; it adds an exception argument to the callback */
-void
+CamelOperation *
mail_get_messagex(CamelFolder *folder, const char *uid, void (*done) (CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data, CamelException *),
void *data, MailMsgDispatchFunc dispatch)
{
@@ -1909,6 +1910,8 @@ mail_get_messagex(CamelFolder *folder, const char *uid, void (*done) (CamelFolde
m->cancel = camel_operation_new(NULL, NULL);
dispatch (m);
+
+ return m->cancel;
}
/* ********************************************************************** */
diff --git a/mail/mail-ops.h b/mail/mail-ops.h
index e615a9121d..9ee3899242 100644
--- a/mail/mail-ops.h
+++ b/mail/mail-ops.h
@@ -57,7 +57,7 @@ void mail_get_message (CamelFolder *folder, const char *uid,
void *data,
MailMsgDispatchFunc dispatch);
-void
+CamelOperation *
mail_get_messagex(CamelFolder *folder, const char *uid,
void (*done) (CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data, CamelException *),
void *data, MailMsgDispatchFunc dispatch);