Bug 720154 - Move restore_on_demand checkbox to Tabs page, never disable it. r=zpao, ui-r=jboriss

This commit is contained in:
Andrew Hurle 2012-05-26 09:33:52 -04:00
Родитель d25627bfb5
Коммит 7d0a88f99a
8 изменённых файлов: 18 добавлений и 48 удалений

Просмотреть файл

@ -17,7 +17,6 @@ var gMainPane = {
window.addEventListener("focus", this._updateUseCurrentButton.bind(this), false); window.addEventListener("focus", this._updateUseCurrentButton.bind(this), false);
this.updateBrowserStartupLastSession(); this.updateBrowserStartupLastSession();
this.startupPagePrefChanged();
// Notify observers that the UI is now ready // Notify observers that the UI is now ready
Components.classes["@mozilla.org/observer-service;1"] Components.classes["@mozilla.org/observer-service;1"]
@ -46,16 +45,6 @@ var gMainPane = {
* option is preserved. * option is preserved.
*/ */
/**
* Enables/Disables the restore on demand checkbox.
*/
startupPagePrefChanged: function ()
{
let startupPref = document.getElementById("browser.startup.page");
let restoreOnDemandPref = document.getElementById("browser.sessionstore.restore_on_demand");
restoreOnDemandPref.disabled = startupPref.value != 3;
},
syncFromHomePref: function () syncFromHomePref: function ()
{ {
let homePref = document.getElementById("browser.startup.homepage"); let homePref = document.getElementById("browser.startup.homepage");

Просмотреть файл

@ -10,11 +10,7 @@
<!-- Startup --> <!-- Startup -->
<preference id="browser.startup.page" <preference id="browser.startup.page"
name="browser.startup.page" name="browser.startup.page"
type="int" type="int"/>
onchange="gMainPane.startupPagePrefChanged();"/>
<preference id="browser.sessionstore.restore_on_demand"
name="browser.sessionstore.restore_on_demand"
type="bool"/>
<preference id="browser.startup.homepage" <preference id="browser.startup.homepage"
name="browser.startup.homepage" name="browser.startup.homepage"
type="wstring"/> type="wstring"/>
@ -83,13 +79,6 @@
</menupopup> </menupopup>
</menulist> </menulist>
</hbox> </hbox>
<hbox align="center">
<checkbox id="restoreOnDemand"
label="&restoreOnDemand.label;"
accesskey="&restoreOnDemand.accesskey;"
class="indent"
preference="browser.sessionstore.restore_on_demand"/>
</hbox>
<separator class="thin"/> <separator class="thin"/>
<hbox align="center"> <hbox align="center">
<label value="&homepage.label;" <label value="&homepage.label;"

Просмотреть файл

@ -23,6 +23,9 @@
<preference id="browser.tabs.warnOnOpen" <preference id="browser.tabs.warnOnOpen"
name="browser.tabs.warnOnOpen" name="browser.tabs.warnOnOpen"
type="bool"/> type="bool"/>
<preference id="browser.sessionstore.restore_on_demand"
name="browser.sessionstore.restore_on_demand"
type="bool"/>
#ifdef XP_WIN #ifdef XP_WIN
<preference id="browser.taskbar.previews.enable" <preference id="browser.taskbar.previews.enable"
name="browser.taskbar.previews.enable" name="browser.taskbar.previews.enable"
@ -61,6 +64,12 @@
preference="browser.tabs.autoHide" preference="browser.tabs.autoHide"
class="indent"/> class="indent"/>
<checkbox id="restoreOnDemand" label="&restoreTabsOnDemand.label;"
data-category="paneTabs" hidden="true"
accesskey="&restoreTabsOnDemand.accesskey;"
preference="browser.sessionstore.restore_on_demand"
class="indent"/>
<checkbox id="switchToNewTabs" label="&switchToNewTabs.label;" <checkbox id="switchToNewTabs" label="&switchToNewTabs.label;"
data-category="paneTabs" hidden="true" data-category="paneTabs" hidden="true"
accesskey="&switchToNewTabs.accesskey;" accesskey="&switchToNewTabs.accesskey;"

Просмотреть файл

@ -22,7 +22,6 @@ var gMainPane = {
window.addEventListener("focus", this._updateUseCurrentButton.bind(this), false); window.addEventListener("focus", this._updateUseCurrentButton.bind(this), false);
this.updateBrowserStartupLastSession(); this.updateBrowserStartupLastSession();
this.startupPagePrefChanged();
this.setupDownloadsWindowOptions(); this.setupDownloadsWindowOptions();
@ -64,16 +63,6 @@ var gMainPane = {
* option is preserved. * option is preserved.
*/ */
/**
* Enables/Disables the restore on demand checkbox.
*/
startupPagePrefChanged: function ()
{
let startupPref = document.getElementById("browser.startup.page");
let restoreOnDemandPref = document.getElementById("browser.sessionstore.restore_on_demand");
restoreOnDemandPref.disabled = startupPref.value != 3;
},
syncFromHomePref: function () syncFromHomePref: function ()
{ {
let homePref = document.getElementById("browser.startup.homepage"); let homePref = document.getElementById("browser.startup.homepage");

Просмотреть файл

@ -29,11 +29,7 @@
<!-- Startup --> <!-- Startup -->
<preference id="browser.startup.page" <preference id="browser.startup.page"
name="browser.startup.page" name="browser.startup.page"
type="int" type="int"/>
onchange="gMainPane.startupPagePrefChanged();"/>
<preference id="browser.sessionstore.restore_on_demand"
name="browser.sessionstore.restore_on_demand"
type="bool"/>
<preference id="browser.startup.homepage" <preference id="browser.startup.homepage"
name="browser.startup.homepage" name="browser.startup.homepage"
type="wstring"/> type="wstring"/>
@ -89,13 +85,6 @@
</menupopup> </menupopup>
</menulist> </menulist>
</hbox> </hbox>
<hbox align="center">
<checkbox id="restoreOnDemand"
label="&restoreOnDemand.label;"
accesskey="&restoreOnDemand.accesskey;"
class="indent"
preference="browser.sessionstore.restore_on_demand"/>
</hbox>
<separator class="thin"/> <separator class="thin"/>
<hbox align="center"> <hbox align="center">
<label value="&homepage.label;" accesskey="&homepage.accesskey;" control="browserHomePage"/> <label value="&homepage.label;" accesskey="&homepage.accesskey;" control="browserHomePage"/>

Просмотреть файл

@ -27,6 +27,7 @@
<preference id="browser.tabs.loadInBackground" name="browser.tabs.loadInBackground" type="bool" inverted="true"/> <preference id="browser.tabs.loadInBackground" name="browser.tabs.loadInBackground" type="bool" inverted="true"/>
<preference id="browser.tabs.warnOnClose" name="browser.tabs.warnOnClose" type="bool"/> <preference id="browser.tabs.warnOnClose" name="browser.tabs.warnOnClose" type="bool"/>
<preference id="browser.tabs.warnOnOpen" name="browser.tabs.warnOnOpen" type="bool"/> <preference id="browser.tabs.warnOnOpen" name="browser.tabs.warnOnOpen" type="bool"/>
<preference id="browser.sessionstore.restore_on_demand" name="browser.sessionstore.restore_on_demand" type="bool"/>
#ifdef XP_WIN #ifdef XP_WIN
<preference id="browser.taskbar.previews.enable" name="browser.taskbar.previews.enable" type="bool"/> <preference id="browser.taskbar.previews.enable" name="browser.taskbar.previews.enable" type="bool"/>
#endif #endif
@ -51,6 +52,9 @@
<checkbox id="showTabBar" label="&showTabBar.label;" <checkbox id="showTabBar" label="&showTabBar.label;"
accesskey="&showTabBar.accesskey;" accesskey="&showTabBar.accesskey;"
preference="browser.tabs.autoHide"/> preference="browser.tabs.autoHide"/>
<checkbox id="restoreOnDemand" label="&restoreTabsOnDemand.label;"
accesskey="&restoreTabsOnDemand.accesskey;"
preference="browser.sessionstore.restore_on_demand"/>
<checkbox id="switchToNewTabs" label="&switchToNewTabs.label;" <checkbox id="switchToNewTabs" label="&switchToNewTabs.label;"
accesskey="&switchToNewTabs.accesskey;" accesskey="&switchToNewTabs.accesskey;"
preference="browser.tabs.loadInBackground"/> preference="browser.tabs.loadInBackground"/>

Просмотреть файл

@ -9,8 +9,6 @@
<!ENTITY startupHomePage.label "Show my home page"> <!ENTITY startupHomePage.label "Show my home page">
<!ENTITY startupBlankPage.label "Show a blank page"> <!ENTITY startupBlankPage.label "Show a blank page">
<!ENTITY startupLastSession.label "Show my windows and tabs from last time"> <!ENTITY startupLastSession.label "Show my windows and tabs from last time">
<!ENTITY restoreOnDemand.label "Dont load tabs until selected">
<!ENTITY restoreOnDemand.accesskey "l">
<!ENTITY homepage.label "Home Page:"> <!ENTITY homepage.label "Home Page:">
<!ENTITY homepage.accesskey "P"> <!ENTITY homepage.accesskey "P">

Просмотреть файл

@ -14,6 +14,9 @@
<!ENTITY showTabBar.label "Always show the tab bar"> <!ENTITY showTabBar.label "Always show the tab bar">
<!ENTITY showTabBar.accesskey "b"> <!ENTITY showTabBar.accesskey "b">
<!ENTITY restoreTabsOnDemand.label "Dont load tabs until selected">
<!ENTITY restoreTabsOnDemand.accesskey "l">
<!ENTITY switchToNewTabs.label "When I open a link in a new tab, switch to it immediately"> <!ENTITY switchToNewTabs.label "When I open a link in a new tab, switch to it immediately">
<!ENTITY switchToNewTabs.accesskey "s"> <!ENTITY switchToNewTabs.accesskey "s">