diff options
-rw-r--r-- | include/m_clistint.h | 1 | ||||
-rw-r--r-- | plugins/Clist_blind/res/resource.rc | 3 | ||||
-rw-r--r-- | plugins/Clist_blind/src/clcopts.cpp | 93 | ||||
-rw-r--r-- | plugins/Clist_blind/src/resource.h | 1 | ||||
-rw-r--r-- | plugins/Clist_modern/res/resource.rc | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcopts.cpp | 20 | ||||
-rw-r--r-- | plugins/Clist_modern/src/resource.h | 1 | ||||
-rw-r--r-- | plugins/Clist_nicer/res/resource.rc | 2 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcopts.cpp | 44 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/resource.h | 1 | ||||
-rw-r--r-- | src/core/stdclist/res/resource.rc | 2 | ||||
-rw-r--r-- | src/core/stdclist/src/clcopts.cpp | 23 | ||||
-rw-r--r-- | src/core/stdclist/src/resource.h | 1 | ||||
-rw-r--r-- | src/mir_app/res/resource.rc | 16 | ||||
-rw-r--r-- | src/mir_app/src/clc.h | 1 | ||||
-rw-r--r-- | src/mir_app/src/clcutils.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/clistopts.cpp | 57 | ||||
-rw-r--r-- | src/mir_app/src/resource.h | 1 |
18 files changed, 88 insertions, 183 deletions
diff --git a/include/m_clistint.h b/include/m_clistint.h index 1e704e209d..a22cde34c4 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -224,7 +224,6 @@ struct MenuProto #define CLCDEFAULT_BKCOLOUR GetSysColor(COLOR_3DFACE)
#define CLCDEFAULT_USEBITMAP 0
#define CLCDEFAULT_BKBMPUSE CLB_STRETCH
-#define CLCDEFAULT_OFFLINEMODES MODEF_OFFLINE
#define CLCDEFAULT_GREYOUTFLAGS 0
#define CLCDEFAULT_FULLGREYOUTFLAGS (MODEF_OFFLINE|PF2_INVISIBLE|GREYF_UNFOCUS)
#define CLCDEFAULT_SELBLEND 1
diff --git a/plugins/Clist_blind/res/resource.rc b/plugins/Clist_blind/res/resource.rc index 1829012b75..397b74f441 100644 --- a/plugins/Clist_blind/res/resource.rc +++ b/plugins/Clist_blind/res/resource.rc @@ -134,9 +134,6 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Items",IDC_STATIC,2,2,310,88
- LTEXT "'Hide offline' means to hide:",IDC_STATIC,191,10,112,8
- CONTROL "Tree1",IDC_HIDEOFFLINEOPTS,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | TVS_NONEVENHEIGHT | WS_BORDER | WS_TABSTOP,191,20,112,63
GROUPBOX "Groups",IDC_STATIC,2,93,310,67
CONTROL "Show counts of number of contacts in a group",IDC_SHOWGROUPCOUNTS,
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,106,292,11
diff --git a/plugins/Clist_blind/src/clcopts.cpp b/plugins/Clist_blind/src/clcopts.cpp index 36a8b33532..522cd62d9b 100644 --- a/plugins/Clist_blind/src/clcopts.cpp +++ b/plugins/Clist_blind/src/clcopts.cpp @@ -30,14 +30,13 @@ wchar_t* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* set #define DBFONTF_ITALIC 2
#define DBFONTF_UNDERLINE 4
-struct CheckBoxToStyleEx_t
+struct
{
int id;
DWORD flag;
int not;
}
-
-static const checkBoxToStyleEx[] =
+static checkBoxToStyleEx[] =
{
{ IDC_TRACKSELECT, CLS_EX_TRACKSELECT, 0 },
{ IDC_SHOWGROUPCOUNTS, CLS_EX_SHOWGROUPCOUNTS, 0 },
@@ -48,66 +47,6 @@ static const checkBoxToStyleEx[] = { IDC_NOTNOSMOOTHSCROLLING, CLS_EX_NOSMOOTHSCROLLING, 1 }
};
-struct CheckBoxValues_t
-{
- DWORD style;
- wchar_t* szDescr;
-};
-
-static const struct CheckBoxValues_t greyoutValues[] = {
- { GREYF_UNFOCUS, LPGENW("Not focused") },
- { MODEF_OFFLINE, LPGENW("Offline") },
- { PF2_ONLINE, LPGENW("Online") },
- { PF2_SHORTAWAY, LPGENW("Away") },
- { PF2_LONGAWAY, LPGENW("Not available") },
- { PF2_LIGHTDND, LPGENW("Occupied") },
- { PF2_HEAVYDND, LPGENW("Do not disturb")},
- { PF2_FREECHAT, LPGENW("Free for chat") },
- { PF2_INVISIBLE, LPGENW("Invisible") },
-};
-
-static const struct CheckBoxValues_t offlineValues[] = {
- { MODEF_OFFLINE, LPGENW("Offline") },
- { PF2_ONLINE, LPGENW("Online") },
- { PF2_SHORTAWAY, LPGENW("Away") },
- { PF2_LONGAWAY, LPGENW("Not available") },
- { PF2_LIGHTDND, LPGENW("Occupied") },
- { PF2_HEAVYDND, LPGENW("Do not disturb")},
- { PF2_FREECHAT, LPGENW("Free for chat") },
- { PF2_INVISIBLE, LPGENW("Invisible") },
-};
-
-static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style)
-{
- TVINSERTSTRUCT tvis;
- tvis.hParent = nullptr;
- tvis.hInsertAfter = TVI_LAST;
- tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
- for (int i = 0; i < nValues; i++) {
- tvis.item.lParam = values[i].style;
- tvis.item.pszText = TranslateW( values[i].szDescr );
- tvis.item.stateMask = TVIS_STATEIMAGEMASK;
- tvis.item.state = INDEXTOSTATEIMAGEMASK((style & tvis.item.lParam) != 0 ? 2 : 1);
- TreeView_InsertItem( hwndTree, &tvis);
-} }
-
-static DWORD MakeCheckBoxTreeFlags(HWND hwndTree)
-{
- DWORD flags = 0;
- TVITEM tvi;
-
- tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_STATE;
- tvi.hItem = TreeView_GetRoot(hwndTree);
- while (tvi.hItem) {
- TreeView_GetItem(hwndTree, &tvi);
- if (((tvi.state & TVIS_STATEIMAGEMASK) >> 12 == 2))
- flags |= tvi.lParam;
- tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
- }
- return flags;
-}
-
-
static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
wchar_t tmp[1024];
@@ -115,8 +54,6 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE,
- GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
{
DWORD exStyle = db_get_dw(0, "CLC", "ExStyle", Clist_GetDefaultExStyle());
for (auto &it : checkBoxToStyleEx)
@@ -137,8 +74,6 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_SETPOS, 0,
MAKELONG(db_get_b(0, "CLC", "GroupIndent", CLCDEFAULT_GROUPINDENT), 0));
EnableWindow(GetDlgItem(hwndDlg, IDC_SMOOTHTIME), IsDlgButtonChecked(hwndDlg, IDC_NOTNOSMOOTHSCROLLING));
- FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), offlineValues, _countof(offlineValues),
- db_get_dw(0, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES));
SetDlgItemText(hwndDlg, IDC_T_CONTACT, MyDBGetContactSettingTString(NULL, "CLC", "TemplateContact", tmp, 1024, TranslateT("%name% [%status% %protocol%] %status_message%")));
SendDlgItemMessage(hwndDlg, IDC_T_CONTACT, EM_LIMITTEXT, 256, 0);
@@ -149,9 +84,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam SetDlgItemText(hwndDlg, IDC_T_INFO, MyDBGetContactSettingTString(NULL, "CLC", "TemplateInfo", tmp, 1024, TranslateT("Info: %s")));
SendDlgItemMessage(hwndDlg, IDC_T_INFO, EM_LIMITTEXT, 256, 0);
return TRUE;
- case WM_VSCROLL:
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
+
case WM_COMMAND:
if (LOWORD(wParam) == IDC_NOTNOSMOOTHSCROLLING)
EnableWindow(GetDlgItem(hwndDlg, IDC_SMOOTHTIME), IsDlgButtonChecked(hwndDlg, IDC_NOTNOSMOOTHSCROLLING));
@@ -163,26 +96,9 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam return 0;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
+
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->idFrom) {
- case IDC_HIDEOFFLINEOPTS:
- if (((LPNMHDR)lParam)->code == NM_CLICK) {
- TVHITTESTINFO hti;
- hti.pt.x = (short)LOWORD(GetMessagePos());
- hti.pt.y = (short)HIWORD(GetMessagePos());
- ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
- if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti))
- if (hti.flags & TVHT_ONITEMSTATEICON) {
- TVITEM tvi;
- tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
- tvi.hItem = hti.hItem;
- TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
- tvi.iImage = tvi.iSelectedImage = tvi.iImage == 1 ? 2 : 1;
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
- break;
case 0:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
int i;
@@ -193,7 +109,6 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam db_set_dw(0, "CLC", "ExStyle", exStyle);
db_set_b(0, "CLC", "ShowIdle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0));
- db_set_dw(0, "CLC", "OfflineModes", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS)));
db_set_b(0, "CLC", "LeftMargin",
(BYTE)SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
db_set_w(0, "CLC", "ScrollTime",
diff --git a/plugins/Clist_blind/src/resource.h b/plugins/Clist_blind/src/resource.h index ab9eeb7a16..5d59bb030e 100644 --- a/plugins/Clist_blind/src/resource.h +++ b/plugins/Clist_blind/src/resource.h @@ -72,7 +72,6 @@ #define IDC_SCRIPT 1300
#define IDC_TILEV 1301
#define IDC_GAMMACORRECT 1302
-#define IDC_HIDEOFFLINEOPTS 1308
#define IDC_DONTCYCLE 1315
#define IDC_PRIMARYSTATUS 1316
#define IDC_CYCLE 1317
diff --git a/plugins/Clist_modern/res/resource.rc b/plugins/Clist_modern/res/resource.rc index 038d21db4a..e0a3667736 100644 --- a/plugins/Clist_modern/res/resource.rc +++ b/plugins/Clist_modern/res/resource.rc @@ -384,8 +384,6 @@ BEGIN CONTROL "Make selection highlight translucent",IDC_NOTNOTRANSLUCENTSEL,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,77,175,10
CONTROL "Dim idle contacts",IDC_IDLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,89,153,10
- CTEXT "'Hide offline' means to hide:",IDC_STATIC,185,14,112,8
- CONTROL "Tree1",IDC_HIDEOFFLINEOPTS,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | TVS_NONEVENHEIGHT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,191,24,105,73
GROUPBOX "Groups",IDC_STATIC,2,105,148,115
CONTROL "Draw a line alongside group names",IDC_LINEWITHGROUPS,
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,114,131,16
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index e090ed6601..e2a38d164a 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -244,9 +244,8 @@ struct CheckBoxValues_t {
DWORD style;
wchar_t *szDescr;
-};
-
-static const struct CheckBoxValues_t greyoutValues[] = {
+}
+static const greyoutValues[] = {
{ GREYF_UNFOCUS, LPGENW("Not focused") },
{ MODEF_OFFLINE, LPGENW("Offline") },
{ PF2_ONLINE, LPGENW("Online") },
@@ -258,17 +257,6 @@ static const struct CheckBoxValues_t greyoutValues[] = { { PF2_INVISIBLE, LPGENW("Invisible") }
};
-static const struct CheckBoxValues_t offlineValues[] = {
- { MODEF_OFFLINE, LPGENW("Offline") },
- { PF2_ONLINE, LPGENW("Online") },
- { PF2_SHORTAWAY, LPGENW("Away") },
- { PF2_LONGAWAY, LPGENW("Not available") },
- { PF2_LIGHTDND, LPGENW("Occupied") },
- { PF2_HEAVYDND, LPGENW("Do not disturb") },
- { PF2_FREECHAT, LPGENW("Free for chat") },
- { PF2_INVISIBLE, LPGENW("Invisible") }
-};
-
static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style)
{
TVINSERTSTRUCT tvis;
@@ -373,7 +361,6 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
{
DWORD exStyle = db_get_dw(0, "CLC", "ExStyle", GetDefaultExStyle());
for (auto &it : checkBoxToStyleEx)
@@ -393,7 +380,6 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar EnableWindow(GetDlgItem(hwndDlg, IDC_SMOOTHTIME), IsDlgButtonChecked(hwndDlg, IDC_NOTNOSMOOTHSCROLLING));
EnableWindow(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), IsDlgButtonChecked(hwndDlg, IDC_GREYOUT));
FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), greyoutValues, _countof(greyoutValues), db_get_dw(0, "CLC", "FullGreyoutFlags", CLCDEFAULT_FULLGREYOUTFLAGS));
- FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), offlineValues, _countof(offlineValues), db_get_dw(0, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES));
CheckDlgButton(hwndDlg, IDC_NOSCROLLBAR, db_get_b(0, "CLC", "NoVScrollBar", CLCDEFAULT_NOVSCROLL) ? BST_CHECKED : BST_UNCHECKED);
return TRUE;
@@ -413,7 +399,6 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar case WM_NOTIFY:
switch (((LPNMHDR)lParam)->idFrom) {
case IDC_GREYOUTOPTS:
- case IDC_HIDEOFFLINEOPTS:
if (((LPNMHDR)lParam)->code == NM_CLICK) {
TVHITTESTINFO hti;
hti.pt.x = (short)LOWORD(GetMessagePos());
@@ -450,7 +435,6 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar db_set_dw(0, "CLC", "GreyoutFlags", 0);
db_set_b(0, "CLC", "ShowIdle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0));
- db_set_dw(0, "CLC", "OfflineModes", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS)));
db_set_w(0, "CLC", "ScrollTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_GETPOS, 0, 0));
db_set_b(0, "CLC", "GroupIndent", (BYTE)SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0));
db_set_b(0, "CLC", "NoVScrollBar", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NOSCROLLBAR) ? 1 : 0));
diff --git a/plugins/Clist_modern/src/resource.h b/plugins/Clist_modern/src/resource.h index 3351ae4ae6..7aac6af638 100644 --- a/plugins/Clist_modern/src/resource.h +++ b/plugins/Clist_modern/src/resource.h @@ -173,7 +173,6 @@ #define IDC_TILEV 1301
#define IDC_GAMMACORRECT 1302
#define IDC_TILEVROWH 1302
-#define IDC_HIDEOFFLINEOPTS 1308
#define IDC_CYCLETIME 1318
#define IDC_CYCLETIMESPIN 1319
#define IDC_HIDETIMESPIN 1320
diff --git a/plugins/Clist_nicer/res/resource.rc b/plugins/Clist_nicer/res/resource.rc index e28a325ac4..baed5a1603 100644 --- a/plugins/Clist_nicer/res/resource.rc +++ b/plugins/Clist_nicer/res/resource.rc @@ -148,8 +148,6 @@ BEGIN "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,5,61,130,16
CONTROL "Do not separate offline contacts",IDC_DONTSEPARATE,
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,5,80,132,16
- LTEXT "Hide as offline",IDC_STATIC,151,1,73,8
- CONTROL "",IDC_HIDEOFFLINEOPTS,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | TVS_NONEVENHEIGHT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,147,11,152,134
LTEXT "Right align contacts",IDC_STATIC,5,150,130,10
COMBOBOX IDC_CLISTALIGN,147,148,77,56,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
END
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 5c5f05ea28..6a9838805d 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -63,15 +63,17 @@ struct CheckBoxToGroupStyleEx_t { struct CheckBoxValues_t {
DWORD style;
wchar_t *szDescr;
-};
-
-static const struct CheckBoxValues_t greyoutValues[] = {
- { GREYF_UNFOCUS, LPGENW("Not focused") }, { MODEF_OFFLINE, LPGENW("Offline") }, { PF2_ONLINE, LPGENW("Online") }, { PF2_SHORTAWAY, LPGENW("Away") },
- { PF2_LONGAWAY, LPGENW("Not available") }, { PF2_LIGHTDND, LPGENW("Occupied") }, { PF2_HEAVYDND, LPGENW("Do not disturb") }, { PF2_FREECHAT, LPGENW("Free for chat") }, { PF2_INVISIBLE, LPGENW("Invisible") },
-};
-static const struct CheckBoxValues_t offlineValues[] = {
- { MODEF_OFFLINE, LPGENW("Offline") }, { PF2_ONLINE, LPGENW("Online") }, { PF2_SHORTAWAY, LPGENW("Away") }, { PF2_LONGAWAY, LPGENW("Not available") },
- { PF2_LIGHTDND, LPGENW("Occupied") }, { PF2_HEAVYDND, LPGENW("Do not disturb") }, { PF2_FREECHAT, LPGENW("Free for chat") }, { PF2_INVISIBLE, LPGENW("Invisible") }
+}
+static const greyoutValues[] = {
+ { GREYF_UNFOCUS, LPGENW("Not focused") },
+ { MODEF_OFFLINE, LPGENW("Offline") },
+ { PF2_ONLINE, LPGENW("Online") },
+ { PF2_SHORTAWAY, LPGENW("Away") },
+ { PF2_LONGAWAY, LPGENW("Not available") },
+ { PF2_LIGHTDND, LPGENW("Occupied") },
+ { PF2_HEAVYDND, LPGENW("Do not disturb") },
+ { PF2_FREECHAT, LPGENW("Free for chat") },
+ { PF2_INVISIBLE, LPGENW("Invisible") },
};
static UINT sortCtrlIDs[] = { IDC_SORTPRIMARY, IDC_SORTTHEN, IDC_SORTFINALLY, 0 };
@@ -238,8 +240,6 @@ static INT_PTR CALLBACK DlgProcDspItems(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
-
for (int i = 0; sortCtrlIDs[i] != 0; i++) {
SendDlgItemMessage(hwndDlg, sortCtrlIDs[i], CB_INSERTSTRING, -1, (LPARAM)TranslateT("Nothing"));
SendDlgItemMessage(hwndDlg, sortCtrlIDs[i], CB_INSERTSTRING, -1, (LPARAM)TranslateT("Name"));
@@ -253,7 +253,6 @@ static INT_PTR CALLBACK DlgProcDspItems(HWND hwndDlg, UINT msg, WPARAM wParam, L SendDlgItemMessage(hwndDlg, IDC_CLISTALIGN, CB_INSERTSTRING, -1, (LPARAM)TranslateT("For RTL only"));
SendDlgItemMessage(hwndDlg, IDC_CLISTALIGN, CB_INSERTSTRING, -1, (LPARAM)TranslateT("RTL TEXT only"));
- FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), offlineValues, sizeof(offlineValues) / sizeof(offlineValues[0]), db_get_dw(0, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES));
CheckDlgButton(hwndDlg, IDC_EVENTSONTOP, (cfg::dat.dwFlags & CLUI_STICKYEVENTS) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DONTSEPARATE, cfg::dat.bDontSeparateOffline ? BST_CHECKED : BST_UNCHECKED);
for (int i = 0; sortCtrlIDs[i] != 0; i++)
@@ -272,25 +271,6 @@ static INT_PTR CALLBACK DlgProcDspItems(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_NOTIFY:
switch (((LPNMHDR)lParam)->idFrom) {
- case IDC_HIDEOFFLINEOPTS:
- if (((LPNMHDR)lParam)->code == NM_CLICK) {
- TVHITTESTINFO hti;
- hti.pt.x = (short)LOWORD(GetMessagePos());
- hti.pt.y = (short)HIWORD(GetMessagePos());
- ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
- if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti))
- if (hti.flags & TVHT_ONITEMSTATEICON) {
- TVITEM tvi;
- tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
- tvi.hItem = hti.hItem;
- TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
- tvi.iImage = tvi.iSelectedImage = tvi.iImage == 1 ? 2 : 1;
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
- break;
-
case 0:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
for (int i = 0; sortCtrlIDs[i] != 0; i++) {
@@ -305,8 +285,6 @@ static INT_PTR CALLBACK DlgProcDspItems(HWND hwndDlg, UINT msg, WPARAM wParam, L cfg::dat.bDontSeparateOffline = IsDlgButtonChecked(hwndDlg, IDC_DONTSEPARATE) ? 1 : 0;
g_plugin.setByte("DontSeparateOffline", (BYTE)cfg::dat.bDontSeparateOffline);
- db_set_dw(0, "CLC", "OfflineModes", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS)));
-
cfgSetFlag(hwndDlg, IDC_EVENTSONTOP, CLUI_STICKYEVENTS);
cfg::dat.bUseDCMirroring = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CLISTALIGN, CB_GETCURSEL, 0, 0);
diff --git a/plugins/Clist_nicer/src/resource.h b/plugins/Clist_nicer/src/resource.h index caa128069a..851b1edcc3 100644 --- a/plugins/Clist_nicer/src/resource.h +++ b/plugins/Clist_nicer/src/resource.h @@ -82,7 +82,6 @@ #define IDC_CBOTTOMSPIN 1079
#define IDC_CRIGHT 1080
#define IDC_CRIGHTSPIN 1081
-#define IDC_HIDEOFFLINEOPTS 1082
#define IDC_LEFTMARGINSPIN 1092
#define IDC_NOGROUPICON 1102
#define IDC_ONECLK 1105
diff --git a/src/core/stdclist/res/resource.rc b/src/core/stdclist/res/resource.rc index e2db018eeb..c040eff77e 100644 --- a/src/core/stdclist/res/resource.rc +++ b/src/core/stdclist/res/resource.rc @@ -130,8 +130,6 @@ BEGIN CONTROL "Make selection highlight translucent",IDC_NOTNOTRANSLUCENTSEL,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,83,179,10
CONTROL "Dim idle contacts",IDC_IDLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,96,153,10
- LTEXT "'Hide offline' means to hide:",IDC_STATIC,191,10,112,8
- CONTROL "Tree1",IDC_HIDEOFFLINEOPTS,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,191,20,112,84
GROUPBOX "Groups",IDC_STATIC,2,112,148,136
CONTROL "Draw a line alongside group names",IDC_LINEWITHGROUPS,
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,129,131,16
diff --git a/src/core/stdclist/src/clcopts.cpp b/src/core/stdclist/src/clcopts.cpp index d3a7d34a8f..7f0507eb15 100644 --- a/src/core/stdclist/src/clcopts.cpp +++ b/src/core/stdclist/src/clcopts.cpp @@ -55,9 +55,8 @@ struct CheckBoxValues_t {
DWORD style;
wchar_t* szDescr;
-};
-
-static const struct CheckBoxValues_t greyoutValues[] =
+}
+static const greyoutValues[] =
{
{ GREYF_UNFOCUS, LPGENW("Not focused") },
{ MODEF_OFFLINE, LPGENW("Offline") },
@@ -70,18 +69,6 @@ static const struct CheckBoxValues_t greyoutValues[] = { PF2_INVISIBLE, LPGENW("Invisible") }
};
-static const struct CheckBoxValues_t offlineValues[] =
-{
- { MODEF_OFFLINE, LPGENW("Offline") },
- { PF2_ONLINE, LPGENW("Online") },
- { PF2_SHORTAWAY, LPGENW("Away") },
- { PF2_LONGAWAY, LPGENW("Not available") },
- { PF2_LIGHTDND, LPGENW("Occupied") },
- { PF2_HEAVYDND, LPGENW("Do not disturb")},
- { PF2_FREECHAT, LPGENW("Free for chat") },
- { PF2_INVISIBLE, LPGENW("Invisible") }
-};
-
static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style)
{
TVINSERTSTRUCT tvis;
@@ -142,8 +129,6 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), GWL_STYLE,
GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE,
- GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
{
DWORD exStyle = db_get_dw(0, "CLC", "ExStyle", Clist_GetDefaultExStyle());
for (auto &it : checkBoxToStyleEx)
@@ -169,8 +154,6 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam EnableWindow(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), IsDlgButtonChecked(hwndDlg, IDC_GREYOUT));
FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), greyoutValues, _countof(greyoutValues),
db_get_dw(0, "CLC", "FullGreyoutFlags", CLCDEFAULT_FULLGREYOUTFLAGS));
- FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), offlineValues, _countof(offlineValues),
- db_get_dw(0, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES));
CheckDlgButton(hwndDlg, IDC_NOSCROLLBAR, db_get_b(0, "CLC", "NoVScrollBar", 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_GAMMACORRECT, db_get_b(0, "CLC", "GammaCorrect", CLCDEFAULT_GAMMACORRECT) ? BST_CHECKED : BST_UNCHECKED);
{
@@ -214,7 +197,6 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam case WM_NOTIFY:
switch (((LPNMHDR)lParam)->idFrom) {
case IDC_GREYOUTOPTS:
- case IDC_HIDEOFFLINEOPTS:
if (((LPNMHDR)lParam)->code == NM_CLICK) {
TVHITTESTINFO hti;
hti.pt.x = (short)LOWORD(GetMessagePos());
@@ -250,7 +232,6 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam db_set_dw(0, "CLC", "GreyoutFlags", 0);
}
db_set_b(0, "CLC", "ShowIdle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0));
- db_set_dw(0, "CLC", "OfflineModes", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS)));
db_set_b(0, "CLC", "LeftMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
db_set_w(0, "CLC", "ScrollTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_GETPOS, 0, 0));
db_set_b(0, "CLC", "GroupIndent", (BYTE)SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0));
diff --git a/src/core/stdclist/src/resource.h b/src/core/stdclist/src/resource.h index d25ecb5890..b4c544a1d2 100644 --- a/src/core/stdclist/src/resource.h +++ b/src/core/stdclist/src/resource.h @@ -74,7 +74,6 @@ #define IDC_SCRIPT 1300
#define IDC_TILEV 1301
#define IDC_GAMMACORRECT 1302
-#define IDC_HIDEOFFLINEOPTS 1308
#define IDC_DONTCYCLE 1315
#define IDC_PRIMARYSTATUS 1316
#define IDC_CYCLE 1317
diff --git a/src/mir_app/res/resource.rc b/src/mir_app/res/resource.rc index eaee0c1dae..1a3e54ef0b 100644 --- a/src/mir_app/res/resource.rc +++ b/src/mir_app/res/resource.rc @@ -779,14 +779,16 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Contact list",IDC_STATIC,6,5,289,90
- CONTROL "Hide offline users",IDC_HIDEOFFLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,17,124,10
- CONTROL "Hide empty groups",IDC_HIDEEMPTYGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,29,124,10
- CONTROL "Enable groups",IDC_USEGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,41,124,10
- CONTROL "Ask before deleting contacts",IDC_CONFIRMDELETE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,53,124,10
+ GROUPBOX "Contact list",IDC_STATIC,6,5,289,130
+ CONTROL "Hide offline users",IDC_HIDEOFFLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,17,166,10
+ CONTROL "Hide empty groups",IDC_HIDEEMPTYGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,29,166,10
+ CONTROL "Enable groups",IDC_USEGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,41,166,10
+ CONTROL "Ask before deleting contacts",IDC_CONFIRMDELETE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,53,166,10
CONTROL "Remove temporary contacts on exit",IDC_REMOVETEMP,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,65,276,10
- CONTROL "Disable icon blinking",IDC_DISABLEICONBLINK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,77,276,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,65,166,10
+ CONTROL "Disable icon blinking",IDC_DISABLEICONBLINK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,77,166,10
+ CTEXT "'Hide offline' means to hide:",IDC_STATIC,183,14,105,8
+ CONTROL "",IDC_HIDEOFFLINEOPTS,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | TVS_NONEVENHEIGHT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,183,24,105,104
END
IDD_EMPTY DIALOGEX 0, 0, 212, 131
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h index 7e5bbbb19a..424d705f53 100644 --- a/src/mir_app/src/clc.h +++ b/src/mir_app/src/clc.h @@ -96,6 +96,7 @@ int ClcOptInit(WPARAM, LPARAM); namespace Clist
{
extern CMOption<bool> RemoveTempContacts, DisableIconBlink;
+ extern CMOption<DWORD> OfflineModes;
};
/* clistmenus.c */
diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp index fec6791349..510d011fa7 100644 --- a/src/mir_app/src/clcutils.cpp +++ b/src/mir_app/src/clcutils.cpp @@ -745,7 +745,7 @@ void fnLoadClcOptions(HWND hwnd, ClcData *dat, BOOL bFirst) SendMessage(hwnd, INTM_SCROLLBARCHANGED, 0, 0);
dat->greyoutFlags = db_get_dw(0, "CLC", "GreyoutFlags", CLCDEFAULT_GREYOUTFLAGS);
- dat->offlineModes = db_get_dw(0, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES);
+ dat->offlineModes = Clist::OfflineModes;
dat->selBkColour = db_get_dw(0, "CLC", "SelBkColour", CLCDEFAULT_SELBKCOLOUR);
dat->selTextColour = db_get_dw(0, "CLC", "SelTextColour", CLCDEFAULT_SELTEXTCOLOUR);
dat->hotTextColour = db_get_dw(0, "CLC", "HotTextColour", CLCDEFAULT_HOTTEXTCOLOUR);
diff --git a/src/mir_app/src/clistopts.cpp b/src/mir_app/src/clistopts.cpp index 5678fd1da6..b7c0ec7463 100644 --- a/src/mir_app/src/clistopts.cpp +++ b/src/mir_app/src/clistopts.cpp @@ -34,13 +34,36 @@ CMOption<bool> Clist::HideEmptyGroups(MODULENAME, "HideEmptyGroups", false); CMOption<bool> Clist::DisableIconBlink(MODULENAME, "NoIconBlink", false); CMOption<bool> Clist::RemoveTempContacts(MODULENAME, "RemoveTempContacts", true); +CMOption<DWORD> Clist::OfflineModes("CLC", "OfflineModes", MODEF_OFFLINE); + +struct +{ + DWORD style; + wchar_t *szDescr; +} +static const offlineValues[] = +{ + { MODEF_OFFLINE, LPGENW("Offline") }, + { PF2_ONLINE, LPGENW("Online") }, + { PF2_SHORTAWAY, LPGENW("Away") }, + { PF2_LONGAWAY, LPGENW("Not available") }, + { PF2_LIGHTDND, LPGENW("Occupied") }, + { PF2_HEAVYDND, LPGENW("Do not disturb") }, + { PF2_FREECHAT, LPGENW("Free for chat") }, + { PF2_INVISIBLE, LPGENW("Invisible") } +}; + +///////////////////////////////////////////////////////////////////////////////////////// + class ClistCommonOptsDlg : public CDlgBase { CCtrlCheck chkUseGroups, chkHideOffline, chkConfirmDelete, chkHideEmptyGroups, chkRemoveTempContacts, chkDisableIconBlink; + CCtrlTreeView hideStatuses; public: ClistCommonOptsDlg() : CDlgBase(g_plugin, IDD_OPT_CLIST), + hideStatuses(this, IDC_HIDEOFFLINEOPTS), chkUseGroups(this, IDC_USEGROUPS), chkHideOffline(this, IDC_HIDEOFFLINE), chkConfirmDelete(this, IDC_CONFIRMDELETE), @@ -56,8 +79,42 @@ public: CreateLink(chkRemoveTempContacts, Clist::RemoveTempContacts); } + bool OnInitDialog() override + { + SetWindowLongPtr(hideStatuses.GetHwnd(), GWL_STYLE, + GetWindowLongPtr(hideStatuses.GetHwnd(), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES); + + int style = Clist::OfflineModes; + + TVINSERTSTRUCT tvis; + tvis.hParent = nullptr; + tvis.hInsertAfter = TVI_LAST; + tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE; + for (auto &it : offlineValues) { + tvis.item.lParam = it.style; + tvis.item.pszText = TranslateW(it.szDescr); + tvis.item.stateMask = TVIS_STATEIMAGEMASK; + tvis.item.state = INDEXTOSTATEIMAGEMASK((style & it.style) != 0 ? 2 : 1); + hideStatuses.InsertItem(&tvis); + } + return true; + } + bool OnApply() override { + DWORD flags = 0; + + TVITEMEX tvi; + tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_STATE; + tvi.hItem = hideStatuses.GetRoot(); + while (tvi.hItem) { + hideStatuses.GetItem(&tvi); + if ((tvi.state & TVIS_STATEIMAGEMASK) >> 12 == 2) + flags |= tvi.lParam; + tvi.hItem = hideStatuses.GetNextSibling(tvi.hItem); + } + Clist::OfflineModes = flags; + Clist_LoadContactTree(); Clist_InitAutoRebuild(g_clistApi.hwndContactTree); return true; diff --git a/src/mir_app/src/resource.h b/src/mir_app/src/resource.h index 98992615d5..c87062ddd1 100644 --- a/src/mir_app/src/resource.h +++ b/src/mir_app/src/resource.h @@ -188,6 +188,7 @@ #define IDC_LANGDATE 1010
#define IDC_LNK_ADDONS 1011
#define IDC_RELOAD 1011
+#define IDC_HIDEOFFLINEOPTS 1012
#define IDC_SPECIFYPORTS 1013
#define IDC_ST_ENTERMSG 1013
#define IDC_ST_ENTERURL 1014
|