mcabber/mcabber/events.c
changeset 1868 fdb2f88b908b
parent 1811 e6d355e50d7a
child 1901 84bb3e893586
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,