mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 14:40:37 +00:00
Fully implement the class NSUserDefaultsController.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27522 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
432f5358af
commit
fe8a97bae9
5 changed files with 267 additions and 23 deletions
|
@ -68,13 +68,13 @@
|
|||
if((self = [super init]) != nil)
|
||||
{
|
||||
if([aDecoder allowsKeyedCoding])
|
||||
{
|
||||
ASSIGN(_declared_keys,[aDecoder decodeObjectForKey: @"NSDeclaredKeys"]);
|
||||
}
|
||||
{
|
||||
ASSIGN(_declared_keys,[aDecoder decodeObjectForKey: @"NSDeclaredKeys"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSIGN(_declared_keys,[aDecoder decodeObject]);
|
||||
}
|
||||
{
|
||||
ASSIGN(_declared_keys,[aDecoder decodeObject]);
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -93,13 +93,34 @@
|
|||
{
|
||||
if (![[_editors objectAtIndex: i] commitEditing])
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void) commitEditingWithDelegate: (id)delegate
|
||||
didCommitSelector: (SEL)didCommitSelector
|
||||
contextInfo: (void*)contextInfo
|
||||
{
|
||||
unsigned c = [_editors count];
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < c; i++)
|
||||
{
|
||||
BOOL didCommit = [[_editors objectAtIndex: i] commitEditing];
|
||||
if (delegate != nil && didCommitSelector != NULL)
|
||||
{
|
||||
void (*meth)(id, SEL, id, BOOL, void*);
|
||||
meth = (void (*)(id, SEL, id, BOOL, void*))[delegate methodForSelector:
|
||||
didCommitSelector];
|
||||
if (meth)
|
||||
meth(delegate, didCommitSelector, self, didCommit, contextInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void) discardEditing
|
||||
{
|
||||
[_editors makeObjectsPerformSelector: @selector(discardEditing)];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue