Changeset c3ab155 for functions.c
- Timestamp:
- Jun 17, 2003, 9:46:10 PM (21 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:
- b1299da
- Parents:
- 65e3901
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
rd559df9 rc3ab155 1955 1955 } 1956 1956 1957 1958 void owl_function_change_view (char *filtname)1957 #if 0 1958 void owl_function_change_view_old(char *filtname) 1959 1959 { 1960 1960 owl_view *v; … … 1999 1999 owl_global_set_curmsg(&g, newpos); 2000 2000 2001 owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS); 2002 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2003 owl_global_set_direction_downwards(&g); 2004 } 2005 #endif 2006 2007 void owl_function_change_view(char *filtname) 2008 { 2009 owl_view *v; 2010 owl_filter *f; 2011 int curid=-1, newpos, curmsg; 2012 owl_message *curm=NULL; 2013 2014 v=owl_global_get_current_view(&g); 2015 2016 curmsg=owl_global_get_curmsg(&g); 2017 if (curmsg==-1) { 2018 owl_function_debugmsg("Hit the curmsg==-1 case in change_view"); 2019 } else { 2020 curm=owl_view_get_element(v, curmsg); 2021 if (curm) { 2022 curid=owl_message_get_id(curm); 2023 owl_view_save_curmsgid(v, curid); 2024 } 2025 } 2026 2027 f=owl_global_get_filter(&g, filtname); 2028 if (!f) { 2029 owl_function_makemsg("Unknown filter"); 2030 return; 2031 } 2032 2033 owl_view_new_filter(v, f); 2034 2035 /* Figure out what to set the current message to. 2036 * - If the view we're leaving has messages in it, go to the closest message 2037 * to the last message pointed to in that view. 2038 * - If the view we're leaving is empty, try to restore the position 2039 * from the last time we were in the new view. */ 2040 if (curm) { 2041 newpos = owl_view_get_nearest_to_msgid(v, curid); 2042 } else { 2043 newpos = owl_view_get_nearest_to_saved(v); 2044 } 2045 2046 owl_global_set_curmsg(&g, newpos); 2001 2047 owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS); 2002 2048 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); … … 2966 3012 fclose(file); 2967 3013 } 3014 3015 void owl_function_toggleoneline() 3016 { 3017 char *style; 3018 3019 style=owl_global_get_style(&g); 3020 3021 if (strcmp(style, "oneline")) { 3022 owl_global_set_style(&g, "oneline"); 3023 } else { 3024 owl_global_set_style(&g, owl_global_get_default_style(&g)); 3025 } 3026 }
Note: See TracChangeset
for help on using the changeset viewer.