Changeset 193c97


Ignore:
Timestamp:
Jul 18, 2009, 5:22:16 PM (12 years ago)
Author:
rene <rene@…>
Branches:
lite_0.1, multiEdit, ng_0.6, ng_0.6_help, ng_0.8, ng_0.9
Children:
d3904b
Parents:
039e6e
Message:

prefDialog optimization

Location:
chrome/content/v_identity
Files:
3 edited

Legend:

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

    r039e6e r193c97  
    5252    },
    5353
     54    extensionActive : function (extensionID) {
     55        // seamonkey has no extension-manager, return false in this case
     56        if (("nsIExtensionManager" in Components.interfaces) && ("@mozilla.org/extensions/manager;1" in Components.classes)) {
     57            var em = Components.classes["@mozilla.org/extensions/manager;1"]
     58                .getService(Components.interfaces.nsIExtensionManager);
     59            var rdfS = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
     60            var source = rdfS.GetResource("urn:mozilla:item:"+extensionID);
     61           
     62            var item = em.getItemForID(extensionID);
     63            if (!item || !item.installLocationKey) return false;
     64
     65            var disabledResource = rdfS.GetResource("http://www.mozilla.org/2004/em-rdf#disabled");
     66            var isDisabledResource = rdfS.GetResource("http://www.mozilla.org/2004/em-rdf#isDisabled");
     67            var disabled = em.datasource.GetTarget(source, disabledResource, true);
     68            if (!disabled) disabled = em.datasource.GetTarget(source, isDisabledResource, true);
     69
     70            try {
     71                disabled=disabled.QueryInterface(Components.interfaces.nsIRDFLiteral);
     72                if (disabled.Value=="true") return false;
     73            } catch (e) { }
     74            return true;
     75        }
     76        else return false;
     77    },
     78
    5479// vI_upgrade.js:229:
    5580// vI_upgrade.js:232:
  • chrome/content/v_identity/vI_prefDialog.js

    r039e6e r193c97  
    194194       
    195195        smartReplyHideSignature : function() {
    196             // seamonkey has no extension-manager
    197             if (("nsIExtensionManager" in Components.interfaces) && ("@mozilla.org/extensions/manager;1" in Components.classes)) {
    198                 var switch_signature_ID="{2ab1b709-ba03-4361-abf9-c50b964ff75d}"
    199                 var em = Components.classes["@mozilla.org/extensions/manager;1"]
    200                     .getService(Components.interfaces.nsIExtensionManager);
    201                 var rdfS = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
    202                 var source=rdfS.GetResource("urn:mozilla:item:"+switch_signature_ID)
    203                
    204                 var item = em.getItemForID(switch_signature_ID)
    205                 if (!item || !item.installLocationKey) return;
    206 
    207                 var disabledResource = rdfS.GetResource("http://www.mozilla.org/2004/em-rdf#disabled");
    208                 var isDisabledResource = rdfS.GetResource("http://www.mozilla.org/2004/em-rdf#isDisabled");
    209                 var disabled = em.datasource.GetTarget(source, disabledResource, true);
    210                 if (!disabled) disabled = em.datasource.GetTarget(source, isDisabledResource, true);
    211                 try {
    212                     disabled=disabled.QueryInterface(Components.interfaces.nsIRDFLiteral);
    213                     if (disabled.Value=="true") return;
    214                 } catch (e) { }
    215                
     196            const switch_signature_ID="{2ab1b709-ba03-4361-abf9-c50b964ff75d}"
     197            if (vI_helper.extensionActive(switch_signature_ID)) {
    216198                document.getElementById("VIdent_identity.HideSignature.warning").setAttribute("hidden", "true");
    217199                document.getElementById("VIdent_identity.hide_signature").setAttribute("disabled", "false");
     
    261243            document.getElementById("fccReplyFollowsParentBox").setAttribute("hidden", "true");
    262244        }
    263 //      if (!(typeof(enigSetMenuSettings)=="function")) {
    264 //          document.getElementById("openPGPencryption").setAttribute("hidden", "true");
    265 //      }
     245        const enigmail_ID="{847b3a00-7ab1-11d4-8f02-006008948af5}"
     246        if (!vI_helper.extensionActive(enigmail_ID))
     247            document.getElementById("openPGPencryption").setAttribute("hidden", "true");
    266248
    267249        vI_prefDialog.base.smartReplyConstraint(document.getElementById("VIdent_identity.smart_reply"));
     
    269251        vI_prefDialog.base.storageConstraint(document.getElementById("VIdent_identity.storage"));
    270252        vI_prefDialog.base.constraints();
    271         if (vI_storageExtrasHelper.seamonkey_to_old())
    272             document.getElementById("storageTab2").setAttribute("hidden", "true")
     253        if (vI_storageExtrasHelper.seamonkey_to_old()) {
     254            document.getElementById("storageExtrasTreeitem1").setAttribute("hidden", "true")
     255            document.getElementById("storageExtrasTreeitem2").setAttribute("hidden", "true")
     256        }
    273257    },
    274258   
  • chrome/content/v_identity/vI_prefDialog.xul

    r039e6e r193c97  
    519519                </treechildren>
    520520            </treeitem>
    521             <treeitem><treerow><treecell label="&vI_prefDialog.storageTab.Tab1.label;" /></treerow></treeitem>
    522             <treeitem><treerow><treecell label="&vI_prefDialog.storageTab.Tab2.label;" /></treerow></treeitem>
     521            <treeitem id="storageExtrasTreeitem1"><treerow><treecell label="&vI_prefDialog.storageTab.Tab1.label;" /></treerow></treeitem>
     522            <treeitem id="storageExtrasTreeitem2"><treerow><treecell label="&vI_prefDialog.storageTab.Tab2.label;" /></treerow></treeitem>
    523523        </treechildren>
    524524        </tree>
Note: See TracChangeset for help on using the changeset viewer.