* Source/GSToolbarView.m: Added code to save the configuration when

deleting an item as well as saving an item.
	* Source/NSToolbarFrameworkPrivate.h: removed old _loadConfig method
	added new methods to track changes to toolbars.
	* Source/NSToolbar.m: Added check for items already in the toolbar,
	removed calls to _loadConfig which were commented out, implemented
	setConfigurationFromDictionary: as described in the documentation,
	changed _build to get dictionary from defaults if it's there. 
	Implemented new method _containsItemWithIdentifier: and 
	_itemsFromConfig.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28084 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
gcasa 2009-03-16 07:33:31 +00:00
parent e1b4fe3b38
commit 31e0c9633c
4 changed files with 126 additions and 21 deletions

View file

@ -397,13 +397,16 @@ static void initSystemExtensionsColors(void)
NSToolbar *toolbar = [self toolbar];
NSToolbarItem *item = [[info draggingSource] toolbarItem];
int newIndex = [self _insertionIndexAtPoint: [info draggingLocation]];
// Calculate the index
if(index == -1)
{
[toolbar _insertItemWithItemIdentifier: [item itemIdentifier]
atIndex: newIndex
broadcast: YES];
NSString *identifier = [item itemIdentifier];
if([_toolbar _containsItemWithIdentifier: identifier] == NO)
{
[toolbar _insertItemWithItemIdentifier: identifier
atIndex: newIndex
broadcast: YES];
}
RELEASE(item);
}
else
@ -412,6 +415,9 @@ static void initSystemExtensionsColors(void)
RELEASE(item);
[toolbar _moveItemFromIndex: index toIndex: newIndex broadcast: YES];
}
// save the configuration...
[toolbar _saveConfig];
return YES;
}