diff --git a/ChangeLog b/ChangeLog index f03a7d58..ccd6f726 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-12-12 12:33-EST Gregory John Casamento + + * GormCore/GormViewEditor.m: Prevent recursive frame/bounds + notifications when resizing a view. + * Plugins/Nib/GormNibWrapperLoader.m: Preliminary changes to support + reading nibs as files instead of packages. + 2012-07-25 22:29-EDT Gregory John Casamento * GormCore/GormDocument.m: Apply patch suggested by Sebastian. diff --git a/GormCore/GormViewEditor.m b/GormCore/GormViewEditor.m index 8d3629db..b569be75 100644 --- a/GormCore/GormViewEditor.m +++ b/GormCore/GormViewEditor.m @@ -325,8 +325,14 @@ static BOOL currently_displaying = NO; - (void) editedObjectFrameDidChange: (id) sender { + [self setPostsFrameChangedNotifications:NO]; + [self setPostsBoundsChangedNotifications:NO]; + [self setFrame: [_editedObject frame]]; [self setBounds: [_editedObject frame]]; + + [self setPostsFrameChangedNotifications:YES]; + [self setPostsBoundsChangedNotifications:YES]; } - (void) frameDidChange: (id) sender diff --git a/Plugins/Nib/GormNibWrapperLoader.m b/Plugins/Nib/GormNibWrapperLoader.m index 34aa20eb..7a9f6ebf 100644 --- a/Plugins/Nib/GormNibWrapperLoader.m +++ b/Plugins/Nib/GormNibWrapperLoader.m @@ -46,6 +46,12 @@ return @"GSNibFileType"; } +- (NSDictionary *)defaultClassesDict +{ + NSString *defaultClassesString = @"{ IBClasses = ({CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }); IBVersion = 1; }"; + return [defaultClassesString propertyList]; +} + - (BOOL) isTopLevelObject: (id)obj { NSMapTable *objects = [container objects]; @@ -75,8 +81,7 @@ NSString *subClassName = nil; NSDictionary *fileWrappers = nil; - if ([super loadFileWrapper: wrapper withDocument: doc] && - [wrapper isDirectory]) + if ([super loadFileWrapper: wrapper withDocument: doc]) { GormClassManager *classManager = [document classManager]; id docFilesOwner; @@ -87,40 +92,49 @@ NSMapTable *classesTable; NSArray *classKeys; - key = nil; - fileWrappers = [wrapper fileWrappers]; - // turn off custom classes... [NSClassSwapper setIsInInterfaceBuilder: YES]; - en = [fileWrappers keyEnumerator]; - while((key = [en nextObject]) != nil) + + if([wrapper isDirectory]) { - NSFileWrapper *fw = [fileWrappers objectForKey: key]; - if([fw isRegularFile]) + key = nil; + fileWrappers = [wrapper fileWrappers]; + + en = [fileWrappers keyEnumerator]; + while((key = [en nextObject]) != nil) { - NSData *fileData = [fw regularFileContents]; - if([key isEqual: @"keyedobjects.nib"]) + NSFileWrapper *fw = [fileWrappers objectForKey: key]; + if([fw isRegularFile]) { - data = fileData; - } - else if([key isEqual: @"classes.nib"]) - { - classes = fileData; - - // load the custom classes... - if (![classManager loadNibFormatCustomClassesWithData: classes]) + NSData *fileData = [fw regularFileContents]; + if([key isEqual: @"keyedobjects.nib"]) { - NSRunAlertPanel(_(@"Problem Loading"), - _(@"Could not open the associated classes file.\n" - @"You won't be able to edit connections on custom classes"), - _(@"OK"), nil, nil); + data = fileData; + } + else if([key isEqual: @"classes.nib"]) + { + classes = fileData; + + // load the custom classes... + if (![classManager loadNibFormatCustomClassesWithData: classes]) + { + NSRunAlertPanel(_(@"Problem Loading"), + _(@"Could not open the associated classes file.\n" + @"You won't be able to edit connections on custom classes"), + _(@"OK"), nil, nil); + } } } } } - + else + { + data = [wrapper regularFileContents]; + classes = nil; // (NSData *)0xdeadbeef; + } + // check the data... - if (data == nil || classes == nil) + if (data == nil)// || classes == nil) { result = NO; }