diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-10-14 05:59:56 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-10-14 05:59:56 +0000 |
commit | 708f9efe9c79a3b2fbdd953e02b6448ce5ad9b97 (patch) | |
tree | 3dc1ffcc6ea8abc73d480de36b63b69cdcc94c58 /protocols/VKontakte/src/vk_options.cpp | |
parent | e9a8795aed41e22c74d7bbcd0f9705ecdb885461 (diff) |
VKontakte:
add ‘Advanced’ option page
move some options to ‘Advanced’ page
rework sticker support part 1 (patch by alitor, edited)
git-svn-id: http://svn.miranda-ng.org/main/trunk@10777 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_options.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_options.cpp | 136 |
1 files changed, 97 insertions, 39 deletions
diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp index f415020918..084ca326ff 100644 --- a/protocols/VKontakte/src/vk_options.cpp +++ b/protocols/VKontakte/src/vk_options.cpp @@ -118,18 +118,12 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L SetDlgItemText(hwndDlg, IDC_GROUPNAME, ppro->getGroup());
}
+
CheckDlgButton(hwndDlg, IDC_DELIVERY, ppro->m_bServerDelivery);
- CheckDlgButton(hwndDlg, IDC_HIDECHATS, ppro->m_bHideChats);
- CheckDlgButton(hwndDlg, IDC_AUTOCLEAN, ppro->getByte("AutoClean", 0));
- CheckDlgButton(hwndDlg, IDC_MESASUREAD, ppro->m_bMesAsUnread);
- CheckDlgButton(hwndDlg, IDC_SYNCHISTOTYONONLINE, ppro->m_bAutoSyncHistory);
CheckDlgButton(hwndDlg, IDC_USE_LOCAL_TIME, ppro->m_bUseLocalTime);
- CheckDlgButton(hwndDlg, IDC_ADD_IMG_BBC, ppro->m_bAddImgBbc);
- CheckDlgButton(hwndDlg, IDC_FORCE_ONLINE_ON_ACT, ppro->m_bUserForceOnlineOnActivity);
- CheckDlgButton(hwndDlg, IDC_REPORT_ABUSE, ppro->m_bReportAbuse);
- CheckDlgButton(hwndDlg, IDC_CLEAR_SERVER_HISTORY, ppro->m_bClearServerHistory);
- CheckDlgButton(hwndDlg, IDC_REMOVE_FROM_FRENDLIST, ppro->m_bRemoveFromFrendlist);
- CheckDlgButton(hwndDlg, IDC_REMOVE_FROM_CLIST, ppro->m_bRemoveFromClist);
+ CheckDlgButton(hwndDlg, IDC_SYNCHISTOTYONONLINE, ppro->m_bAutoSyncHistory);
+ CheckDlgButton(hwndDlg, IDC_AUTOCLEAN, ppro->getByte("AutoClean", 0));
+
CheckDlgButton(hwndDlg, IDC_ONREAD, (ppro->m_iMarkMessageReadOn == markOnRead));
CheckDlgButton(hwndDlg, IDC_ONRECEIVE, (ppro->m_iMarkMessageReadOn == markOnReceive));
CheckDlgButton(hwndDlg, IDC_ONREPLY, (ppro->m_iMarkMessageReadOn == markOnReply));
@@ -149,18 +143,10 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
- case IDC_DELIVERY:
- case IDC_HIDECHATS:
- case IDC_AUTOCLEAN:
- case IDC_MESASUREAD:
- case IDC_SYNCHISTOTYONONLINE:
+ case IDC_DELIVERY:
case IDC_USE_LOCAL_TIME:
- case IDC_ADD_IMG_BBC:
- case IDC_FORCE_ONLINE_ON_ACT:
- case IDC_REPORT_ABUSE:
- case IDC_CLEAR_SERVER_HISTORY:
- case IDC_REMOVE_FROM_FRENDLIST:
- case IDC_REMOVE_FROM_CLIST:
+ case IDC_SYNCHISTOTYONONLINE:
+ case IDC_AUTOCLEAN:
case IDC_ONREAD:
case IDC_ONRECEIVE:
case IDC_ONREPLY:
@@ -190,14 +176,8 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L ppro->m_bServerDelivery = IsDlgButtonChecked(hwndDlg, IDC_DELIVERY) == BST_CHECKED;
ppro->setByte("ServerDelivery", ppro->m_bServerDelivery);
-
- ppro->m_bHideChats = IsDlgButtonChecked(hwndDlg, IDC_HIDECHATS) == BST_CHECKED;
- ppro->setByte("HideChats", ppro->m_bHideChats);
-
+
ppro->setByte("AutoClean", IsDlgButtonChecked(hwndDlg, IDC_AUTOCLEAN) == BST_CHECKED);
-
- ppro->m_bMesAsUnread = IsDlgButtonChecked(hwndDlg, IDC_MESASUREAD) == BST_CHECKED;
- ppro->setByte("MesAsUnread", ppro->m_bMesAsUnread);
ppro->m_bAutoSyncHistory = IsDlgButtonChecked(hwndDlg, IDC_SYNCHISTOTYONONLINE) == BST_CHECKED;
ppro->setByte("AutoSyncHistory", ppro->m_bAutoSyncHistory);
@@ -205,9 +185,89 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L ppro->m_bUseLocalTime = IsDlgButtonChecked(hwndDlg, IDC_USE_LOCAL_TIME) == BST_CHECKED;
ppro->setByte("UseLocalTime", ppro->m_bUseLocalTime);
+ if (IsDlgButtonChecked(hwndDlg, IDC_ONREAD) == BST_CHECKED)
+ ppro->m_iMarkMessageReadOn = markOnRead;
+ if (IsDlgButtonChecked(hwndDlg, IDC_ONRECEIVE) == BST_CHECKED)
+ ppro->m_iMarkMessageReadOn = markOnReceive;
+ if (IsDlgButtonChecked(hwndDlg, IDC_ONREPLY) == BST_CHECKED)
+ ppro->m_iMarkMessageReadOn = markOnReply;
+ if (IsDlgButtonChecked(hwndDlg, IDC_ONTYPING) == BST_CHECKED)
+ ppro->m_iMarkMessageReadOn = markOnTyping;
+ ppro->setByte("MarkMessageReadOn", ppro->m_iMarkMessageReadOn);
+ }
+ break;
+
+ case WM_CLOSE:
+ EndDialog(hwndDlg, 0);
+ break;
+
+ case WM_DESTROY:
+ Skin_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_BIG, 0));
+ Skin_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_SMALL, 0));
+ break;
+ }
+
+ return FALSE;
+}
+
+INT_PTR CALLBACK CVkProto::OptionsAdvProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ CVkProto *ppro = (CVkProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+
+ switch (uMsg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+
+ ppro = (CVkProto*)lParam;
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
+
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon, true));
+ SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon));
+
+ CheckDlgButton(hwndDlg, IDC_HIDECHATS, ppro->m_bHideChats);
+ CheckDlgButton(hwndDlg, IDC_MESASUREAD, ppro->m_bMesAsUnread);
+ CheckDlgButton(hwndDlg, IDC_ADD_IMG_BBC, ppro->m_bAddImgBbc);
+ CheckDlgButton(hwndDlg, IDC_STICKERS_AS_SMYLES, ppro->m_bStikersAsSmyles);
+ CheckDlgButton(hwndDlg, IDC_FORCE_ONLINE_ON_ACT, ppro->m_bUserForceOnlineOnActivity);
+
+ CheckDlgButton(hwndDlg, IDC_REPORT_ABUSE, ppro->m_bReportAbuse);
+ CheckDlgButton(hwndDlg, IDC_CLEAR_SERVER_HISTORY, ppro->m_bClearServerHistory);
+ CheckDlgButton(hwndDlg, IDC_REMOVE_FROM_FRENDLIST, ppro->m_bRemoveFromFrendlist);
+ CheckDlgButton(hwndDlg, IDC_REMOVE_FROM_CLIST, ppro->m_bRemoveFromClist);
+
+ return TRUE;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDC_HIDECHATS:
+ case IDC_MESASUREAD:
+ case IDC_ADD_IMG_BBC:
+ case IDC_FORCE_ONLINE_ON_ACT:
+ case IDC_STICKERS_AS_SMYLES:
+ case IDC_REPORT_ABUSE:
+ case IDC_CLEAR_SERVER_HISTORY:
+ case IDC_REMOVE_FROM_FRENDLIST:
+ case IDC_REMOVE_FROM_CLIST:
+ if (HIWORD(wParam) == BN_CLICKED && (HWND)lParam == GetFocus())
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ }
+ break;
+
+ case WM_NOTIFY:
+ if (((LPNMHDR)lParam)->code == PSN_APPLY) {
+ ppro->m_bHideChats = IsDlgButtonChecked(hwndDlg, IDC_HIDECHATS) == BST_CHECKED;
+ ppro->setByte("HideChats", ppro->m_bHideChats);
+
+ ppro->m_bMesAsUnread = IsDlgButtonChecked(hwndDlg, IDC_MESASUREAD) == BST_CHECKED;
+ ppro->setByte("MesAsUnread", ppro->m_bMesAsUnread);
+
ppro->m_bAddImgBbc = IsDlgButtonChecked(hwndDlg, IDC_ADD_IMG_BBC) == BST_CHECKED;
ppro->setByte("AddImgBbc", ppro->m_bAddImgBbc);
+ ppro->m_bStikersAsSmyles = IsDlgButtonChecked(hwndDlg, IDC_STICKERS_AS_SMYLES) == BST_CHECKED;
+ ppro->setByte("StikersAsSmyles", ppro->m_bStikersAsSmyles);
+
ppro->m_bUserForceOnlineOnActivity = IsDlgButtonChecked(hwndDlg, IDC_FORCE_ONLINE_ON_ACT) == BST_CHECKED;
ppro->setByte("UserForceOnlineOnActivity", ppro->m_bUserForceOnlineOnActivity);
@@ -221,17 +281,8 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L ppro->setByte("RemoveFromFrendlistOnBanUser", ppro->m_bRemoveFromFrendlist);
ppro->m_bRemoveFromClist = IsDlgButtonChecked(hwndDlg, IDC_REMOVE_FROM_CLIST) == BST_CHECKED;
- ppro->setByte("RemoveFromClistOnBanUser", ppro->m_bRemoveFromClist);
+ ppro->setByte("RemoveFromClistOnBanUser", ppro->m_bRemoveFromClist);
- if (IsDlgButtonChecked(hwndDlg, IDC_ONREAD) == BST_CHECKED)
- ppro->m_iMarkMessageReadOn = markOnRead;
- if (IsDlgButtonChecked(hwndDlg, IDC_ONRECEIVE) == BST_CHECKED)
- ppro->m_iMarkMessageReadOn = markOnReceive;
- if (IsDlgButtonChecked(hwndDlg, IDC_ONREPLY) == BST_CHECKED)
- ppro->m_iMarkMessageReadOn = markOnReply;
- if (IsDlgButtonChecked(hwndDlg, IDC_ONTYPING) == BST_CHECKED)
- ppro->m_iMarkMessageReadOn = markOnTyping;
- ppro->setByte("MarkMessageReadOn", ppro->m_iMarkMessageReadOn);
}
break;
@@ -255,11 +306,18 @@ int CVkProto::OnOptionsInit(WPARAM wParam, LPARAM lParam) odp.ptszTitle = m_tszUserName;
odp.dwInitParam = LPARAM(this);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.position = 1;
odp.ptszGroup = LPGENT("Network");
+
odp.ptszTab = LPGENT("Account");
+ odp.position = 1;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MAIN);
odp.pfnDlgProc = &CVkProto::OptionsProc;
Options_AddPage(wParam, &odp);
+
+ odp.ptszTab = LPGENT("Advanced");
+ odp.position = 2;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ADV);
+ odp.pfnDlgProc = &CVkProto::OptionsAdvProc;
+ Options_AddPage(wParam, &odp);
return 0;
}
|