Annotation of chimera/MainController.mm, revision 1.4

1.3       macserv     1: /*
                      2:  *  MainController.mm
                      3:  */
1.1       hyatt       4: 
                      5: #import "MainController.h"
                      6: #import "BrowserWindowController.h"
                      7: 
                      8: @implementation MainController
                      9: 
                     10: -(void)awakeFromNib
                     11: {
1.4     ! hyatt      12:     [self newWindow: self];
1.1       hyatt      13: }
                     14: 
                     15: -(IBAction)newWindow:(id)aSender
                     16: {
1.4     ! hyatt      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];
1.1       hyatt      34: }
                     35: 
1.2       hyatt      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: 
1.4     ! hyatt      61: -(BrowserWindowController*)openBrowserWindowWithURL: (NSString*)aURL
1.1       hyatt      62: {
1.3       macserv    63:        NSLog(@"Opening Browser with URL: %@", aURL);
                     64:        BrowserWindowController* browser = [[BrowserWindowController alloc] initWithWindowNibName: @"BrowserWindow"];
                     65: 
                     66:        [browser loadURL: aURL];
                     67:        [browser showWindow: self];
1.4     ! hyatt      68:     
        !            69:     return browser;
1.1       hyatt      70: }
                     71: 
                     72: @end

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