diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2011-01-07 06:53:58 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2011-01-07 06:53:58 +0000 |
commit | 67dafc6d14d604ae87eb060763a7364f8b58e462 (patch) | |
tree | 87d2cd6d2aa822eab203145d6141a7bdeb0aa93d /src | |
parent | c2b0ac470bcbc1c508814b274909c44caadb4e5a (diff) |
added an option to disable the send dialog.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2781 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/compose.c | 8 | ||||
-rw-r--r-- | src/prefs_common_dialog.c | 9 | ||||
-rw-r--r-- | src/send_message.c | 26 |
3 files changed, 35 insertions, 8 deletions
diff --git a/src/compose.c b/src/compose.c index 82e1ad8c..9a072d2a 100644 --- a/src/compose.c +++ b/src/compose.c @@ -7177,7 +7177,12 @@ static void compose_send_cb(gpointer data, guint action, GtkWidget *widget) Compose *compose = (Compose *)data; gint val; + if (compose->lock_count > 0) + return; + + gtk_widget_set_sensitive(compose->vbox, FALSE); val = compose_send(compose); + gtk_widget_set_sensitive(compose->vbox, TRUE); if (val == 0) compose_destroy(compose); @@ -7389,6 +7394,9 @@ static void compose_close_cb(gpointer data, guint action, GtkWidget *widget) Compose *compose = (Compose *)data; AlertValue val; + if (compose->lock_count > 0) + return; + if (compose->exteditor_pid != 0) { if (!compose_ext_editor_kill(compose)) return; diff --git a/src/prefs_common_dialog.c b/src/prefs_common_dialog.c index 6dae19ed..e28ec172 100644 --- a/src/prefs_common_dialog.c +++ b/src/prefs_common_dialog.c @@ -80,6 +80,7 @@ static struct Send { GtkWidget *checkbtn_savemsg; GtkWidget *checkbtn_filter_sent; GtkWidget *checkbtn_recipients_autoreg; + GtkWidget *checkbtn_show_send_dialog; GtkWidget *optmenu_encoding_method; GtkWidget *optmenu_mime_fencoding_method; @@ -318,6 +319,8 @@ static PrefsUIData ui_data[] = { prefs_set_data_from_toggle, prefs_set_toggle}, {"recipients_autoreg", &p_send.checkbtn_recipients_autoreg, prefs_set_data_from_toggle, prefs_set_toggle}, + {"show_send_dialog", &p_send.checkbtn_show_send_dialog, + prefs_set_data_from_toggle, prefs_set_toggle}, {"encoding_method", &p_send.optmenu_encoding_method, prefs_set_data_from_optmenu, prefs_set_optmenu}, @@ -942,6 +945,8 @@ static void prefs_send_create(void) GtkWidget *checkbtn_savemsg; GtkWidget *checkbtn_filter_sent; GtkWidget *checkbtn_recipients_autoreg; + GtkWidget *vbox3; + GtkWidget *checkbtn_show_send_dialog; GtkWidget *label; GtkWidget *checkbtn_check_attach; GtkWidget *entry_check_attach_str; @@ -980,6 +985,9 @@ static void prefs_send_create(void) PACK_CHECK_BUTTON (vbox2, checkbtn_recipients_autoreg, _("Automatically add recipients to address book")); + PACK_CHECK_BUTTON (vbox2, checkbtn_show_send_dialog, + _("Display send dialog")); + vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW); gtk_widget_show (vbox2); gtk_box_pack_start (GTK_BOX (vbox_tab), vbox2, FALSE, FALSE, 0); @@ -1092,6 +1100,7 @@ static void prefs_send_create(void) p_send.checkbtn_savemsg = checkbtn_savemsg; p_send.checkbtn_filter_sent = checkbtn_filter_sent; p_send.checkbtn_recipients_autoreg = checkbtn_recipients_autoreg; + p_send.checkbtn_show_send_dialog = checkbtn_show_send_dialog; p_send.optmenu_encoding_method = optmenu_trencoding; p_send.optmenu_mime_fencoding_method = optmenu_fencoding; diff --git a/src/send_message.c b/src/send_message.c index cd65935e..b7abd141 100644 --- a/src/send_message.c +++ b/src/send_message.c @@ -1,6 +1,6 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2009 Hiroyuki Yamamoto + * Copyright (C) 1999-2010 Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -70,6 +70,7 @@ struct _SendProgressDialog { ProgressDialog *dialog; Session *session; + gboolean show_dialog; gboolean cancelled; }; @@ -753,9 +754,11 @@ static gint send_message_smtp(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp) if (session_connect_full(session, ac_prefs->smtp_server, port, socks_info) < 0) { - manage_window_focus_in(dialog->dialog->window, NULL, NULL); + if (dialog->show_dialog) + manage_window_focus_in(dialog->dialog->window, NULL, NULL); send_put_error(session); - manage_window_focus_out(dialog->dialog->window, NULL, NULL); + if (dialog->show_dialog) + manage_window_focus_out(dialog->dialog->window, NULL, NULL); session_destroy(session); send_progress_dialog_destroy(dialog); inc_unlock(); @@ -797,9 +800,11 @@ static gint send_message_smtp(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp) ret = -1; if (ret == -1) { - manage_window_focus_in(dialog->dialog->window, NULL, NULL); + if (dialog->show_dialog) + manage_window_focus_in(dialog->dialog->window, NULL, NULL); send_put_error(session); - manage_window_focus_out(dialog->dialog->window, NULL, NULL); + if (dialog->show_dialog) + manage_window_focus_out(dialog->dialog->window, NULL, NULL); } session_destroy(session); @@ -828,12 +833,14 @@ static gint send_recv_message(Session *session, const gchar *msg, gpointer data) case SMTP_HELO: g_snprintf(buf, sizeof(buf), _("Sending HELO...")); state_str = _("Authenticating"); - statusbar_print_all(_("Sending message...")); + statusbar_print_all(_("Sending message via %s:%d..."), + session->server, session->port); break; case SMTP_EHLO: g_snprintf(buf, sizeof(buf), _("Sending EHLO...")); state_str = _("Authenticating"); - statusbar_print_all(_("Sending message...")); + statusbar_print_all(_("Sending message via %s:%d..."), + session->server, session->port); break; case SMTP_AUTH: g_snprintf(buf, sizeof(buf), _("Authenticating...")); @@ -933,7 +940,10 @@ static SendProgressDialog *send_progress_dialog_create(void) progress_dialog_set_value(progress, 0.0); - gtk_widget_show_now(progress->window); + if (prefs_common.show_send_dialog) { + dialog->show_dialog = TRUE; + gtk_widget_show_now(progress->window); + } dialog->dialog = progress; |