From fd25e8729b0b69ceca5c5bc407b4b4379496ac85 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Mon, 6 Sep 2010 09:29:22 +0300 Subject: modified: main.cpp modified: messages.cpp --- main.cpp | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'main.cpp') 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(); } } -- cgit v1.2.3