Changeset 5e0b690 for functions.c
- Timestamp:
- Apr 10, 2004, 10:47:40 AM (20 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 405d5e6
- Parents:
- f84bca8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
rfe1f605 r5e0b690 2301 2301 } 2302 2302 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 */ 2303 2307 void owl_function_change_currentview_filter(char *filtname) 2304 2308 { … … 2346 2350 } 2347 2351 2352 /* Create a new filter, or replace an existing one 2353 * with a new definition. 2354 */ 2348 2355 void owl_function_create_filter(int argc, char **argv) 2349 2356 { … … 2839 2846 } 2840 2847 2848 /* Set the color of the current view's filter to 2849 * be 'color' 2850 */ 2841 2851 void owl_function_color_current_filter(char *color) 2842 2852 { 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 */ 2863 int owl_function_color_filter(char *filtname, char *color) 2864 { 2843 2865 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); 2848 2868 if (!f) { 2849 2869 owl_function_error("Unknown filter"); 2850 return ;2870 return(-2); 2851 2871 } 2852 2872 2853 2873 /* don't touch the all filter */ 2854 if (!strcmp( name, "all")) {2874 if (!strcmp(filtname, "all")) { 2855 2875 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 2860 2879 if (owl_util_string_to_color(color)==-1) { 2861 2880 owl_function_error("No color named '%s' avilable."); 2862 return ;2881 return(-1); 2863 2882 } 2864 2883 owl_filter_set_color(f, owl_util_string_to_color(color)); 2865 2884 owl_global_set_needrefresh(&g); 2866 2885 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2886 return(0); 2867 2887 } 2868 2888
Note: See TracChangeset
for help on using the changeset viewer.