Back out the patch for bug 230778 to fix bug 231769, can't change themes from the preferences panel.

a=chofmann,dbaron
This commit is contained in:
caillon%returnzero.com 2004-02-17 23:18:03 +00:00
Родитель fabd10b530
Коммит 6f627fecbb
7 изменённых файлов: 48 добавлений и 24 удалений

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

@ -99,7 +99,7 @@
// Default to true in case the preference cannot be retrieved
var forceAlwaysAsk = true;
try {
var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
var prefService = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPrefService);
var prefBranch = prefService.getBranch("browser.helperApps.alwaysAsk.");
forceAlwaysAsk = prefBranch.getBoolPref("force");
} catch(e) {

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

@ -89,7 +89,7 @@ const xmlSinkObserver = {
// Convert old "don't ask" pref info to helper app pref entries
try {
var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
var prefService = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPrefService);
var prefBranch = prefService.getBranch("browser.helperApps.neverAsk.");
if (!prefBranch) return;
} catch(e) { return; }

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

@ -1,9 +1,8 @@
//get prefInt services
var availCharsetDict = [];
var prefBranch = null; //Preferences Interface
var prefInt = null; //Preferences Interface
var pref_string_title = "";
var pref_string_object = null;
var pref_string_content = "";
function Init()
@ -13,11 +12,11 @@ function Init()
if ("arguments" in window && window.arguments[0])
applicationArea = window.arguments[0];
try {
prefBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(null);
} catch (e) {}
prefInt = Components.classes["@mozilla.org/preferences;1"];
if (prefInt) {
prefInt = prefInt.getService(Components.interfaces.nsIPref);
if (prefBranch) {
if (applicationArea == "mailedit") {
pref_string_title = "intl.charsetmenu.mailedit";
} else {
@ -25,8 +24,7 @@ function Init()
pref_string_title = "intl.charsetmenu.browser.static";
}
pref_string_object = prefBranch.getComplexValue(pref_string_title, Components.interfaces.nsIPrefLocalizedString);
pref_string_content = pref_string_object.data;
pref_string_content = prefInt.getLocalizedUnicharPref(pref_string_title);
AddRemoveLatin1('add');
}
@ -288,9 +286,9 @@ function Save()
try
{
if (prefBranch) {
pref_string_object.data = pref_string_content;
prefBranch.setComplexValue(pref_string_title, Components.interfaces.nsIPrefLocalizedString, pref_string_object);
if (prefInt) {
prefInt.SetCharPref(pref_string_title, pref_string_content);
window.close();
}
}
catch(ex) {

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

@ -37,6 +37,15 @@
*
* ***** 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 globalFonts = null;
var fontTypes = ["serif", "sans-serif", "cursive", "fantasy", "monospace"];
@ -566,7 +575,7 @@ function selectLanguage()
try
{
var minSizePref = "font.minimum-size." + languageList.value;
minSizeVal = parent.hPrefWindow.pref.GetIntPref( minSizePref );
minSizeVal = pref.GetIntPref( minSizePref );
}
catch(e) { }
minSizeSelect( minSizeVal );

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

@ -34,7 +34,15 @@ function checkEngine()
try
{
var strDefaultSearchEngineName = parent.hPrefWindow.pref.getLocalizedUnicharPref("browser.search.defaultenginename");
var prefInt = null; //Preferences Interface
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 selectedItem = engineListSelection.length ? engineListSelection[0] : null;

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

@ -28,7 +28,17 @@ function moreInfo()
var smartBrowsingURL = regionBundle.getString("smartBrowsingURL");
if (smartBrowsingURL) {
try {
browserURL = parent.hPrefWindow.pref.CopyCharPref("browser.chromeURL");
var prefs = Components.classes["@mozilla.org/preferences;1"];
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) {
}
if (browserURL == null)

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

@ -58,8 +58,8 @@ function Startup()
gData.loaded = true;
parent.hPrefWindow.registerOKCallbackFunc( applySkin );
const kPrefSvcContractID = "@mozilla.org/preferences-service;1";
const kPrefSvcIID = Components.interfaces.nsIPrefService;
const kPrefSvcContractID = "@mozilla.org/preferences;1";
const kPrefSvcIID = Components.interfaces.nsIPref;
const kPrefSvc = Components.classes[kPrefSvcContractID].getService(kPrefSvcIID);
var theme = null;
@ -101,8 +101,8 @@ function applySkin()
if (data.name == null)
return;
const kPrefSvcContractID = "@mozilla.org/preferences-service;1";
const kPrefSvcIID = Components.interfaces.nsIPrefService;
const kPrefSvcContractID = "@mozilla.org/preferences;1";
const kPrefSvcIID = Components.interfaces.nsIPref;
const kPrefSvc = Components.classes[kPrefSvcContractID].getService(kPrefSvcIID);
var theme = null;
@ -208,11 +208,10 @@ function themeSelect()
// XXX - this sucks and should only be temporary.
var selectedSkin = "";
try {
const kPrefSvcContractID = "@mozilla.org/preferences-service;1";
const kPrefSvcIID = Components.interfaces.nsIPrefService;
const kPrefSvcContractID = "@mozilla.org/preferences;1";
const kPrefSvcIID = Components.interfaces.nsIPref;
const kPrefSvc = Components.classes[kPrefSvcContractID].getService(kPrefSvcIID);
selectedSkin = kPrefSvc.getComplexValue("general.skins.selectedSkin",
Components.interfaces.nsISupportsString).data;
selectedSkin = kPrefSvc.CopyCharPref("general.skins.selectedSkin");
}
catch (e) {
}