Changeset 8129a6


Ignore:
Timestamp:
Oct 29, 2010, 1:34:57 AM (10 years ago)
Author:
rene <just@…>
Branches:
ng_0.6, ng_0.8, ng_0.9
Children:
f17ef92
Parents:
a6e3c3
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_prefDialog.xml

    ra6e3c3 r8129a6  
    3636        var AccountManager = Components.classes["@mozilla.org/messenger/account-manager;1"]
    3737            .getService(Components.interfaces.nsIMsgAccountManager);
    38         for (let i = 0; i < AccountManager.accounts.Count(); i++) {
     38        var debugNotes = vI_prefDialog.preferences.getBoolPref("debug_notification");
     39
     40        for (let i = AccountManager.accounts.Count() - 1; i >= 0 ; i--) {
    3941            var account = AccountManager.accounts.QueryElementAt(i, Components.interfaces.nsIMsgAccount);
    40             for (let j = 0; j < account.identities.Count(); j++) {
     42            for (let j = account.identities.Count() - 1; j >= 0 ; j--) {
    4143                var identity = account.identities.QueryElementAt(j, Components.interfaces.nsIMsgIdentity);
    4244                const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
     
    4648                listitem.setAttribute("value", identity.key);
    4749                listitem.setAttribute("description", " - " + account.incomingServer.prettyName);
    48                 this.appendChild(listitem);
     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
    4953            }
    5054        }
     55        if (debugNotes)
     56            document.getAnonymousElementByAttribute(this, "id", "ignoreIDs_debug").removeAttribute("hidden")
    5157        ]]>
    5258    </constructor>
     
    5763        for (var index = 0; index < listItems.length; index++) {
    5864            var key = listItems[index].getAttribute("value");
    59             listItems[index].checked = (val.indexOf(key) == -1);
     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")
    6067        }
    6168        this._value = val;
     
    6774        for (var index = 0; index < listItems.length; index++) {
    6875            if (vI_notificationBar) vI_notificationBar.dump("## identitySelector: getting value, '" + listItems[index].getAttribute("value") + "' '" + listItems[index].checked + "' '" + listItems[index].getAttribute("checked") + "'\n");
    69             if (!listItems[index].checked) returnVal += listItems[index].getAttribute("value") + " "
     76            if (!listItems[index].checked) returnVal += " :" + listItems[index].getAttribute("value") + ": "
    7077        }
    7178        if (vI_notificationBar) vI_notificationBar.dump("## identitySelector: getting value, result '" + returnVal + "'\n");
     
    7986    <content allowevents="true">
    8087        <xul:checkbox anonid="selector_checkbox" />
    81         <xul:label class="menupopup_clone-text" xbl:inherits="value=label,accesskey,crop" flex="1"/>
    82         <xul:label class="menupopup_clone-description" xbl:inherits="value=value" />
    83         <xul:label class="menupopup_clone-description" xbl:inherits="value=description" />
     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" />
    8491    </content>
    8592    <implementation>
    86     <property name="checked" onget="return this._checkbox.getAttribute('checked');" onset="if (val) this._checkbox.setAttribute('checked', val); else this._checkbox.removeAttribute('checked');" />
     93    <property name="checked" onget="return this._checkbox.checked;" onset="this._checkbox.checked = val;" />
    8794    <field name="_checkbox">document.getAnonymousElementByAttribute(this, "anonid", "selector_checkbox")</field>
    8895    </implementation>
Note: See TracChangeset for help on using the changeset viewer.