Changeset 2168 for trunk/jons-gtk-gui

Show
Ignore:
Timestamp:
07/21/00 10:37:20 (8 years ago)
Author:
emojon
Message:

New options: Enable Flashing Events, and Away Color

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

Legend:

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

    r2167 r2168  
    7070gint flash_icons(gpointer data) 
    7171{ 
    72     if(nToFlash < 0) 
     72    // If we aren't supposed to flash or there are no things to flash 
     73    if(!flash_events || (nToFlash < 0)) 
    7374        return -1; 
    74  
     75         
    7576    list<SFlash *>::iterator it; 
    7677    for(it = FlashList.begin(); it != FlashList.end(); it++) 
     
    168169                0, "!"); 
    169170 
    170 /*          nToFlash++; 
    171             list<SFlash *>::iterator it; 
    172             for(it = FlashList.begin(); it != FlashList.end(); it++) 
     171            if(flash_events) 
    173172            { 
    174                 if((*it)->nUin != pUser->Uin()) 
    175                     (*it)->nRow++; 
     173                struct SFlash *flash = g_new0(struct SFlash, 1); 
     174                flash->nRow = ++nToFlash;  
     175                flash->icon = icon; 
     176                flash->bFlashOn = false; 
     177                flash->nUin = pUser->Uin(); 
     178 
     179                FlashList.push_back(flash); 
    176180            } 
    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); 
    185181 
    186182        }  
  • trunk/jons-gtk-gui/src/convo.cpp

    r2167 r2168  
    219219 
    220220    // Stop the flashing if necessary 
    221         if(c->user->NewMessages() > 0) 
     221        if((c->user->NewMessages() > 0) && flash_events) 
    222222        { 
    223223                // Stop the flashing for this user 
     
    243243        } 
    244244        } 
     245 
     246    // Clear the flash list 
     247    else if((c->user->NewMessages() > 0) && !flash_events) 
     248    { 
     249        nToFlash = -1; 
     250        FlashList.clear(); 
     251    } 
    245252} 
    246253 
  • trunk/jons-gtk-gui/src/licq_gtk.h

    r2167 r2168  
    307307    GtkWidget *show_offline; 
    308308    GtkWidget *enter_sends; 
     309    GtkWidget *flash_events; 
    309310}; 
    310311 
     
    444445extern bool show_ignored_users; 
    445446extern bool enter_sends; 
     447extern bool flash_events; 
    446448 
    447449/* Globals in random_chat.cpp */ 
  • trunk/jons-gtk-gui/src/option_window.cpp

    r2128 r2168  
    2929bool show_ignored_users; 
    3030bool enter_sends; 
     31bool flash_events; 
    3132 
    3233/* The "Options" selection under the menu in the main window */ 
     
    7576             GTK_FILL, 3, 3); 
    7677 
     78    // Flash events 
     79    ow->flash_events = gtk_check_button_new_with_label("Flash events"); 
     80    gtk_table_attach(GTK_TABLE(table), ow->flash_events, 1, 2, 1, 2, 
     81        GtkAttachOptions(GTK_FILL | GTK_EXPAND), GTK_FILL, 3, 3); 
     82 
    7783    /* Set the check buttons */ 
    7884    set_options(ow); 
     
    129135             GTK_FILL, GTK_FILL, 3, 3); 
    130136 
     137    // Away color label 
     138    label = gtk_label_new("Away Color"); 
     139    gtk_table_attach(GTK_TABLE(clr_table), label, 0, 1, 2, 3, 
     140             GTK_FILL, GTK_FILL, 3, 3); 
     141 
     142    // Offline color browse button 
     143    int *chg_away_color = new int; 
     144    *chg_away_color = 3; 
     145 
     146    GtkWidget *away_browse = gtk_button_new_with_label("Browse"); 
     147    gtk_signal_connect(GTK_OBJECT(away_browse), "clicked", 
     148        GTK_SIGNAL_FUNC(show_on_color_dlg), (gpointer)chg_away_color); 
     149    gtk_table_attach(GTK_TABLE(clr_table), away_browse, 2, 3, 2, 3, 
     150        GTK_FILL, GTK_FILL, 3, 3); 
     151 
    131152    label = gtk_label_new("Contact List"); 
    132153    gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, label); 
     
    149170{ 
    150171    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ow->show_ignored), 
    151                      show_ignored_users); 
     172        show_ignored_users); 
    152173    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ow->show_offline), 
    153                      show_offline_users); 
     174        show_offline_users); 
    154175    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ow->enter_sends), 
    155                      enter_sends); 
     176        enter_sends); 
     177    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ow->flash_events), 
     178        flash_events); 
    156179} 
    157180 
     
    167190        GTK_TOGGLE_BUTTON(ow->show_ignored)); 
    168191    enter_sends = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ow->enter_sends)); 
     192    flash_events = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON( 
     193        ow->flash_events)); 
    169194     
    170195    gtk_widget_destroy(ow->window); 
     
    196221    licqConf.WriteBool("ShowIgnoredUsres", show_ignored_users); 
    197222    licqConf.WriteBool("EnterSends", enter_sends); 
     223    licqConf.WriteBool("FlashEvents", flash_events); 
    198224 
    199225    licqConf.FlushFile(); 
     
    240266    licqConf.ReadBool("ShowIgnoredUsers", show_ignored_users, false); 
    241267    licqConf.ReadBool("EnterSends", enter_sends, true); 
     268    licqConf.ReadBool("FlashEvents", flash_events, true); 
    242269} 
    243270 
     
    260287        color[2] = (gdouble)offline_color->blue / 65535; 
    261288        color[3] = (gdouble)offline_color->pixel / 65535; 
     289        break; 
     290    case 3: 
     291        color[0] = (gdouble)away_color->red / 65535; 
     292        color[1] = (gdouble)away_color->green / 65535; 
     293        color[2] = (gdouble)away_color->blue / 65535; 
     294        color[3] = (gdouble)away_color->pixel / 65535; 
    262295        break; 
    263296    } 
     
    317350        offline_color->pixel = (gulong)new_color[3]; 
    318351        break; 
     352    case 3: 
     353        away_color->red = (guint16)(new_color[0] * 65535.0); 
     354        away_color->green = (guint16)(new_color[1] * 65535.0); 
     355        away_color->blue = (guint16)(new_color[2] * 65535.0); 
     356        away_color->pixel = (gulong)new_color[3]; 
     357        break; 
    319358    } 
    320359