Changeset 11114


Ignore:
Timestamp:
Aug 4, 2010, 5:35:48 PM (12 years ago)
Author:
Longinus00
Message:

(trunk) #3185: Number on drop-down menu "Activity" - "Active" seems does not follow a change in torrent status correctly

Location:
trunk/gtk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-core.c

    r11107 r11114  
    559559}
    560560
     561static gboolean
     562isTorrentActive( tr_torrent * tor )
     563{
     564    const tr_stat * st = tr_torrentStat( tor );
     565    return ( st->peersSendingToUs > 0 )
     566        || ( st->peersGettingFromUs > 0 )
     567        || ( st->activity == TR_STATUS_CHECK );
     568}
     569
    561570#ifdef HAVE_GIO
    562571
     
    786795                      G_TYPE_DOUBLE,    /* tr_stat.pieceUploadSpeed_KBps */
    787796                      G_TYPE_DOUBLE,    /* tr_stat.pieceDownloadSpeed_KBps */
     797                      G_TYPE_BOOLEAN,   /* filter.c:ACTIVITY_FILTER_ACTIVE */
    788798                      G_TYPE_INT,       /* tr_stat.activity */
    789799                      G_TYPE_UCHAR,     /* tr_stat.finished */
     
    907917                                       MC_SPEED_UP,      st->pieceUploadSpeed_KBps,
    908918                                       MC_SPEED_DOWN,    st->pieceDownloadSpeed_KBps,
     919                                       MC_ACTIVE,        isTorrentActive( tor ),
    909920                                       MC_ACTIVITY,      st->activity,
    910921                                       MC_FINISHED,      st->finished,
     
    13051316    double oldUpSpeed, newUpSpeed;
    13061317    double oldDownSpeed, newDownSpeed;
     1318    gboolean oldActive, newActive;
    13071319    const tr_stat * st;
    13081320    TrTorrent * gtor;
     
    13121324    gtk_tree_model_get( model, iter,
    13131325                        MC_TORRENT, &gtor,
     1326                        MC_ACTIVE, &oldActive,
    13141327                        MC_ACTIVITY, &oldActivity,
    13151328                        MC_FINISHED, &oldFinished,
     
    13231336    tor = tr_torrent_handle( gtor );
    13241337    st = tr_torrentStat( tor );
     1338    newActive = isTorrentActive( tor );
    13251339    newActivity = st->activity;
    13261340    newFinished = st->finished;
     
    13321346    /* updating the model triggers off resort/refresh,
    13331347       so don't do it unless something's actually changed... */
    1334     if( ( newActivity  != oldActivity  )
     1348    if( ( newActive != oldActive )
     1349        || ( newActivity  != oldActivity )
    13351350        || ( newFinished != oldFinished )
    13361351        || ( newPriority != oldPriority )
     
    13401355    {
    13411356        gtk_list_store_set( GTK_LIST_STORE( model ), iter,
     1357                            MC_ACTIVE, newActive,
    13421358                            MC_ACTIVITY, newActivity,
    13431359                            MC_FINISHED, newFinished,
  • trunk/gtk/tr-core.h

    r11087 r11114  
    196196    MC_SPEED_UP,
    197197    MC_SPEED_DOWN,
     198    MC_ACTIVE,
    198199    MC_ACTIVITY,
    199200    MC_FINISHED,
Note: See TracChangeset for help on using the changeset viewer.