зеркало из https://github.com/mozilla/pjs.git
Bug 406387 - Move System Defaults from Main to Advanced - General. r=sspitzer, approval1.9=dsicore
This commit is contained in:
Родитель
ea6264c7a0
Коммит
48b378b56a
|
@ -399,4 +399,51 @@ var gAdvancedPane = {
|
|||
"chrome://pippki/content/device_manager.xul",
|
||||
"", null);
|
||||
}
|
||||
#ifdef HAVE_SHELL_SERVICE
|
||||
,
|
||||
|
||||
// SYSTEM DEFAULTS
|
||||
|
||||
/*
|
||||
* Preferences:
|
||||
*
|
||||
* browser.shell.checkDefault
|
||||
* - true if a default-browser check (and prompt to make it so if necessary)
|
||||
* occurs at startup, false otherwise
|
||||
*/
|
||||
|
||||
/**
|
||||
* Checks whether the browser is currently registered with the operating
|
||||
* system as the default browser. If the browser is not currently the
|
||||
* default browser, the user is given the option of making it the default;
|
||||
* otherwise, the user is informed that this browser already is the browser.
|
||||
*/
|
||||
checkNow: function ()
|
||||
{
|
||||
var shellSvc = Components.classes["@mozilla.org/browser/shell-service;1"]
|
||||
.getService(Components.interfaces.nsIShellService);
|
||||
var brandBundle = document.getElementById("bundleBrand");
|
||||
var shellBundle = document.getElementById("bundleShell");
|
||||
var brandShortName = brandBundle.getString("brandShortName");
|
||||
var promptTitle = shellBundle.getString("setDefaultBrowserTitle");
|
||||
var promptMessage;
|
||||
const IPS = Components.interfaces.nsIPromptService;
|
||||
var psvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(IPS);
|
||||
if (!shellSvc.isDefaultBrowser(false)) {
|
||||
promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage",
|
||||
[brandShortName]);
|
||||
var rv = psvc.confirmEx(window, promptTitle, promptMessage,
|
||||
IPS.STD_YES_NO_BUTTONS,
|
||||
null, null, null, null, { });
|
||||
if (rv == 0)
|
||||
shellSvc.setDefaultBrowser(true, false);
|
||||
}
|
||||
else {
|
||||
promptMessage = shellBundle.getFormattedString("alreadyDefaultBrowser",
|
||||
[brandShortName]);
|
||||
psvc.alert(window, promptTitle, promptMessage);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -72,6 +72,15 @@
|
|||
<preference id="general.smoothScroll" name="general.smoothScroll" type="bool"/>
|
||||
<preference id="layout.spellcheckDefault" name="layout.spellcheckDefault" type="int"/>
|
||||
|
||||
#ifdef HAVE_SHELL_SERVICE
|
||||
<preference id="browser.shell.checkDefaultBrowser"
|
||||
name="browser.shell.checkDefaultBrowser"
|
||||
type="bool"/>
|
||||
|
||||
<preference id="pref.general.disable_button.default_browser"
|
||||
name="pref.general.disable_button.default_browser"
|
||||
type="bool"/>
|
||||
#endif
|
||||
|
||||
<!-- Network tab -->
|
||||
<preference id="browser.cache.disk.capacity" name="browser.cache.disk.capacity" type="int"/>
|
||||
|
@ -114,6 +123,11 @@
|
|||
type="bool"/>
|
||||
</preferences>
|
||||
|
||||
#ifdef HAVE_SHELL_SERVICE
|
||||
<stringbundle id="bundleShell" src="chrome://browser/locale/shellservice.properties"/>
|
||||
<stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/>
|
||||
#endif
|
||||
|
||||
<script type="application/x-javascript" src="chrome://browser/content/preferences/advanced.js"/>
|
||||
|
||||
<tabbox id="advancedPrefs" flex="1"
|
||||
|
@ -169,6 +183,22 @@
|
|||
preference="layout.spellcheckDefault"/>
|
||||
</groupbox>
|
||||
|
||||
#ifdef HAVE_SHELL_SERVICE
|
||||
<!-- System Defaults -->
|
||||
<groupbox id="systemDefaultsGroup" orient="horizontal">
|
||||
<caption label="&systemDefaults.label;"/>
|
||||
|
||||
<hbox id="checkDefaultBox" align="center" flex="1">
|
||||
<checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"
|
||||
label="&alwaysCheckDefault.label;" accesskey="&alwaysCheckDefault.accesskey;"
|
||||
flex="1"/>
|
||||
<button id="checkDefaultButton"
|
||||
label="&checkNow.label;" accesskey="&checkNow.accesskey;"
|
||||
oncommand="gAdvancedPane.checkNow()"
|
||||
preference="pref.general.disable_button.default_browser"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
#endif
|
||||
</tabpanel>
|
||||
|
||||
<!-- Network -->
|
||||
|
@ -200,7 +230,7 @@
|
|||
aaa:labelledby="useCacheBefore cacheSize useCacheAfter"/>
|
||||
<label id="useCacheAfter" flex="1">&useCacheAfter.label;</label>
|
||||
<button id="clearCacheButton" icon="clear"
|
||||
label="&clearCacheNow.label;"
|
||||
label="&clearCacheNow.label;" accesskey="&clearCacheNow.accesskey;"
|
||||
oncommand="gAdvancedPane.clearCache();"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
|
|
@ -466,52 +466,4 @@ var gMainPane = {
|
|||
const EMFEATURES = "chrome,menubar,extra-chrome,toolbar,dialog=no,resizable";
|
||||
window.openDialog(EMURL, "", EMFEATURES);
|
||||
}
|
||||
|
||||
#ifdef HAVE_SHELL_SERVICE
|
||||
,
|
||||
|
||||
// SYSTEM DEFAULTS
|
||||
|
||||
/*
|
||||
* Preferences:
|
||||
*
|
||||
* browser.shell.checkDefault
|
||||
* - true if a default-browser check (and prompt to make it so if necessary)
|
||||
* occurs at startup, false otherwise
|
||||
*/
|
||||
|
||||
/**
|
||||
* Checks whether the browser is currently registered with the operating
|
||||
* system as the default browser. If the browser is not currently the
|
||||
* default browser, the user is given the option of making it the default;
|
||||
* otherwise, the user is informed that this browser already is the browser.
|
||||
*/
|
||||
checkNow: function ()
|
||||
{
|
||||
var shellSvc = Components.classes["@mozilla.org/browser/shell-service;1"]
|
||||
.getService(Components.interfaces.nsIShellService);
|
||||
var brandBundle = document.getElementById("bundleBrand");
|
||||
var shellBundle = document.getElementById("bundleShell");
|
||||
var brandShortName = brandBundle.getString("brandShortName");
|
||||
var promptTitle = shellBundle.getString("setDefaultBrowserTitle");
|
||||
var promptMessage;
|
||||
const IPS = Components.interfaces.nsIPromptService;
|
||||
var psvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(IPS);
|
||||
if (!shellSvc.isDefaultBrowser(false)) {
|
||||
promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage",
|
||||
[brandShortName]);
|
||||
var rv = psvc.confirmEx(window, promptTitle, promptMessage,
|
||||
IPS.STD_YES_NO_BUTTONS,
|
||||
null, null, null, null, { });
|
||||
if (rv == 0)
|
||||
shellSvc.setDefaultBrowser(true, false);
|
||||
}
|
||||
else {
|
||||
promptMessage = shellBundle.getFormattedString("alreadyDefaultBrowser",
|
||||
[brandShortName]);
|
||||
psvc.alert(window, promptTitle, promptMessage);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -93,22 +93,9 @@
|
|||
onchange="gMainPane.displayDownloadDirPref();"/>
|
||||
<preference id="browser.download.folderList" name="browser.download.folderList" type="int"/>
|
||||
|
||||
<!-- SYSTEM DEFAULTS -->
|
||||
<preference id="browser.shell.checkDefaultBrowser"
|
||||
name="browser.shell.checkDefaultBrowser"
|
||||
type="bool"/>
|
||||
|
||||
<preference id="pref.general.disable_button.default_browser"
|
||||
name="pref.general.disable_button.default_browser"
|
||||
type="bool"/>
|
||||
|
||||
</preferences>
|
||||
|
||||
<stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/>
|
||||
#ifdef HAVE_SHELL_SERVICE
|
||||
<stringbundle id="bundleShell" src="chrome://browser/locale/shellservice.properties"/>
|
||||
<stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/>
|
||||
#endif
|
||||
|
||||
<!-- Startup -->
|
||||
<groupbox id="startupGroup">
|
||||
|
@ -195,31 +182,15 @@
|
|||
</radiogroup>
|
||||
</groupbox>
|
||||
|
||||
#ifdef HAVE_SHELL_SERVICE
|
||||
<!-- System Defaults -->
|
||||
<groupbox id="systemDefaultsGroup" orient="horizontal">
|
||||
<caption label="&systemDefaults.label;"/>
|
||||
|
||||
<hbox id="checkDefaultBox" align="center" flex="1">
|
||||
<checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"
|
||||
label="&alwaysCheckDefault.label;" accesskey="&alwaysCheckDefault.accesskey;"
|
||||
flex="1"/>
|
||||
<button id="checkDefaultButton"
|
||||
label="&checkNow.label;" accesskey="&checkNow.accesskey;"
|
||||
oncommand="gMainPane.checkNow()"
|
||||
preference="pref.general.disable_button.default_browser"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
#endif
|
||||
<hbox class="bottomBox">
|
||||
<groupbox id="addonsMgrGroup" orient="horizontal" flex="1">
|
||||
<caption label="&addonsMgr.label;"/>
|
||||
|
||||
<description control="manageAddons"
|
||||
#ifdef XP_WIN
|
||||
flex="1">&manageAddonsDesc.label;</description>
|
||||
flex="1">&manageAddonsDescWin.label;</description>
|
||||
#else
|
||||
flex="1">&manageAddonsDescUnix.label;</description>
|
||||
flex="1">&manageAddonsDescUnix2.label;</description>
|
||||
#endif
|
||||
<button id="manageAddons" label="&manageAddons.label;"
|
||||
accesskey="&manageAddons.accesskey;"
|
||||
|
|
|
@ -83,12 +83,12 @@
|
|||
#endif
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
#ifdef USE_WIN_TITLE_STYLE
|
||||
style="&prefWin.styleWin;">
|
||||
style="&prefWin.styleWin2;">
|
||||
#else
|
||||
#ifdef XP_MACOSX
|
||||
style="&prefWin.styleMac;">
|
||||
style="&prefWin.styleMac2;">
|
||||
#else
|
||||
style="&prefWin.styleGNOME;">
|
||||
style="&prefWin.styleGNOME2;">
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<!-- Note: due to bug 143065, the only remaining accesskeys available to be used
|
||||
in the Advanced pane are: "j", "o", "q", "z" -->
|
||||
<!-- Note: each tab panel must contain unique accesskeys -->
|
||||
|
||||
<!ENTITY generalTab.label "General">
|
||||
|
||||
|
@ -21,6 +20,12 @@
|
|||
<!ENTITY checkSpelling.label "Check my spelling as I type">
|
||||
<!ENTITY checkSpelling.accesskey "t">
|
||||
|
||||
<!ENTITY systemDefaults.label "System Defaults">
|
||||
<!ENTITY alwaysCheckDefault.label "Always check to see if &brandShortName; is the default browser on startup"><!--XXX-->
|
||||
<!ENTITY alwaysCheckDefault.accesskey "w">
|
||||
<!ENTITY checkNow.label "Check Now">
|
||||
<!ENTITY checkNow.accesskey "N">
|
||||
|
||||
<!ENTITY networkTab.label "Network">
|
||||
|
||||
<!ENTITY connection.label "Connection">
|
||||
|
@ -41,6 +46,7 @@
|
|||
<!ENTITY useCacheBefore.accesskey "U">
|
||||
<!ENTITY useCacheAfter.label "MB of space for the cache">
|
||||
<!ENTITY clearCacheNow.label "Clear Now">
|
||||
<!ENTITY clearCacheNow.accesskey "C">
|
||||
|
||||
<!ENTITY updateTab.label "Update">
|
||||
|
||||
|
|
|
@ -30,17 +30,8 @@
|
|||
<!ENTITY alwaysAsk.label "Always ask me where to save files">
|
||||
<!ENTITY alwaysAsk.accesskey "A">
|
||||
|
||||
|
||||
<!ENTITY systemDefaults.label "System Defaults">
|
||||
|
||||
<!ENTITY alwaysCheckDefault.label "Always check to see if &brandShortName; is the default browser on startup"><!--XXX-->
|
||||
<!ENTITY alwaysCheckDefault.accesskey "y">
|
||||
|
||||
<!ENTITY checkNow.label "Check Now">
|
||||
<!ENTITY checkNow.accesskey "N">
|
||||
|
||||
<!ENTITY addonsMgr.label "Add-ons">
|
||||
<!ENTITY manageAddonsDesc.label "Change options for your add-ons.">
|
||||
<!ENTITY manageAddonsDescUnix.label "Change preferences for your add-ons.">
|
||||
<!ENTITY manageAddons.label "Manage Add-ons…">
|
||||
<!ENTITY manageAddons.accesskey "M">
|
||||
<!ENTITY addonsMgr.label "Add-ons">
|
||||
<!ENTITY manageAddonsDescWin.label "Change options for your add-ons">
|
||||
<!ENTITY manageAddonsDescUnix2.label "Change preferences for your add-ons">
|
||||
<!ENTITY manageAddons.label "Manage Add-ons…">
|
||||
<!ENTITY manageAddons.accesskey "M">
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
<!ENTITY prefWindow.titleGNOME "&brandShortName; Preferences">
|
||||
<!-- When making changes to prefWindow.styleWin test both Windows Classic and
|
||||
Luna since widget heights are different based on the OS theme -->
|
||||
<!ENTITY prefWin.styleWin "width: 42em; min-height: 44em;">
|
||||
<!ENTITY prefWin.styleMac "width: 47em; min-height: 45em;">
|
||||
<!ENTITY prefWin.styleGNOME "width: 42em; min-height: 44.5em;">
|
||||
<!ENTITY prefWin.styleWin2 "width: 42em; min-height: 39em;">
|
||||
<!ENTITY prefWin.styleMac2 "width: 47em; min-height: 40em;">
|
||||
<!ENTITY prefWin.styleGNOME2 "width: 42em; min-height: 39.5em;">
|
||||
|
||||
<!ENTITY paneMain.title "Main">
|
||||
<!ENTITY paneTabs.title "Tabs">
|
||||
|
|
Загрузка…
Ссылка в новой задаче