more dump() removal. yes, these are all dumps.

This commit is contained in:
blakeross%telocity.com 2001-01-10 05:17:34 +00:00
Родитель 06ad76ab78
Коммит ded1f83391
1 изменённых файлов: 5 добавлений и 65 удалений

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

@ -57,14 +57,11 @@ function Init()
{ {
doSetOKCancel(AddAvailableLanguage); doSetOKCancel(AddAvailableLanguage);
dump("********** Init()\n");
try { try {
GetBundles() GetBundles();
} }
catch(ex) { catch(ex) {
dump("*** Couldn't get string bundles\n");
} }
ReadAvailableLanguages(); ReadAvailableLanguages();
@ -79,7 +76,6 @@ function Init()
} //try } //try
catch(ex) { catch(ex) {
dump("*** Couldn't get XUL element handles\n");
} //catch } //catch
try { try {
@ -87,10 +83,7 @@ function Init()
} }
catch(ex) { catch(ex) {
dump("*** Couldn't initialize page switcher and pref loader.\n");
//pref service backup //pref service backup
} //catch } //catch
try { try {
@ -100,15 +93,6 @@ function Init()
} //try } //try
catch(ex) { catch(ex) {
dump("*** Couldn't read pref string\n");
} //catch
try {
dump("*** Language PrefString: " + pref_string + "\n");
} //try
catch(ex) {
dump("*** Pref object doesn't exist\n");
} //catch } //catch
LoadActiveLanguages(); LoadActiveLanguages();
@ -128,27 +112,15 @@ function Init()
} //try } //try
catch(ex) { catch(ex) {
dump("*** Couldn't get XUL element handles\n");
} //catch } //catch
try { LoadAvailableLanguages();
dump("*** AddAvailable Language PrefString: " + pref_string + "\n");
} //try
catch(ex) {
dump("*** Pref object doesn't exist\n");
} //catch
LoadAvailableLanguages();
} }
} }
function AddLanguage() function AddLanguage()
{ {
dump("********** AddLanguage()\n");
//cludge: make pref string available from the popup //cludge: make pref string available from the popup
document.getElementById('intlAcceptLanguages').value = pref_string; document.getElementById('intlAcceptLanguages').value = pref_string;
window.openDialog("chrome://communicator/content/pref/pref-languages-add.xul","","modal=yes,chrome,resizable=no", "addlangwindow"); window.openDialog("chrome://communicator/content/pref/pref-languages-add.xul","","modal=yes,chrome,resizable=no", "addlangwindow");
@ -200,8 +172,6 @@ function ReadAvailableLanguages()
} }
catch (ex) { catch (ex) {
dump("tit:" + tit + "\n");
dump("No language string for:" + stringLangRegion[1] + "\n");
tit = ""; tit = "";
} }
@ -213,9 +183,7 @@ function ReadAvailableLanguages()
} }
catch (ex) { catch (ex) {
dump("No region string for:" + stringLangRegion[1] + "\n");
tit += "["+str+"]"; tit += "["+str+"]";
dump(":"+tit+":"+str);
} }
} //if region } //if region
@ -231,25 +199,17 @@ function ReadAvailableLanguages()
availLanguageDict[i][1] = str; availLanguageDict[i][1] = str;
availLanguageDict[i][2] = visible; availLanguageDict[i][2] = visible;
i++; i++;
if (tit) {}
else dump('Not label for :' + str + ', ' + tit+'\n');
} // if str&tit } // if str&tit
//} //if visible //} //if visible
} //if accepted } //if accepted
} //while } //while
availLanguageDict.sort();
dump('length:'+availLanguageDict.length+'\n');
availLanguageDict.sort();
} }
function LoadAvailableLanguages() function LoadAvailableLanguages()
{ {
dump("Loading available languages!\n");
if (availLanguageDict) if (availLanguageDict)
for (var i = 0; i < availLanguageDict.length; i++) { for (var i = 0; i < availLanguageDict.length; i++) {
@ -265,15 +225,10 @@ function LoadAvailableLanguages()
function LoadActiveLanguages() function LoadActiveLanguages()
{ {
dump("LoadActiveLanguages, PrefString: " + pref_string + "\n");
try { try {
arrayOfPrefs = pref_string.split(', '); arrayOfPrefs = pref_string.split(', ');
} }
catch (ex) { catch (ex) {
dump("failed to split the preference string!\n");
} }
if (arrayOfPrefs) if (arrayOfPrefs)
@ -294,9 +249,6 @@ function LoadActiveLanguages()
function LangAlreadyActive(langId) function LangAlreadyActive(langId)
{ {
dump("*** LangAlreadyActive, PrefString: " + pref_string + "\n");
var found = false; var found = false;
try { try {
var arrayOfPrefs = pref_string.split(', '); var arrayOfPrefs = pref_string.split(', ');
@ -418,8 +370,6 @@ function AddAvailableLanguage()
if (otherField.value) { if (otherField.value) {
dump("Other field: " + otherField.value + "\n");
/* reject bogus lang strings, INCLUDING those with HTTP "q" /* reject bogus lang strings, INCLUDING those with HTTP "q"
values kludged on the end of them values kludged on the end of them
*/ */
@ -491,7 +441,6 @@ function GetLanguageTitle(id)
if ( availLanguageDict[j][1] == id) { if ( availLanguageDict[j][1] == id) {
//title = //title =
dump("found title for:" + id + " ==> " + availLanguageDict[j][0] + "\n");
return availLanguageDict[j][0]; return availLanguageDict[j][0];
} }
} }
@ -517,12 +466,10 @@ function AddTreeItem(doc, treeRoot, langID, langTitle)
row.appendChild(cell); row.appendChild(cell);
treeRoot.appendChild(item); treeRoot.appendChild(item);
//dump("*** Added tree item: " + langTitle + "\n");
} //try } //try
catch (ex) { catch (ex) {
dump("*** Failed to add item: " + langTitle + "\n");
} //catch } //catch
} }
@ -533,8 +480,6 @@ function UpdateSavePrefString()
var num_languages = 0; var num_languages = 0;
pref_string = null; pref_string = null;
dump("*** UpdateSavePrefString()\n");
for (var item = active_languages_treeroot.firstChild; item != null; item = item.nextSibling) { for (var item = active_languages_treeroot.firstChild; item != null; item = item.nextSibling) {
var row = item.firstChild; var row = item.firstChild;
@ -554,7 +499,6 @@ function UpdateSavePrefString()
} //if } //if
}//for }//for
dump("*** Pref string set to: " + pref_string + "\n");
parent.hPrefWindow.setPref( "string", "intl.accept_languages", pref_string ); parent.hPrefWindow.setPref( "string", "intl.accept_languages", pref_string );
//Save(); //Save();
@ -563,8 +507,6 @@ function UpdateSavePrefString()
function Save() function Save()
{ {
dump('*** Save()\n');
try try
{ {
var prefInt = null; var prefInt = null;
@ -582,13 +524,11 @@ function Save()
if (prefInt) if (prefInt)
{ {
prefInt.SetCharPref("intl.accept_languages", pref_string); prefInt.SetCharPref("intl.accept_languages", pref_string);
dump('*** saved pref: ' + pref_string + '.\n');
} }
} }
catch(ex) catch(ex)
{ {
dump("*** Couldn't save!\n");
} }
} //Save } //Save