diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-08-14 04:34:41 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-08-14 04:34:41 +0300 |
commit | 92699e2fcd4a7d03b8e1eae29e678773bfa07da8 (patch) | |
tree | b5032a3641672202ddbb5d8fec1fcf50ca99afad | |
parent | ea8554407ed4038aca0eb7835f9d813bdf37c1a9 (diff) |
modified: main.cpp
modified: messages.cpp
modified: options.cpp
-rw-r--r-- | main.cpp | 2 | ||||
-rw-r--r-- | messages.cpp | 2 | ||||
-rw-r--r-- | options.cpp | 39 |
3 files changed, 29 insertions, 14 deletions
@@ -46,7 +46,7 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
- col.pszText = _T("Fingerprint");
+ col.pszText = _T("Key ID");
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.fmt = LVCFMT_LEFT;
col.cx = 50;
diff --git a/messages.cpp b/messages.cpp index 5c37e71..5214429 100644 --- a/messages.cpp +++ b/messages.cpp @@ -215,7 +215,7 @@ int SendMsgSvc(WPARAM w, LPARAM l) DWORD code;
wstring cmd;
wstring path;
- char *tmp = UniGetContactSettingUtf(ccs->hContact, szModuleName, "KeyFingerprint", "");
+ char *tmp = UniGetContactSettingUtf(ccs->hContact, szModuleName, "KeyID", "");
if(strlen(tmp) < 2)
{
mir_free(tmp);
diff --git a/options.cpp b/options.cpp index ced2f64..7f929d1 100644 --- a/options.cpp +++ b/options.cpp @@ -106,23 +106,29 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA col.cx = 100;
ListView_InsertColumn(hwndList, 0, &col);
ZeroMemory(&col,sizeof(col));
- col.pszText = _T("Fingerprint");
+ col.pszText = _T("Key ID");
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.fmt = LVCFMT_LEFT;
col.cx = 30;
ListView_InsertColumn(hwndList, 1, &col);
ZeroMemory(&col,sizeof(col));
- col.pszText = _T("PubKey");
+ col.pszText = _T("Name");
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.fmt = LVCFMT_LEFT;
- col.cx = 250;
+ col.cx = 30;
ListView_InsertColumn(hwndList, 2, &col);
ZeroMemory(&col,sizeof(col));
- col.pszText = _T("Protocol");
+ col.pszText = _T("Email");
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.fmt = LVCFMT_LEFT;
col.cx = 30;
ListView_InsertColumn(hwndList, 3, &col);
+ ZeroMemory(&col,sizeof(col));
+ col.pszText = _T("Protocol");
+ col.mask = LVCF_TEXT | LVCF_WIDTH;
+ col.fmt = LVCFMT_LEFT;
+ col.cx = 30;
+ ListView_InsertColumn(hwndList, 4, &col);
ListView_SetExtendedListViewStyleEx(hwndList, 0, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT);
int i = 1, iRow = 0;
for(HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact != NULL; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
@@ -135,15 +141,23 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA iRow = ListView_InsertItem(hwndList, &item);
ListView_SetItemText(hwndList, iRow, 0, name);
TCHAR *tmp = mir_a2t((char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0));
- ListView_SetItemText(hwndList, iRow, 3, tmp);
+ ListView_SetItemText(hwndList, iRow, 4, tmp);
mir_free(tmp);
- tmp = UniGetContactSettingUtf(hContact, szModuleName, "GPGPubKey", _T("not set"));
+ tmp2 = UniGetContactSettingUtf(hContact, szModuleName, "KeyID", "");
+ tmp = mir_a2t(tmp2);
+ mir_free(tmp2);
+ ListView_SetItemText(hwndList, iRow, 1, (_tcslen(tmp) > 1)?tmp:_T("not set"));
+ mir_free(tmp);
+ tmp2 = UniGetContactSettingUtf(hContact, szModuleName, "KeyMainName", "");
+ tmp = mir_a2t(tmp2);
+ mir_free(tmp2);
ListView_SetItemText(hwndList, iRow, 2, (_tcslen(tmp) > 1)?tmp:_T("not set"));
mir_free(tmp);
- tmp2 = UniGetContactSettingUtf(hContact, szModuleName, "KeyFingerprint", "");
+ tmp2 = UniGetContactSettingUtf(hContact, szModuleName, "KeyMainEmail", "");
tmp = mir_a2t(tmp2);
mir_free(tmp2);
- ListView_SetItemText(hwndList, iRow, 1, (_tcslen(tmp) > 1)?tmp:_T("not set"));
+ ListView_SetItemText(hwndList, iRow, 3, (_tcslen(tmp) > 1)?tmp:_T("not set"));
+ mir_free(tmp);
if(DBGetContactSettingByte(hContact, szModuleName, "GPGEncryption", 0))
ListView_SetItemState(hwndList, iRow, 0x2000, 0xF000);
user_data[i] = hContact;
@@ -154,6 +168,7 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ListView_SetColumnWidth(hwndList, 1, LVSCW_AUTOSIZE);
ListView_SetColumnWidth(hwndList, 2, LVSCW_AUTOSIZE);
ListView_SetColumnWidth(hwndList, 3, LVSCW_AUTOSIZE);
+ ListView_SetColumnWidth(hwndList, 4, LVSCW_AUTOSIZE);
return TRUE;
}
@@ -171,12 +186,12 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TCHAR *ptmp;
char *tmp;
bool keep = false;
- tmp = UniGetContactSettingUtf(user_data[item_num+1], szModuleName, "KeyFingerprint", "");
+ tmp = UniGetContactSettingUtf(user_data[item_num+1], szModuleName, "KeyID", "");
for(HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact != NULL; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
{
if(hContact != user_data[item_num+1])
{
- char *tmp2 = UniGetContactSettingUtf(hContact, szModuleName, "KeyFingerprint", "");
+ char *tmp2 = UniGetContactSettingUtf(hContact, szModuleName, "KeyID", "");
if(!strcmp(tmp, tmp2))
{
mir_free(tmp2);
@@ -208,7 +223,7 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
mir_free(tmp);
}
- DBDeleteContactSetting(user_data[item_num+1], szModuleName, "KeyFingerprint");
+ DBDeleteContactSetting(user_data[item_num+1], szModuleName, "KeyID");
DBDeleteContactSetting(user_data[item_num+1], szModuleName, "GPGPubKey");
DBDeleteContactSetting(user_data[item_num+1], szModuleName, "KeyMainName");
DBDeleteContactSetting(user_data[item_num+1], szModuleName, "KeyType");
@@ -509,7 +524,7 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP {
string::size_type s = output.find("gpg: key ") + strlen("gpg: key ");
string::size_type s2 = output.find(":", s);
- DBWriteContactSettingString(user_data[item_num+1], szModuleName, "KeyFingerprint", output.substr(s,s2-s).c_str());
+ DBWriteContactSettingString(user_data[item_num+1], szModuleName, "KeyID", output.substr(s,s2-s).c_str());
s2+=2;
s = output.find("\"", s2)-1;
if(s != s2-1)
|