зеркало из https://github.com/mozilla/pjs.git
Bug 230778 Convert pref window from nsIPref to nsIPrefBranch r=caillon sr=jag
This commit is contained in:
Родитель
8a2fa7ea41
Коммит
4e628233ac
|
@ -79,7 +79,7 @@ nsPrefWindow.prototype =
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.pref = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref);
|
this.pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(null);
|
||||||
this.chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"].getService(Components.interfaces.nsIXULChromeRegistry);
|
this.chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"].getService(Components.interfaces.nsIXULChromeRegistry);
|
||||||
this.observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
|
this.observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
|
||||||
}
|
}
|
||||||
|
@ -145,26 +145,25 @@ nsPrefWindow.prototype =
|
||||||
getPrefIsLocked:
|
getPrefIsLocked:
|
||||||
function ( aPrefString )
|
function ( aPrefString )
|
||||||
{
|
{
|
||||||
return hPrefWindow.pref.PrefIsLocked(aPrefString);
|
return this.pref.prefIsLocked(aPrefString);
|
||||||
},
|
},
|
||||||
getPref:
|
getPref:
|
||||||
function ( aPrefType, aPrefString, aDefaultFlag )
|
function ( aPrefType, aPrefString )
|
||||||
{
|
{
|
||||||
var pref = hPrefWindow.pref;
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
switch ( aPrefType )
|
switch ( aPrefType )
|
||||||
{
|
{
|
||||||
case "bool":
|
case "bool":
|
||||||
return !aDefaultFlag ? pref.GetBoolPref( aPrefString ) : pref.GetDefaultBoolPref( aPrefString );
|
return this.pref.getBoolPref( aPrefString );
|
||||||
case "int":
|
case "int":
|
||||||
return !aDefaultFlag ? pref.GetIntPref( aPrefString ) : pref.GetDefaultIntPref( aPrefString );
|
return this.pref.getIntPref( aPrefString );
|
||||||
case "localizedstring":
|
case "localizedstring":
|
||||||
return pref.getLocalizedUnicharPref( aPrefString );
|
return this.pref.getComplexValue( aPrefString, Components.interfaces.nsIPrefLocalizedString ).data;
|
||||||
case "color":
|
case "color":
|
||||||
case "string":
|
case "string":
|
||||||
default:
|
default:
|
||||||
return !aDefaultFlag ? pref.CopyUnicharPref( aPrefString ) : pref.CopyDefaultUnicharPref( aPrefString );
|
return this.pref.getComplexValue( aPrefString, Components.interfaces.nsISupportsString ).data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e)
|
catch (e)
|
||||||
|
@ -186,16 +185,18 @@ nsPrefWindow.prototype =
|
||||||
switch ( aPrefType )
|
switch ( aPrefType )
|
||||||
{
|
{
|
||||||
case "bool":
|
case "bool":
|
||||||
hPrefWindow.pref.SetBoolPref( aPrefString, aValue );
|
this.pref.setBoolPref( aPrefString, aValue );
|
||||||
break;
|
break;
|
||||||
case "int":
|
case "int":
|
||||||
hPrefWindow.pref.SetIntPref( aPrefString, aValue );
|
this.pref.setIntPref( aPrefString, aValue );
|
||||||
break;
|
break;
|
||||||
case "color":
|
case "color":
|
||||||
case "string":
|
case "string":
|
||||||
case "localizedstring":
|
case "localizedstring":
|
||||||
default:
|
default:
|
||||||
hPrefWindow.pref.SetUnicharPref( aPrefString, aValue );
|
var supportsString = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
|
||||||
|
supportsString.data = aValue;
|
||||||
|
this.pref.setComplexValue( aPrefString, Components.interfaces.nsISupportsString, supportsString );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -279,7 +280,9 @@ nsPrefWindow.prototype =
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.pref.savePrefFile(null);
|
Components.classes["@mozilla.org/preferences-service;1"]
|
||||||
|
.getService(Components.interfaces.nsIPrefService)
|
||||||
|
.savePrefFile(null);
|
||||||
}
|
}
|
||||||
catch (e)
|
catch (e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -149,7 +149,7 @@
|
||||||
function sysPrefUpdate() {
|
function sysPrefUpdate() {
|
||||||
var checkObj = document.getElementById("systemPrefCheck");
|
var checkObj = document.getElementById("systemPrefCheck");
|
||||||
var prefstring = checkObj.getAttribute( "prefstring" );
|
var prefstring = checkObj.getAttribute( "prefstring" );
|
||||||
parent.hPrefWindow.pref.SetBoolPref(prefstring, checkObj.checked);
|
parent.hPrefWindow.setPref("bool", prefstring, checkObj.checked);
|
||||||
parent.hPrefWindow.pagePrefChanged = true;
|
parent.hPrefWindow.pagePrefChanged = true;
|
||||||
parent.hPrefWindow.pagePrefUpdated = [];
|
parent.hPrefWindow.pagePrefUpdated = [];
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
// Default to true in case the preference cannot be retrieved
|
// Default to true in case the preference cannot be retrieved
|
||||||
var forceAlwaysAsk = true;
|
var forceAlwaysAsk = true;
|
||||||
try {
|
try {
|
||||||
var prefService = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPrefService);
|
var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
|
||||||
var prefBranch = prefService.getBranch("browser.helperApps.alwaysAsk.");
|
var prefBranch = prefService.getBranch("browser.helperApps.alwaysAsk.");
|
||||||
forceAlwaysAsk = prefBranch.getBoolPref("force");
|
forceAlwaysAsk = prefBranch.getBoolPref("force");
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
|
|
@ -89,7 +89,7 @@ const xmlSinkObserver = {
|
||||||
|
|
||||||
// Convert old "don't ask" pref info to helper app pref entries
|
// Convert old "don't ask" pref info to helper app pref entries
|
||||||
try {
|
try {
|
||||||
var prefService = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPrefService);
|
var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
|
||||||
var prefBranch = prefService.getBranch("browser.helperApps.neverAsk.");
|
var prefBranch = prefService.getBranch("browser.helperApps.neverAsk.");
|
||||||
if (!prefBranch) return;
|
if (!prefBranch) return;
|
||||||
} catch(e) { return; }
|
} catch(e) { return; }
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
//get prefInt services
|
//get prefInt services
|
||||||
|
|
||||||
var availCharsetDict = [];
|
var availCharsetDict = [];
|
||||||
var prefInt = null; //Preferences Interface
|
var prefBranch = null; //Preferences Interface
|
||||||
var pref_string_title = "";
|
var pref_string_title = "";
|
||||||
|
var pref_string_object = null;
|
||||||
var pref_string_content = "";
|
var pref_string_content = "";
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
|
@ -12,11 +13,11 @@ function Init()
|
||||||
if ("arguments" in window && window.arguments[0])
|
if ("arguments" in window && window.arguments[0])
|
||||||
applicationArea = window.arguments[0];
|
applicationArea = window.arguments[0];
|
||||||
|
|
||||||
prefInt = Components.classes["@mozilla.org/preferences;1"];
|
try {
|
||||||
|
prefBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(null);
|
||||||
if (prefInt) {
|
} catch (e) {}
|
||||||
prefInt = prefInt.getService(Components.interfaces.nsIPref);
|
|
||||||
|
|
||||||
|
if (prefBranch) {
|
||||||
if (applicationArea == "mailedit") {
|
if (applicationArea == "mailedit") {
|
||||||
pref_string_title = "intl.charsetmenu.mailedit";
|
pref_string_title = "intl.charsetmenu.mailedit";
|
||||||
} else {
|
} else {
|
||||||
|
@ -24,7 +25,8 @@ function Init()
|
||||||
pref_string_title = "intl.charsetmenu.browser.static";
|
pref_string_title = "intl.charsetmenu.browser.static";
|
||||||
}
|
}
|
||||||
|
|
||||||
pref_string_content = prefInt.getLocalizedUnicharPref(pref_string_title);
|
pref_string_object = prefBranch.getComplexValue(pref_string_title, Components.interfaces.nsIPrefLocalizedString);
|
||||||
|
pref_string_content = pref_string_object.data;
|
||||||
|
|
||||||
AddRemoveLatin1('add');
|
AddRemoveLatin1('add');
|
||||||
}
|
}
|
||||||
|
@ -286,9 +288,9 @@ function Save()
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (prefInt) {
|
if (prefBranch) {
|
||||||
prefInt.SetCharPref(pref_string_title, pref_string_content);
|
pref_string_object.data = pref_string_content;
|
||||||
window.close();
|
prefBranch.setComplexValue(pref_string_title, Components.interfaces.nsIPrefLocalizedString, pref_string_object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(ex) {
|
catch(ex) {
|
||||||
|
|
|
@ -37,15 +37,6 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var pref = Components.classes["@mozilla.org/preferences;1"].getService( Components.interfaces.nsIPref );
|
|
||||||
}
|
|
||||||
catch(e)
|
|
||||||
{
|
|
||||||
dump("failed to get font list or pref object: "+e+" in pref-fonts.js\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
var fontEnumerator = null;
|
var fontEnumerator = null;
|
||||||
var globalFonts = null;
|
var globalFonts = null;
|
||||||
var fontTypes = ["serif", "sans-serif", "cursive", "fantasy", "monospace"];
|
var fontTypes = ["serif", "sans-serif", "cursive", "fantasy", "monospace"];
|
||||||
|
@ -378,13 +369,13 @@ function lazyAppendFontNames( i )
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var fontPrefString = "font.name." + fontTypes[i] + "." + languageList.value;
|
var fontPrefString = "font.name." + fontTypes[i] + "." + languageList.value;
|
||||||
var selectVal = parent.hPrefWindow.pref.CopyUnicharPref( fontPrefString );
|
var selectVal = parent.hPrefWindow.pref.getComplexValue( fontPrefString, Components.interfaces.nsISupportsString ).data;
|
||||||
var dataEls = selectElement.listElement.getElementsByAttribute( "value", selectVal );
|
var dataEls = selectElement.listElement.getElementsByAttribute( "value", selectVal );
|
||||||
|
|
||||||
// we need to honor name-list in case name is unavailable
|
// we need to honor name-list in case name is unavailable
|
||||||
if (!dataEls.length) {
|
if (!dataEls.length) {
|
||||||
var fontListPrefString = "font.name-list." + fontTypes[i] + "." + languageList.value;
|
var fontListPrefString = "font.name-list." + fontTypes[i] + "." + languageList.value;
|
||||||
var nameList = parent.hPrefWindow.pref.CopyUnicharPref( fontListPrefString );
|
var nameList = parent.hPrefWindow.pref.getComplexValue( fontListPrefString, Components.interfaces.nsISupportsString ).data;
|
||||||
var fontNames = nameList.split(",");
|
var fontNames = nameList.split(",");
|
||||||
var stripWhitespace = /^\s*(.*)\s*$/;
|
var stripWhitespace = /^\s*(.*)\s*$/;
|
||||||
|
|
||||||
|
@ -419,7 +410,7 @@ function saveFontPrefs()
|
||||||
var currValue = "";
|
var currValue = "";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
currValue = pref.CopyUnicharPref( fontPrefString );
|
currValue = pref.getComplexValue( fontPrefString, Components.interfaces.nsISupportsString ).data;
|
||||||
}
|
}
|
||||||
catch(e)
|
catch(e)
|
||||||
{
|
{
|
||||||
|
@ -430,7 +421,7 @@ function saveFontPrefs()
|
||||||
{
|
{
|
||||||
if (dataValue)
|
if (dataValue)
|
||||||
{
|
{
|
||||||
pref.SetUnicharPref( fontPrefString, dataValue );
|
parent.hPrefWindow.setPref( "string", fontPrefString, dataValue );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -441,7 +432,7 @@ function saveFontPrefs()
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// ClearUserPref throws an exception...
|
// ClearUserPref throws an exception...
|
||||||
pref.ClearUserPref( fontPrefString );
|
pref.clearUserPref( fontPrefString );
|
||||||
}
|
}
|
||||||
catch(e)
|
catch(e)
|
||||||
{
|
{
|
||||||
|
@ -455,19 +446,19 @@ function saveFontPrefs()
|
||||||
var currVariableSize = 12, currFixedSize = 12, minSizeVal = 0;
|
var currVariableSize = 12, currFixedSize = 12, minSizeVal = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
currVariableSize = pref.GetIntPref( variableSizePref );
|
currVariableSize = pref.getIntPref( variableSizePref );
|
||||||
currFixedSize = pref.GetIntPref( fixedSizePref );
|
currFixedSize = pref.getIntPref( fixedSizePref );
|
||||||
minSizeVal = pref.GetIntPref( minSizePref );
|
minSizeVal = pref.getIntPref( minSizePref );
|
||||||
}
|
}
|
||||||
catch(e)
|
catch(e)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
if( currVariableSize != dataObject.languageData[language].variableSize )
|
if( currVariableSize != dataObject.languageData[language].variableSize )
|
||||||
pref.SetIntPref( variableSizePref, dataObject.languageData[language].variableSize );
|
pref.setIntPref( variableSizePref, dataObject.languageData[language].variableSize );
|
||||||
if( currFixedSize != dataObject.languageData[language].fixedSize )
|
if( currFixedSize != dataObject.languageData[language].fixedSize )
|
||||||
pref.SetIntPref( fixedSizePref, dataObject.languageData[language].fixedSize );
|
pref.setIntPref( fixedSizePref, dataObject.languageData[language].fixedSize );
|
||||||
if ( minSizeVal != dataObject.languageData[language].minSize ) {
|
if ( minSizeVal != dataObject.languageData[language].minSize ) {
|
||||||
pref.SetIntPref ( minSizePref, dataObject.languageData[language].minSize );
|
pref.setIntPref ( minSizePref, dataObject.languageData[language].minSize );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -478,20 +469,20 @@ function saveFontPrefs()
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var currDPI = pref.GetIntPref( "browser.display.screen_resolution" );
|
var currDPI = pref.getIntPref( "browser.display.screen_resolution" );
|
||||||
var currFonts = pref.GetIntPref( "browser.display.use_document_fonts" );
|
var currFonts = pref.getIntPref( "browser.display.use_document_fonts" );
|
||||||
var currDefault = pref.CopyUnicharPref( "font.default" );
|
var currDefault = pref.getComplexValue( "font.default", Components.interfaces.nsISupportsString ).data;
|
||||||
}
|
}
|
||||||
catch(e)
|
catch(e)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
if( currDPI != fontDPI )
|
if( currDPI != fontDPI )
|
||||||
pref.SetIntPref( "browser.display.screen_resolution", fontDPI );
|
pref.setIntPref( "browser.display.screen_resolution", fontDPI );
|
||||||
if( currFonts != documentFonts )
|
if( currFonts != documentFonts )
|
||||||
pref.SetIntPref( "browser.display.use_document_fonts", documentFonts );
|
pref.setIntPref( "browser.display.use_document_fonts", documentFonts );
|
||||||
if( currDefault != defaultFont )
|
if( currDefault != defaultFont )
|
||||||
{
|
{
|
||||||
pref.SetUnicharPref( "font.default", defaultFont );
|
parent.hPrefWindow.setPref( "string", "font.default", defaultFont );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -562,11 +553,11 @@ function selectLanguage()
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var variableSizePref = "font.size.variable." + languageList.value;
|
var variableSizePref = "font.size.variable." + languageList.value;
|
||||||
var sizeVarVal = parent.hPrefWindow.pref.GetIntPref( variableSizePref );
|
var sizeVarVal = parent.hPrefWindow.pref.getIntPref( variableSizePref );
|
||||||
variableSize.selectedItem = variableSize.getElementsByAttribute( "value", sizeVarVal )[0];
|
variableSize.selectedItem = variableSize.getElementsByAttribute( "value", sizeVarVal )[0];
|
||||||
|
|
||||||
var fixedSizePref = "font.size.fixed." + languageList.value;
|
var fixedSizePref = "font.size.fixed." + languageList.value;
|
||||||
var sizeFixedVal = parent.hPrefWindow.pref.GetIntPref( fixedSizePref );
|
var sizeFixedVal = parent.hPrefWindow.pref.getIntPref( fixedSizePref );
|
||||||
fixedSize.selectedItem = fixedSize.getElementsByAttribute( "value", sizeFixedVal )[0];
|
fixedSize.selectedItem = fixedSize.getElementsByAttribute( "value", sizeFixedVal )[0];
|
||||||
}
|
}
|
||||||
catch(e) { } // font size lists can simply default to the first entry
|
catch(e) { } // font size lists can simply default to the first entry
|
||||||
|
@ -575,7 +566,7 @@ function selectLanguage()
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var minSizePref = "font.minimum-size." + languageList.value;
|
var minSizePref = "font.minimum-size." + languageList.value;
|
||||||
minSizeVal = pref.GetIntPref( minSizePref );
|
minSizeVal = parent.hPrefWindow.pref.getIntPref( minSizePref );
|
||||||
}
|
}
|
||||||
catch(e) { }
|
catch(e) { }
|
||||||
minSizeSelect( minSizeVal );
|
minSizeSelect( minSizeVal );
|
||||||
|
|
|
@ -34,15 +34,7 @@ function checkEngine()
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var prefInt = null; //Preferences Interface
|
var strDefaultSearchEngineName = parent.hPrefWindow.getPref("localizedstring", "browser.search.defaultenginename");
|
||||||
var strDefaultSearchEngineName;
|
|
||||||
|
|
||||||
prefInt = Components.classes["@mozilla.org/preferences;1"];
|
|
||||||
if (prefInt)
|
|
||||||
{
|
|
||||||
prefInt = prefInt.getService(Components.interfaces.nsIPref);
|
|
||||||
strDefaultSearchEngineName = prefInt.getLocalizedUnicharPref("browser.search.defaultenginename");
|
|
||||||
}
|
|
||||||
|
|
||||||
var engineListSelection = engineList.getElementsByAttribute( "label", strDefaultSearchEngineName );
|
var engineListSelection = engineList.getElementsByAttribute( "label", strDefaultSearchEngineName );
|
||||||
var selectedItem = engineListSelection.length ? engineListSelection[0] : null;
|
var selectedItem = engineListSelection.length ? engineListSelection[0] : null;
|
||||||
|
|
|
@ -28,17 +28,7 @@ function moreInfo()
|
||||||
var smartBrowsingURL = regionBundle.getString("smartBrowsingURL");
|
var smartBrowsingURL = regionBundle.getString("smartBrowsingURL");
|
||||||
if (smartBrowsingURL) {
|
if (smartBrowsingURL) {
|
||||||
try {
|
try {
|
||||||
var prefs = Components.classes["@mozilla.org/preferences;1"];
|
browserURL = parent.hPrefWindow.getPref("string", "browser.chromeURL");
|
||||||
if (prefs) {
|
|
||||||
prefs = prefs.getService();
|
|
||||||
if (prefs)
|
|
||||||
prefs = prefs.QueryInterface(Components.interfaces.nsIPref);
|
|
||||||
}
|
|
||||||
if (prefs) {
|
|
||||||
var url = prefs.CopyCharPref("browser.chromeURL");
|
|
||||||
if (url)
|
|
||||||
browserURL = url;
|
|
||||||
}
|
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
}
|
}
|
||||||
if (browserURL == null)
|
if (browserURL == null)
|
||||||
|
|
|
@ -58,14 +58,9 @@ function Startup()
|
||||||
gData.loaded = true;
|
gData.loaded = true;
|
||||||
parent.hPrefWindow.registerOKCallbackFunc( applySkin );
|
parent.hPrefWindow.registerOKCallbackFunc( applySkin );
|
||||||
|
|
||||||
const kPrefSvcContractID = "@mozilla.org/preferences;1";
|
|
||||||
const kPrefSvcIID = Components.interfaces.nsIPref;
|
|
||||||
const kPrefSvc = Components.classes[kPrefSvcContractID].getService(kPrefSvcIID);
|
|
||||||
|
|
||||||
var theme = null;
|
var theme = null;
|
||||||
try {
|
try {
|
||||||
theme = kPrefSvc.getComplexValue("general.skins.selectedSkin",
|
theme = parent.hPrefWindow.pref.getComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsString).data;
|
||||||
Components.interfaces.nsISupportsString).data;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
var matches;
|
var matches;
|
||||||
|
@ -101,14 +96,9 @@ function applySkin()
|
||||||
if (data.name == null)
|
if (data.name == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const kPrefSvcContractID = "@mozilla.org/preferences;1";
|
|
||||||
const kPrefSvcIID = Components.interfaces.nsIPref;
|
|
||||||
const kPrefSvc = Components.classes[kPrefSvcContractID].getService(kPrefSvcIID);
|
|
||||||
|
|
||||||
var theme = null;
|
var theme = null;
|
||||||
try {
|
try {
|
||||||
theme = kPrefSvc.getComplexValue("general.skins.selectedSkin",
|
theme = parent.hPrefWindow.pref.getComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsString).data;
|
||||||
Components.interfaces.nsISupportsString).data;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,11 +114,7 @@ function applySkin()
|
||||||
var inUse = reg.isSkinSelected(data.name, true);
|
var inUse = reg.isSkinSelected(data.name, true);
|
||||||
if (!theme && inUse == Components.interfaces.nsIChromeRegistry.FULL) return;
|
if (!theme && inUse == Components.interfaces.nsIChromeRegistry.FULL) return;
|
||||||
|
|
||||||
var str = Components.classes["@mozilla.org/supports-string;1"]
|
parent.hPrefWindow.setPref("string", "general.skins.selectedSkin", data.name);
|
||||||
.createInstance(Components.interfaces.nsISupportsString);
|
|
||||||
str.data = data.name;
|
|
||||||
|
|
||||||
kPrefSvc.setComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsString, str);
|
|
||||||
|
|
||||||
// shut down quicklaunch so the next launch will have the new skin
|
// shut down quicklaunch so the next launch will have the new skin
|
||||||
var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService();
|
var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService();
|
||||||
|
@ -208,10 +194,7 @@ function themeSelect()
|
||||||
// XXX - this sucks and should only be temporary.
|
// XXX - this sucks and should only be temporary.
|
||||||
var selectedSkin = "";
|
var selectedSkin = "";
|
||||||
try {
|
try {
|
||||||
const kPrefSvcContractID = "@mozilla.org/preferences;1";
|
selectedSkin = parent.hPrefWindow.pref.getComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsString).data;
|
||||||
const kPrefSvcIID = Components.interfaces.nsIPref;
|
|
||||||
const kPrefSvc = Components.classes[kPrefSvcContractID].getService(kPrefSvcIID);
|
|
||||||
selectedSkin = kPrefSvc.CopyCharPref("general.skins.selectedSkin");
|
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче