(trunk) #1483: move completed torrents to a user-specified directory
This commit is contained in:
parent
45fc5d5846
commit
c35beb3843
|
@ -390,9 +390,11 @@
|
||||||
"alt-speed-up" | number max global upload speed (in K/s)
|
"alt-speed-up" | number max global upload speed (in K/s)
|
||||||
"blocklist-enabled" | boolean true means enabled
|
"blocklist-enabled" | boolean true means enabled
|
||||||
"blocklist-size" | number number of rules in the blocklist
|
"blocklist-size" | number number of rules in the blocklist
|
||||||
|
"download-dir" | string default path to download torrents
|
||||||
"dht-enabled" | boolean true means allow dht in public torrents
|
"dht-enabled" | boolean true means allow dht in public torrents
|
||||||
"encryption" | string "required", "preferred", "tolerated"
|
"encryption" | string "required", "preferred", "tolerated"
|
||||||
"download-dir" | string default path to download torrents
|
"incomplete-dir" | string path for incomplete torrents, when enabled
|
||||||
|
"incomplete-dir-enabled" | boolean true means keep torrents in incomplete-dir until done
|
||||||
"peer-limit-global" | number maximum global number of peers
|
"peer-limit-global" | number maximum global number of peers
|
||||||
"peer-limit-per-torrent" | number maximum global number of peers
|
"peer-limit-per-torrent" | number maximum global number of peers
|
||||||
"pex-enabled" | boolean true means allow pex in public torrents
|
"pex-enabled" | boolean true means allow pex in public torrents
|
||||||
|
@ -559,6 +561,8 @@
|
||||||
| | NO | torrent-get | removed arg "scrapeURL"
|
| | NO | torrent-get | removed arg "scrapeURL"
|
||||||
| | NO | torrent-get | removed arg "seeders"
|
| | NO | torrent-get | removed arg "seeders"
|
||||||
| | NO | torrent-get | removed arg "timesCompleted"
|
| | NO | torrent-get | removed arg "timesCompleted"
|
||||||
| | yes NO | torrent-get | new arg "trackerStats"
|
| | yes | torrent-get | new arg "trackerStats"
|
||||||
|
| | yes | session-set | new arg "incomplete-dir"
|
||||||
|
| | yes | session-set | new arg "incomplete-dir-enabled"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1146,6 +1146,10 @@ sessionSet( tr_session * session,
|
||||||
tr_blocklistSetEnabled( session, boolVal );
|
tr_blocklistSetEnabled( session, boolVal );
|
||||||
if( tr_bencDictFindStr( args_in, TR_PREFS_KEY_DOWNLOAD_DIR, &str ) )
|
if( tr_bencDictFindStr( args_in, TR_PREFS_KEY_DOWNLOAD_DIR, &str ) )
|
||||||
tr_sessionSetDownloadDir( session, str );
|
tr_sessionSetDownloadDir( session, str );
|
||||||
|
if( tr_bencDictFindStr( args_in, TR_PREFS_KEY_INCOMPLETE_DIR, &str ) )
|
||||||
|
tr_sessionSetIncompleteDir( session, str );
|
||||||
|
if( tr_bencDictFindBool( args_in, TR_PREFS_KEY_INCOMPLETE_DIR_ENABLED, &boolVal ) )
|
||||||
|
tr_sessionSetIncompleteDirEnabled( session, boolVal );
|
||||||
if( tr_bencDictFindInt( args_in, TR_PREFS_KEY_PEER_LIMIT_GLOBAL, &i ) )
|
if( tr_bencDictFindInt( args_in, TR_PREFS_KEY_PEER_LIMIT_GLOBAL, &i ) )
|
||||||
tr_sessionSetPeerLimit( session, i );
|
tr_sessionSetPeerLimit( session, i );
|
||||||
if( tr_bencDictFindInt( args_in, TR_PREFS_KEY_PEER_LIMIT_TORRENT, &i ) )
|
if( tr_bencDictFindInt( args_in, TR_PREFS_KEY_PEER_LIMIT_TORRENT, &i ) )
|
||||||
|
@ -1255,12 +1259,14 @@ sessionGet( tr_session * s,
|
||||||
tr_bencDictAddStr ( d, TR_PREFS_KEY_DOWNLOAD_DIR, tr_sessionGetDownloadDir( s ) );
|
tr_bencDictAddStr ( d, TR_PREFS_KEY_DOWNLOAD_DIR, tr_sessionGetDownloadDir( s ) );
|
||||||
tr_bencDictAddInt ( d, TR_PREFS_KEY_PEER_LIMIT_GLOBAL, tr_sessionGetPeerLimit( s ) );
|
tr_bencDictAddInt ( d, TR_PREFS_KEY_PEER_LIMIT_GLOBAL, tr_sessionGetPeerLimit( s ) );
|
||||||
tr_bencDictAddInt ( d, TR_PREFS_KEY_PEER_LIMIT_TORRENT, tr_sessionGetPeerLimitPerTorrent( s ) );
|
tr_bencDictAddInt ( d, TR_PREFS_KEY_PEER_LIMIT_TORRENT, tr_sessionGetPeerLimitPerTorrent( s ) );
|
||||||
|
tr_bencDictAddStr ( d, TR_PREFS_KEY_INCOMPLETE_DIR, tr_sessionGetIncompleteDir( s ) );
|
||||||
|
tr_bencDictAddBool( d, TR_PREFS_KEY_INCOMPLETE_DIR_ENABLED, tr_sessionGetIncompleteDirEnabled( s ) );
|
||||||
tr_bencDictAddBool( d, TR_PREFS_KEY_PEX_ENABLED, tr_sessionIsPexEnabled( s ) );
|
tr_bencDictAddBool( d, TR_PREFS_KEY_PEX_ENABLED, tr_sessionIsPexEnabled( s ) );
|
||||||
tr_bencDictAddBool( d, TR_PREFS_KEY_DHT_ENABLED, tr_sessionIsDHTEnabled( s ) );
|
tr_bencDictAddBool( d, TR_PREFS_KEY_DHT_ENABLED, tr_sessionIsDHTEnabled( s ) );
|
||||||
tr_bencDictAddInt ( d, TR_PREFS_KEY_PEER_PORT, tr_sessionGetPeerPort( s ) );
|
tr_bencDictAddInt ( d, TR_PREFS_KEY_PEER_PORT, tr_sessionGetPeerPort( s ) );
|
||||||
tr_bencDictAddInt ( d, TR_PREFS_KEY_PEER_PORT_RANDOM_ON_START, tr_sessionGetPeerPortRandomOnStart( s ) );
|
tr_bencDictAddInt ( d, TR_PREFS_KEY_PEER_PORT_RANDOM_ON_START, tr_sessionGetPeerPortRandomOnStart( s ) );
|
||||||
tr_bencDictAddBool( d, TR_PREFS_KEY_PORT_FORWARDING, tr_sessionIsPortForwardingEnabled( s ) );
|
tr_bencDictAddBool( d, TR_PREFS_KEY_PORT_FORWARDING, tr_sessionIsPortForwardingEnabled( s ) );
|
||||||
tr_bencDictAddInt ( d, "rpc-version", 6 );
|
tr_bencDictAddInt ( d, "rpc-version", 7 );
|
||||||
tr_bencDictAddInt ( d, "rpc-version-minimum", 1 );
|
tr_bencDictAddInt ( d, "rpc-version-minimum", 1 );
|
||||||
tr_bencDictAddReal( d, "seedRatioLimit", tr_sessionGetRatioLimit( s ) );
|
tr_bencDictAddReal( d, "seedRatioLimit", tr_sessionGetRatioLimit( s ) );
|
||||||
tr_bencDictAddBool( d, "seedRatioLimited", tr_sessionIsRatioLimited( s ) );
|
tr_bencDictAddBool( d, "seedRatioLimited", tr_sessionIsRatioLimited( s ) );
|
||||||
|
|
|
@ -485,14 +485,35 @@ PrefsDialog :: createPrivacyTab( )
|
||||||
****
|
****
|
||||||
***/
|
***/
|
||||||
|
|
||||||
|
void
|
||||||
|
PrefsDialog :: onIncompleteClicked( void )
|
||||||
|
{
|
||||||
|
const QString title = tr( "Select Incomplete Directory" );
|
||||||
|
const QString path = myPrefs.getString( Prefs::INCOMPLETE_DIR );
|
||||||
|
QFileDialog * d = new QFileDialog( this, title, path );
|
||||||
|
d->setFileMode( QFileDialog::Directory );
|
||||||
|
connect( d, SIGNAL(filesSelected(const QStringList&)),
|
||||||
|
this, SLOT(onIncompleteSelected(const QStringList&)) );
|
||||||
|
d->show( );
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PrefsDialog :: onIncompleteSelected( const QStringList& list )
|
||||||
|
{
|
||||||
|
if( list.size() == 1 )
|
||||||
|
myPrefs.set( Prefs::INCOMPLETE_DIR, list.first( ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PrefsDialog :: onWatchClicked( void )
|
PrefsDialog :: onWatchClicked( void )
|
||||||
{
|
{
|
||||||
QFileDialog * d = new QFileDialog( this,
|
const QString title = tr( "Select Watch Directory" );
|
||||||
tr( "Select Watch Directory" ),
|
const QString path = myPrefs.getString( Prefs::DIR_WATCH );
|
||||||
myPrefs.getString( Prefs::DIR_WATCH ) );
|
QFileDialog * d = new QFileDialog( this, title, path );
|
||||||
d->setFileMode( QFileDialog::Directory );
|
d->setFileMode( QFileDialog::Directory );
|
||||||
connect( d, SIGNAL(filesSelected(const QStringList&)), this, SLOT(onWatchSelected(const QStringList&)) );
|
connect( d, SIGNAL(filesSelected(const QStringList&)),
|
||||||
|
this, SLOT(onWatchSelected(const QStringList&)) );
|
||||||
d->show( );
|
d->show( );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -506,11 +527,12 @@ PrefsDialog :: onWatchSelected( const QStringList& list )
|
||||||
void
|
void
|
||||||
PrefsDialog :: onDestinationClicked( void )
|
PrefsDialog :: onDestinationClicked( void )
|
||||||
{
|
{
|
||||||
QFileDialog * d = new QFileDialog( this,
|
const QString title = tr( "Select Destination" );
|
||||||
tr( "Select Destination" ),
|
const QString path = myPrefs.getString( Prefs::DOWNLOAD_DIR );
|
||||||
myPrefs.getString( Prefs::DOWNLOAD_DIR ) );
|
QFileDialog * d = new QFileDialog( this, title, path );
|
||||||
d->setFileMode( QFileDialog::Directory );
|
d->setFileMode( QFileDialog::Directory );
|
||||||
connect( d, SIGNAL(filesSelected(const QStringList&)), this, SLOT(onDestinationSelected(const QStringList&)) );
|
connect( d, SIGNAL(filesSelected(const QStringList&)),
|
||||||
|
this, SLOT(onDestinationSelected(const QStringList&)) );
|
||||||
d->show( );
|
d->show( );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,8 @@ class PrefsDialog: public QDialog
|
||||||
void sessionUpdated( );
|
void sessionUpdated( );
|
||||||
void onWatchClicked( );
|
void onWatchClicked( );
|
||||||
void onWatchSelected( const QStringList& );
|
void onWatchSelected( const QStringList& );
|
||||||
|
void onIncompleteClicked( );
|
||||||
|
void onIncompleteSelected( const QStringList& );
|
||||||
void onDestinationClicked( );
|
void onDestinationClicked( );
|
||||||
void onDestinationSelected( const QStringList& );
|
void onDestinationSelected( const QStringList& );
|
||||||
void onPortTested( bool );
|
void onPortTested( bool );
|
||||||
|
@ -94,6 +96,7 @@ class PrefsDialog: public QDialog
|
||||||
QLabel * myPortLabel;
|
QLabel * myPortLabel;
|
||||||
QPushButton * myPortButton;
|
QPushButton * myPortButton;
|
||||||
QPushButton * myWatchButton;
|
QPushButton * myWatchButton;
|
||||||
|
QPushButton * myIncompleteButton;
|
||||||
QPushButton * myDestinationButton;
|
QPushButton * myDestinationButton;
|
||||||
QWidgetList myWebWidgets;
|
QWidgetList myWebWidgets;
|
||||||
QWidgetList myWebAuthWidgets;
|
QWidgetList myWebAuthWidgets;
|
||||||
|
|
|
@ -77,6 +77,8 @@ Prefs::PrefItem Prefs::myItems[] =
|
||||||
{ DSPEED_ENABLED, TR_PREFS_KEY_DSPEED_ENABLED, QVariant::Bool },
|
{ DSPEED_ENABLED, TR_PREFS_KEY_DSPEED_ENABLED, QVariant::Bool },
|
||||||
{ DOWNLOAD_DIR, TR_PREFS_KEY_DOWNLOAD_DIR, QVariant::String },
|
{ DOWNLOAD_DIR, TR_PREFS_KEY_DOWNLOAD_DIR, QVariant::String },
|
||||||
{ ENCRYPTION, TR_PREFS_KEY_ENCRYPTION, QVariant::Int },
|
{ ENCRYPTION, TR_PREFS_KEY_ENCRYPTION, QVariant::Int },
|
||||||
|
{ INCOMPLETE_DIR, TR_PREFS_KEY_INCOMPLETE_DIR, QVariant::String },
|
||||||
|
{ INCOMPLETE_DIR_ENABLED, TR_PREFS_KEY_INCOMPLETE_DIR_ENABLED, QVariant::Bool },
|
||||||
{ LAZY_BITFIELD, TR_PREFS_KEY_LAZY_BITFIELD, QVariant::Bool },
|
{ LAZY_BITFIELD, TR_PREFS_KEY_LAZY_BITFIELD, QVariant::Bool },
|
||||||
{ MSGLEVEL, TR_PREFS_KEY_MSGLEVEL, QVariant::Int },
|
{ MSGLEVEL, TR_PREFS_KEY_MSGLEVEL, QVariant::Int },
|
||||||
{ OPEN_FILE_LIMIT, TR_PREFS_KEY_OPEN_FILE_LIMIT, QVariant::Int },
|
{ OPEN_FILE_LIMIT, TR_PREFS_KEY_OPEN_FILE_LIMIT, QVariant::Int },
|
||||||
|
|
|
@ -81,6 +81,8 @@ class Prefs: public QObject
|
||||||
DSPEED_ENABLED,
|
DSPEED_ENABLED,
|
||||||
DOWNLOAD_DIR,
|
DOWNLOAD_DIR,
|
||||||
ENCRYPTION,
|
ENCRYPTION,
|
||||||
|
INCOMPLETE_DIR,
|
||||||
|
INCOMPLETE_DIR_ENABLED,
|
||||||
LAZY_BITFIELD,
|
LAZY_BITFIELD,
|
||||||
MSGLEVEL,
|
MSGLEVEL,
|
||||||
OPEN_FILE_LIMIT,
|
OPEN_FILE_LIMIT,
|
||||||
|
|
|
@ -122,6 +122,8 @@ Session :: updatePref( int key )
|
||||||
case Prefs :: BLOCKLIST_DATE:
|
case Prefs :: BLOCKLIST_DATE:
|
||||||
case Prefs :: DHT_ENABLED:
|
case Prefs :: DHT_ENABLED:
|
||||||
case Prefs :: DOWNLOAD_DIR:
|
case Prefs :: DOWNLOAD_DIR:
|
||||||
|
case Prefs :: INCOMPLETE_DIR:
|
||||||
|
case Prefs :: INCOMPLETE_DIR_ENABLED:
|
||||||
case Prefs :: PEER_LIMIT_GLOBAL:
|
case Prefs :: PEER_LIMIT_GLOBAL:
|
||||||
case Prefs :: PEER_LIMIT_TORRENT:
|
case Prefs :: PEER_LIMIT_TORRENT:
|
||||||
case Prefs :: USPEED_ENABLED:
|
case Prefs :: USPEED_ENABLED:
|
||||||
|
|
Loading…
Reference in New Issue