Closed
Bug 410030
Opened 18 years ago
Closed 11 years ago
Get Gecko out of the History prefPane!
Categories
(Camino Graveyard :: Preferences, defect)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: alqahira, Assigned: bugzilla-graveyard)
References
Details
Attachments
(1 file, 1 obsolete file)
11.74 KB,
patch
|
Details | Diff | Splinter Review |
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.
Assignee | ||
Comment 2•18 years ago
|
||
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)
Reporter | ||
Comment 3•18 years ago
|
||
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-
Assignee | ||
Updated•17 years ago
|
Status: NEW → ASSIGNED
Hardware: Macintosh → All
Assignee | ||
Comment 4•17 years ago
|
||
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
Assignee | ||
Updated•17 years ago
|
Attachment #295899 -
Attachment is obsolete: true
Assignee | ||
Comment 5•17 years ago
|
||
(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 :)
Assignee | ||
Comment 6•17 years ago
|
||
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.)
Comment 7•17 years ago
|
||
(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.
Assignee | ||
Comment 8•17 years ago
|
||
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)
Comment 9•17 years ago
|
||
Yes (although obviously you'll also need some MainController changes in the actual patch too...)
Comment 10•11 years ago
|
||
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.
Description
•