update proxy preferences without a restart (thanks Sean)

This commit is contained in:
Simon Kornblith 2008-07-28 22:12:11 +00:00
parent ce210afe2d
commit 17c3d1cc34
2 changed files with 14 additions and 9 deletions

View file

@ -1118,4 +1118,15 @@ function refreshProxyList() {
document.getElementById('proxyTree').currentIndex = -1;
document.getElementById('proxyTree-delete').disabled = true;
document.getElementById('zotero-proxies-autoRecognize').checked = Zotero.Prefs.get("proxies.autoRecognize");
document.getElementById('zotero-proxies-transparent').checked = Zotero.Prefs.get("proxies.transparent");
}
/**
* Updates proxy autoRecognize and transparent settings based on checkboxes
*/
function updateProxyPrefs() {
Zotero.Prefs.set("proxies.autoRecognize", document.getElementById('zotero-proxies-autoRecognize').checked);
Zotero.Prefs.set("proxies.transparent", document.getElementById('zotero-proxies-transparent').checked);
Zotero.Proxies.init()
}

View file

@ -357,18 +357,12 @@ To add a new preference:
<prefpane id="zotero-prefpane-proxies"
label="&zotero.preferences.prefpane.proxies;"
image="chrome://zotero/skin/prefs-proxies.png">
<preferences>
<preference id="pref-proxies-autoRecognize" name="extensions.zotero.proxies.autoRecognize" type="bool"/>
<preference id="pref-proxies-transparent" name="extensions.zotero.proxies.transparent" type="bool"/>
</preferences>
<groupbox>
<caption label="&zotero.preferences.proxies.proxyOptions;"/>
<command id="zotero-proxies-update" oncommand="updateProxyPrefs()"/>
<checkbox id="zotero-proxies-autoRecognize" label="&zotero.preferences.proxies.autoRecognize;"
preference="pref-proxies-autoRecognize" oncommand="Zotero.Proxies.init()"/>
command="zotero-proxies-update"/>
<checkbox id="zotero-proxies-transparent" label="&zotero.preferences.proxies.transparent;"
preference="pref-proxies-transparent" oncommand="Zotero.Proxies.init()"/>
command="zotero-proxies-update"/>
</groupbox>
<groupbox flex="1">