summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2011-03-17 22:11:24 +0200
committerGluzskiy Alexandr <sss123next@list.ru>2011-03-17 22:11:24 +0200
commitbe35d4a3d07f44604ad71e6c6997c47f8b5bcdde (patch)
tree7e89c8fc32c2d95ddda18230deca7896f1f5d1e7 /main.cpp
parent4d6851c77b1d02968e83e60b1dfbed28cd729408 (diff)
parentd116d404808e9ae9a7860c1eecf0b5974b91c994 (diff)
Merge branch 'new_gpg' into new_gpg_autoexchange
Conflicts: main.cpp
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp59
1 files changed, 46 insertions, 13 deletions
diff --git a/main.cpp b/main.cpp
index ca6ecc1..7dad92f 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,4 +1,4 @@
-// Copyright � 2010 sss
+// Copyright � 2010-2011 sss
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -1145,6 +1145,9 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam,
delete [] tmp;
f<<length;
f<<"\n";
+ f<<"Subkey-Length: ";
+ f<<length;
+ f<<"\n";
f<<"Subkey-Type: ";
f<<subkeytype;
delete [] subkeytype;
@@ -1374,11 +1377,17 @@ static BOOL CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wParam,
col.cx = 30;
ListView_InsertColumn(hwndList, 3, &col);
ZeroMemory(&col,sizeof(col));
- col.pszText = _T("Key length");
+ col.pszText = _T("Expiration date");
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.fmt = LVCFMT_LEFT;
col.cx = 30;
ListView_InsertColumn(hwndList, 4, &col);
+ ZeroMemory(&col,sizeof(col));
+ col.pszText = _T("Key length");
+ col.mask = LVCF_TEXT | LVCF_WIDTH;
+ col.fmt = LVCFMT_LEFT;
+ col.cx = 30;
+ ListView_InsertColumn(hwndList, 5, &col);
ListView_SetExtendedListViewStyleEx(hwndList, 0, LVS_EX_FULLROWSELECT);
int i = 1, iRow = 0;
{
@@ -1421,30 +1430,53 @@ static BOOL CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wParam,
TCHAR *tmp = mir_wstrdup(toUTF16(out.substr(p,p2-p)).c_str());
item.pszText = tmp;
iRow = ListView_InsertItem(hwndList, &item);
- ListView_SetItemText(hwndList, iRow, 4, tmp);
+ ListView_SetItemText(hwndList, iRow, 5, tmp);
mir_free(tmp);
p2+=2;
p = out.find(" ", p2);
tmp = mir_wstrdup(toUTF16(out.substr(p2,p-p2)).c_str());
ListView_SetItemText(hwndList, iRow, 0, tmp);
mir_free(tmp);
-
p++;
p2 = out.find("\n", p);
+ string::size_type p3 = out.substr(p, p2-p).find("[");
+ if(p3 != string::npos)
+ {
+ p3+=p;
+ p2 = p3;
+ p2--;
+ p3++;
+ p3+=strlen("expires: ");
+ string::size_type p4 = out.find("]", p3);
+ tmp = mir_wstrdup(toUTF16(out.substr(p3,p4-p3)).c_str());
+ ListView_SetItemText(hwndList, iRow, 4, tmp);
+ mir_free(tmp);
+ }
+ else
+ p2--;
tmp = mir_wstrdup(toUTF16(out.substr(p,p2-p)).c_str());
ListView_SetItemText(hwndList, iRow, 3, tmp);
mir_free(tmp);
-
p = out.find("uid ", p);
- p2 = out.find_first_not_of(" ", p+5);
- p = out.find("<", p2);
- tmp = mir_wstrdup(toUTF16(out.substr(p2,p-p2)).c_str());
- ListView_SetItemText(hwndList, iRow, 2, tmp);
- mir_free(tmp);
- p++;
- p2 = out.find(">", p);
+ p+= strlen("uid ");
+ p2 = out.find("\n", p);
+ p3 = out.substr(p, p2-p).find("<");
+ if(p3 != string::npos)
+ {
+ p3+=p;
+ p2=p3;
+ p2--;
+ p3++;
+ string::size_type p4 = out.find(">", p3);
+ tmp = mir_wstrdup(toUTF16(out.substr(p3,p4-p3)).c_str());
+ ListView_SetItemText(hwndList, iRow, 1, tmp);
+ mir_free(tmp);
+ }
+ else
+ p2--;
+ p = out.find_first_not_of(" ", p);
tmp = mir_wstrdup(toUTF16(out.substr(p,p2-p)).c_str());
- ListView_SetItemText(hwndList, iRow, 1, tmp);
+ ListView_SetItemText(hwndList, iRow, 2, tmp);
mir_free(tmp);
// p = out.find("sub ", p2) + 6;
// p = out.find(" ", p) + 1;
@@ -1457,6 +1489,7 @@ static BOOL CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wParam,
ListView_SetColumnWidth(hwndList, 2, LVSCW_AUTOSIZE);
ListView_SetColumnWidth(hwndList, 3, LVSCW_AUTOSIZE);
ListView_SetColumnWidth(hwndList, 4, LVSCW_AUTOSIZE);
+ ListView_SetColumnWidth(hwndList, 5, LVSCW_AUTOSIZE);
i++;
}
}