Diff for /chimera/MainController.mm between versions 1.4 and 1.5

version 1.4, 2002/01/30 22:43:11 version 1.5, 2002/01/31 03:13:19
Line 14 Line 14
   
 -(IBAction)newWindow:(id)aSender  -(IBAction)newWindow:(id)aSender
 {  {
    BrowserWindowController* controller = [self openBrowserWindowWithURL:@"about:blank"];    BrowserWindowController* controller = [self openBrowserWindowWithURLString:@"about:blank"];
     [controller focusURLBar];      [controller focusURLBar];
 }  }
   
 -(IBAction) openFile:(id)aSender  -(IBAction) openFile:(id)aSender
 {  {
       NSOpenPanel* openPanel = [[NSOpenPanel alloc] init];
       [openPanel setCanChooseFiles: YES];
       [openPanel setCanChooseDirectories: NO];
       [openPanel setAllowsMultipleSelection: NO];
       NSArray* array = [NSArray arrayWithObjects: @"htm",@"html",@"shtml",@"xhtml",@"xml",
                                                   @"txt",@"text",
                                                   @"gif",@"jpg",@"jpeg",@"png",@"bmp",
                                                   nil];
       int result = [openPanel runModalForTypes: array];
       if (result == NSOKButton) {
           NSArray* urlArray = [openPanel URLs];
           if ([urlArray count] == 0)
               return;
           NSURL* url = [urlArray objectAtIndex: 0];
           NSWindow* keyWindow = [mApplication keyWindow];
           if (keyWindow)
               return [[keyWindow windowController] loadURL: url];
           else
               [self openBrowserWindowWithURL: url];
       }
 }  }
   
 -(IBAction) openLocation:(id)aSender  -(IBAction) openLocation:(id)aSender
 {  {
     NSWindow* keyWindow = [mApplication keyWindow];      NSWindow* keyWindow = [mApplication keyWindow];
     if (!keyWindow) {      if (!keyWindow) {
      [self openBrowserWindowWithURL: @"about:blank"];      [self openBrowserWindowWithURLString: @"about:blank"];
       keyWindow = [mApplication keyWindow];        keyWindow = [mApplication keyWindow];
     }      }
           
Line 58 Line 78
     [[[mApplication keyWindow] windowController] home: aSender];      [[[mApplication keyWindow] windowController] home: aSender];
 }  }
   
-(BrowserWindowController*)openBrowserWindowWithURL: (NSString*)aURL-(BrowserWindowController*)openBrowserWindowWithURLString: (NSString*)aURL
 {  {
        NSLog(@"Opening Browser with URL: %@", aURL);    return [self openBrowserWindowWithURL: [NSURL URLWithString:aURL]];
        BrowserWindowController* browser = [[BrowserWindowController alloc] initWithWindowNibName: @"BrowserWindow"];}
   
        [browser loadURL: aURL];-(BrowserWindowController*)openBrowserWindowWithURL: (NSURL*)aURL
 {
         BrowserWindowController* browser = [[BrowserWindowController alloc] initWithWindowNibName: @"BrowserWindow"];
     [browser loadURL: aURL];
         [browser showWindow: self];          [browser showWindow: self];
       
     return browser;      return browser;
 }  }
   

Removed from v.1.4  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>