Changeset c5860f


Ignore:
Timestamp:
Sep 9, 2018, 2:36:46 AM (2 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
8b09cf
Parents:
85fa10
Message:

reference to new rdf storage

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • content/vI_context.xul

    r85fa10 rc5860f  
    6666                        <menuitem label="&vident.vI_Menu.DataEditor.label;"
    6767                            oncommand="window.open('chrome://v_identity/content/vI_rdfDataTree.xul', '', 'chrome, dialog, resizable=yes');" />
    68                         <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasourceImporter(window, 'virtualIdentity.rdf');"/>
    69                         <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasource(window); vI_localRdfDatasource.export('virtualIdentity.rdf')"/>
     68                        <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasourceImporter(window, 'virtualIdentity_0.10.rdf');"/>
     69                        <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasource(window); vI_localRdfDatasource.export('virtualIdentity_0.10.rdf')"/>
    7070                    </menupopup>
    7171                </menu>
  • content/vI_overlay.js

    r85fa10 rc5860f  
    6060
    6161    addEventListener('messagepane-loaded', extensionInit, true);
     62    Log.debug("init rdfDatasource");
     63    var rdfDatasource = vI.rdfDatasourceAccess(window);
     64    Log.debug("init rdfDatasource done");
    6265  }
    6366});
  • content/vI_upgrade.js

    r85fa10 rc5860f  
    3939
    4040      quickUpgrade: function (currentVersion) {
    41         upgrade.rdfDatasource = new vI.rdfDatasource(window, "virtualIdentity.rdf", true);
     41        upgrade.rdfDatasource = new vI.rdfDatasource(window, "virtualIdentity_0.10.rdf", true);
    4242        if (upgrade.rdfDatasource.extUpgradeRequired())
    4343          upgrade.extUpgrade();
     
    5353        switch (currentVersion) {
    5454        case null:
     55          // import pre-0.10 rdf
     56          var vI_localRdfDatasource =
     57            new virtualIdentityExtension.rdfDatasourceImporter(window, 'virtualIdentity_0.10.rdf', false);
     58          vI_localRdfDatasource.importFileByName("virtualIdentity.rdf");
    5559          // no break
    5660        default:
    5761          upgrade.__transferMovedUserPrefs(currentVersion);
    5862          upgrade.__removeObsoleteUserPrefs(currentVersion);
    59           upgrade.__removeExtraAddedHeaders(currentVersion);
    60           upgrade.__cleanupSmartMailboxFolders(currentVersion);
    6163        }
    6264        upgrade.rdfDatasource.storeExtVersion();
     
    6466      },
    6567
    66       __cleanupSmartMailboxFolders: function (currentVersion) {
    67         if ((!currentVersion || upgrade.versionChecker.compare(currentVersion, "0.9.26") < 0)) {
    68           Log.debug("cleaning leftover 'smart mailboxes' == 'unified folder mailboxes'");
    69           // remove obsolete 'smart mailboxes'=='unified folder' server entries
    70           // this is only required because of a virtualIdentity bug introduced in 0.9.22 and fixed in 0.9.26
    71 
    72           //  compare against all accounts, getAccountsArray() does not include 'smart mailboxes' == 'unified folders'
    73           var all_accounts = vI.prefroot.getCharPref("mail.accountmanager.accounts").split(",");
    74 
    75           for (let pref of vI.prefroot.getChildList("mail.server")) {
    76              
    77              
    78             if (pref.indexOf(".hostname") == pref.length - 9 && vI.prefroot.getCharPref(pref) == "smart mailboxes") {
    79               // ok, smart mailbox server found, check if it still in use
    80               let server = pref.replace(/^mail\.server\./, "").replace(/\.hostname$/, "");
    81               let inUse = false;
    82               for (let account of all_accounts) {
    83                 if (vI.prefroot.getCharPref("mail.account." + account + ".server") == server)
    84                   inUse = true;
    85               }
    86               if (!inUse) {
    87                 Log.debug("cleaning leftover 'smart mailbox' for server " + server);
    88                 for (let obsoletePref of vI.prefroot.getChildList("mail.server." + server)) {
    89                   if (obsoletePref.indexOf(".directory") == obsoletePref.length - 10) {
    90                     // remove obsolete 'smart mailbox' directory
    91                     try {
    92                       let file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile);
    93                       file.initWithPath(vI.prefroot.getCharPref(obsoletePref));
    94                       Log.debug("removing obsolete storage Folder " + vI.prefroot.getCharPref(obsoletePref));
    95                       file.remove(true);
    96                     } catch (NS_ERROR_FILE_UNRECOGNIZED_PATH) {};
    97                   }
    98                   vI.prefroot.clearUserPref(obsoletePref);
    99                 }
    100               }
    101             }
    102           }
    103         }
    104       },
    105 
    106       __removeExtraAddedHeaders: function (currentVersion) {
    107         if ((!currentVersion || upgrade.versionChecker.compare(currentVersion, "0.6.9") < 0) &&
    108           vI.prefroot.getCharPref("mailnews.headers.extraExpandedHeaders") != "") {
    109           // clean extraExpandedHeaders once, because the whole header-saving and restoring was broken too long
    110           Log.debug("cleaning extraExpandedHeaders");
    111           vI.prefroot.setCharPref("mailnews.headers.extraExpandedHeaders", "")
    112           Log.debug("cleaned extraExpandedHeaders");
    113         }
    114       },
    115 
    11668      __transferMovedUserPrefs: function (currentVersion) {
    11769        // transfer renamed preferences
    118         var transferPrefs = [{
    119           version: "0.5.3",
    120           prefs: Array({
    121             sourcePref: "smart_reply_ask",
    122             targetPref: "idSelection_ask"
    123           }, {
    124             sourcePref: "smart_reply_ask_always",
    125             targetPref: "idSelection_ask_always"
    126           }, {
    127             sourcePref: "smart_reply_autocreate",
    128             targetPref: "idSelection_autocreate"
    129           }, {
    130             sourcePref: "smart_timestamp",
    131             targetPref: "autoTimestamp"
    132           }, {
    133             sourcePref: "storage_prefer_smart_reply",
    134             targetPref: "idSelection_storage_prefer_smart_reply"
    135           }, {
    136             sourcePref: "storage_ignore_smart_reply",
    137             targetPref: "idSelection_storage_ignore_smart_reply"
    138           })
    139         }];
     70        var transferPrefs = [
     71//         {
     72//           version: "0.5.3",
     73//           prefs: Array({
     74//             sourcePref: "smart_reply_ask",
     75//             targetPref: "idSelection_ask"
     76//           }, {
     77//             sourcePref: "smart_reply_ask_always",
     78//             targetPref: "idSelection_ask_always"
     79//           }, {
     80//             sourcePref: "smart_reply_autocreate",
     81//             targetPref: "idSelection_autocreate"
     82//           }, {
     83//             sourcePref: "smart_timestamp",
     84//             targetPref: "autoTimestamp"
     85//           }, {
     86//             sourcePref: "storage_prefer_smart_reply",
     87//             targetPref: "idSelection_storage_prefer_smart_reply"
     88//           }, {
     89//             sourcePref: "storage_ignore_smart_reply",
     90//             targetPref: "idSelection_storage_ignore_smart_reply"
     91//           })
     92//         }
     93        ];
    14094        // remove obsolete preference-tree virtualIdentity
    14195        for (var i = 0; i < transferPrefs.length; i++) {
     
    157111
    158112      __removeObsoleteUserPrefs: function (currentVersion) {
    159         var obsoletePrefs = [{
    160           version: "0.5.0",
    161           prefs: Array("aBook_use", "aBook_storedefault", "aBook_dont_update_multiple",
    162             "aBook_show_switch", "aBook_warn_update", "aBook_use_for_smart_reply",
    163             "aBook_prefer_smart_reply", "aBook_ignore_smart_reply", "aBook_warn_vI_replace",
    164             "aBook_use_non_vI", "aBook_notification", "storeVIdentity", "experimental",
    165             "storage_use_for_smart_reply")
    166         }, {
    167           version: "0.5.3",
    168           prefs: Array("storage_use_for_smart_reply")
    169         }, {
    170           version: "0.5.6",
    171           prefs: Array("copyEnigmailSettings")
    172         }, {
    173           version: "0.9",
    174           prefs: Array("extensions.virtualIdentity.{2ab1b709-ba03-4361-abf9-c50b964ff75d}",
    175             "extensions.virtualIdentity.{847b3a00-7ab1-11d4-8f02-006008948af5}",
    176             "extensions.virtualIdentity.smart_reply_added_extraHeaders",
    177             "mailnews.headers.extraExpandedHeaders")
    178         }];
     113        var obsoletePrefs = [
     114        {
     115          version: "0.10",
     116          prefs: Array("extensions.virtualIdentity.show_smtp",
     117            "extensions.virtualIdentity.storage_store_SMTP",
     118            "extensions.virtualIdentity.storage_show_SMTP_switch")
     119        }
     120        ];
    179121        // remove obsolete preference-tree virtualIdentity
    180122        for (var i = 0; i < obsoletePrefs.length; i++) {
  • locale/en-US/vI_rdfAccountMismatchDialog.dtd

    r85fa10 rc5860f  
    66<!ENTITY vident.virtualIdentityExtension_rdfAccountMismatchDialog_smtp.desc "Some of the previously stored SMTP-servers don't match the current SMTP-Settings. Please select if the folowing stored SMTP-relations should be removed or assign those to existing SMTP servers:">
    77<!ENTITY vident.virtualIdentityExtension_rdfAccountMismatchDialog_smtp.caption "assign related SMTP-server">
     8<!ENTITY vident.virtualIdentityExtension_rdfAccountMismatchDialog_smtpid.desc "The new version of virtual Identity selects the SMTP-server according to the used underlaying base Identity. This collides with some of your stored identity settings - please select if the folowing stored SMTP-relations should be removed or assign those to the right identities:">
     9<!ENTITY vident.virtualIdentityExtension_rdfAccountMismatchDialog_smtpid.caption "assign mismatching SMTP-servers:">
    810<!ENTITY vident.virtualIdentityExtension_rdfAccountMismatchDialog_identity.old "previous Identity (email / full Name)">
    911<!ENTITY vident.virtualIdentityExtension_rdfAccountMismatchDialog_identity.count "use-count">
     
    1214<!ENTITY vident.virtualIdentityExtension_rdfAccountMismatchDialog_smtp.count "use-count">
    1315<!ENTITY vident.virtualIdentityExtension_rdfAccountMismatchDialog_smtp.new "new SMTP (hostname / username)">
     16<!ENTITY vident.virtualIdentityExtension_rdfAccountMismatchDialog_smtpid.old "stored SMTP / base Identity (SMTP)">
     17<!ENTITY vident.virtualIdentityExtension_rdfAccountMismatchDialog_smtpid.count "use-count">
     18<!ENTITY vident.virtualIdentityExtension_rdfAccountMismatchDialog_smtpid.new "new base Identity (SMTP)">
Note: See TracChangeset for help on using the changeset viewer.