Ignore:
Timestamp:
Nov 22, 2011, 1:58:55 PM (10 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
6c9403
Parents:
f98bd5
Message:

continue to change pref-usage into module (nearly done)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • content/bindings/v_identity.xml

    rf98bd5 rca4823  
    172172                <xul:menupopup anonid="smtp_server_list_popup" />
    173173            </xul:menulist>
    174             <xul:checkbox  id="saveSMTPSwitch" class="vI_plain" allowevents="true" oncommand="event.stopPropagation();virtualIdentityExtension.statusmenu.changeSMTPStatus(this);" >
     174            <xul:checkbox  id="saveSMTPSwitch" class="vI_plain" allowevents="true" oncommand="event.stopPropagation();virtualIdentityExtension.vIprefs.set('storage_store_SMTP', this.checked);" >
    175175                <xul:observes element="virtualIdentityExtension_statusMenu_storage_saveSMTP" attribute="checked" />
    176176                <xul:observes element="virtualIdentityExtension_statusMenu_storage_saveSMTP" attribute="disabled" />
     
    288288                <xul:spacer flex="1" /></xul:vbox>
    289289                <xul:vbox id="saveSwitch"><xul:spacer flex="1" />
    290                     <xul:checkbox class="vI_plain" allowevents="true" oncommand="event.stopPropagation();virtualIdentityExtension.statusmenu.changeSaveStatus(this);" >
     290                    <xul:checkbox class="vI_plain" allowevents="true" oncommand="event.stopPropagation();virtualIdentityExtension.vIprefs.set('storage_store', this.checked);" >
    291291                        <xul:observes element="virtualIdentityExtension_statusMenu_storage_save" attribute="checked" />
    292292                    </xul:checkbox>
     
    305305                <xul:spacer flex="1" /></xul:vbox>
    306306                <xul:vbox id="saveBaseIDSwitch"><xul:spacer flex="1" />
    307                     <xul:checkbox class="vI_plain" allowevents="true" oncommand="event.stopPropagation();virtualIdentityExtension.statusmenu.changeBaseIDStatus(this);" >
     307                    <xul:checkbox class="vI_plain" allowevents="true" oncommand="event.stopPropagation();virtualIdentityExtension.vIprefs.set('storage_store_base_id', this.checked);" >
    308308                        <xul:observes element="virtualIdentityExtension_statusMenu_storage_saveBaseID" attribute="checked" />
    309309                        <xul:observes element="virtualIdentityExtension_statusMenu_storage_saveBaseID" attribute="disabled" />
     
    330330        // document.getElementById("virtualIdentityExtension_tooltipPopupset").addTooltip(this, false);
    331331       
    332         this._prefroot.addObserver("extensions.virtualIdentity.show_smtp", this._observer, false);
    333         this._observer.observe();
     332        virtualIdentityExtension.vIprefs.addObserver("extensions.virtualIdentity.show_smtp", this.observe, this);
     333        this.observe(this);
    334334        ]]>
    335335    </constructor>
     
    338338        var tooltipPopupset = document.getElementById("virtualIdentityExtension_tooltipPopupset")
    339339        if (tooltipPopupset) tooltipPopupset.removeTooltip(this.tooltipElem.getAttribute("tooltip"));
    340         this._prefroot.removeObserver("extensions.virtualIdentity.show_smtp", this._observer);
    341         ]]>
     340        virtualIdentityExtension.vIprefs.removeObserver("extensions.virtualIdentity.show_smtp", this.observe);
     341        ]]>
    342342    </destructor>
    343343
     
    588588        .getService(Components.interfaces.nsIPrefService)
    589589        .getBranch(null).QueryInterface(Components.interfaces.nsIPrefBranch2)</field>
    590     <field name="_observer"><![CDATA[({
    591         _self: this,
    592             observe: function(aSubject, aTopic, aPrefName) {
    593             if (this._self._prefroot)
    594                 this._self.showSmtp =
    595                 this._self._prefroot.getBoolPref("extensions.virtualIdentity.show_smtp");
    596                 var MenuItems = this._self._popupElem.childNodes;
    597                 for (var j = 0; j < MenuItems.length; j++) {
    598                     if (MenuItems[j].localName == "menuseparator") continue;
    599                     MenuItems[j].smtpStyle = "width:" + document.getElementById("smtp_server_list").clientWidth + "px;";
    600                 }
    601         }
    602         })]]></field>
     590    <method name="observe">
     591      <parameter name="self" />
     592      <parameter name="aSubject" />
     593      <parameter name="aTopic" />
     594      <parameter name="aPrefName" />
     595      <![CDATA[
     596        self.showSmtp =
     597          virtualIdentityExtension.vIprefs.get("show_smtp");
     598        var MenuItems = self._popupElem.childNodes;
     599        for (var j = 0; j < MenuItems.length; j++) {
     600            if (MenuItems[j].localName == "menuseparator") continue;
     601            MenuItems[j].smtpStyle = "width:" + document.getElementById("smtp_server_list").clientWidth + "px;";
     602        }
     603    ]]></method>
    603604    <property name="email" onset="this.identityData.email = val; this.label = this.identityData.combinedName; this.inputEvent()" />
    604605    <property name="vid" onget="return (this.getAttribute('vid') == 'true');" onset="this.setAttribute('vid',val?'true':'false'); return val;" />
Note: See TracChangeset for help on using the changeset viewer.