2006-02-01 [paul] 2.0.0cvs4
[claws.git] / src / prefs_send.c
index e46ed7439bcf21299a45b495663fc91fc99a41e5..92fb786fa7396925d90cfb43b26d1a845b852fa1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2005 Colin Leroy <colin@colino.net> & The Sylpheed-Claws Team
+ * Copyright (C) 2005-2006 Colin Leroy <colin@colino.net> & The Sylpheed-Claws Team
  *
  * 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
@@ -14,7 +14,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -47,6 +47,7 @@ typedef struct _SendPage
        GtkWidget *window;
 
        GtkWidget *checkbtn_savemsg;
+       GtkWidget *checkbtn_confirm_send_queued_messages;
        GtkWidget *optmenu_senddialog;
        GtkWidget *optmenu_charset;
        GtkWidget *optmenu_encoding_method;
@@ -114,7 +115,6 @@ void prefs_send_create_widget(PrefsPage *_page, GtkWindow *window,
        
        GtkWidget *vbox1;
        GtkWidget *vbox2;
-       GtkWidget *hbox1;
        GtkWidget *checkbtn_savemsg;
        GtkWidget *label_outcharset;
        GtkWidget *optmenu_charset;
@@ -127,7 +127,8 @@ void prefs_send_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *label_senddialog;
        GtkWidget *menu;
        GtkWidget *optmenu_senddialog;
-       GtkWidget *hbox_senddialog;
+       GtkWidget *checkbtn_confirm_send_queued_messages;
+       GtkWidget *table;
 
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
@@ -138,43 +139,57 @@ void prefs_send_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
 
        PACK_CHECK_BUTTON (vbox2, checkbtn_savemsg,
-                          _("Save sent messages to Sent folder"));
+                       _("Save sent messages to Sent folder"));
 
-       hbox_senddialog = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show(hbox_senddialog);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox_senddialog, FALSE, FALSE, 0);
+       PACK_CHECK_BUTTON (vbox2, checkbtn_confirm_send_queued_messages,
+                       _("Confirm before sending queued messages"));
+
+       table = gtk_table_new(3, 2, FALSE);
+       gtk_widget_show(table);
+       gtk_container_add (GTK_CONTAINER (vbox1), table);
+       gtk_table_set_row_spacings(GTK_TABLE(table), 4);
+       gtk_table_set_col_spacings(GTK_TABLE(table), 8);
 
        label_senddialog = gtk_label_new (_("Show send dialog"));
        gtk_widget_show (label_senddialog);
-       gtk_box_pack_start (GTK_BOX (hbox_senddialog), label_senddialog, FALSE, FALSE, 0);
+       gtk_table_attach(GTK_TABLE(table), label_senddialog, 0, 1, 0, 1,
+                       (GtkAttachOptions) (GTK_FILL),
+                       (GtkAttachOptions) (0), 0, 0);
+       gtk_label_set_justify(GTK_LABEL(label_senddialog), GTK_JUSTIFY_RIGHT);
+       gtk_misc_set_alignment(GTK_MISC(label_senddialog), 1, 0.5);
 
+       /* FIXME : Is it good to change this menu into a checkbtn ? */
        optmenu_senddialog = gtk_option_menu_new ();
        gtk_widget_show (optmenu_senddialog);
-       gtk_box_pack_start (GTK_BOX (hbox_senddialog), optmenu_senddialog, FALSE, FALSE, 0);
-       
+       gtk_table_attach(GTK_TABLE(table), optmenu_senddialog, 1, 2, 0, 1,
+                       (GtkAttachOptions) (GTK_FILL),
+                       (GtkAttachOptions) (0), 0, 0);
+
        menu = gtk_menu_new ();
        MENUITEM_ADD (menu, menuitem, _("Always"), SEND_DIALOG_ALWAYS);
        MENUITEM_ADD (menu, menuitem, _("Never"), SEND_DIALOG_NEVER);
 
        gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_senddialog), menu);
 
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
-
        label_outcharset = gtk_label_new (_("Outgoing encoding"));
        gtk_widget_show (label_outcharset);
-       gtk_box_pack_start (GTK_BOX (hbox1), label_outcharset, FALSE, FALSE, 0);
+       gtk_table_attach(GTK_TABLE(table), label_outcharset, 0, 1, 1, 2,
+                       (GtkAttachOptions) (GTK_FILL),
+                       (GtkAttachOptions) (0), 0, 0);
+       gtk_label_set_justify(GTK_LABEL(label_outcharset), GTK_JUSTIFY_RIGHT);
+       gtk_misc_set_alignment(GTK_MISC(label_outcharset), 1, 0.5);
 
        charset_tooltip = gtk_tooltips_new();
 
        optmenu_charset = gtk_option_menu_new ();
        gtk_widget_show (optmenu_charset);
        gtk_tooltips_set_tip(GTK_TOOLTIPS(charset_tooltip), optmenu_charset,
-                            _("If `Automatic' is selected, the optimal encoding"
+                            _("If 'Automatic' is selected, the optimal encoding"
                               " for the current locale will be used"),
                             NULL);
-       gtk_box_pack_start (GTK_BOX (hbox1), optmenu_charset, FALSE, FALSE, 0);
+       gtk_table_attach(GTK_TABLE(table), optmenu_charset, 1, 2, 1, 2,
+                       (GtkAttachOptions) (GTK_FILL),
+                       (GtkAttachOptions) (0), 0, 0);
 
        optmenu_menu = gtk_menu_new ();
 
@@ -186,7 +201,6 @@ void prefs_send_create_widget(PrefsPage *_page, GtkWindow *window,
        SET_MENUITEM(_("Automatic (Recommended)"),       CS_AUTO);
        SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("7bit ascii (US-ASCII)"),         CS_US_ASCII);
-       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Unicode (UTF-8)"),               CS_UTF_8);
        SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Western European (ISO-8859-1)"),  CS_ISO_8859_1);
@@ -202,6 +216,9 @@ void prefs_send_create_widget(PrefsPage *_page, GtkWindow *window,
        SET_MENUITEM(_("Hebrew (ISO-8859-8)"),           CS_ISO_8859_8);
        SET_MENUITEM(_("Hebrew (Windows-1255)"),         CS_WINDOWS_1255);
        SET_MENUITEM(NULL, NULL);
+       SET_MENUITEM(_("Arabic (ISO-8859-6)"),           CS_ISO_8859_6);
+       SET_MENUITEM(_("Arabic (Windows-1256)"),         CS_WINDOWS_1256);
+       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Turkish (ISO-8859-9)"),          CS_ISO_8859_9);
        SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Cyrillic (ISO-8859-5)"),         CS_ISO_8859_5);
@@ -231,17 +248,13 @@ void prefs_send_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_charset),
                                  optmenu_menu);
 
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
-
        label_encoding = gtk_label_new (_("Transfer encoding"));
        gtk_widget_show (label_encoding);
-       gtk_box_pack_start (GTK_BOX (hbox1), label_encoding, FALSE, FALSE, 0);
+       gtk_table_attach(GTK_TABLE(table), label_encoding, 0, 1, 2, 3,
+                       (GtkAttachOptions) (GTK_FILL),
+                       (GtkAttachOptions) (0), 0, 0);
+       gtk_label_set_justify(GTK_LABEL(label_encoding), GTK_JUSTIFY_RIGHT);
+       gtk_misc_set_alignment(GTK_MISC(label_encoding), 1, 0.5);
 
        encoding_tooltip = gtk_tooltips_new();
 
@@ -251,7 +264,9 @@ void prefs_send_create_widget(PrefsPage *_page, GtkWindow *window,
                             _("Specify Content-Transfer-Encoding used when"
                               " message body contains non-ASCII characters"),
                             NULL);
-       gtk_box_pack_start (GTK_BOX (hbox1), optmenu_encoding, FALSE, FALSE, 0);
+       gtk_table_attach(GTK_TABLE(table), optmenu_encoding, 1, 2, 2, 3,
+                       (GtkAttachOptions) (GTK_FILL),
+                       (GtkAttachOptions) (0), 0, 0);
 
        optmenu_menu = gtk_menu_new ();
 
@@ -263,12 +278,10 @@ void prefs_send_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_encoding),
                                  optmenu_menu);
 
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
-
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_savemsg),
                prefs_common.savemsg);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_confirm_send_queued_messages),
+               prefs_common.confirm_send_queued_messages);
        gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu_senddialog),
                prefs_common.send_dialog_mode);
        prefs_common_charset_set_optmenu(optmenu_charset, 
@@ -279,6 +292,7 @@ void prefs_send_create_widget(PrefsPage *_page, GtkWindow *window,
        prefs_send->window                      = GTK_WIDGET(window);
        
        prefs_send->checkbtn_savemsg = checkbtn_savemsg;
+       prefs_send->checkbtn_confirm_send_queued_messages = checkbtn_confirm_send_queued_messages;
        prefs_send->optmenu_senddialog = optmenu_senddialog;
        prefs_send->optmenu_charset = optmenu_charset;
        prefs_send->optmenu_encoding_method = optmenu_encoding;
@@ -294,6 +308,8 @@ void prefs_send_save(PrefsPage *_page)
 
        prefs_common.savemsg = gtk_toggle_button_get_active(
                GTK_TOGGLE_BUTTON(page->checkbtn_savemsg));
+       prefs_common.confirm_send_queued_messages = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_confirm_send_queued_messages));
 
        menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(page->optmenu_senddialog));
        menuitem = gtk_menu_get_active(GTK_MENU(menu));