[sync with 0.8.2cvs15]
authorPaul Mangan <paul@claws-mail.org>
Fri, 13 Sep 2002 07:57:51 +0000 (07:57 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 13 Sep 2002 07:57:51 +0000 (07:57 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/compose.c

index 5895477..14b4cc2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-09-11
+
+       * src/compose.c: account_activated(): change the state of menu items
+         and entries according to the selected account.
+         compose_select_account(): new. It changes the state of title bar,
+         menu items and entries.
+
 2002-09-11
 
        * src/inc.c: inc_mail(): correct new_msgs when inc_spool() returned
index 0860de1..8d47c18 100644 (file)
@@ -1,3 +1,10 @@
+2002-09-13 [paul]      0.8.2claws45
+
+       * src/compose.c
+               merge claws' select_account() with main's
+               (new) compose_select_account(). [sync with
+               0.8.2cvs15, see ChangeLog 2002-09-11]
+
 2002-09-12 [christoph] 0.8.2claws44
 
        * src/filter.c
index e33bfd1..edbc740 100644 (file)
@@ -1,3 +1,10 @@
+2002-09-11
+
+       * src/compose.c: account_activated(): ÁªÂò¤µ¤ì¤¿¥¢¥«¥¦¥ó¥È¤Ë±þ¤¸¤Æ
+         ¥á¥Ë¥å¡¼¹àÌܤȥ¨¥ó¥È¥ê¤Î¾õÂÖ¤òÊѹ¹¡£
+         compose_select_account(): ¿·µ¬¡£¥¿¥¤¥È¥ë¥Ð¡¼¡¢¥á¥Ë¥å¡¼¹àÌÜ¡¢
+         ¥¨¥ó¥È¥ê¤Î¾õÂÖ¤òÊѹ¹¤¹¤ë¡£
+
 2002-09-11
 
        * src/inc.c: inc_mail(): inc_spool() ¤¬¥¨¥é¡¼¤Çµ¢¤Ã¤¿¤È¤­¤Î
index d7c6bd9..61d03a0 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws44
+EXTRA_VERSION=claws45
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 10c16d1..ff31fb3 100644 (file)
@@ -208,6 +208,8 @@ static void compose_wrap_line_all           (Compose        *compose);
 static void compose_wrap_line_all_full         (Compose        *compose,
                                                 gboolean        autowrap);
 static void compose_set_title                  (Compose        *compose);
+static void compose_select_account             (Compose        *compose,
+                                                PrefsAccount   *account);
 
 static PrefsAccount *compose_current_mail_account(void);
 /* static gint compose_send                    (Compose        *compose); */
@@ -308,9 +310,6 @@ static void toolbar_linewrap_cb             (GtkWidget      *widget,
 static void toolbar_address_cb         (GtkWidget      *widget,
                                         gpointer        data);
 
-static void select_account             (Compose        *compose,
-                                        PrefsAccount   *ac);
-
 static void account_activated          (GtkMenuItem    *menuitem,
                                         gpointer        data);
 
@@ -2686,6 +2685,96 @@ compose_current_mail_account(void)
        return ac;
 }
 
+static void compose_select_account(Compose *compose, PrefsAccount *account)
+{
+       GtkWidget *menuitem;
+       GtkItemFactory *ifactory;
+
+       g_return_if_fail(account != NULL);
+
+       compose->account = account;
+
+       compose_set_title(compose);
+
+       ifactory = gtk_item_factory_from_widget(compose->menubar);
+#if 0
+       if (account->protocol == A_NNTP) {
+               gtk_widget_show(compose->newsgroups_hbox);
+               gtk_widget_show(compose->newsgroups_entry);
+               gtk_table_set_row_spacing(GTK_TABLE(compose->table), 2, 4);
+
+               menuitem = gtk_item_factory_get_item(ifactory, "/View/To");
+               gtk_check_menu_item_set_active
+                       (GTK_CHECK_MENU_ITEM(menuitem), FALSE);
+               gtk_widget_set_sensitive(menuitem, TRUE);
+               menuitem = gtk_item_factory_get_item(ifactory, "/View/Cc");
+               gtk_check_menu_item_set_active
+                       (GTK_CHECK_MENU_ITEM(menuitem), FALSE);
+               gtk_widget_set_sensitive(menuitem, TRUE);
+
+               menu_set_sensitive(ifactory, "/View/Followup to", TRUE);
+       } else {
+               gtk_widget_hide(compose->newsgroups_hbox);
+               gtk_widget_hide(compose->newsgroups_entry);
+               gtk_table_set_row_spacing(GTK_TABLE(compose->table), 2, 0);
+               gtk_widget_queue_resize(compose->table_vbox);
+
+               menuitem = gtk_item_factory_get_item(ifactory, "/View/To");
+               gtk_check_menu_item_set_active
+                       (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
+               gtk_widget_set_sensitive(menuitem, FALSE);
+               menuitem = gtk_item_factory_get_item(ifactory, "/View/Cc");
+               gtk_check_menu_item_set_active
+                       (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
+               gtk_widget_set_sensitive(menuitem, FALSE);
+
+               menuitem = gtk_item_factory_get_item(ifactory, "/View/Followup to");
+               gtk_check_menu_item_set_active
+                       (GTK_CHECK_MENU_ITEM(menuitem), FALSE);
+               gtk_widget_set_sensitive(menuitem, FALSE);
+       }
+
+       if (account->set_autocc && account->auto_cc &&
+           compose->mode != COMPOSE_REEDIT) {
+               gtk_entry_set_text
+                       (GTK_ENTRY(compose->cc_entry), account->auto_cc);
+               menuitem = gtk_item_factory_get_item(ifactory, "/View/Cc");
+               gtk_check_menu_item_set_active
+                       (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
+       }
+       if (account->set_autobcc) {
+               menuitem = gtk_item_factory_get_item(ifactory, "/View/Bcc");
+               gtk_check_menu_item_set_active
+                       (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
+               if (account->auto_bcc && compose->mode != COMPOSE_REEDIT)
+                       gtk_entry_set_text(GTK_ENTRY(compose->bcc_entry),
+                                          account->auto_bcc);
+       }
+       if (account->set_autoreplyto) {
+               menuitem = gtk_item_factory_get_item(ifactory,
+                                                    "/View/Reply to");
+               gtk_check_menu_item_set_active
+                       (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
+               if (account->auto_replyto && compose->mode != COMPOSE_REEDIT)
+                       gtk_entry_set_text(GTK_ENTRY(compose->reply_entry),
+                                          account->auto_replyto);
+       }
+
+       menuitem = gtk_item_factory_get_item(ifactory, "/View/Ruler");
+       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
+                                      prefs_common.show_ruler);
+#endif
+
+#if USE_GPGME
+       menuitem = gtk_item_factory_get_item(ifactory, "/Message/Sign");
+       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
+                                      account->default_sign);
+       menuitem = gtk_item_factory_get_item(ifactory, "/Message/Encrypt");
+       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
+                                      account->default_encrypt);
+#endif /* USE_GPGME */
+}
+
 gboolean compose_check_for_valid_recipient(Compose *compose) {
        gchar *recipient_headers_mail[] = {"To:", "Cc:", "Bcc:", NULL};
        gchar *recipient_headers_news[] = {"Newsgroups:", NULL};
@@ -4461,7 +4550,6 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
        gboolean success[1];
        GdkFont   *font;
        GtkWidget *popupmenu;
-       GtkWidget *menuitem;
        GtkItemFactory *popupfactory;
        GtkItemFactory *ifactory;
        GtkWidget *tmpl_menu;
@@ -4712,7 +4800,6 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
                gtk_widget_hide(newsgroups_hbox);
                gtk_widget_hide(newsgroups_entry);
                gtk_table_set_row_spacing(GTK_TABLE(table), 2, 0);
-               menu_set_sensitive(ifactory, "/View/Followup to", FALSE);
        }
 #endif
 
@@ -4723,8 +4810,6 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
        undo_set_change_state_func(undostruct, &compose_undo_state_changed,
                                   menubar);
 
-       gtk_widget_show(window);
-
        address_completion_start(window);
 
        compose->window        = window;
@@ -4814,113 +4899,33 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
         }
 #endif
 
-       compose_set_title(compose);
-
-#if 0 /* NEW COMPOSE GUI */
-       compose->use_bcc        = FALSE;
-       compose->use_replyto    = FALSE;
-       compose->use_followupto = FALSE;
-#endif
+       compose_select_account(compose, account);
 
 #if USE_ASPELL
         compose->gtkaspell      = gtkaspell;
 #endif
 
-#if 0 /* NEW COMPOSE GUI */
-       if (account->protocol != A_NNTP) {
-               menuitem = gtk_item_factory_get_item(ifactory, "/View/To");
-               gtk_check_menu_item_set_active
-                       (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
-               gtk_widget_set_sensitive(menuitem, FALSE);
-               menuitem = gtk_item_factory_get_item(ifactory, "/View/Cc");
-               gtk_check_menu_item_set_active
-                       (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
-               gtk_widget_set_sensitive(menuitem, FALSE);
-       }
-#endif
-       if (account->set_autocc && account->auto_cc && mode != COMPOSE_REEDIT) {
+       if (account->set_autocc && account->auto_cc && mode != COMPOSE_REEDIT)
                compose_entry_append(compose, account->auto_cc, COMPOSE_CC);
-#if 0 /* NEW COMPOSE GUI */
-               compose->use_cc = TRUE;
-               gtk_entry_set_text(GTK_ENTRY(cc_entry), account->auto_cc);
-               menuitem = gtk_item_factory_get_item(ifactory, "/View/Cc");
-               gtk_check_menu_item_set_active
-                       (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
-#endif
-       }
-       if (account->set_autobcc) {
+
+       if (account->set_autobcc) 
                compose_entry_append(compose, account->auto_bcc, COMPOSE_BCC);
-#if 0 /* NEW COMPOSE GUI */
-               menuitem = gtk_item_factory_get_item(ifactory, "/View/Bcc");
-               gtk_check_menu_item_set_active
-                       (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
-               if (account->auto_bcc && mode != COMPOSE_REEDIT)
-                       gtk_entry_set_text(GTK_ENTRY(bcc_entry),
-                                          account->auto_bcc);
-#endif
-       }
-       if (account->set_autoreplyto && account->auto_replyto && mode != COMPOSE_REEDIT) {
+       
+       if (account->set_autoreplyto && account->auto_replyto && mode != COMPOSE_REEDIT)
                compose_entry_append(compose, account->auto_replyto, COMPOSE_REPLYTO);
-#if 0 /* NEW COMPOSE GUI */
-               compose->use_replyto = TRUE;
-               menuitem = gtk_item_factory_get_item(ifactory,
-                                                    "/View/Reply to");
-               gtk_check_menu_item_set_active
-                       (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
-               gtk_entry_set_text(GTK_ENTRY(reply_entry),
-                                  account->auto_replyto);
-#endif
-       }
 
-       if (account->protocol != A_NNTP) {
+
+       if (account->protocol != A_NNTP)
                gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(compose->header_last->combo)->entry), prefs_common.trans_hdr ? _("To:") : "To:");
-       } else {
+       else
                gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(compose->header_last->combo)->entry), prefs_common.trans_hdr ? _("Newsgroups:") : "Newsgroups:");
-       }
-
-#if 0 /* NEW COMPOSE GUI */
-       menuitem = gtk_item_factory_get_item(ifactory, "/View/Ruler");
-       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
-                                      prefs_common.show_ruler);
-#endif                                
-
-#if USE_GPGME
-       menuitem = gtk_item_factory_get_item(ifactory, "/Message/Sign");
-       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
-                                      account->default_sign);
-       menuitem = gtk_item_factory_get_item(ifactory, "/Message/Encrypt");
-       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
-                                      account->default_encrypt);
-#endif /* USE_GPGME */
 
        addressbook_set_target_compose(compose);
+       update_compose_actions_menu(ifactory, "/Tools/Actions", compose);
        compose_set_template_menu(compose);
 
        compose_list = g_list_append(compose_list, compose);
 
-#if 0 /* NEW COMPOSE GUI */
-       compose->use_to         = FALSE;
-       compose->use_cc         = FALSE;
-       compose->use_attach     = TRUE;
-#endif
-
-#if 0 /* NEW COMPOSE GUI */
-       if (!compose->use_bcc) {
-               gtk_widget_hide(bcc_hbox);
-               gtk_widget_hide(bcc_entry);
-               gtk_table_set_row_spacing(GTK_TABLE(table), 4, 0);
-       }
-       if (!compose->use_replyto) {
-               gtk_widget_hide(reply_hbox);
-               gtk_widget_hide(reply_entry);
-               gtk_table_set_row_spacing(GTK_TABLE(table), 5, 0);
-       }
-       if (!compose->use_followupto) {
-               gtk_widget_hide(followup_hbox);
-               gtk_widget_hide(followup_entry);
-               gtk_table_set_row_spacing(GTK_TABLE(table), 6, 0);
-       }
-#endif
        if (!prefs_common.show_ruler)
                gtk_widget_hide(ruler_hbox);
 
@@ -4928,9 +4933,10 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
        compose->priority = PRIORITY_NORMAL;
        compose_update_priority_menu_item(compose);
 
-       select_account(compose, account);
        set_toolbar_style(compose);
 
+       gtk_widget_show(window);
+       
        return compose;
 }
 
@@ -5997,112 +6003,6 @@ static void toolbar_address_cb(GtkWidget *widget, gpointer data)
        compose_address_cb(data, 0, NULL);
 }
 
-static void select_account(Compose * compose, PrefsAccount * ac)
-{
-#if USE_GPGME
-       GtkItemFactory *ifactory;
-       GtkWidget *menuitem;
-#endif /* USE_GPGME */
-       compose->account = ac;
-       compose_set_title(compose);
-
-#if 0 /* NEW COMPOSE GUI */
-               if (ac->protocol == A_NNTP) {
-                       GtkItemFactory *ifactory;
-                       GtkWidget *menuitem;
-
-                       ifactory = gtk_item_factory_from_widget(compose->menubar);
-                       menu_set_sensitive(ifactory,
-                                          "/Message/Followup to", TRUE);
-                       gtk_widget_show(compose->newsgroups_hbox);
-                       gtk_widget_show(compose->newsgroups_entry);
-                       gtk_table_set_row_spacing(GTK_TABLE(compose->table),
-                                                 1, 4);
-
-                       compose->use_to = FALSE;
-                       compose->use_cc = FALSE;
-
-                       menuitem = gtk_item_factory_get_item(ifactory, "/Message/To");
-                       gtk_check_menu_item_set_active
-                               (GTK_CHECK_MENU_ITEM(menuitem), FALSE);
-
-                       menu_set_sensitive(ifactory,
-                                          "/Message/To", TRUE);
-                       menuitem = gtk_item_factory_get_item(ifactory, "/Message/Cc");
-                       gtk_check_menu_item_set_active
-                               (GTK_CHECK_MENU_ITEM(menuitem), FALSE);
-
-                       gtk_widget_hide(compose->to_hbox);
-                       gtk_widget_hide(compose->to_entry);
-                       gtk_widget_hide(compose->cc_hbox);
-                       gtk_widget_hide(compose->cc_entry);
-                       gtk_table_set_row_spacing(GTK_TABLE(compose->table),
-                                                 0, 0);
-                       gtk_table_set_row_spacing(GTK_TABLE(compose->table),
-                                                 3, 0);
-               }
-               else {
-                       GtkItemFactory *ifactory;
-                       GtkWidget *menuitem;
-
-                       ifactory = gtk_item_factory_from_widget(compose->menubar);
-                       menu_set_sensitive(ifactory,
-                                          "/Message/Followup to", FALSE);
-                       gtk_entry_set_text(GTK_ENTRY(compose->newsgroups_entry), "");
-                       gtk_widget_hide(compose->newsgroups_hbox);
-                       gtk_widget_hide(compose->newsgroups_entry);
-                       gtk_table_set_row_spacing(GTK_TABLE(compose->table),
-                                                 1, 0);
-
-                       compose->use_to = TRUE;
-                       compose->use_cc = TRUE;
-
-                       menuitem = gtk_item_factory_get_item(ifactory, "/Message/To");
-                       gtk_check_menu_item_set_active
-                               (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
-                       menu_set_sensitive(ifactory,
-                                          "/Message/To", FALSE);
-                       menuitem = gtk_item_factory_get_item(ifactory, "/Message/Cc");
-                       gtk_check_menu_item_set_active
-                               (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
-                       gtk_widget_show(compose->to_hbox);
-                       gtk_widget_show(compose->to_entry);
-                       gtk_widget_show(compose->cc_hbox);
-                       gtk_widget_show(compose->cc_entry);
-
-                       gtk_table_set_row_spacing(GTK_TABLE(compose->table),
-                                                 0, 4);
-                       gtk_table_set_row_spacing(GTK_TABLE(compose->table),
-                                                 3, 4);
-               }
-               gtk_widget_queue_resize(compose->table_vbox);
-#endif
-#if USE_GPGME
-               ifactory = gtk_item_factory_from_widget(compose->menubar);
-                       menu_set_sensitive(ifactory,
-                                          "/Message/Sign", TRUE);
-                       menu_set_sensitive(ifactory,
-                                          "/Message/Encrypt", TRUE);
-
-                       menuitem = gtk_item_factory_get_item(ifactory, "/Message/Sign");
-               if (ac->default_sign)
-                       gtk_check_menu_item_set_active
-                               (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
-               else
-                       gtk_check_menu_item_set_active
-                               (GTK_CHECK_MENU_ITEM(menuitem), FALSE);
-
-                       menuitem = gtk_item_factory_get_item(ifactory, "/Message/Encrypt");
-               if (ac->default_encrypt)
-                       gtk_check_menu_item_set_active
-                               (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
-               else
-                       gtk_check_menu_item_set_active
-                               (GTK_CHECK_MENU_ITEM(menuitem), FALSE);
-#endif /* USE_GPGME */
-
-}
-
 static void account_activated(GtkMenuItem *menuitem, gpointer data)
 {
        Compose *compose = (Compose *)data;
@@ -6113,7 +6013,7 @@ static void account_activated(GtkMenuItem *menuitem, gpointer data)
        g_return_if_fail(ac != NULL);
 
        if (ac != compose->account)
-               select_account(compose, ac);
+               compose_select_account(compose, ac);
 }
 
 static void attach_selected(GtkCList *clist, gint row, gint column,