Changeset 12609


Ignore:
Timestamp:
Aug 1, 2011, 11:27:11 PM (10 years ago)
Author:
jordan
Message:

#671 "torrent queuing" -- add a tr_stat.isStalled flag.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/extras/rpc-spec.txt

    r12607 r12609  
    165165   isFinished                  | boolean                     | tr_stat
    166166   isPrivate                   | boolean                     | tr_torrent
     167   isStalled                   | boolean                     | tr_stat
    167168   leftUntilDone               | number                      | tr_stat
    168169   magnetLink                  | number                      | n/a
     
    691692   14    | 2.40    |        NO | torrent-get    | values of "status" field changed
    692693         |         | yes       | torrent-get    | new arg "queuePosition"
     694         |         | yes       | torrent-get    | new arg "isStalled"
    693695         |         | yes       | torrent-set    | new arg "queuePosition"
    694696         |         | yes       | session-set    | new arg "download-queue-size"
  • trunk/gtk/torrent-cell-renderer.c

    r12607 r12609  
    192192        g_snprintf( buf, buflen, _( "%1$s %2$s" ),
    193193                    gtr_get_unicode_string( GTR_UNICODE_UP ), upStr );
     194    else if( st->isStalled )
     195        g_strlcpy( buf, _( "Stalled" ), buflen );
    194196    else if( haveMeta )
    195         /* the torrent isn't uploading or downloading */
    196197        g_strlcpy( buf, _( "Idle" ), buflen );
    197198    else
  • trunk/libtransmission/rpcimpl.c

    r12607 r12609  
    610610    else if( tr_streq( key, keylen, "isPrivate" ) )
    611611        tr_bencDictAddBool( d, key, tr_torrentIsPrivate( tor ) );
     612    else if( tr_streq( key, keylen, "isStalled" ) )
     613        tr_bencDictAddBool( d, key, st->isStalled );
    612614    else if( tr_streq( key, keylen, "leftUntilDone" ) )
    613615        tr_bencDictAddInt( d, key, st->leftUntilDone );
  • trunk/libtransmission/torrent.c

    r12607 r12609  
    11841184    s->error = tor->error;
    11851185    s->queuePosition = tor->queuePosition;
     1186    s->isStalled = tr_torrentIsStalled( tor );
    11861187    tr_strlcpy( s->errorString, tor->errorString, sizeof( s->errorString ) );
    11871188
  • trunk/libtransmission/transmission.h

    r12607 r12609  
    20012001        This will be >= 0 if the torrent is queued; -1 otherwise. */
    20022002    int queuePosition;
     2003
     2004    /** True if the torrent is running, but has been idle for long enough
     2005        to be considered stalled.  @see tr_sessionGetQueueStalledMinutes() */
     2006    bool isStalled;
    20032007}
    20042008tr_stat;
  • trunk/qt/torrent-delegate.cc

    r12464 r12609  
    179179    else if( haveUp )
    180180        str = tr( "%1 %2" ).arg(upArrow).arg(upStr);
     181    else if( tor.isStalled( ) )
     182        str = tr( "Stalled" );
    181183    else if( tor.hasMetadata( ) )
    182184        str = tr( "Idle" );
  • trunk/qt/torrent.cc

    r12607 r12609  
    103103    { IS_FINISHED, "isFinished", QVariant::Bool, STAT },
    104104    { IS_PRIVATE, "isPrivate", QVariant::Bool, INFO },
     105    { IS_STALLED, "isStalled", QVariant::Bool, STAT },
    105106    { COMMENT, "comment", QVariant::String, INFO },
    106107    { CREATOR, "creator", QVariant::String, INFO },
     
    109110    { TORRENT_FILE, "torrentFile", QVariant::String, STAT_EXTRA },
    110111    { BANDWIDTH_PRIORITY, "bandwidthPriority", QVariant::Int, STAT_EXTRA },
    111     { QUEUE_POSITION, "queuePosition", QVariant::Int, STAT }
     112    { QUEUE_POSITION, "queuePosition", QVariant::Int, STAT },
    112113};
    113114
  • trunk/qt/torrent.h

    r12607 r12609  
    167167            IS_FINISHED,
    168168            IS_PRIVATE,
     169            IS_STALLED,
    169170            COMMENT,
    170171            CREATOR,
     
    309310        int queuePosition( ) const { return getInt( QUEUE_POSITION ); }
    310311        bool isQueued( ) const { return queuePosition( ) >= 0; }
     312        bool isStalled( ) const { return getBool( IS_STALLED ); }
    311313
    312314    public:
Note: See TracChangeset for help on using the changeset viewer.