Diff for /chimera/MainController.mm between versions 1.44 and 1.46

version 1.44, 2002/04/17 07:38:31 version 1.46, 2002/04/18 15:42:03
Line 52  static const char* ioServiceContractID = Line 52  static const char* ioServiceContractID =
 -(id)init  -(id)init
 {  {
     if ( (self = [super init]) ) {      if ( (self = [super init]) ) {
        mSplashScreen = [[SplashScreenWindow alloc] splashImage:nil withFade:YES withStatusRect:NSMakeRect(0,0,0,0)];        mSplashScreen = [[SplashScreenWindow alloc] splashImage:nil withStatusRect:NSMakeRect(0,0,0,0)];
     }      }
     mFindDialog = nil;      mFindDialog = nil;
     mMenuBookmarks = nil;      mMenuBookmarks = nil;
Line 98  static const char* ioServiceContractID = Line 98  static const char* ioServiceContractID =
 {  {
   // If we have a key window, have it autosave its dimensions before    // If we have a key window, have it autosave its dimensions before
   // we open a new window.  That ensures the size ends up matching.    // we open a new window.  That ensures the size ends up matching.
  NSWindow* keyWindow = [mApplication keyWindow];  NSWindow* mainWindow = [mApplication mainWindow];
  if ( keyWindow && [keyWindow respondsToSelector:@selector(autosaveWindowFrame)] )  if ( mainWindow && [mainWindow respondsToSelector:@selector(autosaveWindowFrame)] )
    [[keyWindow windowController] autosaveWindowFrame];    [[mainWindow windowController] autosaveWindowFrame];
   
   // Now open the new window.    // Now open the new window.
   BrowserWindowController* controller = [self openBrowserWindowWithURLString:@"about:blank"];    BrowserWindowController* controller = [self openBrowserWindowWithURLString:@"about:blank"];
Line 109  static const char* ioServiceContractID = Line 109  static const char* ioServiceContractID =
   
 -(IBAction)newTab:(id)aSender  -(IBAction)newTab:(id)aSender
 {  {
    NSWindow* keyWindow = [mApplication keyWindow];  [[[mApplication mainWindow] windowController] newTab];
    if (keyWindow) 
        [[keyWindow windowController] newTab]; 
 }  }
   
 -(IBAction)closeTab:(id)aSender  -(IBAction)closeTab:(id)aSender
 {  {
    NSWindow* keyWindow = [mApplication keyWindow];  [[[mApplication mainWindow] windowController] closeTab];
    if (keyWindow) 
        [[keyWindow windowController] closeTab]; 
 }  }
   
 -(IBAction) previousTab:(id)aSender  -(IBAction) previousTab:(id)aSender
 {  {
    NSWindow* keyWindow = [mApplication keyWindow];  [[[mApplication mainWindow] windowController] previousTab];
    if (keyWindow) 
        [[keyWindow windowController] previousTab]; 
 }  }
   
 -(IBAction) nextTab:(id)aSender;  -(IBAction) nextTab:(id)aSender;
 {  {
    NSWindow* keyWindow = [mApplication keyWindow];        [[[mApplication mainWindow] windowController] nextTab];
    if (keyWindow) 
        [[keyWindow windowController] nextTab]; 
 }  }
   
 -(IBAction) openFile:(id)aSender  -(IBAction) openFile:(id)aSender
Line 154  static const char* ioServiceContractID = Line 146  static const char* ioServiceContractID =
         // ----------------------          // ----------------------
         [[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:url];          [[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:url];
         // ----------------------          // ----------------------
        NSWindow* keyWindow = [mApplication keyWindow];        NSWindow* mainWindow = [mApplication mainWindow];
        if (keyWindow) {        if (mainWindow) {
          [[keyWindow windowController] loadURL: url];          [[mainWindow windowController] loadURL: url];
          [[[[keyWindow windowController] getMyBrowserView] getBrowserView] setActive: YES];          [[[[mainWindow windowController] getMyBrowserView] getBrowserView] setActive: YES];
         }          }
         else          else
           [self openBrowserWindowWithURL: url];            [self openBrowserWindowWithURL: url];
Line 166  static const char* ioServiceContractID = Line 158  static const char* ioServiceContractID =
   
 -(IBAction) openLocation:(id)aSender  -(IBAction) openLocation:(id)aSender
 {  {
    NSWindow* keyWindow = [mApplication keyWindow];    NSWindow* mainWindow = [mApplication mainWindow];
    if (!keyWindow) {    if (!mainWindow) {
       [self openBrowserWindowWithURLString: @"about:blank"];        [self openBrowserWindowWithURLString: @"about:blank"];
      keyWindow = [mApplication keyWindow];      mainWindow = [mApplication mainWindow];
     }      }
           
    [[keyWindow windowController] performAppropriateLocationAction];    [[mainWindow windowController] performAppropriateLocationAction];
 }  }
   
 -(IBAction) savePage:(id)aSender  -(IBAction) savePage:(id)aSender
 {  {
    NSWindow* keyWindow = [mApplication keyWindow];  [[[mApplication mainWindow] windowController] saveDocument: mFilterView filterList: mFilterList];
    if (keyWindow) 
      [[keyWindow windowController] saveDocument: mFilterView filterList: mFilterList]; 
 }  }
   
 -(IBAction) printPage:(id)aSender  -(IBAction) printPage:(id)aSender
 {  {
    NSWindow* keyWindow = [mApplication keyWindow];  [[[mApplication mainWindow] windowController] printDocument];
    if (keyWindow) 
      [[keyWindow windowController] printDocument]; 
 }  }
   
 -(IBAction) printPreview:(id)aSender  -(IBAction) printPreview:(id)aSender
 {  {
    NSWindow* keyWindow = [mApplication keyWindow];  [[[mApplication mainWindow] windowController] printPreview];
    if (keyWindow) 
      [[keyWindow windowController] printPreview]; 
 }  }
   
 -(IBAction) toggleOfflineMode:(id)aSender  -(IBAction) toggleOfflineMode:(id)aSender
Line 251  static const char* ioServiceContractID = Line 237  static const char* ioServiceContractID =
   
 -(IBAction) goBack:(id)aSender  -(IBAction) goBack:(id)aSender
 {  {
    [[[mApplication keyWindow] windowController] back: aSender];     [[[mApplication mainWindow] windowController] back: aSender]; 
 }  }
   
 -(IBAction) goForward:(id)aSender  -(IBAction) goForward:(id)aSender
 {  {
    [[[mApplication keyWindow] windowController] forward: aSender];     [[[mApplication mainWindow] windowController] forward: aSender]; 
 }  }
   
 -(IBAction) doReload:(id)aSender  -(IBAction) doReload:(id)aSender
 {  {
    [(BrowserWindowController*)([[mApplication keyWindow] windowController]) reload: aSender];     [(BrowserWindowController*)([[mApplication mainWindow] windowController]) reload: aSender]; 
 }  }
   
 -(IBAction) doStop:(id)aSender  -(IBAction) doStop:(id)aSender
 {  {
    [(BrowserWindowController*)([[mApplication keyWindow] windowController]) stop: aSender];     [(BrowserWindowController*)([[mApplication mainWindow] windowController]) stop: aSender]; 
 }  }
   
 -(IBAction) goHome:(id)aSender  -(IBAction) goHome:(id)aSender
 {  {
    [[[mApplication keyWindow] windowController] home: aSender];    [[[mApplication mainWindow] windowController] home: aSender];
 }  }
   
 -(BrowserWindowController*)openBrowserWindowWithURLString: (NSString*)aURL  -(BrowserWindowController*)openBrowserWindowWithURLString: (NSString*)aURL
Line 292  static const char* ioServiceContractID = Line 278  static const char* ioServiceContractID =
     printf("Termination notification.\n");      printf("Termination notification.\n");
   
     // Autosave one of the windows.      // Autosave one of the windows.
    NSWindow* keyWindow = [mApplication keyWindow];    [[[mApplication mainWindow] windowController] autosaveWindowFrame];
    if (keyWindow) 
      [[keyWindow windowController] autosaveWindowFrame]; 
           
     mMenuBookmarks->RemoveObserver();      mMenuBookmarks->RemoveObserver();
     delete mMenuBookmarks;      delete mMenuBookmarks;
Line 305  static const char* ioServiceContractID = Line 289  static const char* ioServiceContractID =
 // Bookmarks menu actions.  // Bookmarks menu actions.
 -(IBAction) addBookmark:(id)aSender  -(IBAction) addBookmark:(id)aSender
 {  {
    NSWindow* keyWindow = [mApplication keyWindow];  [[[mApplication mainWindow] windowController] addBookmarkExtended: YES isFolder: NO];
    if (keyWindow)}
      [[keyWindow windowController] addBookmarkExtended: YES];
 -(IBAction) addFolder:(id)aSender
 {
   [[[mApplication mainWindow] windowController] addBookmarkExtended: YES isFolder: YES];
 }
 
 -(IBAction) addSeparator:(id)aSender
 {
 }  }
   
 -(IBAction) openMenuBookmark:(id)aSender  -(IBAction) openMenuBookmark:(id)aSender
 {  {
    NSWindow* keyWindow = [mApplication keyWindow];    NSWindow* mainWind = [mApplication mainWindow];
    if (!keyWindow) {    if (!mainWind) {
         [self openBrowserWindowWithURLString: @"about:blank"];          [self openBrowserWindowWithURLString: @"about:blank"];
        keyWindow = [mApplication keyWindow];        mainWind = [mApplication mainWindow];
     }      }
   
    BookmarksService::OpenMenuBookmark([keyWindow windowController], aSender);    BookmarksService::OpenMenuBookmark([mainWind windowController], aSender);
 }  }
   
 -(IBAction)manageBookmarks: (id)aSender  -(IBAction)manageBookmarks: (id)aSender
 {  {
  NSWindow* keyWindow = [mApplication keyWindow];  NSWindow* mainWindow = [mApplication mainWindow];
  if (!keyWindow) {  if (!mainWindow) {
     [self openBrowserWindowWithURLString: @"about:blank"];      [self openBrowserWindowWithURLString: @"about:blank"];
    keyWindow = [mApplication keyWindow];    mainWindow = [mApplication mainWindow];
   }    }
   
  [[keyWindow windowController] manageBookmarks: aSender];  [[mainWindow windowController] manageBookmarks: aSender];
 }  }
   
 - (MVPreferencesController *)preferencesController  - (MVPreferencesController *)preferencesController
Line 352  static const char* ioServiceContractID = Line 343  static const char* ioServiceContractID =
   
 - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename  - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
 {  {
    NSWindow* keyWindow = [mApplication keyWindow];    NSWindow* mainWindow = [mApplication mainWindow];
   
    if (keyWindow) {    if (mainWindow) {
        [[keyWindow windowController] loadURL:[NSURL fileURLWithPath:filename]];        [[mainWindow windowController] loadURL:[NSURL fileURLWithPath:filename]];
     } else {      } else {
         [self openBrowserWindowWithURL:[NSURL fileURLWithPath:filename]];          [self openBrowserWindowWithURL:[NSURL fileURLWithPath:filename]];
     }      }
Line 366  static const char* ioServiceContractID = Line 357  static const char* ioServiceContractID =
   
 - (IBAction)biggerTextSize:(id)aSender  - (IBAction)biggerTextSize:(id)aSender
 {  {
  NSWindow* keyWindow = [mApplication keyWindow];  [[[mApplication mainWindow] windowController] biggerTextSize];
  if (keyWindow) 
    [[keyWindow windowController] biggerTextSize]; 
 }  }
   
 - (IBAction)smallerTextSize:(id)aSender  - (IBAction)smallerTextSize:(id)aSender
 {  {
  NSWindow* keyWindow = [mApplication keyWindow];  [[[mApplication mainWindow] windowController] smallerTextSize];
  if (keyWindow) 
    [[keyWindow windowController] smallerTextSize]; 
 }  }
   
 - (IBAction)toggleSmoothText:(id)aSender  - (IBAction)toggleSmoothText:(id)aSender

Removed from v.1.44  
changed lines
  Added in v.1.46


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