diff options
author | 8 <NotZed@Ximian.com> | 2001-10-28 14:20:33 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2001-10-28 14:20:33 +0800 |
commit | 3a3fa91ac32ebbee54e7f335379564e587513dcb (patch) | |
tree | 42af838f84bb19eb4646dc4fa47812490a481a49 /filter/rule-context.c | |
parent | 2fb3703a51b3da5b833fe9a77b0bdc7778ef7876 (diff) | |
download | gsoc2013-evolution-3a3fa91ac32ebbee54e7f335379564e587513dcb.tar gsoc2013-evolution-3a3fa91ac32ebbee54e7f335379564e587513dcb.tar.gz gsoc2013-evolution-3a3fa91ac32ebbee54e7f335379564e587513dcb.tar.bz2 gsoc2013-evolution-3a3fa91ac32ebbee54e7f335379564e587513dcb.tar.lz gsoc2013-evolution-3a3fa91ac32ebbee54e7f335379564e587513dcb.tar.xz gsoc2013-evolution-3a3fa91ac32ebbee54e7f335379564e587513dcb.tar.zst gsoc2013-evolution-3a3fa91ac32ebbee54e7f335379564e587513dcb.zip |
Add undo for move. (rule_editor_add_undo): Add extra rank item.
2001-10-28 <NotZed@Ximian.com>
* rule-editor.c (rule_move): Add undo for move.
(rule_editor_add_undo): Add extra rank item.
(rule_editor_play_undo): handle rank case.
(rule_editor_finalise): Clean up any hanging over undo log.
(editor_clicked): Only enable 'undo' if we have
EVOLUTION_RULE_UNDO enabled. Code still a bit flakey.
(rule_editor_construct): Only enable a cancel button if
EVOLUTION_RULE_UNDO is set.
* filter-rule.c (filter_rule_set_name): Emit a changed event if it
changes.
(filter_rule_set_source): Same.
2001-10-26 <NotZed@Ximian.com>
* rule-context.c (rule_context_find_rank_rule): Find a rule at a
specific rank/source.
* rule-editor.c (add_editor_clicked): Log the added object.
(rule_editor_add_undo): New function to add an undo record to the
rule editor.
(edit_editor_clicked): Log the changed object.
(rule_delete): Add undo object.
(rule_editor_play_undo): Play an undo log back.
svn path=/trunk/; revision=14281
Diffstat (limited to 'filter/rule-context.c')
-rw-r--r-- | filter/rule-context.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/filter/rule-context.c b/filter/rule-context.c index 065ed91ed4..ce83abc662 100644 --- a/filter/rule-context.c +++ b/filter/rule-context.c @@ -619,3 +619,31 @@ rule_context_get_rank_rule (RuleContext *f, FilterRule *rule, const char *source return -1; } + +FilterRule * +rule_context_find_rank_rule (RuleContext *f, int rank, const char *source) +{ + GList *node; + int i = 0; + + g_assert(f); + + d(printf("getting rule at rank %d source '%s'\n", rank, source?source:"<any>")); + + node = f->rules; + while (node) { + FilterRule *r = node->data; + + d(printf(" checking against rule '%s' rank '%d'\n", r->name, i)); + + if (source == NULL || (r->source && strcmp(r->source, source) == 0)) { + if (rank == i) + return r; + i++; + } + + node = node->next; + } + + return NULL; +} |