Diff for /chimera/BrowserWindowController.mm between versions 1.17 and 1.31

version 1.17, 2002/02/05 09:51:56 version 1.31, 2002/02/12 01:47:57
Line 30  static NSString *PrintToolbarItemIdentif Line 30  static NSString *PrintToolbarItemIdentif
 - (void)windowWillClose:(NSNotification *)notification  - (void)windowWillClose:(NSNotification *)notification
 {  {
     [self autorelease];      [self autorelease];
       [mSidebarBookmarksDataSource windowClosing];
 }  }
   
 - (void)dealloc  - (void)dealloc
 {  {
       printf("Browser controller died.\n");
       
     [mBrowserView windowClosed];      [mBrowserView windowClosed];
       [mSidebarBrowserView windowClosed];
       
     [super dealloc];      [super dealloc];
 }  }
   
Line 42  static NSString *PrintToolbarItemIdentif Line 47  static NSString *PrintToolbarItemIdentif
 {  {
     mInitialized = YES;      mInitialized = YES;
     [self setupToolbar];      [self setupToolbar];
   
       // Our initial view is our primary view.  Connect it up.
       NSTabViewItem* tab = [mTabBrowser tabViewItemAtIndex: 0];
       NSView* view = [tab view];
           
       MyBrowserView* newView = [[[MyBrowserView alloc] initWithFrame: [view frame]] autorelease];
       [tab setView: newView];
       mBrowserView = newView;
       
       [mBrowserView makePrimaryBrowserView: tab urlbar: mURLBar status: mStatus
           progress: mProgress windowController: self];
   
     if (mURL) {      if (mURL) {
       [self loadURL: mURL];        [self loadURL: mURL];
       [mURL release];        [mURL release];
     }      }
       
       [mSidebarDrawer setDelegate: self];
   }
   
   - (void)drawerWillOpen: (NSNotification*)aNotification
   {
       [mSidebarBookmarksDataSource ensureBookmarks];
   }
   
   - (void)drawerDidOpen:(NSNotification *)aNotification
   {
       // XXXdwh This is temporary.
       [[mSidebarBrowserView getBrowserView] loadURI: [NSURL URLWithString: @"http://tinderbox.mozilla.org/SeaMonkey/panel.html"] flags:NSLoadFlagsNone];
   }
   
   - (void)drawerDidClose:(NSNotification *)aNotification
   {
       // Unload the Gecko web page in "My Panels" to save memory.
       [[mSidebarBrowserView getBrowserView] loadURI: [NSURL URLWithString: @"about:blank"] flags:NSLoadFlagsNone];
 }  }
   
 - (void)setupToolbar  - (void)setupToolbar
Line 256  static NSString *PrintToolbarItemIdentif Line 291  static NSString *PrintToolbarItemIdentif
     [[mBrowserView getBrowserView] findAgain];      [[mBrowserView getBrowserView] findAgain];
 }  }
   
   - (void)addBookmark
   {
       // XXXdwh Hack.  Just go to the sidebar for now until we get our
       // menu data source going.
       [mSidebarBookmarksDataSource ensureBookmarks];
       [mSidebarBookmarksDataSource addBookmark: self];
   }
   
 - (IBAction)back:(id)aSender  - (IBAction)back:(id)aSender
 {  {
   [[mBrowserView getBrowserView] goBack];    [[mBrowserView getBrowserView] goBack];
Line 283  static NSString *PrintToolbarItemIdentif Line 326  static NSString *PrintToolbarItemIdentif
   
 - (IBAction)toggleSidebar:(id)aSender  - (IBAction)toggleSidebar:(id)aSender
 {  {
    if ( ([mSidebarDrawer state] == NSDrawerClosedState) || ([mSidebarDrawer state] == NSDrawerClosingState) ) {    NSLog(@"The sidebar drawer is: %@", mSidebarDrawer);
     if ( ([mSidebarDrawer state] == NSDrawerClosedState) || ([mSidebarDrawer state] == NSDrawerClosingState) )  {
         NSLog(@"opening drawer");
         [mSidebarDrawer open];          [mSidebarDrawer open];
     } else {      } else {
           NSLog(@"closing drawer");
         [mSidebarDrawer close];          [mSidebarDrawer close];
     }      }
 }  }
Line 318  static NSString *PrintToolbarItemIdentif Line 364  static NSString *PrintToolbarItemIdentif
     [[self window] update];      [[self window] update];
     [[self window] display];      [[self window] display];
 }  }
   
   -(void)newTab
   {
       NSTabViewItem* newTab = [[[NSTabViewItem alloc] initWithIdentifier: nil] autorelease];
       [mTabBrowser addTabViewItem: newTab];
       
       MyBrowserView* newView = [[[MyBrowserView alloc] initWithFrame: [mBrowserView frame]] autorelease];
       [newTab setView: newView];
       [newTab setLabel: @"Untitled"];
       
       [[newView getBrowserView] loadURI:[NSURL URLWithString:@"about:blank"] flags:NSLoadFlagsNone];
       
       [mTabBrowser selectLastTabViewItem: self];
       
       if ( [[[self window] toolbar] isVisible] ) {
           if ( ([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconAndLabel) ||
                ([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconOnly) ) {
               [self focusURLBar];
           } 
       }
       
       //XXXdwh Do this if we ever support auto-hide.
       //if ([mTabBrowser numberOfTabViewItems] == 2)
       //    [mTabBrowser setTabViewType: NSTopTabsBezelBorder];
   }
   
   - (void)tabView:(NSTabView *)aTabView didSelectTabViewItem:(NSTabViewItem *)aTabViewItem
   {
       // Disconnect the old view.
       [mBrowserView disconnectView];
       
       // Connect up the new view
       mBrowserView = [aTabViewItem view];
          
       // Make the new view the primary content area.
       [mBrowserView makePrimaryBrowserView: aTabViewItem urlbar: mURLBar status: mStatus
           progress: mProgress windowController: self];
   }
   
   -(MyBrowserView*)getMyBrowserView
   {
       return mBrowserView;
   }
 @end  @end
   

Removed from v.1.17  
changed lines
  Added in v.1.31


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