case FILTER_MODE_ACTIVE:
{
const tr_stat * s = tr_torrentStatCached( tor );
- ret = s->peersSendingToUs > 0 || s->peersGettingFromUs > 0;
+ ret = s->peersSendingToUs > 0
+ || s->peersGettingFromUs > 0
+ || tr_torrentGetActivity( tor ) == TR_STATUS_CHECK;
break;
}
QPushButton * w = new QPushButton( i, tr( "&Update blocklist" ) );
connect( w, SIGNAL(clicked(bool)), this, SLOT(onUpdateBlocklistClicked()));
myBlockWidgets << w;
- QWidget * l = checkBoxNew( tr( "Enable &blocklist (contains %Ln rule(s))", 0, session.blocklistSize( ) ), Prefs::BLOCKLIST_ENABLED );
+ QWidget * l = checkBoxNew( "", Prefs::BLOCKLIST_ENABLED );
h->addWidget( l );
h->addStretch( 1 );
h->addWidget( w );
hig->addWideControl( checkBoxNew( tr( "Use peer e&xchange" ), Prefs::PEX_ENABLED ) );
hig->finish( );
- myUnsupportedWhenRemote << myBlockWidgets;
+ updateBlocklistCheckBox( );
return hig;
}
void
PrefsDialog :: sessionUpdated( )
+{
+ updateBlocklistCheckBox( );
+}
+
+void
+PrefsDialog :: updateBlocklistCheckBox( )
{
QCheckBox * box = qobject_cast<QCheckBox*>( myWidgets[Prefs::BLOCKLIST_ENABLED] );
- box->setText( tr( "Enable &blocklist (%Ln rules)", 0, mySession.blocklistSize( ) ) );
+ const int n = mySession.blocklistSize( );
+ if( n < 0 ) // unknown
+ box->setText( tr( "Enable &blocklist" ) );
+ else
+ box->setText( tr( "Enable &blocklist (%Ln rules)", 0, n ) );
}
void
case Prefs :: BLOCKLIST_ENABLED: {
const bool enabled = myPrefs.getBool( key );
+ std::cerr << " setting " << myBlockWidgets.size() << " block widgets to " << enabled << std::endl;
foreach( QWidget * w, myBlockWidgets ) w->setEnabled( enabled );
break;
}
QTimeEdit * timeEditNew( int key );
QLineEdit * lineEditNew( int key, int mode = 0 );
void enableBuddyWhenChecked( QCheckBox *, QWidget * );
+ void updateBlocklistCheckBox( );
public:
PrefsDialog( Session&, Prefs&, QWidget * parent = 0 );
***/
Session :: Session( const char * configDir, Prefs& prefs, const char * url, bool paused ):
- myBlocklistSize( ),
+ myBlocklistSize( -1 ),
myPrefs( prefs ),
mySession( 0 ),
myUrl( url )
break;
}
- if( !tor.isChecking( ) && !tor.isPaused( ) )
+ if( tor.isReadyToTransfer( ) )
str += tr( " - " ) + shortTransferString( tor );
- //str += "asdfasdf";
return str;
}
accepts = true;
break;
case SHOW_ACTIVE:
- accepts = tor->peersWeAreUploadingTo( ) > 0 || tor->peersWeAreDownloadingFrom( ) > 0;
+ accepts = tor->peersWeAreUploadingTo( ) > 0 || tor->peersWeAreDownloadingFrom( ) > 0 || tor->isVerifying( );
break;
case SHOW_DOWNLOADING:
accepts = activity == TR_STATUS_DOWNLOAD;
QString activityString( ) const;
tr_torrent_activity getActivity( ) const { return (tr_torrent_activity) getInt( ACTIVITY ); }
bool isPaused( ) const { return getActivity( ) == TR_STATUS_STOPPED; }
- bool isChecking( ) const { return getActivity( ) == TR_STATUS_CHECK || getActivity( ) == TR_STATUS_CHECK_WAIT; }
+ bool isVerifying( ) const { return getActivity( ) == TR_STATUS_CHECK; }
bool isDownloading( ) const { return getActivity( ) == TR_STATUS_DOWNLOAD; }
+ bool isReadyToTransfer( ) const { return getActivity()==TR_STATUS_DOWNLOAD || getActivity()==TR_STATUS_SEED; }
void notifyComplete( ) const;
public: