sync with 0.7.6cvs24
authorPaul Mangan <paul@claws-mail.org>
Wed, 5 Jun 2002 06:25:18 +0000 (06:25 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 5 Jun 2002 06:25:18 +0000 (06:25 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/compose.c
src/mainwindow.c
src/summaryview.c
src/summaryview.h

index f8858fc..b11374b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2002-06-04
+
+       * src/compose.c: compose_reply(), compose_forward(): reverted the
+         last change since it causes lockup problem.
+
+2002-06-04
+
+       * src/compose.c: compose_reply(), compose_forward(): don't autowrap
+         the signature part.
+         compose_new_with_recipient(): workaround for initial XIM problem.
+
+2002-06-04
+
+       * src/mainwindow.c: sort ascending / descending order can be
+         specified with separated menu items.
+         Added "View/Sort/Don't sort" menu item.
+       * src/summaryview.[ch]: summary_sort(): added an argument for
+         sort type.
+
 2002-05-31
 
        * implemented persistent sort order.
index 25098a3..b0e1a12 100644 (file)
@@ -1,3 +1,8 @@
+2002-06-05 [paul]      0.7.6claws30
+
+       * sync with 0.7.6cvs24
+               see ChangeLog 2002-06-04
+
 2002-06-04 [paul]      0.7.6claws29
 
        * po/pt_BR.po
index b6dc001..d37a224 100644 (file)
@@ -1,3 +1,21 @@
+2002-06-04
+
+       * src/compose.c: compose_reply(), compose_forward(): lockup ¤òµ¯¤³¤¹
+         ¤Î¤ÇľÁ°¤ÎÊѹ¹¤ò¸µ¤ËÌᤷ¤¿¡£
+
+2002-06-04
+
+       * src/compose.c: compose_reply(), compose_forward(): ½ð̾Éôʬ¤ò
+         ¼«Æ°²þ¹Ô¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
+         compose_new_with_recipient(): µ¯Æ°Ä¾¸å¤Î XIM ¤ÎÌäÂê¤ò²óÈò¡£
+
+2002-06-04
+
+       * src/mainwindow.c: ¥½¡¼¥È¤Î¾º½ç / ¹ß½ç¤òÊ̤Υá¥Ë¥å¡¼¹àÌܤ«¤é»ØÄê
+         ¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿¡£
+         ¡Öɽ¼¨/¥½¡¼¥È/¥½¡¼¥È¤·¤Ê¤¤¡×¥á¥Ë¥å¡¼¹àÌܤòÄɲá£
+       * src/summaryview.[ch]: summary_sort(): ¥½¡¼¥È¥¿¥¤¥×¤Î°ú¿ô¤òÄɲá£
+
 2002-05-31
 
        * ±Ê³Ū¤Ê¥½¡¼¥È½ç¤ò¼ÂÁõ¡£
index 8ef6f0b..d3eac33 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws29
+EXTRA_VERSION=claws30
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index cc3b6f8..2366e2d 100644 (file)
@@ -734,6 +734,7 @@ Compose *compose_new_with_folderitem(PrefsAccount *account, FolderItem *item)
 Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderItem *item)
 {
        Compose *compose;
+       GtkSText *text;
 
        if (item && item->prefs && item->prefs->enable_default_account)
                account = account_find_from_id(item->prefs->default_account);
@@ -744,10 +745,19 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
        compose = compose_create(account, COMPOSE_NEW);
        compose->replyinfo = NULL;
 
+       text = GTK_STEXT(compose->text);
+       gtk_stext_freeze(text);
+
        if (prefs_common.auto_sig)
                compose_insert_sig(compose);
-       gtk_editable_set_position(GTK_EDITABLE(compose->text), 0);
-       gtk_stext_set_point(GTK_STEXT(compose->text), 0);
+       gtk_editable_set_position(GTK_EDITABLE(text), 0);
+       gtk_stext_set_point(text, 0);
+
+       gtk_stext_thaw(text);
+
+       /* workaround for initial XIM problem */
+       gtk_widget_grab_focus(compose->text);
+       gtkut_widget_wait_for_draw(compose->text);
 
        if (account->protocol != A_NNTP) {
                if (mailto) {
index 473b4b1..877c4af 100644 (file)
@@ -362,6 +362,9 @@ static void set_display_item_cb      (MainWindow    *mainwin,
 static void sort_summary_cb     (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
+static void sort_summary_type_cb (MainWindow   *mainwin,
+                                 guint          action,
+                                 GtkWidget     *widget);
 static void attract_by_subject_cb(MainWindow   *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
@@ -538,17 +541,21 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_View/Ex_pand Message View"),     "<shift>V", toggle_expand_messageview_cb, 0, "<ToggleItem>"},
        {N_("/_View/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_View/_Sort"),                    NULL, NULL, 0, "<Branch>"},
-       {N_("/_View/_Sort/by _number"),         NULL, sort_summary_cb, SORT_BY_NUMBER, NULL},
-       {N_("/_View/_Sort/by s_ize"),           NULL, sort_summary_cb, SORT_BY_SIZE, NULL},
-       {N_("/_View/_Sort/by _date"),           NULL, sort_summary_cb, SORT_BY_DATE, NULL},
-       {N_("/_View/_Sort/by _from"),           NULL, sort_summary_cb, SORT_BY_FROM, NULL},
-       {N_("/_View/_Sort/by _subject"),        NULL, sort_summary_cb, SORT_BY_SUBJECT, NULL},
+       {N_("/_View/_Sort/by _number"),         NULL, sort_summary_cb, SORT_BY_NUMBER, "<RadioItem>"},
+       {N_("/_View/_Sort/by s_ize"),           NULL, sort_summary_cb, SORT_BY_SIZE, "/View/Sort/by number"},
+       {N_("/_View/_Sort/by _date"),           NULL, sort_summary_cb, SORT_BY_DATE, "/View/Sort/by number"},
+       {N_("/_View/_Sort/by _from"),           NULL, sort_summary_cb, SORT_BY_FROM, "/View/Sort/by number"},
+       {N_("/_View/_Sort/by _subject"),        NULL, sort_summary_cb, SORT_BY_SUBJECT, "/View/Sort/by number"},
        {N_("/_View/_Sort/by _color label"),
-                                               NULL, sort_summary_cb, SORT_BY_LABEL, NULL},
-       {N_("/_View/_Sort/by _mark"),           NULL, sort_summary_cb, SORT_BY_MARK, NULL},
-       {N_("/_View/_Sort/by _unread"),         NULL, sort_summary_cb, SORT_BY_UNREAD, NULL},
+                                               NULL, sort_summary_cb, SORT_BY_LABEL, "/View/Sort/by number"},
+       {N_("/_View/_Sort/by _mark"),           NULL, sort_summary_cb, SORT_BY_MARK, "/View/Sort/by number"},
+       {N_("/_View/_Sort/by _unread"),         NULL, sort_summary_cb, SORT_BY_UNREAD, "/View/Sort/by number"},
        {N_("/_View/_Sort/by a_ttachment"),
-                                               NULL, sort_summary_cb, SORT_BY_MIME, NULL},
+                                               NULL, sort_summary_cb, SORT_BY_MIME, "/View/Sort/by number"},
+       {N_("/_View/_Sort/D_on't sort"),        NULL, sort_summary_cb, SORT_BY_NONE, "/View/Sort/by number"},
+       {N_("/_View/_Sort/---"),                NULL, NULL, 0, "<Separator>"},
+       {N_("/_View/_Sort/Ascending"),          NULL, sort_summary_type_cb, SORT_ASCENDING, "<RadioItem>"},
+       {N_("/_View/_Sort/Descending"),         NULL, sort_summary_type_cb, SORT_DESCENDING, "/View/Sort/Ascending"},
        {N_("/_View/_Sort/---"),                NULL, NULL, 0, "<Separator>"},
        {N_("/_View/_Sort/_Attract by subject"),
                                                NULL, attract_by_subject_cb, 0, NULL},
@@ -866,6 +873,7 @@ MainWindow *main_window_create(SeparateType type)
                                 n_menu_entries, "<Main>", mainwin);
        gtk_widget_show(menubar);
        gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, TRUE, 0);
+       ifactory = gtk_item_factory_from_widget(menubar);
 
        handlebox = gtk_handle_box_new();
        gtk_widget_show(handlebox);
@@ -1623,6 +1631,8 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
        SensitiveCond state;
        gboolean sensitive;
        GtkWidget *menuitem;
+       FolderItem *item;
+       gchar *menu_path;
        gint i;
 
        static const struct {
@@ -1699,13 +1709,62 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
        }
 
        main_window_menu_callback_block(mainwin);
-       menuitem = gtk_item_factory_get_widget(ifactory, "/View/Show all header");
-       gtk_check_menu_item_set_active
-               (GTK_CHECK_MENU_ITEM(menuitem),
-                mainwin->messageview->textview->show_all_headers);
-       menuitem = gtk_item_factory_get_widget(ifactory, "/View/Thread view");
-       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
-                                      (state & M_THREADED) != 0);
+
+#define SET_CHECK_MENU_ACTIVE(path, active) \
+{ \
+       menuitem = gtk_item_factory_get_widget(ifactory, path); \
+       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), active); \
+}
+
+       item = mainwin->summaryview->folder_item;
+       menu_path = "/View/Sort/Don't sort";
+       if (item) {
+               switch (item->sort_key) {
+               case SORT_BY_NUMBER:
+                       menu_path = "/View/Sort/by number"; break;
+               case SORT_BY_SIZE:
+                       menu_path = "/View/Sort/by size"; break;
+               case SORT_BY_DATE:
+                       menu_path = "/View/Sort/by date"; break;
+               case SORT_BY_FROM:
+                       menu_path = "/View/Sort/by from"; break;
+               case SORT_BY_SUBJECT:
+                       menu_path = "/View/Sort/by subject"; break;
+               case SORT_BY_LABEL:
+                       menu_path = "/View/Sort/by color label"; break;
+               case SORT_BY_MARK:
+                       menu_path = "/View/Sort/by mark"; break;
+               case SORT_BY_UNREAD:
+                       menu_path = "/View/Sort/by unread"; break;
+               case SORT_BY_MIME:
+                       menu_path = "/View/Sort/by attachment"; break;
+               case SORT_BY_NONE:
+               default:
+                       menu_path = "/View/Sort/Don't sort"; break;
+               }
+       }
+       SET_CHECK_MENU_ACTIVE(menu_path, TRUE);
+
+       if (!item || item->sort_type == SORT_ASCENDING) {
+               SET_CHECK_MENU_ACTIVE("/View/Sort/Ascending", TRUE);
+       } else {
+               SET_CHECK_MENU_ACTIVE("/View/Sort/Descending", TRUE);
+       }
+
+       if (item && item->sort_key != SORT_BY_NONE) {
+               menu_set_sensitive(ifactory, "/View/Sort/Ascending", TRUE);
+               menu_set_sensitive(ifactory, "/View/Sort/Descending", TRUE);
+       } else {
+               menu_set_sensitive(ifactory, "/View/Sort/Ascending", FALSE);
+               menu_set_sensitive(ifactory, "/View/Sort/Descending", FALSE);
+       }
+
+       SET_CHECK_MENU_ACTIVE("/View/Show all header",
+                             mainwin->messageview->textview->show_all_headers);
+       SET_CHECK_MENU_ACTIVE("/View/Thread view", (state & M_THREADED) != 0);
+
+#undef SET_CHECK_MENU_ACTIVE
+
        main_window_menu_callback_unblock(mainwin);
 }
 
@@ -2993,7 +3052,30 @@ static void set_display_item_cb(MainWindow *mainwin, guint action,
 static void sort_summary_cb(MainWindow *mainwin, guint action,
                            GtkWidget *widget)
 {
-       summary_sort(mainwin->summaryview, (FolderSortKey)action);
+       FolderItem *item = mainwin->summaryview->folder_item;
+       GtkItemFactory *ifactory;
+       GtkWidget *menuitem;
+
+       if (mainwin->menu_lock_count) return;
+       if (item) {
+               ifactory = gtk_item_factory_from_widget(mainwin->menubar);
+               menuitem = gtk_item_factory_get_item
+                       (ifactory, "/View/Sort/Ascending");
+               summary_sort(mainwin->summaryview, (FolderSortKey)action,
+                            GTK_CHECK_MENU_ITEM(menuitem)->active
+                            ? SORT_ASCENDING : SORT_DESCENDING);
+       }
+}
+
+static void sort_summary_type_cb(MainWindow *mainwin, guint action,
+                                GtkWidget *widget)
+{
+       FolderItem *item = mainwin->summaryview->folder_item;
+
+       if (mainwin->menu_lock_count) return;
+       if (item)
+               summary_sort(mainwin->summaryview,
+                            item->sort_key, (FolderSortType)action);
 }
 
 static void attract_by_subject_cb(MainWindow *mainwin, guint action,
index 10bb6a3..05d174f 100644 (file)
@@ -869,13 +869,8 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
 
        g_slist_free(mlist);
 
-       if (item->sort_key != SORT_BY_NONE) {
-               if (item->sort_type == SORT_DESCENDING)
-                       item->sort_type = SORT_ASCENDING;
-               else
-                       item->sort_type = SORT_DESCENDING;
-               summary_sort(summaryview, item->sort_key);
-       }
+       if (item->sort_key != SORT_BY_NONE)
+               summary_sort(summaryview, item->sort_key, item->sort_type);
 
        summary_write_cache(summaryview);
 
@@ -1877,7 +1872,8 @@ static void summary_set_column_titles(SummaryView *summaryview)
        }
 }
 
-void summary_sort(SummaryView *summaryview, FolderSortKey sort_key)
+void summary_sort(SummaryView *summaryview,
+                 FolderSortKey sort_key, FolderSortType sort_type)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        GtkCList *clist = GTK_CLIST(summaryview->ctree);
@@ -1920,6 +1916,12 @@ void summary_sort(SummaryView *summaryview, FolderSortKey sort_key)
        case SORT_BY_LABEL:
                cmp_func = (GtkCListCompareFunc)summary_cmp_by_label;
                break;
+       case SORT_BY_NONE:
+               item->sort_key = sort_key;
+               item->sort_type = SORT_ASCENDING;
+               summary_set_column_titles(summaryview);
+               summary_set_menu_sensitive(summaryview);
+               return;
        default:
                return;
        }
@@ -1931,17 +1933,12 @@ void summary_sort(SummaryView *summaryview, FolderSortKey sort_key)
 
        gtk_clist_set_compare_func(clist, cmp_func);
 
-       /* toggle sort type if the same column is selected */
-       if (item->sort_key == sort_key)
-               item->sort_type =
-                       item->sort_type == SORT_ASCENDING
-                       ? SORT_DESCENDING : SORT_ASCENDING;
-       else
-               item->sort_type = SORT_ASCENDING;
-       gtk_clist_set_sort_type(clist, (GtkSortType)item->sort_type);
+       gtk_clist_set_sort_type(clist, (GtkSortType)sort_type);
        item->sort_key = sort_key;
+       item->sort_type = sort_type;
 
        summary_set_column_titles(summaryview);
+       summary_set_menu_sensitive(summaryview);
 
        gtk_ctree_sort_recursive(ctree, NULL);
 
@@ -4813,57 +4810,72 @@ static void summary_create_filter_cb(SummaryView *summaryview,
        summary_filter_open(summaryview, (PrefsFilterType)action);
 }
 
+static void summary_sort_by_column_click(SummaryView *summaryview,
+                                        FolderSortKey sort_key)
+{
+       FolderItem *item = summaryview->folder_item;
+
+       if (!item) return;
+
+       if (item->sort_key == sort_key)
+               summary_sort(summaryview, sort_key,
+                            item->sort_type == SORT_ASCENDING
+                            ? SORT_DESCENDING : SORT_ASCENDING);
+       else
+               summary_sort(summaryview, sort_key, SORT_ASCENDING);
+}
+
 static void summary_mark_clicked(GtkWidget *button, SummaryView *summaryview)
 {
-       summary_sort(summaryview, SORT_BY_MARK);
+       summary_sort_by_column_click(summaryview, SORT_BY_MARK);
 }
 
 static void summary_unread_clicked(GtkWidget *button, SummaryView *summaryview)
 {
-       summary_sort(summaryview, SORT_BY_UNREAD);
+       summary_sort_by_column_click(summaryview, SORT_BY_UNREAD);
 }
 
 static void summary_mime_clicked(GtkWidget *button, SummaryView *summaryview)
 {
-       summary_sort(summaryview, SORT_BY_MIME);
+       summary_sort_by_column_click(summaryview, SORT_BY_MIME);
 }
 
 static void summary_num_clicked(GtkWidget *button, SummaryView *summaryview)
 {
-       summary_sort(summaryview, SORT_BY_NUMBER);
+       summary_sort_by_column_click(summaryview, SORT_BY_NUMBER);
 }
 
-static void summary_score_clicked(GtkWidget *button,
-                                 SummaryView *summaryview)
+static void summary_size_clicked(GtkWidget *button, SummaryView *summaryview)
 {
-       summary_sort(summaryview, SORT_BY_SCORE);
+       summary_sort_by_column_click(summaryview, SORT_BY_SIZE);
 }
 
-static void summary_locked_clicked(GtkWidget *button,
-                                 SummaryView *summaryview)
+static void summary_date_clicked(GtkWidget *button, SummaryView *summaryview)
 {
-       summary_sort(summaryview, SORT_BY_LOCKED);
+       summary_sort_by_column_click(summaryview, SORT_BY_DATE);
 }
 
-static void summary_size_clicked(GtkWidget *button, SummaryView *summaryview)
+static void summary_from_clicked(GtkWidget *button, SummaryView *summaryview)
 {
-       summary_sort(summaryview, SORT_BY_SIZE);
+       summary_sort_by_column_click(summaryview, SORT_BY_FROM);
 }
 
-static void summary_date_clicked(GtkWidget *button, SummaryView *summaryview)
+static void summary_subject_clicked(GtkWidget *button,
+                                   SummaryView *summaryview)
 {
-       summary_sort(summaryview, SORT_BY_DATE);
+       summary_sort_by_column_click(summaryview, SORT_BY_SUBJECT);
 }
 
-static void summary_from_clicked(GtkWidget *button, SummaryView *summaryview)
+static void summary_score_clicked(GtkWidget *button,
+                                 SummaryView *summaryview)
 {
-       summary_sort(summaryview, SORT_BY_FROM);
+       summary_sort_by_column_click(summaryview, SORT_BY_SCORE);
 }
 
-static void summary_subject_clicked(GtkWidget *button,
-                                   SummaryView *summaryview)
+static void summary_locked_clicked(GtkWidget *button,
+                                  SummaryView *summaryview)
 {
-       summary_sort(summaryview, SORT_BY_SUBJECT);
+       summary_sort_by_column_click(summaryview, SORT_BY_LOCKED);
 }
 
 static void summary_start_drag(GtkWidget *widget, gint button, GdkEvent *event,
index 3cf1628..16610b7 100644 (file)
@@ -184,7 +184,8 @@ void summary_filter_open      (SummaryView          *summaryview,
                                   PrefsFilterType       type);
 
 void summary_sort                (SummaryView          *summaryview,
-                                  FolderSortKey         sort_key);
+                                  FolderSortKey         sort_key,
+                                  FolderSortType        sort_type);
 
 void summary_delete              (SummaryView          *summaryview);
 void summary_delete_duplicated   (SummaryView          *summaryview);