summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rwxr-xr-xmain.cpp48
1 files changed, 27 insertions, 21 deletions
diff --git a/main.cpp b/main.cpp
index 38ae73f..b14c24a 100755
--- a/main.cpp
+++ b/main.cpp
@@ -103,7 +103,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
gpg_thread.~thread();
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<": GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
break;
}
if(result == pxNotFound)
@@ -251,7 +251,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
gpg_thread.~thread();
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<": GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
break;
}
if(result == pxNotFound)
@@ -343,7 +343,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
gpg_thread.~thread();
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<": GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
break;
}
if(result == pxNotFound)
@@ -416,7 +416,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
delete gpg_thread;
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<": GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
break;
}
if(result == pxNotFound)
@@ -445,7 +445,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
delete gpg_thread;
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<": GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
break;
}
if(result == pxNotFound)
@@ -533,6 +533,8 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
params.out = &out;
params.code = &code;
params.result = &result;
+ extern HFONT bold_font;
+ SendMessage(GetDlgItem(hwndDlg, IDC_GENERATING_KEY), WM_SETFONT, (WPARAM)bold_font, true);
SetWindowTextA(GetDlgItem(hwndDlg, IDC_GENERATING_KEY), Translate("Generating new random key, please wait"));
EnableWindow(GetDlgItem(hwndDlg, IDC_GENERATE_KEY), 0);
EnableWindow(GetDlgItem(hwndDlg, IDC_OTHER), 0);
@@ -545,7 +547,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
gpg_thread.~thread();
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<": GPG execution timed out, aborted";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
break;
}
if(result == pxNotFound)
@@ -577,7 +579,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
gpg_thread.~thread();
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<"GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+"GPG execution timed out, aborted");
break;
}
if(result == pxNotFound)
@@ -760,7 +762,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
gpg_thread.~thread();
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<": GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
}
gpg_valid = false;
DBDeleteContactSetting(NULL, szGPGModuleName, "szGpgBinPath");
@@ -880,7 +882,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
gpg_thread.~thread();
- debuglog<<time_str()<<": GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
}
gpg_valid = false;
DBDeleteContactSetting(NULL, szGPGModuleName, "szGpgBinPath");
@@ -969,7 +971,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
gpg_thread.~thread();
- debuglog<<time_str()<<": GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
}
gpg_valid = false;
DBDeleteContactSetting(NULL, szGPGModuleName, "szGpgBinPath");
@@ -1061,7 +1063,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
gpg_thread.~thread();
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<": GPG execution timed out, aborted";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
gpg_valid = false;
break;
}
@@ -1095,7 +1097,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
gpg_thread.~thread();
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<"GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+"GPG execution timed out, aborted");
gpg_valid = false;
break;
}
@@ -1139,6 +1141,8 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case WM_DESTROY:
hwndSetDirs = NULL;
+ void InitCheck();
+ InitCheck();
break;
}
@@ -1409,6 +1413,8 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
params.out = &out;
params.code = &code;
params.result = &result;
+ extern HFONT bold_font;
+ SendMessage(GetDlgItem(hwndDlg, IDC_GENERATING_TEXT), WM_SETFONT, (WPARAM)bold_font, true);
SetWindowTextA(GetDlgItem(hwndDlg, IDC_GENERATING_TEXT), Translate("Generating new key, please wait..."));
EnableWindow(GetDlgItem(hwndDlg, IDCANCEL), 0);
EnableWindow(GetDlgItem(hwndDlg, IDOK), 0);
@@ -1425,7 +1431,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
gpg_thread.~thread();
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<": GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
break;
}
if(result == pxNotFound)
@@ -1458,7 +1464,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
gpg_thread.~thread();
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<": GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
break;
}
if(result == pxNotFound)
@@ -1620,7 +1626,7 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wPar
gpg_thread.~thread();
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<": GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
break;
}
if(result == pxNotFound)
@@ -1729,7 +1735,7 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wPar
gpg_thread.~thread();
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<": GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
break;
}
if(result == pxNotFound)
@@ -1856,7 +1862,7 @@ static INT_PTR CALLBACK DlgProcImportKeyDialog(HWND hwndDlg, UINT msg, WPARAM wP
gpg_thread.~thread();
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<": GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
}
MessageBoxA(0, out.c_str(), "GPG output", MB_OK);
}
@@ -2018,7 +2024,7 @@ void InitCheck()
gpg_thread.~thread();
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<": GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
return;
}
if(result == pxNotFound)
@@ -2035,8 +2041,8 @@ void InitCheck()
void ShowFirstRunDialog();
if(!DBGetContactSettingByte(NULL, szGPGModuleName, "FirstRun", 1) && (!keyid[0] || !key[0]))
{
- question = Translate("You have not set public key for gpg, it's recommended to do it.\nDo you want to do it now ?");
- if(MessageBoxA(0, question.c_str(), Translate("Own public key warning"), MB_YESNO) == IDYES)
+ question = Translate("You didn't set a private key.\nWould you like to set it now?");
+ if(MessageBoxA(0, question.c_str(), Translate("Own private key warning"), MB_YESNO) == IDYES)
ShowFirstRunDialog();
}
if(out.find(keyid) == string::npos)
@@ -2152,7 +2158,7 @@ void ImportKey()
gpg_thread.~thread();
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- debuglog<<time_str()<<": GPG execution timed out, aborted\n";
+ debuglog<<std::string(time_str()+": GPG execution timed out, aborted");
return;
}
if(result == pxNotFound)