diff --git a/Cocoa/Plug-Ins/Hex Editor/HexWindowController.m b/Cocoa/Plug-Ins/Hex Editor/HexWindowController.m index 6df6f4b..e25ce7c 100644 --- a/Cocoa/Plug-Ins/Hex Editor/HexWindowController.m +++ b/Cocoa/Plug-Ins/Hex Editor/HexWindowController.m @@ -42,8 +42,8 @@ OSStatus Plug_InitInstance( Plug_PlugInRef plug, Plug_ResourceRef resource ) // load the window from the nib file and set it's title [self window]; // implicitly loads nib - if( ![[resource name] isEqualToString:@""] ) - [[self window] setTitle:[resource name]]; + [[self window] setTitle:[resource nameForEditorWindow]]; + return self; } @@ -227,9 +227,7 @@ OSStatus Plug_InitInstance( Plug_PlugInRef plug, Plug_ResourceRef resource ) - (void)resourceNameDidChange:(NSNotification *)notification { - if( ![[(id )[notification object] name] isEqualToString:@""] ) - [[self window] setTitle:[(id )[notification object] name]]; - else [[self window] setTitle:NSLocalizedStringFromTableInBundle(@"Untitled Resource", @"Localizable", [NSBundle mainBundle], nil)]; + [[self window] setTitle:[(id )[notification object] nameForEditorWindow]]; } - (void)resourceDataDidChange:(NSNotification *)notification diff --git a/Cocoa/Plug-Ins/ResKnifeResourceProtocol.h b/Cocoa/Plug-Ins/ResKnifeResourceProtocol.h index 0348481..e12ff09 100644 --- a/Cocoa/Plug-Ins/ResKnifeResourceProtocol.h +++ b/Cocoa/Plug-Ins/ResKnifeResourceProtocol.h @@ -17,6 +17,7 @@ M. Uli Kusterer, witness(at)zathras.de, (c) 2003. REVISIONS: + 2003-08-05 UK Added nameForEditorWindow. 2003-07-31 UK Added document accessor, commented. ========================================================================== */ @@ -38,6 +39,7 @@ -(NSString*) name; -(void) setName: (NSString*)newName; +-(NSString*) nameForEditorWindow; -(NSString*) type; -(void) setType: (NSString*)newType;