save and correctly display lock sort mode and type
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sat, 24 Nov 2001 00:18:16 +0000 (00:18 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sat, 24 Nov 2001 00:18:16 +0000 (00:18 +0000)
ChangeLog.claws
configure.in
src/summaryview.c
src/summaryview.h

index 00eef4f..31268f3 100644 (file)
@@ -1,3 +1,9 @@
+2001-11-24 [alfons]    0.6.5claws32
+
+       * src/summaryview.[ch]
+               make summary sort headers work, and also make
+               sure the sort type is stored
+
 2001-11-23 [alfons]    0.6.5claws31
 
        * src/summaryview.[ch]
index 7cdbbae..c75cdd7 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws31
+EXTRA_VERSION=claws32
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index 8dbdeec..008cadb 100644 (file)
@@ -327,6 +327,8 @@ static void summary_subject_clicked (GtkWidget              *button,
                                         SummaryView            *summaryview);
 static void summary_score_clicked      (GtkWidget              *button,
                                         SummaryView            *summaryview);
+static void summary_locked_clicked     (GtkWidget              *button,
+                                        SummaryView            *summaryview);
 
 static void summary_start_drag         (GtkWidget        *widget, 
                                         int button,
@@ -368,6 +370,8 @@ static gint summary_cmp_by_subject  (GtkCList               *clist,
 static gint summary_cmp_by_score       (GtkCList               *clist,
                                         gconstpointer           ptr1,
                                         gconstpointer           ptr2);
+static gint summary_cmp_by_locked      (GtkCList *clist,
+                                        gconstpointer ptr1, gconstpointer ptr2);
 static gint summary_cmp_by_label       (GtkCList               *clist,
                                         gconstpointer           ptr1,
                                         gconstpointer           ptr2);
@@ -1831,6 +1835,9 @@ void summary_sort(SummaryView *summaryview, SummarySortType type)
        case SORT_BY_SCORE:
                cmp_func = (GtkCListCompareFunc)summary_cmp_by_score;
                break;
+       case SORT_BY_LOCKED:
+               cmp_func = (GtkCListCompareFunc)summary_cmp_by_locked;
+               break;
        case SORT_BY_LABEL:
                cmp_func = (GtkCListCompareFunc)summary_cmp_by_label;
                break;
@@ -3904,6 +3911,7 @@ static GtkWidget *summary_ctree_create(SummaryView *summaryview)
        CLIST_BUTTON_SIGNAL_CONNECT(S_COL_FROM   , summary_from_clicked);
        CLIST_BUTTON_SIGNAL_CONNECT(S_COL_SUBJECT, summary_subject_clicked);
        CLIST_BUTTON_SIGNAL_CONNECT(S_COL_SCORE,   summary_score_clicked);
+       CLIST_BUTTON_SIGNAL_CONNECT(S_COL_LOCKED,  summary_locked_clicked);
 
 #undef CLIST_BUTTON_SIGNAL_CONNECT
 
@@ -4406,6 +4414,12 @@ static void summary_score_clicked(GtkWidget *button,
        summary_sort(summaryview, SORT_BY_SCORE);
 }
 
+static void summary_locked_clicked(GtkWidget *button,
+                                 SummaryView *summaryview)
+{
+       summary_sort(summaryview, SORT_BY_LOCKED);
+}
+
 static void summary_size_clicked(GtkWidget *button, SummaryView *summaryview)
 {
        summary_sort(summaryview, SORT_BY_SIZE);
@@ -4603,6 +4617,15 @@ static gint summary_cmp_by_score(GtkCList *clist,
                return summary_cmp_by_date(clist, ptr1, ptr2);
 }
 
+static gint summary_cmp_by_locked(GtkCList *clist,
+                                 gconstpointer ptr1, gconstpointer ptr2)
+{
+       MsgInfo *msginfo1 = ((GtkCListRow *)ptr1)->data;
+       MsgInfo *msginfo2 = ((GtkCListRow *)ptr2)->data;
+
+       return MSG_IS_LOCKED(msginfo1->flags) - MSG_IS_LOCKED(msginfo2->flags);
+}
+
 static void summary_ignore_thread_func(GtkCTree *ctree, GtkCTreeNode *row, gpointer data)
 {
        SummaryView *summaryview = (SummaryView *) data;
index b631493..cdf5862 100644 (file)
@@ -63,6 +63,7 @@ typedef enum
        SORT_BY_FROM,
        SORT_BY_SUBJECT,
        SORT_BY_SCORE,
+       SORT_BY_LOCKED,
        SORT_BY_LABEL,
        SORT_BY_MARK,
        SORT_BY_UNREAD,