Changeset 6c9403


Ignore:
Timestamp:
Nov 22, 2011, 2:56:17 PM (8 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
855e5e
Parents:
ca4823
Message:

final removement of old preferences

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • content/bindings/v_identity.xml

    rca4823 r6c9403  
    585585    <field name="tooltipElem">document.getAnonymousElementByAttribute(this, "anonid", "contentHBox")</field>
    586586    <field name="textBoxElem">document.getAnonymousElementByAttribute(this, "anonid", "textBox");</field>
    587     <field name="_prefroot">Components.classes["@mozilla.org/preferences-service;1"]
    588         .getService(Components.interfaces.nsIPrefService)
    589         .getBranch(null).QueryInterface(Components.interfaces.nsIPrefBranch2)</field>
    590587    <method name="observe">
    591588      <parameter name="self" />
  • modules/plugins/conversations.js

    rca4823 r6c9403  
    3232Cu.import("resource://v_identity/vI_smartIdentityCollection.js");
    3333Cu.import("resource://v_identity/vI_identityData.js");
     34Cu.import("resource://v_identity/vI_prefs.js");
    3435
    3536let Log = setupLogging("virtualIdentity.plugins.conversations");
    36 
    37 let pref = Cc["@mozilla.org/preferences-service;1"]
    38   .getService(Components.interfaces.nsIPrefService)
    39   .getBranch("extensions.virtualIdentity.");
    4037
    4138const AccountManager = Cc["@mozilla.org/messenger/account-manager;1"]
     
    9895      return;
    9996 
    100     if (pref.getBoolPref("idSelection_preferExisting")) {
     97    if (vIprefs.get("idSelection_preferExisting")) {
    10198      var existingIDIndex = localSmartIdentityCollection._foundExistingIdentity();
    10299      if (existingIDIndex) {
     
    107104    }
    108105
    109     if (pref.getBoolPref("idSelection_ask") &&
    110       ((localSmartIdentityCollection._allIdentities.number == 1 && pref.getBoolPref("idSelection_ask_always"))
     106    if (vIprefs.get("idSelection_ask") &&
     107      ((localSmartIdentityCollection._allIdentities.number == 1 && vIprefs.get("idSelection_ask_always"))
    111108      || localSmartIdentityCollection._allIdentities.number > 1)) {
    112109        recentWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
     
    119116          /* callback: */ changeIdentityToSmartIdentity).focus();
    120117      }
    121     else if (pref.getBoolPref("idSelection_autocreate"))
     118    else if (vIprefs.get("idSelection_autocreate"))
    122119      changeIdentityToSmartIdentity(localSmartIdentityCollection._allIdentities, 0);
    123120  },
     
    182179  onRecipientAdded: function _virtualIdentityHook_onRecipientAdded(aData, aType, aCount) {
    183180    Log.debug("onRecipientAdded", aData.data, aType, aCount);
    184     if (!pref.getBoolPref("storage")) return;
     181    if (!vIprefs.get("storage")) return;
    185182    if (aType == "bcc") return;
    186183    if (aData.data == "") return;
  • modules/vI_identityDataExtras.js

    rca4823 r6c9403  
    2828
    2929Cu.import("resource://v_identity/vI_log.js");
     30Cu.import("resource://v_identity/vI_prefs.js");
     31
    3032let Log = setupLogging("virtualIdentity.identityDataExtras");
    31 
    32 let preferences = Cc["@mozilla.org/preferences-service;1"]
    33   .getService(Ci.nsIPrefService)
    34   .getBranch("extensions.virtualIdentity.");
    3533
    3634let stringBundle = Cc["@mozilla.org/intl/stringbundle;1"]
     
    184182    return "";
    185183  },
    186   get active() { return preferences.getBoolPref("storage") && preferences.getBoolPref(this.option) },
     184  get active() { return vIprefs.get("storage") && vIprefs.get(this.option) },
    187185  equal : function(compareIdentityDataExtrasObject) {
    188186    this.lastCompareValue = compareIdentityDataExtrasObject.valueHtml;
  • modules/vI_log.js

    rca4823 r6c9403  
    2929const {classes: Cc, interfaces: Ci, utils: Cu, results : Cr} = Components;
    3030
    31 Cu.import("resource:///modules/gloda/log4moz.js");
    32 preferences = Components.classes["@mozilla.org/preferences-service;1"]
    33   .getService(Components.interfaces.nsIPrefService)
    34   .getBranch("extensions.virtualIdentity.");
    35 
     31Cu.import("resource://v_identity/vI_prefs.js");
    3632
    3733// different formatters for the log output
     
    143139    obj_notificationBox.appendNotification(newLabel, "", "chrome://messenger/skin/icons/flag.png");
    144140
    145     if (preferences.getIntPref("notification_timeout") != 0)
     141    if (vIprefs.get("notification_timeout") != 0)
    146142      this.timer =
    147143        this.currentWindow.setTimeout(this.clearNote,
    148                                       preferences.getIntPref("notification_timeout") * 1000, this);
     144                                      vIprefs.get("notification_timeout") * 1000, this);
    149145  }
    150146}
     
    183179  root.level = Log4Moz.Level["All"];
    184180
    185   if (preferences.getBoolPref("debug_notification")) {
     181  if (vIprefs.get("debug_notification")) {
    186182    // A console appender outputs to the JS Error Console
    187183    let capp = new Log4Moz.ConsoleAppender(myBasicFormatter);
     
    234230let myNotificationFormatter = new NotificationFormatter();
    235231let SmartReplyNotification = Log4Moz.repository.getLogger("virtualIdentity.SmartReply");
    236 if (preferences.getBoolPref("smart_reply_notification")) {
     232if (vIprefs.get("smart_reply_notification")) {
    237233  let napp = new NotificationOutputAppender(myNotificationFormatter);
    238234  napp.level = Log4Moz.Level["All"];
     
    240236}
    241237let StorageNotification = Log4Moz.repository.getLogger("virtualIdentity.StorageNotification");
    242 if (preferences.getBoolPref("storage_notification")) {
     238if (vIprefs.get("storage_notification")) {
    243239  let napp = new NotificationOutputAppender(myNotificationFormatter);
    244240  napp.level = Log4Moz.Level["All"];
     
    246242}
    247243let GetHeaderNotification = Log4Moz.repository.getLogger("virtualIdentity.GetHeaderNotification");
    248 if (preferences.getBoolPref("get_header_notification")) {
     244if (vIprefs.get("get_header_notification")) {
    249245  let napp = new NotificationOutputAppender(myNotificationFormatter);
    250246  napp.level = Log4Moz.Level["All"];
  • modules/vI_smartIdentityCollection.js

    rca4823 r6c9403  
    2828Components.utils.import("resource://v_identity/vI_identityData.js");
    2929Components.utils.import("resource://v_identity/vI_rdfDatasource.js");
     30Components.utils.import("resource://v_identity/vI_prefs.js");
     31
    3032let Log = setupLogging("virtualIdentity.smartIdentityCollection");
    3133
     
    4648    messenger : Components.classes["@mozilla.org/messenger;1"].createInstance()
    4749        .QueryInterface(Components.interfaces.nsIMessenger),
    48     _pref : Components.classes["@mozilla.org/preferences-service;1"]
    49             .getService(Components.interfaces.nsIPrefService)
    50             .getBranch("extensions.virtualIdentity."),
    5150    _unicodeConverter : Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
    5251            .createInstance(Components.interfaces.nsIScriptableUnicodeConverter),
     
    7776        Log.debug("current email: " + current_email[0] + "@" + current_email[1] + "\n");
    7877       
    79         var autoString = this._pref.getCharPref("autoString");
    80         var formatString = this._pref.getCharPref("autoTimeFormat");
     78        var autoString = vIprefs.get("autoString");
     79        var formatString = vIprefs.get("autoTimeFormat");
    8180       
    8281        var dateObj = new Date(); var dateString = "";
     
    9796   
    9897    __ignoreID : function() {
    99         Log.debug("checking " + this._pref.getCharPref("idSelection_ignoreIDs") + " against " + this._preselectedID.key + "\n")
     98        Log.debug("checking " + vIprefs.get("idSelection_ignoreIDs") + " against " + this._preselectedID.key + "\n")
    10099        // check if usage if virtual Identities should be used at all for the currently selected ID
    101         if (this._pref.getCharPref("idSelection_ignoreIDs").indexOf(":" + this._preselectedID.key + ":") != -1) {
     100        if (vIprefs.get("idSelection_ignoreIDs").indexOf(":" + this._preselectedID.key + ":") != -1) {
    102101            Log.debug("not using virtual Identites for ID " + this._preselectedID.key + "\n");
    103102            return true;
     
    110109        if (this.__ignoreID()) return;
    111110        this._rdfDatasourceAccess.getVIdentityFromAllRecipients(this._allIdentities, this._recipients);
    112         if (this._allIdentities.number == 0 && this._pref.getBoolPref("autoTimestamp")) this.__autoTimestamp();
     111        if (this._allIdentities.number == 0 && vIprefs.get("autoTimestamp")) this.__autoTimestamp();
    113112    },
    114113   
     
    158157    // this function checks if we have a draft-case and Smart-Draft should replace the Identity
    159158    __SmartDraftOrReplyOnSent : function() {
    160         if (!this._pref.getBoolPref("smart_draft"))
     159        if (!vIprefs.get("smart_draft"))
    161160            { Log.debug("SmartDraft deactivated\n"); return; }
    162161
     
    174173       
    175174        var filterList  =
    176             this._unicodeConverter.ConvertToUnicode(this._pref.getCharPref("smart_reply_filter")).split(/\n/)
     175            this._unicodeConverter.ConvertToUnicode(vIprefs.get("smart_reply_filter")).split(/\n/)
    177176        if (filterList.length == 0) filterList[0] == ""
    178177       
     
    223222    __smartReplyCollectAddresses : function() {
    224223        // add emails from selected headers (stored by vI_getHeader.xul/js)
    225         var reply_headers = this._unicodeConverter.ConvertToUnicode(this._pref.getCharPref("smart_reply_headers")).split(/\n/)
     224        var reply_headers = this._unicodeConverter.ConvertToUnicode(vIprefs.get("smart_reply_headers")).split(/\n/)
    226225                   
    227226        for (var index = 0; index < reply_headers.length; index++) {
     
    295294        //  hidden option smart_detectByReceivedHeader will act as a switch for not RFC-compliant servers
    296295            // RFC-compliant
    297             if (this._pref.getBoolPref("smart_detectByReceivedHeader")) {
     296            if (vIprefs.get("smart_detectByReceivedHeader")) {
    298297                if (!this._msgHdr.getStringProperty("vI_received")) { // mail was not received
    299298                    Log.debug("reply on non-received (sent?) mail. Using SmartDraft. \n");
     
    325324        this._rdfDatasourceAccess.getVIdentityFromAllRecipients(storageIdentities, this._recipients);
    326325       
    327         if (storageIdentities.number == 0 || !this._pref.getBoolPref("idSelection_storage_ignore_smart_reply"))
     326        if (storageIdentities.number == 0 || !vIprefs.get("idSelection_storage_ignore_smart_reply"))
    328327            this.__SmartReply();
    329328        else Log.debug("SmartReply skipped, Identities in Storage found.\n");
    330329
    331330        // merge SmartReply-Identities and Storage-Identites
    332         if (this._pref.getBoolPref("idSelection_storage_prefer_smart_reply"))
     331        if (vIprefs.get("idSelection_storage_prefer_smart_reply"))
    333332            { this._allIdentities.mergeWithoutDuplicates(storageIdentities); }
    334333        else {
     
    343342    // this function checks if we have a reply-case and Smart-Reply should replace the Identity
    344343    __SmartReply : function() {
    345         if (!this._pref.getBoolPref("smart_reply"))
     344        if (!vIprefs.get("smart_reply"))
    346345            { Log.debug("SmartReply deactivated\n"); return; }
    347         if (this._newsgroup && !this._pref.getBoolPref("smart_reply_for_newsgroups")) {
     346        if (this._newsgroup && !vIprefs.get("smart_reply_for_newsgroups")) {
    348347            Log.debug("SmartReply, answering to a newsgroup, aborting\n");
    349348            return;
     
    363362           
    364363            /* set default FullName */
    365             var smart_reply_defaultFullName = this._unicodeConverter.ConvertToUnicode(this._pref.getCharPref("smart_reply_defaultFullName"))
     364            var smart_reply_defaultFullName = this._unicodeConverter.ConvertToUnicode(vIprefs.get("smart_reply_defaultFullName"))
    366365            if (smart_reply_defaultFullName != "") {
    367366                for (var index = 0; index < this._allIdentities.number; index++) {
     
    377376            /* if match replace FullName with existing one, keep identity in list by now        */
    378377            /* will not be added to the menu but probably choosen with __smartIdentitySelection     */
    379             if (this._pref.getBoolPref("smart_reply_ignoreFullName")) {
     378            if (vIprefs.get("smart_reply_ignoreFullName")) {
    380379                Log.debug("compare with existing Identities (ignoring FullNames).\n")
    381380           
Note: See TracChangeset for help on using the changeset viewer.