diff --git a/mozilla/camino/PreferencePanes/History/English.lproj/History.nib/info.nib b/mozilla/camino/PreferencePanes/History/English.lproj/History.nib/info.nib index 01ceb58eeb6..b5cdf0822fb 100644 --- a/mozilla/camino/PreferencePanes/History/English.lproj/History.nib/info.nib +++ b/mozilla/camino/PreferencePanes/History/English.lproj/History.nib/info.nib @@ -3,10 +3,10 @@ IBDocumentLocation - 111 35 522 320 0 0 1920 1178 + 68 33 522 320 0 0 1600 1002 IBFramework Version - 364.0 + 437.0 IBSystem Version - 7W98 + 8F46 diff --git a/mozilla/camino/PreferencePanes/History/English.lproj/History.nib/keyedobjects.nib b/mozilla/camino/PreferencePanes/History/English.lproj/History.nib/keyedobjects.nib index 3bf429c1f9d..081794669c6 100644 Binary files a/mozilla/camino/PreferencePanes/History/English.lproj/History.nib/keyedobjects.nib and b/mozilla/camino/PreferencePanes/History/English.lproj/History.nib/keyedobjects.nib differ diff --git a/mozilla/camino/PreferencePanes/History/English.lproj/Localizable.strings b/mozilla/camino/PreferencePanes/History/English.lproj/Localizable.strings index 03755554a02..c71980579b8 100644 Binary files a/mozilla/camino/PreferencePanes/History/English.lproj/Localizable.strings and b/mozilla/camino/PreferencePanes/History/English.lproj/Localizable.strings differ diff --git a/mozilla/camino/PreferencePanes/History/History.mm b/mozilla/camino/PreferencePanes/History/History.mm index 52547cecf29..6c646572e08 100644 --- a/mozilla/camino/PreferencePanes/History/History.mm +++ b/mozilla/camino/PreferencePanes/History/History.mm @@ -47,6 +47,13 @@ const int kDefaultExpireDays = 9; +@interface OrgMozillaChimeraPreferenceHistory(Private) + +- (void)doClearDiskCache; +- (void)doClearGlobalHistory; + +@end + @implementation OrgMozillaChimeraPreferenceHistory - (id)initWithBundle:(NSBundle *)bundle @@ -96,14 +103,60 @@ const int kDefaultExpireDays = 9; // Clear the user's disk cache -(IBAction) clearDiskCache:(id)aSender +{ + NSBeginCriticalAlertSheet([self getLocalizedString:@"EmptyCacheTitle"], + [self getLocalizedString:@"EmptyButton"], + [self getLocalizedString:@"CancelButtonText"], + nil, + [textFieldHistoryDays window], // any view will do + self, + @selector(clearDiskCacheSheetDidEnd:returnCode:contextInfo:), + nil, + NULL, + [self getLocalizedString:@"EmptyCacheMessage"]); +} + +// use the browser history service to clear out the user's global history +- (IBAction)clearGlobalHistory:(id)sender +{ + NSBeginCriticalAlertSheet([self getLocalizedString:@"ClearHistoryTitle"], + [self getLocalizedString:@"ClearHistoryButton"], + [self getLocalizedString:@"CancelButtonText"], + nil, + [textFieldHistoryDays window], // any view willl do + self, + @selector(clearGlobalHistorySheetDidEnd:returnCode:contextInfo:), + nil, + NULL, + [self getLocalizedString:@"ClearHistoryMessage"]); +} + +#pragma mark - + +- (void)clearDiskCacheSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo +{ + if (returnCode == NSAlertDefaultReturn) + { + [self doClearDiskCache]; + } +} + +- (void)clearGlobalHistorySheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo +{ + if (returnCode == NSAlertDefaultReturn) + { + [self doClearGlobalHistory]; + } +} + +- (void)doClearDiskCache { nsCOMPtr cacheServ ( do_GetService("@mozilla.org/network/cache-service;1") ); if ( cacheServ ) cacheServ->EvictEntries(nsICache::STORE_ANYWHERE); } -// use the browser history service to clear out the user's global history -- (IBAction)clearGlobalHistory:(id)sender +- (void)doClearGlobalHistory { nsCOMPtr hist ( do_GetService("@mozilla.org/browser/global-history;2") ); if ( hist )