2005-10-26 [colin] 1.9.15cvs111
[claws.git] / src / mainwindow.c
index 4e0ae96e3ecbcc063622ea8582f1542a0442fe32..2901cf161f75b82848cfaaceb7b528c0d420d72b 100644 (file)
@@ -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.
  */
 
 #include "defs.h"
@@ -464,6 +464,7 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_File/_Print..."),                "<control>P", print_cb, 0, NULL},
        {N_("/_File/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_File/_Work offline"),            "<control>W", toggle_work_offline_cb, 0, "<ToggleItem>"},
+       {N_("/_File/Synchronise folders"),      "<control><shift>S", sync_cb, 0, NULL},
        {N_("/_File/---"),                      NULL, NULL, 0, "<Separator>"},
        /* {N_("/_File/_Close"),                "<alt>W", app_exit_cb, 0, NULL}, */
        {N_("/_File/E_xit"),                    "<control>Q", app_exit_cb, 0, NULL},
@@ -574,6 +575,8 @@ static GtkItemFactoryEntry mainwin_entries[] =
         ENC_ACTION(C_ISO_8859_1)},
        {N_("/_View/Character _encoding/Western European (ISO-8859-15)"),
         ENC_ACTION(C_ISO_8859_15)},
+       {N_("/_View/Character _encoding/Western European (Windows-1252)"),
+        ENC_ACTION(C_WINDOWS_1252)},
        ENC_SEPARATOR,
 
        {N_("/_View/Character _encoding/Central European (ISO-8859-_2)"),
@@ -679,7 +682,6 @@ static GtkItemFactoryEntry mainwin_entries[] =
                                                NULL, inc_cancel_cb, 0, NULL},
        {N_("/_Message/Recei_ve/---"),          NULL, NULL, 0, "<Separator>"},
        {N_("/_Message/_Send queued messages"), NULL, send_queue_cb, 0, NULL},
-       {N_("/_Message/Synchronise folders"),   "<control><shift>S", sync_cb, 0, NULL},
        {N_("/_Message/---"),                   NULL, NULL, 0, "<Separator>"},
        {N_("/_Message/Compose a_n email message"),     "<control>M", compose_mail_cb, 0, NULL},
        {N_("/_Message/Compose a news message"),        NULL,   compose_news_cb, 0, NULL},
@@ -691,7 +693,8 @@ static GtkItemFactoryEntry mainwin_entries[] =
                                                "<control>L", main_window_reply_cb, COMPOSE_REPLY_TO_LIST, NULL},
        {N_("/_Message/Follow-up and reply to"),NULL, main_window_reply_cb, COMPOSE_FOLLOWUP_AND_REPLY_TO, NULL},
        {N_("/_Message/---"),                   NULL, NULL, 0, "<Separator>"},
-       {N_("/_Message/_Forward"),              "<control><alt>F", main_window_reply_cb, COMPOSE_FORWARD, NULL},
+       {N_("/_Message/_Forward"),              "<control><alt>F", main_window_reply_cb, COMPOSE_FORWARD_INLINE, NULL},
+       {N_("/_Message/For_ward as attachment"),        NULL, main_window_reply_cb, COMPOSE_FORWARD_AS_ATTACH, NULL},
        {N_("/_Message/Redirect"),              NULL, main_window_reply_cb, COMPOSE_REDIRECT, NULL},
        {N_("/_Message/---"),                   NULL, NULL, 0, "<Separator>"},
        {N_("/_Message/M_ove..."),              "<control>O", move_to_cb, 0, NULL},
@@ -960,7 +963,6 @@ MainWindow *main_window_create(SeparateType type)
        ac_button = gtk_button_new();
        gtk_tooltips_set_tip(GTK_TOOLTIPS(sel_ac_tip),
                             ac_button, _("Select account"), NULL);
-       gtk_button_set_relief(GTK_BUTTON(ac_button), GTK_RELIEF_NONE);
        GTK_WIDGET_UNSET_FLAGS(ac_button, GTK_CAN_FOCUS);
        gtk_widget_set_size_request(ac_button, -1, 0);
        gtk_box_pack_end(GTK_BOX(hbox_stat), ac_button, FALSE, FALSE, 0);
@@ -1112,8 +1114,8 @@ MainWindow *main_window_create(SeparateType type)
        menu_connect_identical_items();
 
 
-       
-       /* show main window */
+       gtk_window_iconify(mainwin->window);
+
        gtk_widget_show(mainwin->window);
 
        /* initialize views */
@@ -1699,7 +1701,7 @@ void main_window_add_mailbox(MainWindow *mainwin)
 
        folder_add(folder);
        folder_set_ui_func(folder, scan_tree_func, mainwin);
-       folder_scan_tree(folder);
+       folder_scan_tree(folder, TRUE);
        folder_set_ui_func(folder, NULL, NULL);
 }
 
@@ -1762,8 +1764,10 @@ SensitiveCond main_window_get_current_state(MainWindow *mainwin)
        if (inc_is_active())
                state |= M_INC_ACTIVE;
 
-       if (mainwin->summaryview->deleted > 0)
-               state |= M_DELAYED_FLAGS;
+       if (mainwin->summaryview->deleted > 0 ||
+           mainwin->summaryview->moved > 0 ||
+           mainwin->summaryview->copied > 0)
+               state |= M_DELAY_EXEC;
 
        return state;
 }
@@ -1786,17 +1790,8 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                gchar *const entry;
                SensitiveCond cond;
        } entry[] = {
-               {"/File/Add mailbox"                          , M_UNLOCKED},
-
-                {"/File/Add mailbox/MH..."                   , M_UNLOCKED},
-               {"/File/Change folder order"                  , M_UNLOCKED},
-               {"/File/Export to mbox file..."               , M_UNLOCKED},
-               {"/File/Empty all Trash folders"              , M_UNLOCKED},
-               {"/File/Work offline"                         , M_UNLOCKED},
-
-               {"/File/Save as...", M_TARGET_EXIST|M_UNLOCKED},
-               {"/File/Print..."  , M_TARGET_EXIST|M_UNLOCKED},
-               /* {"/File/Close"  , M_UNLOCKED}, */
+               {"/File/Save as...", M_TARGET_EXIST},
+               {"/File/Print..."  , M_TARGET_EXIST},
                {"/File/Exit"      , M_UNLOCKED},
 
                {"/Edit/Select thread"             , M_SINGLE_TARGET_EXIST},
@@ -1830,29 +1825,28 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                {"/Message/Reply to"              , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
                {"/Message/Follow-up and reply to", M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST|M_NEWS},
                {"/Message/Forward"               , M_HAVE_ACCOUNT|M_TARGET_EXIST},
+               {"/Message/Forward as attachment" , M_HAVE_ACCOUNT|M_TARGET_EXIST},
                {"/Message/Redirect"              , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
-               {"/Message/Move..."               , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED},
-               {"/Message/Copy..."               , M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
-               {"/Message/Move to trash"         , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED|M_NOT_NEWS},
-               {"/Message/Delete..."             , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED|M_NOT_NEWS},
-               {"/Message/Cancel a news message" , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED|M_NEWS},
+               {"/Message/Move..."               , M_TARGET_EXIST|M_ALLOW_DELETE},
+               {"/Message/Copy..."               , M_TARGET_EXIST|M_EXEC},
+               {"/Message/Move to trash"         , M_TARGET_EXIST|M_ALLOW_DELETE|M_NOT_NEWS},
+               {"/Message/Delete..."             , M_TARGET_EXIST|M_ALLOW_DELETE},
+               {"/Message/Cancel a news message" , M_TARGET_EXIST|M_ALLOW_DELETE|M_NEWS},
                {"/Message/Mark"                  , M_TARGET_EXIST},
                {"/Message/Re-edit"               , M_HAVE_ACCOUNT|M_ALLOW_REEDIT},
 
                {"/Tools/Add sender to address book"   , M_SINGLE_TARGET_EXIST},
-               {"/Tools/Harvest addresses"            , M_UNLOCKED},
                {"/Tools/Harvest addresses/from Folder..."       
-                                                      , M_UNLOCKED|M_MSG_EXIST},
+                                                      , M_MSG_EXIST},
                {"/Tools/Harvest addresses/from Messages..."
-                                                      , M_UNLOCKED|M_MSG_EXIST|M_TARGET_EXIST},
-               {"/Tools/Harvest addresses"            , M_UNLOCKED},
-               {"/Tools/Filter all messages in folder", M_MSG_EXIST|M_EXEC|M_UNLOCKED},
-               {"/Tools/Filter selected messages"     , M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
+                                                      , M_MSG_EXIST|M_TARGET_EXIST},
+               {"/Tools/Filter all messages in folder", M_MSG_EXIST|M_EXEC},
+               {"/Tools/Filter selected messages"     , M_TARGET_EXIST|M_EXEC},
                {"/Tools/Create filter rule"           , M_SINGLE_TARGET_EXIST|M_UNLOCKED},
-               {"/Tools/Actions"                      , M_TARGET_EXIST|M_UNLOCKED},
+               {"/Tools/Create processing rule"       , M_SINGLE_TARGET_EXIST|M_UNLOCKED},
+               {"/Tools/Actions"                      , M_TARGET_EXIST},
                {"/Tools/Execute"                      , M_DELAY_EXEC},
-               {"/Tools/Execute"                      , M_DELAYED_FLAGS},
-               {"/Tools/Delete duplicated messages/In selected folder"   , M_MSG_EXIST|M_ALLOW_DELETE|M_UNLOCKED},
+               {"/Tools/Delete duplicated messages/In selected folder"   , M_MSG_EXIST|M_ALLOW_DELETE},
 
                {"/Configuration", M_UNLOCKED},
 
@@ -2054,7 +2048,7 @@ static void main_window_set_widgets(MainWindow *mainwin, SeparateType type)
                
                folderwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
                gtk_window_set_title(GTK_WINDOW(folderwin),
-                                    _("Sylpheed - Folder View"));
+                                    _("Sylpheed-Claws - Folder View"));
 
                gtk_window_move(GTK_WINDOW(folderwin),
                                prefs_common.folderwin_x,
@@ -2090,7 +2084,7 @@ static void main_window_set_widgets(MainWindow *mainwin, SeparateType type)
                
                messagewin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
                gtk_window_set_title(GTK_WINDOW(messagewin),
-                                    _("Sylpheed - Message View"));
+                                    _("Sylpheed-Claws - Message View"));
                                     
                gtk_window_move(GTK_WINDOW(messagewin), 
                                prefs_common.main_msgwin_x,
@@ -2481,7 +2475,7 @@ static void print_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
 static void app_exit_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
 {
        if (prefs_common.confirm_on_exit) {
-               if (alertpanel(_("Exit"), _("Exit this program?"),
+               if (alertpanel(_("Exit"), _("Exit Sylpheed-Claws?"),
                               GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL)
                    != G_ALERTDEFAULT)
                        return;
@@ -3137,7 +3131,6 @@ static void account_selector_menu_cb(GtkMenuItem *menuitem, gpointer data)
        toolbar_update(TOOLBAR_MAIN, mainwindow_get_mainwindow());
        main_window_set_menu_sensitive(mainwindow_get_mainwindow());
        toolbar_main_set_sensitive(mainwindow_get_mainwindow());
-       gtk_button_set_relief(GTK_BUTTON(mainwindow_get_mainwindow()->ac_button), GTK_RELIEF_NONE);
        item = folderview_get_selected_item(
                        mainwindow_get_mainwindow()->folderview);
        if (item) {