mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-24 03:51:22 +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>
|
2012-07-25 22:29-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||||
|
|
||||||
* GormCore/GormDocument.m: Apply patch suggested by Sebastian.
|
* GormCore/GormDocument.m: Apply patch suggested by Sebastian.
|
||||||
|
|
|
@ -325,8 +325,14 @@ static BOOL currently_displaying = NO;
|
||||||
|
|
||||||
- (void) editedObjectFrameDidChange: (id) sender
|
- (void) editedObjectFrameDidChange: (id) sender
|
||||||
{
|
{
|
||||||
|
[self setPostsFrameChangedNotifications:NO];
|
||||||
|
[self setPostsBoundsChangedNotifications:NO];
|
||||||
|
|
||||||
[self setFrame: [_editedObject frame]];
|
[self setFrame: [_editedObject frame]];
|
||||||
[self setBounds: [_editedObject frame]];
|
[self setBounds: [_editedObject frame]];
|
||||||
|
|
||||||
|
[self setPostsFrameChangedNotifications:YES];
|
||||||
|
[self setPostsBoundsChangedNotifications:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) frameDidChange: (id) sender
|
- (void) frameDidChange: (id) sender
|
||||||
|
|
|
@ -46,6 +46,12 @@
|
||||||
return @"GSNibFileType";
|
return @"GSNibFileType";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSDictionary *)defaultClassesDict
|
||||||
|
{
|
||||||
|
NSString *defaultClassesString = @"{ IBClasses = ({CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }); IBVersion = 1; }";
|
||||||
|
return [defaultClassesString propertyList];
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL) isTopLevelObject: (id)obj
|
- (BOOL) isTopLevelObject: (id)obj
|
||||||
{
|
{
|
||||||
NSMapTable *objects = [container objects];
|
NSMapTable *objects = [container objects];
|
||||||
|
@ -75,8 +81,7 @@
|
||||||
NSString *subClassName = nil;
|
NSString *subClassName = nil;
|
||||||
NSDictionary *fileWrappers = nil;
|
NSDictionary *fileWrappers = nil;
|
||||||
|
|
||||||
if ([super loadFileWrapper: wrapper withDocument: doc] &&
|
if ([super loadFileWrapper: wrapper withDocument: doc])
|
||||||
[wrapper isDirectory])
|
|
||||||
{
|
{
|
||||||
GormClassManager *classManager = [document classManager];
|
GormClassManager *classManager = [document classManager];
|
||||||
id docFilesOwner;
|
id docFilesOwner;
|
||||||
|
@ -87,40 +92,49 @@
|
||||||
NSMapTable *classesTable;
|
NSMapTable *classesTable;
|
||||||
NSArray *classKeys;
|
NSArray *classKeys;
|
||||||
|
|
||||||
key = nil;
|
|
||||||
fileWrappers = [wrapper fileWrappers];
|
|
||||||
|
|
||||||
// turn off custom classes...
|
// turn off custom classes...
|
||||||
[NSClassSwapper setIsInInterfaceBuilder: YES];
|
[NSClassSwapper setIsInInterfaceBuilder: YES];
|
||||||
en = [fileWrappers keyEnumerator];
|
|
||||||
while((key = [en nextObject]) != nil)
|
if([wrapper isDirectory])
|
||||||
{
|
{
|
||||||
NSFileWrapper *fw = [fileWrappers objectForKey: key];
|
key = nil;
|
||||||
if([fw isRegularFile])
|
fileWrappers = [wrapper fileWrappers];
|
||||||
|
|
||||||
|
en = [fileWrappers keyEnumerator];
|
||||||
|
while((key = [en nextObject]) != nil)
|
||||||
{
|
{
|
||||||
NSData *fileData = [fw regularFileContents];
|
NSFileWrapper *fw = [fileWrappers objectForKey: key];
|
||||||
if([key isEqual: @"keyedobjects.nib"])
|
if([fw isRegularFile])
|
||||||
{
|
{
|
||||||
data = fileData;
|
NSData *fileData = [fw regularFileContents];
|
||||||
}
|
if([key isEqual: @"keyedobjects.nib"])
|
||||||
else if([key isEqual: @"classes.nib"])
|
|
||||||
{
|
|
||||||
classes = fileData;
|
|
||||||
|
|
||||||
// load the custom classes...
|
|
||||||
if (![classManager loadNibFormatCustomClassesWithData: classes])
|
|
||||||
{
|
{
|
||||||
NSRunAlertPanel(_(@"Problem Loading"),
|
data = fileData;
|
||||||
_(@"Could not open the associated classes file.\n"
|
}
|
||||||
@"You won't be able to edit connections on custom classes"),
|
else if([key isEqual: @"classes.nib"])
|
||||||
_(@"OK"), nil, nil);
|
{
|
||||||
|
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...
|
// check the data...
|
||||||
if (data == nil || classes == nil)
|
if (data == nil)// || classes == nil)
|
||||||
{
|
{
|
||||||
result = NO;
|
result = NO;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue