aboutsummaryrefslogtreecommitdiffstats
path: root/filter/rule-editor.c
diff options
context:
space:
mode:
author8 <NotZed@Ximian.com>2001-10-28 17:39:04 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-28 17:39:04 +0800
commit15ada734a7008b42c2ca2c21aece9336c2b9e075 (patch)
tree49036be5a3eac64ecac70f22d35ab38493bd00eb /filter/rule-editor.c
parentc0cf9754b8c5ec7e13f6ee035040d792bc254ee2 (diff)
downloadgsoc2013-evolution-15ada734a7008b42c2ca2c21aece9336c2b9e075.tar
gsoc2013-evolution-15ada734a7008b42c2ca2c21aece9336c2b9e075.tar.gz
gsoc2013-evolution-15ada734a7008b42c2ca2c21aece9336c2b9e075.tar.bz2
gsoc2013-evolution-15ada734a7008b42c2ca2c21aece9336c2b9e075.tar.lz
gsoc2013-evolution-15ada734a7008b42c2ca2c21aece9336c2b9e075.tar.xz
gsoc2013-evolution-15ada734a7008b42c2ca2c21aece9336c2b9e075.tar.zst
gsoc2013-evolution-15ada734a7008b42c2ca2c21aece9336c2b9e075.zip
Implement, change any folder uri's that have been renamed, to the new one.
2001-10-28 <NotZed@Ximian.com> * filter-context.c (filter_rename_uri): Implement, change any folder uri's that have been renamed, to the new one. (filter_delete_uri): Dont actually do any work (yet). We could probably put rename_uri on every rule context/filter part/filter element, and let their methods handle it, but for now its easy enough just to handle the few cases that we have to handle manually. * rule-context.c (rule_context_delete_uri): Update a filter context for a deleted uri, e.g. folder removed. (rule_context_rename_uri): Update a filter context for a renamed uri, e.g. * filter-folder.c (filter_folder_set_value): New function to set the uri of a folder filter. * 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. (rule_editor_add_undo): Only add if undo enabled. * filter-rule.c (filter_rule_set_name): Emit a changed event if it changes. (filter_rule_set_source): Same. svn path=/trunk/; revision=14289
Diffstat (limited to 'filter/rule-editor.c')
-rw-r--r--filter/rule-editor.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/filter/rule-editor.c b/filter/rule-editor.c
index 0fdd845dd9..63986e6f2d 100644
--- a/filter/rule-editor.c
+++ b/filter/rule-editor.c
@@ -36,6 +36,8 @@
/* for getenv only, remove when getenv need removed */
#include <stdlib.h>
+static int enable_undo;
+
void rule_editor_add_undo(RuleEditor *re, int type, FilterRule *rule, int rank, int newrank);
void rule_editor_play_undo(RuleEditor *re);
@@ -88,7 +90,10 @@ rule_editor_get_type(void)
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL
};
-
+
+ /* TODO: Remove when it works (or never will) */
+ enable_undo = getenv("EVOLUTION_RULE_UNDO") != NULL;
+
type = gtk_type_unique (gnome_dialog_get_type (), &type_info);
}
@@ -514,9 +519,7 @@ rule_editor_add_undo(RuleEditor *re, int type, FilterRule *rule, int rank, int n
{
RuleEditorUndo *undo;
- printf("Adding udno record: %d object %p '%s'\n", type, rule, rule->name);
-
- if (!re->undo_active) {
+ if (!re->undo_active && !enable_undo) {
undo = g_malloc0(sizeof(*undo));
undo->rule = rule;
undo->type = type;
@@ -581,7 +584,7 @@ static void
editor_clicked (GtkWidget *dialog, int button, RuleEditor *re)
{
if (button != 0) {
- if (getenv("EVOLUTION_RULE_UNDO"))
+ if (enable_undo)
rule_editor_play_undo(re);
else {
RuleEditorUndo *undo, *next;
@@ -624,7 +627,7 @@ rule_editor_construct (RuleEditor *re, RuleContext *context, GladeXML *gui, cons
gtk_signal_connect (GTK_OBJECT (re), "clicked", editor_clicked, re);
rule_editor_set_source (re, source);
- if (getenv("EVOLUTION_RULE_UNDO")) {
+ if (enable_undo) {
gnome_dialog_append_buttons (GNOME_DIALOG (re), GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL, NULL);
} else