Skip to content

Commit

Permalink
See changelog
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.getfiregpg.org/firegpg@388 1e1cc2a3-b62a-0410-bc93-fb3b3b0a0737
  • Loading branch information
theglu committed May 7, 2008
1 parent a2f1be5 commit 1c53807
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 13 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,3 +1,7 @@
2008-05-07 Maximilien Cuony
* Implemented sub key for key selection (but widout the new keys' list system)
* Add flexibility to some dialogs

2008-05-06 Maximilien Cuony
* Reforming key lists communication system, implementing subkey system.
* New key list implemented for options.
Expand Down
58 changes: 53 additions & 5 deletions content/list.js
Expand Up @@ -135,16 +135,64 @@ function onLoad(win)
savedList[k] = new Array(list[id].keyName, list[id].keyId, list[id].keyDate, list[id].keyExpi, (list[id].keyName + list[id].keyId+ list[id].keyDate + list[id].keyExpi) .toLowerCase() );
k++;

//var newItem = listInDialog.appendItem(list[id], id);


if (selected == true) {
listOfAutoSelect[j] = item;
j++;
//listInDialog.addItemToSelection(newItem);
//newItem.setAttribute('selected', selected);
}

//TODO : Find a better way
if (list[id].subKeys.length > 0) {

for(var kid in list[id].subKeys){

if (list[id].subKeys[kid].keyName == "")
continue;

selected = false;

if (autoSelectMode == true) {

var reg = new RegExp('[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}', 'gi');

var theMail = reg.exec(list[id].subKeys[kid].keyName);

if (theMail != null) {
if (testList.indexOf(theMail) != -1)
selected = true;
}

}

var item = document.createElement('listitem');

var child1 = document.createElement('listcell');
child1.setAttribute('label', "> " +list[id].subKeys[kid].keyName);
item.appendChild(child1);

var child2 = document.createElement('listcell');
child2.setAttribute('label', list[id].keyId);
item.appendChild(child2);

var child3 = document.createElement('listcell');
child3.setAttribute('label', list[id].subKeys[kid].keyDate);
item.appendChild(child3);

var child4 = document.createElement('listcell');
child4.setAttribute('label', list[id].subKeys[kid].keyExpi);
item.appendChild(child4);

listInDialog.appendChild(item);

savedList[k] = new Array("> " + list[id].subKeys[kid].keyName, list[id].keyId, list[id].subKeys[kid].keyDate, list[id].subKeys[kid].keyExpi, (list[id].subKeys[kid].keyName + list[id].subKeys[kid].keyId+ list[id].subKeys[kid].keyDate + list[id].subKeys[kid].keyExpi) .toLowerCase() );
k++;

if (selected == true) {
listOfAutoSelect[j] = item;
j++;
}
}
}

}

// description
Expand Down
2 changes: 1 addition & 1 deletion content/list.xul
Expand Up @@ -43,7 +43,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
ondialogaccept="return onAccept()">
<script src="list.js"/>
<vbox>
<vbox flex="1" >
<description control="list" id="description" value="default description"/>
<listbox id="list" seltype="multiple" flex="1" rows="20" style="width:35em" ondblclick="acceptDialog()">
<listhead>
Expand Down
10 changes: 8 additions & 2 deletions content/misc.js
Expand Up @@ -1123,8 +1123,9 @@ function EnigConvertToUnicode(text, charset) {
Parameters:
key - The key
document - The current document.
forceId - If we have to force the id of the key
*/
function CreateTreeItemKey(key, document) {
function CreateTreeItemKey(key, document, forceId) {
var item = document.createElement('treeitem');

var row = document.createElement('treerow');
Expand All @@ -1145,7 +1146,12 @@ function CreateTreeItemKey(key, document) {
child4.setAttribute('label', key.keyExpi);
row.appendChild(child4);

row.setAttribute('gpg-id',key.keyId);
var id = key.keyId;

if (forceId != undefined)
id = forceId;

row.setAttribute('gpg-id', id);

item.appendChild(row);

Expand Down
5 changes: 1 addition & 4 deletions content/options.js
Expand Up @@ -139,10 +139,7 @@ function onLoad(win)

if (gpg_keys[key].subKeys[skey].keyName) {

if(default_private_key == gpg_keys[key].subKeys[skey].keyId)
default_item = -1;

var subItem = CreateTreeItemKey( gpg_keys[key].subKeys[skey] ,document);
var subItem = CreateTreeItemKey( gpg_keys[key].subKeys[skey] ,document, gpg_keys[key].keyId);

subChildren.appendChild(subItem);
}
Expand Down
2 changes: 1 addition & 1 deletion content/showtext.xul
Expand Up @@ -52,7 +52,7 @@
<script src="cgpg.js"/>

<description control="text" id="description" value="default description"/>
<textbox id="text" multiline="true" rows="25" cols="80"/>
<textbox id="text" multiline="true" rows="25" cols="80" flex="1"/>
<label id="dcryptsignresult" style="display: none;" />

<hbox id="buttons-box">
Expand Down

0 comments on commit 1c53807

Please sign in to comment.