Changeset 8192


Ignore:
Timestamp:
Apr 9, 2009, 10:42:55 PM (12 years ago)
Author:
charles
Message:

(trunk qt,gtk) include torrents-being-verified in the "active torrents" filter.

Location:
trunk
Files:
7 edited

Legend:

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

    r8173 r8192  
    373373        {
    374374            const tr_stat * s = tr_torrentStatCached( tor );
    375             ret = s->peersSendingToUs > 0 || s->peersGettingFromUs > 0;
     375            ret = s->peersSendingToUs > 0
     376               || s->peersGettingFromUs > 0
     377               || tr_torrentGetActivity( tor ) == TR_STATUS_CHECK;
    376378            break;
    377379        }
  • trunk/qt/prefs-dialog.cc

    r8188 r8192  
    445445    connect( w, SIGNAL(clicked(bool)), this, SLOT(onUpdateBlocklistClicked()));
    446446    myBlockWidgets << w;
    447     QWidget * l = checkBoxNew( tr( "Enable &blocklist (contains %Ln rule(s))", 0, session.blocklistSize( ) ), Prefs::BLOCKLIST_ENABLED );
     447    QWidget * l = checkBoxNew( "", Prefs::BLOCKLIST_ENABLED );
    448448    h->addWidget( l );
    449449    h->addStretch( 1 );
     
    472472
    473473    hig->finish( );
    474     myUnsupportedWhenRemote << myBlockWidgets;
     474    updateBlocklistCheckBox( );
    475475    return hig;
    476476}
     
    619619PrefsDialog :: sessionUpdated( )
    620620{
     621    updateBlocklistCheckBox( );
     622}
     623
     624void
     625PrefsDialog :: updateBlocklistCheckBox( )
     626{
    621627    QCheckBox * box = qobject_cast<QCheckBox*>( myWidgets[Prefs::BLOCKLIST_ENABLED] );
    622     box->setText( tr( "Enable &blocklist (%Ln rules)", 0, mySession.blocklistSize( ) ) );
     628    const int n = mySession.blocklistSize( );
     629    if( n < 0 ) // unknown
     630        box->setText( tr( "Enable &blocklist" ) );
     631    else
     632        box->setText( tr( "Enable &blocklist (%Ln rules)", 0, n ) );
    623633}
    624634
     
    657667        case Prefs :: BLOCKLIST_ENABLED: {
    658668            const bool enabled = myPrefs.getBool( key );
     669            std::cerr << " setting " << myBlockWidgets.size() << " block widgets to " << enabled << std::endl;
    659670            foreach( QWidget * w, myBlockWidgets ) w->setEnabled( enabled );
    660671            break;
  • trunk/qt/prefs-dialog.h

    r8188 r8192  
    7070        QLineEdit * lineEditNew( int key, int mode = 0 );
    7171        void enableBuddyWhenChecked( QCheckBox *, QWidget * );
     72        void updateBlocklistCheckBox( );
    7273
    7374    public:
  • trunk/qt/session.cc

    r8188 r8192  
    175175
    176176Session :: Session( const char * configDir, Prefs& prefs, const char * url, bool paused ):
    177     myBlocklistSize( ),
     177    myBlocklistSize( -1 ),
    178178    myPrefs( prefs ),
    179179    mySession( 0 ),
  • trunk/qt/torrent-delegate.cc

    r8188 r8192  
    219219    }
    220220
    221     if( !tor.isChecking( ) && !tor.isPaused( ) )
     221    if( tor.isReadyToTransfer( ) )
    222222        str += tr( " - " ) + shortTransferString( tor );
    223223
    224     //str += "asdfasdf";
    225224    return str;
    226225}
  • trunk/qt/torrent-filter.cc

    r8188 r8192  
    8181            break;
    8282        case SHOW_ACTIVE:
    83             accepts = tor->peersWeAreUploadingTo( ) > 0 || tor->peersWeAreDownloadingFrom( ) > 0;
     83            accepts = tor->peersWeAreUploadingTo( ) > 0 || tor->peersWeAreDownloadingFrom( ) > 0 || tor->isVerifying( );
    8484            break;
    8585        case SHOW_DOWNLOADING:
  • trunk/qt/torrent.h

    r8188 r8192  
    272272        tr_torrent_activity getActivity( ) const { return (tr_torrent_activity) getInt( ACTIVITY ); }
    273273        bool isPaused( ) const { return getActivity( ) == TR_STATUS_STOPPED; }
    274         bool isChecking( ) const { return getActivity( ) == TR_STATUS_CHECK || getActivity( ) == TR_STATUS_CHECK_WAIT; }
     274        bool isVerifying( ) const { return getActivity( ) == TR_STATUS_CHECK; }
    275275        bool isDownloading( ) const { return getActivity( ) == TR_STATUS_DOWNLOAD; }
     276        bool isReadyToTransfer( ) const { return getActivity()==TR_STATUS_DOWNLOAD || getActivity()==TR_STATUS_SEED; }
    276277        void notifyComplete( ) const;
    277278
Note: See TracChangeset for help on using the changeset viewer.