aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-callbacks.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-12-14 06:51:35 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-12-14 06:51:35 +0800
commit5a5eec6a63ca61ba652dfc4f096b5d29bd26c98e (patch)
tree8805dad99f9f383761dd9c7d3dfbda95762eaf14 /mail/mail-callbacks.c
parent33f5b6f67d90bffdb7a83a07d619face63e9983c (diff)
downloadgsoc2013-evolution-5a5eec6a63ca61ba652dfc4f096b5d29bd26c98e.tar.gz
gsoc2013-evolution-5a5eec6a63ca61ba652dfc4f096b5d29bd26c98e.tar.zst
gsoc2013-evolution-5a5eec6a63ca61ba652dfc4f096b5d29bd26c98e.zip
Make sure the folder-browser is not NULL or we'll crash.
2002-12-13 Jeffrey Stedfast <fejj@ximian.com> * mail-callbacks.c (check_send_configuration): Make sure the folder-browser is not NULL or we'll crash. svn path=/trunk/; revision=19115
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r--mail/mail-callbacks.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 02c54e5b06..2b550bcb0a 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -182,16 +182,16 @@ static gboolean
configure_mail (FolderBrowser *fb)
{
MailConfigDruid *druid;
-
- if (e_question(FB_WINDOW(fb), GTK_RESPONSE_YES, NULL,
- _("You have not configured the mail client.\n"
- "You need to do this before you can send,\n"
- "receive or compose mail.\n"
- "Would you like to configure it now?"))) {
+
+ if (e_question (FB_WINDOW (fb), GTK_RESPONSE_YES, NULL,
+ _("You have not configured the mail client.\n"
+ "You need to do this before you can send,\n"
+ "receive or compose mail.\n"
+ "Would you like to configure it now?"))) {
druid = mail_config_druid_new (fb->shell);
g_object_weak_ref ((GObject *) druid, (GWeakNotify) druid_destroy_cb, NULL);
- gtk_widget_show ((GtkWidget *)druid);
- gtk_grab_add ((GtkWidget *)druid);
+ gtk_widget_show ((GtkWidget *) druid);
+ gtk_grab_add ((GtkWidget *) druid);
gtk_main ();
}
@@ -204,25 +204,32 @@ check_send_configuration (FolderBrowser *fb)
const MailConfigAccount *account;
GtkWidget *dialog;
- /* Check general */
- if (!mail_config_is_configured () && !configure_mail (fb))
- return FALSE;
+ if (!mail_config_is_configured ()) {
+ if (fb == NULL) {
+ e_notice (NULL, GTK_MESSAGE_WARNING,
+ _("You need to configure an account\nbefore you can compose mail."));
+ return FALSE;
+ }
+
+ if (!configure_mail (fb))
+ return FALSE;
+ }
/* Get the default account */
account = mail_config_get_default_account ();
/* Check for an identity */
if (!account) {
- e_notice(FB_WINDOW(fb), GTK_MESSAGE_WARNING,
- _("You need to configure an identity\nbefore you can compose mail."));
+ e_notice (FB_WINDOW (fb), GTK_MESSAGE_WARNING,
+ _("You need to configure an identity\nbefore you can compose mail."));
return FALSE;
}
/* Check for a transport */
if (!account->transport || !account->transport->url) {
- e_notice(FB_WINDOW(fb), GTK_MESSAGE_WARNING,
- _("You need to configure a mail transport\n"
- "before you can compose mail."));
+ e_notice (FB_WINDOW (fb), GTK_MESSAGE_WARNING,
+ _("You need to configure a mail transport\n"
+ "before you can compose mail."));
return FALSE;
}