diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-10-31 13:02:56 +0200 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-10-31 13:02:56 +0200 |
commit | 0922841b20da6c15076f1467280a0e67407826d1 (patch) | |
tree | 359a1149b1d24c603ffbac4a7fb68c7e380821be /gpg_wrapper.cpp | |
parent | f375e4f961eb52fa504c17e7825e832829310e8a (diff) |
log rework
better gpg configuration check
removed annoying message boxes (info now out to log)
Diffstat (limited to 'gpg_wrapper.cpp')
-rw-r--r-- | gpg_wrapper.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gpg_wrapper.cpp b/gpg_wrapper.cpp index 04f3512..8ab32a3 100644 --- a/gpg_wrapper.cpp +++ b/gpg_wrapper.cpp @@ -24,6 +24,8 @@ boost::mutex gpg_mutex; pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD aexitcode, pxResult *result) { gpg_mutex.lock(); + if(!gpg_configured) + return pxNotConfigured; extern logtofile debuglog; BOOL success; STARTUPINFO sinfo = {0}; @@ -97,7 +99,7 @@ pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD delete [] home_dir; } - debuglog<<"gpg in: "<<commandline<<"\n"; + debuglog<<time_str()<<": gpg in: "<<commandline; success = CreateProcess(NULL, (TCHAR*)commandline.c_str(), NULL, NULL, TRUE, CREATE_NEW_CONSOLE | CREATE_UNICODE_ENVIRONMENT, (void*)_T("LANGUAGE=en@quot\0LC_ALL=English\0"), NULL, &sinfo, &pri); @@ -134,7 +136,7 @@ pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD storeOutput(readstdout,aoutput); - debuglog<<"gpg out: "<<aoutput->c_str()<<"\n"; + debuglog<<time_str()<<": gpg out: "<<aoutput->c_str(); WaitForSingleObject(pri.hProcess,INFINITE); @@ -155,6 +157,6 @@ void pxEexcute_thread(void *param) pxResult result = pxExecute(params->cmd, params->useless, params->out, params->code, params->result); if(result == pxNotFound) { - MessageBox(0, _T("Set path to gpg.exe first!"), _T("Warning"), MB_OK); + debuglog<<time_str()<<": Gpg binary not found"; } }
|