Set save panel accessory view before calling -prepareSavePanel: to

allow clients to modify the accessory view.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35791 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2012-11-12 08:14:03 +00:00
parent e0e4395cd7
commit 7e5f0c199c
2 changed files with 18 additions and 8 deletions

View file

@ -1,3 +1,11 @@
2012-11-12 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSDocument.m (-_runSavePanelForSaveOperation:): Set save
panel accessory view before calling -prepareSavePanel: to allow
clients to modify the accessory view. Furthermore, don't call
-prepareSavePanel: if -runModalSavePanel:withAccessoryView: is
overridden.
2012-11-05 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSApplication.m (-_openFiles): Protect agains empty arguments.

View file

@ -1146,7 +1146,6 @@ originalContentsURL: (NSURL *)orig
- (NSSavePanel *)_runSavePanelForSaveOperation: (NSSaveOperationType)saveOperation
{
NSView *accessory = nil;
NSString *title;
NSString *directory;
NSArray *types;
@ -1164,7 +1163,7 @@ originalContentsURL: (NSURL *)orig
[self _addItemsToSpaButtonFromArray: types];
accessory = _save_panel_accessory;
[savePanel setAccessoryView: _save_panel_accessory];
}
if ([types count] > 0)
@ -1192,13 +1191,16 @@ originalContentsURL: (NSURL *)orig
else
directory = [controller currentDirectory];
[savePanel setDirectory: directory];
if (![self prepareSavePanel: savePanel])
{
return nil;
}
if ([self runModalSavePanel: savePanel withAccessoryView: accessory])
if (!OVERRIDDEN(runModalSavePanel:withAccessoryView:))
{
if (![self prepareSavePanel: savePanel])
{
return nil;
}
}
if ([self runModalSavePanel: savePanel
withAccessoryView: [savePanel accessoryView]])
{
return savePanel;
}