#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;
static GdkBitmap *forwardedxpmmask;
static GdkPixmap *ignorethreadxpm;
static GdkBitmap *ignorethreadxpmmask;
+static GdkPixmap *lockedxpm;
+static GdkBitmap *lockedxpmmask;
static GdkPixmap *clipxpm;
static GdkBitmap *clipxpmmask;
/* message handling */
static void summary_mark_row (SummaryView *summaryview,
GtkCTreeNode *row);
+static void summary_lock_row (SummaryView *summaryview,
+ GtkCTreeNode *row);
static void summary_mark_row_as_read (SummaryView *summaryview,
GtkCTreeNode *row);
static void summary_mark_row_as_unread (SummaryView *summaryview,
N_("Date"), /* S_COL_DATE */
N_("Size"), /* S_COL_SIZE */
N_("No."), /* S_COL_NUMBER */
- N_("Score") /* S_COL_SCORE */
+ N_("Score"), /* S_COL_SCORE */
+ N_("L") /* S_COL_LOCKED */
};
SummaryView *summary_create(void)
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);
for (; node != NULL; node = GTK_CTREE_NODE_PREV(node)) {
msginfo = gtk_ctree_node_get_row_data(ctree, node);
- if (!MSG_IS_DELETED(msginfo->flags)) break;
+ if (!MSG_IS_DELETED(msginfo->flags))
+ break;
}
return node;
for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
msginfo = gtk_ctree_node_get_row_data(ctree, node);
- if (!MSG_IS_DELETED(msginfo->flags)) break;
+ if (!MSG_IS_DELETED(msginfo->flags))
+ break;
}
return node;
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);
debug_print(_("Message %d is marked\n"), msginfo->msgnum);
}
+static void summary_lock_row(SummaryView *summaryview, GtkCTreeNode *row)
+{
+ /* almost verbatim summary_mark_row(); may want a menu action? */
+ gboolean changed = FALSE;
+ GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+ MsgInfo *msginfo;
+
+ msginfo = gtk_ctree_node_get_row_data(ctree, row);
+ if (MSG_IS_DELETED(msginfo->flags))
+ summaryview->deleted--;
+ if (MSG_IS_MOVE(msginfo->flags)) {
+ summaryview->moved--;
+ changed = TRUE;
+ }
+ if (MSG_IS_COPY(msginfo->flags)) {
+ summaryview->copied--;
+ changed = TRUE;
+ }
+ if (changed && !prefs_common.immediate_exec) {
+ msginfo->to_folder->op_count--;
+ if (msginfo->to_folder->op_count == 0)
+ folderview_update_item(msginfo->to_folder, 0);
+ }
+ msginfo->to_folder = NULL;
+ MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_DELETED);
+ MSG_UNSET_TMP_FLAGS(msginfo->flags, MSG_MOVE | MSG_COPY);
+ MSG_SET_PERM_FLAGS(msginfo->flags, MSG_LOCKED);
+ CHANGE_FLAGS(msginfo);
+ summary_set_row_marks(summaryview, row);
+ debug_print(_("Message %d is locked\n"), msginfo->msgnum);
+}
+
void summary_mark(SummaryView *summaryview)
{
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
msginfo = gtk_ctree_node_get_row_data(ctree, row);
+ if (MSG_IS_LOCKED(msginfo->flags)) return;
+
if (MSG_IS_DELETED(msginfo->flags)) return;
if (MSG_IS_MOVE(msginfo->flags)) {
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],
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],
summary_status_show(summaryview);
}
break;
+ case S_COL_LOCKED:
+ if (MSG_IS_LOCKED(msginfo->flags)) {
+ MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_LOCKED);
+ CHANGE_FLAGS(msginfo);
+ summary_set_row_marks(summaryview, row);
+ }
+ else
+ summary_lock_row(summaryview, row);
+ break;
default:
break;
}