Remove remaining overlay from prefs dialog.

This commit is contained in:
blakeross%telocity.com 2002-10-11 01:56:25 +00:00
parent 31c4d48ac1
commit 612fa33f10
7 changed files with 181 additions and 9 deletions

View File

@ -19,8 +19,7 @@
#
# Contributor(s):
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xul-overlay href="chrome://browser/content/pref/platformPrefOverlay.xul"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://browser/locale/pref/pref-navigator.dtd" >
@ -36,6 +35,121 @@
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["browserStartupHomepage"];
#ifdef XP_WIN
// "Install" the SetFields function. This will be
// called whenever the Navigator pane is shown.
window.SetFields = function( pageData ) {
// Determine if we have been selected as the default browser
// already, and enable/disable the "Set As Default" button
// accordingly.
// We store our state info in the same place as the code in
// pref-winhooks.js uses so that this panel and the
// Advanced/System panel are kept in synch.
if (!("winHooks" in parent)) {
// Neither the Advanced/System panel nor this panel has
// appeared. Initialize the state information.
parent.winHooks = new Object;
// Get winhooks service.
parent.winHooks.winhooks = Components.classes[ "@mozilla.org/winhooks;1" ]
.getService( Components.interfaces.nsIWindowsHooks );
// Extract current settings (these are what the user has checked on
// the Advanced/System panel).
parent.winHooks.prefs = parent.winHooks.winhooks.settings;
}
// Ensure our additional state info is set.
if (!("makeDefaultPending" in parent.winHooks)) {
parent.winHooks.makeDefaultPending = false;
}
// Figure out which <deck> child should be activated.
// Default is child 0 (with button enabled).
var deckState = 0;
// Start by checking http/https/ftp and html/xhtml/xml.
var prefs = parent.winHooks.prefs;
if (prefs.isHandlingHTTP &&
prefs.isHandlingHTTPS &&
prefs.isHandlingFTP &&
prefs.isHandlingHTML &&
prefs.isHandlingXHTML &&
prefs.isHandlingXML) {
// The user *wants* us to be the default, apparently. This means
// that the deck *might* be in one of the other two states (with
// button disabled), depending on whether the registry matches.
// We test the registry settings using a scratch copy of the
// settings because we don't care about some of them, but we
// don't want to mess up the user's choices from the
// Advanced/System panel.
var testSettings = parent.winHooks.winhooks.settings;
// Test that these are set.
testSettings.isHandlingHTTP = true;
testSettings.isHandlingHTTPS = true;
testSettings.isHandlingFTP = true;
testSettings.isHandlingHTML = true;
testSettings.isHandlingXHTML = true;
testSettings.isHandlingXML = true;
// Ignore the rest.
testSettings.isHandlingCHROME = false;
testSettings.isHandlingGOPHER = false;
testSettings.isHandlingJPEG = false;
testSettings.isHandlingGIF = false;
testSettings.isHandlingMNG = false;
testSettings.isHandlingPNG = false;
testSettings.isHandlingBMP = false;
testSettings.isHandlingICO = false;
testSettings.isHandlingXUL = false;
// Now test whether the registry matches that.
if ( testSettings.registryMatches ) {
// Disable the button. The only remaining question
// is what text appears alongside it. That will
// vary depending on whether the user has pressed
// the "Set As Default" button already.
if ( parent.winHooks.makeDefaultPending ) {
deckState = 2;
} else {
deckState = 1;
}
}
}
// Now, switch the deck to the appropriate state.
document.getElementById("defaultBrowserDeck").selectedIndex = deckState;
// Return true to tell caller to process the standard pref fields.
return true;
}
// "Install" the makeDefault function;
window.makeDefault = function() {
// Extract current settings (these are what the
// user has checked on the Advanced/System panel).
var settings = parent.winHooks.prefs;
// Turn on all "default browser" settings.
settings.isHandlingHTTP = true;
settings.isHandlingHTTPS = true;
settings.isHandlingFTP = true;
settings.isHandlingHTML = true;
settings.isHandlingXHTML = true;
settings.isHandlingXML = true;
// Register callback that will be called when and if the
// user presses the OK button.
parent.hPrefWindow.registerOKCallbackFunc( function () {
// Apply the settings.
parent.winHooks.winhooks.settings = parent.winHooks.prefs;
} );
// Flip the deck to the "make-default pending" state.
document.getElementById("defaultBrowserDeck").selectedIndex = 2;
// Remember this state when next displayed.
parent.winHooks.makeDefaultPending = true;
}
}
#endif
]]>
</script>
@ -65,6 +179,47 @@
prefstring="pref.browser.homepage.disable_button.blank_page"/>
</hbox>
</groupbox>
<groupbox id="pref-nav-platform-extensions"/>
#ifdef XP_WIN
<groupbox flex="1">
<caption label="&defaultBrowserGroup.label;"/>
<deck id="defaultBrowserDeck" flex="1">
<!-- We use a deck for the three cases:
o If not already the default, then use child 0 (with button enabled)
o If already the default, then use child 1 (with disabled button).
o If the user has already pushed the "Set As Default" button, then use child 2
(with different text and a disabled button).
-->
<vbox flex="1">
<description>&makeDefaultText;</description>
<hbox>
<spacer flex="1"/>
<button label="&defaultBrowserButton.label;"
oncommand="makeDefault()"/>
<spacer flex="1"/>
</hbox>
</vbox>
<vbox flex="1">
<description>&alreadyDefaultText;</description>
<hbox>
<spacer flex="1"/>
<button label="&defaultBrowserButton.label;"
autostretch="never"
disabled="true"/>
<spacer flex="1"/>
</hbox>
</vbox>
<vbox flex="1">
<description pack="start">&defaultPendingText;</description>
<hbox>
<spacer flex="1"/>
<button label="&defaultBrowserButton.label;"
autostretch="never"
disabled="true"/>
<spacer flex="1"/>
</hbox>
</vbox>
</deck>
</groupbox>
#endif
</page>

View File

@ -22,8 +22,6 @@
# Ben Goodger <ben@netscape.com>
# Dave Hyatt (hyatt@apple.com)
<?xul-overlay href="chrome://browser/content/pref/platformPrefOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://browser/locale/pref/preftree.dtd" >
<overlay id="prefTreeOverlay"
@ -96,6 +94,13 @@
<treecell url="chrome://browser/content/pref/pref-tabs.xul" label="&tabs.label;"/>
</treerow>
</treeitem>
#ifdef XP_WIN
<treeitem id="winhooks">
<treerow>
<treecell url="chrome://communicator/content/pref/pref-winhooks.xul" label="&winhooks.label;"/>
</treerow>
</treeitem>
#endif
</treechildren>
</treeitem>
</treechildren>

View File

@ -35,12 +35,12 @@ en-US.jar:
locale/en-US/browser/pref/pref-languages.dtd (locale/pref-languages.dtd)
locale/en-US/browser/pref/pref-tabs.dtd (locale/pref-tabs.dtd)
locale/en-US/browser/pref/pref-languages.properties (locale/pref-languages.properties)
locale/en-US/browser/pref/pref-navigator.dtd (locale/pref-navigator.dtd)
* locale/en-US/browser/pref/pref-navigator.dtd (locale/pref-navigator.dtd)
locale/en-US/browser/pref/pref-connection.dtd (locale/pref-connection.dtd)
locale/en-US/browser/pref/pref-scripts.dtd (locale/pref-scripts.dtd)
locale/en-US/browser/pref/pref-privacy.dtd (locale/pref-privacy.dtd)
locale/en-US/browser/pref/pref-popups.dtd (locale/pref-popups.dtd)
locale/en-US/browser/pref/prefutilities.properties (locale/prefutilities.properties)
locale/en-US/browser/pref/preftree.dtd (locale/preftree.dtd)
* locale/en-US/browser/pref/preftree.dtd (locale/preftree.dtd)
locale/en-US/browser/pref/pref.dtd (locale/pref.dtd)
locale/en-US/browser/pref/pref-winhooks.dtd (locale/pref-winhooks.dtd)

View File

@ -9,3 +9,10 @@
<!ENTITY useBookmark.accesskey "U">
<!ENTITY useBlank.label "Use Blank Page">
<!ENTITY useBlank.accesskey "B">
#ifdef XP_WIN
<!ENTITY defaultBrowserGroup.label "Default Browser">
<!ENTITY defaultBrowserButton.label "Set Default Browser">
<!ENTITY alreadyDefaultText "&brandShortName; is already your default browser.">
<!ENTITY defaultPendingText "&brandShortName; will be set as your default browser when you click OK.">
<!ENTITY makeDefaultText "Set &brandShortName; as your default browser.">
#endif

View File

@ -4,3 +4,4 @@
<!ENTITY background.label "Load links in the background">
<!ENTITY openTabs.label "Open tabs instead of windows for">
<!ENTITY middleClick.label "Middle-click or control-click of links in a Web page">
<!ENTITY urlbar.label "Control+Enter in the Location bar">

View File

@ -10,4 +10,4 @@
width of the letter 'm' in the selected font.
XUL/FE DEVELOPERS: DO NOT MODIFY THIS VALUE. It represents the correct
size of this window for en-US. -->
<!ENTITY prefWindow.size "width: 52em; height: 41em;">
<!ENTITY prefWindow.size "width: 52em; height: 41em;">

View File

@ -11,4 +11,8 @@
<!ENTITY connection.label "Connection">
<!ENTITY popups.label "Popup Windows">
<!ENTITY scriptsAndWindows.label "JavaScript">
<!ENTITY tabs.label "Tabbed Browsing">
<!ENTITY tabs.label "Tabbed Browsing">
<!ENTITY urlbar.label "Control+Enter in the Location bar">
#ifdef XP_WIN
<!ENTITY winhooks.label "System">
#endif