]> granicus.if.org Git - transmission/commitdiff
(trunk T) add preliminary enable/disable toggles in daemon, gtk, and qt clients....
authorJordan Lee <jordan@transmissionbt.com>
Fri, 18 Feb 2011 00:33:29 +0000 (00:33 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Fri, 18 Feb 2011 00:33:29 +0000 (00:33 +0000)
daemon/remote.c
daemon/transmission-remote.1
gtk/main.c
gtk/tr-prefs.c
qt/prefs-dialog.cc
qt/prefs.cc
qt/prefs.h
qt/qtr.pro
qt/session.cc

index 875fdcabac8e2f1b5e9ff95a11b7cb6bc2070c2c..74efc635ffe92914f36d465da1771eda0db37174 100644 (file)
@@ -298,6 +298,8 @@ static tr_option opts[] =
     { 985, "no-honor-session",       "Make the current torrent(s) not honor the session limits", "HL",  0, NULL },
     { 'u', "uplimit",                "Set the max upload speed in "SPEED_K_STR" for the current torrent(s) or globally", "u", 1, "<speed>" },
     { 'U', "no-uplimit",             "Disable max upload speed for the current torrent(s) or globally", "U", 0, NULL },
+    { 830, "utp",                    "Enable uTP for peer connections", NULL, 0, NULL },
+    { 831, "no-utp",                 "Disable uTP for peer connections", NULL, 0, NULL },
     { 'v', "verify",                 "Verify the current torrent(s)", "v",  0, NULL },
     { 'V', "version",                "Show version number and exit", "V", 0, NULL },
     { 'w', "download-dir",           "When adding a new torrent, set its download folder. Otherwise, set the default download folder", "w",  1, "<path>" },
@@ -380,6 +382,8 @@ getOptMode( int val )
         case 'Y': /* no-lpd */
         case 800: /* torrent-done-script */
         case 801: /* no-torrent-done-script */
+        case 830: /* utp */
+        case 831: /* no-utp */
         case 970: /* alt-speed */
         case 971: /* no-alt-speed */
         case 972: /* alt-speed-downlimit */
@@ -1991,6 +1995,10 @@ processArgs( const char * rpcurl, int argc, const char ** argv )
                           break;
                 case 'O': tr_bencDictAddBool( args, TR_PREFS_KEY_DHT_ENABLED, FALSE );
                           break;
+                case 830: tr_bencDictAddBool( args, TR_PREFS_KEY_UTP_ENABLED, TRUE );
+                          break;
+                case 831: tr_bencDictAddBool( args, TR_PREFS_KEY_UTP_ENABLED, FALSE );
+                          break;
                 case 'p': tr_bencDictAddInt( args, TR_PREFS_KEY_PEER_PORT, numarg( optarg ) );
                           break;
                 case 'P': tr_bencDictAddBool( args, TR_PREFS_KEY_PEER_PORT_RANDOM_ON_START, TRUE);
index f16d8655665f55cbbd04e87153483ee0ed7cffed..51842c65f46dc4f96c7aed05bcf41fc38eef3255 100644 (file)
@@ -57,6 +57,7 @@ and
 .Op Fl hl
 .Op Fl HL
 .Op Fl u Ar number | Fl U
+.Op Fl utp | no-utp
 .Op Fl v
 .Op Fl V
 .Op Fl w Ar download-dir
@@ -267,6 +268,10 @@ KiB/s.
 If current torrent(s) are selected this operates on them. Otherwise, it changes the global setting.
 .It Fl U Fl -no-uplimit
 Disable upload speed limits.
+.It Fl -utp
+Enable uTP for peer connections.
+.It Fl -no-utp
+Disable uTP for peer connections.
 If current torrent(s) are selected this operates on them. Otherwise, it changes the global setting.
 .It Fl v Fl -verify
 Verify the current torrent(s)
index 859ab877bf2200af8b0bd5f4fcbf4e0cf368fd83..47b383abe87822630e2daea23b2f193388cf5d6f 100644 (file)
@@ -1451,6 +1451,10 @@ on_prefs_changed( TrCore * core UNUSED, const char * key, gpointer data )
     {
         tr_sessionSetDHTEnabled( tr, gtr_pref_flag_get( key ) );
     }
+    else if( !strcmp( key, TR_PREFS_KEY_UTP_ENABLED ) )
+    {
+        tr_sessionSetUTPEnabled( tr, gtr_pref_flag_get( key ) );
+    }
     else if( !strcmp( key, TR_PREFS_KEY_LPD_ENABLED ) )
     {
         tr_sessionSetLPDEnabled( tr, gtr_pref_flag_get( key ) );
index f80c263189192cb7d3aab91c7fbb01b5d24cfd1c..85b7b42e4fad875c8db5da780777753d2a8825e9 100644 (file)
@@ -1217,6 +1217,12 @@ networkPage( GObject * core )
     hig_workarea_add_section_divider( t, &row );
     hig_workarea_add_section_title( t, &row, _( "Options" ) );
 
+    s = _( "Enable _uTP for peer communication" );
+    w = new_check_button( s, TR_PREFS_KEY_UTP_ENABLED, core );
+    s = _( "uTP is a tool for reducing network congestion." );
+    gtr_widget_set_tooltip_text( w, s );
+    hig_workarea_add_wide_control( t, &row, w );
+
     w = gtk_button_new_with_mnemonic( _( "Edit GNOME Proxy Settings" ) );
     g_signal_connect( w, "clicked", G_CALLBACK( onGNOMEClicked ), data );
     h = gtk_hbox_new( FALSE, 0 );
index 0dcddc925d33b3b5bbc4056d0fe2aaec587a5cba..5e9e1fc895b0d5f0578910b4c9601062c98b964b 100644 (file)
@@ -355,6 +355,13 @@ PrefsDialog :: createNetworkTab( )
     hig->addRow( tr( "Maximum peers per &torrent:" ), spinBoxNew( Prefs::PEER_LIMIT_TORRENT, 1, 300, 5 ) );
     hig->addRow( tr( "Maximum peers &overall:" ), spinBoxNew( Prefs::PEER_LIMIT_GLOBAL, 1, 3000, 5 ) );
 
+    hig->addSectionDivider( );
+    hig->addSectionTitle( tr( "Options" ) );
+
+    QWidget * w;
+    hig->addWideControl( w = checkBoxNew( tr( "Enable &uTP for peer connections" ), Prefs::UTP_ENABLED ) );
+    w->setToolTip( tr( "uTP is a tool for reducing network congestion." ) );
+
     hig->finish( );
     return hig;
 }
index 33bed31d69120b5880957854b73cf49281d50704..0f0667be678c448bccedd77fa05f845f871d25e0 100644 (file)
@@ -100,6 +100,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 },
+    { UTP_ENABLED, TR_PREFS_KEY_UTP_ENABLED, QVariant::Bool },
     { LPD_ENABLED, TR_PREFS_KEY_LPD_ENABLED, QVariant::Bool },
     { PORT_FORWARDING, TR_PREFS_KEY_PORT_FORWARDING, QVariant::Bool },
     { PREALLOCATION, TR_PREFS_KEY_PREALLOCATION, QVariant::Int },
index 6ef11b9b785c206227a0e10503569f3392b5a8e7..b26284003e56557ec8d4b71cbc448d74c6b3e811 100644 (file)
@@ -105,6 +105,7 @@ class Prefs: public QObject
             TRASH_ORIGINAL,
             PEX_ENABLED,
             DHT_ENABLED,
+            UTP_ENABLED,
             LPD_ENABLED,
             PORT_FORWARDING,
             PREALLOCATION,
index 93a699eb66628ffc57589be748afa78f620ef337..2bcdeda8f813c87f9e102bb26b530cbf363a4837 100644 (file)
@@ -16,9 +16,10 @@ QT += network
 PKGCONFIG = fontconfig libcurl openssl libevent
 
 TRANSMISSION_TOP = ..
+INCLUDEPATH = $${EVENT_TOP}/include $${INCLUDEPATH}
 INCLUDEPATH += $${TRANSMISSION_TOP}
 LIBS += $${TRANSMISSION_TOP}/libtransmission/libtransmission.a
-LIBS += $${TRANSMISSION_TOP}/third-party/dht/libutp.a
+LIBS += $${TRANSMISSION_TOP}/third-party/libutp/libutp.a
 LIBS += $${TRANSMISSION_TOP}/third-party/dht/libdht.a
 LIBS += $${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a
 LIBS += $${TRANSMISSION_TOP}/third-party/libnatpmp/libnatpmp.a
index 37e4f473e04bffb54a2d19c97018ef899d39dd8e..de60ea24966b30185fc33de51e50a4cdec35f7b4 100644 (file)
@@ -170,6 +170,7 @@ Session :: updatePref( int key )
         case Prefs :: TRASH_ORIGINAL:
         case Prefs :: USPEED:
         case Prefs :: USPEED_ENABLED:
+        case Prefs :: UTP_ENABLED:
             sessionSet( myPrefs.keyStr(key), myPrefs.variant(key) );
             break;