Changeset 8a0f50


Ignore:
Timestamp:
Nov 6, 2007, 2:59:03 PM (12 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
b52b6b
Parents:
de62b8
Message:

removed experimental settings, repaired replyTo and bugfix for Identities with identityName set

Location:
chrome/content/v_identity
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_addressBook.js

    rde62b8 r8a0f50  
    238238                if ( info && info[0] ) addresses.id_keys[0] = info[0];
    239239                if ( info && info[1] ) addresses.smtp_keys[0] = info[1];
     240                vI_notificationBar.dump("## vI_addressBook: found '" + addresses.combinedNames[0] + "'.\n")
    240241                vI_notificationBar.dump("## vI_addressBook: found '" + addresses.fullABEntry[0] + "'.\n")
    241242                return addresses
     
    338339       
    339340       
    340         dontUpdateMultipleNoEqual = (vI.preferences.getBoolPref("experimental") &&
    341                 vI.preferences.getBoolPref("aBook_dont_update_multiple") &&
    342                 vI_addressBook.multipleRecipients)
     341        dontUpdateMultipleNoEqual = (vI.preferences.getBoolPref("aBook_dont_update_multiple") &&
     342                    vI_addressBook.multipleRecipients)
    343343       
    344344        if (addresses) {
  • chrome/content/v_identity/vI_msgIdentityClone.js

    rde62b8 r8a0f50  
    7272            .setAttribute("value", vI_msgIdentityClone.elements.Obj_MsgIdentity.selectedItem.getAttribute("value"));
    7373        vI_msgIdentityClone.elements.Obj_MsgIdentity_clone
    74             .setAttribute("label", vI_msgIdentityClone.elements.Obj_MsgIdentity.selectedItem.getAttribute("label"));
    75         vI_msgIdentityClone.elements.Obj_MsgIdentity_clone
    7674            .setAttribute("accountname", vI.helper.getAccountname(vI_msgIdentityClone.elements.Obj_MsgIdentity.selectedItem));
     75        // Identitys might have IdentityName set differently to 'name <email>',
     76        // so retrieve name and email directly from Identity
     77        var identity = gAccountManager.getIdentity(vI_msgIdentityClone.elements.Obj_MsgIdentity.selectedItem.getAttribute("value"))
     78        var label = identity.getUnicharAttribute("fullName") + " <" + identity.getUnicharAttribute("useremail") + ">"
     79        vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.setAttribute("label", label);
    7780    },
    7881   
     
    9295            }
    9396        }
    94         vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.doCommand();
     97        vI_notificationBar.dump("## vI_msgIdentityClone: setMenuToIdentity MsgIdentityPopup_clone.doCommand()\n");
     98        vI_msgIdentityClone.elements.Obj_MsgIdentityPopup_clone.doCommand();
    9599    },
    96100   
     
    100104   
    101105    copySelectedIdentity : function() {
     106        vI_notificationBar.dump("## vI_msgIdentityClone: copySelectedIdentity\n");
    102107        // copy selected Menu-Value from clone to orig.
    103108        MenuItems = vI_msgIdentityClone.elements.Obj_MsgIdentity.firstChild.childNodes
     
    110115            }
    111116        }
    112         vI_notificationBar.dump("## vI_msgIdentityClone: MsgIdentityPopup.doCommand()\n");
     117        vI_notificationBar.dump("## vI_msgIdentityClone: copySelectedIdentity MsgIdentityPopup.doCommand()\n");
    113118        vI_msgIdentityClone.elements.Obj_MsgIdentityPopup.doCommand();
    114119    },
     
    124129    LoadIdentity : function()
    125130    {
     131        vI_notificationBar.dump("## vI_msgIdentityClone: LoadIdentity\n");
    126132        vI_msgIdentityClone.cleanupReplyTo();
    127133        if (vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem.value != "vid") {
     
    131137        }
    132138        vI_msgIdentityClone.initMsgIdentityTextbox_clone();
    133         vI_msgIdentityClone.elements.Obj_MsgIdentityTextbox_clone.value =
    134             vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem.getAttribute("label");
     139        // Identitys might have IdentityName set differently to 'name <email>',
     140        // so retrieve name and email directly from Identity
     141        var identity = gAccountManager.getIdentity(vI_msgIdentityClone.elements.Obj_MsgIdentity.selectedItem.getAttribute("value"))
     142        var label = identity.getUnicharAttribute("fullName") + " <" + identity.getUnicharAttribute("useremail") + ">"
     143        vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.setAttribute("label", label);
     144        vI_msgIdentityClone.elements.Obj_MsgIdentityTextbox_clone.value = label;
     145
    135146        vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.setAttribute("accountname",
    136147            vI.helper.getAccountname(vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem));
     
    140151   
    141152    setIdentity : function(newName) {
     153        vI_notificationBar.dump("## initReplyToFields setIdentity " + newName + "\n");
    142154        vI_msgIdentityClone.initMsgIdentityTextbox_clone();
    143155        vI_msgIdentityClone.elements.Obj_MsgIdentityTextbox_clone.value = newName;
     
    145157        var newIdentity = vI_msgIdentityClone.isNewIdentity();
    146158        window.setTimeout(vI_msgIdentityClone.markAsNewAccount, 0, newIdentity);
     159        if (!newIdentity) window.setTimeout(vI_msgIdentityClone.setMenuToIdentity, 0,
     160            vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.getAttribute("value"));
    147161        return newIdentity;
    148162    },
     
    159173        vI_msgIdentityClone.initMsgIdentityTextbox_clone();
    160174        // compare Identity with existant ones and prepare Virtual-Identity if nonexistant found
    161         vI_msgIdentityClone.markAsNewAccount(vI_msgIdentityClone.isNewIdentity());
     175        var newIdentity = vI_msgIdentityClone.isNewIdentity();
     176        vI_msgIdentityClone.markAsNewAccount(newIdentity);
     177        if (!newIdentity) vI_msgIdentityClone.setMenuToIdentity(vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.getAttribute("value"));
    162178    },
    163179   
    164180    replyToInputElem : null,    // it is important to store the Elements and not the row
    165181    replyToPopupElem : null,    // cause row might change if one above gets removed
     182    replyToInitValue : null,
    166183    replyToStoredLastValue : null,
    167184    replyToSynchronize : true,
     
    170187    // searches the first reply-to row and assumes that this is the one we like to adapt
    171188    initReplyToFields : function() {
    172         if (!vI.preferences.getBoolPref("experimental")) return
    173189        var replyTo = gAccountManager.getIdentity(vI_msgIdentityClone.elements.
    174190                Obj_MsgIdentity_clone.selectedItem.value).replyTo
    175         vI_notificationBar.dump("#X initReplyToFields identity.replyTo: " + replyTo + "\n");
     191        vI_notificationBar.dump("## initReplyToFields identity.replyTo: " + replyTo + "\n");
    176192        if (replyTo == "") return
    177193       
     194        vI_msgIdentityClone.replyToInitValue = replyTo;
    178195        for (var row = 1; row <= top.MAX_RECIPIENTS; row ++) {
    179196            var awType = awGetPopupElement(row).selectedItem.getAttribute("value");
    180197            var awValue = awGetInputElement(row).value
    181198            if (awType == "addr_reply" && awValue == replyTo) {
    182                 vI_notificationBar.dump("#X vI_msgIdentityClone: Reply-To found in row " + row + "\n");
     199                vI_notificationBar.dump("## vI_msgIdentityClone: Reply-To found in row " + row + "\n");
    183200                vI_msgIdentityClone.replyToPopupElem = awGetPopupElement(row)
    184201                vI_msgIdentityClone.replyToInputElem = awGetInputElement(row)
     
    186203                }
    187204        }
    188         if (!vI_msgIdentityClone.replyToInputElem) vI_notificationBar.dump("#X vI_msgIdentityClone: no Reply-To row found\n");
     205        if (!vI_msgIdentityClone.replyToInputElem) vI_notificationBar.dump("## vI_msgIdentityClone: no Reply-To row found\n");
    189206    },
    190207   
    191208    cleanupReplyTo : function() {
    192         if (!vI.preferences.getBoolPref("experimental")) return
    193209        if (!vI_msgIdentityClone.replyToSynchronize) return
    194         vI_notificationBar.dump("#X cleanupReplyTo\n");
    195         if (vI_msgIdentityClone.replyToInputElem) {
    196                 vI_notificationBar.dump("#X restore ReplyTo\n");
    197                 vI_msgIdentityClone.replyToInputElem.value =
    198                     gAccountManager.getIdentity(vI_msgIdentityClone.elements.
    199                         Obj_MsgIdentity_clone.selectedItem.value).replyTo
    200                 vI_msgIdentityClone.replyToInputElem.setAttribute("value",
    201                     gAccountManager.getIdentity(vI_msgIdentityClone.elements.
    202                         Obj_MsgIdentity_clone.selectedItem.value).replyTo)
    203             }
     210        vI_notificationBar.dump("## cleanupReplyTo\n");
     211       
     212        // check if sychronizing should still be done (will be stopped if value was modified by hand)
     213        // if still in synchronizing mode reset the fields
     214        if ( vI_msgIdentityClone.replyToInputElem && vI_msgIdentityClone.synchroneReplyTo() ) {
     215            if (vI_msgIdentityClone.replyToInitValue) {
     216                var replyTo = vI_msgIdentityClone.replyToInitValue;
     217                vI_notificationBar.dump("## restore ReplyTo: " + replyTo + "\n");
     218                vI_msgIdentityClone.replyToInputElem.value = replyTo;
     219                vI_msgIdentityClone.replyToInputElem.setAttribute("value",replyTo)
     220            }
     221            else {
     222                awDeleteHit(vI_msgIdentityClone.replyToInputElem);
     223                window.setTimeout("vI_msgIdentityClone.elements.Obj_MsgIdentityTextbox_clone.focus();", 0)
     224            }
     225        }
    204226        vI_msgIdentityClone.replyToInputElem = null;
    205227        vI_msgIdentityClone.replyToPopupElem = null;
     228        vI_msgIdentityClone.replyToInitValue = null;
    206229        vI_msgIdentityClone.replyToStoredLastValue = null;
    207230    },
    208231   
    209     // updateReplyTo is called on every change in the From: field, if its a virtual Identity
    210     updateReplyTo : function(newIdentity) {
    211         if (!vI.preferences.getBoolPref("experimental")) return
    212         if (!vI.preferences.getBoolPref("autoReplyToSelf")) return
    213         if (!vI_msgIdentityClone.replyToSynchronize) {
    214             vI_notificationBar.dump("#X updateReplyTo stopped Synchronizing\n")
    215             return
    216         }
    217         vI_notificationBar.dump("#X updateReplyTo replyToStoredLastValue="
    218                 + vI_msgIdentityClone.replyToStoredLastValue + "\n");
    219 
    220         // if replyToInputElem not set (so no initial Reply-To row was found) add a row now
    221         if (!vI_msgIdentityClone.replyToInputElem) {
    222             awAddRecipient("addr_reply",vI_msgIdentityClone.elements.Obj_MsgIdentityTextbox_clone.value)
    223             //~ vI_msgIdentityClone.elements.Obj_MsgIdentityTextbox_clone.focus()
    224             vI_msgIdentityClone.replyToPopupElem = awGetPopupElement(top.MAX_RECIPIENTS - 1)
    225             vI_msgIdentityClone.replyToInputElem = awGetInputElement(top.MAX_RECIPIENTS - 1)
    226             //~ vI_notificationBar.dump("#X vI_msgIdentityClone: Reply-To created in row " + top.MAX_RECIPIENTS + "\n");
    227         }
    228        
    229         // check if sychronizing should still be done (will be stopped if value was modified by hand)
     232    synchroneReplyTo : function() {
     233        vI_notificationBar.dump("## synchroneReplyTo\n");
    230234        if ( (vI_msgIdentityClone.replyToPopupElem.selectedItem.value != "addr_reply") ||
    231235            (vI_msgIdentityClone.replyToStoredLastValue &&
    232236            vI_msgIdentityClone.replyToInputElem.value != vI_msgIdentityClone.replyToStoredLastValue)) {
    233237            vI_msgIdentityClone.replyToSynchronize = false;
    234             vI_notificationBar.dump("#X vI_msgIdentityClone: (former) Reply-To entry changed, stop synchronizing\n");
    235         }
    236         else {
     238            vI_notificationBar.dump("## vI_msgIdentityClone: (former) Reply-To entry changed, stop synchronizing\n");
     239        }
     240        return vI_msgIdentityClone.replyToSynchronize
     241    },
     242   
     243    // updateReplyTo is called on every change in the From: field, if its a virtual Identity
     244    updateReplyTo : function(newIdentity) {
     245        if (!vI.preferences.getBoolPref("autoReplyToSelf")) return
     246        if (!vI_msgIdentityClone.replyToSynchronize) {
     247            vI_notificationBar.dump("## updateReplyTo stopped Synchronizing\n")
     248            return
     249        }
     250        vI_notificationBar.dump("## updateReplyTo replyToStoredLastValue="
     251                + vI_msgIdentityClone.replyToStoredLastValue + "\n");
     252
     253        // if replyToInputElem not set (so no initial Reply-To row was found) add a row now
     254        if (!vI_msgIdentityClone.replyToInputElem) {
     255            awAddRecipient("addr_reply",vI_msgIdentityClone.elements.Obj_MsgIdentityTextbox_clone.value)
     256            window.setTimeout("vI_msgIdentityClone.elements.Obj_MsgIdentityTextbox_clone.focus();", 0)
     257            vI_msgIdentityClone.replyToPopupElem = awGetPopupElement(top.MAX_RECIPIENTS - 1)
     258            vI_msgIdentityClone.replyToInputElem = awGetInputElement(top.MAX_RECIPIENTS - 1)
     259        }
     260       
     261        // check if sychronizing should still be done (will be stopped if value was modified by hand)
     262        if (vI_msgIdentityClone.synchroneReplyTo()) {
    237263            vI_msgIdentityClone.replyToInputElem.value =
    238264                vI_msgIdentityClone.elements.Obj_MsgIdentityTextbox_clone.value
     
    240266                //~ vI_msgIdentityClone.elements.Obj_MsgIdentityTextbox_clone.value)
    241267            vI_msgIdentityClone.replyToStoredLastValue = vI_msgIdentityClone.replyToInputElem.value
    242         }
    243         vI_msgIdentityClone.elements.Obj_MsgIdentityTextbox_clone.focus()
     268        }       
    244269    },
    245270   
     
    291316                    .setAttribute("oldvalue",null)
    292317                //~ vI_msgIdentityClone.elements.Obj_MsgIdentityPopup_clone.doCommand();
    293                 vI_msgIdentityClone.setMenuToIdentity(vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.getAttribute("value"));
    294318            }
    295319            // code to show the signature
  • chrome/content/v_identity/vI_prefDialog.js

    rde62b8 r8a0f50  
    274274        window.setTimeout(vI_prefDialog.base.aBookCheckCounter, 0); // do this in background, cause this might take a while
    275275       
    276         if (vI_prefDialog.preferences.getBoolPref("experimental")){
    277             document.getElementById("autoReplyToSelfSpacer").setAttribute("hidden", "false")
    278             document.getElementById("VIdent_identity.autoReplyToSelf").setAttribute("hidden", "false")
    279             document.getElementById("VIdent_identity.aBook_dont_update_multiple").setAttribute("hidden", "false")
    280         }
     276        //~ if (vI_prefDialog.preferences.getBoolPref("experimental")){
     277        //~ }
    281278       
    282279        dump("## vI_prefDialog: init_prefs done\n");
  • chrome/content/v_identity/vI_prefDialog.xul

    rde62b8 r8a0f50  
    139139            <checkbox id="VIdent_identity.hide_signature" label="&vident.prefs.HideSignature.label;" disabled="true"
    140140                prefstring="hide_signature"/>
    141             <!-- experimental -->
    142             <spacer id="autoReplyToSelfSpacer" height="10px" hidden="true"/>
     141            <spacer id="autoReplyToSelfSpacer" height="10px"/>
    143142            <checkbox id="VIdent_identity.autoReplyToSelf" label="&vident.prefs.autoReplyToSelf.label;"
    144                 prefstring="autoReplyToSelf" hidden="true"/>
    145             <!-- experimental -->
     143                prefstring="autoReplyToSelf"/>
    146144            </groupbox>
    147145            </tabpanel>
     
    292290                    prefstring="aBook_warn_update"/>
    293291                <checkbox id="VIdent_identity.aBook_dont_update_multiple" label="&vident.prefs.aBook.dont_update_multiple.label;"
    294                     prefstring="aBook_dont_update_multiple" hidden="true"/>
     292                    prefstring="aBook_dont_update_multiple"/>
    295293            </vbox>
    296294            </groupbox>
Note: See TracChangeset for help on using the changeset viewer.