-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename restart prefs and move new to new category
- Loading branch information
1 parent
9b808de
commit 3b74b11
Showing
14 changed files
with
197 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. | ||
*/ | ||
|
||
/* import-globals-from preferences.js */ | ||
/* import-globals-from main.js */ | ||
|
||
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); | ||
|
||
Preferences.addAll([ | ||
{ id: "browser.restart_menu.purgecache", type: "bool" }, | ||
{ id: "browser.restart_menu.requireconfirm", type: "bool" }, | ||
{ id: "browser.restart_menu.showpanelmenubtn", type: "bool" }, | ||
{ id: "browser.tabs.duplicateTab", type: "bool" }, | ||
{ id: "browser.tabs.copyurl", type: "bool" }, | ||
{ id: "browser.tabs.copyurl.activetab", type: "bool" }, | ||
{ id: "browser.tabs.copyallurls", type: "bool" }, | ||
]); | ||
|
||
var gAdvancedPane = { | ||
_inited: false, | ||
|
||
/** | ||
* Brings the appropriate tab to the front and initializes various bits of UI. | ||
*/ | ||
init() { | ||
function setEventListener(aId, aEventType, aCallback) { | ||
document.getElementById(aId) | ||
.addEventListener(aEventType, aCallback.bind(gAdvancedPane)); | ||
} | ||
|
||
this._inited = true; | ||
var advancedPrefs = document.getElementById("advancedPrefs"); | ||
|
||
var preference = document.getElementById("browser.preferences.advanced.selectedTabIndex"); | ||
if (preference.value !== null) | ||
advancedPrefs.selectedIndex = preference.value; | ||
|
||
setEventListener("advancedPrefs", "select", | ||
gAdvancedPane.tabSelectionChanged); | ||
}, | ||
|
||
/** | ||
* Stores the identity of the current tab in preferences so that the selected | ||
* tab can be persisted between openings of the preferences window. | ||
*/ | ||
tabSelectionChanged() { | ||
if (!this._inited) | ||
return; | ||
var advancedPrefs = document.getElementById("advancedPrefs"); | ||
var preference = document.getElementById("browser.preferences.advanced.selectedTabIndex"); | ||
|
||
// tabSelectionChanged gets called twice due to the selectedIndex being set | ||
// by both the selectedItem and selectedPanel callstacks. This guard is used | ||
// to prevent double-counting in Telemetry. | ||
if (preference.valueFromPreferences != advancedPrefs.selectedIndex) { | ||
Services.telemetry | ||
.getHistogramById("FX_PREFERENCES_CATEGORY_OPENED") | ||
.add(telemetryBucketForCategory("advanced")); | ||
} | ||
|
||
preference.valueFromPreferences = advancedPrefs.selectedIndex; | ||
}, | ||
|
||
observe(aSubject, aTopic, aData) { | ||
switch (aTopic) { | ||
case "nsPref:changed": | ||
this.updateReadPrefs(); | ||
break; | ||
} | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. | ||
|
||
<!-- Advanced panel --> | ||
|
||
<script src="chrome://browser/content/preferences/in-content/advanced.js"/> | ||
<stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/> | ||
<html:template id="template-paneAdvanced"> | ||
<hbox id="browserAdvancedCategory" | ||
class="subcategory" | ||
hidden="true" | ||
data-category="paneAdvanced"> | ||
<html:h1 data-l10n-id="pane-advanced-header"/> | ||
</hbox> | ||
|
||
<!-- Restart Menu Item --> | ||
<groupbox id="restartGroup" | ||
data-category="paneRestart" | ||
hidden="true"> | ||
<label><html:h2 data-l10n-id="restart-header"/></label> | ||
|
||
<checkbox id="browser.restart_menu.showpanelmenubtn" data-l10n-id="restart-paneluibtn" | ||
preference="browser.restart_menu.showpanelmenubtn"/> | ||
<checkbox id="browser.restart_menu.purgecache" data-l10n-id="clean-fast-restart-cache" | ||
preference="browser.restart_menu.purgecache"/> | ||
<checkbox id="browser.restart_menu.requireconfirm" data-l10n-id="restart-reqconfirmation" | ||
preference="browser.restart_menu.requireconfirm"/> | ||
</groupbox> | ||
<groupbox id="tabContextMenu" | ||
data-category="paneTabContextMenu" | ||
hidden="true"> | ||
<label><html:h2 data-l10n-id="tabContextMenu-header"/></label> | ||
|
||
<checkbox id="browser.tabs.duplicateTab" data-l10n-id="duplicate-tab-options" | ||
preference="browser.tabs.duplicateTab"/> | ||
|
||
<checkbox id="browser.tabs.copyurl" data-l10n-id="copy-tab-url-options" | ||
preference="browser.tabs.copyurl"/> | ||
|
||
<checkbox id="browser.tabs.copyurl.activetab" data-l10n-id="copy-active-tab-url-options" | ||
preference="browser.tabs.copyurl.activetab"/> | ||
|
||
<checkbox id="browser.tabs.copyallurls" data-l10n-id="copy-all-tab-urls-options" | ||
preference="browser.tabs.copyallurls"/> | ||
</groupbox> | ||
</html:template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters