summaryrefslogtreecommitdiff
path: root/options.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2013-10-10 12:55:59 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2013-10-10 12:55:59 +0300
commit2db81bed3b59b2c48bac5cbd97b511e79a9f23ca (patch)
tree756d44af537dd3463e1f81cecf0cf48213ce3d5f /options.cpp
parent3ad5e6b61974c2d71f4afaefeab7c2ed8804176c (diff)
merged some of critical fixes from miranda ng main reponew_gpg
Diffstat (limited to 'options.cpp')
-rwxr-xr-xoptions.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/options.cpp b/options.cpp
index c7b89f5..a9bf91e 100755
--- a/options.cpp
+++ b/options.cpp
@@ -256,7 +256,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
}
if(!keep)
- if(MessageBox(0, TranslateT("This key not used by any contact, do you want to remove it from public keyring ?"), TranslateT("Key info"), MB_YESNO) == IDYES)
+ if(MessageBox(0, TranslateT("This key is not used by any contact. Do you want to remove it from public keyring?"), TranslateT("Key info"), MB_YESNO) == IDYES)
{
std::vector<wstring> cmd;
string output;
@@ -290,7 +290,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
mir_free(tmp);
if(ismetacontact)
{
- if(MessageBox(0, TranslateT("Do you want to remove key from entire metacontact (all subcontacts) ?"), TranslateT("Metacontact detected"), MB_YESNO) == IDYES)
+ if(MessageBox(0, TranslateT("Do you want to remove key from entire metacontact (all subcontacts)?"), TranslateT("Metacontact detected"), MB_YESNO) == IDYES)
{
HANDLE hcnt = NULL;
int count = metaGetContactsNum(meta);
@@ -373,7 +373,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if(OpenClipboard(hwndDlg))
{
char *szKey = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", "");
- std::string str = szKey;;
+ std::string str = szKey;
mir_free(szKey);
boost::algorithm::replace_all(str, "\n", "\r\n");
HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, str.size() +1);
@@ -386,7 +386,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if(!szKey)
{
char msg[64];
- mir_snprintf(msg, 127, "Failed to lock memory with error %d", GetLastError());
+ mir_snprintf(msg, 64, "Failed to lock memory with error %d", GetLastError());
MessageBoxA(0, msg, "Error", MB_OK);
GlobalFree(hMem);
}
@@ -399,7 +399,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
GlobalFree(hMem);
char msg[64];
- mir_snprintf(msg, 127, "Failed write to clipboard with error %d", GetLastError());
+ mir_snprintf(msg, 64, "Failed write to clipboard with error %d", GetLastError());
MessageBoxA(0, msg, "Error", MB_OK);
}
CloseClipboard();
@@ -407,7 +407,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
else
{
char msg[64];
- mir_snprintf(msg, 127, "Failed to open clipboard with error %d", GetLastError());
+ mir_snprintf(msg, 64, "Failed to open clipboard with error %d", GetLastError());
MessageBoxA(0, msg, "Error", MB_OK);
}
}
@@ -526,7 +526,10 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
params.out = &out;
params.code = &code;
params.result = &result;
+ auto old_gpg_state = gpg_valid;
+ gpg_valid = true;
gpg_launcher(params);
+ gpg_valid = old_gpg_state;
DBWriteContactSettingTString(NULL, szGPGModuleName, "szGpgBinPath", tmp_path);
mir_free(tmp_path);
string::size_type p1 = out.find("(GnuPG) ");
@@ -539,10 +542,10 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
else
{
bad_version = false;
- MessageBox(0, TranslateT("This is not gnupg binary !\nrecommended to use GnuPG v1.x.x with this plugn."), TranslateT("Warning"), MB_OK);
+ MessageBox(0, TranslateT("This is not GnuPG binary!\nIt is recommended to use GnuPG v1.x.x with this plugin."), TranslateT("Warning"), MB_OK);
}
/* if(bad_version) //looks like working fine with gpg2
- MessageBox(0, TranslateT("Unsupported gnupg version found, use at you own risk!\nrecommended to use GnuPG v1.x.x with this plugn."), _T("Warning"), MB_OK); */
+ MessageBox(0, TranslateT("Unsupported GnuPG version found, use at you own risk!\nIt is recommended to use GnuPG v1.x.x with this plugin."), _T("Warning"), MB_OK); */
}
}
char mir_path[MAX_PATH];
@@ -574,6 +577,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
tmp = mir_a2t(p_path);
SetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp);
}
+ mir_free(atmp);
}
break;
default: