Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/events.c @ 1868:fdb2f88b908b
/event list sets the message flag when the list is long
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 04 Apr 2010 00:15:53 +0200 |
parents | e6d355e50d7a |
children | 84bb3e893586 |
comparison
equal
deleted
inserted
replaced
1867:edb63a8380f4 | 1868:fdb2f88b908b |
---|---|
21 */ | 21 */ |
22 | 22 |
23 #include <glib.h> | 23 #include <glib.h> |
24 #include <string.h> | 24 #include <string.h> |
25 #include "events.h" | 25 #include "events.h" |
26 #include "logprint.h" | 26 #include "screen.h" |
27 | 27 |
28 typedef struct { | 28 typedef struct { |
29 char *id; | 29 char *id; |
30 char *description; | 30 char *description; |
31 time_t timeout; | 31 time_t timeout; |
160 | 160 |
161 // evs_display_list() | 161 // evs_display_list() |
162 // Prints list of events to mcabber log window. | 162 // Prints list of events to mcabber log window. |
163 void evs_display_list(void) | 163 void evs_display_list(void) |
164 { | 164 { |
165 guint count = 0; | |
165 GSList *p; | 166 GSList *p; |
166 | 167 |
167 scr_LogPrint(LPRINT_LOGNORM, "Events list:"); | 168 scr_LogPrint(LPRINT_NORMAL, "Events list:"); |
168 for (p = evs_list; p; p = g_slist_next(p)) { | 169 for (p = evs_list; p; p = g_slist_next(p)) { |
169 evs_t *i = p->data; | 170 evs_t *i = p->data; |
170 scr_LogPrint(LPRINT_LOGNORM, | 171 scr_LogPrint(LPRINT_NORMAL, |
171 "Id: %-3s %s", i->id, | 172 "Id: %-3s %s", i->id, |
172 (i->description ? i->description : "")); | 173 (i->description ? i->description : "")); |
173 } | 174 count++; |
174 scr_LogPrint(LPRINT_LOGNORM, "End of events list."); | 175 } |
176 scr_LogPrint(LPRINT_NORMAL, "End of events list."); | |
177 if (count+2 > scr_getlogwinheight()) { | |
178 scr_setmsgflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE); | |
179 scr_setattentionflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE, | |
180 ROSTER_UI_PRIO_STATUS_WIN_MESSAGE, prio_max); | |
181 } | |
175 } | 182 } |
176 | 183 |
177 // evs_geteventslist() | 184 // evs_geteventslist() |
178 // Return a singly-linked-list of events ids. | 185 // Return a singly-linked-list of events ids. |
179 // Data in list should not be modified and can disappear, | 186 // Data in list should not be modified and can disappear, |