Bug 339720 show warning page before showing about:config (toolkit version)

r=mano
This commit is contained in:
cst%yecc.com 2006-12-05 00:15:22 +00:00
parent b13c0d0304
commit 0f99a556d9
5 changed files with 174 additions and 35 deletions

View File

@ -322,6 +322,17 @@ function onConfigLoad()
gTypeStrs[nsIPrefBranch.PREF_INT] = gConfigBundle.getString("int");
gTypeStrs[nsIPrefBranch.PREF_BOOL] = gConfigBundle.getString("bool");
var showWarning = gPrefBranch.getBoolPref("general.warnOnAboutConfig");
if (showWarning)
document.getElementById("warningButton").focus();
else
ShowPrefs();
}
// Unhide the warning message
function ShowPrefs()
{
var prefCount = { value: 0 };
var prefArray = gPrefBranch.getChildList("", prefCount);
@ -353,14 +364,20 @@ function onConfigLoad()
gPrefBranch.addObserver("", gPrefListener, false);
document.getElementById("configTree").view = view;
document.getElementById("configDeck").setAttribute("selectedIndex", 1);
if (!document.getElementById("showWarningNextTime").checked)
gPrefBranch.setBoolPref("general.warnOnAboutConfig", false);
document.getElementById("textbox").focus();
}
function onConfigUnload()
{
gPrefBranch.removeObserver("", gPrefListener);
document.getElementById("configTree").view = null;
if (document.getElementById("configDeck").getAttribute("selectedIndex") == 1) {
gPrefBranch.removeObserver("", gPrefListener);
document.getElementById("configTree").view = null;
}
}
function FilterPrefs()

View File

@ -76,34 +76,52 @@
<key keycode="VK_ENTER" oncommand="ModifySelected();"/>
<key keycode="VK_RETURN" oncommand="ModifySelected();"/>
</keyset>
<hbox id="filterRow" align="center">
<label value="&filterPrefs.label;" accesskey="&filterPrefs.accesskey;" control="textbox"/>
<textbox id="textbox" flex="1" type="timed" timeout="500" oncommand="FilterPrefs();"/>
<button id="button" label="&showAll.label;" accesskey="&showAll.accesskey;" oncommand="ClearFilter();" disabled="true"/>
</hbox>
<tree id="configTree" flex="1" seltype="single" enableColumnDrag="true"
context="configContext">
<treecols>
<treecol id="prefCol" label="&prefColumn.label;" flex="7"
class="sortDirectionIndicator"
ignoreincolumnpicker="true"
persist="hidden width ordinal sortDirection"/>
<splitter class="tree-splitter" />
<treecol id="lockCol" label="&lockColumn.label;" flex="1"
class="sortDirectionIndicator"
persist="hidden width ordinal sortDirection"/>
<splitter class="tree-splitter" />
<treecol id="typeCol" label="&typeColumn.label;" flex="1"
class="sortDirectionIndicator"
persist="hidden width ordinal sortDirection"/>
<splitter class="tree-splitter" />
<treecol id="valueCol" label="&valueColumn.label;" flex="10"
class="sortDirectionIndicator"
persist="hidden width ordinal sortDirection"/>
</treecols>
<treechildren id="configTreeBody" ondblclick="if (event.button == 0) ModifySelected();"/>
</tree>
<deck id="configDeck" flex="1">
<vbox id="warningScreen" flex="1" align="center">
<spacer flex="1"/>
<hbox id="warningBox" align="top">
<image id="exclam" class="alert-icon"/>
<vbox id="warningInnerBox" flex="1">
<label id="warningTitle">&scaryWarningTitle.label;</label>
<label id="warningText">&scaryWarningText.label;</label>
<checkbox id="showWarningNextTime" label="&scaryWarningCheckbox.label;" checked="true"/>
<hbox pack="center">
<button id="warningButton" oncommand="ShowPrefs();" label="&scaryWarningButton.label;"/>
</hbox>
</vbox>
</hbox>
<spacer flex="2"/>
</vbox>
<vbox flex="1">
<hbox id="filterRow" align="center">
<label value="&filterPrefs.label;" accesskey="&filterPrefs.accesskey;" control="textbox"/>
<textbox id="textbox" flex="1" type="timed" timeout="500" oncommand="FilterPrefs();"/>
<button id="button" label="&showAll.label;" accesskey="&showAll.accesskey;" oncommand="ClearFilter();" disabled="true"/>
</hbox>
<tree id="configTree" flex="1" class="plain focusring" seltype="single"
enableColumnDrag="true" context="configContext">
<treecols>
<treecol id="prefCol" label="&prefColumn.label;" flex="7"
class="sortDirectionIndicator"
ignoreincolumnpicker="true"
persist="hidden width ordinal sortDirection"/>
<splitter class="tree-splitter" />
<treecol id="lockCol" label="&lockColumn.label;" flex="1"
class="sortDirectionIndicator"
persist="hidden width ordinal sortDirection"/>
<splitter class="tree-splitter" />
<treecol id="typeCol" label="&typeColumn.label;" flex="1"
class="sortDirectionIndicator"
persist="hidden width ordinal sortDirection"/>
<splitter class="tree-splitter" />
<treecol id="valueCol" label="&valueColumn.label;" flex="10"
class="sortDirectionIndicator"
persist="hidden width ordinal sortDirection"/>
</treecols>
<treechildren id="configTreeBody" ondblclick="if (event.button == 0) ModifySelected();"/>
</tree>
</vbox>
</deck>
</window>

View File

@ -36,6 +36,11 @@
<!ENTITY window.title "about:config">
<!ENTITY scaryWarningTitle.label "Be careful, this gun is loaded!">
<!ENTITY scaryWarningText.label "The about:config page allows you to modify advanced preferences that control this application. It is possible to create harmful side effects by changing the values of these preferences. You should only continue if you know what you are doing or if you are following trusted advice.">
<!ENTITY scaryWarningButton.label "I'll be careful, I promise!">
<!ENTITY scaryWarningCheckbox.label "Show this warning next time">
<!ENTITY filterPrefs.label "Filter:">
<!ENTITY filterPrefs.accesskey "I">
<!ENTITY showAll.label "Show All">

View File

@ -3,6 +3,56 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
#warningScreen
{
background: -moz-Dialog;
}
#warningBox
{
background: white;
border: 1px solid ThreeDShadow;
-moz-border-radius: 10px;
padding: 3em;
-moz-padding-start: 30px;
margin-left: 1em;
margin-right: 1em;
}
#warningInnerBox
{
max-width: 50em;
}
#warningTitle
{
margin: 0 0 .6em 0;
font-size: 160%;
border-bottom: 1px solid ThreeDLightShadow
}
#warningText
{
font-size: 110%;
margin-left: 0;
}
#warningButton
{
margin-top: 0.6em;
}
#showWarningNextTime
{
margin-top: 0.6em;
}
#exclam
{
list-style-image: url("chrome://global/skin/icons/warning-large.png");
-moz-margin-end: 3em;
}
#configTreeBody::-moz-tree-cell-text(user)
{
font-weight: bold;
@ -22,4 +72,4 @@
#filterRow
{
margin-top: 5px;
}
}

View File

@ -3,6 +3,56 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
#warningScreen
{
background: -moz-Dialog;
}
#warningBox
{
background: white;
border: 1px solid ThreeDShadow;
-moz-border-radius: 10px;
padding: 3em;
-moz-padding-start: 30px;
margin-left: 1em;
margin-right: 1em;
}
#warningInnerBox
{
max-width: 50em;
}
#warningTitle
{
margin: 0 0 .6em 0;
font-size: 160%;
border-bottom: 1px solid ThreeDLightShadow
}
#warningText
{
font-size: 110%;
margin-left: 0;
}
#warningButton
{
margin-top: 0.6em;
}
#showWarningNextTime
{
margin-top: 0.6em;
}
#exclam
{
list-style-image: url("chrome://global/skin/icons/warning-large.png");
-moz-margin-end: 3em;
}
#configTreeBody::-moz-tree-cell-text(user)
{
font-weight: bold;
@ -23,4 +73,3 @@
{
margin-top: 5px;
}