Diff for /chimera/MyBrowserView.mm between versions 1.11 and 1.16

version 1.11, 2002/02/05 00:34:14 version 1.16, 2002/02/11 07:22:13
Line 25  static const char* ioServiceContractID = Line 25  static const char* ioServiceContractID =
   
 -(void)dealloc  -(void)dealloc
 {  {
       printf("My browser view died.\n");
       
     [[NSNotificationCenter defaultCenter] removeObserver: self];      [[NSNotificationCenter defaultCenter] removeObserver: self];
           
         [defaultStatus release];          [defaultStatus release];
Line 38  static const char* ioServiceContractID = Line 40  static const char* ioServiceContractID =
   [browserView loadURI:[NSURL URLWithString:[urlbar stringValue]] flags:NSLoadFlagsNone];    [browserView loadURI:[NSURL URLWithString:[urlbar stringValue]] flags:NSLoadFlagsNone];
 }  }
   
- (void)awakeFromNib -(void)disconnectView
 {  {
  browserView = [[[NSBrowserView alloc] initWithFrame:[self bounds]] autorelease];    urlbar = nil;
  [self addSubview:browserView];    status = nil;
  [browserView setContainer:self];    progress = nil;
  [browserView addListener:self];    progressSuper = nil;
    mIsPrimary = NO;
     [[NSNotificationCenter defaultCenter] removeObserver:self];
 }
 
 - (id)initWithFrame:(NSRect)frameRect
 {
     [super initWithFrame: frameRect];
      browserView = [[[NSBrowserView alloc] initWithFrame:[self bounds]] autorelease];
     [self addSubview:browserView];
     [browserView setContainer:self];
     [browserView addListener:self];
     mIsBusy = NO;
     return self;
 }
 
 -(void)makePrimaryBrowserView: (NSTabViewItem*)tab urlbar: (id)aUrlbar status: (id)aStatus
     progress: (id)aProgress windowController: aWindowController
 {
   mTab = tab;
   urlbar = aUrlbar;
   status = aStatus;
   progress = aProgress;
   progressSuper = [aProgress superview];
   mWindowController = aWindowController;
   
   if (!mIsBusy) {
     [progress retain];
     [progress removeFromSuperview];
   }
   
   defaultStatus = NULL;    defaultStatus = NULL;
   loadingStatus = DOCUMENT_DONE_STRING;    loadingStatus = DOCUMENT_DONE_STRING;
   [status setStringValue:loadingStatus];    [status setStringValue:loadingStatus];
   mIsBusy = NO;  
     
   [progress retain];  
   [progress removeFromSuperview];  
       
     mIsPrimary = YES;
    
   nsCOMPtr<nsIIOService> ioService(do_GetService(ioServiceContractID));    nsCOMPtr<nsIIOService> ioService(do_GetService(ioServiceContractID));
   if (!ioService)    if (!ioService)
     return;      return;
Line 60  static const char* ioServiceContractID = Line 89  static const char* ioServiceContractID =
   ioService->GetOffline(&offline);    ioService->GetOffline(&offline);
   mOffline = offline;    mOffline = offline;
       
  [[NSNotificationCenter defaultCenter] addObserver:self  if (mWindowController) // Only register if we're the content area.
      selector:@selector(offlineModeChanged:)    [[NSNotificationCenter defaultCenter] addObserver:self
      name:@"offlineModeChanged"        selector:@selector(offlineModeChanged:)
      object:nil];        name:@"offlineModeChanged"
         object:nil];
 }
 
 - (void)awakeFromNib 
 {
 }  }
   
 - (void)setFrame:(NSRect)frameRect  - (void)setFrame:(NSRect)frameRect
Line 94  static const char* ioServiceContractID = Line 128  static const char* ioServiceContractID =
   [status setStringValue:loadingStatus];    [status setStringValue:loadingStatus];
   
   mIsBusy = YES;    mIsBusy = YES;
     [mTab setLabel: LOADING_STRING];
     
   if (mWindowController)    if (mWindowController)
     [mWindowController updateToolbarItems];      [mWindowController updateToolbarItems];
 }  }
Line 137  static const char* ioServiceContractID = Line 173  static const char* ioServiceContractID =
   [mWindowController updateLocationFields:spec];    [mWindowController updateLocationFields:spec];
 }  }
   
   - (void)onStatusChange:(NSString*)aStatusString
   {
     [status setStringValue: aStatusString];
   }
   
 - (void)setStatus:(NSString *)statusString ofType:(NSStatusType)type   - (void)setStatus:(NSString *)statusString ofType:(NSStatusType)type 
 {  {
   if (type == NSStatusTypeScriptDefault) {    if (type == NSStatusTypeScriptDefault) {
Line 168  static const char* ioServiceContractID = Line 209  static const char* ioServiceContractID =
   
 - (void)setTitle:(NSString *)title  - (void)setTitle:(NSString *)title
 {  {
    if (mOffline) {    if (!mWindowController)
        NSString* newTitle;        return; // Sidebar panels can't affect the window title.
        if (title && ![title isEqualToString:@""])    
            newTitle = [title stringByAppendingString: @" [Working Offline]"];    // We must be the primary content area.
        else    if (mIsPrimary) {
            newTitle = @"Untitled [Working Offline]";        if (mOffline) {
        [[mWindowController window] setTitle: newTitle];            NSString* newTitle;
    }            if (title && ![title isEqualToString:@""])
    else {                newTitle = [title stringByAppendingString: @" [Working Offline]"];
        if (title && ![title isEqualToString:@""])            else
            [[mWindowController window] setTitle:title];                newTitle = @"Untitled [Working Offline]";
        else            [[mWindowController window] setTitle: newTitle];
            [[mWindowController window] setTitle:@"Untitled"];        }
         else {
             if (title && ![title isEqualToString:@""])
                 [[mWindowController window] setTitle:title];
             else
                 [[mWindowController window] setTitle:@"Untitled"];
         }
     }      }
       
       // Always set the tab.
       if (title && ![title isEqualToString:@""])
           [mTab setLabel:title];
       else
           [mTab setLabel:@"Untitled"];
 }  }
   
 - (void)offlineModeChanged: (NSNotification*)aNotification  - (void)offlineModeChanged: (NSNotification*)aNotification

Removed from v.1.11  
changed lines
  Added in v.1.16


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