Changeset 2167 for trunk/jons-gtk-gui

Show
Ignore:
Timestamp:
07/20/00 16:27:56 (8 years ago)
Author:
emojon
Message:

Flashing icons

Location:
trunk/jons-gtk-gui/src
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/jons-gtk-gui/src/contact_list.cpp

    r2140 r2167  
    3232struct status_icon *online, *offline, *away, *na, *dnd, *occ, *ffc, 
    3333    *invisible, *message_icon, *file_icon, *chat_icon, *url_icon, 
    34     *secure_icon, *birthday_icon, *securebday_icon; 
     34    *secure_icon, *birthday_icon, *securebday_icon, *blank_icon; 
     35gboolean bFlashOn = false; 
     36gint nToFlash = -1; 
    3537 
    3638list<unsigned long> AutoSecureList; 
     39list<SFlash *> FlashList; 
    3740 
    3841GtkWidget *contact_list_new(gint height, gint width) 
     
    6568} 
    6669 
     70gint flash_icons(gpointer data) 
     71{ 
     72    if(nToFlash < 0) 
     73        return -1; 
     74 
     75    list<SFlash *>::iterator it; 
     76    for(it = FlashList.begin(); it != FlashList.end(); it++) 
     77    { 
     78        if(!(*it)->bFlashOn) 
     79        { 
     80            (*it)->bFlashOn = true; 
     81            gtk_clist_set_pixmap(GTK_CLIST(contact_list), 
     82                (*it)->nRow, 1, blank_icon->pm, 
     83                blank_icon->bm); 
     84        } 
     85        else 
     86        { 
     87            (*it)->bFlashOn = false; 
     88            gtk_clist_set_pixmap(GTK_CLIST(contact_list), 
     89                (*it)->nRow, 1, (*it)->icon->pm, 
     90                (*it)->icon->bm); 
     91        } 
     92    } 
     93 
     94    return -1; 
     95} 
     96 
    6797void contact_list_refresh() 
    6898{ 
    6999    gchar *blah[3]; 
    70100    gint num_users = 0; 
     101    nToFlash = -1; 
    71102 
    72103    /* Don't update the clist window, so we can update all the users */ 
     
    136167            gtk_clist_set_text(GTK_CLIST(contact_list), num_users, 
    137168                0, "!"); 
     169 
     170/*          nToFlash++; 
     171            list<SFlash *>::iterator it; 
     172            for(it = FlashList.begin(); it != FlashList.end(); it++) 
     173            { 
     174                if((*it)->nUin != pUser->Uin()) 
     175                    (*it)->nRow++; 
     176            } 
     177*/ 
     178            struct SFlash *flash = g_new0(struct SFlash, 1); 
     179            flash->nRow = ++nToFlash;  
     180            flash->icon = icon; 
     181            flash->bFlashOn = false; 
     182            flash->nUin = pUser->Uin(); 
     183 
     184            FlashList.push_back(flash); 
     185 
    138186        }  
    139187 
  • trunk/jons-gtk-gui/src/convo.cpp

    r2128 r2167  
    217217 
    218218    gtk_widget_show_all(c->window); 
     219 
     220    // Stop the flashing if necessary 
     221        if(c->user->NewMessages() > 0) 
     222        { 
     223                // Stop the flashing for this user 
     224                nToFlash--; 
     225                list<SFlash *>::iterator it; 
     226        int x = 0; 
     227                for(it = FlashList.begin(); it != FlashList.end(); it++) 
     228                { 
     229            x++; 
     230                        if((*it)->nUin == c->user->Uin()) 
     231                        { 
     232                                g_free(*it); 
     233                                FlashList.erase(it); 
     234                break; 
     235                        }                 
     236                } 
     237 
     238        for(it = FlashList.begin(); it != FlashList.end(); it++) 
     239        { 
     240            x--; 
     241            if(x <= 0) 
     242                (*it)->nRow--; 
     243        } 
     244        } 
    219245} 
    220246 
     
    350376    { 
    351377        system_status_refresh(); 
    352         return;  
     378                return; 
    353379    } 
    354380 
  • trunk/jons-gtk-gui/src/extras.cpp

    r2159 r2167  
    3636#include "pixmaps/birthday.xpm" 
    3737#include "pixmaps/securebday.xpm" 
     38#include "pixmaps/blank.xpm" 
    3839 
    3940#include "licq_countrycodes.h" 
     
    7980    birthday_icon = make_pixmap(birthday_icon, (gchar **)birthday_xpm); 
    8081    securebday_icon = make_pixmap(securebday_icon, (gchar **)securebday_xpm); 
     82    blank_icon = make_pixmap(blank_icon, (gchar **)blank_xpm); 
    8183} 
    8284 
  • trunk/jons-gtk-gui/src/licq_gtk.h

    r2159 r2167  
    389389}; 
    390390 
     391struct SFlash 
     392{ 
     393    struct status_icon *icon; 
     394    gulong nUin; 
     395    gint nRow; 
     396    gboolean bFlashOn; 
     397}; 
     398 
    391399/******************* Global Variables ******************/ 
    392400 
     
    398406extern struct status_icon *online, *away, *na, *dnd, *occ, *offline, *ffc, 
    399407    *invisible, *message_icon, *file_icon, *chat_icon, *url_icon, 
    400     *secure_icon, *birthday_icon, *securebday_icon; 
     408    *secure_icon, *birthday_icon, *securebday_icon, *blank_icon; 
     409extern int nToFlash; 
     410extern list<SFlash *> FlashList; 
    401411 
    402412/* Globals in chat_window.cpp */ 
     
    508518extern void contact_list_click(GtkWidget *, GdkEventButton *, gpointer); 
    509519extern void add_to_popup(const gchar *, GtkWidget *, GtkSignalFunc, ICQUser *); 
     520extern gint flash_icons(gpointer); 
    510521 
    511522 
  • trunk/jons-gtk-gui/src/main_window.cpp

    r2157 r2167  
    2727GtkWidget *contact_list; 
    2828 
     29gint flash_icons(gpointer); 
     30 
    2931void main_window_delete_event(GtkWidget *mainwindow, gpointer data) 
    3032{ 
     
    3638               gint width) 
    3739{ 
     40    gtk_timeout_add(1000, flash_icons, NULL); 
     41 
    3842    /* Here's a good place to start the option defaults */ 
    3943    const char *filename = g_strdup_printf("%s/licq_jons-gtk-gui.conf",