diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-08-18 08:26:47 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-08-18 08:26:47 +0300 |
commit | 45ff7b504d79072bfbd24cf12f5818ed356f94bc (patch) | |
tree | b3e51aa789863f95d48d5e3775216fa336911c9d /main.cpp | |
parent | e07a374f12258c3798c9f49ea926db29f90d93ec (diff) |
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
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 38 |
1 files changed, 25 insertions, 13 deletions
@@ -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<<new_key.c_str();
f.close();
- cmd += _T(" --trust-model always ");
+ cmd += _T(" --batch ");
cmd += _T(" --import \"");
cmd += tmp2;
cmd += _T("\"");
- }
+ } if(pxExecute(&cmd, "", &output, &exitcode) == pxNotFound)
{
MessageBox(0, _T("Set path to gpg.exe first!"), _T("Warning"), MB_OK);
return;
- }
+ } DBDeleteContactSetting(new_key_hcnt, szGPGModuleName, "bAlwatsTrust");
cp866_to_cp1251(&output);
{
|