Changeset 04b16f8


Ignore:
Timestamp:
May 22, 2010, 10:37:26 PM (10 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
98d7757
Parents:
5aa33fd
git-author:
Nelson Elhage <nelhage@mit.edu> (05/21/10 16:46:40)
git-committer:
Nelson Elhage <nelhage@mit.edu> (05/22/10 22:37:26)
Message:
Set up filters and a view in the tester.
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • global.c

    r0881cdd r04b16f8  
    10431043  g->interrupted = 0;
    10441044}
     1045
     1046void owl_global_setup_default_filters(owl_global *g)
     1047{
     1048  int i;
     1049  static const struct {
     1050    const char *name;
     1051    const char *desc;
     1052  } filters[] = {
     1053    { "personal",
     1054      "private ^true$ and ( not type ^zephyr$ or "
     1055      "( class ^message and ( instance ^personal$ or instance ^urgent$ ) ) )" },
     1056    { "trash",
     1057      "class ^mail$ or opcode ^ping$ or type ^admin$ or ( not login ^none$ )" },
     1058    { "wordwrap", "not ( type ^admin$ or type ^zephyr$ )" },
     1059    { "ping", "opcode ^ping$" },
     1060    { "auto", "opcode ^auto$" },
     1061    { "login", "not login ^none$" },
     1062    { "reply-lockout", "class ^noc or class ^mail$" },
     1063    { "out", "direction ^out$" },
     1064    { "aim", "type ^aim$" },
     1065    { "zephyr", "type ^zephyr$" },
     1066    { "none", "false" },
     1067    { "all", "true" },
     1068    { NULL, NULL }
     1069  };
     1070
     1071  owl_function_debugmsg("startup: creating default filters");
     1072
     1073  for (i = 0; filters[i].name != NULL; i++)
     1074    owl_global_add_filter(g, owl_filter_new_fromstring(filters[i].name,
     1075                                                       filters[i].desc));
     1076}
  • owl.c

    r3687413 r04b16f8  
    149149}
    150150
    151 static void owl_setup_default_filters(void)
    152 {
    153   int i;
    154   static const struct {
    155     const char *name;
    156     const char *desc;
    157   } filters[] = {
    158     { "personal",
    159       "isprivate ^true$ and ( not type ^zephyr$ or ( class ^message  ) )" },
    160     { "trash",
    161       "class ^mail$ or opcode ^ping$ or type ^admin$ or ( not login ^none$ )" },
    162     { "wordwrap", "not ( type ^admin$ or type ^zephyr$ )" },
    163     { "ping", "opcode ^ping$" },
    164     { "auto", "opcode ^auto$" },
    165     { "login", "not login ^none$" },
    166     { "reply-lockout", "class ^noc or class ^mail$" },
    167     { "out", "direction ^out$" },
    168     { "aim", "type ^aim$" },
    169     { "zephyr", "type ^zephyr$" },
    170     { "none", "false" },
    171     { "all", "true" },
    172     { NULL, NULL }
    173   };
    174 
    175   owl_function_debugmsg("startup: creating default filters");
    176 
    177   for (i = 0; filters[i].name != NULL; i++)
    178     owl_global_add_filter(&g, owl_filter_new_fromstring(filters[i].name,
    179                                                         filters[i].desc));
    180 }
    181151
    182152/*
     
    563533  owl_global_complete_setup(&g);
    564534
    565   owl_setup_default_filters();
     535  owl_global_setup_default_filters(&g);
    566536
    567537  /* set the current view */
  • tester.c

    r5aa33fd r04b16f8  
    4343  }
    4444  owl_global_complete_setup(&g);
     45  owl_global_setup_default_filters(&g);
     46
     47  owl_view_create(owl_global_get_current_view(&g), "main",
     48                  owl_global_get_filter(&g, "all"),
     49                  owl_global_get_style_by_name(&g, "default"));
    4550
    4651  if (argc > 1) {
Note: See TracChangeset for help on using the changeset viewer.