Changeset 5e0b690 for functions.c


Ignore:
Timestamp:
Apr 10, 2004, 10:47:40 AM (17 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
405d5e6
Parents:
f84bca8
Message:
The colorclass command is added, to make colorization easy
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    rfe1f605 r5e0b690  
    23012301}
    23022302
     2303/* Change the filter associated with the current view.
     2304 * This also figures out which message in the new filter
     2305 * should have the pointer.
     2306 */
    23032307void owl_function_change_currentview_filter(char *filtname)
    23042308{
     
    23462350}
    23472351
     2352/* Create a new filter, or replace an existing one
     2353 * with a new definition.
     2354 */
    23482355void owl_function_create_filter(int argc, char **argv)
    23492356{
     
    28392846}
    28402847
     2848/* Set the color of the current view's filter to
     2849 * be 'color'
     2850 */
    28412851void owl_function_color_current_filter(char *color)
    28422852{
     2853  char *name;
     2854
     2855  name=owl_view_get_filtname(owl_global_get_current_view(&g));
     2856  owl_function_color_filter(name, color);
     2857}
     2858
     2859/* Set the color of the filter 'filter' to be 'color'.  If the color
     2860 * name does not exist, return -1, if the filter does not exist or is
     2861 * the "all" filter, return -2.  Return 0 on success
     2862 */
     2863int owl_function_color_filter(char *filtname, char *color)
     2864{
    28432865  owl_filter *f;
    2844   char *name;
    2845 
    2846   name=owl_view_get_filtname(owl_global_get_current_view(&g));
    2847   f=owl_global_get_filter(&g, name);
     2866
     2867  f=owl_global_get_filter(&g, filtname);
    28482868  if (!f) {
    28492869    owl_function_error("Unknown filter");
    2850     return;
     2870    return(-2);
    28512871  }
    28522872
    28532873  /* don't touch the all filter */
    2854   if (!strcmp(name, "all")) {
     2874  if (!strcmp(filtname, "all")) {
    28552875    owl_function_error("You may not change the 'all' filter.");
    2856     return;
    2857   }
    2858 
    2859   /* deal with the case of trying change the filter color */
     2876    return(-2);
     2877  }
     2878
    28602879  if (owl_util_string_to_color(color)==-1) {
    28612880    owl_function_error("No color named '%s' avilable.");
    2862     return;
     2881    return(-1);
    28632882  }
    28642883  owl_filter_set_color(f, owl_util_string_to_color(color));
    28652884  owl_global_set_needrefresh(&g);
    28662885  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
     2886  return(0);
    28672887}
    28682888
Note: See TracChangeset for help on using the changeset viewer.