Closed Bug 410030 Opened 18 years ago Closed 11 years ago

Get Gecko out of the History prefPane!

Categories

(Camino Graveyard :: Preferences, defect)

All
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: alqahira, Assigned: bugzilla-graveyard)

References

Details

Attachments

(1 file, 1 obsolete file)

Over in bug 403173, we discussed a method of un-duplicating our clear cache and clear history strings and un-duplicating a bunch of code that would result in getting Gecko all the way out of the History prefPane. --- Comment #5 Mark Mentovai 2007-12-27 06:40:07 PST --- "so that it is faster to visit them again." Really? I don't know. "so that they load more quickly on future visits." Something along those lines? We can access main bundle strings from a prefpane with: [[NSBundle mainBundle] localizedStringForKey:key value:value tableName:nil]; or the NSLocalizedStringFromTableInBundle equivalent. Perhaps we should add a main-bundle-string getter utility to PreferencePaneBase, or update localizedStringForKey: to fall back to checking the main bundle's strings if a string isn't present in the prefpane's own strings file. --- Comment #6 Mark Mentovai 2007-12-27 07:46:04 PST --- Another idea is to just keep a single copy of the clear-cache code, in the main executable. Then, we can eliminate some duplicated code in addition to duplicated strings. Right now, the main executable shows an application-modal dialog with NSRunCriticalAlertPanel, and the prefpane shows a window-modal sheet with NSBeginCriticalAlertSheet. We can move to something where we have -[MainController runEmptyCacheDialogOnWindow:], along the lines of: - (void)runEmptyCacheDialogOnWindow:(NSWindow*)window { if (window) { // pass emptyCacheDialogDidEnd:returnCode:contextInfo: as didEndSelector NSBeginCriticalAlertSheet(...); } else { int returnCode = NSRunCriticalAlertPanel(...); [self emptyCacheDialogDidEnd:nil returnCode:returnCode contextInfo:nil]; } } The History prefpane's clearDiskCache: would change to a single call to [[NSApp delegate] runEmptyCacheDialogOnWindow:[self window]];. We'd get to remove its copy of clearDiskCacheSheetDidEnd:, getting us halfway to de-Geckoizing that prefpane. "Clear History" takes care of the other half - just repeat the above steps with that (it's the same exact thing), and History.prefPane will be completely Gecko-free. This is an excellent exercise for anyone with any level of programming skill - it's within everyone's reach, and there's probably something interesting to learn for everyone owing to the inter-modular nature of this change. --- Chris wants this and promises to do it soon.
Attached patch fix v1 (obsolete) — Splinter Review
Asking for r from Smokey since I know he can at least test the patch, and I can't at the moment. (I hope to have this remedied within a week.)
Attachment #295899 - Flags: review?(alqahira)
Comment on attachment 295899 [details] [diff] [review] fix v1 r- per irc since it doesn't build. Stuart, Chris said if you want to steal this, feel free, since "internet only from the car" and "gcc fubared" don't exactly make it easy to develop right now :(
Attachment #295899 - Flags: review?(alqahira) → review-
No longer blocks: 411203
Status: NEW → ASSIGNED
Hardware: Macintosh → All
I should be able to get back to this once some of the other pref stuff lands, maybe next week-ish. Also helps to have working Internet :-p
Attachment #295899 - Attachment is obsolete: true
(In reply to comment #0) > The History prefpane's clearDiskCache: would change to a single call to [[NSApp > delegate] runEmptyCacheDialogOnWindow:[self window]]; That throws two warnings: 1) History.mm:114: warning: 'OrgMozillaCaminoPreferenceHistory' may not respond to '-window' This is thrown once for each method (clearDiskCache: and clearGlobalHistory:). 2) History.mm:114: warning: no '-runEmptyCacheDialogOnWindow:' method found Also thrown once for each method. I'm not sure what sort of casts might possibly fix this problem, but I'm certainly open to ideas :)
OK, I fixed (1) in comment 5 by using |[[self mainView] window]| instead, but I'm still not quite sure how to make the History pref pane know that MainController does indeed implement that method and that it'll work when the pref pane is loaded in the app during execution. (I assume turning off -werror is not an option, though that would probably fix it too.)
(In reply to comment #6) > OK, I fixed (1) in comment 5 by using |[[self mainView] window]| instead That's the way to do it. (In reply to comment #5) > 2) History.mm:114: warning: no '-runEmptyCacheDialogOnWindow:' method found > > Also thrown once for each method. The best way to fix this is probably to make a new protocol with those methods in a new header, include the protocol from the pref pane and cast the delegate to it, and have MainController implement the protocol.
Something like this, then? Not tagging for review because there's a bunch of other History pref pane junk from other bugs in here. I just want to make sure I have the right general idea. (Oh, and the protocol name is obviously a placeholder too :-p)
Yes (although obviously you'll also need some MainController changes in the actual patch too...)
This bug has been buried in the graveyard and has not been updated in over 5 years. It is probably safe to assume that it will never be fixed, so resolving as WONTFIX. [Mass-change filter: graveyard-wontfix-2014-09-24]
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: