Diff for /chimera/MainController.mm between versions 1.2 and 1.8

version 1.2, 2002/01/29 19:53:45 version 1.8, 2002/02/03 05:53:12
Line 1 Line 1
///*
//  MainController.mm *  MainController.mm
//  Chimera */
// 
//  Created by David Hyatt on Tue Jan 29 2002. 
//  Copyright (c) 2001 __MyCompanyName__. All rights reserved. 
// 
   
 #import "MainController.h"  #import "MainController.h"
 #import "BrowserWindowController.h"  #import "BrowserWindowController.h"
Line 13 Line 9
   
 -(void)awakeFromNib  -(void)awakeFromNib
 {  {
  NSLog(@"HELLO?");    [self newWindow: self];
  [self newWindow: nil]; 
 }  }
   
 -(IBAction)newWindow:(id)aSender  -(IBAction)newWindow:(id)aSender
 {  {
  [self openBrowserWindowWithURL: @"about:blank"];    BrowserWindowController* controller = [self openBrowserWindowWithURLString:@"about:blank"];
     [controller focusURLBar];
 }
 
 -(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
 {
     NSWindow* keyWindow = [mApplication keyWindow];
     if (!keyWindow) {
       [self openBrowserWindowWithURLString: @"about:blank"];
       keyWindow = [mApplication keyWindow];
     }
     
     [[keyWindow windowController] performAppropriateLocationAction];
 }
 
 -(IBAction) savePage:(id)aSender
 {
     NSWindow* keyWindow = [mApplication keyWindow];
     if (keyWindow)
       [[keyWindow windowController] saveDocument: mFilterView filterList: mFilterList];
 }
 
 -(IBAction) toggleOfflineMode:(id)aSender
 {
   // XXXdwh Write me!
 }  }
   
 -(IBAction) back:(id)aSender  -(IBAction) back:(id)aSender
Line 47 Line 90
     [[[mApplication keyWindow] windowController] home: aSender];      [[[mApplication keyWindow] windowController] home: aSender];
 }  }
   
-(void)openBrowserWindowWithURL: (NSString*)aURL-(BrowserWindowController*)openBrowserWindowWithURLString: (NSString*)aURL
 {
     return [self openBrowserWindowWithURL: [NSURL URLWithString:aURL]];
 }
 
 -(BrowserWindowController*)openBrowserWindowWithURL: (NSURL*)aURL
 {  {
  NSLog(@"YARF!");        BrowserWindowController* browser = [[BrowserWindowController alloc] initWithWindowNibName: @"BrowserWindow"];
  BrowserWindowController* browser = [[BrowserWindowController alloc] initWithWindowNibName: @"BrowserWindow"];    [browser loadURL: aURL];
  [browser loadURL: aURL];        [browser showWindow: self];
  [browser showWindow: self];    return browser;
 }  }
   
 @end  @end

Removed from v.1.2  
changed lines
  Added in v.1.8


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