aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-02-09 06:32:13 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-02-09 06:32:13 +0800
commit9fecb732dee690a2ddf43f9e7bf41ae6a7f91f52 (patch)
tree946d872c3456f6f8992556ab79a9a3010f5a1aa2 /mail/folder-browser.c
parenta61a6cab2068b39afd97c29ad544b8bc008b1453 (diff)
downloadgsoc2013-evolution-9fecb732dee690a2ddf43f9e7bf41ae6a7f91f52.tar.gz
gsoc2013-evolution-9fecb732dee690a2ddf43f9e7bf41ae6a7f91f52.tar.zst
gsoc2013-evolution-9fecb732dee690a2ddf43f9e7bf41ae6a7f91f52.zip
Base class for a message tag editor.
2002-02-08 Jeffrey Stedfast <fejj@ximian.com> * message-tag-editor.[c,h]: Base class for a message tag editor. * folder-browser.c (on_right_click): Setup the hide/enable masks for "Flag for Follow-up" * mail-callbacks.c (confirm_expunge): Instead of hiding deleted messages and then expunging, disable the use of the message-list completely during the expunge operation. (expunged_folder): Re-enable the use of the message-list widget here. svn path=/trunk/; revision=15626
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r--mail/folder-browser.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index 92ada2f612..a2ca2b2a0b 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -1431,7 +1431,9 @@ enum {
IS_MAILING_LIST = 1<<6,
CAN_RESEND = 1<<7,
CAN_MARK_IMPORTANT = 1<<8,
- CAN_MARK_UNIMPORTANT = 1<<9
+ CAN_MARK_UNIMPORTANT = 1<<9,
+ CAN_FLAG_FOR_FOLLOWUP = 1<<10,
+ CAN_FLAG_COMPLETED = 1<<11
};
#define MLIST_VFOLDER (3)
@@ -1466,7 +1468,15 @@ static EPopupMenu context_menu[] = {
{ N_("Reply to _List"), NULL, GTK_SIGNAL_FUNC (reply_to_list), NULL, 0 },
{ N_("Reply to _All"), NULL, GTK_SIGNAL_FUNC (reply_to_all), NULL, 0 },
{ N_("_Forward"), NULL, GTK_SIGNAL_FUNC (forward), NULL, 0 },
- { "", NULL, (NULL), NULL, 0 },
+
+ E_POPUP_SEPARATOR,
+
+ { N_("Flag for Follow-up"), NULL, GTK_SIGNAL_FUNC (flag_for_followup),NULL, CAN_FLAG_FOR_FOLLOWUP },
+ { N_("Flag Completed"), NULL, GTK_SIGNAL_FUNC (flag_completed), NULL, CAN_FLAG_COMPLETED },
+ { N_("Clear Flag"), NULL, GTK_SIGNAL_FUNC (flag_clear), NULL, CAN_FLAG_COMPLETED },
+
+ /* separator here? */
+
{ N_("Mar_k as Read"), NULL, GTK_SIGNAL_FUNC (mark_as_seen), NULL, CAN_MARK_READ },
{ N_("Mark as U_nread"), NULL, GTK_SIGNAL_FUNC (mark_as_unseen), NULL, CAN_MARK_UNREAD },
{ N_("Mark as _Important"), NULL, GTK_SIGNAL_FUNC (mark_as_important), NULL, CAN_MARK_IMPORTANT },
@@ -1511,6 +1521,12 @@ context_menu_position_func (GtkMenu *menu, gint *x, gint *y,
*y += ty + th / 2;
}
+static gboolean
+followup_tag_complete (const char *tag)
+{
+ return FALSE;
+}
+
/* handle context menu over message-list */
static int
on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, FolderBrowser *fb)
@@ -1561,6 +1577,10 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event
gboolean have_unseen = FALSE;
gboolean have_important = FALSE;
gboolean have_unimportant = FALSE;
+ gboolean have_flag_for_followup = FALSE;
+ gboolean have_flag_completed = FALSE;
+ gboolean have_unflagged = FALSE;
+ const char *tag;
for (i = 0; i < uids->len; i++) {
info = camel_folder_get_message_info (fb->folder, uids->pdata[i]);
@@ -1582,6 +1602,13 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event
else
have_unimportant = TRUE;
+ if ((tag = camel_tag_get (&info->user_tags, "follow-up"))) {
+ have_flag_for_followup = TRUE;
+ if (followup_tag_complete (tag))
+ have_flag_completed = TRUE;
+ } else
+ have_unflagged = TRUE;
+
camel_folder_free_message_info (fb->folder, info);
if (have_seen && have_unseen && have_deleted && have_undeleted)
@@ -1603,6 +1630,11 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event
if (!have_important)
enable_mask |= CAN_MARK_UNIMPORTANT;
+ if (!have_unflagged)
+ enable_mask |= CAN_FLAG_FOR_FOLLOWUP;
+ if (!(have_flag_for_followup && have_flag_completed))
+ enable_mask |= CAN_FLAG_COMPLETED;
+
/*
* Hide items that wont get used.
*/
@@ -1626,6 +1658,11 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event
else
hide_mask |= CAN_MARK_UNIMPORTANT;
}
+
+ if (!have_unflagged)
+ enable_mask |= CAN_FLAG_FOR_FOLLOWUP;
+ if (!(have_flag_for_followup && have_flag_completed))
+ enable_mask |= CAN_FLAG_COMPLETED;
}
/* free uids */