Changeset 7c85ef


Ignore:
Timestamp:
Mar 24, 2012, 8:33:52 PM (10 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
d415fa
Parents:
9258d9
Message:

refer to window if opening dialogs

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • content/vI_storage.js

    r9258d9 r7c85ef  
    170170        var currentIdentity = document.getElementById("virtualIdentityExtension_msgIdentityClone").identityData
    171171        var storageResult = storage._rdfDatasourceAccess.updateVIdentityFromStorage(inputElement.value, recipientType,
    172             currentIdentity, document.getElementById("virtualIdentityExtension_msgIdentityClone").vid, isNotFirstInputElement);
     172            currentIdentity, document.getElementById("virtualIdentityExtension_msgIdentityClone").vid, isNotFirstInputElement, window);
    173173       
    174174        if (storageResult.identityCollection.number == 0) return; // return if there was no match
  • content/v_identity.js

    r9258d9 r7c85ef  
    146146            var virtualIdentityData = document.getElementById("virtualIdentityExtension_msgIdentityClone").identityData;
    147147           
    148             let returnValue = vI.vIaccount_prepareSendMsg(  vid, msgType, virtualIdentityData,
     148            let returnValue = vI.vIaccount_prepareSendMsg(vid, msgType, virtualIdentityData,
    149149                            main.accountManager.getIdentity(main.elements.Obj_MsgIdentity.value),
    150                             main._getRecipients() );
     150                            main._getRecipients(), window );
    151151            if (returnValue.update == "abort") {
    152152                main.replacement_functions.GenericSendMessageInProgress = false;
  • modules/plugins/conversations.js

    r9258d9 r7c85ef  
    143143        for (var index = 0; index < number; index++)
    144144          recipients.push( { recipient: combinedNames.value[index], recipientType: "addr_to" } )
    145 
     145       
     146        let recentWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
     147          .getService(Ci.nsIWindowMediator)
     148          .getMostRecentWindow("mail:3pane");
     149         
    146150        returnValue = vIaccount_prepareSendMsg(virtualIdInUse, Ci.nsIMsgCompDeliverMode.Now,
    147           currentIdentityData, aAddress.params.identity, recipients );
     151          currentIdentityData, aAddress.params.identity, recipients, recentWindow);
    148152        Log.debug("returnValue.update:", returnValue.update);
    149153       
     
    189193    if (!_rdfDatasourceAccess) _rdfDatasourceAccess = new rdfDatasourceAccess();
    190194    else _rdfDatasourceAccess.clean();
    191    
     195
     196    let recentWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
     197          .getService(Ci.nsIWindowMediator)
     198          .getMostRecentWindow("mail:3pane");
     199
    192200    var storageResult = _rdfDatasourceAccess.updateVIdentityFromStorage(aData.data, "addr_to",
    193       currentIdentityData, virtualIdInUse, isNotFirstInputElement);
     201      currentIdentityData, virtualIdInUse, isNotFirstInputElement, recentWindow);
    194202   
    195203    if (storageResult.identityCollection.number == 0) return; // return if there was no match
  • modules/vI_account.js

    r9258d9 r7c85ef  
    3737let Log = setupLogging("virtualIdentity.account");
    3838
    39 function vIaccount_prepareSendMsg(vid, msgType, identityData, baseIdentity, recipients) {
     39function vIaccount_prepareSendMsg(vid, msgType, identityData, baseIdentity, recipients, currentWindow) {
    4040    var stringBundle = Services.strings.createBundle("chrome://v_identity/locale/v_identity.properties");
    4141   
     
    5252    if (msgType == Ci.nsIMsgCompDeliverMode.Now) {
    5353        if ( (vid && vIprefs.get("warn_virtual") &&
    54             !(promptService.confirm(window,"Warning",
     54            !(promptService.confirm(currentWindow,"Warning",
    5555                stringBundle.GetStringFromName("vident.sendVirtual.warning")))) ||
    5656            (!vid && vIprefs.get("warn_nonvirtual") &&
    57             !(promptService.confirm(window,"Warning",
     57            !(promptService.confirm(currentWindow,"Warning",
    5858                stringBundle.GetStringFromName("vident.sendNonvirtual.warning")))) ) {
    5959            return { update : "abort", storedIdentity : null }; // completely abort sending
     
    6161        if (vIprefs.get("storage") && vIprefs.get("storage_store")) {
    6262            var localeDatasourceAccess = new rdfDatasourceAccess();
    63             var returnValue = localeDatasourceAccess.storeVIdentityToAllRecipients(identityData, recipients)
     63            var returnValue = localeDatasourceAccess.storeVIdentityToAllRecipients(identityData, recipients, currentWindow)
    6464            if ( returnValue.update == "abort" || returnValue.update == "takeover" ) {
    6565                Log.debug("prepareSendMsg: sending aborted");
  • modules/vI_rdfDatasource.js

    r9258d9 r7c85ef  
    877877    },
    878878   
    879     updateVIdentityFromStorage : function(recipientName, recipientType, currentIdentity, currentIdentityIsVid, isNotFirstInputElement) {
     879    updateVIdentityFromStorage : function(recipientName, recipientType, currentIdentity, currentIdentityIsVid, isNotFirstInputElement, currentWindow) {
    880880        var localIdentities = new identityCollection();
    881881        localIdentities.addWithoutDuplicates(this._rdfDataSource.readVIdentityFromRDF(recipientName, recipientType));
     
    903903                    if (    !currentIdentityIsVid ||
    904904                        !vIprefs.get("storage_warn_vI_replace") ||
    905                         (this.__askWarning(warning) == "accept")) {
     905                        (this.__askWarning(warning, currentWindow) == "accept")) {
    906906                            returnValue.result = "accept";
    907907                    }
     
    915915    },
    916916   
    917     storeVIdentityToAllRecipients : function(identityData, recipients) {
     917    storeVIdentityToAllRecipients : function(identityData, recipients, currentWindow) {
    918918        var multipleRecipients = (recipients.length > 1);
    919919        var dontUpdateMultipleNoEqual = (vIprefs.get("storage_dont_update_multiple") && multipleRecipients)
     
    922922        let returnValue = { update : "cancel" };
    923923        for (var j = 0; j < recipients.length; j++) {
    924             returnValue = this.__updateStorageFromVIdentity(identityData, recipients[j].recipient, recipients[j].recipientType, dontUpdateMultipleNoEqual);
     924            returnValue = this.__updateStorageFromVIdentity(identityData, recipients[j].recipient, recipients[j].recipientType, dontUpdateMultipleNoEqual, currentWindow);
    925925            if (returnValue.update != "accept")  break;
    926926        }
     
    939939    },
    940940
    941     __updateStorageFromVIdentity : function(identityData, recipient, recipientType, dontUpdateMultipleNoEqual) {
     941    __updateStorageFromVIdentity : function(identityData, recipient, recipientType, dontUpdateMultipleNoEqual, currentWindow) {
    942942        Log.debug("__updateStorageFromVIdentity.")
    943943        var storageDataByType = this._rdfDataSource.readVIdentityFromRDF(recipient, recipientType);
     
    956956            if (storageDataByType && !storageDataByTypeEqual && vIprefs.get("storage_warn_update")) {
    957957                Log.debug("__updateStorageFromVIdentity overwrite warning");
    958                 doUpdate = this.__askWarning(this.__getWarning("updateStorage", recipient, storageDataByTypeCompResult.compareMatrix));
     958                doUpdate = this.__askWarning(this.__getWarning("updateStorage", recipient, storageDataByTypeCompResult.compareMatrix), currentWindow);
    959959            }
    960960        }
     
    981981    },
    982982
    983     __askWarning : function(warning) {
     983    __askWarning : function(warning, currentWindow) {
    984984        var retVar = { returnValue: null };
    985         var answer = get3PaneWindow().openDialog("chrome://v_identity/content/vI_Dialog.xul","",
     985        var answer = currentWindow.openDialog("chrome://v_identity/content/vI_Dialog.xul","",
    986986                    "chrome, dialog, modal, alwaysRaised, resizable=yes",
    987987                     warning, retVar)
Note: See TracChangeset for help on using the changeset viewer.