diff --git a/mozilla/camino/PreferencePanes/History/English.lproj/Localizable.strings.in b/mozilla/camino/PreferencePanes/History/English.lproj/Localizable.strings.in index c3b780f38a2..554c9dc44ae 100644 --- a/mozilla/camino/PreferencePanes/History/English.lproj/Localizable.strings.in +++ b/mozilla/camino/PreferencePanes/History/English.lproj/Localizable.strings.in @@ -1,14 +1,13 @@ "PreferencePanelLabel" = "History"; -"OKButtonText" = "OK"; -"CancelButtonText" = "Cancel"; - -/* Empty cache messages */ +/* Empty cache messages (note that these are duplicates from the main bundle) */ "EmptyCacheTitle" = "Are you sure you want to empty the cache?"; -"EmptyCacheMessage" = "Camino saves the contents of websites you visit in a cache so that they load more quickly on future visits. You cannot undo this action."; -"EmptyButton" = "Empty Cache"; +"EmptyCacheMessage" = "Camino saves the contents of web pages you visit in a cache so that they load more quickly on future visits.\n\nYou cannot undo this action.\n"; +"EmptyCacheButtonText" = "Empty Cache"; +"DontEmptyButtonText" = "Don’t Empty"; -/* Clear history message */ +/* Clear history message (note that these are duplicates from the main bundle) */ "ClearHistoryTitle" = "Are you sure you want to clear the history?"; -"ClearHistoryMessage" = "Clearing your history will erase the list of sites that you have visited. You won’t be able to autocomplete the URLs of these sites when typing in the location bar."; -"ClearHistoryButton" = "Clear History"; +"ClearHistoryMessage" = "Clearing your history will erase the list of sites that you have visited. You won’t be able to autocomplete the URLs of these sites when typing in the location bar.\n\nYou cannot undo this action.\n"; +"ClearHistoryButtonText" = "Clear History"; +"DontClearButtonText" = "Don’t Clear"; diff --git a/mozilla/camino/PreferencePanes/History/History.mm b/mozilla/camino/PreferencePanes/History/History.mm index d6726b23f77..b9ae6fd8c61 100644 --- a/mozilla/camino/PreferencePanes/History/History.mm +++ b/mozilla/camino/PreferencePanes/History/History.mm @@ -107,47 +107,51 @@ static const int kDefaultExpireDays = 9; // Clear the user's disk cache - (IBAction)clearDiskCache:(id)aSender { - NSBeginCriticalAlertSheet([self localizedStringForKey:@"EmptyCacheTitle"], - [self localizedStringForKey:@"EmptyButton"], - [self localizedStringForKey:@"CancelButtonText"], - nil, - [textFieldHistoryDays window], // any view will do - self, - @selector(clearDiskCacheSheetDidEnd:returnCode:contextInfo:), - nil, - NULL, - [self localizedStringForKey:@"EmptyCacheMessage"]); + NSAlert* clearCacheAlert = [[[NSAlert alloc] init] autorelease]; + [clearCacheAlert setMessageText:[self localizedStringForKey:@"EmptyCacheTitle"]]; + [clearCacheAlert setInformativeText:[self localizedStringForKey:@"EmptyCacheMessage"]]; + [clearCacheAlert addButtonWithTitle:[self localizedStringForKey:@"EmptyCacheButtonText"]]; + NSButton* dontEmptyButton = [clearCacheAlert addButtonWithTitle:[self localizedStringForKey:@"DontEmptyButtonText"]]; + [dontEmptyButton setKeyEquivalent:@"\e"]; // escape + + [clearCacheAlert setAlertStyle:NSCriticalAlertStyle]; + [clearCacheAlert beginSheetModalForWindow:[textFieldHistoryDays window] + modalDelegate:self + didEndSelector:@selector(clearDiskCacheAlertDidEnd:returnCode:contextInfo:) + contextInfo:nil]; } // use the browser history service to clear out the user's global history - (IBAction)clearGlobalHistory:(id)sender { - NSBeginCriticalAlertSheet([self localizedStringForKey:@"ClearHistoryTitle"], - [self localizedStringForKey:@"ClearHistoryButton"], - [self localizedStringForKey:@"CancelButtonText"], - nil, - [textFieldHistoryDays window], // any view willl do - self, - @selector(clearGlobalHistorySheetDidEnd:returnCode:contextInfo:), - nil, - NULL, - [self localizedStringForKey:@"ClearHistoryMessage"]); + NSAlert* clearGlobalHistoryAlert = [[[NSAlert alloc] init] autorelease]; + [clearGlobalHistoryAlert setMessageText:[self localizedStringForKey:@"ClearHistoryTitle"]]; + [clearGlobalHistoryAlert setInformativeText:[self localizedStringForKey:@"ClearHistoryMessage"]]; + [clearGlobalHistoryAlert addButtonWithTitle:[self localizedStringForKey:@"ClearHistoryButtonText"]]; + NSButton* dontClearButton = [clearGlobalHistoryAlert addButtonWithTitle:[self localizedStringForKey:@"DontClearButtonText"]]; + [dontClearButton setKeyEquivalent:@"\e"]; // escape + + [clearGlobalHistoryAlert setAlertStyle:NSCriticalAlertStyle]; + [clearGlobalHistoryAlert beginSheetModalForWindow:[textFieldHistoryDays window] + modalDelegate:self + didEndSelector:@selector(clearGlobalHistoryAlertDidEnd:returnCode:contextInfo:) + contextInfo:nil]; } #pragma mark - -- (void)clearDiskCacheSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo +- (void)clearDiskCacheAlertDidEnd:(NSAlert *)alert returnCode:(int)returnCode contextInfo:(void *)contextInfo { - if (returnCode == NSAlertDefaultReturn) { + if (returnCode == NSAlertFirstButtonReturn) { nsCOMPtr cacheServ (do_GetService("@mozilla.org/network/cache-service;1")); if (cacheServ) cacheServ->EvictEntries(nsICache::STORE_ANYWHERE); } } -- (void)clearGlobalHistorySheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo +- (void)clearGlobalHistoryAlertDidEnd:(NSAlert *)alert returnCode:(int)returnCode contextInfo:(void *)contextInfo { - if (returnCode == NSAlertDefaultReturn) { + if (returnCode == NSAlertFirstButtonReturn) { nsCOMPtr hist (do_GetService("@mozilla.org/browser/global-history;2")); if (hist) hist->RemoveAllPages(); diff --git a/mozilla/camino/PreferencePanes/Privacy/English.lproj/Localizable.strings.in b/mozilla/camino/PreferencePanes/Privacy/English.lproj/Localizable.strings.in index 7074e395eb2..8ce7c489e60 100644 --- a/mozilla/camino/PreferencePanes/Privacy/English.lproj/Localizable.strings.in +++ b/mozilla/camino/PreferencePanes/Privacy/English.lproj/Localizable.strings.in @@ -8,7 +8,7 @@ "CookieExpiresOnQuit" = "On Quit"; -"CancelButtonText" = "Cancel"; +"DontRemoveButtonText" = "Don’t Remove"; /* cookie removal warning */ "Remove All Cookies" = "Remove All Cookies"; diff --git a/mozilla/camino/PreferencePanes/Privacy/PrivacyPane.mm b/mozilla/camino/PreferencePanes/Privacy/PrivacyPane.mm index 7140b386de8..1e7c8220626 100644 --- a/mozilla/camino/PreferencePanes/Privacy/PrivacyPane.mm +++ b/mozilla/camino/PreferencePanes/Privacy/PrivacyPane.mm @@ -300,12 +300,16 @@ const int kSortReverse = 1; - (IBAction)removeAllCookies:(id)aSender { - if (NSRunCriticalAlertPanel([self localizedStringForKey:@"RemoveAllCookiesWarningTitle"], - [self localizedStringForKey:@"RemoveAllCookiesWarning"], - [self localizedStringForKey:@"Remove All Cookies"], - [self localizedStringForKey:@"CancelButtonText"], - nil) == NSAlertDefaultReturn) - { + NSAlert* removeAllCookiesAlert = [[[NSAlert alloc] init] autorelease]; + [removeAllCookiesAlert setMessageText:[self localizedStringForKey:@"RemoveAllCookiesWarningTitle"]]; + [removeAllCookiesAlert setInformativeText:[self localizedStringForKey:@"RemoveAllCookiesWarning"]]; + [removeAllCookiesAlert addButtonWithTitle:[self localizedStringForKey:@"Remove All Cookies"]]; + NSButton* dontRemoveButton = [removeAllCookiesAlert addButtonWithTitle:[self localizedStringForKey:@"DontRemoveButtonText"]]; + [dontRemoveButton setKeyEquivalent:@"\e"]; // escape + + [removeAllCookiesAlert setAlertStyle:NSCriticalAlertStyle]; + + if ([removeAllCookiesAlert runModal] == NSAlertFirstButtonReturn) { [[CHCookieStorage cookieStorage] deleteAllCookies]; [mCookies release]; @@ -512,12 +516,17 @@ const int kSortReverse = 1; CHPermissionManager* permManager = [CHPermissionManager permissionManager]; if (!permManager) return; - if (NSRunCriticalAlertPanel([self localizedStringForKey:@"RemoveAllCookiePermissionsWarningTitle"], - [self localizedStringForKey:@"RemoveAllCookiePermissionsWarning"], - [self localizedStringForKey:@"Remove All Exceptions"], - [self localizedStringForKey:@"CancelButtonText"], - nil) == NSAlertDefaultReturn) - { + + NSAlert* removeAllCookiePermissionsAlert = [[[NSAlert alloc] init] autorelease]; + [removeAllCookiePermissionsAlert setMessageText:[self localizedStringForKey:@"RemoveAllCookiePermissionsWarningTitle"]]; + [removeAllCookiePermissionsAlert setInformativeText:[self localizedStringForKey:@"RemoveAllCookiePermissionsWarning"]]; + [removeAllCookiePermissionsAlert addButtonWithTitle:[self localizedStringForKey:@"Remove All Exceptions"]]; + NSButton* dontRemoveButton = [removeAllCookiePermissionsAlert addButtonWithTitle:[self localizedStringForKey:@"DontRemoveButtonText"]]; + [dontRemoveButton setKeyEquivalent:@"\e"]; // escape + + [removeAllCookiePermissionsAlert setAlertStyle:NSCriticalAlertStyle]; + + if ([removeAllCookiePermissionsAlert runModal] == NSAlertFirstButtonReturn) { NSEnumerator* permissionEnumerator = [mPermissions objectEnumerator]; CHPermission* permission; while ((permission = [permissionEnumerator nextObject])) { @@ -637,11 +646,16 @@ const int kSortReverse = 1; } - (IBAction)removeAllKeychainExclusions:(id)sender { - if (NSRunCriticalAlertPanel([self localizedStringForKey:@"RemoveAllKeychainExclusionsWarningTitle"], - [self localizedStringForKey:@"RemoveAllKeychainExclusionsWarning"], - [self localizedStringForKey:@"RemoveAllKeychainExclusionsButton"], - [self localizedStringForKey:@"CancelButtonText"], - nil) == NSAlertDefaultReturn) { + NSAlert* removeAllKeychainExclusionsAlert = [[[NSAlert alloc] init] autorelease]; + [removeAllKeychainExclusionsAlert setMessageText:[self localizedStringForKey:@"RemoveAllKeychainExclusionsWarningTitle"]]; + [removeAllKeychainExclusionsAlert setInformativeText:[self localizedStringForKey:@"RemoveAllKeychainExclusionsWarning"]]; + [removeAllKeychainExclusionsAlert addButtonWithTitle:[self localizedStringForKey:@"RemoveAllKeychainExclusionsButton"]]; + NSButton* dontRemoveButton = [removeAllKeychainExclusionsAlert addButtonWithTitle:[self localizedStringForKey:@"DontRemoveButtonText"]]; + [dontRemoveButton setKeyEquivalent:@"\e"]; // escape + + [removeAllKeychainExclusionsAlert setAlertStyle:NSCriticalAlertStyle]; + + if ([removeAllKeychainExclusionsAlert runModal] == NSAlertFirstButtonReturn) { [[KeychainDenyList instance] removeAllHosts]; [mKeychainExclusions removeAllObjects]; [mKeychainExclusionsTable reloadData]; diff --git a/mozilla/camino/resources/localized/English.lproj/Localizable.strings.in b/mozilla/camino/resources/localized/English.lproj/Localizable.strings.in index 1ecd2d9e88d..08fe63b7ac5 100644 --- a/mozilla/camino/resources/localized/English.lproj/Localizable.strings.in +++ b/mozilla/camino/resources/localized/English.lproj/Localizable.strings.in @@ -4,6 +4,8 @@ "OKButtonText" = "OK"; "CancelButtonText" = "Cancel"; "QuitButtonText" = "Quit"; +"DontQuitButtonText" = "Don’t Quit"; +"DontCloseButtonText" = "Don’t Close"; "ChooseDirectoryOKButton" = "Select"; "DontShowWarningAgainCheckboxLabel" = "Don’t show this warning again"; @@ -42,6 +44,7 @@ /* close multiple windows */ "CloseMultipleWindowsMsg" = "Are you sure you want to close all windows?"; "CloseMultipleWindowsExpl" = "You have %u windows open. If you close these windows, you will lose any information that you entered in them."; +"CloseWindowsButtonText" = "Close Windows"; /* quit multiple windows/tabs */ "QuitWithMultipleWindowsMsg" = "Are you sure you want to quit when there are multiple open windows?"; @@ -69,7 +72,6 @@ /* quit with downloads alert */ "QuitWithDownloadsMsg" = "Are you sure you want to quit?"; "QuitWithDownloadsExpl" = "There are downloads in progress that will be stopped if you quit now."; -"QuitWithDownloadsButtonDefault" = "Don’t Quit"; /* Parser error loading bookmarks.xml file */ "CorruptedBookmarksAlert" = "Error Reading Bookmarks"; @@ -385,6 +387,7 @@ "Reset Camino Title" = "Are you sure you want to reset Camino?"; "Reset Warning Message" = "Resetting Camino will erase your browsing history, empty the cache, clear downloads, clear all cookies and site cookie permissions, and remove any passwords Camino saved in your Keychain.\n\nYou cannot undo this action.\n"; "Reset Camino" = "Reset Camino"; +"DontResetButtonText" = "Don’t Reset"; /* History labels */ "Tomorrow" = "Tomorrow"; @@ -401,13 +404,15 @@ /* Empty cache messages (note that these are duplicated in the History prefs panel) */ "EmptyCacheTitle" = "Are you sure you want to empty the cache?"; "EmptyCacheMessage" = "Camino saves the contents of web pages you visit in a cache so that they load more quickly on future visits.\n\nYou cannot undo this action.\n"; -"EmptyButton" = "Empty"; +"EmptyCacheButtonText" = "Empty Cache"; +"DontEmptyButtonText" = "Don’t Empty"; /* Clear history message (note that these are duplicated in the History prefs panel) */ "ClearHistoryMenuItem" = "Clear History…"; "ClearHistoryTitle" = "Are you sure you want to clear the history?"; "ClearHistoryMessage" = "Clearing your history will erase the list of sites that you have visited. You won’t be able to autocomplete the URLs of these sites when typing in the location bar.\n\nYou cannot undo this action.\n"; -"ClearHistoryButton" = "Clear History"; +"ClearHistoryButtonText" = "Clear History"; +"DontClearButtonText" = "Don’t Clear"; "ShowMoreHistoryMenuItem" = "Show More"; @@ -455,6 +460,7 @@ "RestoreDefaultEnginesTitle" = "Restore the default search engines?"; "RestoreDefaultEnginesMessage" = "Restoring the default search engines will replace all of the engines that are currently installed.\n\nYou cannot undo this action.\n"; "RestoreDefaultEnginesActionButton" = "Restore Default Engines"; +"DontRestoreDefaultEnginesActionButton" = "Don’t Restore"; /* Web Search Plug-ins */ "InstallSearchPluginMenuItem" = "Add “%@”"; diff --git a/mozilla/camino/src/application/MainController.mm b/mozilla/camino/src/application/MainController.mm index 15d67275a52..2c600061e58 100644 --- a/mozilla/camino/src/application/MainController.mm +++ b/mozilla/camino/src/application/MainController.mm @@ -412,7 +412,7 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina title:quitAlertMsg text:quitAlertExpl button1:NSLocalizedString(@"QuitButtonText", @"") - button2:NSLocalizedString(@"CancelButtonText", @"") + button2:NSLocalizedString(@"DontQuitButtonText", @"") button3:nil checkMsg:NSLocalizedString(@"DontShowWarningAgainCheckboxLabel", @"") checkValue:&dontShowAgain]; @@ -1020,13 +1020,18 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina // - (IBAction)resetBrowser:(id)sender { - if (NSRunCriticalAlertPanel(NSLocalizedString(@"Reset Camino Title", nil), - NSLocalizedString(@"Reset Warning Message", nil), - NSLocalizedString(@"Reset Camino", nil), - NSLocalizedString(@"CancelButtonText", nil), - nil) == NSAlertDefaultReturn) - { + NSAlert* resetBrowserAlert = [[[NSAlert alloc] init] autorelease]; + [resetBrowserAlert setMessageText:NSLocalizedString(@"Reset Camino Title", nil)]; + [resetBrowserAlert setInformativeText:NSLocalizedString(@"Reset Warning Message", nil)]; + [resetBrowserAlert addButtonWithTitle:NSLocalizedString(@"Reset Camino", nil)]; + NSButton* dontResetButton = [resetBrowserAlert addButtonWithTitle:NSLocalizedString(@"DontResetButtonText", nil)]; + [dontResetButton setKeyEquivalent:@"\e"]; // escape + [resetBrowserAlert setAlertStyle:NSCriticalAlertStyle]; + + [NSMenu cancelAllTracking]; + + if ([resetBrowserAlert runModal] == NSAlertFirstButtonReturn) { // close all windows NSArray* openWindows = [[NSApp orderedWindows] copy]; NSEnumerator* windowEnum = [openWindows objectEnumerator]; @@ -1086,11 +1091,18 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina // - (IBAction)emptyCache:(id)sender { - if (NSRunCriticalAlertPanel(NSLocalizedString(@"EmptyCacheTitle", nil), - NSLocalizedString(@"EmptyCacheMessage", nil), - NSLocalizedString(@"EmptyButton", nil), - NSLocalizedString(@"CancelButtonText", nil), nil) == NSAlertDefaultReturn) - { + NSAlert* emptyCacheAlert = [[[NSAlert alloc] init] autorelease]; + [emptyCacheAlert setMessageText:NSLocalizedString(@"EmptyCacheTitle", nil)]; + [emptyCacheAlert setInformativeText:NSLocalizedString(@"EmptyCacheMessage", nil)]; + [emptyCacheAlert addButtonWithTitle:NSLocalizedString(@"EmptyCacheButtonText", nil)]; + NSButton* dontEmptyButton = [emptyCacheAlert addButtonWithTitle:NSLocalizedString(@"DontEmptyButtonText", nil)]; + [dontEmptyButton setKeyEquivalent:@"\e"]; // escape + + [emptyCacheAlert setAlertStyle:NSCriticalAlertStyle]; + + [NSMenu cancelAllTracking]; + + if ([emptyCacheAlert runModal] == NSAlertFirstButtonReturn) { // remove cache nsCOMPtr cacheServ (do_GetService("@mozilla.org/network/cache-service;1")); if (cacheServ) @@ -1274,8 +1286,8 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina doCloseWindows = [controller confirmCheckEx:nil title:closeAlertMsg text:closeAlertExpl - button1:NSLocalizedString(@"OKButtonText", @"") - button2:NSLocalizedString(@"CancelButtonText", @"") + button1:NSLocalizedString(@"CloseWindowsButtonText", @"") + button2:NSLocalizedString(@"DontCloseButtonText", @"") button3:nil checkMsg:NSLocalizedString(@"DontShowWarningAgainCheckboxLabel", @"") checkValue:&dontShowAgain]; @@ -1516,12 +1528,18 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina // - (IBAction)clearHistory:(id)aSender { - if (NSRunCriticalAlertPanel(NSLocalizedString(@"ClearHistoryTitle", nil), - NSLocalizedString(@"ClearHistoryMessage", nil), - NSLocalizedString(@"ClearHistoryButton", nil), - NSLocalizedString(@"CancelButtonText", nil), - nil) == NSAlertDefaultReturn) - { + NSAlert* clearHistoryAlert = [[[NSAlert alloc] init] autorelease]; + [clearHistoryAlert setMessageText:NSLocalizedString(@"ClearHistoryTitle", nil)]; + [clearHistoryAlert setInformativeText:NSLocalizedString(@"ClearHistoryMessage", nil)]; + [clearHistoryAlert addButtonWithTitle:NSLocalizedString(@"ClearHistoryButtonText", nil)]; + NSButton* dontClearButton = [clearHistoryAlert addButtonWithTitle:NSLocalizedString(@"DontClearButtonText", nil)]; + [dontClearButton setKeyEquivalent:@"\e"]; // escape + + [clearHistoryAlert setAlertStyle:NSCriticalAlertStyle]; + + [NSMenu cancelAllTracking]; + + if ([clearHistoryAlert runModal] == NSAlertFirstButtonReturn) { // clear history nsCOMPtr hist = do_GetService("@mozilla.org/browser/global-history;2"); if (hist) diff --git a/mozilla/camino/src/browser/BrowserWindowController.mm b/mozilla/camino/src/browser/BrowserWindowController.mm index a9178db5306..39f3261c5ec 100644 --- a/mozilla/camino/src/browser/BrowserWindowController.mm +++ b/mozilla/camino/src/browser/BrowserWindowController.mm @@ -752,7 +752,7 @@ public: title:NSLocalizedString(@"CloseWindowWithMultipleTabsMsg", @"") text:[NSString stringWithFormat:closeMultipleTabWarning, numberOfTabs] button1:NSLocalizedString(@"CloseWindowWithMultipleTabsButton", @"") - button2:NSLocalizedString(@"CancelButtonText", @"") + button2:NSLocalizedString(@"DontCloseButtonText", @"") button3:nil checkMsg:NSLocalizedString(@"DontShowWarningAgainCheckboxLabel", @"") checkValue:&dontShowAgain]; diff --git a/mozilla/camino/src/download/ProgressDlgController.mm b/mozilla/camino/src/download/ProgressDlgController.mm index 9a2fc3efc4e..c74026f6c0a 100644 --- a/mozilla/camino/src/download/ProgressDlgController.mm +++ b/mozilla/camino/src/download/ProgressDlgController.mm @@ -702,8 +702,7 @@ static id gSharedProgressController = nil; NSString *title = NSLocalizedString(@"QuitWithDownloadsMsg", nil); NSString *text = NSLocalizedString(@"QuitWithDownloadsExpl", nil); - NSString *dontQuit = NSLocalizedString(@"QuitWithDownloadsButtonDefault", - nil); + NSString *dontQuit = NSLocalizedString(@"DontQuitButtonText", nil); NSString *quit = NSLocalizedString(@"QuitButtonText", nil); nsAlertController* alertController = [nsAlertController sharedController]; diff --git a/mozilla/camino/src/websearch/SearchEngineEditor.mm b/mozilla/camino/src/websearch/SearchEngineEditor.mm index 90c0327c96c..13f29cddae9 100644 --- a/mozilla/camino/src/websearch/SearchEngineEditor.mm +++ b/mozilla/camino/src/websearch/SearchEngineEditor.mm @@ -147,16 +147,17 @@ static NSString *const kSearchEngineEditorDraggedEngineType = @"SearchEngineEdit - (IBAction)restoreDefaultSearchEngines:(id)sender { // Since this will remove all existing engines, ask the user for confirmation - NSAlert *alert = [[[NSAlert alloc] init] autorelease]; - [alert addButtonWithTitle:NSLocalizedString(@"RestoreDefaultEnginesActionButton", nil)]; - [alert addButtonWithTitle:NSLocalizedString(@"CancelButtonText", nil)]; - [alert setMessageText:NSLocalizedString(@"RestoreDefaultEnginesTitle", nil)]; - [alert setInformativeText:NSLocalizedString(@"RestoreDefaultEnginesMessage", nil)]; - [alert setAlertStyle:NSWarningAlertStyle]; - [alert beginSheetModalForWindow:[self window] - modalDelegate:self - didEndSelector:@selector(restoreDefaultEnginesAlertDidEnd:returnCode:contextInfo:) - contextInfo:NULL]; + NSAlert *restoreDefaultSearchEnginesAlert = [[[NSAlert alloc] init] autorelease]; + [restoreDefaultSearchEnginesAlert addButtonWithTitle:NSLocalizedString(@"RestoreDefaultEnginesActionButton", nil)]; + NSButton* dontRestoreButton = [restoreDefaultSearchEnginesAlert addButtonWithTitle:NSLocalizedString(@"DontRestoreDefaultEnginesActionButton", nil)]; + [dontRestoreButton setKeyEquivalent:@"\e"]; // escape + [restoreDefaultSearchEnginesAlert setMessageText:NSLocalizedString(@"RestoreDefaultEnginesTitle", nil)]; + [restoreDefaultSearchEnginesAlert setInformativeText:NSLocalizedString(@"RestoreDefaultEnginesMessage", nil)]; + [restoreDefaultSearchEnginesAlert setAlertStyle:NSWarningAlertStyle]; + [restoreDefaultSearchEnginesAlert beginSheetModalForWindow:[self window] + modalDelegate:self + didEndSelector:@selector(restoreDefaultEnginesAlertDidEnd:returnCode:contextInfo:) + contextInfo:NULL]; } - (void)restoreDefaultEnginesAlertDidEnd:(NSAlert *)alert returnCode:(int)returnCode contextInfo:(void *)contextInfo