1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-20 13:16:53 +00:00

(trunk) add LDS toggles to GTK+ client, Qt client, and transmission-remote

This commit is contained in:
Charles Kerr 2010-05-01 16:23:42 +00:00
parent a17dfd02b2
commit 3473686ee2
7 changed files with 32 additions and 3 deletions

View file

@ -255,6 +255,8 @@ static tr_option opts[] =
{ 'w', "download-dir", "When adding a new torrent, set its download folder. Otherwise, set the default download folder", "w", 1, "<path>" },
{ 'x', "pex", "Enable peer exchange (PEX)", "x", 0, NULL },
{ 'X', "no-pex", "Disable peer exchange (PEX)", "X", 0, NULL },
{ 'z', "lds", "Enable local peer discovery (LDS)", "z", 0, NULL },
{ 'Z', "no-lds", "Disable local peer discovery (LDS)", "Z", 0, NULL },
{ 940, "peer-info", "List the current torrent(s)' peers", "pi", 0, NULL },
{ 0, NULL, NULL, NULL, 0, NULL }
};
@ -323,6 +325,8 @@ getOptMode( int val )
case 'P': /* random incoming peer port */
case 'x': /* pex */
case 'X': /* no-pex */
case 'z': /* lds */
case 'Z': /* no-lds */
case 970: /* alt-speed */
case 971: /* no-alt-speed */
case 972: /* alt-speed-downlimit */
@ -1815,6 +1819,10 @@ processArgs( const char * host, int port, int argc, const char ** argv )
break;
case 'X': tr_bencDictAddBool( args, TR_PREFS_KEY_PEX_ENABLED, FALSE );
break;
case 'z': tr_bencDictAddBool( args, TR_PREFS_KEY_LDS_ENABLED, TRUE );
break;
case 'Z': tr_bencDictAddBool( args, TR_PREFS_KEY_LDS_ENABLED, FALSE );
break;
case 953: tr_bencDictAddReal( args, "seedRatioLimit", atof(optarg) );
tr_bencDictAddBool( args, "seedRatioLimited", TRUE );
break;

View file

@ -55,6 +55,7 @@ and
.Op Fl V
.Op Fl w Ar download-dir
.Op Fl x | X
.Op Fl z | Z
.Op Fl pi
.Ek
.Sh DESCRIPTION
@ -246,6 +247,10 @@ as the default location for newly added torrents to download files to.
Enable peer exchange (PEX).
.It Fl X Fl -no-pex
Disable peer exchange (PEX).
.It Fl z Fl -lds
Enable local peer discovery (LDS).
.It Fl Z Fl -no-lds
Disable local peer discovery (LDS).
.It Fl pi Fl -peer-info
List the current torrent's connected peers.
In the `status' section of the list, the following shorthand is used:

View file

@ -1221,6 +1221,10 @@ prefschanged( TrCore * core UNUSED,
{
tr_sessionSetDHTEnabled( tr, pref_flag_get( key ) );
}
else if( !strcmp( key, TR_PREFS_KEY_LDS_ENABLED ) )
{
tr_sessionSetLDSEnabled( tr, pref_flag_get( key ) );
}
else if( !strcmp( key, TR_PREFS_KEY_RPC_PORT ) )
{
tr_sessionSetRPCPort( tr, pref_int_get( key ) );

View file

@ -554,6 +554,12 @@ privacyPage( GObject * core )
gtr_widget_set_tooltip_text( w, s );
hig_workarea_add_wide_control( t, &row, w );
s = _( "Use LDS to find local peers" );
w = new_check_button( s, TR_PREFS_KEY_LDS_ENABLED, core );
s = _( "LDS is a tool for finding peers on your local network." );
gtr_widget_set_tooltip_text( w, s );
hig_workarea_add_wide_control( t, &row, w );
hig_workarea_finish( t, &row );
g_object_weak_ref( G_OBJECT( t ), privacyPageDestroyed, data );
return t;

View file

@ -451,7 +451,7 @@ PrefsDialog :: createPrivacyTab( )
hig->addSectionTitle( tr( "Blocklist" ) );
QHBoxLayout * h = new QHBoxLayout( );
QIcon i( style()->standardIcon( QStyle::StandardPixmap( QStyle::SP_BrowserReload ) ) );
QPushButton * w = new QPushButton( i, tr( "&Update blocklist" ) );
QWidget * w = new QPushButton( i, tr( "&Update blocklist" ) );
connect( w, SIGNAL(clicked(bool)), this, SLOT(onUpdateBlocklistClicked()));
myBlockWidgets << w;
QWidget * l = checkBoxNew( "", Prefs::BLOCKLIST_ENABLED );
@ -473,8 +473,12 @@ PrefsDialog :: createPrivacyTab( )
hig->addSectionDivider( );
hig->addSectionTitle( tr( "Privacy" ) );
hig->addRow( tr( "&Encryption mode:" ), box );
hig->addWideControl( checkBoxNew( tr( "Use PE&X to find more peers" ), Prefs::PEX_ENABLED ) );
hig->addWideControl( checkBoxNew( tr( "Use &DHT to find more peers" ), Prefs::DHT_ENABLED ) );
hig->addWideControl( w = checkBoxNew( tr( "Use PE&X to find more peers" ), Prefs::PEX_ENABLED ) );
w->setToolTip( tr( "PEX is a tool for exchanging peer lists with the peers you're connected to." ) );
hig->addWideControl( w = checkBoxNew( tr( "Use &DHT to find more peers" ), Prefs::DHT_ENABLED ) );
w->setToolTip( tr( "DHT is a tool for finding peers without a tracker." ) );
hig->addWideControl( w = checkBoxNew( tr( "Use &LDS to find local peers" ), Prefs::LDS_ENABLED ) );
w->setToolTip( tr( "LDS is a tool for finding peers on your local network." ) );
hig->finish( );
updateBlocklistCheckBox( );

View file

@ -93,6 +93,7 @@ Prefs::PrefItem Prefs::myItems[] =
{ TRASH_ORIGINAL, TR_PREFS_KEY_TRASH_ORIGINAL, QVariant::Bool },
{ PEX_ENABLED, TR_PREFS_KEY_PEX_ENABLED, QVariant::Bool },
{ DHT_ENABLED, TR_PREFS_KEY_DHT_ENABLED, QVariant::Bool },
{ LDS_ENABLED, TR_PREFS_KEY_LDS_ENABLED, QVariant::Bool },
{ PORT_FORWARDING, TR_PREFS_KEY_PORT_FORWARDING, QVariant::Bool },
{ PROXY_AUTH_ENABLED, TR_PREFS_KEY_PROXY_AUTH_ENABLED, QVariant::Bool },
{ PREALLOCATION, TR_PREFS_KEY_PREALLOCATION, QVariant::Int },

View file

@ -97,6 +97,7 @@ class Prefs: public QObject
TRASH_ORIGINAL,
PEX_ENABLED,
DHT_ENABLED,
LDS_ENABLED,
PORT_FORWARDING,
PROXY_AUTH_ENABLED,
PREALLOCATION,