Changeset e97c30


Ignore:
Timestamp:
Apr 15, 2008, 6:36:26 PM (14 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
9b501a
Parents:
fa4f02
Message:

initial implementation of storageExtras

Files:
3 added
15 edited

Legend:

Unmodified
Added
Removed
  • chrome.manifest

    rfa4f02 re97c30  
    1414overlay chrome://messenger/content/messenger.xul                chrome://v_identity/content/vI_upgradeOverlay.xul
    1515overlay chrome://messenger/content/mailWindowOverlay.xul            chrome://v_identity/content/vI_getHeader.xul
     16overlay chrome://v_identity/content/vI_rdfDataEditor.xul    chrome://v_identity/content/vI_storageExtras.xul
  • chrome/content/v_identity/vI_helper.js

    rfa4f02 re97c30  
    1212    },
    1313
    14     addIdentityMenuItem: function(object, identityName, accountName, accountKey, identityKey, base_id_key, smtp_key, extra) {
     14    addIdentityMenuItem: function(object, identityName, accountName, accountKey, identityKey, base_id_key, smtp_key, extras) {
    1515        var MenuItem = document.createElement("menuitem");
    1616        MenuItem.className = "identity-popup-item";
     
    2424        if (base_id_key) MenuItem.setAttribute("base_id_key", base_id_key)
    2525        if (smtp_key) MenuItem.setAttribute("smtp_key", smtp_key)
    26         if (extra) MenuItem.setAttribute("extra", extra)
     26        if (extras) MenuItem.setAttribute("extras", extras)
    2727       
    2828        object.appendChild(MenuItem)
  • chrome/content/v_identity/vI_msgIdentityClone.js

    rfa4f02 re97c30  
    122122    },
    123123
    124     addIdentityToCloneMenu: function(name, id, smtp, extra) {
     124    addIdentityToCloneMenu: function(name, id, smtp, extras) {
    125125        vI_notificationBar.dump("## vI_msgIdentityClone: addIdentityToCloneMenu '" + id + "'\n");
    126126        var accountname = null; var separator = null;
     
    140140       
    141141        vI_helper.addIdentityMenuItem(vI_msgIdentityClone.elements.Obj_MsgIdentityPopup_clone,
    142             name, accountname, "", "vid", id, smtp, extra
     142            name, accountname, "", "vid", id, smtp, extras)
    143143    },
    144144   
     
    152152                    vI_msgIdentityClone.addIdentityToCloneMenu(
    153153                        all_addresses.combinedNames[index], all_addresses.id_keys[index],
    154                         all_addresses.smtp_keys[index], all_addresses.extra[index])
     154                        all_addresses.smtp_keys[index], all_addresses.extras[index])
    155155                }
    156156        }
  • chrome/content/v_identity/vI_prefDialog.js

    rfa4f02 re97c30  
    7272                "VIdent_identity.storage_notification",
    7373                "VIdent_identity.storage_getOneOnly",
    74                 "VIdent_identity.storage_returnReciept",
    75                 "VIdent_identity.storage_characterEncoding",
    76                 "VIdent_identity.storage_messageFormat",
    77                 "VIdent_identity.storage_sMime_messageEncryption",
    78                 "VIdent_identity.storage_sMime_messageSignature",
    79                 "VIdent_identity.storage_openPGP_messageEncryption",
    80                 "VIdent_identity.storage_openPGP_messageSignature",
    81                 "VIdent_identity.storage_openPGP_PGPMIME",
     74                "VIdent_identity.storageExtras_returnReciept",
     75                "VIdent_identity.storageExtras_characterEncoding",
     76                "VIdent_identity.storageExtras_messageFormat",
     77                "VIdent_identity.storageExtras_sMime_messageEncryption",
     78                "VIdent_identity.storageExtras_sMime_messageSignature",
     79                "VIdent_identity.storageExtras_openPGP_messageEncryption",
     80                "VIdent_identity.storageExtras_openPGP_messageSignature",
     81                "VIdent_identity.storageExtras_openPGP_PGPMIME",
    8282                "VIdent_identity.idSelection_storage_prefer_smart_reply",
    8383                "VIdent_identity.idSelection_storage_ignore_smart_reply",
     
    246246                "VIdent_identity.storage_notification",
    247247                "VIdent_identity.storage_getOneOnly",
    248                 "VIdent_identity.storage_returnReciept",
    249                 "VIdent_identity.storage_characterEncoding",
    250                 "VIdent_identity.storage_messageFormat",
    251                 "VIdent_identity.storage_sMime_messageEncryption",
    252                 "VIdent_identity.storage_sMime_messageSignature",
    253                 "VIdent_identity.storage_openPGP_messageEncryption",
    254                 "VIdent_identity.storage_openPGP_messageSignature",
    255                 "VIdent_identity.storage_openPGP_PGPMIME",
     248                "VIdent_identity.storageExtras_returnReciept",
     249                "VIdent_identity.storageExtras_characterEncoding",
     250                "VIdent_identity.storageExtras_messageFormat",
     251                "VIdent_identity.storageExtras_sMime_messageEncryption",
     252                "VIdent_identity.storageExtras_sMime_messageSignature",
     253                "VIdent_identity.storageExtras_openPGP_messageEncryption",
     254                "VIdent_identity.storageExtras_openPGP_messageSignature",
     255                "VIdent_identity.storageExtras_openPGP_PGPMIME",
    256256                "storageTab", "storageTab1", "storageTab2"];
    257257            for( var i = 0; i < elementIDs.length; i++ ) {
  • chrome/content/v_identity/vI_prefDialog.xul

    rfa4f02 re97c30  
    3333<!ENTITY % vIprefDialogDTD SYSTEM "chrome://v_identity/locale/vI_prefDialog.dtd">
    3434%vIprefDialogDTD;
     35<!ENTITY % vIstorageExtrasDTD SYSTEM "chrome://v_identity/locale/vI_storageExtras.dtd">
     36%vIstorageExtrasDTD;
    3537<!ENTITY % vIdentityDTD SYSTEM "chrome://v_identity/locale/v_identity.dtd">
    3638%vIdentityDTD;
     
    373375            <caption label="&vI_prefDialog.storageCap3.caption;"/>
    374376            <vbox align="left">
    375                 <checkbox id="VIdent_identity.storage_returnReciept" label="&vI_prefDialog.storage.returnReciept.label;"
    376                     prefstring="storage_returnReciept"/>
    377                 <checkbox id="VIdent_identity.storage_characterEncoding" label="&vI_prefDialog.storage.characterEncoding.label;"
    378                     prefstring="storage_characterEncoding"/>
    379                 <checkbox id="VIdent_identity.storage_messageFormat" label="&vI_prefDialog.storage.messageFormat.label;"
    380                     prefstring="storage_messageFormat"/>
     377                <checkbox id="VIdent_identity.storageExtras_returnReciept" label="&vI_prefDialog.storageExtras.returnReciept.label;"
     378                    prefstring="storageExtras_returnReciept"/>
     379                <checkbox id="VIdent_identity.storageExtras_characterEncoding" label="&vI_prefDialog.storageExtras.characterEncoding.label;"
     380                    prefstring="storageExtras_characterEncoding"/>
     381                <checkbox id="VIdent_identity.storageExtras_messageFormat" label="&vI_prefDialog.storageExtras.messageFormat.label;"
     382                    prefstring="storageExtras_messageFormat"/>
    381383                <spacer height="10px"/>
    382384                <hbox><vbox>
    383                 <label value="&vI_prefDialog.storage.sMime.label;"/>
    384                 <checkbox id="VIdent_identity.storage_sMime_messageEncryption" label="&vI_prefDialog.storage.sMime.messageEncryption.label;"
    385                     prefstring="storage_sMime_messageEncryption"/>
    386                 <checkbox id="VIdent_identity.storage_sMime_messageSignature" label="&vI_prefDialog.storage.sMime.messageSignature.label;"
    387                     prefstring="storage_sMime_messageSignature"/>
     385                <label value="&vI_prefDialog.storageExtras.sMime.label;"/>
     386                <checkbox id="VIdent_identity.storageExtras_sMime_messageEncryption" label="&vI_prefDialog.storageExtras.sMime.messageEncryption.label;"
     387                    prefstring="storageExtras_sMime_messageEncryption"/>
     388                <checkbox id="VIdent_identity.storageExtras_sMime_messageSignature" label="&vI_prefDialog.storageExtras.sMime.messageSignature.label;"
     389                    prefstring="storageExtras_sMime_messageSignature"/>
    388390                </vbox><spacer flex="1"/><vbox>
    389                 <label value="&vI_prefDialog.storage.openPGP.label;"/>
    390                 <checkbox id="VIdent_identity.storage_openPGP_messageEncryption" label="&vI_prefDialog.storage.openPGP.messageEncryption.label;"
    391                     prefstring="storage_openPGP_messageEncryption"/>
    392                 <checkbox id="VIdent_identity.storage_openPGP_messageSignature" label="&vI_prefDialog.storage.openPGP.messageSignature.label;"
    393                     prefstring="storage_openPGP_messageSignature"/>
    394                 <checkbox id="VIdent_identity.storage_openPGP_PGPMIME" label="&vI_prefDialog.storage.openPGP.PGPMIME.label;"
    395                     prefstring="storage_openPGP_PGPMIME"/>
     391                <label value="&vI_prefDialog.storageExtras.openPGP.label;"/>
     392                <checkbox id="VIdent_identity.storageExtras_openPGP_messageEncryption" label="&vI_prefDialog.storageExtras.openPGP.messageEncryption.label;"
     393                    prefstring="storageExtras_openPGP_messageEncryption"/>
     394                <checkbox id="VIdent_identity.storageExtras_openPGP_messageSignature" label="&vI_prefDialog.storageExtras.openPGP.messageSignature.label;"
     395                    prefstring="storageExtras_openPGP_messageSignature"/>
     396                <checkbox id="VIdent_identity.storageExtras_openPGP_PGPMIME" label="&vI_prefDialog.storageExtras.openPGP.PGPMIME.label;"
     397                    prefstring="storageExtras_openPGP_PGPMIME"/>
    396398                </vbox></hbox>
    397399            </vbox>
  • chrome/content/v_identity/vI_rdfDataEditor.js

    rfa4f02 re97c30  
    2525vI_rdfDataEditor = {
    2626    __rdfDatasource : null,
     27   
     28    extras : new vI_storageExtras(resource, vI_rdfDatasource.__getRDFValue),
    2729
    2830    init : function() {
     
    5759        vI_smtpSelector.__loadSMTP_server_list();
    5860        vI_smtpSelector.setMenuToKey(window.arguments[0]["smtpKey"])
    59 
     61       
     62        vI_rdfDataEditor.extras.setEditorValues();
    6063    },
    6164   
     
    7174        if (window.arguments[0]["resource"])
    7275            vI_rdfDataEditor.__rdfDatasource.removeVIdentityFromRDF(window.arguments[0]["resource"])
     76           
     77        vI_rdfDataEditor.extras.readEditorValues();
    7378        vI_rdfDataEditor.__rdfDatasource.updateRDF(
    7479                document.getElementById("recipient").value,
     
    7681                address.email, address.name,
    7782                document.getElementById("identity_list").selectedItem.getAttribute("value"),
    78                 document.getElementById("smtp_server_list").selectedItem.getAttribute("key"))
     83                document.getElementById("smtp_server_list").selectedItem.getAttribute("key"),
     84                )
    7985    },
    8086}
  • chrome/content/v_identity/vI_rdfDataEditor.xul

    rfa4f02 re97c30  
    4747
    4848    <dialogheader title="&vI_rdfDataEditor.header.label;"/>
     49    <vbox id="vI_rdfDataEditorContent">
    4950    <hbox>
    5051        <vbox><spacer flex="1"/>
     
    8283        </hbox>
    8384    </groupbox>
    84 
     85    </vbox>
    8586    <splitter id="vIDebugBoxSplitter" hidden="true"/>
    8687    <textbox id="vIDebugBox" hidden="true" multiline="true" readonly="true"
  • chrome/content/v_identity/vI_rdfDataTree.js

    rfa4f02 re97c30  
    9393                idCol : idName,
    9494                idKey : values.id,
     95                extras : values.extras,
    9596                resource : resource }
    9697       
  • chrome/content/v_identity/vI_rdfDatasource.js

    rfa4f02 re97c30  
    125125        vI_rdfDatasource.__unsetRDFValue(resource, "id", vI_rdfDatasource.__getRDFValue(resource, "id"))
    126126        vI_rdfDatasource.__unsetRDFValue(resource, "smtp", vI_rdfDatasource.__getRDFValue(resource, "smtp"))
     127       
     128        var extras = new vI_storageExtras(vI_rdfDatasource.__getRDFValue, resource);
     129        extras.loopForRDF(vI_rdfDatasource.__unsetRDFValue, resource);
    127130    },
    128131   
     
    155158            var id = vI_rdfDatasource.__getRDFValue(resource, "id")
    156159            var smtp = vI_rdfDatasource.__getRDFValue(resource, "smtp")
    157             var values = { email : email, fullName : fullName, id : id, smtp : (smtp=="default"?"":smtp) };
     160            var extras = new vI_storageExtras(vI_rdfDatasource.__getRDFValue, resource);
     161            var values = { email : email, fullName : fullName, id : id, smtp : (smtp=="default"?"":smtp), extras : extras  };
    158162           
    159163            callFunction (resource, type, name, values)     
     
    180184        vI_notificationBar.dump("## vI_rdfDatasource: smtp '" + smtp + "'\n");
    181185       
    182         return { email : email, fullName : fullName, id : id, smtp : (smtp=="default"?"":smtp) };
     186        var extras = new vI_storageExtras(vI_rdfDatasource.__getRDFValue, resource);
     187        vI_notificationBar.dump("## vI_rdfDatasource: extras: " + extras.status() + "\n");
     188       
     189        return { email : email, fullName : fullName, id : id, smtp : (smtp=="default"?"":smtp), extras : extras };
    183190    },
    184191   
     
    195202        if (!id_key) id_key = vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.getAttribute("value");
    196203        var smtp_key = vI_smtpSelector.elements.Obj_SMTPServerList.selectedItem.getAttribute("key");
    197        
    198         vI_rdfDatasource.updateRDF(recDescription, recType, address.email, address.name, id_key, (smtp_key?smtp_key:"default"));
    199     },
    200    
    201     updateRDF : function (recDescription, recType, email, fullName, id, smtp) {
     204        var extras = new vI_storageExtras();
     205        extras.readValues(); // initialize with current MsgComposeDialog Values
     206       
     207        vI_rdfDatasource.updateRDF(recDescription, recType, address.email, address.name, id_key, (smtp_key?smtp_key:"default"), extras );
     208    },
     209   
     210    updateRDF : function (recDescription, recType, email, fullName, id, smtp, extras) {
    202211        if (!email) {
    203212            vI_notificationBar.dump("## vI_rdfDatasource: updateRDF: no Sender-email for Recipient, aborting.\n");
     
    211220        vI_rdfDatasource.__setRDFValue(resource, "id", id)
    212221        vI_rdfDatasource.__setRDFValue(resource, "smtp", smtp)
     222       
     223        if (extras) extras.loopForRDF(vI_rdfDatasource.__setRDFValue, resource);
    213224    },
    214225
    215226    __setRDFValue : function (resource, field, value) {
     227        vI_notificationBar.dump("## vI_rdfDatasource: __setRDFValue " + resource.ValueUTF8 + " " + field + " " + value + ".\n");
    216228        if (!value) return; // return if some value was not set.
    217229        var predicate = vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + "rdf#" + field);
  • chrome/content/v_identity/vI_smartIdentity.js

    rfa4f02 re97c30  
    241241                add_addresses.id_keys[index],
    242242                add_addresses.smtp_keys[index],
    243                 add_addresses.extra[index])
     243                add_addresses.extras[index])
    244244        return all_addresses
    245245    },
     
    262262                    all_addresses.id_keys[index] = id_key;
    263263                    all_addresses.smtp_keys[index] = smtp_key;
    264                     all_addresses.extra[index] = extra;
     264                    all_addresses.extras[index] = extra;
    265265                    vI_notificationBar.dump("## vI_smartIdentity:   added id '" + id_key
    266266                        + "' smtp '" + smtp_key + "' (+extra) to stored email '" + email +"'\n")
     
    328328                all_addresses.id_keys[all_addresses.number] = null;
    329329                all_addresses.smtp_keys[all_addresses.number] = null;
    330                 all_addresses.extra[all_addresses.number] = null;
     330                all_addresses.extras[all_addresses.number] = null;
    331331               
    332332                vI_notificationBar.dump("## vI_smartIdentity:   found '" +
  • chrome/content/v_identity/vI_storage.js

    rfa4f02 re97c30  
    3838    id_keys : {},
    3939    smtp_keys : {},
    40     extra : {}
     40    extras : {}
    4141};
    4242
     
    4545   
    4646    lastCheckedEmail : {},  // array of last checked emails per row,
    47                 // to prevent ugly double dialogs nd time-consuming double-checks
     47                // to prevent ugly double dialogs and time-consuming double-checks
    4848   
    4949    elements : { Obj_storageSave : null },
     
    174174                vI_storage.firstUsedStorageData.fullName != storageData.fullName ||
    175175                vI_storage.firstUsedStorageData.id != storageData.id ||
    176                 vI_storage.firstUsedStorageData.smtp != storageData.smtp ) {
     176                vI_storage.firstUsedStorageData.smtp != storageData.smtp ||
     177                !vI_storage.firstUsedStorageData.extras.equal(storageData.extras) ) {
    177178                    // add Identity to dropdown-menu
    178179                    vI_msgIdentityClone.addIdentityToCloneMenu(
    179180                        vI_helper.combineNames(storageData.fullName, storageData.email),
    180                         storageData.id, storageData.smtp)
     181                        storageData.id, storageData.smtp, storageData.extras)
    181182                    vI_notificationBar.setNote(vI.elements.strings.getString("vident.smartIdentity.vIStorageCollidingIdentity"),
    182183                    "storage_notification");
     
    188189            vI_msgIdentityClone.addIdentityToCloneMenu(
    189190                vI_helper.combineNames(storageData.fullName, storageData.email),
    190                 storageData.id, storageData.smtp)
     191                storageData.id, storageData.smtp, storageData.extras)
    191192            var warning = vI_storage.__getReplaceVIdentityWarning(recipient, storageData);
    192193           
     
    195196                !vI.preferences.getBoolPref("storage_warn_vI_replace") ||
    196197                vI_storage.promptService.confirm(window,"Warning",warning)) {                       
    197                     vI_msgIdentityClone.setMenuToIdentity(storageData.id)
    198                     vI_smtpSelector.setMenuToKey(storageData.smtp)
     198                    vI_msgIdentityClone.setMenuToIdentity(storageData.id);
     199                    vI_smtpSelector.setMenuToKey(storageData.smtp);
     200                    storageData.extras.setValues();
    199201                    if (vI_msgIdentityClone.setIdentity(
    200202                        vI_helper.combineNames(storageData.fullName, storageData.email), null))
     
    217219        if (!id_key) id_key = vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.getAttribute("value");
    218220        var smtp_key = vI_smtpSelector.elements.Obj_SMTPServerList.selectedItem.getAttribute('key');
     221        var extras = new vI_storageExtras();
     222        extras.readValues(); // initialize with current MsgComposeDialog Values
     223
    219224        var equal = (   (id_key == storageData.id) &&
    220225                (smtp_key == storageData.smtp) &&
    221226                (curAddress.email == storageData.email) &&
    222                 (curAddress.name == storageData.fullName)   )
     227                (curAddress.name == storageData.fullName) &&
     228                (extras.equal(storageData.extras))  )
    223229        if (equal) vI_notificationBar.dump("## vI_storage: Identities are the same.\n")
    224230        else vI_notificationBar.dump("## vI_storage: Identities differ.\n")
     
    228234    storeVIdentityToAllRecipients : function(msgType) {
    229235        if (msgType != nsIMsgCompDeliverMode.Now) return;
     236        vI_notificationBar.dump("## vI_storage: ----------------------------------------------------------\n")
    230237        if (!vI.preferences.getBoolPref("storage"))
    231238            { vI_notificationBar.dump("## vI_storage: Storage deactivated\n"); return; }
     
    274281            window.setTimeout(vI_storage.__updateStorageFromVIdentity, 0, awGetInputElement(row).value, recipientType)
    275282        }
     283        vI_notificationBar.dump("## vI_storage: ----------------------------------------------------------\n")
    276284    },
    277285   
     
    309317   
    310318    __updateStorageFromVIdentity : function(recipient, recipientType) {
     319        vI_notificationBar.dump("## vI_storage: __updateStorageFromVIdentity.\n")
    311320        var dontUpdateMultipleNoEqual = (vI.preferences.getBoolPref("storage_dont_update_multiple") &&
    312321                    vI_storage.multipleRecipients)
  • chrome/content/v_identity/vI_upgrade.js

    rfa4f02 re97c30  
    138138       
    139139        vI_rdfDatasource.updateRDF(vI_helper.combineNames(Card.displayName, Card.primaryEmail),
    140                         "email", splitted.email, splitted.name, id, smtp)
     140                        "email", splitted.email, splitted.name, id, smtp, null)
    141141        if (Card.secondEmail.replace(/^\s+|\s+$/g,""))
    142142            vI_rdfDatasource.updateRDF(vI_helper.combineNames(Card.displayName, Card.secondEmail),
    143                     "email", splitted.email, splitted.name, id, smtp)
     143                    "email", splitted.email, splitted.name, id, smtp, null)
    144144       
    145145        Card[returnVar.prop] = "";
  • chrome/content/v_identity/v_identity.xul

    rfa4f02 re97c30  
    4848<script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js"/>
    4949<script type="application/x-javascript" src="chrome://v_identity/content/vI_storage.js"/>
     50<script type="application/x-javascript" src="chrome://v_identity/content/vI_storageExtras.js"/>
    5051
    5152  <stringbundleset id="stringbundleset">
  • chrome/locale/en-US/v_identity/vI_prefDialog.dtd

    rfa4f02 re97c30  
    7474<!ENTITY vI_prefDialog.storageTab.Tab2.label "additional options">
    7575<!ENTITY vI_prefDialog.storageCap3.caption "store (and recall) the following settings">
    76 <!ENTITY vI_prefDialog.storage.returnReciept.label "return reciept status">
    77 <!ENTITY vI_prefDialog.storage.characterEncoding.label "selected character encoding">
    78 <!ENTITY vI_prefDialog.storage.messageFormat.label "selected message format">
    79 
    80 <!ENTITY vI_prefDialog.storage.sMime.label "S/MIME">
    81 <!ENTITY vI_prefDialog.storage.sMime.messageEncryption.label "encryption status">
    82 <!ENTITY vI_prefDialog.storage.sMime.messageSignature.label "signature usage">
    83 <!ENTITY vI_prefDialog.storage.openPGP.label "OpenPGP">
    84 <!ENTITY vI_prefDialog.storage.openPGP.messageEncryption.label "encryption status">
    85 <!ENTITY vI_prefDialog.storage.openPGP.messageSignature.label "signature usage">
    86 <!ENTITY vI_prefDialog.storage.openPGP.PGPMIME.label "PGP/MIME usage">
    8776
    8877<!ENTITY vI_prefDialog.idSelection.header "Identity Selection">
  • defaults/preferences/preferences.js

    rfa4f02 re97c30  
    3434pref("extensions.virtualIdentity.storage_notification", true);
    3535pref("extensions.virtualIdentity.storage_getOneOnly", true);
     36pref("extensions.virtualIdentity.storageExtras_returnReciept", false);
     37pref("extensions.virtualIdentity.storageExtras_characterEncoding", false);
     38pref("extensions.virtualIdentity.storageExtras_messageFormat", false);
     39pref("extensions.virtualIdentity.storageExtras_sMime_messageEncryption", false);
     40pref("extensions.virtualIdentity.storageExtras_sMime_messageSignature", false);
     41pref("extensions.virtualIdentity.storageExtras_openPGP_messageEncryption", false);
     42pref("extensions.virtualIdentity.storageExtras_openPGP_messageSignature", false);
     43pref("extensions.virtualIdentity.storageExtras_openPGP_PGPMIME", false);
    3644pref("extensions.virtualIdentity.idSelection_storage_prefer_smart_reply", false);
    3745pref("extensions.virtualIdentity.idSelection_storage_ignore_smart_reply", true);
Note: See TracChangeset for help on using the changeset viewer.