mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 19:51:00 +00:00
* 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. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@35882 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d7a2c8488f
commit
1c60f26d3a
3 changed files with 52 additions and 25 deletions
|
@ -1,3 +1,10 @@
|
|||
2012-12-12 12:33-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* 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 <greg.casamento@gmail.com>
|
||||
|
||||
* GormCore/GormDocument.m: Apply patch suggested by Sebastian.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue