File:  [mozdev] / chimera / MainController.mm
Revision 1.4: download - view: text, annotated - select for diffs - revision graph
Wed Jan 30 22:43:11 2002 UTC (17 years, 8 months ago) by hyatt
Branches: MAIN
CVS tags: HEAD
The open location command is now hooked up in the menu!  New windows properly focus their url bar now.

    1: /*
    2:  *  MainController.mm
    3:  */
    4: 
    5: #import "MainController.h"
    6: #import "BrowserWindowController.h"
    7: 
    8: @implementation MainController
    9: 
   10: -(void)awakeFromNib
   11: {
   12:     [self newWindow: self];
   13: }
   14: 
   15: -(IBAction)newWindow:(id)aSender
   16: {
   17:     BrowserWindowController* controller = [self openBrowserWindowWithURL:@"about:blank"];
   18:     [controller focusURLBar];
   19: }
   20: 
   21: -(IBAction) openFile:(id)aSender
   22: {
   23: }
   24: 
   25: -(IBAction) openLocation:(id)aSender
   26: {
   27:     NSWindow* keyWindow = [mApplication keyWindow];
   28:     if (!keyWindow) {
   29:       [self openBrowserWindowWithURL: @"about:blank"];
   30:       keyWindow = [mApplication keyWindow];
   31:     }
   32:     
   33:     [[keyWindow windowController] focusURLBar];
   34: }
   35: 
   36: -(IBAction) back:(id)aSender
   37: {
   38:     [[[mApplication keyWindow] windowController] back: aSender]; 
   39: }
   40: 
   41: -(IBAction) forward:(id)aSender
   42: {
   43:     [[[mApplication keyWindow] windowController] forward: aSender]; 
   44: }
   45: 
   46: -(IBAction) reload:(id)aSender
   47: {
   48:     [[[mApplication keyWindow] windowController] reload: aSender]; 
   49: }
   50: 
   51: -(IBAction) stop:(id)aSender
   52: {
   53:     [[[mApplication keyWindow] windowController] stop: aSender]; 
   54: }
   55: 
   56: -(IBAction) home:(id)aSender
   57: {
   58:     [[[mApplication keyWindow] windowController] home: aSender];
   59: }
   60: 
   61: -(BrowserWindowController*)openBrowserWindowWithURL: (NSString*)aURL
   62: {
   63: 	NSLog(@"Opening Browser with URL: %@", aURL);
   64: 	BrowserWindowController* browser = [[BrowserWindowController alloc] initWithWindowNibName: @"BrowserWindow"];
   65: 
   66: 	[browser loadURL: aURL];
   67: 	[browser showWindow: self];
   68:     
   69:     return browser;
   70: }
   71: 
   72: @end

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