visual indicator locked ("keep"); not yet completed
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Mon, 19 Nov 2001 20:35:46 +0000 (20:35 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Mon, 19 Nov 2001 20:35:46 +0000 (20:35 +0000)
ChangeLog.claws
configure.in
src/Makefile.am
src/pixmaps/locked.xpm [new file with mode: 0644]
src/prefs_common.c
src/prefs_summary_column.c
src/procmsg.h
src/summaryview.c
src/summaryview.h

index b4ee71d..5ed35f6 100644 (file)
@@ -1,3 +1,16 @@
+2001-11-19 [alfons]    0.6.5claws22
+
+       more of my old things into claws
+
+       * src/Makefile.am
+       * src/prefs_common.c
+       * src/procmsg.h
+       * src/summaryview.[ch]
+       * src/prefs_summary_column.c
+       * src/pixmaps/locked.xpm
+               add indicators for locking of message in summary view
+               (does not work yet, only visual indicator)
+
 2001-11-19 [paul]      0.6.5claws21
 
        * sync with sylpheed 0.6.5cvs10
index 0e7e12b..cd0e82a 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws21
+EXTRA_VERSION=claws22
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index 4663fec..040289b 100644 (file)
@@ -184,7 +184,8 @@ EXTRA_DIST = \
        pixmaps/interface.xpm \
        pixmaps/jpilot.xpm \
        pixmaps/ldap.xpm \
-       pixmaps/vcard.xpm
+       pixmaps/vcard.xpm \
+       pixmaps/locked.xpm
 
 INCLUDES = \
        -DG_LOG_DOMAIN=\"Sylpheed\" \
diff --git a/src/pixmaps/locked.xpm b/src/pixmaps/locked.xpm
new file mode 100644 (file)
index 0000000..e036097
--- /dev/null
@@ -0,0 +1,48 @@
+/* XPM */
+static char * locked_xpm[] = {
+"9 10 35 1",
+"      c None",
+".     c #000000",
+"+     c #F3EFE0",
+"@     c #F4E5B3",
+"#     c #CDB86D",
+"$     c #F4F0E4",
+"%     c #F2E1A5",
+"&     c #EED680",
+"*     c #F9F9F9",
+"=     c #E5EAF1",
+"-     c #DCE3EB",
+";     c #DAE1E8",
+">     c #D7DEE6",
+",     c #D1D9E1",
+"'     c #8F99A2",
+")     c #E3EAF1",
+"!     c #B7C8DA",
+"~     c #8CA7C3",
+"{     c #87A2BE",
+"]     c #829DBA",
+"^     c #7D98B6",
+"/     c #465766",
+"(     c #E7EDF3",
+"_     c #B6C7D9",
+":     c #8AA5C1",
+"<     c #85A0BC",
+"[     c #809BB8",
+"}     c #7B96B4",
+"|     c #445462",
+"1     c #ECF1F5",
+"2     c #AEC0D4",
+"3     c #88A3BF",
+"4     c #839EBB",
+"5     c #7E99B6",
+"6     c #7994B2",
+"   ...   ",
+"  .+@#.  ",
+" .$.. #. ",
+" .%. .&. ",
+"..#...#..",
+".*=-;>,'.",
+".)!~{]^/.",
+".(_:<[}|.",
+".123456|.",
+"........."};
index 2d56f64..d9e0bfe 100644 (file)
@@ -463,6 +463,8 @@ static PrefParam param[] = {
         &prefs_common.summary_col_visible[S_COL_NUMBER], P_BOOL, NULL, NULL, NULL},
        {"summary_col_show_score", "FALSE",
         &prefs_common.summary_col_visible[S_COL_SCORE], P_BOOL, NULL, NULL, NULL},
+       {"summary_col_show_locked", "FALSE",
+        &prefs_common.summary_col_visible[S_COL_LOCKED], P_BOOL, NULL, NULL, NULL},
 
        {"summary_col_pos_mark", "0",
          &prefs_common.summary_col_pos[S_COL_MARK], P_INT, NULL, NULL, NULL},
@@ -482,6 +484,8 @@ static PrefParam param[] = {
          &prefs_common.summary_col_pos[S_COL_NUMBER], P_INT, NULL, NULL, NULL},
        {"summary_col_pos_score", "8",
         &prefs_common.summary_col_pos[S_COL_SCORE], P_INT, NULL, NULL, NULL},
+       {"summary_col_pos_locked", "9",
+        &prefs_common.summary_col_pos[S_COL_LOCKED], P_INT, NULL, NULL, NULL},
 
        {"summary_col_size_mark", "10",
         &prefs_common.summary_col_size[S_COL_MARK], P_INT, NULL, NULL, NULL},
@@ -501,6 +505,8 @@ static PrefParam param[] = {
         &prefs_common.summary_col_size[S_COL_NUMBER], P_INT, NULL, NULL, NULL},
        {"summary_col_size_score", "40",
         &prefs_common.summary_col_size[S_COL_SCORE], P_INT, NULL, NULL, NULL},
+       {"summary_col_size_locked", "13",
+        &prefs_common.summary_col_size[S_COL_LOCKED], P_INT, NULL, NULL, NULL},
 
        /* Widget size */
        {"folderview_width", "179", &prefs_common.folderview_width, P_INT,
index 3bb6a9a..9d5d23b 100644 (file)
@@ -72,7 +72,8 @@ static const gchar *const col_name[N_SUMMARY_COLS] = {
        N_("Date"),             /* S_COL_DATE    */
        N_("Size"),             /* S_COL_SIZE    */
        N_("Number"),           /* S_COL_NUMBER  */
-        N_("Score")            /* S_COL_SCORE   */
+        N_("Score"),           /* S_COL_SCORE   */
+       N_("Locked"),           /* S_COL_LOCKED  */
 };
 
 static SummaryColumnState default_state[N_SUMMARY_COLS] = {
@@ -84,7 +85,8 @@ static SummaryColumnState default_state[N_SUMMARY_COLS] = {
        { S_COL_DATE   , TRUE  },
        { S_COL_SIZE   , TRUE  },
        { S_COL_NUMBER , FALSE },
-        { S_COL_SCORE  , FALSE }
+        { S_COL_SCORE  , FALSE },
+       { S_COL_LOCKED , FALSE  },
 };
 
 static void prefs_summary_column_create        (void);
index 1df4648..7fb4014 100644 (file)
@@ -65,6 +65,7 @@ typedef enum
 #define MSG_CLABEL_BROWN       MSG_CLABEL_7
 
        MSG_IGNORE_THREAD   = 1 << 10,   /* ignore threads */
+       MSG_LOCKED          = 1 << 11,   /* msg is locked  */
 
        /* RESERVED */
        MSG_RESERVED_CLAWS  = 1 << 30,  /* for sylpheed-claws */
@@ -109,6 +110,7 @@ typedef enum
 #define MSG_IS_MARKED(msg)             (((msg).perm_flags & MSG_MARKED) != 0)
 #define MSG_IS_DELETED(msg)            (((msg).perm_flags & MSG_DELETED) != 0)
 #define MSG_IS_REPLIED(msg)            (((msg).perm_flags & MSG_REPLIED) != 0)
+#define MSG_IS_LOCKED(msg)             (((msg).perm_flags & MSG_LOCKED) != 0)
 #define MSG_IS_FORWARDED(msg)          (((msg).perm_flags & MSG_FORWARDED) != 0)
 
 #define MSG_GET_COLORLABEL(msg)                (((msg).perm_flags & MSG_CLABEL_FLAG_MASK))
index d5539e4..b84a73a 100644 (file)
@@ -89,6 +89,7 @@
 #include "pixmaps/forwarded.xpm"
 #include "pixmaps/clip.xpm"
 #include "pixmaps/ignorethread.xpm"
+#include "pixmaps/locked.xpm"
 
 #define STATUSBAR_PUSH(mainwin, str) \
 { \
 
 #define SUMMARY_COL_MARK_WIDTH         10
 #define SUMMARY_COL_UNREAD_WIDTH       13
+#define SUMMARY_COL_LOCKED_WIDTH       13
 #define SUMMARY_COL_MIME_WIDTH         10
 
 static GdkFont *boldfont;
@@ -135,6 +137,8 @@ static GdkPixmap *forwardedxpm;
 static GdkBitmap *forwardedxpmmask;
 static GdkPixmap *ignorethreadxpm;
 static GdkBitmap *ignorethreadxpmmask;
+static GdkPixmap *lockedxpm;
+static GdkBitmap *lockedxpmmask;
 
 static GdkPixmap *clipxpm;
 static GdkBitmap *clipxpmmask;
@@ -206,6 +210,8 @@ static void summary_mark_row_as_read        (SummaryView            *summaryview,
                                         GtkCTreeNode           *row);
 static void summary_mark_row_as_unread (SummaryView            *summaryview,
                                         GtkCTreeNode           *row);
+static void summary_mark_row_as_locked  (SummaryView *summaryview,
+                                        GtkCTreeNode *row);
 static void summary_delete_row         (SummaryView            *summaryview,
                                         GtkCTreeNode           *row);
 static void summary_unmark_row         (SummaryView            *summaryview,
@@ -399,6 +405,7 @@ static GtkItemFactoryEntry summary_popup_entries[] =
        {N_("/_Mark/---"),              NULL, NULL,             0, "<Separator>"},
        {N_("/_Mark/Mark as unr_ead"),  NULL, summary_mark_as_unread, 0, NULL},
        {N_("/_Mark/Mark as rea_d"),    NULL, summary_mark_as_read, 0, NULL},
+       {N_("/_Mark/Mark as _locked"),  NULL, summary_mark_as_locked, 0, NULL},
        {N_("/_Mark/Mark all read"),    NULL, summary_mark_all_read, 0, NULL},
        {N_("/_Mark/Ignore thread"),    NULL, summary_ignore_thread, 0, NULL},
        {N_("/_Mark/Unignore thread"),  NULL, summary_unignore_thread, 0, NULL},
@@ -535,6 +542,7 @@ void summary_init(SummaryView *summaryview)
                      forwarded_xpm);
        PIXMAP_CREATE(summaryview->ctree, ignorethreadxpm, ignorethreadxpmmask,
                      ignorethread_xpm);
+       PIXMAP_CREATE(summaryview->ctree, lockedxpm, lockedxpmmask, locked_xpm);                      
        PIXMAP_CREATE(summaryview->ctree, clipxpm, clipxpmmask, clip_xpm);
        PIXMAP_CREATE(summaryview->hbox, folderxpm, folderxpmmask,
                      dir_open_xpm);
@@ -993,6 +1001,7 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
 
        menu_set_sensitive(ifactory, "/Mark/Mark as unread", TRUE);
        menu_set_sensitive(ifactory, "/Mark/Mark as read",   TRUE);
+       menu_set_sensitive(ifactory, "/Mark/Mark as locked", TRUE);
        menu_set_sensitive(ifactory, "/Mark/Mark all read", TRUE);
        menu_set_sensitive(ifactory, "/Mark/Ignore thread",   TRUE);
        menu_set_sensitive(ifactory, "/Mark/Unignore thread", TRUE);
@@ -2491,6 +2500,14 @@ static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
                gtk_ctree_node_set_text(ctree, row, col_pos[S_COL_MARK], NULL);
        }
 
+       if (MSG_IS_LOCKED(flags)) {
+               gtk_ctree_node_set_pixmap(ctree, row, col_pos[S_COL_LOCKED],
+                                         lockedxpm, lockedxpmmask);
+       }
+       else {
+               gtk_ctree_node_set_text(ctree, row, col_pos[S_COL_LOCKED], NULL);
+       }
+
        if (MSG_IS_MIME(flags)) {
                gtk_ctree_node_set_pixmap(ctree, row, col_pos[S_COL_MIME],
                                          clipxpm, clipxpmmask);
@@ -2637,6 +2654,29 @@ static void summary_mark_row_as_unread(SummaryView *summaryview,
        summary_set_row_marks(summaryview, row);
 }
 
+static void summary_mark_row_as_locked(SummaryView *summaryview,
+                                      GtkCTreeNode *row)
+{
+       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+       MsgInfo *msginfo;
+
+       msginfo = gtk_ctree_node_get_row_data(ctree, row);
+       if (MSG_IS_DELETED(msginfo->flags)) {
+               msginfo->to_folder = NULL;
+               MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_DELETED);
+               summaryview->deleted--;
+       }
+       if (!MSG_IS_LOCKED(msginfo->flags)) {
+               MSG_SET_PERM_FLAGS(msginfo->flags, MSG_LOCKED);
+               debug_print(_("Message %d is marked as locked\n"),
+                           msginfo->msgnum);
+       }
+
+       CHANGE_FLAGS(msginfo);
+
+       summary_set_row_marks(summaryview, row);
+}
+
 void summary_mark_as_unread(SummaryView *summaryview)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
@@ -2649,6 +2689,18 @@ void summary_mark_as_unread(SummaryView *summaryview)
        summary_status_show(summaryview);
 }
 
+void summary_mark_as_locked(SummaryView *summaryview)
+{
+       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+       GList *cur;
+
+       for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next)
+               summary_mark_row_as_locked(summaryview,
+                                          GTK_CTREE_NODE(cur->data));
+
+       summary_status_show(summaryview);
+}
+
 static void summary_delete_row(SummaryView *summaryview, GtkCTreeNode *row)
 {
        gboolean changed = FALSE;
@@ -3787,6 +3839,8 @@ static GtkWidget *summary_ctree_create(SummaryView *summaryview)
                                           GTK_JUSTIFY_CENTER);
        gtk_clist_set_column_justification(GTK_CLIST(ctree), col_pos[S_COL_UNREAD],
                                           GTK_JUSTIFY_CENTER);
+       gtk_clist_set_column_justification(GTK_CLIST(ctree), col_pos[S_COL_LOCKED],
+                                          GTK_JUSTIFY_CENTER);
        gtk_clist_set_column_justification(GTK_CLIST(ctree), col_pos[S_COL_MIME],
                                           GTK_JUSTIFY_CENTER);
        gtk_clist_set_column_justification(GTK_CLIST(ctree), col_pos[S_COL_SIZE],
@@ -3799,6 +3853,8 @@ static GtkWidget *summary_ctree_create(SummaryView *summaryview)
                                   SUMMARY_COL_MARK_WIDTH);
        gtk_clist_set_column_width(GTK_CLIST(ctree), col_pos[S_COL_UNREAD],
                                   SUMMARY_COL_UNREAD_WIDTH);
+       gtk_clist_set_column_width(GTK_CLIST(ctree), col_pos[S_COL_LOCKED],
+                                  SUMMARY_COL_LOCKED_WIDTH);
        gtk_clist_set_column_width(GTK_CLIST(ctree), col_pos[S_COL_MIME],
                                   SUMMARY_COL_MIME_WIDTH);
        gtk_clist_set_column_width(GTK_CLIST(ctree), col_pos[S_COL_SUBJECT],
index 69e9dd4..630fbfd 100644 (file)
@@ -48,10 +48,11 @@ typedef enum
        S_COL_DATE,
        S_COL_SIZE,
        S_COL_NUMBER,
-       S_COL_SCORE
+       S_COL_SCORE,
+       S_COL_LOCKED
 } SummaryColumnType;
 
-#define N_SUMMARY_COLS 9
+#define N_SUMMARY_COLS 10
 
 typedef enum
 {
@@ -231,6 +232,7 @@ void summary_mark             (SummaryView          *summaryview);
 void summary_unmark              (SummaryView          *summaryview);
 void summary_mark_as_unread      (SummaryView          *summaryview);
 void summary_mark_as_read        (SummaryView          *summaryview);
+void summary_mark_as_locked      (SummaryView          *summaryview);
 void summary_mark_all_read       (SummaryView          *summaryview);
 void summary_add_address         (SummaryView          *summaryview);
 void summary_select_all                  (SummaryView          *summaryview);