Changeset ca4823


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

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

Files:
14 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;" />
  • content/prefDialog/vI_prefDialog.js

    rf98bd5 rca4823  
    9595                "VIdent_identity.hide_openPGP_messageSignature",
    9696                "VIdent_identity.storage",
    97                 "VIdent_identity.storage_storedefault",
     97                "VIdent_identity.storage_store",
    9898                "VIdent_identity.storage_store_base_id",
    9999                "VIdent_identity.storage_store_SMTP",
     
    258258        storageConstraint : function(element) {
    259259            var mAttr = prefDialog.base.modifyAttribute;
    260             mAttr("VIdent_identity.storage_storedefault","disabled",element.checked);
     260            mAttr("VIdent_identity.storage_store","disabled",element.checked);
    261261            mAttr("VIdent_identity.storage_store_base_id","disabled",element.checked);
    262262            mAttr("VIdent_identity.storage_store_SMTP","disabled",element.checked);
  • content/prefDialog/vI_prefDialog.xul

    rf98bd5 rca4823  
    609609                <caption label="&vI_prefDialog.storageTab.storing.caption;"/>
    610610                <vbox align="left">
    611                     <checkbox id="VIdent_identity.storage_storedefault" label="&vI_prefDialog.storage.storedefault.label;"
    612                         prefstring="storage_storedefault"/>
     611                    <checkbox id="VIdent_identity.storage_store" label="&vI_prefDialog.storage.storedefault.label;"
     612                        prefstring="storage_store"/>
    613613                    <checkbox id="VIdent_identity.storage_store_base_id" label="&vI_prefDialog.storage.store_base_id.label;"
    614614                        prefstring="storage_store_base_id"/>
  • content/vI_msgIdentityCloneTools.js

    rf98bd5 rca4823  
    5151            Log.debug("signatureSwitch hide/remove signatures\n");
    5252            // code to hide the text signature
    53             try { if (vI.vIpref.get("hide_signature") && ss_signature.length == 0) {
     53            try { if (vI.vIprefs.get("hide_signature") && ss_signature.length == 0) {
    5454                Log.debug("hide text/html signature");
    5555                ss_main.signatureSwitch()
     
    5757            } } catch(vErr) { Log.debug(" -- missing signatureSwitch extension?\n"); };
    5858            // code to hide the sMime signature
    59             try { if (vI.vIpref.get("hide_sMime_messageSignature")) {
     59            try { if (vI.vIprefs.get("hide_sMime_messageSignature")) {
    6060                var element = document.getElementById("menu_securitySign1");
    6161                if (element.getAttribute("checked") == "true") {
     
    6767            } catch(vErr) { };
    6868            // code to hide the openGPG signature
    69             try { if (vI.vIpref.get("hide_openPGP_messageSignature")) {
     69            try { if (vI.vIprefs.get("hide_openPGP_messageSignature")) {
    7070                var element = document.getElementById("enigmail_signed_send");
    7171                if (element.getAttribute("checked") == "true") {
     
    102102   
    103103    initReplyTo : function() {
    104         if (vI.statusmenu.prefroot.getBoolPref("extensions.virtualIdentity.autoReplyToSelf")) {
     104        if (vI.vIprefs.get("autoReplyToSelf")) {
    105105            document.getElementById("virtualIdentityExtension_autoReplyToSelfLabel").removeAttribute("hidden");
    106106            msgIdentityCloneTools.removeAllReplyTos();
  • content/vI_rdfDataEditor.js

    rf98bd5 rca4823  
    105105      rdfDataEditor.__identityData.extras.loopThroughExtras(
    106106        function(extra) {
    107           var hidden = hide && !vI.vIpref.get(extra.option);
     107          var hidden = hide && !vI.vIprefs.get(extra.option);
    108108          document.getElementById("vI_" + extra.option).setAttribute("hidden", hidden)
    109109          document.getElementById("vI_" + extra.option + "_store").setAttribute("hidden", hidden)
  • content/vI_smartIdentity.js

    rf98bd5 rca4823  
    103103        Log.debug("__smartIdentitySelection autocreate=" + autocreate + "\n");
    104104       
    105         if (vI.vIpref.get("idSelection_preferExisting")) {
     105        if (vI.vIprefs.get("idSelection_preferExisting")) {
    106106            var existingIDIndex = smartIdentity._smartIdentityCollection._foundExistingIdentity();
    107107            if (existingIDIndex) {
     
    117117        Log.debug("__smartIdentitySelection smartIdentity._smartIdentityCollection._allIdentities.number=" +
    118118                smartIdentity._smartIdentityCollection._allIdentities.number +
    119                 " vI.vIpref.get('idSelection_ask_always')=" +
    120                 vI.vIpref.get("idSelection_ask_always") +
    121                 " vI.vIpref.get('idSelection_ask')=" +
    122                 vI.vIpref.get("idSelection_ask") + "\n");
    123         if (!autocreate && vI.vIpref.get("idSelection_ask") &&
    124             ((smartIdentity._smartIdentityCollection._allIdentities.number == 1 && vI.vIpref.get("idSelection_ask_always"))
     119                " vI.vIprefs.get('idSelection_ask_always')=" +
     120                vI.vIprefs.get("idSelection_ask_always") +
     121                " vI.vIprefs.get('idSelection_ask')=" +
     122                vI.vIprefs.get("idSelection_ask") + "\n");
     123        if (!autocreate && vI.vIprefs.get("idSelection_ask") &&
     124            ((smartIdentity._smartIdentityCollection._allIdentities.number == 1 && vI.vIprefs.get("idSelection_ask_always"))
    125125                || smartIdentity._smartIdentityCollection._allIdentities.number > 1)) {
    126126            for (var index = 0; index < smartIdentity._smartIdentityCollection._allIdentities.number; index++) {
     
    133133                    /* callback: */ smartIdentity.changeIdentityToSmartIdentity).focus();
    134134        }
    135         else if (autocreate || vI.vIpref.get("idSelection_autocreate")) {
     135        else if (autocreate || vI.vIprefs.get("idSelection_autocreate")) {
    136136            smartIdentity.changeIdentityToSmartIdentity(smartIdentity._smartIdentityCollection._allIdentities, 0);
    137137        }   
     
    153153   
    154154    __removeSmartIdentityFromRecipients : function(allIdentities, index) {
    155         if (!vI.vIpref.get("idSelection_removeSmartIdentityFromRecipients")) return;
     155        if (!vI.vIprefs.get("idSelection_removeSmartIdentityFromRecipients")) return;
    156156       
    157157        // check if selected email is defined as doBcc address. If so, it should not be removed.
  • content/vI_statusmenu.js

    rf98bd5 rca4823  
    2525Components.utils.import("resource://v_identity/vI_nameSpaceWrapper.js");
    2626virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     27
     28let Log = vI.setupLogging("virtualIdentity.statusmenu");
    2729
    2830Components.utils.import("resource://v_identity/vI_prefs.js", virtualIdentityExtension);
     
    4042   
    4143    observe: function(self, subject, topic, data) {
     44//         Log.debug("statusmenu observe " + data + "\n");
    4245        switch (data) {
    4346            case "fcc_show_switch":
     
    4548                // no break, continue like with doFcc           
    4649            case "doFcc":
    47                 statusmenu.objFccSwitch.setAttribute("checked", vI.vIprefs.get("doFcc"));
     50                statusmenu.objFccSwitch.setAttribute("checked", vI.vIprefs.get(data));
    4851                break;
    4952            case "storage_show_switch":
     
    5457                break;
    5558            case "storage_show_SMTP_switch":
     59//                 Log.debug("changed storage_show_SMTP_switch to " + statusmenu.objSaveSMTPMenuItem + "=" + vI.vIprefs.get(data) + "\n");
    5660                statusmenu.objSaveSMTPSwitch.setAttribute("hidden", !vI.vIprefs.get(data));
    5761                break;
    58             case "storage_storedefault":
    59                 statusmenu.objStorageSaveMenuItem.setAttribute("checked", vI.vIprefs.get("storage_storedefault"));
     62            case "storage_store":
     63                statusmenu.objStorageSaveMenuItem.setAttribute("checked", vI.vIprefs.get(data));
    6064                break;
    6165            case "storage_store_base_id":
     
    6367                break;
    6468            case "storage_store_SMTP":
     69//                 Log.debug("changed storage_store_SMTP to " + statusmenu.objSaveSMTPMenuItem + "=" + vI.vIprefs.get(data) + "\n");
    6570                statusmenu.objSaveSMTPMenuItem.setAttribute("checked", vI.vIprefs.get(data));
     71//                 Log.debug("changed storage_store_SMTP done\n");
    6672                break;
    6773            case "storage_colorIndication":
     
    96102        vI.vIprefs.addObserver("storage_show_SMTP_switch", this.observe, this);
    97103        vI.vIprefs.addObserver("storage_colorIndication", this.observe, this);
    98         vI.vIprefs.addObserver("storage_storedefault", this.observe, this);
     104        vI.vIprefs.addObserver("storage_store", this.observe, this);
    99105        vI.vIprefs.addObserver("storage_store_base_id", this.observe, this);
    100106        vI.vIprefs.addObserver("storage_store_SMTP", this.observe, this);
     
    109115        vI.vIprefs.removeObserver("storage_show_SMTP_switch", this.observe);
    110116        vI.vIprefs.removeObserver("storage_colorIndication", this.observe);
    111         vI.vIprefs.removeObserver("storage_storedefault", this.observe);
     117        vI.vIprefs.removeObserver("storage_store", this.observe);
    112118        vI.vIprefs.removeObserver("storage_store_base_id", this.observe);
    113119        vI.vIprefs.removeObserver("storage_store_SMTP", this.observe);
     
    136142        statusmenu.observe(this, null, null, "storage_store_base_id");
    137143        statusmenu.observe(this, null, null, "storage_store_SMTP");
    138         statusmenu.observe(this, null, null, "storage_storedefault");
     144        statusmenu.observe(this, null, null, "storage_store");
    139145        statusmenu.observe(this, null, null, "storage");
    140146    },
     
    203209        if (!vI.vIprefs.get("storage")) return;
    204210
    205         var curSaveStatus = (statusmenu.objStorageSaveMenuItem.getAttribute("checked") == "true");
    206         var curSaveSMTPStatus = (statusmenu.objSaveSMTPMenuItem.getAttribute("checked") == "true");
    207         var curSaveBaseIDStatus = (statusmenu.objSaveBaseIDMenuItem.getAttribute("checked") == "true");
     211        var curSaveStatus = vI.vIprefs.get("storage_store")
     212        var curSaveSMTPStatus = vI.vIprefs.get("storage_store_SMTP")
     213        var curSaveBaseIDStatus = vI.vIprefs.get("storage_store_base_id")
    208214        var newSaveStatus = ((!curSaveStatus) || (curSaveStatus && !curSaveSMTPStatus) || (curSaveStatus && !curSaveBaseIDStatus))
    209215        var newSaveSMTPStatus = ((!curSaveSMTPStatus && curSaveStatus) || (curSaveBaseIDStatus && !curSaveSMTPStatus))
    210216        var newSaveBaseIDStatus = ((curSaveSMTPStatus && curSaveStatus && !curSaveBaseIDStatus) || (curSaveBaseIDStatus && !curSaveSMTPStatus))
    211         statusmenu.objStorageSaveMenuItem.setAttribute("checked", newSaveStatus)
    212         statusmenu.objSaveSMTPMenuItem.setAttribute("checked", newSaveSMTPStatus)
    213         statusmenu.objSaveBaseIDMenuItem.setAttribute("checked", newSaveBaseIDStatus)
     217       
     218        vI.vIprefs.set("storage_store", newSaveStatus)
     219        vI.vIprefs.set("storage_store_SMTP", newSaveSMTPStatus)
     220        vI.vIprefs.set("storage_store_base_id", newSaveBaseIDStatus)
    214221       
    215222        statusmenu.menuConstraint();
  • content/v_identity.js

    rf98bd5 rca4823  
    144144            var virtualIdentityData = document.getElementById("virtualIdentityExtension_msgIdentityClone").identityData;
    145145           
    146             returnValue = vI.vIaccount_prepareSendMsg(  vid, msgType, virtualIdentityData,
     146            let returnValue = vI.vIaccount_prepareSendMsg(  vid, msgType, virtualIdentityData,
    147147                            main.accountManager.getIdentity(main.elements.Obj_MsgIdentity.value),
    148148                            main._getRecipients() );
  • content/v_identity.xul

    rf98bd5 rca4823  
    6666    <checkbox id="virtualIdentityExtension_fccSwitch" label="&vident.composeDialog.fcc_switch.label;"
    6767        tooltiptext="&vident.composeDialog.fcc_switch.tooltiptext;" hidden="true" doFcc="false"
    68         oncommand="if (this.doFcc == this.checked) this.checked = !(this.checked); this.doFcc = this.checked;" />
     68        oncommand="virtualIdentityExtension.vIprefs.set('doFcc', this.checked);" />
    6969    <popupset id="virtualIdentityExtension_tooltipPopupset" />
    7070</hbox>
     
    7474      <menupopup id="virtualIdentityExtension_statusMenu">
    7575          <menuitem type="checkbox" id="virtualIdentityExtension_statusMenu_storage_save" label="&vident.vI_Menu.storageSave.label;"
    76             oncommand="virtualIdentityExtension.statusmenu.menuConstraint(this);"/>
     76            oncommand="virtualIdentityExtension.vIprefs.set('storage_store', (this.getAttribute('checked') == 'true'));"/>
    7777          <menuitem type="checkbox" id="virtualIdentityExtension_statusMenu_storage_saveBaseID" label="&vident.vI_Menu.saveBaseID.label;"
    78             oncommand="virtualIdentityExtension.statusmenu.menuConstraint(virtualIdentityExtension.statusmenu.objStorageSaveMenuItem);"/>
     78            oncommand="virtualIdentityExtension.vIprefs.set('storage_store_base_id', (this.getAttribute('checked') == 'true'));"/>
    7979          <menuitem type="checkbox" id="virtualIdentityExtension_statusMenu_storage_saveSMTP" label="&vident.vI_Menu.saveSMTP.label;"
    80             oncommand="virtualIdentityExtension.statusmenu.menuConstraint(virtualIdentityExtension.statusmenu.objStorageSaveMenuItem);"/>
     80            oncommand="virtualIdentityExtension.vIprefs.set('storage_store_SMTP', (this.getAttribute('checked') == 'true'));"/>
    8181          <menuseparator id="virtualIdentityExtension_statusMenu_separator" />
    8282          <menuitem class="menuitem-iconic" label="&vident.vI_Menu.Settings.label;"
  • defaults/preferences/preferences.js

    rf98bd5 rca4823  
    3535pref("extensions.virtualIdentity.hide_openPGP_messageSignature", false);
    3636pref("extensions.virtualIdentity.storage", true);
    37 pref("extensions.virtualIdentity.storage_storedefault", true);
     37pref("extensions.virtualIdentity.storage_store", true);
    3838pref("extensions.virtualIdentity.storage_store_base_id", false);
    3939pref("extensions.virtualIdentity.storage_store_SMTP", false);
  • modules/vI_account.js

    rf98bd5 rca4823  
    5959            return { update : "abort", storedIdentity : null }; // completely abort sending
    6060        }
    61 //      if (vIprefs.get("storage") &&
    62 //              (!vI.statusmenu || vI.statusmenu.objStorageSaveMenuItem.getAttribute("checked") == "true")) {
    63         if (vIprefs.get("storage")) {
     61        if (vIprefs.get("storage") && vIprefs.get("storage_store")) {
    6462            var localeDatasourceAccess = new rdfDatasourceAccess();
    6563            var returnValue = localeDatasourceAccess.storeVIdentityToAllRecipients(identityData, recipients)
     
    333331    _setupFcc : function()
    334332    {
    335         // fcc_switch is only available in modified ComposeDialog.
    336         // XXXXX get rid of this Elem reference
    337         var doFcc = true;
    338         try { doFcc = document.getElementById("fcc_switch").getAttribute("checked") } catch(e) { }
    339         if (doFcc) {
    340             switch (vIprefs.get("fccFolderPickerMode"))
    341             {
    342                 case "2"  :
    343                 Log.debug ("preparing Fcc --- use Settings of Default Account\n");
    344                 account._account.defaultIdentity.doFcc = account._AccountManager.defaultAccount.defaultIdentity.doFcc;
    345                 account._account.defaultIdentity.fccFolder = account._AccountManager.defaultAccount.defaultIdentity.fccFolder;
    346                 account._account.defaultIdentity.fccFolderPickerMode = account._AccountManager.defaultAccount.defaultIdentity.fccFolderPickerMode;
    347                 account._account.defaultIdentity.fccReplyFollowsParent = account._AccountManager.defaultAccount.defaultIdentity.fccReplyFollowsParent;
    348                 break;
    349                 case "3"  :
    350                 Log.debug ("preparing Fcc --- use Settings of Modified Account\n");
    351                 account._account.defaultIdentity.doFcc = account._baseIdentity.doFcc;
    352                 account._account.defaultIdentity.fccFolder = account._baseIdentity.fccFolder;
    353                 account._account.defaultIdentity.fccFolderPickerMode = account._baseIdentity.fccFolderPickerMode;
    354                 account._account.defaultIdentity.fccReplyFollowsParent = account._baseIdentity.fccReplyFollowsParent;
    355                 break;
    356                 default  :
    357                 Log.debug ("preparing Fcc --- use Virtual Identity Settings\n");
    358                 account._account.defaultIdentity.doFcc
    359                     = vIprefs.get("doFcc");
    360                 account._account.defaultIdentity.fccFolder
    361                     = account._unicodeConverter.ConvertToUnicode(vIprefs.get("fccFolder"));
    362                 account._account.defaultIdentity.fccFolderPickerMode
    363                     = vIprefs.get("fccFolderPickerMode");
    364                 account._account.defaultIdentity.fccReplyFollowsParent = vIprefs.get("fccReplyFollowsParent");
    365 
    366                 break;
    367             }
    368         }
    369         else {
    370             dump ("dont performing Fcc\n");
    371             account._account.defaultIdentity.doFcc = false;
    372         }
    373         Log.debug("Stored (doFcc " + account._account.defaultIdentity.doFcc + " fccFolder " +
    374             account._account.defaultIdentity.fccFolder + " fccFolderPickerMode " +
    375             account._account.defaultIdentity.fccFolderPickerMode + "(" +
    376             vIprefs.get("fccFolderPickerMode") + "))\n");
     333      if (vIprefs.get("doFcc")) {
     334          switch (vIprefs.get("fccFolderPickerMode"))
     335          {
     336              case "2"  :
     337              Log.debug ("preparing Fcc --- use Settings of Default Account\n");
     338              account._account.defaultIdentity.doFcc = account._AccountManager.defaultAccount.defaultIdentity.doFcc;
     339              account._account.defaultIdentity.fccFolder = account._AccountManager.defaultAccount.defaultIdentity.fccFolder;
     340              account._account.defaultIdentity.fccFolderPickerMode = account._AccountManager.defaultAccount.defaultIdentity.fccFolderPickerMode;
     341              account._account.defaultIdentity.fccReplyFollowsParent = account._AccountManager.defaultAccount.defaultIdentity.fccReplyFollowsParent;
     342              break;
     343              case "3"  :
     344              Log.debug ("preparing Fcc --- use Settings of Modified Account\n");
     345              account._account.defaultIdentity.doFcc = account._baseIdentity.doFcc;
     346              account._account.defaultIdentity.fccFolder = account._baseIdentity.fccFolder;
     347              account._account.defaultIdentity.fccFolderPickerMode = account._baseIdentity.fccFolderPickerMode;
     348              account._account.defaultIdentity.fccReplyFollowsParent = account._baseIdentity.fccReplyFollowsParent;
     349              break;
     350              default  :
     351              Log.debug ("preparing Fcc --- use Virtual Identity Settings\n");
     352              account._account.defaultIdentity.doFcc
     353                  = vIprefs.get("doFcc");
     354              account._account.defaultIdentity.fccFolder
     355                  = account._unicodeConverter.ConvertToUnicode(vIprefs.get("fccFolder"));
     356              account._account.defaultIdentity.fccFolderPickerMode
     357                  = vIprefs.get("fccFolderPickerMode");
     358              account._account.defaultIdentity.fccReplyFollowsParent = vIprefs.get("fccReplyFollowsParent");
     359
     360              break;
     361          }
     362      }
     363      else {
     364          dump ("dont performing Fcc\n");
     365          account._account.defaultIdentity.doFcc = false;
     366      }
     367      Log.debug("Stored (doFcc " + account._account.defaultIdentity.doFcc + " fccFolder " +
     368          account._account.defaultIdentity.fccFolder + " fccFolderPickerMode " +
     369          account._account.defaultIdentity.fccFolderPickerMode + "(" +
     370          vIprefs.get("fccFolderPickerMode") + "))\n");
    377371    },
    378372   
  • modules/vI_identityData.js

    rf98bd5 rca4823  
    3030Components.utils.import("resource://v_identity/vI_log.js");
    3131let Log = setupLogging("virtualIdentity.identityData");
     32Components.utils.import("resource://v_identity/vI_prefs.js");
     33
    3234Components.utils.import("resource://v_identity/vI_identityDataExtras.js");
    3335Components.utils.import("resource://v_identity/identityDataExtras/returnReceipt.js");
     
    6163}
    6264identityData.prototype = {
    63     _prefroot : Components.classes["@mozilla.org/preferences-service;1"]
    64         .getService(Components.interfaces.nsIPrefService)
    65         .getBranch(null),
    66 
    67     _pref : Components.classes["@mozilla.org/preferences-service;1"]
    68         .getService(Components.interfaces.nsIPrefService)
    69         .getBranch("extensions.virtualIdentity."),
    70 
    7165    _email : null,          // internal email-field might contain combinedName (until first queried via email)
    7266    _fullName : null,
     
    157151        for (let i = 0; i < AccountManager.accounts.Count(); i++) {
    158152            var account = AccountManager.accounts.QueryElementAt(i, Components.interfaces.nsIMsgAccount);
    159             try { this._prefroot.getBoolPref("mail.account."+account.key+".vIdentity"); continue; } catch (e) { };
     153            try { prefroot.getBoolPref("mail.account."+account.key+".vIdentity"); continue; } catch (e) { };
    160154            for (let j = 0; j < account.identities.Count(); j++) {
    161155                var identity = account.identities.QueryElementAt(j, Components.interfaces.nsIMsgIdentity);
     
    211205        const Items = Array("fullName", "email", "smtp", "id");
    212206        var string = "";
    213         var saveBaseId = this._pref.getBoolPref("storage_store_base_id");
    214         var saveSMTP = this._pref.getBoolPref("storage_store_SMTP");
    215 //         var saveBaseId = (!vI.statusmenu && this._pref.getBoolPref("storage_store_base_id")
    216 //              || vI.statusmenu.objSaveBaseIDMenuItem.getAttribute("checked") == "true")
    217 //      var saveSMTP = (!vI.statusmenu && this._pref.getBoolPref("storage_store_SMTP")
    218 //              || vI.statusmenu.objSaveSMTPMenuItem.getAttribute("checked") == "true")
    219         for each (let item in Items) {
     207        var saveBaseId = vIprefs.get("storage_store_base_id");
     208        var saveSMTP = vIprefs.get("storage_store_SMTP");
     209        for each (let item in Items) {
    220210            var classEqual = (this.comp.equals[item])?"equal":"unequal";
    221211            var classIgnore = (((!saveBaseId) && (item == "id")) || ((!saveSMTP) && (item == "smtp")))?" ignoreValues":""
  • modules/vI_prefs.js

    rf98bd5 rca4823  
    8181
    8282    get: function(aPrefName) {
    83       if (!this._localPrefs[aPrefName])
     83      if (!(aPrefName in this._localPrefs))
    8484        this._retrievePref(aPrefName);
    8585      return this._localPrefs[aPrefName];
    8686    },
    8787    set: function(aPrefName, aPrefValue) {
    88       if (!this._localPrefs[aPrefName])
     88      if (!(aPrefName in this._localPrefs))
    8989        this._retrievePref(aPrefName);
    9090      this._localPrefs[aPrefName] = aPrefValue;
     91//       Log.debug("changed pref " + aPrefName + " to " + aPrefValue + "\n")
    9192      for each (let [, prefObserver] in Iterator(this._localObservers)) {
    92         if (prefObserver.pref == aPrefName)
    93           prefObserver.observe(aPrefName);
     93//         Log.debug("check prefobserver " + prefObserver.pref + " against " + aPrefName + "\n")
     94        if (prefObserver.pref == aPrefName) {
     95          prefObserver.observe(prefObserver.context, aPrefValue, "nsPref:changed", aPrefName);
     96        }
    9497      }
    9598    },
     
    97100      if (aPrefValue)
    98101        this.set(aPrefName, aPrefValue);
    99       if (this._localPrefs[aPrefName])
     102      if (aPrefName in this._localPrefs)
    100103        this._storePref(aPrefName);
    101104    },
     
    105108    addObserver: function(aPrefName, aFunction, aSelf) {
    106109      this._localObservers.push({ pref: aPrefName, observe: aFunction, context: aSelf });
     110//       Log.debug("added observer for " + aPrefName + "\n");
    107111    },
    108112    removeObserver: function(aPrefName, aFunction) {
     
    119123      for each (let [, prefObserver] in Iterator(this._localObservers)) {
    120124        if (prefObserver.pref == aPrefName) {
    121           Log.debug("found observer, calling : " + prefObserver.observe + "\n")
     125//           Log.debug("found observer, calling : " + prefObserver.observe + "\n")
    122126          prefObserver.observe(prefObserver.context, subject, topic, aPrefName);
    123           Log.debug("found observer, calling : " + prefObserver.observe + " done\n")
     127//           Log.debug("found observer, calling : " + prefObserver.observe + " done\n")
    124128        }
    125129      }
  • modules/vI_rdfDatasource.js

    rf98bd5 rca4823  
    2828let Log = setupLogging("virtualIdentity.rdfDatasource");
    2929
     30Components.utils.import("resource://v_identity/vI_prefs.js");
    3031Components.utils.import("resource://v_identity/vI_identityData.js");
    3132Components.utils.import("resource://gre/modules/Services.jsm");
     
    8182            .createInstance(Components.interfaces.nsIRDFContainer),
    8283   
    83     _pref : Components.classes["@mozilla.org/preferences-service;1"]
    84         .getService(Components.interfaces.nsIPrefService)
    85         .getBranch("extensions.virtualIdentity."),
    86 
    8784    getContainer : function (type) {
    8885        switch (type) {
     
    762759        var recipient = this.__getDescriptionAndType(recipientName, recipientType)
    763760        this.updateRDF(recipient.recDesc, recipient.recType, identityData,
    764             this._pref.getBoolPref("storage_store_base_id"),
    765             this._pref.getBoolPref("storage_store_SMTP"),
     761            vIprefs.get("storage_store_base_id"),
     762            vIprefs.get("storage_store_SMTP"),
    766763            null, null);
    767 //      this.updateRDF(recipient.recDesc, recipient.recType, identityData,
    768 //          (!vI.statusmenu && this._pref.getBoolPref("storage_store_base_id")
    769 //              || vI.statusmenu.objSaveBaseIDMenuItem.getAttribute("checked") == "true"),
    770 //          (!vI.statusmenu && this._pref.getBoolPref("storage_store_SMTP")
    771 //              || vI.statusmenu.objSaveSMTPMenuItem.getAttribute("checked") == "true"),
    772 //          null, null);
    773764    },
    774765   
     
    877868    stringBundle : null,
    878869   
    879     _pref : Components.classes["@mozilla.org/preferences-service;1"]
    880         .getService(Components.interfaces.nsIPrefService)
    881         .getBranch("extensions.virtualIdentity."),
    882    
    883870    clean : function() {
    884871        this._rdfDataSource.clean();
     
    897884        else {
    898885            Log.debug("compare with current Identity\n");
    899             if (this._pref.getBoolPref("storage_getOneOnly") &&     // if requested to retrieve only storageID for first recipient entered
     886            if (vIprefs.get("storage_getOneOnly") &&        // if requested to retrieve only storageID for first recipient entered
    900887                isNotFirstInputElement &&                           // and it is now not the first recipient entered
    901888                !localIdentities.identityDataCollection[0].equalsIdentity(currentIdentity, false).equal) {      // and this id is different than the current used one
     
    910897                    var warning = this.__getWarning("replaceVIdentity", recipientName, compResult.compareMatrix);
    911898                    if (    !currentIdentityIsVid ||
    912                         !this._pref.getBoolPref("storage_warn_vI_replace") ||
     899                        !vIprefs.get("storage_warn_vI_replace") ||
    913900                        (this.__askWarning(warning) == "accept")) {
    914901                            returnValue.result = "accept";
     
    925912    storeVIdentityToAllRecipients : function(identityData, recipients) {
    926913        var multipleRecipients = (recipients.length > 1);
    927         var dontUpdateMultipleNoEqual = (this._pref.getBoolPref("storage_dont_update_multiple") && multipleRecipients)
     914        var dontUpdateMultipleNoEqual = (vIprefs.get("storage_dont_update_multiple") && multipleRecipients)
    928915        Log.debug("storeVIdentityToAllRecipients dontUpdateMultipleNoEqual='" + dontUpdateMultipleNoEqual + "'\n")
    929916       
     
    936923
    937924    getVIdentityFromAllRecipients : function(allIdentities, recipients) {
    938         if (!this._pref.getBoolPref("storage"))
     925        if (!vIprefs.get("storage"))
    939926            { Log.debug("Storage deactivated\n"); return; }
    940927        var initnumber = allIdentities.number;
     
    961948            (!storageDataByTypeEqual && !storageDataByFilterEqual && !dontUpdateMultipleNoEqual) ) {
    962949            Log.debug("__updateStorageFromVIdentity updating\n")
    963             if (storageDataByType && !storageDataByTypeEqual && this._pref.getBoolPref("storage_warn_update")) {
     950            if (storageDataByType && !storageDataByTypeEqual && vIprefs.get("storage_warn_update")) {
    964951                Log.debug("__updateStorageFromVIdentity overwrite warning\n");
    965952                doUpdate = this.__askWarning(this.__getWarning("updateStorage", recipient, storageDataByTypeCompResult.compareMatrix));
Note: See TracChangeset for help on using the changeset viewer.