summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp295
-rw-r--r--plugins/Clist_modern/src/modern_skinopt.cpp16
-rw-r--r--plugins/Clist_modern/src/stdafx.h1
4 files changed, 0 insertions, 316 deletions
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index a0e294434a..997607814c 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -29,7 +29,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
#include "modern_clcpaint.h"
-int ModernOptInit(WPARAM wParam, LPARAM lParam);
int ModernSkinOptInit(WPARAM wParam, LPARAM lParam);
/*
@@ -1551,9 +1550,6 @@ static int clcHookModulesLoaded(WPARAM, LPARAM)
HookEvent(ME_AV_AVATARCHANGED, clcHookAvatarChanged);
- HookEvent(ME_MODERNOPT_INITIALIZE, ModernOptInit);
- HookEvent(ME_MODERNOPT_INITIALIZE, ModernSkinOptInit);
-
HookEvent(ME_FOLDERS_PATH_CHANGED, ReloadSkinFolder);
hSkinFolder = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("Modern contact list"), MIRANDA_PATHT L"\\" _A2W(DEFAULT_SKIN_FOLDER));
FoldersGetCustomPathT(hSkinFolder, SkinsFolder, _countof(SkinsFolder), _A2W(DEFAULT_SKIN_FOLDER));
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index a59411a90b..d490f48ee3 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -1499,301 +1499,6 @@ int BackgroundsUnloadModule(void)
/////////////////////////////////////////////////////////////////////////////////////////
-enum
-{
- CBVT_NONE,
- CBVT_CHAR,
- CBVT_INT,
- CBVT_BYTE,
- CBVT_DWORD,
- CBVT_BOOL,
-};
-
-struct OptCheckBox
-{
- UINT idc;
-
- DWORD defValue; // should be full combined value for masked items!
- DWORD dwBit;
-
- BYTE dbType;
- char *dbModule;
- char *dbSetting;
-
- BYTE valueType;
- union
- {
- void *pValue;
-
- char *charValue;
- int *intValue;
- BYTE *byteValue;
- DWORD *dwordValue;
- BOOL *boolValue;
- };
-};
-
-DWORD OptCheckBox_LoadValue(struct OptCheckBox *cb)
-{
- switch (cb->valueType) {
- case CBVT_NONE:
- switch (cb->dbType) {
- case DBVT_BYTE:
- return db_get_b(NULL, cb->dbModule, cb->dbSetting, cb->defValue);
- case DBVT_WORD:
- return db_get_w(NULL, cb->dbModule, cb->dbSetting, cb->defValue);
- case DBVT_DWORD:
- return db_get_dw(NULL, cb->dbModule, cb->dbSetting, cb->defValue);
- }
- break;
-
- case CBVT_CHAR:
- return *cb->charValue;
- case CBVT_INT:
- return *cb->intValue;
- case CBVT_BYTE:
- return *cb->byteValue;
- case CBVT_DWORD:
- return *cb->dwordValue;
- case CBVT_BOOL:
- return *cb->boolValue;
- }
-
- return cb->defValue;
-}
-
-void OptCheckBox_Load(HWND hwnd, struct OptCheckBox *cb)
-{
- DWORD value = OptCheckBox_LoadValue(cb);
- if (cb->dwBit) value &= cb->dwBit;
- CheckDlgButton(hwnd, cb->idc, value ? BST_CHECKED : BST_UNCHECKED);
-}
-
-void OptCheckBox_Save(HWND hwnd, struct OptCheckBox *cb)
-{
- DWORD value = IsDlgButtonChecked(hwnd, cb->idc) == BST_CHECKED;
-
- if (cb->dwBit) {
- DWORD curValue = OptCheckBox_LoadValue(cb);
- value = value ? (curValue | cb->dwBit) : (curValue & ~cb->dwBit);
- }
-
- switch (cb->dbType) {
- case DBVT_BYTE:
- db_set_b(NULL, cb->dbModule, cb->dbSetting, (BYTE)value);
- break;
- case DBVT_WORD:
- db_set_w(NULL, cb->dbModule, cb->dbSetting, (WORD)value);
- break;
- case DBVT_DWORD:
- db_set_dw(NULL, cb->dbModule, cb->dbSetting, (DWORD)value);
- break;
- }
-
- switch (cb->valueType) {
- case CBVT_CHAR:
- *cb->charValue = (char)value;
- break;
- case CBVT_INT:
- *cb->intValue = (int)value;
- break;
- case CBVT_BYTE:
- *cb->byteValue = (BYTE)value;
- break;
- case CBVT_DWORD:
- *cb->dwordValue = (DWORD)value;
- break;
- case CBVT_BOOL:
- *cb->boolValue = (BOOL)value;
- break;
- }
-}
-
-static struct OptCheckBox opts[] =
-{
- //{IDC_, def, bit, dbtype, dbmodule, dbsetting, valtype, pval},
- { IDC_ONTOP, SETTING_ONTOP_DEFAULT, 0, DBVT_BYTE, "CList", "OnTop" },
- { IDC_SHOWPROTO, SETTING_SBARSHOW_DEFAULT, 2, DBVT_BYTE, "CLUI", "SBarShow" },
- { IDC_SHOWSTATUS, SETTING_SBARSHOW_DEFAULT, 4, DBVT_BYTE, "CLUI", "SBarShow" },
- { IDC_AUTOHIDE, SETTING_AUTOHIDE_DEFAULT, 0, DBVT_BYTE, "CList", "AutoHide" },
- { IDC_FADEINOUT, SETTING_FADEIN_DEFAULT, 0, DBVT_BYTE, "CLUI", "FadeInOut" },
- { IDC_TRANSPARENT, SETTING_TRANSPARENT_DEFAULT, 0, DBVT_BYTE, "CList", "Transparent" },
- { IDC_SHOWGROUPCOUNTS, GetDefaultExStyle(), CLS_EX_SHOWGROUPCOUNTS, DBVT_DWORD, "CLC", "ExStyle" },
- { IDC_HIDECOUNTSWHENEMPTY, GetDefaultExStyle(), CLS_EX_HIDECOUNTSWHENEMPTY, DBVT_DWORD, "CLC", "ExStyle" },
- { IDC_MINIMODE, SETTING_COMPACTMODE_DEFAULT, 0, DBVT_BYTE, "CLC", "CompactMode" },
- { IDC_SHOW_AVATARS, SETTINGS_SHOWAVATARS_DEFAULT, 0, DBVT_BYTE, "CList", "AvatarsShow" },
- { IDC_SHOW_ANIAVATARS, FALSE, 0, DBVT_BYTE, "CList", "AvatarsAnimated" },
- { IDC_SHOW, SETTING_SHOWTIME_DEFAULT, 0, DBVT_BYTE, "CList", "ContactTimeShow" },
-};
-
-static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- static bool bInit = true;
- char str[10];
-
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- bInit = true;
- {
- int i, item;
- for (i = 0; i < _countof(opts); ++i)
- OptCheckBox_Load(hwndDlg, opts + i);
-
- EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
- EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
- SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETRANGE, 0, MAKELONG(900, 1));
- SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), 0));
-
- if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) {
- EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC11), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC12), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSACTIVE), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSINACTIVE), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_ACTIVEPERC), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_INACTIVEPERC), FALSE);
- }
- SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
- SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
- SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETPOS, TRUE, db_get_b(NULL, "CList", "Alpha", SETTING_ALPHA_DEFAULT));
- SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETPOS, TRUE, db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT));
- SendMessage(hwndDlg, WM_HSCROLL, 0x12345678, 0);
-
- for (i = 0; i < _countof(sortby); i++) {
- item = SendDlgItemMessage(hwndDlg, IDC_CLSORT1, CB_ADDSTRING, 0, (LPARAM)TranslateW(sortby[i]));
- SendDlgItemMessage(hwndDlg, IDC_CLSORT1, CB_SETITEMDATA, item, 0);
- item = SendDlgItemMessage(hwndDlg, IDC_CLSORT2, CB_ADDSTRING, 0, (LPARAM)TranslateW(sortby[i]));
- SendDlgItemMessage(hwndDlg, IDC_CLSORT2, CB_SETITEMDATA, item, 0);
- item = SendDlgItemMessage(hwndDlg, IDC_CLSORT3, CB_ADDSTRING, 0, (LPARAM)TranslateW(sortby[i]));
- SendDlgItemMessage(hwndDlg, IDC_CLSORT3, CB_SETITEMDATA, item, 0);
-
- }
- int s1 = db_get_b(NULL, "CList", "SortBy1", SETTING_SORTBY1_DEFAULT);
- int s2 = db_get_b(NULL, "CList", "SortBy2", SETTING_SORTBY2_DEFAULT);
- int s3 = db_get_b(NULL, "CList", "SortBy3", SETTING_SORTBY3_DEFAULT);
-
- for (i = 0; i < _countof(sortby); i++) {
- if (s1 == sortbyValue[i])
- SendDlgItemMessage(hwndDlg, IDC_CLSORT1, CB_SETCURSEL, i, 0);
- if (s2 == sortbyValue[i])
- SendDlgItemMessage(hwndDlg, IDC_CLSORT2, CB_SETCURSEL, i, 0);
- if (s3 == sortbyValue[i])
- SendDlgItemMessage(hwndDlg, IDC_CLSORT3, CB_SETCURSEL, i, 0);
- }
-
- bInit = false;
- }
- return TRUE;
-
- case WM_DESTROY:
- bInit = true;
- break;
-
- case WM_HSCROLL:
- mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
- SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str);
- mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255);
- SetDlgItemTextA(hwndDlg, IDC_ACTIVEPERC, str);
- if (wParam != 0x12345678 && !bInit)
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- break;
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDC_AUTOHIDE:
- EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
- EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
- break;
-
- case IDC_TRANSPARENT:
- EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC11), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC12), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSACTIVE), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSINACTIVE), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- EnableWindow(GetDlgItem(hwndDlg, IDC_ACTIVEPERC), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- EnableWindow(GetDlgItem(hwndDlg, IDC_INACTIVEPERC), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- break;
- }
- if (!bInit)
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
-
- case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->idFrom) {
- case 0:
- switch (((LPNMHDR)lParam)->code) {
- case PSN_APPLY:
- g_mutex_bChangingMode = TRUE;
-
- for (int i = 0; i < _countof(opts); ++i)
- OptCheckBox_Save(hwndDlg, opts + i);
-
- SetWindowPos(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
- db_set_w(NULL, "CList", "HideTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0));
-
- db_set_b(NULL, "CList", "Alpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
- db_set_b(NULL, "CList", "AutoAlpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0));
-
- int s1 = SendDlgItemMessage(hwndDlg, IDC_CLSORT1, CB_GETCURSEL, 0, 0);
- int s2 = SendDlgItemMessage(hwndDlg, IDC_CLSORT2, CB_GETCURSEL, 0, 0);
- int s3 = SendDlgItemMessage(hwndDlg, IDC_CLSORT3, CB_GETCURSEL, 0, 0);
- if (s1 >= 0) s1 = sortbyValue[s1];
- if (s2 >= 0) s2 = sortbyValue[s2];
- if (s3 >= 0) s3 = sortbyValue[s3];
- db_set_b(NULL, "CList", "SortBy1", (BYTE)s1);
- db_set_b(NULL, "CList", "SortBy2", (BYTE)s2);
- db_set_b(NULL, "CList", "SortBy3", (BYTE)s3);
-
- ClcOptionsChanged();
- AniAva_UpdateOptions();
- ske_LoadSkinFromDB();
- CLUI_UpdateLayeredMode();
- CLUI_ChangeWindowMode();
- SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
- CLUI_ReloadCLUIOptions();
- cliShowHide(true);
- }
- g_mutex_bChangingMode = FALSE;
- return TRUE;
- }
- break;
- }
-
- return FALSE;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-int ModernOptInit(WPARAM wParam, LPARAM)
-{
- static int iBoldControls[] =
- {
- IDC_TXT_TITLE1, IDC_TXT_TITLE2,
- IDC_TXT_TITLE3, IDC_TXT_TITLE4,
- IDC_TXT_TITLE5,
- MODERNOPT_CTRL_LAST
- };
-
- MODERNOPTOBJECT obj = { sizeof(obj) };
- obj.dwFlags = MODEROPT_FLG_TCHAR | MODEROPT_FLG_NORESIZE;
- obj.hIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- obj.hInstance = g_hInst;
- obj.iSection = MODERNOPT_PAGE_CLIST;
- obj.iType = MODERNOPT_TYPE_SECTIONPAGE;
- obj.iBoldControls = iBoldControls;
- obj.lptzSubsection = L"Fonts";
- obj.lpzClassicGroup = NULL;
- obj.lpzClassicPage = "Contact list";
- obj.lpzHelpUrl = "https://wiki.miranda-ng.org/";
-
- obj.lpzTemplate = MAKEINTRESOURCEA(IDD_MODERNOPTS);
- obj.pfnDlgProc = DlgProcModernOptions;
- CallService(MS_MODERNOPT_ADDOBJECT, wParam, (LPARAM)&obj);
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
struct
{
char *name; // Tab name
diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp
index c2d6a31a20..f636a3ece5 100644
--- a/plugins/Clist_modern/src/modern_skinopt.cpp
+++ b/plugins/Clist_modern/src/modern_skinopt.cpp
@@ -61,22 +61,6 @@ int SkinOptInit(WPARAM wParam, LPARAM)
return 0;
}
-int ModernSkinOptInit(WPARAM wParam, LPARAM)
-{
- MODERNOPTOBJECT obj = { 0 };
- obj.cbSize = sizeof(obj);
- obj.dwFlags = MODEROPT_FLG_TCHAR;
- obj.hIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- obj.hInstance = g_hInst;
- obj.iSection = MODERNOPT_PAGE_SKINS;
- obj.iType = MODERNOPT_TYPE_SELECTORPAGE;
- obj.lptzSubsection = L"Contact list";
- obj.lpzThemeExtension = ".msf";
- obj.lpzThemeModuleName = "ModernSkinSel";
- CallService(MS_MODERNOPT_ADDOBJECT, wParam, (LPARAM)&obj);
- return 0;
-}
-
INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
diff --git a/plugins/Clist_modern/src/stdafx.h b/plugins/Clist_modern/src/stdafx.h
index f2e3fbb331..7fd4444024 100644
--- a/plugins/Clist_modern/src/stdafx.h
+++ b/plugins/Clist_modern/src/stdafx.h
@@ -95,7 +95,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_xstatus.h>
#include <m_cluiframes.h>
#include <m_protoint.h>
-#include <m_modernopt.h>
#include <m_netlib.h>
#include <m_toptoolbar.h>
#include <m_metacontacts.h>