summaryrefslogtreecommitdiff
path: root/plugins/NewsAggregator/Src/Authentication.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-07-22 13:38:03 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-07-22 13:38:03 +0000
commit01de930753fd7a5d47c0350a4361949d770b93cf (patch)
tree1ea25c299e48d76c776e8b39eba4915e10e2a555 /plugins/NewsAggregator/Src/Authentication.cpp
parentff287facb697ba6c2b40976e8ab46855ea27eb92 (diff)
replace sprintf to mir_snprintf (part 1)
git-svn-id: http://svn.miranda-ng.org/main/trunk@5446 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewsAggregator/Src/Authentication.cpp')
-rw-r--r--plugins/NewsAggregator/Src/Authentication.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/plugins/NewsAggregator/Src/Authentication.cpp b/plugins/NewsAggregator/Src/Authentication.cpp
index 7d3c2d703d..4503fc7ef9 100644
--- a/plugins/NewsAggregator/Src/Authentication.cpp
+++ b/plugins/NewsAggregator/Src/Authentication.cpp
@@ -57,24 +57,21 @@ INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
switch (msg) {
case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
{
+ TranslateDialogDefault(hwndDlg);
ItemInfo &SelItem = *(ItemInfo*)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG)&SelItem);
- if (SelItem.hwndList)
- {
+ if (SelItem.hwndList) {
TCHAR str[MAX_PATH];
if (GetDlgItemText(SelItem.hwndList, IDC_FEEDTITLE, str, SIZEOF(str)))
SetDlgItemText(hwndDlg, IDC_FEEDNAME, str);
- else
- {
+ else {
GetDlgItemText(SelItem.hwndList, IDC_FEEDURL, str, SIZEOF(str));
SetDlgItemText(hwndDlg, IDC_FEEDNAME, str);
}
}
- else if (SelItem.hContact)
- {
+ else if (SelItem.hContact) {
DBVARIANT dbv;
if (!db_get_ts(SelItem.hContact, MODULE, "Nick", &dbv)) {
SetDlgItemText(hwndDlg, IDC_FEEDNAME, dbv.ptszVal);
@@ -96,23 +93,21 @@ INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
TCHAR username[MAX_PATH];
char passw[MAX_PATH];
if (!GetDlgItemText(hwndDlg, IDC_FEEDUSERNAME, username, SIZEOF(username))) {
- MessageBox(hwndDlg, TranslateT("Enter your username"), TranslateT("Error"), MB_OK);
+ MessageBox(hwndDlg, TranslateT("Enter your username"), TranslateT("Error"), MB_OK | MB_ICONERROR);
break;
}
if (!GetDlgItemTextA(hwndDlg, IDC_FEEDPASSWORD, passw, SIZEOF(passw))) {
- MessageBox(hwndDlg, TranslateT("Enter your password"), TranslateT("Error"), MB_OK);
+ MessageBox(hwndDlg, TranslateT("Enter your password"), TranslateT("Error"), MB_OK | MB_ICONERROR);
break;
}
- if (SelItem.hwndList)
- {
+ if (SelItem.hwndList) {
CheckDlgButton(SelItem.hwndList, IDC_USEAUTH, BST_CHECKED);
EnableWindow(GetDlgItem(SelItem.hwndList, IDC_LOGIN), TRUE);
EnableWindow(GetDlgItem(SelItem.hwndList, IDC_PASSWORD), TRUE);
SetDlgItemText(SelItem.hwndList, IDC_LOGIN, username);
SetDlgItemTextA(SelItem.hwndList, IDC_PASSWORD, passw);
}
- else if (SelItem.hContact)
- {
+ else if (SelItem.hContact) {
db_set_b(SelItem.hContact, MODULE, "UseAuth", 1);
db_set_ts(SelItem.hContact, MODULE, "Login", username);
CallService(MS_DB_CRYPT_ENCODESTRING, strlen(passw), (LPARAM)&passw);
@@ -130,6 +125,5 @@ INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
}
break;
}
-
return FALSE;
} \ No newline at end of file