3
* ***** BEGIN LICENSE BLOCK *****
4
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
6
* The contents of this file are subject to the Mozilla Public
7
* License Version 1.1 (the "MPL"); you may not use this file
8
* except in compliance with the MPL. You may obtain a copy of
9
* the MPL at http://www.mozilla.org/MPL/
11
* Software distributed under the MPL is distributed on an "AS
12
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
13
* implied. See the MPL for the specific language governing
14
* rights and limitations under the MPL.
16
* The Original Code is Enigmail.
18
* The Initial Developer of the Original Code is Patrick Brunschwig.
19
* Portions created by Patrick Brunschwig <patrick@mozilla-enigmail.org> are
20
* Copyright (C) 2004 Patrick Brunschwig. All Rights Reserved.
24
* Alternatively, the contents of this file may be used under the terms of
25
* either the GNU General Public License Version 2 or later (the "GPL"), or
26
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
* in which case the provisions of the GPL or the LGPL are applicable instead
28
* of those above. If you wish to allow use of your version of this file only
29
* under the terms of either the GPL or the LGPL, and not to allow others to
30
* use your version of this file under the terms of the MPL, indicate your
31
* decision by deleting the provisions above and replace them with the notice
32
* and other provisions required by the GPL or the LGPL. If you do not delete
33
* the provisions above, a recipient may use your version of this file under
34
* the terms of any one of the MPL, the GPL or the LGPL.
35
* ***** END LICENSE BLOCK ***** *
39
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
40
<?xml-stylesheet href="chrome://enigmail/skin/enigmail.css" type="text/css"?>
43
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
45
<!ENTITY % enigMailDTD SYSTEM "chrome://enigmail/locale/enigmail.dtd" >
49
<dialog id="enigmailEditKeyTrustDlg"
50
title="&enigmail.keyTrust.title;"
51
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
53
ondialogaccept="return onAccept();"
57
<script type="application/x-javascript">
60
Components.utils.import("resource://enigmail/enigmailCommon.jsm");
61
Components.utils.import("resource://enigmail/keyManagement.jsm");
62
const Ec = EnigmailCommon;
65
// set current key trust if only one key is changed
66
var enigmailSvc = Ec.getService(window);
70
var errorMsgObj = new Object();
71
var exitCodeObj = new Object();
73
window.arguments[1].refresh = false;
76
var sigListStr = enigmailSvc.getKeySig("0x"+window.arguments[0].keyId.join(" 0x"), exitCodeObj, errorMsgObj);
77
if (exitCodeObj.value == 0) {
78
var sigList = sigListStr.split(/[\n\r]+/);
79
for (var i=0; i < sigList.length; i++) {
80
var aLine=sigList[i].split(/:/);
81
if (aLine[0] == "pub") {
82
currTrust=(("-nmfuq").indexOf(aLine[8]) % 5)+1;
83
if (lastTrust==-1) lastTrust=currTrust;
84
if (currTrust != lastTrust) {
91
var t=document.getElementById("trustLevel"+currTrust.toString());
92
document.getElementById("trustLevelGroup").selectedItem=t;
97
var keyIdList = document.getElementById("keyIdList");
98
for (i=0; i<window.arguments[0].userId.length; i++) {
99
var keyId = window.arguments[0].userId[i]+" - 0x"+ window.arguments[0].keyId[i].substr(-8,8);
100
keyIdList.appendItem(keyId);
104
function processNextKey(index) {
105
Ec.DEBUG_LOG("enigmailEditKeyTrust: processNextKey("+index+")\n");
107
var t=document.getElementById("trustLevelGroup");
108
EnigmailKeyMgmt.setKeyTrust(window,
109
window.arguments[0].keyId[index],
110
Number(t.selectedItem.value),
111
function(exitCode, errorMsg) {
113
Ec.alert(window, Ec.getString("setKeyTrustFailed")+"\n\n"+errorMsg);
118
window.arguments[1].refresh = true;
122
if (index == window.arguments[0].keyId.length)
125
processNextKey(index);
130
function onAccept() {
138
<vbox orient="vertical">
140
<label value="&enigmail.keyTrust.trustKey.label;" control="keyIdList"/>
141
<listbox flex="1" id="keyIdList" style="height:60px"/>
146
<caption label="&enigmail.keyTrust.trustLevel.label;"/>
147
<radiogroup id="trustLevelGroup">
148
<radio value="1" id="trustLevel1"
149
label="&enigmail.keyTrust.dontKnow.label;"/>
150
<radio value="2" id="trustLevel2"
151
label="&enigmail.keyTrust.noTrust.label;"/>
152
<radio value="3" id="trustLevel3"
153
label="&enigmail.keyTrust.marginalTrust.label;"/>
154
<radio value="4" id="trustLevel4"
155
label="&enigmail.keyTrust.fullTrust.label;"/>
156
<radio value="5" id="trustLevel5"
157
label="&enigmail.keyTrust.ultimateTrust.label;"/>