diff --git a/daemon/remote.c b/daemon/remote.c index af7827786..29ba0a561 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -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, "" }, { '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; diff --git a/daemon/transmission-remote.1 b/daemon/transmission-remote.1 index bab2ad9c6..db0ef5d39 100644 --- a/daemon/transmission-remote.1 +++ b/daemon/transmission-remote.1 @@ -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: diff --git a/gtk/main.c b/gtk/main.c index 0ed44f97a..c4372ddb8 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -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 ) ); diff --git a/gtk/tr-prefs.c b/gtk/tr-prefs.c index 0f869cf28..a2307be6b 100644 --- a/gtk/tr-prefs.c +++ b/gtk/tr-prefs.c @@ -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; diff --git a/qt/prefs-dialog.cc b/qt/prefs-dialog.cc index e966ca551..89715ae8b 100644 --- a/qt/prefs-dialog.cc +++ b/qt/prefs-dialog.cc @@ -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( ); diff --git a/qt/prefs.cc b/qt/prefs.cc index fbee37c29..7279e7587 100644 --- a/qt/prefs.cc +++ b/qt/prefs.cc @@ -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 }, diff --git a/qt/prefs.h b/qt/prefs.h index 582c4904c..7eb92b428 100644 --- a/qt/prefs.h +++ b/qt/prefs.h @@ -97,6 +97,7 @@ class Prefs: public QObject TRASH_ORIGINAL, PEX_ENABLED, DHT_ENABLED, + LDS_ENABLED, PORT_FORWARDING, PROXY_AUTH_ENABLED, PREALLOCATION,