Changeset 663


Ignore:
Timestamp:
Jul 22, 2006, 8:39:33 PM (16 years ago)
Author:
livings124
Message:

Don't disable green zoom button because showing a sheet automatically enables it. Oh well...

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r662 r663  
    351351        [self showInfo: nil];
    352352   
    353     //must do after everything is set up
     353    //must do after everything else is set up
    354354    [self checkAutoImportDirectory: nil];
    355355    fAutoImportTimer = [NSTimer scheduledTimerWithTimeInterval: 15.0 target: self
     
    388388
    389389            NSBeginAlertSheet(@"Confirm Quit", @"Quit", @"Cancel", nil, fWindow, self,
    390                                 @selector(quitSheetDidEnd:returnCode:contextInfo:),
    391                                 nil, nil, message);
     390                                @selector(quitSheetDidEnd:returnCode:contextInfo:), nil, nil, message);
    392391            return NSTerminateLater;
    393392        }
     
    397396}
    398397
    399 - (void) quitSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode
    400     contextInfo: (void *) contextInfo
    401 {
    402     [NSApp stopModal];
     398- (void) quitSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode contextInfo: (void *) contextInfo
     399{
    403400    [NSApp replyToApplicationShouldTerminate: returnCode == NSAlertDefaultReturn];
    404401}
     
    906903
    907904    //badge dock
    908     [fBadger updateBadgeWithCompleted: fCompleted
    909         uploadRate: uploadRate downloadRate: downloadRate];
     905    [fBadger updateBadgeWithCompleted: fCompleted uploadRate: uploadRate downloadRate: downloadRate];
    910906}
    911907
     
    21222118- (void) setAutoSize: (NSNotification *) notification
    21232119{
    2124     [[fWindow standardWindowButton: NSWindowZoomButton] setEnabled: ![fDefaults boolForKey: @"AutoSize"]];
     2120    #warning will not work because of sheets
     2121    //[[fWindow standardWindowButton: NSWindowZoomButton] setEnabled: ![fDefaults boolForKey: @"AutoSize"]];
    21252122    [self setWindowSizeToFit];
     2123}
     2124
     2125- (BOOL) windowShouldZoom: (NSWindow *) sender toFrame: (NSRect) newFrame
     2126{
     2127    return ![fDefaults boolForKey: @"AutoSize"];
    21262128}
    21272129
  • trunk/macosx/PrefsController.m

    r655 r663  
    692692- (void) folderSheetClosed: (NSOpenPanel *) openPanel returnCode: (int) code contextInfo: (void *) info
    693693{
    694    if (code == NSOKButton)
    695    {
    696        [fDownloadFolder release];
    697        fDownloadFolder = [[[openPanel filenames] objectAtIndex: 0] retain];
    698 
    699        [fFolderPopUp selectItemAtIndex: DOWNLOAD_FOLDER];
    700        [fDefaults setObject: fDownloadFolder forKey: @"DownloadFolder"];
    701        [fDefaults setObject: @"Constant" forKey: @"DownloadChoice"];
    702 
    703        [self updatePopUp];
    704    }
    705    else
    706    {
    707        //reset if cancelled
    708        NSString * downloadChoice = [fDefaults stringForKey: @"DownloadChoice"];
    709        if ([downloadChoice isEqualToString: @"Constant"])
    710            [fFolderPopUp selectItemAtIndex: DOWNLOAD_FOLDER];
    711        else if ([downloadChoice isEqualToString: @"Torrent"])
    712            [fFolderPopUp selectItemAtIndex: DOWNLOAD_TORRENT];
    713        else
    714            [fFolderPopUp selectItemAtIndex: DOWNLOAD_ASK];
    715    }
     694    if (code == NSOKButton)
     695    {
     696        [fDownloadFolder release];
     697        fDownloadFolder = [[[openPanel filenames] objectAtIndex: 0] retain];
     698       
     699        [fFolderPopUp selectItemAtIndex: DOWNLOAD_FOLDER];
     700        [fDefaults setObject: fDownloadFolder forKey: @"DownloadFolder"];
     701        [fDefaults setObject: @"Constant" forKey: @"DownloadChoice"];
     702       
     703        [self updatePopUp];
     704    }
     705    else
     706    {
     707        //reset if cancelled
     708        NSString * downloadChoice = [fDefaults stringForKey: @"DownloadChoice"];
     709        if ([downloadChoice isEqualToString: @"Constant"])
     710            [fFolderPopUp selectItemAtIndex: DOWNLOAD_FOLDER];
     711        else if ([downloadChoice isEqualToString: @"Torrent"])
     712            [fFolderPopUp selectItemAtIndex: DOWNLOAD_TORRENT];
     713        else
     714            [fFolderPopUp selectItemAtIndex: DOWNLOAD_ASK];
     715    }
    716716}
    717717
Note: See TracChangeset for help on using the changeset viewer.