Changeset 3caa82


Ignore:
Timestamp:
Feb 18, 2008, 6:50:56 PM (14 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
fe3a63
Parents:
0b9cba
Message:

activate window-recycling. Should work now with icedove too.

Location:
chrome/content/v_identity
Files:
5 edited

Legend:

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

    r0b9cba r3caa82  
    4646        vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.setAttribute("hidden", "false");
    4747        vI_msgIdentityClone.elements.Obj_MsgIdentity.previousSibling.setAttribute("control", "msgIdentity_clone");
     48    },
     49   
     50    reinit : function() {
     51        vI_notificationBar.dump("## vI_msgIdentityClone: reinit\n");
     52        MenuItems = vI_msgIdentityClone.elements.Obj_MsgIdentityPopup_clone.childNodes
     53        while (MenuItems.length > 0) vI_msgIdentityClone.elements.Obj_MsgIdentityPopup_clone.removeChild(MenuItems[0])
     54        vI_msgIdentityClone.clone_Obj_MsgIdentity();
     55        vI_msgIdentityClone.elements.Obj_MsgIdentityPopup_clone.doCommand();
    4856    },
    4957   
     
    6472            newMenuItem.setAttribute("class", "identity_clone-popup-item person-icon")
    6573            vI_msgIdentityClone.elements.Obj_MsgIdentityPopup_clone.appendChild(newMenuItem)
    66             if (vI_msgIdentityClone.elements.Obj_MsgIdentity.selectedItem == MenuItems[index])
     74            if (vI_msgIdentityClone.elements.Obj_MsgIdentity.selectedItem == MenuItems[index]) {
     75                vI_notificationBar.dump("## vI_msgIdentityClone: '" + vI_msgIdentityClone.elements.Obj_MsgIdentity.selectedItem.value + "'\n");
    6776                vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem = newMenuItem;
     77            }
    6878            // "accountname" property changed in Thunderbird 3.x, Seamonkey 1.5x to "description"
    6979            newMenuItem.setAttribute("accountname", vI.helper.getAccountname(newMenuItem))
     
    193203    replyToStoredLastValue : null,
    194204    replyToSynchronize : true,
     205   
     206    reinitReplyToFields : function() {
     207        replyToInputElem = null;
     208        replyToPopupElem = null;
     209        replyToInitValue = null;
     210        replyToStoredLastValue = null;
     211        replyToSynchronize = true;
     212        vI_msgIdentityClone.initReplyToFields();
     213    },
    195214   
    196215    // called directly after a change of the Identity with the dropdown menu
  • chrome/content/v_identity/vI_smartIdentity.js

    r0b9cba r3caa82  
    2727        .QueryInterface(Components.interfaces.nsIMessenger),
    2828       
    29     smartIdentity : null,
    3029    smartIdentity_BaseIdentity : null,
    3130
     31    reinit : function() {
     32        vI_smartIdentity.smartIdentity_BaseIdentity = null;
     33        vI_smartIdentity.init();
     34    },
     35   
    3236    // After Loading the MessageComposeDialog, check if smartIdentity is needed
    3337    init : function() {
  • chrome/content/v_identity/vI_smtpSelector.js

    r0b9cba r3caa82  
    4040        vI_smtpSelector.__selectUsedSMTPServer();
    4141        vI_smtpSelector.addObserver();
     42        vI_smtpSelector.observe(); // just do it once to initialize the status
     43    },
     44   
     45    reinit : function() {
     46        vI_notificationBar.dump("## v_smtpSelector: reinit\n")
     47        MenuItems = vI_smtpSelector.elements.Obj_SMTPServerListPopup.childNodes
     48        while (MenuItems.length > 0) vI_smtpSelector.elements.Obj_SMTPServerListPopup.removeChild(MenuItems[0])
     49        vI_smtpSelector.__loadSMTP_server_list();
     50        vI_smtpSelector.__selectUsedSMTPServer();
    4251        vI_smtpSelector.observe(); // just do it once to initialize the status
    4352    },
  • chrome/content/v_identity/vI_storage.js

    r0b9cba r3caa82  
    4545            .getService(Components.interfaces.nsIPrefService)
    4646            .getBranch(null),
    47 
     47   
     48    reinit: function() {
     49        vI_storage.multipleRecipients = null;
     50        vI_storage.lastCheckedEmail = {};
     51        vI_storage.elements = { Obj_storageSave : null };
     52        vI_storage.firstUsedInputElement = null;
     53        vI_storage.firstUsedStorageData = null;
     54    },
     55   
    4856    original_functions : {
    4957        awSetInputAndPopupValue : null,
     
    106114   
    107115    firstUsedInputElement : null,   // this stores the first Element for which a Lookup in the Storage was successfull
    108     firstUsedRDFEntry : null,   // stores the used storage-entry to show a warning if the Identities differ
     116    firstUsedStorageData : null,    // stores the used storage-entry to show a warning if the Identities differ
    109117    updateVIdentityFromStorage: function(inputElement) {
    110118        if (!vI.preferences.getBoolPref("storeVIdentity")) {
  • chrome/content/v_identity/v_identity.js

    r0b9cba r3caa82  
    112112            vI.elements.strings = document.getElementById("vIdentBundle");
    113113        },
     114        strings : null
    114115    },
    115116
     
    120121        NotifyComposeFieldsReady: function() {
    121122            vI_notificationBar.dump("## v_identity: NotifyComposeFieldsReady\n");
    122             vI_msgIdentityClone.initReplyToFields();
    123             vI_storage.init();
    124             vI_smartIdentity.init();
     123            vI.open();
    125124        },
    126125        ComposeProcessDone: function(aResult) {
    127126            vI_notificationBar.dump("## v_identity: StateListener reports ComposeProcessDone\n");
    128             vI.Cleanup_Account();
    129             if (aResult== Components.results.NS_OK && vI.msgType == nsIMsgCompDeliverMode.Now)
    130                     MsgComposeCloseWindow(false);
     127            vI.Cleanup_Account(); // not really required, parallel handled by vI.close
    131128        },
    132129        SaveInFolderDone: function(folderURI) {
     
    140137        MsgComposeCloseWindow : function(recycleIt) {
    141138            vI_notificationBar.dump("## v_identity: MsgComposeCloseWindow\n");
    142             vI.original_functions.MsgComposeCloseWindow(false);
     139            //~ alert("before MsgComposeCloseWindow")
     140            //~ vI.original_functions.MsgComposeCloseWindow(false);
     141            //~ alert("after MsgComposeCloseWindow")
    143142        },
    144143       
     
    205204
    206205    remove: function() {
     206        window.removeEventListener('compose-window-reopen', vI.reopen, true);
     207        window.removeEventListener('compose-window-close', vI.close, true);
    207208        vI_notificationBar.dump("## v_identity: end. remove Account if there.\n")
    208209        vI.Cleanup_Account();
     
    211212    // initialization //
    212213    init: function() {
    213         // clear the DebugArea (not needed cause window is new)
    214         //~ vI_notificationBar.clear_dump()
    215214        vI.unicodeConverter.charset="UTF-8";
     215        gMsgCompose.RegisterStateListener(vI.ComposeStateListener);
     216        window.addEventListener('compose-window-reopen', vI.reopen, true);
     217        window.addEventListener('compose-window-close', vI.close, true);
     218    },
     219   
     220    close : function() {
     221        vI.Cleanup_Account();
     222    },
     223   
     224    adapt_interface : function() {
     225        if (vI.elements.strings) return; // only rearrange the interface once
    216226       
    217227        // initialize the pointers to extension elements
     
    226236       
    227237        // initialize the pointers to extension elements (initialize those earlier might brake the interface)
    228         vI.elements.init_rest();
    229        
    230         vI_smtpSelector.init();
    231         vI_msgIdentityClone.init();
    232        
    233         // replace MsgComposeCloseWindow with our own version to get rid of the old account in any case
    234         vI_notificationBar.dump("## v_identity: replace MsgComposeCloseWindow\n");
    235         vI.original_functions.MsgComposeCloseWindow = MsgComposeCloseWindow;
    236         MsgComposeCloseWindow = function (recycleIt) {
    237             vI.replacement_functions.MsgComposeCloseWindow(recycleIt); }
    238            
     238        vI.elements.init_rest();   
     239    },
     240   
     241    adapt_genericSendMessage : function() {
     242        if (vI.original_functions.GenericSendMessage) return; // only initialize this once
     243   
    239244        // adapt GenericSendMessage to know SendMsgType
    240245        vI_notificationBar.dump("## v_identity: adapt GenericSendMessage\n");
     
    243248                vI.msgType = msgType; if (vI.warning(msgType)) {
    244249                    vI.original_functions.GenericSendMessage(msgType);
    245                     vI_storage.storeVIdentityToAllRecipients(msgType); } }
    246        
    247         gMsgCompose.RegisterStateListener(vI.ComposeStateListener);
    248         window.removeEventListener("load", vI.init, false);
     250                    vI_storage.storeVIdentityToAllRecipients(msgType); } }     
     251    },
     252   
     253    open : function() {
     254        vI_notificationBar.dump("## v_identity: composeDialog opened.\n")
     255        vI.adapt_interface();
     256        vI.adapt_genericSendMessage();
     257        vI_smtpSelector.init();
     258        vI_msgIdentityClone.init();
     259        vI_msgIdentityClone.initReplyToFields();
     260        vI_storage.init();
     261        vI_smartIdentity.init();
     262    },
     263   
     264    reopen: function() {
     265        vI_notificationBar.clear_dump()
     266        vI_notificationBar.dump("## v_identity: composeDialog reopened.\n")
     267        vI.adapt_interface();
     268        vI.adapt_genericSendMessage();
     269        vI_storage.reinit();
     270        vI_smtpSelector.reinit();
     271        vI_msgIdentityClone.reinit();
     272        vI_msgIdentityClone.reinitReplyToFields();
     273        vI_storage.reinit();
     274        vI_smartIdentity.reinit();
    249275    },
    250276   
Note: See TracChangeset for help on using the changeset viewer.