aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog17
-rw-r--r--mail/mail-accounts.c5
-rw-r--r--mail/mail-accounts.h5
-rw-r--r--mail/mail-callbacks.c14
-rw-r--r--mail/mail-config-druid.c78
-rw-r--r--mail/mail-config-druid.h5
-rw-r--r--mail/mail-config.c38
-rw-r--r--mail/mail-display.c2
-rw-r--r--mail/mail-format.c6
-rw-r--r--mail/mail-tools.c2
10 files changed, 109 insertions, 63 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index c2a2500560..d51f546553 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,22 @@
2001-01-07 Jeffrey Stedfast <fejj@helixcode.com>
+ * mail-tools.c (mail_tool_quote_message): Updated to reflect
+ changes to the mail-config API.
+
+ * mail-display.c (redisplay): Updated to reflect changes to the
+ mail-config API.
+
+ * mail-callbacks.c (providers_config): Use the new account dialog.
+
+ * mail-config-druid.c (druid_finish): Load the new storage into
+ the shell.
+ (mail_config_druid_new): Take a shell argument.
+
+ * mail-format.c (mail_generate_reply): Updated to reflect changes
+ to the mail-config API.
+
+ * mail-config-druid.c: Fixed this to build.
+
* mail-callbacks.c (check_send_configuration): Updated to reflect
changes to the mail-config API.
(create_msg_composer): Same.
diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c
index ed10636493..952342cfc1 100644
--- a/mail/mail-accounts.c
+++ b/mail/mail-accounts.c
@@ -171,7 +171,7 @@ mail_add (GtkButton *button, gpointer data)
MailAccountsDialog *dialog = data;
MailConfigDruid *druid;
- druid = mail_config_druid_new ();
+ druid = mail_config_druid_new (dialog->shell);
gtk_signal_connect (GTK_OBJECT (druid), "destroy",
GTK_SIGNAL_FUNC (mail_add_finished), dialog);
@@ -389,12 +389,13 @@ construct (MailAccountsDialog *dialog)
}
MailAccountsDialog *
-mail_accounts_dialog_new ()
+mail_accounts_dialog_new (GNOME_Evolution_Shell shell)
{
MailAccountsDialog *new;
new = (MailAccountsDialog *) gtk_type_new (mail_accounts_dialog_get_type ());
construct (new);
+ new->shell = shell;
return new;
}
diff --git a/mail/mail-accounts.h b/mail/mail-accounts.h
index b87d77e7f1..86dd7a42ea 100644
--- a/mail/mail-accounts.h
+++ b/mail/mail-accounts.h
@@ -31,6 +31,7 @@ extern "C" {
#include <gnome.h>
#include <glade/glade.h>
#include <camel.h>
+#include "shell/Evolution.h"
#define MAIL_ACCOUNTS_DIALOG_TYPE (mail_accounts_dialog_get_type ())
#define MAIL_ACCOUNTS_DIALOG(o) (GTK_CHECK_CAST ((o), MAIL_ACCOUNTS_DIALOG_TYPE, MailAccountsDialog))
@@ -41,6 +42,8 @@ extern "C" {
struct _MailAccountsDialog {
GnomeDialog parent;
+ GNOME_Evolution_Shell shell;
+
GladeXML *gui;
const GSList *accounts;
@@ -72,7 +75,7 @@ typedef struct {
GtkType mail_accounts_dialog_get_type (void);
-MailAccountsDialog *mail_accounts_dialog_new (void);
+MailAccountsDialog *mail_accounts_dialog_new (GNOME_Evolution_Shell shell);
#ifdef __cplusplus
}
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index d58e208320..ab461a6b04 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -33,6 +33,8 @@
#include "mail.h"
#include "mail-callbacks.h"
#include "mail-config.h"
+#include "mail-accounts.h"
+#include "mail-config-druid.h"
#include "mail-threads.h"
#include "mail-tools.h"
#include "mail-ops.h"
@@ -65,6 +67,8 @@ struct post_send_data {
static gboolean
check_configured (FolderBrowser *fb)
{
+ MailConfigDruid *druid;
+
if (mail_config_is_configured ())
return TRUE;
@@ -83,7 +87,9 @@ check_configured (FolderBrowser *fb)
switch (gnome_dialog_run_and_close (GNOME_DIALOG (dialog))) {
case 0:
- mail_config_druid (fb->shell);
+ /* FIXME: should we block until mail-config is done? */
+ druid = mail_config_druid_new (fb->shell);
+ gtk_widget_show (GTK_WIDGET (druid));
break;
case 1:
default:
@@ -938,7 +944,11 @@ vfolder_edit_vfolders (BonoboUIComponent *uih, void *user_data, const char *path
void
providers_config (BonoboUIComponent *uih, void *user_data, const char *path)
{
- mail_config ((FOLDER_BROWSER (user_data))->shell);
+ /* FIXME: should we block until mail-config is done? */
+ MailAccountsDialog *dialog;
+
+ dialog = mail_accounts_dialog_new ((FOLDER_BROWSER (user_data))->shell);
+ gtk_widget_show (GTK_WIDGET (dialog));
}
/*
diff --git a/mail/mail-config-druid.c b/mail/mail-config-druid.c
index 511e162bd6..1a7ae15312 100644
--- a/mail/mail-config-druid.c
+++ b/mail/mail-config-druid.c
@@ -21,14 +21,20 @@
*/
#include "config.h"
+
+#include <glade/glade.h>
+#include <gtkhtml/gtkhtml.h>
#include "mail-config-druid.h"
+#include "mail-config.h"
#include "mail-ops.h"
+#include "mail.h"
#include <sys/types.h>
#include <string.h>
#include <unistd.h>
#define d(x) x
+extern CamelSession *session;
static void mail_config_druid_class_init (MailConfigDruidClass *class);
static void mail_config_druid_init (MailConfigDruid *druid);
@@ -105,15 +111,15 @@ static struct {
char *text;
} info[] = {
{ "htmlIdentity",
- _("Please enter your name and email address below. The \"optional\" fields below do not need to be filled in, unless you wish to include this information in email you send.") },
+ "Please enter your name and email address below. The \"optional\" fields below do not need to be filled in, unless you wish to include this information in email you send." },
{ "htmlIncoming",
- _("Please enter information about your incoming mail server below. If you don't know what kind of server you use, contact your system administrator or Internet Service Provider.") },
+ "Please enter information about your incoming mail server below. If you don't know what kind of server you use, contact your system administrator or Internet Service Provider." },
{ "htmlAuthentication",
- _("Your mail server supports the following types of authentication. Please select the type you want Evolution to use.") },
+ "Your mail server supports the following types of authentication. Please select the type you want Evolution to use." },
{ "htmlTransport",
- _("Please enter information about your outgoing mail protocol below. If you don't know which protocol you use, contact your system administrator or Internet Service Provider.") },
+ "Please enter information about your outgoing mail protocol below. If you don't know which protocol you use, contact your system administrator or Internet Service Provider." },
{ "htmlAccountInfo",
- _("You are almost done with the mail configuration process. The identity, incoming mail server and outgoing mail transport method which you provided will be grouped together to make an Evolution mail account. Please enter a name for this account in the space below. This name will be used for display purposes only.") }
+ "You are almost done with the mail configuration process. The identity, incoming mail server and outgoing mail transport method which you provided will be grouped together to make an Evolution mail account. Please enter a name for this account in the space below. This name will be used for display purposes only." }
};
static int num_info = (sizeof (info) / sizeof (info[0]));
@@ -186,10 +192,11 @@ druid_finish (GnomeDruidPage *page, gpointer arg1, gpointer user_data)
MailConfigIdentity *id;
MailConfigService *source;
MailConfigService *transport;
+ GSList *mini;
account = g_new0 (MailConfigAccount, 1);
account->name = mail_config_druid_get_account_name (druid);
- account->default = mail_config_druid_get_default_account (druid);
+ account->default_account = mail_config_druid_get_default_account (druid);
/* construct the identity */
id = g_new0 (MailConfigIdentity, 1);
@@ -202,8 +209,8 @@ druid_finish (GnomeDruidPage *page, gpointer arg1, gpointer user_data)
/* construct the source */
source = g_new0 (MailConfigService, 1);
source->url = mail_config_druid_get_source_url (druid);
- source->keep_mail_on_server = mail_config_druid_get_keep_mail_on_server (druid);
- source->save_password = mail_config_druid_get_save_password (druid);
+ source->keep_on_server = mail_config_druid_get_keep_mail_on_server (druid);
+ source->save_passwd = mail_config_druid_get_save_password (druid);
/* construct the transport */
transport = g_new0 (MailConfigService, 1);
@@ -213,7 +220,11 @@ druid_finish (GnomeDruidPage *page, gpointer arg1, gpointer user_data)
account->source = source;
account->transport = transport;
- mail_config_add_accounts (account);
+ mail_config_add_account (account);
+
+ mini = g_slist_append (NULL, account->source);
+ mail_load_storages (druid->shell, mini);
+ g_slist_free (mini);
gtk_widget_destroy (GTK_WIDGET (druid));
}
@@ -240,7 +251,7 @@ identity_changed (GtkWidget *widget, gpointer data)
static void
identity_prepare (GnomeDruidPage *page, GnomeDruid *druid, gpointer data)
{
- MailConfigDruid *config;
+ MailConfigDruid *config = data;
identity_check (config);
}
@@ -285,7 +296,7 @@ incoming_changed (GtkWidget *widget, gpointer data)
static void
incoming_prepare (GnomeDruidPage *page, GnomeDruid *druid, gpointer data)
{
- MailConfigDruid *config;
+ MailConfigDruid *config = data;
if (!gtk_object_get_data (GTK_OBJECT (page), "initialized")) {
char *username;
@@ -309,17 +320,14 @@ static gboolean
incoming_next (GnomeDruidPage *page, GnomeDruid *druid, gpointer data)
{
MailConfigDruid *config = data;
- const CamelProvider *provider;
GtkWidget *transport_page;
GList *authtypes = NULL;
+ gchar *source_url;
CamelURL *url;
- provider = config->source_provider;
- url = g_new0 (CamelURL, 1);
- url->protocol = g_strdup (provider->protocol);
- url->host = mail_config_druid_get_incoming_hostname (config);
- url->user = mail_config_druid_get_incoming_username (config);
- url->path = mail_config_druid_get_incoming_path (config);
+ source_url = mail_config_druid_get_source_url (config);
+ url = camel_url_new (source_url, NULL);
+ g_free (source_url);
/* If we can't connect, don't let them continue. */
if (!mail_config_check_service (url, CAMEL_PROVIDER_STORE, &authtypes)) {
@@ -388,7 +396,7 @@ incoming_type_changed (GtkWidget *widget, gpointer user_data)
static void
authentication_check (MailConfigDruid *druid)
{
- if (mail_config_druid_get_save_passwd (druid) &&
+ if (mail_config_druid_get_save_password (druid) &&
gtk_entry_get_text (druid->password) != NULL)
gnome_druid_set_buttons_sensitive (druid->druid, TRUE, TRUE, TRUE);
else
@@ -406,7 +414,7 @@ authentication_changed (GtkWidget *widget, gpointer data)
static void
authentication_prepare (GnomeDruidPage *page, GnomeDruid *druid, gpointer data)
{
- MailConfigDruid *config;
+ MailConfigDruid *config = data;
authentication_check (config);
}
@@ -494,17 +502,16 @@ transport_prepare (GnomeDruidPage *page, GnomeDruid *druid, gpointer data)
transport_check (config);
}
-static void
+static gboolean
transport_next (GnomeDruidPage *page, GnomeDruid *druid, gpointer data)
{
MailConfigDruid *config = data;
- const CamelProvider *provider;
+ gchar *xport_url;
CamelURL *url;
- provider = config->transport_provider;
- url = g_new0 (CamelURL, 1);
- url->protocol = g_strdup (provider->protocol);
- url->host = mail_config_druid_get_outgoing_hostname (config);
+ xport_url = mail_config_druid_get_transport_url (config);
+ url = camel_url_new (xport_url, NULL);
+ g_free (xport_url);
/* If we can't connect, don't let them continue. */
if (!mail_config_check_service (url, CAMEL_PROVIDER_TRANSPORT, NULL)) {
@@ -680,7 +687,7 @@ construct (MailConfigDruid *druid)
GladeXML *gui;
GtkWidget *widget;
- gui = glade_xml_new (EVOLUTION_DATA_DIR "/mail-config-druid.glade", "mail-config-window");
+ gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config-druid.glade", "mail-config-window");
druid->gui = gui;
/* get our toplevel widget */
@@ -694,7 +701,7 @@ construct (MailConfigDruid *druid)
/* get our cared-about widgets */
druid->account_text = glade_xml_get_widget (gui, "htmlAccountInfo");
druid->account_name = GTK_ENTRY (glade_xml_get_widget (gui, "txtAccountName"));
- druid->default_account = GTK_CHECK_BOX (glade_xml_get_widget (gui, "chkAccountDefault"));
+ druid->default_account = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "chkAccountDefault"));
druid->identity_text = glade_xml_get_widget (gui, "htmlIdentity");
druid->full_name = GTK_ENTRY (glade_xml_get_widget (gui, "txtFullName"));
@@ -713,19 +720,19 @@ construct (MailConfigDruid *druid)
gtk_signal_connect (GTK_OBJECT (druid->incoming_username), "changed", incoming_changed, druid);
druid->incoming_path = GTK_ENTRY (glade_xml_get_widget (gui, "txtIncomingPath"));
gtk_signal_connect (GTK_OBJECT (druid->incoming_path), "changed", incoming_changed, druid);
- druid->incoming_keep_mail = GTK_CHECK_BOX (glade_xml_get_widget (gui, "chkIncomingKeepMail"));
+ druid->incoming_keep_mail = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "chkIncomingKeepMail"));
druid->auth_text = glade_xml_get_widget (gui, "htmlAuthentication");
druid->auth_type = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuAuthType"));
druid->password = GTK_ENTRY (glade_xml_get_widget (gui, "txtAuthPasswd"));
gtk_signal_connect (GTK_OBJECT (druid->password), "changed", authentication_changed, druid);
- druid->save_password = GTK_CHECK_BOX (glade_xml_get_widget (gui, "chkAuthSavePasswd"));
+ druid->save_password = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "chkAuthSavePasswd"));
druid->outgoing_text = glade_xml_get_widget (gui, "htmlTransport");
druid->outgoing_type = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuTransportType"));
druid->outgoing_hostname = GTK_ENTRY (glade_xml_get_widget (gui, "txtTransportHostname"));
gtk_signal_connect (GTK_OBJECT (druid->outgoing_hostname), "changed", transport_changed, druid);
- druid->outgoing_requires_auth = GTK_CHECK_BOX (glade_xml_get_widget (gui, "chkTransportNeedsAuth"));
+ druid->outgoing_requires_auth = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "chkTransportNeedsAuth"));
glade_xml_signal_autoconnect (gui);
@@ -735,12 +742,13 @@ construct (MailConfigDruid *druid)
}
MailConfigDruid *
-mail_config_druid_new ()
+mail_config_druid_new (GNOME_Evolution_Shell shell)
{
MailConfigDruid *new;
new = (MailConfigDruid *) gtk_type_new (mail_config_druid_get_type ());
construct (new);
+ new->shell = shell;
return new;
}
@@ -814,7 +822,7 @@ mail_config_druid_get_source_url (MailConfigDruid *druid)
char *source_url, *host, *pport;
const CamelProvider *provider;
CamelURL *url;
- int port;
+ int port = 0;
g_return_val_if_fail (IS_MAIL_CONFIG_DRUID (druid), NULL);
@@ -866,7 +874,7 @@ mail_config_druid_get_transport_url (MailConfigDruid *druid)
char *transport_url, *host, *pport;
const CamelProvider *provider;
CamelURL *url;
- int port;
+ int port = 0;
g_return_val_if_fail (IS_MAIL_CONFIG_DRUID (druid), NULL);
@@ -890,7 +898,7 @@ mail_config_druid_get_transport_url (MailConfigDruid *druid)
gboolean
-mail_config_druid_get_outgoing_requires_auth (MailConfigDruid *druid)
+mail_config_druid_get_transport_requires_auth (MailConfigDruid *druid)
{
g_return_val_if_fail (IS_MAIL_CONFIG_DRUID (druid), FALSE);
diff --git a/mail/mail-config-druid.h b/mail/mail-config-druid.h
index 29a17736b9..e738839bc7 100644
--- a/mail/mail-config-druid.h
+++ b/mail/mail-config-druid.h
@@ -31,6 +31,7 @@ extern "C" {
#include <gnome.h>
#include <glade/glade.h>
#include <camel.h>
+#include "shell/Evolution.h"
#define MAIL_CONFIG_DRUID_TYPE (mail_config_druid_get_type ())
#define MAIL_CONFIG_DRUID(o) (GTK_CHECK_CAST ((o), MAIL_CONFIG_DRUID_TYPE, MailConfigDruid))
@@ -41,6 +42,8 @@ extern "C" {
struct _MailConfigDruid {
GtkWindow parent;
+ GNOME_Evolution_Shell shell;
+
GladeXML *gui;
GList *providers;
@@ -95,7 +98,7 @@ typedef struct {
GtkType mail_config_druid_get_type (void);
-MailConfigDruid *mail_config_druid_new (void);
+MailConfigDruid *mail_config_druid_new (GNOME_Evolution_Shell shell);
char *mail_config_druid_get_account_name (MailConfigDruid *druid);
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 5121683bc6..f67d2c7578 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -129,7 +129,7 @@ account_copy (const MailConfigAccount *account)
new = g_new0 (MailConfigAccount, 1);
new->name = g_strdup (account->name);
- new->default = source->default;
+ new->default_account = account->default_account;
new->id = identity_copy (account->id);
new->source = service_copy (account->source);
@@ -183,8 +183,8 @@ mail_config_clear (void)
}
if (config->news) {
- g_list_foreach (config->news, service_destroy_each, NULL);
- g_list_free (config->news);
+ g_slist_foreach (config->news, service_destroy_each, NULL);
+ g_slist_free (config->news);
config->news = NULL;
}
@@ -223,9 +223,9 @@ config_read (void)
path = g_strdup_printf ("account_name_%d", i);
account->name = gnome_config_get_string (path);
g_free (path);
- path = g_strdup_printf ("account_default_%d", i);
- account->default = gnome_config_get_bool (path) && !have_default;
- if (account->default)
+ path = g_strdup_printf ("account_is_default_%d", i);
+ account->default_account = gnome_config_get_bool (path) && !have_default;
+ if (account->default_account)
have_default = TRUE;
g_free (path);
@@ -241,10 +241,10 @@ config_read (void)
id->address = gnome_config_get_string (path);
g_free (path);
path = g_strdup_printf ("identity_organization_%d", i);
- id->org = gnome_config_get_string (path);
+ id->organization = gnome_config_get_string (path);
g_free (path);
path = g_strdup_printf ("identity_signature_%d", i);
- id->sig = gnome_config_get_string (path);
+ id->signature = gnome_config_get_string (path);
g_free (path);
/* get the source */
@@ -350,8 +350,8 @@ mail_config_write (void)
path = g_strdup_printf ("account_name_%d", i);
gnome_config_set_string (path, account->name);
g_free (path);
- path = g_strdup_printf ("account_default_%d", i);
- gnome_config_set_bool (path, account->default);
+ path = g_strdup_printf ("account_is_default_%d", i);
+ gnome_config_set_bool (path, account->default_account);
g_free (path);
/* identity info */
@@ -441,11 +441,13 @@ mail_config_write_on_exit (void)
/* Passwords */
gnome_config_private_clean_section ("/Evolution/Passwords");
- for (sources = config->sources; sources; sources = sources->next) {
+ sources = mail_config_get_sources ();
+ for ( ; sources; sources = sources->next) {
s = sources->data;
if (s->save_passwd)
mail_session_remember_password (s->url);
}
+ g_slist_free (sources);
gnome_config_sync ();
}
@@ -546,11 +548,11 @@ mail_config_get_accounts (void)
}
void
-mail_config_add_accounts (MailConfigAccount *account)
+mail_config_add_account (MailConfigAccount *account)
{
if (account->default_account) {
/* Un-defaultify other accounts */
- GSList *node = accounts;
+ GSList *node = config->accounts;
while (node) {
MailConfigAccount *acnt = node->data;
@@ -567,7 +569,7 @@ mail_config_add_accounts (MailConfigAccount *account)
void
mail_config_set_default_account (const MailConfigAccount *account)
{
- GSList *node = accounts;
+ GSList *node = config->accounts;
while (node) {
MailConfigAccount *acnt = node->data;
@@ -577,7 +579,7 @@ mail_config_set_default_account (const MailConfigAccount *account)
node = node->next;
}
- account->default_account = TRUE;
+ ((MailConfigAccount *) account)->default_account = TRUE;
}
const MailConfigIdentity *
@@ -633,8 +635,10 @@ mail_config_get_sources (void)
accounts = mail_config_get_accounts ();
while (accounts) {
- if (accounts->source)
- sources = g_slist_append (sources, accounts->source);
+ const MailConfigAccount *account = accounts->data;
+
+ if (account->source)
+ sources = g_slist_append (sources, account->source);
accounts = accounts->next;
}
diff --git a/mail/mail-display.c b/mail/mail-display.c
index c1fb94c5f3..43f61138ad 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -835,7 +835,7 @@ redisplay (MailDisplay *md, gboolean unscroll)
if (md->current_message) {
camel_object_ref (CAMEL_OBJECT (md->current_message));
- if (mail_config_view_source ())
+ if (mail_config_get_view_source ())
mail_format_raw_message (md->current_message, md);
else
mail_format_mime_message (md->current_message, md);
diff --git a/mail/mail-format.c b/mail/mail-format.c
index c4f9ef2b7c..aaefd4856f 100644
--- a/mail/mail-format.c
+++ b/mail/mail-format.c
@@ -1654,7 +1654,7 @@ mail_generate_reply (CamelMimeMessage *message, gboolean to_all)
const char *message_id, *references;
const char *name = NULL, *address = NULL;
GList *to = NULL, *cc = NULL;
- MailConfigIdentity *id;
+ const MailConfigIdentity *id;
gchar *sig_file = NULL;
const CamelInternetAddress *reply_to, *sender;
time_t date;
@@ -1662,9 +1662,9 @@ mail_generate_reply (CamelMimeMessage *message, gboolean to_all)
id = mail_config_get_default_identity ();
if (id)
- sig_file = id->sig;
+ sig_file = id->signature;
- composer = e_msg_composer_new_with_sig_file (sig_file, mail_config_send_html ());
+ composer = e_msg_composer_new_with_sig_file (sig_file, mail_config_get_send_html ());
if (!composer)
return NULL;
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index a564818b3c..ff82630e53 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -557,7 +557,7 @@ mail_tool_quote_message (CamelMimeMessage *message, const char *fmt, ...)
gboolean want_plain, is_html;
gchar *text;
- want_plain = !mail_config_send_html ();
+ want_plain = !mail_config_get_send_html ();
contents = camel_medium_get_content_object (CAMEL_MEDIUM (message));
text = mail_get_message_body (contents, want_plain, &is_html);