diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-09-01 00:50:29 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-09-01 00:50:29 +0300 |
commit | 4f14d10536cd593a332fccdf6b954b8020f0b8d2 (patch) | |
tree | 85d5d5d8ee8b43ede24e1a1172ff3a37d2aeb288 /options.cpp | |
parent | adfbd68fc806c2c1fa79e0e878d2ff76a76bee8b (diff) |
modified: main.cpp
modified: messages.cpp
modified: new_gpg.rc
modified: options.cpp
modified: resource.h
Diffstat (limited to 'options.cpp')
-rw-r--r-- | options.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/options.cpp b/options.cpp index 766035e..161a5e5 100644 --- a/options.cpp +++ b/options.cpp @@ -80,13 +80,15 @@ int GpgOptInit(WPARAM wParam,LPARAM lParam) map<int, HANDLE> user_data; int item_num = 0; -HWND hwndList_p; +HWND hwndList_p = NULL; +HWND hwndCurKey_p = NULL; void ShowLoadPublicKeyDialog(); static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { HWND hwndList=GetDlgItem(hwndDlg, IDC_USERLIST); hwndList_p = hwndList; + hwndCurKey_p = GetDlgItem(hwndDlg, IDC_CURRENT_KEY); LVCOLUMN col = {0}; LVITEM item = {0}; TCHAR *tmp = NULL; @@ -176,6 +178,13 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA mir_free(tmp); CheckStateLoadDB(hwndDlg, IDC_DEBUG_LOG, "bDebugLog", 0); EnableWindow(GetDlgItem(hwndDlg, IDC_JABBER_API), bIsMiranda09); + { + string keyinfo = "Current private key id: "; + char *keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", ""); + keyinfo += (strlen(keyid) > 0)?keyid:"not set"; + mir_free(keyid); + SetDlgItemTextA(hwndDlg, IDC_CURRENT_KEY, keyinfo.c_str()); + } if(bIsMiranda09) CheckStateLoadDB(hwndDlg, IDC_JABBER_API, "bJabberAPI", 1); return TRUE; @@ -767,7 +776,7 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP } mir_free(tmp2); tmp = mir_utf8decodeW(output.substr(s,s2-s).c_str()); - if(hContact) + if(hContact && hwndList_p) ListView_SetItemText(hwndList_p, item_num, 1, tmp); mir_free(tmp); s2+=2; @@ -829,7 +838,7 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP } mir_free(tmp2); tmp = mir_utf8decodeW(output.substr(s,s2-s-1).c_str()); - if(hContact) + if(hContact && hwndList_p) ListView_SetItemText(hwndList_p, item_num, 2, tmp); mir_free(tmp); if((s = output.find(")", s2)) == string::npos) @@ -890,7 +899,7 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP } mir_free(tmp2); tmp = mir_utf8decodeW(output.substr(s,s2-s).c_str()); - if(hContact) + if(hContact && hwndList_p) ListView_SetItemText(hwndList_p, item_num, 3, tmp); mir_free(tmp); } @@ -922,11 +931,11 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP } mir_free(tmp2); tmp = mir_utf8decodeW(output.substr(s2,s-s2).c_str()); - if(hContact) + if(hContact && hwndList_p) ListView_SetItemText(hwndList_p, item_num, 3, tmp); mir_free(tmp); } - if(hContact) + if(hContact && hwndList_p) { ListView_SetColumnWidth(hwndList_p, 0, LVSCW_AUTOSIZE); ListView_SetColumnWidth(hwndList_p, 1, LVSCW_AUTOSIZE); |