diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-02-12 00:54:59 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-02-12 00:54:59 +0800 |
commit | af223e6f19084fcd08a613d1e88c0d31d5161266 (patch) | |
tree | 388d91a090008eca9c3fb4f44726c91beb820b7e /mail/folder-browser.c | |
parent | a541fc716262e7fc7f0f527fc8b268d22d202a43 (diff) | |
download | gsoc2013-evolution-af223e6f19084fcd08a613d1e88c0d31d5161266.tar.gz gsoc2013-evolution-af223e6f19084fcd08a613d1e88c0d31d5161266.tar.zst gsoc2013-evolution-af223e6f19084fcd08a613d1e88c0d31d5161266.zip |
Implemented. (on_right_click): Do better enabling/hiding of unwanted
2002-02-11 Jeffrey Stedfast <fejj@ximian.com>
* folder-browser.c (followup_tag_complete): Implemented.
(on_right_click): Do better enabling/hiding of unwanted
flag-for-followup options.
svn path=/trunk/; revision=15675
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r-- | mail/folder-browser.c | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c index d0d9887e7b..da955ff525 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -63,6 +63,7 @@ #include "mail-mt.h" #include "mail-folder-cache.h" #include "folder-browser-ui.h" +#include "message-tag-followup.h" #include "mail-local.h" #include "mail-config.h" @@ -1433,7 +1434,8 @@ enum { CAN_MARK_IMPORTANT = 1<<8, CAN_MARK_UNIMPORTANT = 1<<9, CAN_FLAG_FOR_FOLLOWUP = 1<<10, - CAN_FLAG_COMPLETED = 1<<11 + CAN_FLAG_COMPLETED = 1<<11, + CAN_CLEAR_FLAG = 1<<12 }; #define MLIST_VFOLDER (3) @@ -1473,7 +1475,7 @@ static EPopupMenu context_menu[] = { { 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_followup_completed), NULL, CAN_FLAG_COMPLETED }, - { N_("Clear Flag"), NULL, GTK_SIGNAL_FUNC (flag_followup_clear), NULL, CAN_FLAG_COMPLETED }, + { N_("Clear Flag"), NULL, GTK_SIGNAL_FUNC (flag_followup_clear), NULL, CAN_CLEAR_FLAG }, /* separator here? */ @@ -1522,9 +1524,16 @@ context_menu_position_func (GtkMenu *menu, gint *x, gint *y, } static gboolean -followup_tag_complete (const char *tag) +followup_tag_complete (const char *tag_value) { - return FALSE; + struct _FollowUpTag *tag; + gboolean ret; + + tag = message_tag_followup_decode (tag_value); + ret = tag->completed != (time_t) 0 ? TRUE : FALSE; + g_free (tag); + + return ret; } /* handle context menu over message-list */ @@ -1579,6 +1588,7 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event gboolean have_unimportant = FALSE; gboolean have_flag_for_followup = FALSE; gboolean have_flag_completed = FALSE; + gboolean have_flag_incomplete = FALSE; gboolean have_unflagged = FALSE; const char *tag; @@ -1606,6 +1616,8 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event have_flag_for_followup = TRUE; if (followup_tag_complete (tag)) have_flag_completed = TRUE; + else + have_flag_incomplete = TRUE; } else have_unflagged = TRUE; @@ -1630,39 +1642,43 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event if (!have_important) enable_mask |= CAN_MARK_UNIMPORTANT; + if (!have_flag_for_followup) + enable_mask |= CAN_CLEAR_FLAG; if (!have_unflagged) enable_mask |= CAN_FLAG_FOR_FOLLOWUP; - if (!(have_flag_for_followup && have_flag_completed)) + if (!have_flag_incomplete) enable_mask |= CAN_FLAG_COMPLETED; /* * Hide items that wont get used. */ - if (!(have_unseen && have_seen)){ + if (!(have_unseen && have_seen)) { if (have_seen) hide_mask |= CAN_MARK_READ; else hide_mask |= CAN_MARK_UNREAD; } - if (!(have_undeleted && have_deleted)){ + if (!(have_undeleted && have_deleted)) { if (have_deleted) hide_mask |= CAN_DELETE; else hide_mask |= CAN_UNDELETE; } - if (!(have_important && have_unimportant)){ + if (!(have_important && have_unimportant)) { if (have_important) hide_mask |= CAN_MARK_IMPORTANT; else hide_mask |= CAN_MARK_UNIMPORTANT; } + if (!have_flag_for_followup) + hide_mask |= CAN_CLEAR_FLAG; if (!have_unflagged) - enable_mask |= CAN_FLAG_FOR_FOLLOWUP; - if (!(have_flag_for_followup && have_flag_completed)) - enable_mask |= CAN_FLAG_COMPLETED; + hide_mask |= CAN_FLAG_FOR_FOLLOWUP; + if (!have_flag_incomplete) + hide_mask |= CAN_FLAG_COMPLETED; } /* free uids */ |