Bug 954801 - Suppress errors when running without libpurple, r=florian.

This commit is contained in:
Benedikt Pfeifer 2012-10-11 01:13:46 +02:00
Родитель b9486b262e
Коммит 43424e7d71
5 изменённых файлов: 32 добавлений и 9 удалений

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

@ -50,10 +50,15 @@
versionField.value = versionField.value + xai.platformVersion
+ ' (' + xai.platformBuildID + ')';
var pcs = Components.classes["@instantbird.org/libpurple/core;1"]
.getService(Components.interfaces.purpleICoreService)
versionField = document.getElementById("libpurpleVersionField");
versionField.value = versionField.value + pcs.version;
if ("@instantbird.org/libpurple/core;1" in Components.classes) {
var pcs = Components.classes["@instantbird.org/libpurple/core;1"]
.getService(Components.interfaces.purpleICoreService);
versionField.value = versionField.value + pcs.version;
}
else {
versionField.hidden = true;
}
versionField = document.getElementById("userAgentField");
versionField.value = navigator.userAgent;

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

@ -26,6 +26,7 @@ var gAdvancedPane = {
advancedPrefs.selectedIndex = preference.value;
}
this.updateConnectionGroupbox();
#ifdef MOZ_UPDATER
this.updateAppUpdateItems();
this.updateAutoItems();
@ -149,6 +150,22 @@ var gAdvancedPane = {
"", null);
},
/**
* Adapt the content of the connection groupbox depending on libpurple being
* there or not.
*/
updateConnectionGroupbox: function ()
{
let hasLibpurple = "@instantbird.org/libpurple/core;1" in Components.classes;
// Hide explanatory header and libpurple section.
document.getElementById("connectionGroupHeader").hidden = !hasLibpurple;
document.getElementById("connectionGroupSeparator").hidden = !hasLibpurple;
document.getElementById("purpleConnectionBox").hidden = !hasLibpurple;
// Choose appropriate label for the Mozilla proxy options.
document.getElementById("mozConnLabelWithoutLibpurple").hidden = hasLibpurple;
document.getElementById("mozConnLabelWithLibpurple").hidden = !hasLibpurple;
},
// UPDATE TAB
/*

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

@ -184,7 +184,7 @@
<groupbox id="connectionGroup">
<caption label="&connection.label;"/>
<hbox align="center">
<hbox id="connectionGroupHeader" align="center">
<image style="padding-right: 1em;" src="chrome://global/skin/icons/information-32.png"/>
<vbox>
<description flex="1">&connectionInfoDesc.label;</description>
@ -192,17 +192,18 @@
</vbox>
</hbox>
<separator class="thin"/>
<separator id="connectionGroupSeparator" class="thin"/>
<hbox align="center" id="purpleConnectionBox">
<description flex="1" control="connectionSettingsPurple">&connectionAccountsDesc.label;</description>
<description flex="1" control="connectionSettingsPurple">&connectionLibpurpleDesc.label;</description>
<button id="connectionSettingsPurple" icon="network" label="&connectionSettings.label;"
accesskey="&connectionSettings.accesskey;"
oncommand="gAdvancedPane.showProxies();"/>
</hbox>
<hbox align="center" id="mozillaConnectionBox">
<description flex="1" control="connectionSettings">&connectionOtherDesc.label;</description>
<description id="mozConnLabelWithoutLibpurple" flex="1" control="connectionSettings">&connectionDesc.label;</description>
<description id="mozConnLabelWithLibpurple" flex="1" control="connectionSettings">&connectionOtherDesc.label;</description>
<button id="connectionSettings" icon="network" label="&connectionSettings.label;"
accesskey="&connectionSettings2.accesskey;"
oncommand="gAdvancedPane.showConnections();"/>

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

@ -37,7 +37,7 @@
<!ENTITY connectionDesc.label "Configure how &brandShortName; connects to the Internet">
<!ENTITY connectionInfoDesc.label "The two following parts will be merged in a later version.">
<!ENTITY connectionAccountsDesc.label "To connect accounts">
<!ENTITY connectionLibpurpleDesc.label "For libpurple-based accounts">
<!ENTITY connectionOtherDesc.label "For everything else (updates, addons, …)">
<!ENTITY connectionSettings.label "Settings…">
<!ENTITY connectionSettings.accesskey "e">

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

@ -30,7 +30,7 @@ var Core = {
// don't worry too much about this exception.
}
if (!Ci.purpleICoreService) {
if (!Ci.imICoreService) {
this._promptError("startupFailure.purplexpcomFileError");
return false;
}