Changeset 2136


Ignore:
Timestamp:
Jun 17, 2007, 4:23:37 PM (15 years ago)
Author:
livings124
Message:

initialize the overlay window when it is first needed instead of at launch

Location:
branches/file_selection
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/file_selection/NEWS

    r2134 r2136  
    55 - Torrent file creation
    66 - Partial licensing change -- see the LICENSE file for details
    7  - Fix to UPnP support
     7 - Fix to UPnP
    88 - Rechecking torrents is now done one torrent at a time
    99   to avoid hammering the disk
  • branches/file_selection/macosx/Controller.m

    r2108 r2136  
    173173       
    174174        fBadger = [[Badger alloc] initWithLib: fLib];
    175         fOverlayWindow = [[DragOverlayWindow alloc] initWithLib: fLib];
    176175       
    177176        fIPCController = [[IPCController alloc] init];
     
    198197    [fDisplayedTorrents release];
    199198    [fBadger release];
    200     [fOverlayWindow release];
     199    if (fOverlayWindow)
     200        [fOverlayWindow release];
    201201    [fIPCController release];
    202202   
     
    215215   
    216216    [fWindow setAcceptsMouseMovedEvents: YES]; //ensure filter buttons display correctly
    217     [fWindow addChildWindow: fOverlayWindow ordered: NSWindowAbove];
    218217   
    219218    fToolbar = [[NSToolbar alloc] initWithIdentifier: @"Transmission Toolbar"];
     
    21412140                tr_torrentClose(tempTor);
    21422141               
    2143                 [fOverlayWindow setFiles: files];
     2142                if (!fOverlayWindow)
     2143                    fOverlayWindow = [[DragOverlayWindow alloc] initWithLib: fLib forWindow: fWindow];
     2144                [fOverlayWindow setTorrents: files];
    21442145               
    21452146                return NSDragOperationCopy;
     
    21492150    else if ([[pasteboard types] containsObject: NSURLPboardType])
    21502151    {
     2152        if (!fOverlayWindow)
     2153            fOverlayWindow = [[DragOverlayWindow alloc] initWithLib: fLib forWindow: fWindow];
    21512154        [fOverlayWindow setURL: [[NSURL URLFromPasteboard: pasteboard] relativeString]];
    21522155       
     
    21602163- (void) draggingExited: (id <NSDraggingInfo>) info
    21612164{
    2162     [fOverlayWindow fadeOut];
     2165    if (fOverlayWindow)
     2166        [fOverlayWindow fadeOut];
    21632167}
    21642168
    21652169- (BOOL) performDragOperation: (id <NSDraggingInfo>) info
    21662170{
    2167     [fOverlayWindow fadeOut];
     2171    if (fOverlayWindow)
     2172        [fOverlayWindow fadeOut];
    21682173   
    21692174    NSPasteboard * pasteboard = [info draggingPasteboard];
  • branches/file_selection/macosx/DragOverlayWindow.h

    r1898 r2136  
    3030    tr_handle_t * fLib;
    3131   
    32     //NSTimer * fFadeInTimer, * fFadeOutTimer;
    3332    NSViewAnimation * fFadeInAnimation, * fFadeOutAnimation;
    3433}
    3534
    36 - (void) setFiles: (NSArray *) files;
     35- (id) initWithLib: (tr_handle_t *) lib forWindow: (NSWindow *) window;
     36- (void) setTorrents: (NSArray *) files;
    3737- (void) setURL: (NSString *) url;
    3838
  • branches/file_selection/macosx/DragOverlayWindow.m

    r1996 r2136  
    2929@implementation DragOverlayWindow
    3030
    31 - (id) initWithLib: (tr_handle_t *) lib
     31- (id) initWithLib: (tr_handle_t *) lib forWindow: (NSWindow *) window
    3232{
    3333    if (self = ([super initWithContentRect: NSMakeRect(0, 0, 1.0, 1.0) styleMask: NSBorderlessWindowMask
     
    5858        [fFadeOutAnimation setDuration: 0.5];
    5959        [fFadeOutAnimation setAnimationBlockingMode: NSAnimationNonblockingThreaded];
     60       
     61        [window addChildWindow: self ordered: NSWindowAbove];
    6062    }
    6163    return self;
     
    7072}
    7173
    72 - (void) setFiles: (NSArray *) files
     74- (void) setTorrents: (NSArray *) files
    7375{
    7476    uint64_t size = 0;
Note: See TracChangeset for help on using the changeset viewer.