Changeset 10465


Ignore:
Timestamp:
Apr 12, 2010, 12:55:31 AM (12 years ago)
Author:
livings124
Message:

#2612 Display a neutered add window for magnet links

Location:
trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r10447 r10465  
    101101                A21A9D41106EC2E800F1C3C1 /* TrackerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A21A9D40106EC2E800F1C3C1 /* TrackerCell.m */; };
    102102                A21DFF100A292B2B007C5F76 /* Transfers.png in Resources */ = {isa = PBXBuildFile; fileRef = A21DFF0F0A292B2B007C5F76 /* Transfers.png */; };
     103                A21F15AC11729A8B00CF5A9C /* AddMagnetWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A21F15AA11729A8B00CF5A9C /* AddMagnetWindowController.m */; };
     104                A21F15AD11729A9F00CF5A9C /* AddMagnetWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A21F1538117299F100CF5A9C /* AddMagnetWindow.xib */; };
    103105                A21FBBAB0EDA78C300BC3C51 /* bandwidth.h in Headers */ = {isa = PBXBuildFile; fileRef = A21FBBA90EDA78C300BC3C51 /* bandwidth.h */; };
    104106                A21FBBAC0EDA78C300BC3C51 /* bandwidth.c in Sources */ = {isa = PBXBuildFile; fileRef = A21FBBAA0EDA78C300BC3C51 /* bandwidth.c */; };
     
    538540                A21A9D40106EC2E800F1C3C1 /* TrackerCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TrackerCell.m; path = macosx/TrackerCell.m; sourceTree = "<group>"; };
    539541                A21DFF0F0A292B2B007C5F76 /* Transfers.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Transfers.png; path = macosx/Images/Transfers.png; sourceTree = "<group>"; };
     542                A21F1539117299F100CF5A9C /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = macosx/en.lproj/AddMagnetWindow.xib; sourceTree = "<group>"; };
     543                A21F15AA11729A8B00CF5A9C /* AddMagnetWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AddMagnetWindowController.m; path = macosx/AddMagnetWindowController.m; sourceTree = "<group>"; };
     544                A21F15AB11729A8B00CF5A9C /* AddMagnetWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddMagnetWindowController.h; path = macosx/AddMagnetWindowController.h; sourceTree = "<group>"; };
    540545                A21FBBA90EDA78C300BC3C51 /* bandwidth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bandwidth.h; path = libtransmission/bandwidth.h; sourceTree = "<group>"; };
    541546                A21FBBAA0EDA78C300BC3C51 /* bandwidth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bandwidth.c; path = libtransmission/bandwidth.c; sourceTree = "<group>"; };
     
    976981                                A26AF2820D2DC27C00FF7140 /* AddWindowController.h */,
    977982                                A26AF2830D2DC27C00FF7140 /* AddWindowController.m */,
     983                                A21F15AB11729A8B00CF5A9C /* AddMagnetWindowController.h */,
     984                                A21F15AA11729A8B00CF5A9C /* AddMagnetWindowController.m */,
    978985                                A25E74450AF5089E006F11AE /* ExpandedPathToPathTransformer.h */,
    979986                                A25E74440AF5089E006F11AE /* ExpandedPathToPathTransformer.m */,
     
    10751082                                A29576010D11D63C0093B167 /* Creator.xib */,
    10761083                                A26AF27C0D2DBDDF00FF7140 /* AddWindow.xib */,
     1084                                A21F1538117299F100CF5A9C /* AddMagnetWindow.xib */,
    10771085                                A215BF5B0F02EBB800350CDB /* GroupRules.xib */,
    10781086                                A233BD320D8C6585007EE7B4 /* MessageWindow.xib */,
     
    19151923                                A209EC12114301C6002B02D1 /* InfoOptionsView.xib in Resources */,
    19161924                                A209ECA2114319C3002B02D1 /* InfoWindow.xib in Resources */,
     1925                                A21F15AD11729A9F00CF5A9C /* AddMagnetWindow.xib in Resources */,
    19171926                        );
    19181927                        runOnlyForDeploymentPostprocessing = 0;
     
    21002109                                A209EBCE1142F2B4002B02D1 /* InfoFileViewController.m in Sources */,
    21012110                                A209EBF91142FEEE002B02D1 /* InfoOptionsViewController.m in Sources */,
     2111                                A21F15AC11729A8B00CF5A9C /* AddMagnetWindowController.m in Sources */,
    21022112                        );
    21032113                        runOnlyForDeploymentPostprocessing = 0;
     
    22692279                        );
    22702280                        name = GroupRules.xib;
     2281                        sourceTree = "<group>";
     2282                };
     2283                A21F1538117299F100CF5A9C /* AddMagnetWindow.xib */ = {
     2284                        isa = PBXVariantGroup;
     2285                        children = (
     2286                                A21F1539117299F100CF5A9C /* en */,
     2287                        );
     2288                        name = AddMagnetWindow.xib;
    22712289                        sourceTree = "<group>";
    22722290                };
  • trunk/macosx/AddWindowController.h

    r10161 r10465  
    4545    BOOL fLockDestination;
    4646   
    47     BOOL fDeleteTorrent, fDeleteEnable;
     47    BOOL fDeleteTorrentInitial, fDeleteEnableInitial;
    4848    NSInteger fGroupValue;
    4949   
  • trunk/macosx/AddWindowController.m

    r10344 r10465  
    7070        fTorrentFile = [[torrentFile stringByExpandingTildeInPath] retain];
    7171       
    72         fDeleteTorrent = deleteTorrent;
    73         fDeleteEnable = canToggleDelete;
     72        fDeleteTorrentInitial = deleteTorrent;
     73        fDeleteEnableInitial = canToggleDelete;
    7474       
    7575        fGroupValue = [torrent groupValue];
     
    113113    [fStartCheck setState: [[NSUserDefaults standardUserDefaults] boolForKey: @"AutoStartDownload"] ? NSOnState : NSOffState];
    114114   
    115     [fDeleteCheck setState: fDeleteTorrent ? NSOnState : NSOffState];
    116     [fDeleteCheck setEnabled: fDeleteEnable];
     115    [fDeleteCheck setState: fDeleteTorrentInitial ? NSOnState : NSOffState];
     116    [fDeleteCheck setEnabled: fDeleteEnableInitial];
    117117   
    118118    if (fDestination)
  • trunk/macosx/Controller.h

    r10073 r10465  
    2828#import <Growl/Growl.h>
    2929
     30@class AddMagnetWindowController;
    3031@class AddWindowController;
    3132@class Badger;
     
    118119
    119120- (void) openFiles: (NSArray *) filenames addType: (addType) type forcePath: (NSString *) path;
    120 - (void) openMagnet: (NSString *) address;
    121121
    122122- (void) askOpenConfirmed: (AddWindowController *) addController add: (BOOL) add;
     
    124124- (void) openFilesWithDict: (NSDictionary *) dictionary;
    125125- (void) openShowSheet: (id) sender;
     126
     127- (void) openMagnet: (NSString *) address;
     128- (void) askOpenMagnetConfirmed: (AddMagnetWindowController *) addController add: (BOOL) add;
    126129
    127130- (void) invalidOpenAlert: (NSString *) filename;
  • trunk/macosx/Controller.m

    r10444 r10465  
    3838#import "AboutWindowController.h"
    3939#import "AddWindowController.h"
     40#import "AddMagnetWindowController.h"
    4041#import "MessageWindowController.h"
    4142#import "ButtonToolbarItem.h"
     
    942943}
    943944
     945- (void) askOpenConfirmed: (AddWindowController *) addController add: (BOOL) add
     946{
     947    Torrent * torrent = [addController torrent];
     948    [addController release];
     949   
     950    if (add)
     951    {
     952        [torrent update];
     953        [fTorrents addObject: torrent];
     954        [torrent release];
     955       
     956        [self updateTorrentsInQueue];
     957    }
     958    else
     959    {
     960        [torrent closeRemoveTorrent];
     961        [torrent release];
     962    }
     963}
     964
    944965- (void) openMagnet: (NSString *) address
    945966{
     
    960981    }
    961982   
    962     #warning show add window perhaps?
     983    //determine download location
     984    NSString * location = nil;
     985    if ([fDefaults boolForKey: @"DownloadLocationConstant"])
     986        location = [[fDefaults stringForKey: @"DownloadFolder"] stringByExpandingTildeInPath];
    963987   
    964988    //change the location if the group calls for it (this has to wait until after the torrent is created)
    965989    if ([[GroupsController groups] usesCustomDownloadLocationForIndex: [torrent groupValue]])
    966990    {
    967         NSString * location = [[GroupsController groups] customDownloadLocationForIndex: [torrent groupValue]];
     991        location = [[GroupsController groups] customDownloadLocationForIndex: [torrent groupValue]];
    968992        [torrent changeDownloadFolderBeforeUsing: location];
    969993    }
    970994   
    971     [torrent setWaitToStart: [fDefaults boolForKey: @"AutoStartDownload"]];
    972    
    973     [torrent update];
    974     [fTorrents addObject: torrent];
    975     [torrent release];
     995    if ([fDefaults boolForKey: @"DownloadAsk"] || !location)
     996    {
     997        AddMagnetWindowController * addController = [[AddMagnetWindowController alloc] initWithTorrent: torrent destination: location
     998                                                        controller: self];
     999        [addController showWindow: self];
     1000    }
     1001    else
     1002    {
     1003        [torrent setWaitToStart: [fDefaults boolForKey: @"AutoStartDownload"]];
     1004       
     1005        [torrent update];
     1006        [fTorrents addObject: torrent];
     1007        [torrent release];
     1008    }
    9761009
    9771010    [self updateTorrentsInQueue];
    9781011}
    9791012
    980 - (void) askOpenConfirmed: (AddWindowController *) addController add: (BOOL) add
     1013- (void) askOpenMagnetConfirmed: (AddMagnetWindowController *) addController add: (BOOL) add
    9811014{
    9821015    Torrent * torrent = [addController torrent];
  • trunk/macosx/Makefile.am

    r10379 r10465  
    2828    AboutWindowController.h \
    2929    AboutWindowController.m \
     30    AddMagnetWindowController.h \
     31    AddMagnetWindowController.m \
    3032    AddWindowController.h \
    3133    AddWindowController.m \
Note: See TracChangeset for help on using the changeset viewer.