]> granicus.if.org Git - transmission/commitdiff
(trunk, libT) #2844 "add able to disable '.part' suffix for incomplete files" --...
authorCharles Kerr <charles@transmissionbt.com>
Mon, 1 Feb 2010 04:43:10 +0000 (04:43 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Mon, 1 Feb 2010 04:43:10 +0000 (04:43 +0000)
doc/rpc-spec.txt
gtk/main.c
gtk/tr-prefs.c
libtransmission/rpcimpl.c
qt/prefs-dialog.cc
qt/prefs.cc
qt/prefs.h

index 0c8b5d795b69815f6b1dc2eeded9cf8c30a87579..4d29dccd9c255a9e855fd38f83229a47cc9fe935 100644 (file)
    "peer-port"                | number     port number
    "peer-port-random-on-start"| boolean    true means pick a random peer port on launch
    "port-forwarding-enabled"  | boolean    true means enabled
+   "rename-partial-files"     | boolean    true means append ".part" to incomplete files
    "rpc-version"              | number     the current RPC API version
    "rpc-version-minimum"      | number     the minimum RPC API version supported
    "seedRatioLimit"           | double     the default seed ratio for torrents to use
          |         | yes       | torrent-get    | new arg "trackerStats"
          |         | yes       | session-set    | new arg "incomplete-dir"
          |         | yes       | session-set    | new arg "incomplete-dir-enabled"
-
+   ------+---------+-----------+----------------+-------------------------------
+   8     | 1.90    | yes       | session-set    | new arg "rename-partial-files"
+         |         | yes       | session-get    | new arg "rename-partial-files"
 
index 4f71bbd0c447b46df19e3b202a8faa1c3ad390db..4c2fa80cea0c5fa1d9a64cd87e5dd7664732c9c9 100644 (file)
@@ -1193,6 +1193,10 @@ prefschanged( TrCore * core UNUSED,
     {
         tr_sessionSetPexEnabled( tr, pref_flag_get( key ) );
     }
+    else if( !strcmp( key, TR_PREFS_KEY_RENAME_PARTIAL_FILES ) )
+    {
+        tr_sessionSetIncompleteFileNamingEnabled( tr, pref_flag_get( key ) );
+    }
     else if( !strcmp( key, TR_PREFS_KEY_DHT_ENABLED ) )
     {
         tr_sessionSetDHTEnabled( tr, pref_flag_get( key ) );
index 4067cd21dd4a19db390bd27bf7f731ab00f0a42f..178cfe7bb0e61ffa9dbac1014c2d5e6334e47ae8 100644 (file)
@@ -297,6 +297,10 @@ torrentPage( GObject * core )
     w = new_check_button( s, PREF_KEY_TRASH_ORIGINAL, core );
     hig_workarea_add_wide_control( t, &row, w );
 
+    s = _( "Append \"._part\" to incomplete files' names" );
+    w = new_check_button( s, TR_PREFS_KEY_RENAME_PARTIAL_FILES, core );
+    hig_workarea_add_wide_control( t, &row, w );
+
     s = _( "Keep _incomplete torrents in:" );
     l = new_check_button( s, TR_PREFS_KEY_INCOMPLETE_DIR_ENABLED, core );
     w = new_path_chooser_button( TR_PREFS_KEY_INCOMPLETE_DIR, core );
index 07c0cef819c21dc236f84ade7b592ba94fc86c91..7ea9febb9f5422dbdd3514d5b60b4daf6a037174 100644 (file)
@@ -1185,6 +1185,8 @@ sessionSet( tr_session               * session,
         tr_sessionSetPeerPort( session, i );
     if( tr_bencDictFindBool( args_in, TR_PREFS_KEY_PORT_FORWARDING, &boolVal ) )
         tr_sessionSetPortForwardingEnabled( session, boolVal );
+    if( tr_bencDictFindBool( args_in, TR_PREFS_KEY_RENAME_PARTIAL_FILES, &boolVal ) )
+        tr_sessionSetIncompleteFileNamingEnabled( session, boolVal );
     if( tr_bencDictFindReal( args_in, "seedRatioLimit", &d ) )
         tr_sessionSetRatioLimit( session, d );
     if( tr_bencDictFindBool( args_in, "seedRatioLimited", &boolVal ) )
@@ -1287,7 +1289,8 @@ sessionGet( tr_session               * 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_bencDictAddBool( d, TR_PREFS_KEY_PORT_FORWARDING, tr_sessionIsPortForwardingEnabled( s ) );
-    tr_bencDictAddInt ( d, "rpc-version", 7 );
+    tr_bencDictAddBool( d, TR_PREFS_KEY_RENAME_PARTIAL_FILES, tr_sessionIsIncompleteFileNamingEnabled( s ) );
+    tr_bencDictAddInt ( d, "rpc-version", 8 );
     tr_bencDictAddInt ( d, "rpc-version-minimum", 1 );
     tr_bencDictAddReal( d, "seedRatioLimit", tr_sessionGetRatioLimit( s ) );
     tr_bencDictAddBool( d, "seedRatioLimited", tr_sessionIsRatioLimited( s ) );
index 295498b718c5d86094b26e8deea79bb38269f85a..af4f15bcf9afb2d22ab99b034cd7ed6e41e31c54 100644 (file)
@@ -566,6 +566,7 @@ PrefsDialog :: createTorrentsTab( )
         hig->addWideControl( checkBoxNew( tr( "Show &options dialog" ), Prefs::OPTIONS_PROMPT ) );
         hig->addWideControl( checkBoxNew( tr( "&Start when added" ), Prefs::START ) );
         hig->addWideControl( checkBoxNew( tr( "Mo&ve .torrent file to the trash" ), Prefs::TRASH_ORIGINAL ) );
+        hig->addWideControl( checkBoxNew( tr( "Append \".&part\" to incomplete files' names" ), Prefs::RENAME_PARTIAL_FILES ) );
 
         b = myIncompleteButton = new QPushButton;
         b->setIcon( folderPixmap );
index 90179d3446ad097856932950c4c77ad0cf11983b..c98829f754450401f0188bd80470f3e1b7f6a98f 100644 (file)
@@ -102,6 +102,7 @@ Prefs::PrefItem Prefs::myItems[] =
     { PROXY_USERNAME, TR_PREFS_KEY_PROXY_USERNAME, QVariant::String },
     { RATIO, TR_PREFS_KEY_RATIO, QVariant::Double },
     { RATIO_ENABLED, TR_PREFS_KEY_RATIO_ENABLED, QVariant::Bool },
+    { RENAME_PARTIAL_FILES, TR_PREFS_KEY_RENAME_PARTIAL_FILES, QVariant::Bool },
     { RPC_AUTH_REQUIRED, TR_PREFS_KEY_RPC_AUTH_REQUIRED, QVariant::Bool },
     { RPC_ENABLED, TR_PREFS_KEY_RPC_ENABLED, QVariant::Bool },
     { RPC_PASSWORD, TR_PREFS_KEY_RPC_PASSWORD, QVariant::String },
index 7abda3550e195fea1a0d279da5eac23b8350c02d..34ec3f881f03bad4ce0701528f56ca57edb4a705 100644 (file)
@@ -106,6 +106,7 @@ class Prefs: public QObject
             PROXY_USERNAME,
             RATIO,
             RATIO_ENABLED,
+            RENAME_PARTIAL_FILES,
             RPC_AUTH_REQUIRED,
             RPC_ENABLED,
             RPC_PASSWORD,