# HG changeset patch # User Mikael Berthe # Date 1270332953 -7200 # Node ID fdb2f88b908b9e1e11e124377eb36645386f4719 # Parent edb63a8380f4c55b4b619c6ecd3b939a817fb6e7 /event list sets the message flag when the list is long diff -r edb63a8380f4 -r fdb2f88b908b mcabber/mcabber/events.c --- a/mcabber/mcabber/events.c Sat Apr 03 22:01:54 2010 +0200 +++ b/mcabber/mcabber/events.c Sun Apr 04 00:15:53 2010 +0200 @@ -23,7 +23,7 @@ #include #include #include "events.h" -#include "logprint.h" +#include "screen.h" typedef struct { char *id; @@ -162,16 +162,23 @@ // Prints list of events to mcabber log window. void evs_display_list(void) { + guint count = 0; GSList *p; - scr_LogPrint(LPRINT_LOGNORM, "Events list:"); + scr_LogPrint(LPRINT_NORMAL, "Events list:"); for (p = evs_list; p; p = g_slist_next(p)) { evs_t *i = p->data; - scr_LogPrint(LPRINT_LOGNORM, + scr_LogPrint(LPRINT_NORMAL, "Id: %-3s %s", i->id, (i->description ? i->description : "")); + count++; } - scr_LogPrint(LPRINT_LOGNORM, "End of events list."); + scr_LogPrint(LPRINT_NORMAL, "End of events list."); + if (count+2 > scr_getlogwinheight()) { + scr_setmsgflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE); + scr_setattentionflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE, + ROSTER_UI_PRIO_STATUS_WIN_MESSAGE, prio_max); + } } // evs_geteventslist()