Changeset 1054 for trunk/macosx


Ignore:
Timestamp:
Nov 5, 2006, 7:08:38 PM (15 years ago)
Author:
livings124
Message:

remove option to save a private torrent copy...just do it automatically

Location:
trunk/macosx
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Defaults.plist

    r1051 r1054  
    7575        <key>SUScheduledCheckInterval</key>
    7676        <integer>86400</integer>
    77         <key>SavePrivateTorrent</key>
    78         <true/>
    7977        <key>SeedingSound</key>
    8078        <string>Submarine</string>
  • trunk/macosx/English.lproj/InfoWindow.nib/info.nib

    r1025 r1054  
    44<dict>
    55        <key>IBDocumentLocation</key>
    6         <string>58 51 356 240 0 0 1024 746 </string>
     6        <string>69 61 356 240 0 0 1152 842 </string>
    77        <key>IBEditorPositions</key>
    88        <dict>
  • trunk/macosx/English.lproj/Localizable.strings

    r1026 r1054  
    242242"%d Transfers" = "%d Transfers";
    243243
    244 /* Torrent -> location */
     244/* Torrent -> location when deleting original */
    245245"Transmission Support Folder" = "Transmission Support Folder";
    246246
  • trunk/macosx/English.lproj/PrefsWindow.nib/classes.nib

    r1051 r1054  
    1515                setAutoSpeedLimit = id;
    1616                setBadge = id;
    17                 setCopyTorrents = id;
    1817                setDownloadLocation = id;
    1918                setNat = id;
  • trunk/macosx/English.lproj/PrefsWindow.nib/info.nib

    r1052 r1054  
    88        <dict>
    99                <key>153</key>
    10                 <string>294 445 563 267 0 0 1152 842 </string>
     10                <string>286 248 563 267 0 0 1152 842 </string>
    1111                <key>28</key>
    1212                <string>294 434 563 290 0 0 1152 842 </string>
    1313                <key>41</key>
    14                 <string>294 408 563 342 0 0 1152 842 </string>
     14                <string>128 481 563 305 0 0 1152 842 </string>
    1515                <key>66</key>
    1616                <string>294 507 563 144 0 0 1152 842 </string>
     
    2525        <array>
    2626                <integer>41</integer>
     27                <integer>153</integer>
    2728        </array>
    2829        <key>IBSystem Version</key>
  • trunk/macosx/InfoWindowController.m

    r1053 r1054  
    123123        if (numberSelected > 0)
    124124        {
    125             [fNameField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d Torrents Selected", "Inspector -> above tabs -> selected torrents"), numberSelected]];
     125            [fNameField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d Torrents Selected",
     126                                            "Inspector -> above tabs -> selected torrents"), numberSelected]];
    126127       
    127128            uint64_t size = 0;
     
    131132                size += [torrent size];
    132133           
    133             [fSizeField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%@ Total", "Inspector -> above tabs -> total size (several torrents selected)"), [NSString stringForFileSize: size]]];
     134            [fSizeField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%@ Total",
     135                "Inspector -> above tabs -> total size (several torrents selected)"), [NSString stringForFileSize: size]]];
    134136        }
    135137        else
    136138        {
    137             [fNameField setStringValue: NSLocalizedString(@"No Torrents Selected", "Inspector -> above tabs -> selected torrents")];
     139            [fNameField setStringValue: NSLocalizedString(@"No Torrents Selected",
     140                                                            "Inspector -> above tabs -> selected torrents")];
    138141            [fSizeField setStringValue: @""];
    139142   
     
    210213        [fHashField setToolTip: hashString];
    211214       
    212         [fTorrentLocationField setStringValue: [torrent torrentLocationString]];
    213         [fTorrentLocationField setToolTip: [torrent torrentLocation]];
     215        BOOL publicTorrent = [torrent publicTorrent];
     216        [fTorrentLocationField setStringValue: publicTorrent
     217                    ? [[torrent publicTorrentLocation] stringByAbbreviatingWithTildeInPath]
     218                    : NSLocalizedString(@"Transmission Support Folder", "Torrent -> location when deleting original")];
     219        if (publicTorrent)
     220            [fTorrentLocationField setToolTip: [NSString stringWithFormat: @"%@\n\n%@",
     221                        [torrent publicTorrentLocation], [torrent torrentLocation]]];
     222        else
     223            [fTorrentLocationField setToolTip: [torrent torrentLocation]];
    214224       
    215225        [fDateStartedField setObjectValue: [torrent date]];
     
    243253       
    244254        if ([fFiles count] > 1)
    245             [fFileTableStatusField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d files", "Inspector -> Files tab -> bottom text (number of files)"), [fFiles count]]];
    246         else
    247             [fFileTableStatusField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d file", "Inspector -> Files tab -> bottom text (number of files)"), [fFiles count]]];
    248     }
    249     else
    250         [fFileTableStatusField setStringValue: NSLocalizedString(@"info not available", "Inspector -> Files tab -> bottom text (number of files)")];
     255            [fFileTableStatusField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d files",
     256                                        "Inspector -> Files tab -> bottom text (number of files)"), [fFiles count]]];
     257        else
     258            [fFileTableStatusField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d file",
     259                                        "Inspector -> Files tab -> bottom text (number of files)"), [fFiles count]]];
     260    }
     261    else
     262        [fFileTableStatusField setStringValue: NSLocalizedString(@"info not available",
     263                                        "Inspector -> Files tab -> bottom text (number of files)")];
    251264   
    252265    [fFileTable deselectAll: nil];
     
    313326   
    314327    BOOL active = [torrent isActive];
    315     [fConnectedPeersField setStringValue: active ? [NSString stringWithFormat: NSLocalizedString(@"%d (%d incoming)", "Inspector -> Peers tab -> connected"),
     328    [fConnectedPeersField setStringValue: active ? [NSString stringWithFormat: NSLocalizedString(@"%d (%d incoming)",
     329                                                                                "Inspector -> Peers tab -> connected"),
    316330                                                    [torrent totalPeers], [torrent totalPeersIncoming]]: @""];
    317331    [fDownloadingFromField setStringValue: active ? [NSString stringWithInt: [torrent peersUploading]] : @""];
     
    535549        NSDictionary * file = [fFiles objectAtIndex: row];
    536550        if ([[column identifier] isEqualToString: @"Size"])
    537             return [[[file objectForKey: @"Size"] stringValue] stringByAppendingString: NSLocalizedString(@" bytes", "Inspector -> Files tab -> table row tooltip")];
     551            return [[[file objectForKey: @"Size"] stringValue] stringByAppendingString: NSLocalizedString(@" bytes",
     552                                                                        "Inspector -> Files tab -> table row tooltip")];
    538553        else
    539554            return [file objectForKey: @"Name"];
  • trunk/macosx/PrefsController.h

    r1051 r1054  
    6767- (void) setQueueNumber:    (id) sender;
    6868
    69 - (void) setCopyTorrents: (id) sender;
    70 
    7169- (void) setDownloadLocation:       (id) sender;
    7270- (void) folderSheetShow:           (id) sender;
  • trunk/macosx/PrefsController.m

    r1051 r1054  
    360360}
    361361
    362 - (void) setCopyTorrents: (id) sender
    363 {
    364     if (![fDefaults boolForKey: @"SavePrivateTorrent"])
    365         [fDefaults setBool: NO forKey: @"DeleteOriginalTorrent"];
    366 }
    367 
    368362- (void) setDownloadLocation: (id) sender
    369363{
  • trunk/macosx/Torrent.h

    r1051 r1054  
    4343    NSString    * fDownloadFolder, * fIncompleteFolder;
    4444   
    45     BOOL        fPrivateTorrent, fPublicTorrent;
     45    BOOL        fPublicTorrent;
    4646    NSString    * fPublicTorrentLocation;
    4747
     
    112112- (NSString *) torrentLocation;
    113113- (NSString *) publicTorrentLocation;
    114 - (NSString *) torrentLocationString;
    115114- (NSString *) dataLocation;
    116115
    117116- (BOOL) publicTorrent;
    118 - (BOOL) privateTorrent;
    119117
    120118- (NSString *) stateString;
  • trunk/macosx/Torrent.m

    r1051 r1054  
    3434
    3535- (id) initWithHash: (NSString *) hashString path: (NSString *) path lib: (tr_handle_t *) lib
    36         privateTorrent: (NSNumber *) privateTorrent publicTorrent: (NSNumber *) publicTorrent
     36        publicTorrent: (NSNumber *) publicTorrent
    3737        date: (NSDate *) date stopRatioSetting: (NSNumber *) stopRatioSetting
    3838        ratioLimit: (NSNumber *) ratioLimit waitToStart: (NSNumber *) waitToStart
     
    6161- (id) initWithPath: (NSString *) path lib: (tr_handle_t *) lib
    6262{
    63     self = [self initWithHash: nil path: path lib: lib privateTorrent: nil publicTorrent: nil
     63    self = [self initWithHash: nil path: path lib: lib publicTorrent: nil
    6464            date: nil stopRatioSetting: nil ratioLimit: nil waitToStart: nil orderValue: nil];
    6565   
     
    7979    self = [self initWithHash: [history objectForKey: @"TorrentHash"]
    8080                path: [history objectForKey: @"TorrentPath"] lib: lib
    81                 privateTorrent: [history objectForKey: @"PrivateCopy"]
    8281                publicTorrent: [history objectForKey: @"PublicCopy"]
    8382                date: [history objectForKey: @"Date"]
     
    125124{
    126125    NSMutableDictionary * history = [NSMutableDictionary dictionaryWithObjectsAndKeys:
    127                     [NSNumber numberWithBool: fPrivateTorrent], @"PrivateCopy",
    128126                    [NSNumber numberWithBool: fPublicTorrent], @"PublicCopy",
     127                    [self hashString], @"TorrentHash",
    129128                    fDownloadFolder, @"DownloadFolder",
    130129                    [NSNumber numberWithBool: fUseIncompleteFolder], @"UseIncompleteFolder",
     
    138137    if (fUseIncompleteFolder)
    139138        [history setObject: fIncompleteFolder forKey: @"IncompleteFolder"];
    140    
    141     if (fPrivateTorrent)
    142         [history setObject: [self hashString] forKey: @"TorrentHash"];
    143139
    144140    if (fPublicTorrent)
     
    443439- (void) removeForever
    444440{
    445     if (fPrivateTorrent)
    446         tr_torrentRemoveSaved(fHandle);
     441    tr_torrentRemoveSaved(fHandle);
    447442}
    448443
     
    616611}
    617612
    618 - (NSString *) torrentLocationString
    619 {
    620     return fPrivateTorrent ? NSLocalizedString(@"Transmission Support Folder", "Torrent -> location")
    621                             : [fPublicTorrentLocation stringByAbbreviatingWithTildeInPath];
    622 }
    623 
    624613- (NSString *) dataLocation
    625614{
     
    630619{
    631620    return fPublicTorrent;
    632 }
    633 
    634 - (BOOL) privateTorrent
    635 {
    636     return fPrivateTorrent;
    637621}
    638622
     
    869853//if a hash is given, attempt to load that; otherwise, attempt to open file at path
    870854- (id) initWithHash: (NSString *) hashString path: (NSString *) path lib: (tr_handle_t *) lib
    871         privateTorrent: (NSNumber *) privateTorrent publicTorrent: (NSNumber *) publicTorrent
     855        publicTorrent: (NSNumber *) publicTorrent
    872856        date: (NSDate *) date stopRatioSetting: (NSNumber *) stopRatioSetting
    873857        ratioLimit: (NSNumber *) ratioLimit waitToStart: (NSNumber *) waitToStart
     
    880864    fDefaults = [NSUserDefaults standardUserDefaults];
    881865
    882     fPrivateTorrent = privateTorrent ? [privateTorrent boolValue] : [fDefaults boolForKey: @"SavePrivateTorrent"];
    883     fPublicTorrent = !fPrivateTorrent || (publicTorrent ? [publicTorrent boolValue]
    884                                             : ![fDefaults boolForKey: @"DeleteOriginalTorrent"]);
     866    fPublicTorrent = path && (publicTorrent ? [publicTorrent boolValue] : ![fDefaults boolForKey: @"DeleteOriginalTorrent"]);
     867    if (fPublicTorrent)
     868        fPublicTorrentLocation = [path retain];
    885869
    886870    int error;
    887     if (fPrivateTorrent && hashString)
     871    if (hashString)
    888872        fHandle = tr_torrentInitSaved(fLib, [hashString UTF8String], TR_FSAVEPRIVATE, & error);
    889873   
    890874    if (!fHandle && path)
    891         fHandle = tr_torrentInit(fLib, [path UTF8String], fPrivateTorrent ? TR_FSAVEPRIVATE : 0, & error);
     875        fHandle = tr_torrentInit(fLib, [path UTF8String], TR_FSAVEPRIVATE, & error);
    892876
    893877    if (!fHandle)
     
    898882   
    899883    fInfo = tr_torrentInfo( fHandle );
    900 
    901     if (fPublicTorrent)
    902         fPublicTorrentLocation = [path retain];
    903884
    904885    fDate = date ? [date retain] : [[NSDate alloc] init];
Note: See TracChangeset for help on using the changeset viewer.