Changeset c3ab155
- Timestamp:
- Jun 17, 2003, 9:46:10 PM (22 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
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
rb97fce8 rc3ab155 8 8 format_msg() function is found in .owlconf 9 9 Added the 'oneline' style 10 Added the 'default_style' variable 11 Added the 'toggle-oneline' command 12 the 'o' key is bound to 'toggle-oneline' 13 Really use just one view now, named 'main' and recalculate 14 messages when its filter is changed 10 15 11 16 2.0.3 -
commands.c
raac889a rc3ab155 270 270 "alist", 271 271 "Print a listing of buddies logged in, regardless of protocol."), 272 273 OWLCMD_ARGS("toggle-oneline", owl_command_toggleoneline, OWL_CTX_INTERACTIVE, 274 "Toggle the style between oneline and the default style", 275 "toggle-oneline", 276 ""), 272 277 273 278 OWLCMD_VOID("recv:shiftleft", owl_command_shift_left, OWL_CTX_INTERACTIVE, … … 866 871 char *owl_command_blist() { 867 872 owl_function_buddylist(1, 1, NULL); 873 return(NULL); 874 } 875 876 char *owl_command_toggleoneline() { 877 owl_function_toggleoneline(); 868 878 return(NULL); 869 879 } -
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 } -
keys.c
r38cf544c rc3ab155 246 246 BIND_CMD("T", "delete trash", "mark all 'trash' messages for deletion"); 247 247 248 BIND_CMD("o", "toggle-oneline", ""); 249 248 250 BIND_CMD("A", "zaway toggle", "toggles zaway on and off"); 249 251 -
owl.c
r8b32593 rc3ab155 211 211 212 212 /* set the current view */ 213 owl_view_create(owl_global_get_current_view(&g), f);213 owl_view_create(owl_global_get_current_view(&g), "main", f, owl_global_get_style_by_name(&g, "default")); 214 214 215 215 /* AIM init */ -
owl.h
rbd3f232 rc3ab155 314 314 315 315 typedef struct _owl_view { 316 char *name; 316 317 owl_filter *filter; 317 318 owl_messagelist ml; 319 owl_style *style; 318 320 } owl_view; 319 321 -
stylefunc.c
r65e3901 rc3ab155 430 430 431 431 /* make personal messages bold for smaat users */ 432 if (owl_global_is_userclue(&g, OWL_USERCLUE_CLASSES) && owl_message_is_personal(m)) { 432 if (owl_global_is_userclue(&g, OWL_USERCLUE_CLASSES) && 433 owl_message_is_personal(m) && 434 owl_message_is_direction_in(m)) { 433 435 owl_fmtext_addattr(fm, OWL_FMTEXT_ATTR_BOLD); 434 436 } -
variable.c
r8b32593 rc3ab155 204 204 "available, 'perl'\n", 205 205 NULL, owl_variable_style_set, NULL), 206 207 OWLVAR_STRING( "default_style" /* %OwlVarStub */, "default", 208 "name of the default formatting style", 209 "This sets the default message formatting style. Possbile\n" 210 "values include 'default' 'basic' 'oneline' and if\n" 211 "available, 'perl'\n" ), 206 212 207 213 OWLVAR_INT( "edit:maxfillcols" /* %OwlVarStub:edit_maxfillcols */, 70, -
view.c
r3a2daac rc3ab155 4 4 static const char fileIdent[] = "$Id$"; 5 5 6 void owl_view_create(owl_view *v, owl_filter *f) { 6 void owl_view_create(owl_view *v, char *name, owl_filter *f, owl_style *s) 7 { 8 v->name=owl_strdup(name); 7 9 v->filter=f; 10 v->style=s; 8 11 owl_messagelist_create(&(v->ml)); 9 12 owl_view_recalculate(v); 10 13 } 11 14 12 void owl_view_consider_message(owl_view *v, owl_message *m) { 13 /* if the message matches the filter then add to view */ 15 16 /* if the message matches the filter then add to view */ 17 void owl_view_consider_message(owl_view *v, owl_message *m) 18 { 14 19 if (owl_filter_message_match(v->filter, m)) { 15 20 owl_messagelist_append_element(&(v->ml), m); … … 17 22 } 18 23 19 void owl_view_recalculate(owl_view *v) { 20 /* add all the global messages that match the filter */ 24 /* remove all messages, add all the global messages that match the 25 * filter. 26 */ 27 void owl_view_recalculate(owl_view *v) 28 { 21 29 int i, j; 22 30 owl_messagelist *gml; … … 41 49 } 42 50 43 owl_message *owl_view_get_element(owl_view *v, int index) { 51 void owl_view_new_filter(owl_view *v, owl_filter *f) 52 { 53 v->filter=f; 54 owl_view_recalculate(v); 55 } 56 57 void owl_view_set_style(owl_view *v, owl_style *s) 58 { 59 v->style=s; 60 } 61 62 owl_message *owl_view_get_element(owl_view *v, int index) 63 { 44 64 return(owl_messagelist_get_element(&(v->ml), index)); 45 65 } 46 66 47 void owl_view_delete_element(owl_view *v, int index) { 67 void owl_view_delete_element(owl_view *v, int index) 68 { 48 69 owl_messagelist_delete_element(&(v->ml), index); 49 70 } 50 71 51 void owl_view_undelete_element(owl_view *v, int index) { 72 void owl_view_undelete_element(owl_view *v, int index) 73 { 52 74 owl_messagelist_undelete_element(&(v->ml), index); 53 75 } 54 76 55 int owl_view_get_size(owl_view *v) { 77 int owl_view_get_size(owl_view *v) 78 { 56 79 return(owl_messagelist_get_size(&(v->ml))); 57 80 } … … 59 82 /* Returns the position in the view with a message closest 60 83 * to the passed msgid. */ 61 int owl_view_get_nearest_to_msgid(owl_view *v, int targetid) { 84 int owl_view_get_nearest_to_msgid(owl_view *v, int targetid) 85 { 62 86 int i, bestdist=-1, bestpos=0, curid, curdist; 63 87 … … 73 97 } 74 98 75 int owl_view_get_nearest_to_saved(owl_view *v) { 99 int owl_view_get_nearest_to_saved(owl_view *v) 100 { 76 101 int cachedid; 77 102 … … 83 108 /* saves the current message position in the filter so it can 84 109 * be restored later if we switch back to this filter. */ 85 void owl_view_save_curmsgid(owl_view *v, int curid) { 110 void owl_view_save_curmsgid(owl_view *v, int curid) 111 { 86 112 owl_filter_set_cachedmsgid(v->filter, curid); 87 113 } 88 114 89 char *owl_view_get_filtname(owl_view *v) { 115 char *owl_view_get_filtname(owl_view *v) 116 { 90 117 return(owl_filter_get_name(v->filter)); 91 118 } 92 119 93 void owl_view_free(owl_view *v) { 120 void owl_view_free(owl_view *v) 121 { 94 122 owl_list_free_simple((owl_list *) &(v->ml)); 123 if (v->name) owl_free(v->name); 95 124 }
Note: See TracChangeset
for help on using the changeset viewer.