This is just some static backup of the original site, don't expect every link to work!

source: chrome/content/v_identity/vI_prefDialog.xml @ 92fd25

ng_0.8ng_0.9
Last change on this file since 92fd25 was 8129a6, checked in by rene <just@…>, 12 years ago

changed to show all listitems to construct all checkboxes before dialog is shown

  • Property mode set to 100644
File size: 5.4 KB
Line 
1<?xml version="1.0"?>
2<!-- ***** BEGIN LICENSE BLOCK *****
3   - This program is free software; you can redistribute it and/or modify
4   - it under the terms of the GNU General Public License as published by
5   - the Free Software Foundation; either version 2 of the License, or
6   - (at your option) any later version.
7
8   - This program is distributed in the hope that it will be useful,
9   - but WITHOUT ANY WARRANTY; without even the implied warranty of
10   - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11   - GNU General Public License for more details.
12
13   - You should have received a copy of the GNU General Public License
14   - along with this program; if not, write to the Free Software
15   - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
16
17   - The Original Code is the Virtual Identity Extension.
18
19   - The Initial Developer of the Original Code is Rene Ejury.
20   - Portions created by the Initial Developer are Copyright (C) 2007
21   - the Initial Developer. All Rights Reserved.
22
23   - Contributor(s):
24   - ***** END LICENSE BLOCK ***** -->
25
26<bindings id="prefDialogBindings"
27          xmlns="http://www.mozilla.org/xbl"
28          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
29          xmlns:xbl="http://www.mozilla.org/xbl">
30   
31    <binding id="identitySelector" extends="chrome://global/content/bindings/listbox.xml#listbox">
32    <implementation>
33    <constructor>
34        <![CDATA[
35        if (vI_notificationBar) vI_notificationBar.dump("## identitySelector: constructor\n");
36        var AccountManager = Components.classes["@mozilla.org/messenger/account-manager;1"]
37            .getService(Components.interfaces.nsIMsgAccountManager);
38        var debugNotes = vI_prefDialog.preferences.getBoolPref("debug_notification");
39
40        for (let i = AccountManager.accounts.Count() - 1; i >= 0 ; i--) {
41            var account = AccountManager.accounts.QueryElementAt(i, Components.interfaces.nsIMsgAccount);
42            for (let j = account.identities.Count() - 1; j >= 0 ; j--) {
43                var identity = account.identities.QueryElementAt(j, Components.interfaces.nsIMsgIdentity);
44                const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
45                var listitem = document.createElementNS(XUL_NS, "listitem"); // create a new XUL listitem
46                listitem.setAttribute("class", "selectorListitem");
47                listitem.setAttribute("label", identity.identityName);
48                listitem.setAttribute("value", identity.key);
49                listitem.setAttribute("description", " - " + account.incomingServer.prettyName);
50                listitem.setAttribute("debugNotesHidden", !debugNotes);
51                if (this.firstChild) this.insertBefore(listitem, this.firstChild);      // ensure that new elements are visible
52                else this.appendChild(listitem);                                        // otherwise checkbox will not be initialized
53            }
54        }
55        if (debugNotes)
56            document.getAnonymousElementByAttribute(this, "id", "ignoreIDs_debug").removeAttribute("hidden")
57        ]]>
58    </constructor>
59    <property name="value" >
60        <setter><![CDATA[
61        if (vI_notificationBar) vI_notificationBar.dump("## identitySelector: setting value to '" + val + "'\n");
62        var listItems = this.childNodes;
63        for (var index = 0; index < listItems.length; index++) {
64            var key = listItems[index].getAttribute("value");
65            listItems[index].checked = (val.indexOf(":" + key + ":") == -1);
66            if (vI_notificationBar) vI_notificationBar.dump("## identitySelector: setting value, '" + listItems[index].getAttribute("value") + "' '" + listItems[index].checked + "' '" + listItems[index].getAttribute("checked") + "'\n")
67        }
68        this._value = val;
69        ]]></setter>
70        <getter><![CDATA[
71        if (vI_notificationBar) vI_notificationBar.dump("## identitySelector: getting value\n");
72        var returnVal = "";
73        var listItems = this.childNodes;
74        for (var index = 0; index < listItems.length; index++) {
75            if (vI_notificationBar) vI_notificationBar.dump("## identitySelector: getting value, '" + listItems[index].getAttribute("value") + "' '" + listItems[index].checked + "' '" + listItems[index].getAttribute("checked") + "'\n");
76            if (!listItems[index].checked) returnVal += " :" + listItems[index].getAttribute("value") + ": "
77        }
78        if (vI_notificationBar) vI_notificationBar.dump("## identitySelector: getting value, result '" + returnVal + "'\n");
79        return returnVal;
80        ]]></getter>       
81    </property>
82    </implementation>
83    </binding>
84
85    <binding id="selectorListitem" extends="chrome://global/content/bindings/listbox.xml#listitem">
86    <content allowevents="true">
87        <xul:checkbox anonid="selector_checkbox" />
88        <xul:label class="menupopup_clone-text" xbl:inherits="value=label,accesskey,crop" />
89        <xul:label class="menupopup_clone-description" anonid="debugNote" xbl:inherits="value=value, hidden=debugNotesHidden" hidden="true" />
90        <xul:label class="menupopup_clone-description" xbl:inherits="value=description" flex="1" />
91    </content>
92    <implementation>
93    <property name="checked" onget="return this._checkbox.checked;" onset="this._checkbox.checked = val;" />
94    <field name="_checkbox">document.getAnonymousElementByAttribute(this, "anonid", "selector_checkbox")</field>
95    </implementation>
96    </binding>
97
98</bindings>
Note: See TracBrowser for help on using the repository browser.