Changeset 11106 for branches


Ignore:
Timestamp:
Aug 4, 2010, 5:23:25 AM (12 years ago)
Author:
Longinus00
Message:

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

Location:
branches/2.0x
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0x/gtk/details.c

    r11003 r11106  
    21532153            di->trackers = NULL;
    21542154            di->tracker_buffer = NULL;
    2155             tr_core_torrent_changed( di->core, tr_torrentId( tor ) );
    21562155        }
    21572156
  • branches/2.0x/gtk/filter.c

    r10672 r11106  
    590590    ACTIVITY_FILTER_ACTIVE,
    591591    ACTIVITY_FILTER_PAUSED,
     592    ACTIVITY_FILTER_FINISHED,
    592593    ACTIVITY_FILTER_QUEUED,
    593594    ACTIVITY_FILTER_VERIFYING,
     
    634635            return st->activity == TR_STATUS_STOPPED;
    635636
     637        case ACTIVITY_FILTER_FINISHED:
     638            return st->finished == TRUE;
     639
    636640        case ACTIVITY_FILTER_QUEUED:
    637             return FALSE;
     641            return st->activity == TR_STATUS_CHECK_WAIT;
    638642
    639643        case ACTIVITY_FILTER_VERIFYING:
    640             return ( st->activity == TR_STATUS_CHECK_WAIT )
    641                 || ( st->activity == TR_STATUS_CHECK );
     644            return st->activity == TR_STATUS_CHECK ;
    642645
    643646        case ACTIVITY_FILTER_ERROR:
     
    646649        default: /* ACTIVITY_FILTER_ALL */
    647650            return TRUE;
    648 
    649651    }
    650652}
     
    721723        { ACTIVITY_FILTER_SEEDING, N_( "Seeding" ), GTK_STOCK_GO_UP },
    722724        { ACTIVITY_FILTER_PAUSED, N_( "Paused" ), GTK_STOCK_MEDIA_PAUSE },
     725        { ACTIVITY_FILTER_FINISHED, N_( "Finished" ), NULL },
    723726        { ACTIVITY_FILTER_QUEUED, N_( "Queued" ), NULL },
    724727        { ACTIVITY_FILTER_VERIFYING, N_( "Verifying" ), GTK_STOCK_REFRESH },
  • branches/2.0x/gtk/tr-core.c

    r10853 r11106  
    483483}
    484484
     485static char *
     486torrentTrackerString( tr_torrent * tor )
     487{
     488    int i;
     489    GString * str = g_string_new( NULL );
     490    const tr_info * inf = tr_torrentInfo( tor );
     491
     492    for( i = 0; i < inf->trackerCount; ++i )
     493    {
     494        const tr_tracker_info * t = &inf->trackers[i];
     495        g_string_append( str, t->announce );
     496    }
     497
     498    return g_string_free( str, FALSE );
     499}
     500
    485501#ifdef HAVE_GIO
    486502
     
    710726                      G_TYPE_DOUBLE,    /* tr_stat.pieceUploadSpeed */
    711727                      G_TYPE_DOUBLE,    /* tr_stat.pieceDownloadSpeed */
    712                       G_TYPE_INT };     /* tr_stat.status */
     728                      G_TYPE_INT,       /* tr_stat.activity */
     729                      G_TYPE_UCHAR,     /* tr_stat.finished */
     730                      G_TYPE_CHAR,      /* tr_priority_t */
     731                      G_TYPE_STRING };  /* concatenated trackers string */
    713732
    714733    p = self->priv = G_TYPE_INSTANCE_GET_PRIVATE( self,
     
    844863    tr_torrent *    tor = tr_torrent_handle( gtor );
    845864    char *          collated = doCollate( inf->name );
     865    char *          trackers = torrentTrackerString( tor );
    846866    GtkListStore *  store = GTK_LIST_STORE( tr_core_model( self ) );
    847867    GtkTreeIter     unused;
     
    855875                                       MC_SPEED_DOWN,    st->pieceDownloadSpeed,
    856876                                       MC_ACTIVITY,      st->activity,
     877                                       MC_FINISHED,      st->finished,
     878                                       MC_PRIORITY,      tr_torrentGetPriority( tor ),
     879                                       MC_TRACKERS,      trackers,
    857880                                       -1 );
    858881
     
    863886    g_object_unref( G_OBJECT( gtor ) );
    864887    g_free( collated );
     888    g_free( trackers );
    865889}
    866890
     
    12431267{
    12441268    int oldActivity, newActivity;
     1269    tr_bool oldFinished, newFinished;
     1270    tr_priority_t oldPriority, newPriority;
     1271    char * oldTrackers, * newTrackers;
    12451272    double oldUpSpeed, newUpSpeed;
    12461273    double oldDownSpeed, newDownSpeed;
    12471274    const tr_stat * st;
    12481275    TrTorrent * gtor;
     1276    tr_torrent * tor;
    12491277
    12501278    /* get the old states */
     
    12521280                        MC_TORRENT, &gtor,
    12531281                        MC_ACTIVITY, &oldActivity,
     1282                        MC_FINISHED, &oldFinished,
     1283                        MC_PRIORITY, &oldPriority,
     1284                        MC_TRACKERS, &oldTrackers,
    12541285                        MC_SPEED_UP, &oldUpSpeed,
    12551286                        MC_SPEED_DOWN, &oldDownSpeed,
     
    12571288
    12581289    /* get the new states */
    1259     st = tr_torrentStat( tr_torrent_handle( gtor ) );
     1290    tor = tr_torrent_handle( gtor );
     1291    st = tr_torrentStat( tor );
    12601292    newActivity = st->activity;
     1293    newFinished = st->finished;
     1294    newPriority = tr_torrentGetPriority( tor );
     1295    newTrackers = torrentTrackerString( tor );
    12611296    newUpSpeed = st->pieceUploadSpeed;
    12621297    newDownSpeed = st->pieceDownloadSpeed;
     
    12651300       so don't do it unless something's actually changed... */
    12661301    if( ( newActivity != oldActivity ) ||
     1302        || ( newFinished != oldFinished )
     1303        || ( newPriority != oldPriority )
     1304        || tr_strcmp( oldTrackers, newTrackers )
    12671305        ( (int)(newUpSpeed*10.0) != (int)(oldUpSpeed*10.0) ) ||
    12681306        ( (int)(newDownSpeed*10.0) != (int)(oldDownSpeed*10.0) ) )
     
    12701308        gtk_list_store_set( GTK_LIST_STORE( model ), iter,
    12711309                            MC_ACTIVITY, newActivity,
     1310                            MC_FINISHED, newFinished,
     1311                            MC_PRIORITY, newPriority,
     1312                            MC_TRACKERS, newTrackers,
    12721313                            MC_SPEED_UP, newUpSpeed,
    12731314                            MC_SPEED_DOWN, newDownSpeed,
     
    12771318    /* cleanup */
    12781319    g_object_unref( gtor );
     1320    g_free( newTrackers );
     1321    g_free( oldTrackers );
    12791322    return FALSE;
    12801323}
  • branches/2.0x/gtk/tr-core.h

    r10717 r11106  
    214214    MC_SPEED_DOWN,
    215215    MC_ACTIVITY,
     216    MC_FINISHED,
     217    MC_PRIORITY,
     218    MC_TRACKERS,
    216219    MC_ROW_COUNT
    217220};
  • branches/2.0x/libtransmission/transmission.h

    r10958 r11106  
    17171717    char errorString[512];
    17181718
    1719     /** When tr_stat.status is TR_STATUS_CHECK or TR_STATUS_CHECK_WAIT,
     1719    /** When tr_stat.activity is TR_STATUS_CHECK or TR_STATUS_CHECK_WAIT,
    17201720        this is the percentage of how much of the files has been
    17211721        verified.  When it gets to 1, the verify process is done.
    17221722        Range is [0..1]
    1723         @see tr_stat.status */
     1723        @see tr_stat.activity */
    17241724    float    recheckProgress;
    17251725
Note: See TracChangeset for help on using the changeset viewer.