summaryrefslogtreecommitdiff
path: root/plugins/StatusManager/src/AdvancedAutoAway
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-10-16 13:29:32 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-10-16 13:29:32 +0300
commit9d6b20ce1cfc010f9b9cc47d376dd0f01e290ca4 (patch)
treedd4c8561d6997ccf2186a748cdc867160c2053d4 /plugins/StatusManager/src/AdvancedAutoAway
parent56239808326cc550d0b1bd45a368e89957e7021b (diff)
StatusManager: atavism (manual options tab) in options removed
Diffstat (limited to 'plugins/StatusManager/src/AdvancedAutoAway')
-rw-r--r--plugins/StatusManager/src/AdvancedAutoAway/aaa_msgoptions.cpp9
-rw-r--r--plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp116
-rw-r--r--plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.h7
3 files changed, 24 insertions, 108 deletions
diff --git a/plugins/StatusManager/src/AdvancedAutoAway/aaa_msgoptions.cpp b/plugins/StatusManager/src/AdvancedAutoAway/aaa_msgoptions.cpp
index 35834d4e75..f9b04fba79 100644
--- a/plugins/StatusManager/src/AdvancedAutoAway/aaa_msgoptions.cpp
+++ b/plugins/StatusManager/src/AdvancedAutoAway/aaa_msgoptions.cpp
@@ -19,7 +19,14 @@
#include "..\stdafx.h"
-extern char *StatusModeToDbSetting(int status, const char *suffix);
+struct AAMSGSETTING
+{
+ short useCustom;
+ int status;
+ char* msg;
+};
+
+char *StatusModeToDbSetting(int status, const char *suffix);
void DisableDialog(HWND hwndDlg)
{
diff --git a/plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp b/plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp
index 58b79a22f0..3f48a7bee4 100644
--- a/plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp
+++ b/plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp
@@ -415,102 +415,6 @@ static INT_PTR CALLBACK DlgProcAutoAwayGeneralOpts(HWND hwndDlg, UINT msg, WPARA
}
/////////////////////////////////////////////////////////////////////////////////////////
-// Tab window procedure
-
-static INT_PTR CALLBACK DlgProcAutoAwayTabs(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
-{
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- {
- RECT rcTabs, rcOptions, rcPage;
- bSettingSame = db_get_b(0, AAAMODULENAME, SETTING_SAMESETTINGS, FALSE);
-
- // set tabs
- int tabCount = 0;
- HWND hTab = GetDlgItem(hwndDlg, IDC_TABS);
- GetWindowRect(hTab, &rcTabs);
- GetWindowRect(hwndDlg, &rcOptions);
-
- // general tab
- TCITEM tci = { 0 };
- tci.mask = TCIF_TEXT | TCIF_PARAM;
- tci.pszText = TranslateT("General");
- HWND hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_GENAUTOAWAY), hwndDlg, DlgProcAutoAwayGeneralOpts, (LPARAM)GetParent(hwndDlg));
- EnableThemeDialogTexture(hPage, ETDT_ENABLETAB);
-
- tci.lParam = (LPARAM)hPage;
- GetClientRect(hPage, &rcPage);
- MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right - rcTabs.left) - (rcPage.right - rcPage.left)) / 2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom - rcTabs.top) - (rcPage.bottom - rcPage.top)) / 2, rcPage.right - rcPage.left, rcPage.bottom - rcPage.top, TRUE);
- ShowWindow(hPage, SW_HIDE);
- TabCtrl_InsertItem(hTab, tabCount++, &tci);
- HWND hShow = hPage;
-
- // rules tab
- tci.mask = TCIF_TEXT | TCIF_PARAM;
- tci.pszText = TranslateT("Rules");
- hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_AUTOAWAY), hwndDlg, DlgProcAutoAwayRulesOpts, (LPARAM)GetParent(hwndDlg));
- EnableThemeDialogTexture(hPage, ETDT_ENABLETAB);
-
- tci.lParam = (LPARAM)hPage;
- GetClientRect(hPage, &rcPage);
- MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right - rcTabs.left) - (rcPage.right - rcPage.left)) / 2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom - rcTabs.top) - (rcPage.bottom - rcPage.top)) / 2, rcPage.right - rcPage.left, rcPage.bottom - rcPage.top, TRUE);
- ShowWindow(hPage, SW_HIDE);
- TabCtrl_InsertItem(hTab, tabCount++, &tci);
-
- // messages tab
- tci.mask = TCIF_TEXT | TCIF_PARAM;
- tci.pszText = TranslateT("Status messages");
- hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_AUTOAWAYMSG), hwndDlg, DlgProcAutoAwayMsgOpts, (LPARAM)GetParent(hwndDlg));
- EnableThemeDialogTexture(hPage, ETDT_ENABLETAB);
-
- tci.lParam = (LPARAM)hPage;
- GetClientRect(hPage, &rcPage);
- MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right - rcTabs.left) - (rcPage.right - rcPage.left)) / 2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom - rcTabs.top) - (rcPage.bottom - rcPage.top)) / 2, rcPage.right - rcPage.left, rcPage.bottom - rcPage.top, TRUE);
- ShowWindow(hPage, SW_HIDE);
- TabCtrl_InsertItem(hTab, tabCount++, &tci);
-
- ShowWindow(hShow, SW_SHOW);
- }
- break;
-
- case PSM_CHANGED:
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
-
- case WM_NOTIFY:
- if ((((NMHDR*)lParam)->idFrom == IDC_TABS)) {
- if (((NMHDR*)lParam)->code == TCN_SELCHANGING) {
- TCITEM tci;
-
- tci.mask = TCIF_PARAM;
- TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TABS)), &tci);
- ShowWindow((HWND)tci.lParam, SW_HIDE);
- }
- else if (((NMHDR*)lParam)->code == TCN_SELCHANGE) {
- TCITEM tci;
-
- tci.mask = TCIF_PARAM;
- TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TABS)), &tci);
- ShowWindow((HWND)tci.lParam, SW_SHOW);
- }
- }
- if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- TCITEM tci;
- tci.mask = TCIF_PARAM;
- int count = TabCtrl_GetItemCount(GetDlgItem(hwndDlg, IDC_TABS));
- for (int i = 0; i < count; i++) {
- TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), i, &tci);
- SendMessage((HWND)tci.lParam, WM_NOTIFY, 0, lParam);
- }
- }
- break;
- }
-
- return FALSE;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
// Options initialization procedure
int AutoAwayOptInitialise(WPARAM wParam, LPARAM)
@@ -518,11 +422,23 @@ int AutoAwayOptInitialise(WPARAM wParam, LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 1000000000;
odp.hInstance = hInst;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TABS);
- odp.szTitle.a = LPGEN("Auto away");
- odp.szGroup.a = LPGEN("Status");
- odp.pfnDlgProc = DlgProcAutoAwayTabs;
odp.flags = ODPF_BOLDGROUPS;
+ odp.szGroup.a = LPGEN("Status");
+ odp.szTitle.a = LPGEN("Auto away");
+
+ odp.szTab.a = LPGEN("General");
+ odp.pfnDlgProc = DlgProcAutoAwayGeneralOpts;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GENAUTOAWAY);
+ Options_AddPage(wParam, &odp);
+
+ odp.szTab.a = LPGEN("Rules");
+ odp.pfnDlgProc = DlgProcAutoAwayRulesOpts;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_AUTOAWAY);
+ Options_AddPage(wParam, &odp);
+
+ odp.szTab.a = LPGEN("Status messages");
+ odp.pfnDlgProc = DlgProcAutoAwayMsgOpts;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_AUTOAWAYMSG);
Options_AddPage(wParam, &odp);
return 0;
}
diff --git a/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.h b/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.h
index c529bf69e0..6feb889b99 100644
--- a/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.h
+++ b/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.h
@@ -72,13 +72,6 @@ struct TAAAProtoSetting : public PROTOCOLSETTINGEX, public MZeroedObject
int AAACompareSettings(const TAAAProtoSetting *p1, const TAAAProtoSetting *p2);
-struct AAMSGSETTING
-{
- short useCustom;
- int status;
- char* msg;
-};
-
void AdvancedAutoAwayLoad();
void AdvancedAutoAwayUnload();