summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/main.cpp b/main.cpp
index 601ebf1..7fdf27c 100644
--- a/main.cpp
+++ b/main.cpp
@@ -41,31 +41,32 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM
{
SetWindowPos(hwndDlg, 0, firstrun_rect.left, firstrun_rect.top, 0, 0, SWP_NOSIZE|SWP_SHOWWINDOW);
TranslateDialogDefault(hwndDlg);
+ SetWindowText(hwndDlg, TranslateW(_T("Set own key")));
col.pszText = _T("Key ID");
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.fmt = LVCFMT_LEFT;
col.cx = 50;
ListView_InsertColumn(hwndList, 0, &col);
ZeroMemory(&col,sizeof(col));
- col.pszText = _T("Email");
+ col.pszText = TranslateW(_T("Email"));
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.fmt = LVCFMT_LEFT;
col.cx = 30;
ListView_InsertColumn(hwndList, 1, &col);
ZeroMemory(&col,sizeof(col));
- col.pszText = _T("Name");
+ col.pszText = TranslateW(_T("Name"));
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.fmt = LVCFMT_LEFT;
col.cx = 250;
ListView_InsertColumn(hwndList, 2, &col);
ZeroMemory(&col,sizeof(col));
- col.pszText = _T("Creation date");
+ col.pszText = TranslateW(_T("Creation date"));
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.fmt = LVCFMT_LEFT;
col.cx = 30;
ListView_InsertColumn(hwndList, 3, &col);
ZeroMemory(&col,sizeof(col));
- col.pszText = _T("Key length");
+ col.pszText = TranslateW(_T("Key length"));
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.fmt = LVCFMT_LEFT;
col.cx = 30;
@@ -1071,6 +1072,7 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam,
{
SetWindowPos(hwndDlg, 0, key_gen_rect.left, key_gen_rect.top, 0, 0, SWP_NOSIZE|SWP_SHOWWINDOW);
TranslateDialogDefault(hwndDlg);
+ SetWindowText(hwndDlg, TranslateW(_T("Key Generation dialog")));
ComboBoxAddStringUtf(GetDlgItem(hwndDlg, IDC_KEY_TYPE), _T("RSA"), 0);
ComboBoxAddStringUtf(GetDlgItem(hwndDlg, IDC_KEY_TYPE), _T("DSA"), 1);
SendDlgItemMessage(hwndDlg, IDC_KEY_TYPE, CB_SETCURSEL, (WPARAM)1, 0);
@@ -1096,7 +1098,7 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam,
if(_tcslen(tmp) < 3)
{
mir_free(tmp);
- MessageBox(0, _T("You must set encryption algorythm first"), _T("Error"), MB_OK);
+ MessageBox(0, TranslateW(_T("You must set encryption algorythm first")), TranslateW(_T("Error")), MB_OK);
break;
}
mir_free(tmp);
@@ -1106,14 +1108,14 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam,
mir_free(tmp);
if(length < 1024 || length > 4096)
{
- MessageBox(0, _T("Key length must be of length from 1024 to 4096 bits"), _T("Error"), MB_OK);
+ MessageBox(0, TranslateW(_T("Key length must be of length from 1024 to 4096 bits")), TranslateW(_T("Error")), MB_OK);
break;
}
tmp = new TCHAR [12];
GetDlgItemText(hwndDlg, IDC_KEY_EXPIRE_DATE, tmp, 12);
if(_tcslen(tmp) != 10 && tmp[0] != '0')
{
- MessageBox(0, _T("Invalid date"), _T("Error"), MB_OK);
+ MessageBox(0, TranslateW(_T("Invalid date")), TranslateW(_T("Error")), MB_OK);
delete [] tmp;
break;
}
@@ -1122,13 +1124,13 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam,
GetDlgItemText(hwndDlg, IDC_KEY_REAL_NAME, tmp, 128);
if(_tcslen(tmp) < 5)
{
- MessageBox(0, _T("Name must contain at least 5 characters"), _T("Error"), MB_OK);
+ MessageBox(0, TranslateW(_T("Name must contain at least 5 characters")), TranslateW(_T("Error")), MB_OK);
delete [] tmp;
break;
}
else if (_tcschr(tmp, _T('(')) || _tcschr(tmp, _T(')')))
{
- MessageBox(0, _T("Name cannot contain '(' or ')'"), _T("Error"), MB_OK);
+ MessageBox(0, TranslateW(_T("Name cannot contain '(' or ')'")), TranslateW(_T("Error")), MB_OK);
delete [] tmp;
break;
}
@@ -1137,7 +1139,7 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam,
GetDlgItemText(hwndDlg, IDC_KEY_EMAIL, tmp, 128);
if((_tcslen(tmp)) < 5 || (!_tcschr(tmp, _T('@'))) || (!_tcschr(tmp, _T('.'))))
{
- MessageBox(0, _T("Invalid Email"), _T("Error"), MB_OK);
+ MessageBox(0, TranslateW(_T("Invalid Email")), TranslateW(_T("Error")), MB_OK);
delete [] tmp;
break;
}
@@ -1153,7 +1155,7 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam,
wfstream f(path.c_str(), std::ios::out);
if(!f.is_open())
{
- MessageBox(0, _T("Failed to open file"), _T("Error"), MB_OK);
+ MessageBox(0, TranslateW(_T("Failed to open file")), TranslateW(_T("Error")), MB_OK);
break;
}
f<<"Key-Type: ";
@@ -1251,7 +1253,6 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam,
gpg_thread.~thread();
TerminateProcess(params.hProcess, 1);
params.hProcess = NULL;
- MessageBox(0, _T("GPG execution timed out, aborted"), _T(""), MB_OK);
debuglog<<time_str()<<": GPG execution timed out, aborted\n";
break;
}