From 45ff7b504d79072bfbd24cf12f5818ed356f94bc Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Wed, 18 Aug 2010 08:26:47 +0300 Subject: modified: gpg_wrapper.cpp modified: init.cpp modified: main.cpp modified: messages.cpp modified: new_gpg.rc modified: new_gpg.sln modified: new_gpg.vcproj modified: options.cpp modified: resource.h modified: utilities.cpp --- main.cpp | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 1dc3ef8..c2b8ad5 100644 --- a/main.cpp +++ b/main.cpp @@ -80,7 +80,7 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM DWORD code; string::size_type p = 0, p2 = 0, stop = 0; { - wstring cmd = _T("--list-secret-keys"); + wstring cmd = _T("--batch --list-secret-keys"); if(pxExecute(&cmd, "", &out, &code) == pxNotFound) { MessageBox(0, _T("Set path to gpg.exe first!"), _T("Warning"), MB_OK); @@ -151,7 +151,7 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM { string out; DWORD code; - wstring cmd = _T("--export -a "); + wstring cmd = _T("--batch --export -a "); cmd += fp; if(pxExecute(&cmd, "", &out, &code) == pxNotFound) { @@ -202,6 +202,8 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM } switch (((LPNMHDR)lParam)->code) { + default: + break; } } @@ -279,6 +281,8 @@ static BOOL CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP { switch (((LPNMHDR)lParam)->code) { + default: + break; } } break; @@ -339,6 +343,8 @@ static BOOL CALLBACK DlgProcNewKeyDialog(HWND hwndDlg, UINT msg, WPARAM wParam, { switch (((LPNMHDR)lParam)->code) { + default: + break; } } break; @@ -516,8 +522,12 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam, wstring cmd; cmd += _T("--batch --yes --gen-key \""); cmd += path; - cmd += _T("\""); - pxExecute(&cmd, "", &out, &code); + cmd += _T("\""); + if(pxExecute(&cmd, "", &out, &code) == pxNotFound) + { + MessageBox(0, _T("Set path to gpg.exe first!"), _T("Warning"), MB_OK); + break; + } } DeleteFile(path.c_str()); DestroyWindow(hwndDlg); @@ -532,12 +542,12 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam, DWORD code; string::size_type p = 0, p2 = 0, stop = 0; { - wstring cmd = _T("--list-secret-keys"); + wstring cmd = _T("--list-secret-keys"); if(pxExecute(&cmd, "", &out, &code) == pxNotFound) { MessageBox(0, _T("Set path to gpg.exe first!"), _T("Warning"), MB_OK); break; - } + } } cp866_to_cp1251(&out); ListView_DeleteAllItems(hwndList_g); @@ -598,6 +608,8 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam, { switch (((LPNMHDR)lParam)->code) { + default: + break; } } break; @@ -668,12 +680,12 @@ static BOOL CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wParam, DWORD code; string::size_type p = 0, p2 = 0, stop = 0; { - wstring cmd = _T("--list-keys"); + wstring cmd = _T("--batch --list-keys"); if(pxExecute(&cmd, "", &out, &code) == pxNotFound) { MessageBox(0, _T("Set path to gpg.exe first!"), _T("Warning"), MB_OK); break; - } + } } cp866_to_cp1251(&out); while(p != string::npos) @@ -733,8 +745,8 @@ static BOOL CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wParam, extern HWND hPubKeyEdit; string out; DWORD code; - wstring cmd = _T("--export -a "); - cmd += id; + wstring cmd = _T("--batch --export -a "); + cmd += id; if(pxExecute(&cmd, "", &out, &code) == pxNotFound) { MessageBox(0, _T("Set path to gpg.exe first!"), _T("Warning"), MB_OK); @@ -878,16 +890,16 @@ void ImportKey() mir_free(ptmp); f<