diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-05-10 07:14:33 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-05-10 07:14:33 +0800 |
commit | a23d192991b3abfa64b447a2eaa5219757599e3e (patch) | |
tree | 86e8326b22522674658dd3f6b9303903b09f1b42 | |
parent | 57a877702667674f5ddb845c1c7d4378866c391c (diff) | |
download | gsoc2013-evolution-a23d192991b3abfa64b447a2eaa5219757599e3e.tar gsoc2013-evolution-a23d192991b3abfa64b447a2eaa5219757599e3e.tar.gz gsoc2013-evolution-a23d192991b3abfa64b447a2eaa5219757599e3e.tar.bz2 gsoc2013-evolution-a23d192991b3abfa64b447a2eaa5219757599e3e.tar.lz gsoc2013-evolution-a23d192991b3abfa64b447a2eaa5219757599e3e.tar.xz gsoc2013-evolution-a23d192991b3abfa64b447a2eaa5219757599e3e.tar.zst gsoc2013-evolution-a23d192991b3abfa64b447a2eaa5219757599e3e.zip |
Add filter-file.[c,h] to the build.
2002-05-09 Jeffrey Stedfast <fejj@ximian.com>
* Makefile.am: Add filter-file.[c,h] to the build.
* filtertypes.xml: Add a "Command" filter rule.
* filter-element.c (filter_element_new_type_name): Add support for
type "command" which uses the new FilterFile widget.
svn path=/trunk/; revision=16739
-rw-r--r-- | filter/ChangeLog | 7 | ||||
-rw-r--r-- | filter/Makefile.am | 2 | ||||
-rw-r--r-- | filter/filter-element.c | 3 | ||||
-rw-r--r-- | filter/filter-file.c | 5 | ||||
-rw-r--r-- | filter/filtertypes.xml | 32 | ||||
-rw-r--r-- | filter/libfilter-i18n.h | 37 |
6 files changed, 66 insertions, 20 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog index 358ffbdfb1..382eafbfbd 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,5 +1,12 @@ 2002-05-09 Jeffrey Stedfast <fejj@ximian.com> + * Makefile.am: Add filter-file.[c,h] to the build. + + * filtertypes.xml: Add a "Command" filter rule. + + * filter-element.c (filter_element_new_type_name): Add support for + type "command" which uses the new FilterFile widget. + * filter-file.[c,h]: New filter widgets for choosing files and/or command-line's (?). Not yet hooked up or anything, just for future use. diff --git a/filter/Makefile.am b/filter/Makefile.am index 6b284d6da2..7576a1f169 100644 --- a/filter/Makefile.am +++ b/filter/Makefile.am @@ -30,6 +30,8 @@ libfilter_la_SOURCES = \ filter-editor.h \ filter-element.c \ filter-element.h \ + filter-file.c \ + filter-file.h \ filter-filter.c \ filter-filter.h \ filter-folder.c \ diff --git a/filter/filter-element.c b/filter/filter-element.c index fcb814e538..1d22da1839 100644 --- a/filter/filter-element.c +++ b/filter/filter-element.c @@ -36,6 +36,7 @@ #include "filter-int.h" #include "filter-folder.h" #include "filter-source.h" +#include "filter-file.h" static gboolean validate (FilterElement *fe); @@ -273,6 +274,8 @@ filter_element_new_type_name (const char *type) return (FilterElement *)filter_input_new_type_name (type); } else if (!strcmp (type, "source")) { return (FilterElement *)filter_source_new (); + } else if (!strcmp (type, "command")) { + return (FilterElement *) filter_file_new_type_name (type); } else { g_warning("Unknown filter type '%s'", type); return 0; diff --git a/filter/filter-file.c b/filter/filter-file.c index 6884fcb1a9..524d6f6d37 100644 --- a/filter/filter-file.c +++ b/filter/filter-file.c @@ -27,6 +27,7 @@ #include <string.h> #include <sys/types.h> +#include <sys/stat.h> #include <regex.h> #include <gtk/gtkobject.h> #include <gtk/gtkwidget.h> @@ -148,7 +149,7 @@ filter_file_new (void) FilterFile * -filter_file_new_type (const char *type) +filter_file_new_type_name (const char *type) { FilterFile *file; @@ -274,7 +275,7 @@ entry_changed (GtkEntry *entry, FilterElement *fe) new = e_utf8_gtk_entry_get_text (entry); g_free (file->path); - fi->path = new; + file->path = new; } static GtkWidget * diff --git a/filter/filtertypes.xml b/filter/filtertypes.xml index f6f0ce2abe..2ef34da1c5 100644 --- a/filter/filtertypes.xml +++ b/filter/filtertypes.xml @@ -562,6 +562,38 @@ <input type="source" name="source"/> </part> + <part name="command"> + <title>Command</title> + <input type="command" name="command"/> + <input type="optionlist" name="retval-type"> + <option value="is"> + <title>is</title> + <code> + (match-all (= (shell-exec ${command}) ${retval})) + </code> + </option> + <option value="is-not"> + <title>is not</title> + <code> + (match-all (not (= (shell-exec ${command}) ${retval}))) + </code> + </option> + <option value="greater-than"> + <title>is greater than</title> + <code> + (match-all (> (shell-exec ${command}) ${retval})) + </code> + </option> + <option value="less-than"> + <title>is less than</title> + <code> + (match-all (< (shell-exec ${command}) ${retval})) + </code> + </option> + </input> + <input type="integer" name="retval"/> + </part> + </partset> diff --git a/filter/libfilter-i18n.h b/filter/libfilter-i18n.h index 864e9644cc..82aab705d2 100644 --- a/filter/libfilter-i18n.h +++ b/filter/libfilter-i18n.h @@ -4,18 +4,35 @@ char *s = N_("Assign Color"); char *s = N_("Assign Score"); char *s = N_("Attachments"); char *s = N_("Beep"); +char *s = N_("Command"); +char *s = N_("contains"); char *s = N_("Copy to Folder"); char *s = N_("Date received"); char *s = N_("Date sent"); char *s = N_("Delete"); char *s = N_("Deleted"); +char *s = N_("does not contain"); +char *s = N_("does not end with"); +char *s = N_("does not exist"); +char *s = N_("does not sound like"); +char *s = N_("does not start with"); char *s = N_("Do Not Exist"); char *s = N_("Draft"); +char *s = N_("ends with"); char *s = N_("Execute Shell Command"); char *s = N_("Exist"); +char *s = N_("exists"); char *s = N_("Expression"); char *s = N_("Follow Up"); char *s = N_("Important"); +char *s = N_("is"); +char *s = N_("is after"); +char *s = N_("is before"); +char *s = N_("is Flagged"); +char *s = N_("is greater than"); +char *s = N_("is less than"); +char *s = N_("is not"); +char *s = N_("is not Flagged"); char *s = N_("Mailing list"); char *s = N_("Message Body"); char *s = N_("Message Header"); @@ -29,26 +46,10 @@ char *s = N_("Score"); char *s = N_("Sender"); char *s = N_("Set Status"); char *s = N_("Size (kB)"); +char *s = N_("sounds like"); char *s = N_("Source Account"); char *s = N_("Specific header"); +char *s = N_("starts with"); char *s = N_("Status"); char *s = N_("Stop Processing"); char *s = N_("Subject"); -char *s = N_("contains"); -char *s = N_("does not contain"); -char *s = N_("does not end with"); -char *s = N_("does not exist"); -char *s = N_("does not sound like"); -char *s = N_("does not start with"); -char *s = N_("ends with"); -char *s = N_("exists"); -char *s = N_("is Flagged"); -char *s = N_("is after"); -char *s = N_("is before"); -char *s = N_("is greater than"); -char *s = N_("is less than"); -char *s = N_("is not Flagged"); -char *s = N_("is not"); -char *s = N_("is"); -char *s = N_("sounds like"); -char *s = N_("starts with"); |