Diff for /chimera/MyBrowserView.mm between versions 1.8 and 1.12

version 1.8, 2002/02/04 07:00:31 version 1.12, 2002/02/07 05:11:38
Line 4 Line 4
   
 #import "MyBrowserView.h"  #import "MyBrowserView.h"
   
   #include "nsCOMPtr.h"
   #include "nsIServiceManager.h"
   #include "nsIIOService.h"
   
 #define DOCUMENT_DONE_STRING @"Document: Done"  #define DOCUMENT_DONE_STRING @"Document: Done"
 #define LOADING_STRING @"Loading..."  #define LOADING_STRING @"Loading..."
   
   static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
   
 @implementation MyBrowserView  @implementation MyBrowserView
   
 -(void)windowClosed  -(void)windowClosed
Line 14 Line 20
     // Break the cycle.      // Break the cycle.
     [browserView setContainer: nil];      [browserView setContainer: nil];
     [browserView removeListener: self];      [browserView removeListener: self];
       [browserView destroyWebBrowser];
 }  }
   
 -(void)dealloc  -(void)dealloc
 {  {
       [[NSNotificationCenter defaultCenter] removeObserver: self];
       
         [defaultStatus release];          [defaultStatus release];
     [loadingStatus release];      [loadingStatus release];
           
Line 43 Line 52
       
   [progress retain];    [progress retain];
   [progress removeFromSuperview];    [progress removeFromSuperview];
     
     nsCOMPtr<nsIIOService> ioService(do_GetService(ioServiceContractID));
     if (!ioService)
       return;
     PRBool offline = PR_FALSE;
     ioService->GetOffline(&offline);
     mOffline = offline;
     
     if (mWindowController) // Only register if we're the content area.
       [[NSNotificationCenter defaultCenter] addObserver:self
           selector:@selector(offlineModeChanged:)
           name:@"offlineModeChanged"
           object:nil];
 }  }
   
 - (void)setFrame:(NSRect)frameRect  - (void)setFrame:(NSRect)frameRect
Line 147 Line 169
   
 - (void)setTitle:(NSString *)title  - (void)setTitle:(NSString *)title
 {  {
    if ( (title) && (! [title isEqualToString:@""]) ) {    if (!mWindowController)
        [[mWindowController window] setTitle:title];        return; // Sidebar panels can't affect the window title.
    } else {        
        [[mWindowController window] setTitle:@"Untitled"];    if (mOffline) {
         NSString* newTitle;
         if (title && ![title isEqualToString:@""])
             newTitle = [title stringByAppendingString: @" [Working Offline]"];
         else
             newTitle = @"Untitled [Working Offline]";
         [[mWindowController window] setTitle: newTitle];
     }
     else {
         if (title && ![title isEqualToString:@""])
             [[mWindowController window] setTitle:title];
         else
             [[mWindowController window] setTitle:@"Untitled"];
     }
 }
 
 - (void)offlineModeChanged: (NSNotification*)aNotification
 {
     nsCOMPtr<nsIIOService> ioService(do_GetService(ioServiceContractID));
     if (!ioService)
         return;
     PRBool offline = PR_FALSE;
     ioService->GetOffline(&offline);
     mOffline = offline;
     
     if (mOffline) {
         NSString* newTitle = [[[mWindowController window] title] stringByAppendingString: @" [Working Offline]"];
         [[mWindowController window] setTitle: newTitle];
     }
     else {
         NSArray* titleItems = [[[mWindowController window] title] componentsSeparatedByString:@" [Working Offline]"];
         [[mWindowController window] setTitle: [titleItems objectAtIndex: 0]];
     }      }
 }  }
   

Removed from v.1.8  
changed lines
  Added in v.1.12


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