Bug 519311 - Filename extension and format can get out of sync in bookmarks export; always set the extension to match the remembered file format when setting up the panel. r/sr=smorgan

git-svn-id: svn://10.0.0.236/branches/CAMINO_2_0_BRANCH@258519 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
alqahira%ardisson.org
2009-09-29 04:26:03 +00:00
parent f9443680f1
commit b36d99d7aa

View File

@@ -1443,7 +1443,6 @@ const int kZoomActionsTag = 108;
{
NSSavePanel* savePanel = [NSSavePanel savePanel];
[savePanel setPrompt:NSLocalizedString(@"Export", @"Export")];
[savePanel setRequiredFileType:@"html"];
[savePanel setCanSelectHiddenExtension:YES];
// get an accessory view for HTML or Safari .plist output
@@ -1454,10 +1453,13 @@ const int kZoomActionsTag = 108;
[[button itemAtIndex:1] setRepresentedObject:savePanel];
[savePanel setAccessoryView:mExportPanelView];
// Set the initial extension based on the remembered value for the output type.
int selectedButton = [button indexOfSelectedItem];
[self setFileExtension:[button itemAtIndex:selectedButton]];
// start the save panel
[NSMenu cancelAllTracking];
int saveResult = [savePanel runModalForDirectory:nil file:NSLocalizedString(@"ExportedBookmarkFile", @"Exported Bookmarks")];
int selectedButton = [button indexOfSelectedItem];
if (saveResult != NSFileHandlingPanelOKButton)
return;
if (0 == selectedButton)