diff --git a/Cocoa/Classes/PasteboardDocument.h b/Cocoa/Classes/PasteboardDocument.h index c3c5714..2cc23eb 100644 --- a/Cocoa/Classes/PasteboardDocument.h +++ b/Cocoa/Classes/PasteboardDocument.h @@ -3,7 +3,7 @@ @interface PasteboardDocument : ResourceDocument { - unsigned long generalChangeCount; // change count for the general pasteboard + int generalChangeCount; // change count for the general pasteboard } - (void)readPasteboard:(NSString *)pbName; diff --git a/Cocoa/Classes/PasteboardDocument.m b/Cocoa/Classes/PasteboardDocument.m index 1d19278..f275c16 100644 --- a/Cocoa/Classes/PasteboardDocument.m +++ b/Cocoa/Classes/PasteboardDocument.m @@ -13,12 +13,12 @@ return self; } -- (void)readPasteboard:(NSString *)pbName +-(void) readPasteboard:(NSString *)pbName { - NSPasteboard *pb = [NSPasteboard pasteboardWithName:pbName]; - NSArray *types = [pb types]; - NSEnumerator *enumerator = [types objectEnumerator]; - NSString *currentType; + NSPasteboard *pb = [NSPasteboard pasteboardWithName:pbName]; + NSArray *types = [pb types]; + NSEnumerator *enumerator = [types objectEnumerator]; + NSString *currentType; [[self undoManager] disableUndoRegistration]; while( currentType = [enumerator nextObject] ) @@ -42,6 +42,18 @@ [resources addObject:resource]; // array retains resource } [[self undoManager] enableUndoRegistration]; + + [outlineView reloadData]; } +-(void) windowDidBecomeKey: (NSNotification*)notification +{ + // This mess sponsored by Uli Kusterer ;-) + generalChangeCount = [[NSPasteboard generalPasteboard] changeCount]; + [resources removeAllObjects]; + + [self readPasteboard:NSGeneralPboard]; // Update window contents. +} + + @end diff --git a/Cocoa/Classes/PasteboardWindowController.m b/Cocoa/Classes/PasteboardWindowController.m index 01ff53c..c66a484 100644 --- a/Cocoa/Classes/PasteboardWindowController.m +++ b/Cocoa/Classes/PasteboardWindowController.m @@ -13,7 +13,9 @@ { static PasteboardWindowController *sharedPasteboardWindowController = nil; if( !sharedPasteboardWindowController ) + { sharedPasteboardWindowController = [[PasteboardWindowController allocWithZone:[self zone]] init]; + } return sharedPasteboardWindowController; } diff --git a/Cocoa/Resources/ResKnife.icns b/Cocoa/Resources/ResKnife.icns index d54c63c..b01faf6 100644 Binary files a/Cocoa/Resources/ResKnife.icns and b/Cocoa/Resources/ResKnife.icns differ diff --git a/TODO.txt b/TODO.txt index e9be76c..8da3276 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,2 +1,3 @@ -> "Open as Hex" displays "(null)" as the document name. Why? --> Template editor always forces at least one item in a list. Make it support empty lists. \ No newline at end of file +-> Changing the type/creator of a file isn't written to disk by ResourceDocument. +-> Create small versions of the doc icons in Photoshop instead of letting IconComposer use its cheap scaling on them. \ No newline at end of file