summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2010-09-06 09:29:22 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2010-09-06 09:29:22 +0300
commitfd25e8729b0b69ceca5c5bc407b4b4379496ac85 (patch)
treeee5e49a70beff2c5a1e32e87cbc6dedaac24cfdc /main.cpp
parentbb56212c72bea28881c668b6da766c603a67a37d (diff)
modified: main.cpp
modified: messages.cpp
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp33
1 files changed, 16 insertions, 17 deletions
diff --git a/main.cpp b/main.cpp
index f4f4e00..b461349 100644
--- a/main.cpp
+++ b/main.cpp
@@ -413,8 +413,8 @@ static BOOL CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
- TCHAR *path = new TCHAR [MAX_PATH];
DWORD len = MAX_PATH;
+ TCHAR *path = NULL;
tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", (SHGetValue(HKEY_CURRENT_USER, _T("Software\\GNU\\GnuPG\\gpgProgram"), 0, 0, path, &len) == ERROR_SUCCESS)?path:_T(""));
delete [] path;
SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp);
@@ -437,7 +437,7 @@ static BOOL CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
case IDC_SET_BIN_PATH:
GetFilePath(_T("Choose gpg2.exe"), "szGpgBinPath", _T("*.exe"), _T("EXE Executables"));
- tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", _T("gpg2.exe"));
+ tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", _T("gpg.exe"));
SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp);
mir_free(tmp);
break;
@@ -1125,6 +1125,12 @@ void FirstRun()
void InitCheck()
{
{//parse gpg output
+ char *keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", "");
+ if(strlen(keyid) < 1)
+ {
+ mir_free(keyid);
+ return;
+ }
string out;
DWORD code;
pxResult result;
@@ -1149,21 +1155,14 @@ void InitCheck()
return;
}
}
- char *keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", "");
- if(strlen(keyid) > 0)
- {
- string question = "Your secret key whith id: ";
- question += keyid;
- mir_free(keyid);
- question += " deleted from gpg secret keyring\nDo you want to set another key ?";
- void ShowFirstRunDialog();
- if(out.find(keyid) == string::npos)
- if(MessageBoxA(0, question.c_str(), "Own secret key warning", MB_YESNO) == IDYES)
- ShowFirstRunDialog();
- return;
- }
- else
- mir_free(keyid);
+ string question = "Your secret key whith id: ";
+ question += keyid;
+ mir_free(keyid);
+ question += " deleted from gpg secret keyring\nDo you want to set another key ?";
+ void ShowFirstRunDialog();
+ if(out.find(keyid) == string::npos)
+ if(MessageBoxA(0, question.c_str(), "Own secret key warning", MB_YESNO) == IDYES)
+ ShowFirstRunDialog();
}
}