aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-callbacks.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2001-01-09 11:31:31 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-01-09 11:31:31 +0800
commita2d998fe1391733fa472f2c142891d31fd81f958 (patch)
treec554cd3852b61c3166b749097c0be976974526d8 /mail/mail-callbacks.c
parent20b3bc147ce1de0fe2708236c7915df96d275634 (diff)
downloadgsoc2013-evolution-a2d998fe1391733fa472f2c142891d31fd81f958.tar.gz
gsoc2013-evolution-a2d998fe1391733fa472f2c142891d31fd81f958.tar.zst
gsoc2013-evolution-a2d998fe1391733fa472f2c142891d31fd81f958.zip
Brand spankin' new config druid, editor, and manager.
2001-01-08 Jeffrey Stedfast <fejj@helixcode.com> * Makefile.am: * component-factory.c: * folder-browser-factory.c: * folder-browser.c: * mail-accounts.[c,h]: * mail-account-editor.[c,h]: * mail-callbacks.c: * mail-config.[c,h]: * mail-config-druid.[c,h]: * mail-config-druid.glade: * mail-display.c: * mail-format.c: * mail-tools.c: Brand spankin' new config druid, editor, and manager. svn path=/trunk/; revision=7313
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r--mail/mail-callbacks.c93
1 files changed, 52 insertions, 41 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 9c7cd1e2b8..ee9de6d195 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:
@@ -98,17 +104,18 @@ check_configured (FolderBrowser *fb)
static gboolean
check_send_configuration (FolderBrowser *fb)
{
- MailConfigService *xport = NULL;
+ const MailConfigAccount *account;
/* Check general */
-
if (!check_configured (fb)) {
return FALSE;
}
- /* Check for an identity */
+ /* Get the default account */
+ account = mail_config_get_default_account ();
- if (!mail_config_get_default_identity ()) {
+ /* Check for an identity */
+ if (!account) {
GtkWidget *message;
message = gnome_warning_dialog_parented (_("You need to configure an identity\n"
@@ -120,9 +127,7 @@ check_send_configuration (FolderBrowser *fb)
}
/* Check for a transport */
-
- xport = mail_config_get_transport ();
- if (!xport || !xport->url) {
+ if (!account->transport || !account->transport->url) {
GtkWidget *message;
message = gnome_warning_dialog_parented (_("You need to configure a mail transport\n"
@@ -199,14 +204,14 @@ void
send_queued_mail (GtkWidget *widget, gpointer user_data)
{
extern CamelFolder *outbox_folder;
- MailConfigService *transport;
+ const MailConfigAccount *account;
if (!mail_config_is_configured ()) {
return;
}
- transport = mail_config_get_transport ();
- if (!transport) {
+ account = mail_config_get_default_account ();
+ if (!account->transport) {
GtkWidget *win = gtk_widget_get_ancestor (GTK_WIDGET (user_data),
GTK_TYPE_WINDOW);
@@ -224,7 +229,7 @@ send_queued_mail (GtkWidget *widget, gpointer user_data)
return;
}
- mail_do_send_queue (outbox_folder, transport->url);
+ mail_do_send_queue (outbox_folder, account->transport->url);
}
void
@@ -291,7 +296,7 @@ composer_sent_cb(char *uri, CamelMimeMessage *message, gboolean sent, void *data
void
composer_send_cb (EMsgComposer *composer, gpointer data)
{
- MailConfigService *xport = NULL;
+ const MailConfigAccount *account = NULL;
CamelMimeMessage *message;
const CamelInternetAddress *iaddr;
const char *subject;
@@ -299,7 +304,7 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
struct _send_data *send;
/* Config info */
- xport = mail_config_get_transport ();
+ account = mail_config_get_default_account ();
/* Get the message */
message = e_msg_composer_get_message (composer);
@@ -328,13 +333,13 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
return;
}
}
-
+
send = g_malloc(sizeof(*send));
send->psd = psd;
send->composer = composer;
gtk_object_ref((GtkObject *)composer);
gtk_widget_hide((GtkWidget *)composer);
- mail_send_mail(xport->url, message, composer_sent_cb, send);
+ mail_send_mail (account->transport->url, message, composer_sent_cb, send);
}
void
@@ -374,25 +379,25 @@ composer_postpone_cb (EMsgComposer *composer, gpointer data)
static GtkWidget *
create_msg_composer (const char *url)
{
- MailConfigIdentity *id;
- gboolean send_html;
- gchar *sig_file = NULL;
- EMsgComposer *composer;
-
- id = mail_config_get_default_identity ();
- send_html = mail_config_send_html ();
-
- if (id)
- sig_file = id->sig;
-
- if (url != NULL) {
- composer = e_msg_composer_new_from_url (url);
- if (composer)
- e_msg_composer_set_send_html (composer, send_html);
- } else
- composer = e_msg_composer_new_with_sig_file (sig_file, send_html);
-
- return (GtkWidget *)composer;
+ const MailConfigAccount *account;
+ gboolean send_html;
+ gchar *sig_file = NULL;
+ EMsgComposer *composer;
+
+ account = mail_config_get_default_account ();
+ send_html = mail_config_get_send_html ();
+
+ if (account->id)
+ sig_file = account->id->signature;
+
+ if (url != NULL) {
+ composer = e_msg_composer_new_from_url (url);
+ if (composer)
+ e_msg_composer_set_send_html (composer, send_html);
+ } else
+ composer = e_msg_composer_new_with_sig_file (sig_file, send_html);
+
+ return (GtkWidget *)composer;
}
void
@@ -499,13 +504,15 @@ enumerate_msg (MessageList *ml, const char *uid, gpointer data)
}
-static EMsgComposer *forward_get_composer(const char *subject)
+static EMsgComposer *
+forward_get_composer (const char *subject)
{
+ const MailConfigAccount *account;
EMsgComposer *composer;
- MailConfigIdentity *id;
-
- id = mail_config_get_default_identity ();
- composer = e_msg_composer_new_with_sig_file(id?id->sig:NULL, mail_config_send_html());
+
+ account = mail_config_get_default_account ();
+ composer = e_msg_composer_new_with_sig_file (account && account->id ? account->id->signature : NULL,
+ mail_config_get_send_html ());
if (composer) {
gtk_signal_connect (GTK_OBJECT (composer), "send",
GTK_SIGNAL_FUNC (composer_send_cb), NULL);
@@ -937,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);
+ gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
}
/*