summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-13 22:20:03 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-13 22:20:03 +0300
commit37f66793bed39f26031e0e7dd4c1b2bf22d52ab2 (patch)
tree33deaa5fe78181cee91793e1630fbb0af406ba13 /plugins
parent992b68811f8697ff3bf93ff10288d93022f58f53 (diff)
clist_modern -> g_plugin
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Clist_modern/src/cluiframes.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_aniavatars.cpp18
-rw-r--r--plugins/Clist_modern/src/modern_cachefuncs.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp22
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp20
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp134
-rw-r--r--plugins/Clist_modern/src/modern_clcutils.cpp114
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_clistmod.cpp16
-rw-r--r--plugins/Clist_modern/src/modern_clistopts.cpp230
-rw-r--r--plugins/Clist_modern/src/modern_clistsettings.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_clisttray.cpp60
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp98
-rw-r--r--plugins/Clist_modern/src/modern_contact.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_defsettings.h384
-rw-r--r--plugins/Clist_modern/src/modern_docking.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_keyboard.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_newrowopts.cpp195
-rw-r--r--plugins/Clist_modern/src/modern_toolbar.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp4
20 files changed, 572 insertions, 769 deletions
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp
index e447ba23f8..b6cf33c8f1 100644
--- a/plugins/Clist_modern/src/cluiframes.cpp
+++ b/plugins/Clist_modern/src/cluiframes.cpp
@@ -175,7 +175,7 @@ int CLUIFrames_ActivateSubContainers(BOOL active)
for (int i = 0; i < g_nFramesCount; i++) {
FRAMEWND &F = g_pfwFrames[i];
if (active && !F.floating && F.OwnerWindow != (HWND)nullptr && F.OwnerWindow != (HWND)-2 && F.visible && !F.needhide) {
- if (db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
+ if (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
SetWindowPos(F.OwnerWindow, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
SetWindowPos(F.OwnerWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}
@@ -218,7 +218,7 @@ int CLUIFrames_OnShowHide(int mode)
if (mode != SW_HIDE) {
SetWindowPos(F.OwnerWindow, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- if (db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
+ if (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
SetWindowPos(F.OwnerWindow, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
SetWindowPos(F.OwnerWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}
@@ -2957,7 +2957,7 @@ static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wP
BYTE alpha;
if ((wParam != WA_INACTIVE || ((HWND)lParam == hwnd) || GetParent((HWND)lParam) == hwnd)) {
HWND hw = lParam ? GetParent((HWND)lParam) : nullptr;
- alpha = db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT);
+ alpha = g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT);
if (hw) SetWindowPos(hw, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
CLUI_SmoothAlphaTransition(hwnd, alpha, 1);
}
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp
index 41d6b51efb..99a784e452 100644
--- a/plugins/Clist_modern/src/modern_aniavatars.cpp
+++ b/plugins/Clist_modern/src/modern_aniavatars.cpp
@@ -442,18 +442,18 @@ static void _AniAva_LoadOptions()
aacheck;
mir_cslock lck(s_CS);
- s_bFlags = (db_get_b(0, "CList", "AvatarsDrawBorders", SETTINGS_AVATARDRAWBORDER_DEFAULT) ? AAO_HAS_BORDER : 0) |
- (db_get_b(0, "CList", "AvatarsRoundCorners", SETTINGS_AVATARROUNDCORNERS_DEFAULT) ? AAO_ROUND_CORNERS : 0) |
- (db_get_b(0, "CList", "AvatarsDrawOverlay", SETTINGS_AVATARDRAWOVERLAY_DEFAULT) ? AAO_HAS_OVERLAY : 0) |
+ s_bFlags = (g_plugin.getByte("AvatarsDrawBorders", SETTINGS_AVATARDRAWBORDER_DEFAULT) ? AAO_HAS_BORDER : 0) |
+ (g_plugin.getByte("AvatarsRoundCorners", SETTINGS_AVATARROUNDCORNERS_DEFAULT) ? AAO_ROUND_CORNERS : 0) |
+ (g_plugin.getByte("AvatarsDrawOverlay", SETTINGS_AVATARDRAWOVERLAY_DEFAULT) ? AAO_HAS_OVERLAY : 0) |
((0) ? AAO_OPAQUE : 0);
if (s_bFlags & AAO_HAS_BORDER)
- s_borderColor = (COLORREF)db_get_dw(0, "CList", "AvatarsBorderColor", SETTINGS_AVATARBORDERCOLOR_DEFAULT);
+ s_borderColor = (COLORREF)g_plugin.getDword("AvatarsBorderColor", SETTINGS_AVATARBORDERCOLOR_DEFAULT);
if (s_bFlags & AAO_ROUND_CORNERS)
- s_cornerRadius = db_get_b(0, "CList", "AvatarsUseCustomCornerSize", SETTINGS_AVATARUSECUTOMCORNERSIZE_DEFAULT) ? db_get_w(0, "CList", "AvatarsCustomCornerSize", SETTINGS_AVATARCORNERSIZE_DEFAULT) : 0;
+ s_cornerRadius = g_plugin.getByte("AvatarsUseCustomCornerSize", SETTINGS_AVATARUSECUTOMCORNERSIZE_DEFAULT) ? g_plugin.getWord("AvatarsCustomCornerSize", SETTINGS_AVATARCORNERSIZE_DEFAULT) : 0;
if (s_bFlags & AAO_HAS_OVERLAY) {
// check image list
- BYTE type = db_get_b(0, "CList", "AvatarsOverlayType", SETTINGS_AVATAROVERLAYTYPE_DEFAULT);
+ BYTE type = g_plugin.getByte("AvatarsOverlayType", SETTINGS_AVATAROVERLAYTYPE_DEFAULT);
switch (type) {
case SETTING_AVATAR_OVERLAY_TYPE_NORMAL:
s_overlayIconImageList = hAvatarOverlays;
@@ -468,7 +468,7 @@ static void _AniAva_LoadOptions()
}
if (s_bFlags & AAO_OPAQUE)
s_bkgColor = 0;
- s_bSeparateWindow = db_get_b(0, "CList", "AvatarsInSeparateWnd", SETTINGS_AVATARINSEPARATE_DEFAULT);
+ s_bSeparateWindow = g_plugin.getByte("AvatarsInSeparateWnd", SETTINGS_AVATARINSEPARATE_DEFAULT);
}
static void _AniAva_InvalidateParent(ANIAVA_WINDOWINFO * dat)
@@ -939,7 +939,7 @@ int AniAva_SetAvatarPos(MCONTACT hContact, RECT *rc, int overlayIdx, BYTE bAlpha
int AniAva_UpdateOptions()
{
BOOL bReloadAvatars = FALSE;
- BOOL bBeEnabled = db_get_b(0, "CList", "AvatarsAnimated", db_get_b(0, "CList", "AvatarsShow", SETTINGS_SHOWAVATARS_DEFAULT));
+ BOOL bBeEnabled = g_plugin.getByte("AvatarsAnimated", g_plugin.getByte("AvatarsShow", SETTINGS_SHOWAVATARS_DEFAULT));
if (bBeEnabled && !s_bModuleStarted) {
AniAva_InitModule();
bReloadAvatars = TRUE;
@@ -980,7 +980,7 @@ void AniAva_UpdateParent()
int AniAva_InitModule()
{
- if (!db_get_b(0, "CList", "AvatarsAnimated", db_get_b(0, "CList", "AvatarsShow", SETTINGS_SHOWAVATARS_DEFAULT)))
+ if (!g_plugin.getByte("AvatarsAnimated", g_plugin.getByte("AvatarsShow", SETTINGS_SHOWAVATARS_DEFAULT)))
return 0;
WNDCLASSEX wc = { sizeof(wc) };
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp
index c25d62efb5..e48791b3a7 100644
--- a/plugins/Clist_modern/src/modern_cachefuncs.cpp
+++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp
@@ -354,7 +354,7 @@ int GetStatusMessage(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xs
// Get StatusMsg
if (pdnce->hContact && text[0] == '\0') {
- ptrW tszStatusMsg(db_get_wsa(pdnce->hContact, "CList", "StatusMsg"));
+ ptrW tszStatusMsg(g_plugin.getWStringA(pdnce->hContact, "StatusMsg"));
if (tszStatusMsg != nullptr) {
CopySkipUnprintableChars(text, tszStatusMsg, text_size - 1);
if (text[0] != '\0')
@@ -716,7 +716,7 @@ void Cache_GetAvatar(ClcData *dat, ClcContact *contact)
return;
}
- if (dat->avatars_show && !db_get_b(contact->hContact, "CList", "HideContactAvatar", 0)) {
+ if (dat->avatars_show && !g_plugin.getByte(contact->hContact, "HideContactAvatar", 0)) {
contact->avatar_data = (AVATARCACHEENTRY*)CallService(MS_AV_GETAVATARBITMAP, contact->hContact, 0);
if (contact->avatar_data == nullptr || contact->avatar_data->dwFlags == AVS_BITMAP_EXPIRED)
contact->avatar_data = nullptr;
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index ce6d9b2313..65cbf527c8 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -160,7 +160,7 @@ static int clcHookDbEventAdded(WPARAM hContact, LPARAM lParam)
DBEVENTINFO dbei = {};
db_event_get(lParam, &dbei);
if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) {
- db_set_dw(hContact, "CList", "mf_lastmsg", dbei.timestamp);
+ g_plugin.setDword(hContact, "mf_lastmsg", dbei.timestamp);
ClcCacheEntry *pdnce = Clist_GetCacheEntry(hContact);
if (pdnce)
pdnce->dwLastMsgTime = dbei.timestamp;
@@ -513,7 +513,7 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM
ClcContact *ht = nullptr;
KillTimer(hwnd, TIMERID_SUBEXPAND);
contact->bSubExpanded = false;
- db_set_b(contact->hContact, "CList", "Expanded", 0);
+ g_plugin.setByte(contact->hContact, "Expanded", 0);
ht = contact;
dat->bNeedsResort = true;
g_clistApi.pfnSortCLC(hwnd, dat, 1);
@@ -528,7 +528,7 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM
ClcContact *ht = nullptr;
KillTimer(hwnd, TIMERID_SUBEXPAND);
contact->bSubExpanded = true;
- db_set_b(contact->hContact, "CList", "Expanded", 1);
+ g_plugin.setByte(contact->hContact, "Expanded", 1);
ht = contact;
dat->bNeedsResort = true;
g_clistApi.pfnSortCLC(hwnd, dat, 1);
@@ -618,7 +618,7 @@ static LRESULT clcOnTimer(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPAR
ClcContact *ht = nullptr;
if (hitcontact && dat->bMetaExpanding) {
hitcontact->bSubExpanded = !hitcontact->bSubExpanded;
- db_set_b(hitcontact->hContact, "CList", "Expanded", hitcontact->bSubExpanded);
+ g_plugin.setByte(hitcontact->hContact, "Expanded", hitcontact->bSubExpanded);
if (hitcontact->bSubExpanded)
ht = &(hitcontact->subcontacts[hitcontact->iSubAllocated - 1]);
}
@@ -1306,7 +1306,7 @@ static LRESULT clcOnIntmGroupChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wPara
flags = contact->flags;
}
Clist_DeleteItemFromTree(hwnd, wParam);
- if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b(wParam, "CList", "Hidden", 0)) {
+ if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !g_plugin.getByte(wParam, "Hidden")) {
NMCLISTCONTROL nm;
g_clistApi.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
if (Clist_FindItem(hwnd, dat, wParam, &contact)) {
@@ -1643,9 +1643,9 @@ HRESULT ClcLoadModule()
int ClcUnloadModule()
{
if (g_CluiData.bOldUseGroups != (BYTE)-1)
- db_set_b(0, "CList", "UseGroups", (BYTE)g_CluiData.bOldUseGroups);
+ g_plugin.setByte("UseGroups", (BYTE)g_CluiData.bOldUseGroups);
if (g_CluiData.boldHideOffline != (BYTE)-1)
- db_set_b(0, "CList", "HideOffline", (BYTE)g_CluiData.boldHideOffline);
+ g_plugin.setByte("HideOffline", (BYTE)g_CluiData.boldHideOffline);
return 0;
}
@@ -1660,7 +1660,7 @@ int ClcDoProtoAck(ACKDATA *ack)
if (db_get_b(ack->hContact, ack->szModule, "ChatRoom", 0) != 0)
return 0;
- db_set_ws(ack->hContact, "CList", "StatusMsg", (const wchar_t *)ack->lParam);
+ g_plugin.setWString(ack->hContact, "StatusMsg", (const wchar_t *)ack->lParam);
Clist_Broadcast(INTM_STATUSCHANGED, ack->hContact, 0);
}
else {
@@ -1669,10 +1669,10 @@ int ClcDoProtoAck(ACKDATA *ack)
return 0;
if (ack->hContact) {
- char *val = db_get_sa(ack->hContact, "CList", "StatusMsg");
+ char *val = g_plugin.getStringA(ack->hContact, "StatusMsg");
if (val) {
- if (mir_strcmpi(val, ""))
- db_set_s(ack->hContact, "CList", "StatusMsg", "");
+ if (mir_strcmp(val, ""))
+ g_plugin.setString(ack->hContact, "StatusMsg", "");
else
Clist_Broadcast(INTM_STATUSCHANGED, ack->hContact, 0);
mir_free(val);
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index 344d0aaae5..385d721b60 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup)
{
- cont->bSubExpanded = db_get_b(cont->hContact, "CList", "Expanded", 0) && db_get_b(0, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT);
+ cont->bSubExpanded = g_plugin.getByte(cont->hContact, "Expanded") && db_get_b(0, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT);
int subcount = db_mc_getSubCount(cont->hContact);
if (subcount <= 0) {
cont->iSubNumber = 0;
@@ -40,7 +40,7 @@ void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup)
cont->subcontacts = (ClcContact *)mir_calloc(sizeof(ClcContact)*subcount);
cont->iSubAllocated = subcount;
int i = 0;
- int bHideOffline = db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
+ int bHideOffline = g_plugin.getByte("HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
for (int j = 0; j < subcount; j++) {
MCONTACT hsub = db_mc_getSub(cont->hContact, j);
if (hsub == -1)
@@ -162,7 +162,7 @@ static void _LoadDataToContact(ClcContact *cont, ClcCacheEntry *pdnce, ClcGroup
Cache_GetText(dat, cont);
Cache_GetTimezone(dat, cont->hContact);
cont->iImage = Clist_GetContactIcon(hContact);
- cont->bContactRate = db_get_b(hContact, "CList", "Rate", 0);
+ cont->bContactRate = g_plugin.getByte(hContact, "Rate");
}
ClcContact* cli_AddContactToGroup(ClcData *dat, ClcGroup *group, MCONTACT hContact)
@@ -255,7 +255,7 @@ void cliRebuildEntireList(HWND hwnd, ClcData *dat)
dat->selection = -1;
dat->bNeedsResort = true;
dat->HiLightMode = db_get_b(0, "CLC", "HiLightMode", SETTING_HILIGHTMODE_DEFAULT);
- dat->bPlaceOfflineToRoot = db_get_b(0, "CList", "PlaceOfflineToRoot", SETTING_PLACEOFFLINETOROOT_DEFAULT) != 0;
+ dat->bPlaceOfflineToRoot = g_plugin.getByte("PlaceOfflineToRoot", SETTING_PLACEOFFLINETOROOT_DEFAULT) != 0;
corecli.pfnRebuildEntireList(hwnd, dat);
@@ -326,13 +326,13 @@ ClcCacheEntry* cliCreateCacheItem(MCONTACT hContact)
pdnce->hContact = hContact;
pdnce->szProto = GetContactProto(hContact);
- pdnce->bIsHidden = db_get_b(hContact, "CList", "Hidden", 0);
+ pdnce->bIsHidden = g_plugin.getByte(hContact, "Hidden");
pdnce->m_bIsSub = db_mc_isSub(hContact) != 0;
- pdnce->m_bNoHiddenOffline = db_get_b(hContact, "CList", "noOffline", 0);
+ pdnce->m_bNoHiddenOffline = g_plugin.getByte(hContact, "noOffline");
pdnce->IdleTS = db_get_dw(hContact, pdnce->szProto, "IdleTS", 0);
pdnce->ApparentMode = db_get_w(hContact, pdnce->szProto, "ApparentMode", 0);
- pdnce->NotOnList = db_get_b(hContact, "CList", "NotOnList", 0);
- pdnce->IsExpanded = db_get_b(hContact, "CList", "Expanded", 0);
+ pdnce->NotOnList = g_plugin.getByte(hContact, "NotOnList");
+ pdnce->IsExpanded = g_plugin.getByte(hContact, "Expanded");
pdnce->dwLastMsgTime = -1;
return pdnce;
}
@@ -395,7 +395,7 @@ int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly)
int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat)
{
- int dbHidden = db_get_b(hContact, "CList", "Hidden", 0); // default hidden state, always respect it.
+ int dbHidden = g_plugin.getByte(hContact, "Hidden"); // default hidden state, always respect it.
int filterResult = 1;
int searchResult = 0;
ClcCacheEntry *pdnce = Clist_GetCacheEntry(hContact);
@@ -436,7 +436,7 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat)
}
if (g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) {
- ptrW tszGroup(db_get_wsa(hContact, "CList", "Group"));
+ ptrW tszGroup(g_plugin.getWStringA(hContact, "Group"));
if (tszGroup != nullptr) {
wchar_t szGroupMask[256];
mir_snwprintf(szGroupMask, L"%s|", tszGroup);
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index ea9f4a5fa8..b5d96bdf80 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -490,10 +490,10 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS, db_get_b(0, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, db_get_b(0, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE, db_get_b(0, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, g_plugin.getByte("HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS, g_plugin.getByte("HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, g_plugin.getByte("UseGroups", SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE, g_plugin.getByte("ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_GAMMACORRECT, db_get_b(0, "CLC", "GammaCorrect", CLCDEFAULT_GAMMACORRECT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_HILIGHTMODE4, db_get_b(0, "CLC", "HiLightMode", SETTING_HILIGHTMODE_DEFAULT) == 0 ? BST_CHECKED : BST_UNCHECKED);
@@ -511,9 +511,9 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
SendDlgItemMessage(hwndDlg, IDC_CLSORT3, CB_SETITEMDATA, item, 0);
}
- s1 = db_get_b(0, "CList", "SortBy1", SETTING_SORTBY1_DEFAULT);
- s2 = db_get_b(0, "CList", "SortBy2", SETTING_SORTBY2_DEFAULT);
- s3 = db_get_b(0, "CList", "SortBy3", SETTING_SORTBY3_DEFAULT);
+ s1 = g_plugin.getByte("SortBy1", SETTING_SORTBY1_DEFAULT);
+ s2 = g_plugin.getByte("SortBy2", SETTING_SORTBY2_DEFAULT);
+ s3 = g_plugin.getByte("SortBy3", SETTING_SORTBY3_DEFAULT);
for (int i = 0; i < _countof(sortby); i++) {
if (s1 == sortbyValue[i])
@@ -524,8 +524,8 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
SendDlgItemMessage(hwndDlg, IDC_CLSORT3, CB_SETCURSEL, i, 0);
}
- CheckDlgButton(hwndDlg, IDC_NOOFFLINEMOVE, db_get_b(0, "CList", "NoOfflineBottom", SETTING_NOOFFLINEBOTTOM_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_OFFLINETOROOT, db_get_b(0, "CList", "PlaceOfflineToRoot", SETTING_PLACEOFFLINETOROOT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOOFFLINEMOVE, g_plugin.getByte("NoOfflineBottom", SETTING_NOOFFLINEBOTTOM_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_OFFLINETOROOT, g_plugin.getByte("PlaceOfflineToRoot", SETTING_PLACEOFFLINETOROOT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
}
return TRUE;
@@ -540,10 +540,10 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, "CList", "HideOffline", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEOFFLINE));
- db_set_b(0, "CList", "HideEmptyGroups", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEEMPTYGROUPS));
- db_set_b(0, "CList", "UseGroups", (BYTE)BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DISABLEGROUPS));
- db_set_b(0, "CList", "ConfirmDelete", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CONFIRMDELETE));
+ g_plugin.setByte("HideOffline", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEOFFLINE));
+ g_plugin.setByte("HideEmptyGroups", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEEMPTYGROUPS));
+ g_plugin.setByte("UseGroups", (BYTE)BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DISABLEGROUPS));
+ g_plugin.setByte("ConfirmDelete", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CONFIRMDELETE));
db_set_b(0, "CLC", "GammaCorrect", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_GAMMACORRECT));
int hil = 0;
@@ -558,12 +558,12 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
if (s1 >= 0) s1 = sortbyValue[s1];
if (s2 >= 0) s2 = sortbyValue[s2];
if (s3 >= 0) s3 = sortbyValue[s3];
- db_set_b(0, "CList", "SortBy1", (BYTE)s1);
- db_set_b(0, "CList", "SortBy2", (BYTE)s2);
- db_set_b(0, "CList", "SortBy3", (BYTE)s3);
+ g_plugin.setByte("SortBy1", (BYTE)s1);
+ g_plugin.setByte("SortBy2", (BYTE)s2);
+ g_plugin.setByte("SortBy3", (BYTE)s3);
- db_set_b(0, "CList", "NoOfflineBottom", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOOFFLINEMOVE));
- db_set_b(0, "CList", "PlaceOfflineToRoot", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_OFFLINETOROOT));
+ g_plugin.setByte("NoOfflineBottom", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOOFFLINEMOVE));
+ g_plugin.setByte("PlaceOfflineToRoot", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_OFFLINETOROOT));
Clist_LoadContactTree(); /* this won't do job properly since it only really works when changes happen */
Clist_InitAutoRebuild(g_clistApi.hwndContactTree); /* force reshuffle */
@@ -585,9 +585,9 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_NOOFFLINEMOVE, db_get_b(0, "CList", "NoOfflineBottom", SETTING_NOOFFLINEBOTTOM_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_OFFLINETOROOT, db_get_b(0, "CList", "PlaceOfflineToRoot", SETTING_PLACEOFFLINETOROOT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONECLK, db_get_b(0, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOOFFLINEMOVE, g_plugin.getByte("NoOfflineBottom", SETTING_NOOFFLINEBOTTOM_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_OFFLINETOROOT, g_plugin.getByte("PlaceOfflineToRoot", SETTING_PLACEOFFLINETOROOT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONECLK, g_plugin.getByte("Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
{
BYTE trayOption = db_get_b(0, "CLUI", "XStatusTray", SETTING_TRAYOPTION_DEFAULT);
CheckDlgButton(hwndDlg, IDC_SHOWXSTATUS, (trayOption & 3) ? BST_CHECKED : BST_UNCHECKED);
@@ -598,11 +598,11 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENTOVERLAY), IsDlgButtonChecked(hwndDlg, IDC_SHOWXSTATUS) && IsDlgButtonChecked(hwndDlg, IDC_SHOWNORMAL));
}
- CheckDlgButton(hwndDlg, IDC_ALWAYSSTATUS, db_get_b(0, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DISABLEBLINK, db_get_b(0, "CList", "DisableTrayFlash", SETTING_DISABLETRAYFLASH_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALWAYSSTATUS, g_plugin.getByte("AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DISABLEBLINK, g_plugin.getByte("DisableTrayFlash", SETTING_DISABLETRAYFLASH_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETRANGE, 0, MAKELONG(0x3FFF, 250));
- SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(0, "CList", "IconFlashTime", SETTING_ICONFLASHTIME_DEFAULT), 0));
+ SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETPOS, 0, MAKELONG(g_plugin.getWord("IconFlashTime", SETTING_ICONFLASHTIME_DEFAULT), 0));
// == Tray icon mode ==
// preparing account list.
@@ -613,13 +613,13 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
int item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS_S, CB_ADDSTRING, 0, (LPARAM)pa->tszAccountName);
SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS_S, CB_SETITEMDATA, item, (LPARAM)pa);
- if (!mir_strcmp(pa->szModuleName, db_get_sa(0, "CList", "tiAccS")))
+ if (!mir_strcmp(pa->szModuleName, g_plugin.getStringA("tiAccS")))
siS = item;
item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS_V, CB_ADDSTRING, 0, (LPARAM)pa->tszAccountName);
SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS_V, CB_SETITEMDATA, item, (LPARAM)pa);
- if (!mir_strcmp(pa->szModuleName, db_get_sa(0, "CList", "tiAccV")))
+ if (!mir_strcmp(pa->szModuleName, g_plugin.getStringA("tiAccV")))
siV = item;
}
}
@@ -633,10 +633,10 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
// setting icon cycling period
SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_SETRANGE, 0, MAKELONG(120, 1));
- SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(0, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT), 0));
+ SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_SETPOS, 0, MAKELONG(g_plugin.getWord("CycleTime", SETTING_CYCLETIME_DEFAULT), 0));
// setting icon mode
- switch (db_get_b(0, "CList", "tiModeS", TRAY_ICON_MODE_GLOBAL)) {
+ switch (g_plugin.getByte("tiModeS", TRAY_ICON_MODE_GLOBAL)) {
case TRAY_ICON_MODE_GLOBAL:
CheckDlgButton(hwndDlg, IDC_ICON_GLOBAL_S, 1);
break;
@@ -652,7 +652,7 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
break;
}
- switch (db_get_b(0, "CList", "tiModeV", TRAY_ICON_MODE_GLOBAL)) {
+ switch (g_plugin.getByte("tiModeV", TRAY_ICON_MODE_GLOBAL)) {
case TRAY_ICON_MODE_GLOBAL:
CheckDlgButton(hwndDlg, IDC_ICON_GLOBAL_V, 1);
break;
@@ -701,11 +701,11 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, "CList", "Tray1Click", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONECLK));
- db_set_b(0, "CList", "AlwaysStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYSSTATUS));
+ g_plugin.setByte("Tray1Click", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONECLK));
+ g_plugin.setByte("AlwaysStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYSSTATUS));
- db_set_w(0, "CList", "IconFlashTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CList", "DisableTrayFlash", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
+ g_plugin.setWord("IconFlashTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0));
+ g_plugin.setByte("DisableTrayFlash", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
BYTE xOptions = 0;
xOptions = IsDlgButtonChecked(hwndDlg, IDC_SHOWXSTATUS) ? 1 : 0;
@@ -718,25 +718,25 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
int idx = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS_S, CB_GETCURSEL, 0, 0);
if (idx != CB_ERR) {
PROTOACCOUNT *pa = (PROTOACCOUNT*)SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS_S, CB_GETITEMDATA, idx, 0);
- db_set_s(0, "CList", "tiAccS", pa->szModuleName);
+ g_plugin.setString("tiAccS", pa->szModuleName);
}
idx = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS_V, CB_GETCURSEL, 0, 0);
if (idx != CB_ERR) {
PROTOACCOUNT *pa = (PROTOACCOUNT*)SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS_V, CB_GETITEMDATA, idx, 0);
- db_set_s(0, "CList", "tiAccV", pa->szModuleName);
+ g_plugin.setString("tiAccV", pa->szModuleName);
}
// icon cycling timeout.
- db_set_w(0, "CList", "CycleTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_GETPOS, 0, 0));
+ g_plugin.setWord("CycleTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_GETPOS, 0, 0));
// icon modes
- db_set_b(0, "CList", "tiModeS",
+ g_plugin.setByte("tiModeS",
IsDlgButtonChecked(hwndDlg, IDC_ICON_GLOBAL_S) << 0
| IsDlgButtonChecked(hwndDlg, IDC_ICON_ACC_S) << 1
| IsDlgButtonChecked(hwndDlg, IDC_ICON_CYCLE_S) << 2
| IsDlgButtonChecked(hwndDlg, IDC_ICON_ALL_S) << 3);
- db_set_b(0, "CList", "tiModeV",
+ g_plugin.setByte("tiModeV",
IsDlgButtonChecked(hwndDlg, IDC_ICON_GLOBAL_V) << 0
| IsDlgButtonChecked(hwndDlg, IDC_ICON_ACC_V) << 1
| IsDlgButtonChecked(hwndDlg, IDC_ICON_CYCLE_V) << 2
@@ -773,7 +773,7 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM
CheckDlgButton(hwndDlg, IDC_DRAGTOSCROLL, (db_get_b(0, "CLUI", "DragToScroll", SETTING_DRAGTOSCROLL_DEFAULT) && !db_get_b(0, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT)) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_AUTOSIZE, g_CluiData.fAutoSize ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_LOCKSIZING, db_get_b(0, "CLUI", "LockSize", SETTING_LOCKSIZE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, db_get_b(0, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, g_plugin.getByte("BringToFront", SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETRANGE, 0, MAKELONG(100, 0));
SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETPOS, 0, db_get_b(0, "CLUI", "MaxSizeHeight", SETTING_MAXSIZEHEIGHT_DEFAULT));
@@ -787,9 +787,9 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM
CheckDlgButton(hwndDlg, IDC_EVENTAREA, db_get_b(0, "CLUI", "EventArea", SETTING_EVENTAREAMODE_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_EVENTAREA_ALWAYS, db_get_b(0, "CLUI", "EventArea", SETTING_EVENTAREAMODE_DEFAULT) == 2 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOHIDE, db_get_b(0, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOHIDE, g_plugin.getByte("AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETRANGE, 0, MAKELONG(900, 1));
- SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(0, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), 0));
+ SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETPOS, 0, MAKELONG(g_plugin.getWord("HideTime", SETTING_HIDETIME_DEFAULT), 0));
EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC01), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
@@ -890,7 +890,7 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM
db_set_w(0, "ModernData", "HideBehindBorderSize", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN4, UDM_GETPOS, 0, 0));
db_set_b(0, "CLUI", "DragToScroll", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAGTOSCROLL));
- db_set_b(0, "CList", "BringToFront", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
+ g_plugin.setByte("BringToFront", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
g_mutex_bChangingMode = TRUE;
db_set_b(0, "CLUI", "ClientAreaDrag", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG));
db_set_b(0, "CLUI", "AutoSize", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
@@ -905,8 +905,8 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM
db_set_b(0, "CLUI", "EventArea",
(BYTE)(IsDlgButtonChecked(hwndDlg, IDC_EVENTAREA_ALWAYS) ? 2 : (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EVENTAREA) ? 1 : 0));
- db_set_b(0, "CList", "AutoHide", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
- db_set_w(0, "CList", "HideTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0));
+ g_plugin.setByte("AutoHide", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ g_plugin.setWord("HideTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0));
CLUI_ChangeWindowMode();
SendMessage(g_clistApi.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
CLUI_ReloadCLUIOptions();
@@ -929,7 +929,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
g_hCLUIOptionsWnd = hwndDlg;
- CheckDlgButton(hwndDlg, IDC_ONTOP, db_get_b(0, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONTOP, g_plugin.getByte("OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
{
//====== Activate/Deactivate Non-Layered items =======
fEnabled = !g_CluiData.fLayered || g_CluiData.fDisableSkinEngine;
@@ -947,10 +947,10 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
}
{
//====== Non-Layered Mode =====
- CheckDlgButton(hwndDlg, IDC_TOOLWND, db_get_b(0, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_MIN2TRAY, db_get_b(0, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_BORDER, db_get_b(0, "CList", "ThinBorder", SETTING_THINBORDER_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOBORDERWND, db_get_b(0, "CList", "NoBorder", SETTING_NOBORDER_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TOOLWND, g_plugin.getByte("ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MIN2TRAY, g_plugin.getByte("Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_BORDER, g_plugin.getByte("ThinBorder", SETTING_THINBORDER_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOBORDERWND, g_plugin.getByte("NoBorder", SETTING_NOBORDER_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
if (IsDlgButtonChecked(hwndDlg, IDC_TOOLWND))
EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), FALSE);
CheckDlgButton(hwndDlg, IDC_SHOWCAPTION, db_get_b(0, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
@@ -966,12 +966,12 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
EnableWindow(GetDlgItem(hwndDlg, IDC_TITLETEXT), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWCAPTION), FALSE);
}
- CheckDlgButton(hwndDlg, IDC_DROPSHADOW, db_get_b(0, "CList", "WindowShadow", SETTING_WINDOWSHADOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DROPSHADOW, g_plugin.getByte("WindowShadow", SETTING_WINDOWSHADOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_ROUNDCORNERS, db_get_b(0, "CLC", "RoundCorners", SETTING_ROUNDCORNERS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
} //====== End of Non-Layered Mode =====
CheckDlgButton(hwndDlg, IDC_FADEINOUT, db_get_b(0, "CLUI", "FadeInOut", SETTING_FADEIN_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONDESKTOP, db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONDESKTOP, g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_FRAMESSPIN, UDM_SETRANGE, 0, MAKELONG(50, 0));
SendDlgItemMessage(hwndDlg, IDC_CAPTIONSSPIN, UDM_SETRANGE, 0, MAKELONG(50, 0));
SendDlgItemMessage(hwndDlg, IDC_FRAMESSPIN, UDM_SETPOS, 0, db_get_dw(0, "CLUIFrames", "GapBetweenFrames", SETTING_GAPFRAMES_DEFAULT));
@@ -994,7 +994,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
{
DBVARIANT dbv = { 0 };
wchar_t *s;
- if (!db_get_ws(0, "CList", "TitleText", &dbv))
+ if (!g_plugin.getWString("TitleText", &dbv))
s = dbv.pwszVal;
else
s = _A2W(MIRANDANAME);
@@ -1023,7 +1023,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
dbv.pszVal = nullptr;
}
}
- CheckDlgButton(hwndDlg, IDC_TRANSPARENT, db_get_b(0, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TRANSPARENT, g_plugin.getByte("Transparent", SETTING_TRANSPARENT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC11), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC12), FALSE);
@@ -1034,8 +1034,8 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
}
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(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT));
- SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETPOS, TRUE, db_get_b(0, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT));
+ SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETPOS, TRUE, g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT));
+ SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETPOS, TRUE, g_plugin.getByte("AutoAlpha", SETTING_AUTOALPHA_DEFAULT));
SendMessage(hwndDlg, WM_HSCROLL, 0x12345678, 0);
return TRUE;
@@ -1127,24 +1127,24 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
db_unset(0, "ModernData", "EnableLayering");
}
g_CluiData.dwKeyColor = db_get_dw(0, "ModernSettings", "KeyColor", (DWORD)SETTING_KEYCOLOR_DEFAULT);
- db_set_b(0, "CList", "OnDesktop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
- db_set_b(0, "CList", "OnTop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
+ g_plugin.setByte("OnDesktop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
+ g_plugin.setByte("OnTop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
SetWindowPos(g_clistApi.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
db_set_b(0, "CLUI", "DragToScroll", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAGTOSCROLL));
//====== Non-Layered Mode ======
- db_set_b(0, "CList", "ToolWindow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TOOLWND));
+ g_plugin.setByte("ToolWindow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TOOLWND));
db_set_b(0, "CLUI", "ShowCaption", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION));
db_set_b(0, "CLUI", "ShowMainMenu", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU));
- db_set_b(0, "CList", "ThinBorder", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BORDER));
- db_set_b(0, "CList", "NoBorder", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOBORDERWND));
+ g_plugin.setByte("ThinBorder", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BORDER));
+ g_plugin.setByte("NoBorder", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOBORDERWND));
{
wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
- db_set_ws(0, "CList", "TitleText", title);
+ g_plugin.setWString("TitleText", title);
}
- db_set_b(0, "CList", "Min2Tray", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY));
- db_set_b(0, "CList", "WindowShadow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW));
+ g_plugin.setByte("Min2Tray", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY));
+ g_plugin.setByte("WindowShadow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW));
db_set_b(0, "CLC", "RoundCorners", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ROUNDCORNERS));
//====== End of Non-Layered Mode ======
@@ -1176,10 +1176,10 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
db_set_dw(0, "CLUIFrames", "GapBetweenTitleBar", (DWORD)i2);
Sync(CLUIFramesOnClistResize, (WPARAM)g_clistApi.hwndContactList, 0);
}
- db_set_b(0, "CList", "Transparent", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- db_set_b(0, "CList", "Alpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
- db_set_b(0, "CList", "AutoAlpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0));
- db_set_b(0, "CList", "OnDesktop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
+ g_plugin.setByte("Transparent", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
+ g_plugin.setByte("Alpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
+ g_plugin.setByte("AutoAlpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0));
+ g_plugin.setByte("OnDesktop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
ske_LoadSkinFromDB();
CLUI_UpdateLayeredMode();
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp
index 0fe627f991..266fdce597 100644
--- a/plugins/Clist_modern/src/modern_clcutils.cpp
+++ b/plugins/Clist_modern/src/modern_clcutils.cpp
@@ -459,29 +459,29 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst)
LoadCLCFonts(hwnd, dat);
- g_CluiData.bSortByOrder[0] = db_get_b(0, "CList", "SortBy1", SETTING_SORTBY1_DEFAULT);
- g_CluiData.bSortByOrder[1] = db_get_b(0, "CList", "SortBy2", SETTING_SORTBY2_DEFAULT);
- g_CluiData.bSortByOrder[2] = db_get_b(0, "CList", "SortBy3", SETTING_SORTBY3_DEFAULT);
- g_CluiData.fSortNoOfflineBottom = db_get_b(0, "CList", "NoOfflineBottom", SETTING_NOOFFLINEBOTTOM_DEFAULT) != 0;
+ g_CluiData.bSortByOrder[0] = g_plugin.getByte("SortBy1", SETTING_SORTBY1_DEFAULT);
+ g_CluiData.bSortByOrder[1] = g_plugin.getByte("SortBy2", SETTING_SORTBY2_DEFAULT);
+ g_CluiData.bSortByOrder[2] = g_plugin.getByte("SortBy3", SETTING_SORTBY3_DEFAULT);
+ g_CluiData.fSortNoOfflineBottom = g_plugin.getByte("NoOfflineBottom", SETTING_NOOFFLINEBOTTOM_DEFAULT) != 0;
// Row
- dat->row_min_heigh = db_get_w(0, "CList", "MinRowHeight", CLCDEFAULT_ROWHEIGHT);
- dat->row_border = db_get_w(0, "CList", "RowBorder", SETTING_ROWBORDER_DEFAULT);
+ dat->row_min_heigh = g_plugin.getWord("MinRowHeight", CLCDEFAULT_ROWHEIGHT);
+ dat->row_border = g_plugin.getWord("RowBorder", SETTING_ROWBORDER_DEFAULT);
dat->row_before_group_space = ((hwnd != g_clistApi.hwndContactTree && g_clistApi.hwndContactTree != nullptr)
|| !db_get_b(0, "ModernData", "UseAdvancedRowLayout", SETTING_ROW_ADVANCEDLAYOUT_DEFAULT)) ? 0 : db_get_w(0, "ModernSkin", "SpaceBeforeGroup", SKIN_SPACEBEFOREGROUP_DEFAULT);
- dat->row_variable_height = db_get_b(0, "CList", "VariableRowHeight", SETTING_VARIABLEROWHEIGHT_DEFAULT);
- dat->row_align_left_items_to_left = db_get_b(0, "CList", "AlignLeftItemsToLeft", SETTING_ALIGNLEFTTOLEFT_DEFAULT);
- dat->row_hide_group_icon = db_get_b(0, "CList", "HideGroupsIcon", SETTING_HIDEGROUPSICON_DEFAULT);
- dat->row_align_right_items_to_right = db_get_b(0, "CList", "AlignRightItemsToRight", SETTING_ALIGNRIGHTORIGHT_DEFAULT);
+ dat->row_variable_height = g_plugin.getByte("VariableRowHeight", SETTING_VARIABLEROWHEIGHT_DEFAULT);
+ dat->row_align_left_items_to_left = g_plugin.getByte("AlignLeftItemsToLeft", SETTING_ALIGNLEFTTOLEFT_DEFAULT);
+ dat->row_hide_group_icon = g_plugin.getByte("HideGroupsIcon", SETTING_HIDEGROUPSICON_DEFAULT);
+ dat->row_align_right_items_to_right = g_plugin.getByte("AlignRightItemsToRight", SETTING_ALIGNRIGHTORIGHT_DEFAULT);
//TODO: Add to settings
- dat->row_align_group_mode = db_get_b(0, "CList", "AlignGroupCaptions", SETTING_ALIGNGROPCAPTION_DEFAULT);
+ dat->row_align_group_mode = g_plugin.getByte("AlignGroupCaptions", SETTING_ALIGNGROPCAPTION_DEFAULT);
if (g_clistApi.hwndContactTree == nullptr || dat->hWnd == g_clistApi.hwndContactTree) {
int defItemsOrder[NUM_ITEM_TYPE] = SETTINS_ROWITEMORDER_DEFAULT;
for (int i = 0; i < NUM_ITEM_TYPE; i++) {
char tmp[128];
mir_snprintf(tmp, "RowPos%d", i);
- dat->row_items[i] = db_get_w(0, "CList", tmp, defItemsOrder[i]);
+ dat->row_items[i] = g_plugin.getWord(tmp, defItemsOrder[i]);
}
}
else {
@@ -492,17 +492,17 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst)
// Avatar
if (g_clistApi.hwndContactTree == hwnd || g_clistApi.hwndContactTree == nullptr) {
- dat->avatars_show = ServiceExists(MS_AV_GETAVATARBITMAP) && db_get_b(0, "CList", "AvatarsShow", SETTINGS_SHOWAVATARS_DEFAULT);
- dat->avatars_draw_border = db_get_b(0, "CList", "AvatarsDrawBorders", SETTINGS_AVATARDRAWBORDER_DEFAULT);
- dat->avatars_border_color = (COLORREF)db_get_dw(0, "CList", "AvatarsBorderColor", SETTINGS_AVATARBORDERCOLOR_DEFAULT);
- dat->avatars_round_corners = db_get_b(0, "CList", "AvatarsRoundCorners", SETTINGS_AVATARROUNDCORNERS_DEFAULT);
- dat->avatars_use_custom_corner_size = db_get_b(0, "CList", "AvatarsUseCustomCornerSize", SETTINGS_AVATARUSECUTOMCORNERSIZE_DEFAULT);
- dat->avatars_custom_corner_size = db_get_w(0, "CList", "AvatarsCustomCornerSize", SETTINGS_AVATARCORNERSIZE_DEFAULT);
- dat->avatars_ignore_size_for_row_height = db_get_b(0, "CList", "AvatarsIgnoreSizeForRow", SETTINGS_AVATARIGNORESIZEFORROW_DEFAULT);
- dat->avatars_draw_overlay = db_get_b(0, "CList", "AvatarsDrawOverlay", SETTINGS_AVATARDRAWOVERLAY_DEFAULT);
- dat->avatars_overlay_type = db_get_b(0, "CList", "AvatarsOverlayType", SETTINGS_AVATAROVERLAYTYPE_DEFAULT);
- dat->avatars_maxheight_size = db_get_w(0, "CList", "AvatarsSize", SETTING_AVATARHEIGHT_DEFAULT);
- dat->avatars_maxwidth_size = db_get_w(0, "CList", "AvatarsWidth", SETTING_AVATARWIDTH_DEFAULT);
+ dat->avatars_show = ServiceExists(MS_AV_GETAVATARBITMAP) && g_plugin.getByte("AvatarsShow", SETTINGS_SHOWAVATARS_DEFAULT);
+ dat->avatars_draw_border = g_plugin.getByte("AvatarsDrawBorders", SETTINGS_AVATARDRAWBORDER_DEFAULT);
+ dat->avatars_border_color = (COLORREF)g_plugin.getDword("AvatarsBorderColor", SETTINGS_AVATARBORDERCOLOR_DEFAULT);
+ dat->avatars_round_corners = g_plugin.getByte("AvatarsRoundCorners", SETTINGS_AVATARROUNDCORNERS_DEFAULT);
+ dat->avatars_use_custom_corner_size = g_plugin.getByte("AvatarsUseCustomCornerSize", SETTINGS_AVATARUSECUTOMCORNERSIZE_DEFAULT);
+ dat->avatars_custom_corner_size = g_plugin.getWord("AvatarsCustomCornerSize", SETTINGS_AVATARCORNERSIZE_DEFAULT);
+ dat->avatars_ignore_size_for_row_height = g_plugin.getByte("AvatarsIgnoreSizeForRow", SETTINGS_AVATARIGNORESIZEFORROW_DEFAULT);
+ dat->avatars_draw_overlay = g_plugin.getByte("AvatarsDrawOverlay", SETTINGS_AVATARDRAWOVERLAY_DEFAULT);
+ dat->avatars_overlay_type = g_plugin.getByte("AvatarsOverlayType", SETTINGS_AVATAROVERLAYTYPE_DEFAULT);
+ dat->avatars_maxheight_size = g_plugin.getWord("AvatarsSize", SETTING_AVATARHEIGHT_DEFAULT);
+ dat->avatars_maxwidth_size = g_plugin.getWord("AvatarsWidth", SETTING_AVATARWIDTH_DEFAULT);
}
else {
dat->avatars_show = 0;
@@ -520,9 +520,9 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst)
// Icon
if (g_clistApi.hwndContactTree == hwnd || g_clistApi.hwndContactTree == nullptr) {
- dat->icon_hide_on_avatar = db_get_b(0, "CList", "IconHideOnAvatar", SETTING_HIDEICONONAVATAR_DEFAULT);
- dat->icon_draw_on_avatar_space = db_get_b(0, "CList", "IconDrawOnAvatarSpace", SETTING_ICONONAVATARPLACE_DEFAULT);
- dat->icon_ignore_size_for_row_height = db_get_b(0, "CList", "IconIgnoreSizeForRownHeight", SETTING_ICONIGNORESIZE_DEFAULT);
+ dat->icon_hide_on_avatar = g_plugin.getByte("IconHideOnAvatar", SETTING_HIDEICONONAVATAR_DEFAULT);
+ dat->icon_draw_on_avatar_space = g_plugin.getByte("IconDrawOnAvatarSpace", SETTING_ICONONAVATARPLACE_DEFAULT);
+ dat->icon_ignore_size_for_row_height = g_plugin.getByte("IconIgnoreSizeForRownHeight", SETTING_ICONIGNORESIZE_DEFAULT);
}
else {
dat->icon_hide_on_avatar = 0;
@@ -532,8 +532,8 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst)
// Contact time
if (g_clistApi.hwndContactTree == hwnd || g_clistApi.hwndContactTree == nullptr) {
- dat->contact_time_show = db_get_b(0, "CList", "ContactTimeShow", SETTING_SHOWTIME_DEFAULT);
- dat->contact_time_show_only_if_different = db_get_b(0, "CList", "ContactTimeShowOnlyIfDifferent", SETTING_SHOWTIMEIFDIFF_DEFAULT);
+ dat->contact_time_show = g_plugin.getByte("ContactTimeShow", SETTING_SHOWTIME_DEFAULT);
+ dat->contact_time_show_only_if_different = g_plugin.getByte("ContactTimeShowOnlyIfDifferent", SETTING_SHOWTIMEIFDIFF_DEFAULT);
}
else {
dat->contact_time_show = 0;
@@ -541,60 +541,60 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst)
}
// Text
- dat->text_rtl = db_get_b(0, "CList", "TextRTL", SETTING_TEXT_RTL_DEFAULT);
- dat->text_align_right = db_get_b(0, "CList", "TextAlignToRight", SETTING_TEXT_RIGHTALIGN_DEFAULT);
- dat->text_replace_smileys = db_get_b(0, "CList", "TextReplaceSmileys", SETTING_TEXT_SMILEY_DEFAULT);
- dat->text_resize_smileys = db_get_b(0, "CList", "TextResizeSmileys", SETTING_TEXT_RESIZESMILEY_DEFAULT);
+ dat->text_rtl = g_plugin.getByte("TextRTL", SETTING_TEXT_RTL_DEFAULT);
+ dat->text_align_right = g_plugin.getByte("TextAlignToRight", SETTING_TEXT_RIGHTALIGN_DEFAULT);
+ dat->text_replace_smileys = g_plugin.getByte("TextReplaceSmileys", SETTING_TEXT_SMILEY_DEFAULT);
+ dat->text_resize_smileys = g_plugin.getByte("TextResizeSmileys", SETTING_TEXT_RESIZESMILEY_DEFAULT);
dat->text_smiley_height = 0;
- dat->text_use_protocol_smileys = db_get_b(0, "CList", "TextUseProtocolSmileys", SETTING_TEXT_PROTOSMILEY_DEFAULT);
+ dat->text_use_protocol_smileys = g_plugin.getByte("TextUseProtocolSmileys", SETTING_TEXT_PROTOSMILEY_DEFAULT);
if (g_clistApi.hwndContactTree == hwnd || g_clistApi.hwndContactTree == nullptr)
- dat->text_ignore_size_for_row_height = db_get_b(0, "CList", "TextIgnoreSizeForRownHeight", SETTING_TEXT_IGNORESIZE_DEFAULT);
+ dat->text_ignore_size_for_row_height = g_plugin.getByte("TextIgnoreSizeForRownHeight", SETTING_TEXT_IGNORESIZE_DEFAULT);
else
dat->text_ignore_size_for_row_height = 0;
// First line
- dat->first_line_draw_smileys = db_get_b(0, "CList", "FirstLineDrawSmileys", SETTING_FIRSTLINE_SMILEYS_DEFAULT);
- dat->first_line_append_nick = db_get_b(0, "CList", "FirstLineAppendNick", SETTING_FIRSTLINE_APPENDNICK_DEFAULT);
- gl_TrimText = db_get_b(0, "CList", "TrimText", SETTING_FIRSTLINE_TRIMTEXT_DEFAULT);
+ dat->first_line_draw_smileys = g_plugin.getByte("FirstLineDrawSmileys", SETTING_FIRSTLINE_SMILEYS_DEFAULT);
+ dat->first_line_append_nick = g_plugin.getByte("FirstLineAppendNick", SETTING_FIRSTLINE_APPENDNICK_DEFAULT);
+ gl_TrimText = g_plugin.getByte("TrimText", SETTING_FIRSTLINE_TRIMTEXT_DEFAULT);
// Second line
if (g_clistApi.hwndContactTree == hwnd || g_clistApi.hwndContactTree == nullptr) {
- dat->secondLine.show = db_get_b(0, "CList", "SecondLineShow", SETTING_SECONDLINE_SHOW_DEFAULT);
- dat->secondLine.top_space = db_get_w(0, "CList", "SecondLineTopSpace", SETTING_SECONDLINE_TOPSPACE_DEFAULT);
- dat->secondLine.draw_smileys = db_get_b(0, "CList", "SecondLineDrawSmileys", SETTING_SECONDLINE_SMILEYS_DEFAULT);
- dat->secondLine.type = db_get_w(0, "CList", "SecondLineType", SETTING_SECONDLINE_TYPE_DEFAULT);
+ dat->secondLine.show = g_plugin.getByte("SecondLineShow", SETTING_SECONDLINE_SHOW_DEFAULT);
+ dat->secondLine.top_space = g_plugin.getWord("SecondLineTopSpace", SETTING_SECONDLINE_TOPSPACE_DEFAULT);
+ dat->secondLine.draw_smileys = g_plugin.getByte("SecondLineDrawSmileys", SETTING_SECONDLINE_SMILEYS_DEFAULT);
+ dat->secondLine.type = g_plugin.getWord("SecondLineType", SETTING_SECONDLINE_TYPE_DEFAULT);
- ptrW tszLineText(db_get_wsa(0, "CList", "SecondLineText"));
+ ptrW tszLineText(g_plugin.getWStringA("SecondLineText"));
if (tszLineText)
wcsncpy_s(dat->secondLine.text, tszLineText, _TRUNCATE);
else
dat->secondLine.text[0] = '\0';
- dat->secondLine.xstatus_has_priority = db_get_b(0, "CList", "SecondLineXStatusHasPriority", SETTING_SECONDLINE_XSTATUS_DEFAULT);
- dat->secondLine.show_status_if_no_away = db_get_b(0, "CList", "SecondLineShowStatusIfNoAway", SETTING_SECONDLINE_STATUSIFNOAWAY_DEFAULT);
- dat->secondLine.show_listening_if_no_away = db_get_b(0, "CList", "SecondLineShowListeningIfNoAway", SETTING_SECONDLINE_LISTENINGIFNOAWAY_DEFAULT);
- dat->secondLine.use_name_and_message_for_xstatus = db_get_b(0, "CList", "SecondLineUseNameAndMessageForXStatus", SETTING_SECONDLINE_XSTATUSNAMETEXT_DEFAULT);
+ dat->secondLine.xstatus_has_priority = g_plugin.getByte("SecondLineXStatusHasPriority", SETTING_SECONDLINE_XSTATUS_DEFAULT);
+ dat->secondLine.show_status_if_no_away = g_plugin.getByte("SecondLineShowStatusIfNoAway", SETTING_SECONDLINE_STATUSIFNOAWAY_DEFAULT);
+ dat->secondLine.show_listening_if_no_away = g_plugin.getByte("SecondLineShowListeningIfNoAway", SETTING_SECONDLINE_LISTENINGIFNOAWAY_DEFAULT);
+ dat->secondLine.use_name_and_message_for_xstatus = g_plugin.getByte("SecondLineUseNameAndMessageForXStatus", SETTING_SECONDLINE_XSTATUSNAMETEXT_DEFAULT);
}
else memset(&dat->secondLine, 0, sizeof(dat->secondLine));
// Third line
if (g_clistApi.hwndContactTree == hwnd || g_clistApi.hwndContactTree == nullptr) {
- dat->thirdLine.show = db_get_b(0, "CList", "ThirdLineShow", SETTING_THIRDLINE_SHOW_DEFAULT);
- dat->thirdLine.top_space = db_get_w(0, "CList", "ThirdLineTopSpace", SETTING_THIRDLINE_TOPSPACE_DEFAULT);
- dat->thirdLine.draw_smileys = db_get_b(0, "CList", "ThirdLineDrawSmileys", SETTING_THIRDLINE_SMILEYS_DEFAULT);
- dat->thirdLine.type = db_get_w(0, "CList", "ThirdLineType", SETTING_THIRDLINE_TYPE_DEFAULT);
+ dat->thirdLine.show = g_plugin.getByte("ThirdLineShow", SETTING_THIRDLINE_SHOW_DEFAULT);
+ dat->thirdLine.top_space = g_plugin.getWord("ThirdLineTopSpace", SETTING_THIRDLINE_TOPSPACE_DEFAULT);
+ dat->thirdLine.draw_smileys = g_plugin.getByte("ThirdLineDrawSmileys", SETTING_THIRDLINE_SMILEYS_DEFAULT);
+ dat->thirdLine.type = g_plugin.getWord("ThirdLineType", SETTING_THIRDLINE_TYPE_DEFAULT);
- ptrW tszLineText(db_get_wsa(0, "CList", "ThirdLineText"));
+ ptrW tszLineText(g_plugin.getWStringA("ThirdLineText"));
if (tszLineText)
wcsncpy_s(dat->thirdLine.text, tszLineText, _TRUNCATE);
else
dat->thirdLine.text[0] = '\0';
- dat->thirdLine.xstatus_has_priority = db_get_b(0, "CList", "ThirdLineXStatusHasPriority", SETTING_THIRDLINE_XSTATUS_DEFAULT);
- dat->thirdLine.show_status_if_no_away = db_get_b(0, "CList", "ThirdLineShowStatusIfNoAway", SETTING_THIRDLINE_STATUSIFNOAWAY_DEFAULT);
- dat->thirdLine.show_listening_if_no_away = db_get_b(0, "CList", "ThirdLineShowListeningIfNoAway", SETTING_THIRDLINE_LISTENINGIFNOAWAY_DEFAULT);
- dat->thirdLine.use_name_and_message_for_xstatus = db_get_b(0, "CList", "ThirdLineUseNameAndMessageForXStatus", SETTING_THIRDLINE_XSTATUSNAMETEXT_DEFAULT);
+ dat->thirdLine.xstatus_has_priority = g_plugin.getByte("ThirdLineXStatusHasPriority", SETTING_THIRDLINE_XSTATUS_DEFAULT);
+ dat->thirdLine.show_status_if_no_away = g_plugin.getByte("ThirdLineShowStatusIfNoAway", SETTING_THIRDLINE_STATUSIFNOAWAY_DEFAULT);
+ dat->thirdLine.show_listening_if_no_away = g_plugin.getByte("ThirdLineShowListeningIfNoAway", SETTING_THIRDLINE_LISTENINGIFNOAWAY_DEFAULT);
+ dat->thirdLine.use_name_and_message_for_xstatus = g_plugin.getByte("ThirdLineUseNameAndMessageForXStatus", SETTING_THIRDLINE_XSTATUSNAMETEXT_DEFAULT);
}
else memset(&dat->thirdLine, 0, sizeof(dat->thirdLine));
@@ -631,7 +631,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst)
dat->bMetaExpanding = db_get_b(0, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT) != 0;
- dat->bPlaceOfflineToRoot = db_get_b(0, "CList", "PlaceOfflineToRoot", SETTING_PLACEOFFLINETOROOT_DEFAULT) != 0;
+ dat->bPlaceOfflineToRoot = g_plugin.getByte("PlaceOfflineToRoot", SETTING_PLACEOFFLINETOROOT_DEFAULT) != 0;
dat->drawOverlayedStatus = db_get_b(0, "CLC", "DrawOverlayedStatus", SETTING_DRAWOVERLAYEDSTATUS_DEFAULT);
dat->dbbMetaHideExtra = db_get_b(0, "CLC", "MetaHideExtra", SETTING_METAHIDEEXTRA_DEFAULT);
@@ -654,7 +654,7 @@ int ExpandMetaContact(HWND hwnd, ClcContact *contact, ClcData *dat)
return 0;
contact->bSubExpanded = true;
- db_set_b(contact->hContact, "CList", "Expanded", contact->bSubExpanded);
+ g_plugin.setByte(contact->hContact, "Expanded", contact->bSubExpanded);
dat->bNeedsResort = true;
g_clistApi.pfnSortCLC(hwnd, dat, 1);
cliRecalcScrollBar(hwnd, dat);
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index 95eec95d18..95fcbdfdca 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -57,7 +57,7 @@ static IconItem iconList[] =
static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
{
- BYTE bContactRate = db_get_b(hContact, "CList", "Rate", 0);
+ BYTE bContactRate = g_plugin.getByte(hContact, "Rate");
if (bContactRate > _countof(rates) - 1)
bContactRate = _countof(rates) - 1;
@@ -71,14 +71,14 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
for (int i = 0; i < _countof(rates); i++)
Menu_SetChecked(hFavoriteContactMenuItems[i], bContactRate == i);
- Menu_SetChecked(hShowIfOflineItem, db_get_b(hContact, "CList", "noOffline", 0) != 0);
+ Menu_SetChecked(hShowIfOflineItem, g_plugin.getByte(hContact, "noOffline") != 0);
return 0;
}
INT_PTR FAV_SetRate(WPARAM hContact, LPARAM nRate)
{
if (hContact)
- db_set_b(hContact, "CList", "Rate", (BYTE)nRate);
+ g_plugin.setByte(hContact, "Rate", (BYTE)nRate);
return 0;
}
@@ -86,7 +86,7 @@ INT_PTR FAV_SetRate(WPARAM hContact, LPARAM nRate)
INT_PTR FAV_ToggleShowOffline(WPARAM hContact, LPARAM)
{
if (hContact)
- db_set_b(hContact, "CList", "noOffline", !db_get_b(hContact, "CList", "noOffline", 0));
+ g_plugin.setByte(hContact, "noOffline", !g_plugin.getByte(hContact, "noOffline"));
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp
index 4734bcada5..752ebcadd3 100644
--- a/plugins/Clist_modern/src/modern_clistmod.cpp
+++ b/plugins/Clist_modern/src/modern_clistmod.cpp
@@ -189,7 +189,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY)
if (IsIconic(hWnd) || !IsWindowVisible(hWnd))
return GWVS_HIDDEN;
- if (db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT) || !db_get_b(0, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT))
+ if (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT) || !g_plugin.getByte("BringToFront", SETTING_BRINGTOFRONT_DEFAULT))
return GWVS_VISIBLE;
HWND hwndFocused = GetFocus();
@@ -345,11 +345,11 @@ int cliShowHide(bool bAlwaysShow)
Sync(CLUIFrames_ActivateSubContainers, TRUE);
CLUI_ShowWindowMod(g_clistApi.hwndContactList, SW_RESTORE);
- if (!db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
+ if (!g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
Sync(CLUIFrames_OnShowHide, 1); //TO BE PROXIED
SetWindowPos(g_clistApi.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
g_bCalledFromShowHide = 1;
- if (!db_get_b(0, "CList", "OnTop", SETTING_ONTOP_DEFAULT))
+ if (!g_plugin.getByte("OnTop", SETTING_ONTOP_DEFAULT))
SetWindowPos(g_clistApi.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
g_bCalledFromShowHide = 0;
}
@@ -358,7 +358,7 @@ int cliShowHide(bool bAlwaysShow)
Sync(CLUIFrames_OnShowHide, 1);
SetForegroundWindow(g_clistApi.hwndContactList);
}
- db_set_b(0, "CList", "State", SETTING_STATE_NORMAL);
+ g_plugin.setByte("State", SETTING_STATE_NORMAL);
RECT rcWindow;
GetWindowRect(g_clistApi.hwndContactList, &rcWindow);
@@ -369,15 +369,15 @@ int cliShowHide(bool bAlwaysShow)
else { // It needs to be hidden
if (GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) {
CListMod_HideWindow();
- db_set_b(0, "CList", "State", SETTING_STATE_HIDDEN);
+ g_plugin.setByte("State", SETTING_STATE_HIDDEN);
}
- else if (db_get_b(0, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) {
+ else if (g_plugin.getByte("Min2Tray", SETTING_MIN2TRAY_DEFAULT)) {
CLUI_ShowWindowMod(g_clistApi.hwndContactList, SW_HIDE);
- db_set_b(0, "CList", "State", SETTING_STATE_HIDDEN);
+ g_plugin.setByte("State", SETTING_STATE_HIDDEN);
}
else {
CLUI_ShowWindowMod(g_clistApi.hwndContactList, SW_MINIMIZE);
- db_set_b(0, "CList", "State", SETTING_STATE_MINIMIZED);
+ g_plugin.setByte("State", SETTING_STATE_MINIMIZED);
}
SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp
index 7a17f78610..d0a18bedfa 100644
--- a/plugins/Clist_modern/src/modern_clistopts.cpp
+++ b/plugins/Clist_modern/src/modern_clistopts.cpp
@@ -31,15 +31,15 @@ static INT_PTR CALLBACK DlgProcItemRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam
TranslateDialogDefault(hwndDlg);
SendDlgItemMessage(hwndDlg, IDC_MIN_ROW_HEIGHT_SPIN, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_MIN_ROW_HEIGHT), 0); // set buddy
SendDlgItemMessage(hwndDlg, IDC_MIN_ROW_HEIGHT_SPIN, UDM_SETRANGE, 0, MAKELONG(255, 0));
- SendDlgItemMessage(hwndDlg, IDC_MIN_ROW_HEIGHT_SPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(0, "CList", "MinRowHeight", CLCDEFAULT_ROWHEIGHT), 0));
+ SendDlgItemMessage(hwndDlg, IDC_MIN_ROW_HEIGHT_SPIN, UDM_SETPOS, 0, MAKELONG(g_plugin.getWord("MinRowHeight", CLCDEFAULT_ROWHEIGHT), 0));
SendDlgItemMessage(hwndDlg, IDC_ROW_BORDER_SPIN, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_ROW_BORDER), 0); // set buddy
SendDlgItemMessage(hwndDlg, IDC_ROW_BORDER_SPIN, UDM_SETRANGE, 0, MAKELONG(255, 0));
- SendDlgItemMessage(hwndDlg, IDC_ROW_BORDER_SPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(0, "CList", "RowBorder", SETTING_ROWBORDER_DEFAULT), 0));
+ SendDlgItemMessage(hwndDlg, IDC_ROW_BORDER_SPIN, UDM_SETPOS, 0, MAKELONG(g_plugin.getWord("RowBorder", SETTING_ROWBORDER_DEFAULT), 0));
- CheckDlgButton(hwndDlg, IDC_VARIABLE_ROW_HEIGHT, db_get_b(0, "CList", "VariableRowHeight", SETTING_VARIABLEROWHEIGHT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ALIGN_TO_LEFT, db_get_b(0, "CList", "AlignLeftItemsToLeft", SETTING_ALIGNLEFTTOLEFT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ALIGN_TO_RIGHT, db_get_b(0, "CList", "AlignRightItemsToRight", SETTING_ALIGNRIGHTORIGHT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_VARIABLE_ROW_HEIGHT, g_plugin.getByte("VariableRowHeight", SETTING_VARIABLEROWHEIGHT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALIGN_TO_LEFT, g_plugin.getByte("AlignLeftItemsToLeft", SETTING_ALIGNLEFTTOLEFT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALIGN_TO_RIGHT, g_plugin.getByte("AlignRightItemsToRight", SETTING_ALIGNRIGHTORIGHT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_MINIMODE, db_get_b(0, "CLC", "CompactMode", SETTING_COMPACTMODE_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
@@ -60,7 +60,7 @@ static INT_PTR CALLBACK DlgProcItemRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam
int pos = 0;
mir_snprintf(tmp, "RowPos%d", i);
- type = db_get_w(0, "CList", tmp, i);
+ type = g_plugin.getWord(tmp, i);
switch (type) {
case ITEM_AVATAR:
@@ -192,11 +192,11 @@ static INT_PTR CALLBACK DlgProcItemRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_w(0, "CList", "MinRowHeight", (WORD)SendDlgItemMessage(hwndDlg, IDC_MIN_ROW_HEIGHT_SPIN, UDM_GETPOS, 0, 0));
- db_set_w(0, "CList", "RowBorder", (WORD)SendDlgItemMessage(hwndDlg, IDC_ROW_BORDER_SPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CList", "VariableRowHeight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_VARIABLE_ROW_HEIGHT));
- db_set_b(0, "CList", "AlignLeftItemsToLeft", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_TO_LEFT));
- db_set_b(0, "CList", "AlignRightItemsToRight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_TO_RIGHT));
+ g_plugin.setWord("MinRowHeight", (WORD)SendDlgItemMessage(hwndDlg, IDC_MIN_ROW_HEIGHT_SPIN, UDM_GETPOS, 0, 0));
+ g_plugin.setWord("RowBorder", (WORD)SendDlgItemMessage(hwndDlg, IDC_ROW_BORDER_SPIN, UDM_GETPOS, 0, 0));
+ g_plugin.setByte("VariableRowHeight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_VARIABLE_ROW_HEIGHT));
+ g_plugin.setByte("AlignLeftItemsToLeft", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_TO_LEFT));
+ g_plugin.setByte("AlignRightItemsToRight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_TO_RIGHT));
db_set_b(0, "CLC", "CompactMode", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MINIMODE));
db_set_b(0, "CLC", "LeftMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
db_set_b(0, "CLC", "RightMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_RIGHTMARGINSPIN, UDM_GETPOS, 0, 0));
@@ -205,7 +205,7 @@ static INT_PTR CALLBACK DlgProcItemRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam
for (int i = 0; i < NUM_ITEM_TYPE; i++) {
char tmp[128];
mir_snprintf(tmp, "RowPos%d", i);
- db_set_w(0, "CList", tmp, (WORD)SendMessage(hwndList, LB_GETITEMDATA, i, 0));
+ g_plugin.setWord(tmp, (WORD)SendMessage(hwndList, LB_GETITEMDATA, i, 0));
}
}
@@ -224,16 +224,16 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_SHOW_AVATARS, db_get_b(0, "CList", "AvatarsShow", SETTINGS_SHOWAVATARS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOW_ANIAVATARS, db_get_b(0, "CList", "AvatarsAnimated", BST_CHECKED));
- CheckDlgButton(hwndDlg, IDC_AVATAR_FASTDRAW, db_get_b(0, "CList", "AvatarsInSeparateWnd", SETTINGS_AVATARINSEPARATE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AVATAR_DRAW_BORDER, db_get_b(0, "CList", "AvatarsDrawBorders", SETTINGS_AVATARDRAWBORDER_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AVATAR_ROUND_CORNERS, db_get_b(0, "CList", "AvatarsRoundCorners", SETTINGS_AVATARROUNDCORNERS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK, db_get_b(0, "CList", "AvatarsUseCustomCornerSize", SETTINGS_AVATARUSECUTOMCORNERSIZE_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AVATAR_IGNORE_SIZE, db_get_b(0, "CList", "AvatarsIgnoreSizeForRow", SETTINGS_AVATARIGNORESIZEFORROW_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AVATAR_OVERLAY_ICONS, db_get_b(0, "CList", "AvatarsDrawOverlay", SETTINGS_AVATARDRAWOVERLAY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
-
- switch (db_get_b(0, "CList", "AvatarsOverlayType", SETTINGS_AVATAROVERLAYTYPE_DEFAULT)) {
+ CheckDlgButton(hwndDlg, IDC_SHOW_AVATARS, g_plugin.getByte("AvatarsShow", SETTINGS_SHOWAVATARS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOW_ANIAVATARS, g_plugin.getByte("AvatarsAnimated", BST_CHECKED));
+ CheckDlgButton(hwndDlg, IDC_AVATAR_FASTDRAW, g_plugin.getByte("AvatarsInSeparateWnd", SETTINGS_AVATARINSEPARATE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AVATAR_DRAW_BORDER, g_plugin.getByte("AvatarsDrawBorders", SETTINGS_AVATARDRAWBORDER_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AVATAR_ROUND_CORNERS, g_plugin.getByte("AvatarsRoundCorners", SETTINGS_AVATARROUNDCORNERS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK, g_plugin.getByte("AvatarsUseCustomCornerSize", SETTINGS_AVATARUSECUTOMCORNERSIZE_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AVATAR_IGNORE_SIZE, g_plugin.getByte("AvatarsIgnoreSizeForRow", SETTINGS_AVATARIGNORESIZEFORROW_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AVATAR_OVERLAY_ICONS, g_plugin.getByte("AvatarsDrawOverlay", SETTINGS_AVATARDRAWOVERLAY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+
+ switch (g_plugin.getByte("AvatarsOverlayType", SETTINGS_AVATAROVERLAYTYPE_DEFAULT)) {
case SETTING_AVATAR_OVERLAY_TYPE_NORMAL:
CheckDlgButton(hwndDlg, IDC_AVATAR_OVERLAY_ICON_NORMAL, BST_CHECKED);
break;
@@ -247,17 +247,17 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa
SendDlgItemMessage(hwndDlg, IDC_AVATAR_SIZE_SPIN, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_AVATAR_SIZE), 0); // set buddy
SendDlgItemMessage(hwndDlg, IDC_AVATAR_SIZE_SPIN, UDM_SETRANGE, 0, MAKELONG(255, 1));
- SendDlgItemMessage(hwndDlg, IDC_AVATAR_SIZE_SPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(0, "CList", "AvatarsSize", SETTING_AVATARHEIGHT_DEFAULT), 0));
+ SendDlgItemMessage(hwndDlg, IDC_AVATAR_SIZE_SPIN, UDM_SETPOS, 0, MAKELONG(g_plugin.getWord("AvatarsSize", SETTING_AVATARHEIGHT_DEFAULT), 0));
SendDlgItemMessage(hwndDlg, IDC_AVATAR_WIDTH_SPIN, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_AVATAR_WIDTH), 0); // set buddy
SendDlgItemMessage(hwndDlg, IDC_AVATAR_WIDTH_SPIN, UDM_SETRANGE, 0, MAKELONG(255, 0));
- SendDlgItemMessage(hwndDlg, IDC_AVATAR_WIDTH_SPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(0, "CList", "AvatarsWidth", SETTING_AVATARWIDTH_DEFAULT), 0));
+ SendDlgItemMessage(hwndDlg, IDC_AVATAR_WIDTH_SPIN, UDM_SETPOS, 0, MAKELONG(g_plugin.getWord("AvatarsWidth", SETTING_AVATARWIDTH_DEFAULT), 0));
SendDlgItemMessage(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE), 0); // set buddy
SendDlgItemMessage(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN, UDM_SETRANGE, 0, MAKELONG(255, 1));
- SendDlgItemMessage(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(0, "CList", "AvatarsCustomCornerSize", SETTINGS_AVATARCORNERSIZE_DEFAULT), 0));
+ SendDlgItemMessage(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN, UDM_SETPOS, 0, MAKELONG(g_plugin.getWord("AvatarsCustomCornerSize", SETTINGS_AVATARCORNERSIZE_DEFAULT), 0));
- SendDlgItemMessage(hwndDlg, IDC_AVATAR_BORDER_COLOR, CPM_SETCOLOUR, 0, (COLORREF)db_get_dw(0, "CList", "AvatarsBorderColor", SETTINGS_AVATARBORDERCOLOR_DEFAULT));
+ SendDlgItemMessage(hwndDlg, IDC_AVATAR_BORDER_COLOR, CPM_SETCOLOUR, 0, (COLORREF)g_plugin.getDword("AvatarsBorderColor", SETTINGS_AVATARBORDERCOLOR_DEFAULT));
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOW_AVATARS)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_AVATAR_DRAW_BORDER), FALSE);
@@ -375,26 +375,26 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, "CList", "AvatarsShow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_AVATARS));
- db_set_b(0, "CList", "AvatarsAnimated", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_ANIAVATARS));
- db_set_b(0, "CList", "AvatarsInSeparateWnd", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_FASTDRAW));
-
- db_set_b(0, "CList", "AvatarsDrawBorders", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_DRAW_BORDER));
- db_set_dw(0, "CList", "AvatarsBorderColor", (DWORD)SendDlgItemMessage(hwndDlg, IDC_AVATAR_BORDER_COLOR, CPM_GETCOLOUR, 0, 0));
- db_set_b(0, "CList", "AvatarsRoundCorners", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_ROUND_CORNERS));
- db_set_b(0, "CList", "AvatarsIgnoreSizeForRow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_IGNORE_SIZE));
- db_set_b(0, "CList", "AvatarsUseCustomCornerSize", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK));
- db_set_w(0, "CList", "AvatarsCustomCornerSize", (WORD)SendDlgItemMessage(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CList", "AvatarsDrawOverlay", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_OVERLAY_ICONS));
- db_set_w(0, "CList", "AvatarsSize", (WORD)SendDlgItemMessage(hwndDlg, IDC_AVATAR_SIZE_SPIN, UDM_GETPOS, 0, 0));
- db_set_w(0, "CList", "AvatarsWidth", (WORD)SendDlgItemMessage(hwndDlg, IDC_AVATAR_WIDTH_SPIN, UDM_GETPOS, 0, 0));
+ g_plugin.setByte("AvatarsShow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_AVATARS));
+ g_plugin.setByte("AvatarsAnimated", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_ANIAVATARS));
+ g_plugin.setByte("AvatarsInSeparateWnd", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_FASTDRAW));
+
+ g_plugin.setByte("AvatarsDrawBorders", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_DRAW_BORDER));
+ g_plugin.setDword("AvatarsBorderColor", (DWORD)SendDlgItemMessage(hwndDlg, IDC_AVATAR_BORDER_COLOR, CPM_GETCOLOUR, 0, 0));
+ g_plugin.setByte("AvatarsRoundCorners", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_ROUND_CORNERS));
+ g_plugin.setByte("AvatarsIgnoreSizeForRow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_IGNORE_SIZE));
+ g_plugin.setByte("AvatarsUseCustomCornerSize", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK));
+ g_plugin.setWord("AvatarsCustomCornerSize", (WORD)SendDlgItemMessage(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN, UDM_GETPOS, 0, 0));
+ g_plugin.setByte("AvatarsDrawOverlay", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_OVERLAY_ICONS));
+ g_plugin.setWord("AvatarsSize", (WORD)SendDlgItemMessage(hwndDlg, IDC_AVATAR_SIZE_SPIN, UDM_GETPOS, 0, 0));
+ g_plugin.setWord("AvatarsWidth", (WORD)SendDlgItemMessage(hwndDlg, IDC_AVATAR_WIDTH_SPIN, UDM_GETPOS, 0, 0));
if (IsDlgButtonChecked(hwndDlg, IDC_AVATAR_OVERLAY_ICON_NORMAL))
- db_set_b(0, "CList", "AvatarsOverlayType", SETTING_AVATAR_OVERLAY_TYPE_NORMAL);
+ g_plugin.setByte("AvatarsOverlayType", SETTING_AVATAR_OVERLAY_TYPE_NORMAL);
else if (IsDlgButtonChecked(hwndDlg, IDC_AVATAR_OVERLAY_ICON_PROTOCOL))
- db_set_b(0, "CList", "AvatarsOverlayType", SETTING_AVATAR_OVERLAY_TYPE_PROTOCOL);
+ g_plugin.setByte("AvatarsOverlayType", SETTING_AVATAR_OVERLAY_TYPE_PROTOCOL);
else if (IsDlgButtonChecked(hwndDlg, IDC_AVATAR_OVERLAY_ICON_CONTACT))
- db_set_b(0, "CList", "AvatarsOverlayType", SETTING_AVATAR_OVERLAY_TYPE_CONTACT);
+ g_plugin.setByte("AvatarsOverlayType", SETTING_AVATAR_OVERLAY_TYPE_CONTACT);
ClcOptionsChanged();
AniAva_UpdateOptions();
return TRUE;
@@ -413,12 +413,12 @@ static INT_PTR CALLBACK DlgProcItemIconOpts(HWND hwndDlg, UINT msg, WPARAM wPara
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_HIDE_ICON_ON_AVATAR, db_get_b(0, "CList", "IconHideOnAvatar", SETTING_HIDEICONONAVATAR_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DRAW_ON_AVATAR_SPACE, db_get_b(0, "CList", "IconDrawOnAvatarSpace", SETTING_ICONONAVATARPLACE_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ICONBLINK, db_get_b(0, "CList", "NoIconBlink", SETTING_NOICONBLINF_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_HIDE_GROUPSICON, db_get_b(0, "CList", "HideGroupsIcon", SETTING_HIDEGROUPSICON_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTCHECKICONSIZE, db_get_b(0, "CList", "IconIgnoreSizeForRownHeight", SETTING_ICONIGNORESIZE_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ALWAYS_VISIBLEICON, db_get_b(0, "CList", "AlwaysShowAlwaysVisIcon", SETTING_ALWAYSVISICON_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_HIDE_ICON_ON_AVATAR, g_plugin.getByte("IconHideOnAvatar", SETTING_HIDEICONONAVATAR_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DRAW_ON_AVATAR_SPACE, g_plugin.getByte("IconDrawOnAvatarSpace", SETTING_ICONONAVATARPLACE_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ICONBLINK, g_plugin.getByte("NoIconBlink", SETTING_NOICONBLINF_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_HIDE_GROUPSICON, g_plugin.getByte("HideGroupsIcon", SETTING_HIDEGROUPSICON_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTCHECKICONSIZE, g_plugin.getByte("IconIgnoreSizeForRownHeight", SETTING_ICONIGNORESIZE_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALWAYS_VISIBLEICON, g_plugin.getByte("AlwaysShowAlwaysVisIcon", SETTING_ALWAYSVISICON_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_USEXSTATUS, (db_get_b(0, "CLC", "DrawOverlayedStatus", SETTING_DRAWOVERLAYEDSTATUS_DEFAULT) & 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DRAWSTATUSOVERLAY, (db_get_b(0, "CLC", "DrawOverlayedStatus", SETTING_DRAWOVERLAYEDSTATUS_DEFAULT) & 2) ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_DRAWSTATUSOVERLAY), IsDlgButtonChecked(hwndDlg, IDC_USEXSTATUS));
@@ -445,12 +445,12 @@ static INT_PTR CALLBACK DlgProcItemIconOpts(HWND hwndDlg, UINT msg, WPARAM wPara
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, "CList", "IconHideOnAvatar", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDE_ICON_ON_AVATAR));
- db_set_b(0, "CList", "IconDrawOnAvatarSpace", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAW_ON_AVATAR_SPACE));
- db_set_b(0, "CList", "HideGroupsIcon", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDE_GROUPSICON));
- db_set_b(0, "CList", "NoIconBlink", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ICONBLINK));
- db_set_b(0, "CList", "IconIgnoreSizeForRownHeight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOTCHECKICONSIZE));
- db_set_b(0, "CList", "AlwaysShowAlwaysVisIcon", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYS_VISIBLEICON));
+ g_plugin.setByte("IconHideOnAvatar", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDE_ICON_ON_AVATAR));
+ g_plugin.setByte("IconDrawOnAvatarSpace", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAW_ON_AVATAR_SPACE));
+ g_plugin.setByte("HideGroupsIcon", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDE_GROUPSICON));
+ g_plugin.setByte("NoIconBlink", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ICONBLINK));
+ g_plugin.setByte("IconIgnoreSizeForRownHeight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOTCHECKICONSIZE));
+ g_plugin.setByte("AlwaysShowAlwaysVisIcon", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYS_VISIBLEICON));
{
BYTE ovr = IsDlgButtonChecked(hwndDlg, IDC_USEXSTATUS) ? 1 : 0;
if (ovr) ovr += IsDlgButtonChecked(hwndDlg, IDC_DRAWSTATUSOVERLAY) ? 2 : 0;
@@ -472,8 +472,8 @@ static INT_PTR CALLBACK DlgProcItemContactTimeOpts(HWND hwndDlg, UINT msg, WPARA
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_SHOW, db_get_b(0, "CList", "ContactTimeShow", SETTING_SHOWTIME_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOW_ONLY_IF_DIFFERENT, db_get_b(0, "CList", "ContactTimeShowOnlyIfDifferent", SETTING_SHOWTIMEIFDIFF_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOW, g_plugin.getByte("ContactTimeShow", SETTING_SHOWTIME_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOW_ONLY_IF_DIFFERENT, g_plugin.getByte("ContactTimeShowOnlyIfDifferent", SETTING_SHOWTIMEIFDIFF_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
break;
case WM_COMMAND:
@@ -485,8 +485,8 @@ static INT_PTR CALLBACK DlgProcItemContactTimeOpts(HWND hwndDlg, UINT msg, WPARA
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, "CList", "ContactTimeShow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
- db_set_b(0, "CList", "ContactTimeShowOnlyIfDifferent", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_ONLY_IF_DIFFERENT));
+ g_plugin.setByte("ContactTimeShow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
+ g_plugin.setByte("ContactTimeShowOnlyIfDifferent", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_ONLY_IF_DIFFERENT));
ClcOptionsChanged();
return TRUE;
}
@@ -504,24 +504,23 @@ static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wPara
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_RTL, db_get_b(0, "CList", "TextRTL", SETTING_TEXT_RTL_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- //TODO: init IDC_ALIGNGROUPCOMBO from db_get_b(0,"CList","AlignGroupCaptions",SETTING_ALIGNGROPCAPTION_DEFAULT);
+ CheckDlgButton(hwndDlg, IDC_RTL, g_plugin.getByte("TextRTL", SETTING_TEXT_RTL_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
{
int item;
wchar_t *align[] = { LPGENW("Left align group names"), LPGENW("Center group names"), LPGENW("Right align group names") };
for (int i = 0; i < sizeof(align) / sizeof(char*); i++)
item = SendDlgItemMessage(hwndDlg, IDC_ALIGNGROUPCOMBO, CB_ADDSTRING, 0, (LPARAM)TranslateW(align[i]));
- SendDlgItemMessage(hwndDlg, IDC_ALIGNGROUPCOMBO, CB_SETCURSEL, db_get_b(0, "CList", "AlignGroupCaptions", SETTING_ALIGNGROPCAPTION_DEFAULT), 0);
+ SendDlgItemMessage(hwndDlg, IDC_ALIGNGROUPCOMBO, CB_SETCURSEL, g_plugin.getByte("AlignGroupCaptions", SETTING_ALIGNGROPCAPTION_DEFAULT), 0);
}
- CheckDlgButton(hwndDlg, IDC_ALIGN_RIGHT, db_get_b(0, "CList", "TextAlignToRight", SETTING_TEXT_RIGHTALIGN_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_REPLACE_SMILEYS, db_get_b(0, "CList", "TextReplaceSmileys", SETTING_TEXT_SMILEY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_RESIZE_SMILEYS, db_get_b(0, "CList", "TextResizeSmileys", SETTING_TEXT_RESIZESMILEY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_USE_PROTOCOL_SMILEYS, db_get_b(0, "CList", "TextUseProtocolSmileys", SETTING_TEXT_PROTOSMILEY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_IGNORE_SIZE, db_get_b(0, "CList", "TextIgnoreSizeForRownHeight", SETTING_TEXT_IGNORESIZE_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALIGN_RIGHT, g_plugin.getByte("TextAlignToRight", SETTING_TEXT_RIGHTALIGN_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_REPLACE_SMILEYS, g_plugin.getByte("TextReplaceSmileys", SETTING_TEXT_SMILEY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_RESIZE_SMILEYS, g_plugin.getByte("TextResizeSmileys", SETTING_TEXT_RESIZESMILEY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_USE_PROTOCOL_SMILEYS, g_plugin.getByte("TextUseProtocolSmileys", SETTING_TEXT_PROTOSMILEY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_IGNORE_SIZE, g_plugin.getByte("TextIgnoreSizeForRownHeight", SETTING_TEXT_IGNORESIZE_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS_ON_FIRST_LINE, db_get_b(0, "CList", "FirstLineDrawSmileys", SETTING_FIRSTLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_APPEND_NICK, db_get_b(0, "CList", "FirstLineAppendNick", SETTING_FIRSTLINE_APPENDNICK_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TRIM_TEXT, db_get_b(0, "CList", "TrimText", SETTING_FIRSTLINE_TRIMTEXT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS_ON_FIRST_LINE, g_plugin.getByte("FirstLineDrawSmileys", SETTING_FIRSTLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_APPEND_NICK, g_plugin.getByte("FirstLineAppendNick", SETTING_FIRSTLINE_APPENDNICK_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TRIM_TEXT, g_plugin.getByte("TrimText", SETTING_FIRSTLINE_TRIMTEXT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
{
bool smileAddPresent = ServiceExists(MS_SMILEYADD_BATCHPARSE) != 0;
CLUI_ShowWindowMod(GetDlgItem(hwndDlg, IDC_REPLACE_SMILEYS), smileAddPresent ? SW_SHOW : SW_HIDE);
@@ -550,17 +549,16 @@ static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wPara
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, "CList", "TextRTL", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RTL));
- //TODO: Store IDC_ALIGNGROUPCOMBO at db_get_b(0,"CList","AlignGroupCaptions",SETTING_ALIGNGROPCAPTION_DEFAULT);
- db_set_b(0, "CList", "AlignGroupCaptions", (BYTE)SendDlgItemMessage(hwndDlg, IDC_ALIGNGROUPCOMBO, CB_GETCURSEL, 0, 0));
- db_set_b(0, "CList", "TextAlignToRight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_RIGHT));
- db_set_b(0, "CList", "TextReplaceSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_REPLACE_SMILEYS));
- db_set_b(0, "CList", "TextResizeSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RESIZE_SMILEYS));
- db_set_b(0, "CList", "TextUseProtocolSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_USE_PROTOCOL_SMILEYS));
- db_set_b(0, "CList", "TextIgnoreSizeForRownHeight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNORE_SIZE));
- db_set_b(0, "CList", "FirstLineDrawSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS_ON_FIRST_LINE));
- db_set_b(0, "CList", "FirstLineAppendNick", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_APPEND_NICK));
- db_set_b(0, "CList", "TrimText", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TRIM_TEXT));
+ g_plugin.setByte("TextRTL", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RTL));
+ g_plugin.setByte("AlignGroupCaptions", (BYTE)SendDlgItemMessage(hwndDlg, IDC_ALIGNGROUPCOMBO, CB_GETCURSEL, 0, 0));
+ g_plugin.setByte("TextAlignToRight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_RIGHT));
+ g_plugin.setByte("TextReplaceSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_REPLACE_SMILEYS));
+ g_plugin.setByte("TextResizeSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RESIZE_SMILEYS));
+ g_plugin.setByte("TextUseProtocolSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_USE_PROTOCOL_SMILEYS));
+ g_plugin.setByte("TextIgnoreSizeForRownHeight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNORE_SIZE));
+ g_plugin.setByte("FirstLineDrawSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS_ON_FIRST_LINE));
+ g_plugin.setByte("FirstLineAppendNick", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_APPEND_NICK));
+ g_plugin.setByte("TrimText", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TRIM_TEXT));
ClcOptionsChanged();
return TRUE;
}
@@ -576,21 +574,21 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_SHOW, db_get_b(0, "CList", "SecondLineShow", SETTING_SECONDLINE_SHOW_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOW, g_plugin.getByte("SecondLineShow", SETTING_SECONDLINE_SHOW_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_TOP_SPACE_SPIN, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_TOP_SPACE), 0); // set buddy
SendDlgItemMessage(hwndDlg, IDC_TOP_SPACE_SPIN, UDM_SETRANGE, 0, MAKELONG(255, 0));
- SendDlgItemMessage(hwndDlg, IDC_TOP_SPACE_SPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(0, "CList", "SecondLineTopSpace", SETTING_SECONDLINE_TOPSPACE_DEFAULT), 0));
+ SendDlgItemMessage(hwndDlg, IDC_TOP_SPACE_SPIN, UDM_SETPOS, 0, MAKELONG(g_plugin.getWord("SecondLineTopSpace", SETTING_SECONDLINE_TOPSPACE_DEFAULT), 0));
- CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS, db_get_b(0, "CList", "SecondLineDrawSmileys", SETTING_SECONDLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS, g_plugin.getByte("SecondLineDrawSmileys", SETTING_SECONDLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
{
- ptrW tszText(db_get_wsa(0, "CList", "SecondLineText"));
+ ptrW tszText(g_plugin.getWStringA("SecondLineText"));
if (tszText)
SetDlgItemText(hwndDlg, IDC_VARIABLE_TEXT, tszText);
}
SendDlgItemMessage(hwndDlg, IDC_VARIABLE_TEXT, EM_SETLIMITTEXT, TEXT_TEXT_MAX_LENGTH, 0);
{
- int radio = db_get_w(0, "CList", "SecondLineType", TEXT_STATUS_MESSAGE);
+ int radio = g_plugin.getWord("SecondLineType", TEXT_STATUS_MESSAGE);
CheckDlgButton(hwndDlg, IDC_STATUS, radio == TEXT_STATUS ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_NICKNAME, radio == TEXT_NICKNAME ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_STATUS_MESSAGE, radio == TEXT_STATUS_MESSAGE ? BST_CHECKED : BST_UNCHECKED);
@@ -598,10 +596,10 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM
CheckDlgButton(hwndDlg, IDC_CONTACT_TIME, radio == TEXT_CONTACT_TIME ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_TEXT, radio == TEXT_TEXT ? BST_CHECKED : BST_UNCHECKED);
}
- CheckDlgButton(hwndDlg, IDC_XSTATUS_HAS_PRIORITY, db_get_b(0, "CList", "SecondLineXStatusHasPriority", SETTING_SECONDLINE_XSTATUS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY, db_get_b(0, "CList", "SecondLineShowStatusIfNoAway", SETTING_SECONDLINE_STATUSIFNOAWAY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY, db_get_b(0, "CList", "SecondLineShowListeningIfNoAway", SETTING_SECONDLINE_LISTENINGIFNOAWAY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_USE_NAME_AND_MESSAGE, db_get_b(0, "CList", "SecondLineUseNameAndMessageForXStatus", SETTING_SECONDLINE_XSTATUSNAMETEXT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_XSTATUS_HAS_PRIORITY, g_plugin.getByte("SecondLineXStatusHasPriority", SETTING_SECONDLINE_XSTATUS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY, g_plugin.getByte("SecondLineShowStatusIfNoAway", SETTING_SECONDLINE_STATUSIFNOAWAY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY, g_plugin.getByte("SecondLineShowListeningIfNoAway", SETTING_SECONDLINE_LISTENINGIFNOAWAY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_USE_NAME_AND_MESSAGE, g_plugin.getByte("SecondLineUseNameAndMessageForXStatus", SETTING_SECONDLINE_XSTATUSNAMETEXT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOW)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_USE_PROTOCOL_SMILEYS), FALSE);
@@ -697,9 +695,9 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, "CList", "SecondLineShow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
- db_set_w(0, "CList", "SecondLineTopSpace", (WORD)SendDlgItemMessage(hwndDlg, IDC_TOP_SPACE_SPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CList", "SecondLineDrawSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS));
+ g_plugin.setByte("SecondLineShow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
+ g_plugin.setWord("SecondLineTopSpace", (WORD)SendDlgItemMessage(hwndDlg, IDC_TOP_SPACE_SPIN, UDM_GETPOS, 0, 0));
+ g_plugin.setByte("SecondLineDrawSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS));
int radio;
if (IsDlgButtonChecked(hwndDlg, IDC_STATUS))
@@ -714,17 +712,17 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM
radio = TEXT_LISTENING_TO;
else
radio = TEXT_STATUS_MESSAGE;
- db_set_w(0, "CList", "SecondLineType", (WORD)radio);
+ g_plugin.setWord("SecondLineType", (WORD)radio);
wchar_t t[TEXT_TEXT_MAX_LENGTH];
GetDlgItemText(hwndDlg, IDC_VARIABLE_TEXT, t, _countof(t));
t[TEXT_TEXT_MAX_LENGTH - 1] = '\0';
- db_set_ws(0, "CList", "SecondLineText", t);
+ g_plugin.setWString("SecondLineText", t);
- db_set_b(0, "CList", "SecondLineXStatusHasPriority", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_XSTATUS_HAS_PRIORITY));
- db_set_b(0, "CList", "SecondLineShowStatusIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY));
- db_set_b(0, "CList", "SecondLineShowListeningIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY));
- db_set_b(0, "CList", "SecondLineUseNameAndMessageForXStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_USE_NAME_AND_MESSAGE));
+ g_plugin.setByte("SecondLineXStatusHasPriority", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_XSTATUS_HAS_PRIORITY));
+ g_plugin.setByte("SecondLineShowStatusIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY));
+ g_plugin.setByte("SecondLineShowListeningIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY));
+ g_plugin.setByte("SecondLineUseNameAndMessageForXStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_USE_NAME_AND_MESSAGE));
ClcOptionsChanged();
return TRUE;
}
@@ -741,23 +739,23 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_SHOW, db_get_b(0, "CList", "ThirdLineShow", SETTING_THIRDLINE_SHOW_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOW, g_plugin.getByte("ThirdLineShow", SETTING_THIRDLINE_SHOW_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_TOP_SPACE_SPIN, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_TOP_SPACE), 0); // set buddy
SendDlgItemMessage(hwndDlg, IDC_TOP_SPACE_SPIN, UDM_SETRANGE, 0, MAKELONG(255, 0));
- SendDlgItemMessage(hwndDlg, IDC_TOP_SPACE_SPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(0, "CList", "ThirdLineTopSpace", SETTING_THIRDLINE_TOPSPACE_DEFAULT), 0));
+ SendDlgItemMessage(hwndDlg, IDC_TOP_SPACE_SPIN, UDM_SETPOS, 0, MAKELONG(g_plugin.getWord("ThirdLineTopSpace", SETTING_THIRDLINE_TOPSPACE_DEFAULT), 0));
- CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS, db_get_b(0, "CList", "ThirdLineDrawSmileys", SETTING_THIRDLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS, g_plugin.getByte("ThirdLineDrawSmileys", SETTING_THIRDLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
{
DBVARIANT dbv;
- if (!db_get_ws(0, "CList", "ThirdLineText", &dbv)) {
+ if (!g_plugin.getWString("ThirdLineText", &dbv)) {
SetDlgItemText(hwndDlg, IDC_VARIABLE_TEXT, dbv.pwszVal);
db_free(&dbv);
}
}
SendDlgItemMessage(hwndDlg, IDC_VARIABLE_TEXT, EM_SETLIMITTEXT, TEXT_TEXT_MAX_LENGTH, 0);
{
- int radio = db_get_w(0, "CList", "ThirdLineType", SETTING_THIRDLINE_TYPE_DEFAULT);
+ int radio = g_plugin.getWord("ThirdLineType", SETTING_THIRDLINE_TYPE_DEFAULT);
CheckDlgButton(hwndDlg, IDC_STATUS, radio == TEXT_STATUS ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_NICKNAME, radio == TEXT_NICKNAME ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_STATUS_MESSAGE, radio == TEXT_STATUS_MESSAGE ? BST_CHECKED : BST_UNCHECKED);
@@ -766,10 +764,10 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM
CheckDlgButton(hwndDlg, IDC_TEXT, radio == TEXT_TEXT ? BST_CHECKED : BST_UNCHECKED);
}
- CheckDlgButton(hwndDlg, IDC_XSTATUS_HAS_PRIORITY, db_get_b(0, "CList", "ThirdLineXStatusHasPriority", SETTING_THIRDLINE_XSTATUS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY, db_get_b(0, "CList", "ThirdLineShowStatusIfNoAway", SETTING_THIRDLINE_STATUSIFNOAWAY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY, db_get_b(0, "CList", "ThirdLineShowListeningIfNoAway", SETTING_THIRDLINE_LISTENINGIFNOAWAY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_USE_NAME_AND_MESSAGE, db_get_b(0, "CList", "ThirdLineUseNameAndMessageForXStatus", SETTING_THIRDLINE_XSTATUSNAMETEXT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_XSTATUS_HAS_PRIORITY, g_plugin.getByte("ThirdLineXStatusHasPriority", SETTING_THIRDLINE_XSTATUS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY, g_plugin.getByte("ThirdLineShowStatusIfNoAway", SETTING_THIRDLINE_STATUSIFNOAWAY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY, g_plugin.getByte("ThirdLineShowListeningIfNoAway", SETTING_THIRDLINE_LISTENINGIFNOAWAY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_USE_NAME_AND_MESSAGE, g_plugin.getByte("ThirdLineUseNameAndMessageForXStatus", SETTING_THIRDLINE_XSTATUSNAMETEXT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOW)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_USE_PROTOCOL_SMILEYS), FALSE);
@@ -862,9 +860,9 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, "CList", "ThirdLineShow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
- db_set_w(0, "CList", "ThirdLineTopSpace", (WORD)SendDlgItemMessage(hwndDlg, IDC_TOP_SPACE_SPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CList", "ThirdLineDrawSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS));
+ g_plugin.setByte("ThirdLineShow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
+ g_plugin.setWord("ThirdLineTopSpace", (WORD)SendDlgItemMessage(hwndDlg, IDC_TOP_SPACE_SPIN, UDM_GETPOS, 0, 0));
+ g_plugin.setByte("ThirdLineDrawSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS));
{
int radio;
if (IsDlgButtonChecked(hwndDlg, IDC_STATUS))
@@ -879,7 +877,7 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM
radio = TEXT_LISTENING_TO;
else
radio = TEXT_STATUS_MESSAGE;
- db_set_w(0, "CList", "ThirdLineType", (WORD)radio);
+ g_plugin.setWord("ThirdLineType", (WORD)radio);
}
{
wchar_t t[TEXT_TEXT_MAX_LENGTH];
@@ -887,13 +885,13 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM
GetDlgItemText(hwndDlg, IDC_VARIABLE_TEXT, t, _countof(t));
t[TEXT_TEXT_MAX_LENGTH - 1] = '\0';
- db_set_ws(0, "CList", "ThirdLineText", t);
+ g_plugin.setWString("ThirdLineText", t);
}
- db_set_b(0, "CList", "ThirdLineXStatusHasPriority", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_XSTATUS_HAS_PRIORITY));
- db_set_b(0, "CList", "ThirdLineUseNameAndMessageForXStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_USE_NAME_AND_MESSAGE));
- db_set_b(0, "CList", "ThirdLineShowStatusIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY));
- db_set_b(0, "CList", "ThirdLineShowListeningIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY));
+ g_plugin.setByte("ThirdLineXStatusHasPriority", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_XSTATUS_HAS_PRIORITY));
+ g_plugin.setByte("ThirdLineUseNameAndMessageForXStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_USE_NAME_AND_MESSAGE));
+ g_plugin.setByte("ThirdLineShowStatusIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY));
+ g_plugin.setByte("ThirdLineShowListeningIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY));
ClcOptionsChanged();
return TRUE;
}
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp
index 31ea588c24..74f28c7536 100644
--- a/plugins/Clist_modern/src/modern_clistsettings.cpp
+++ b/plugins/Clist_modern/src/modern_clistsettings.cpp
@@ -63,7 +63,7 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce)
// this variable isn't filled inside cliCreateCacheItem() because the filter could be changed dynamically
if (pdnce->dwLastMsgTime == -1 && g_CluiData.bFilterEffective & (CLVM_FILTER_LASTMSG | CLVM_FILTER_LASTMSG_NEWERTHAN | CLVM_FILTER_LASTMSG_OLDERTHAN)) {
- pdnce->dwLastMsgTime = db_get_dw(pdnce->hContact, "CList", "mf_lastmsg", 0);
+ pdnce->dwLastMsgTime = g_plugin.getDword(pdnce->hContact, "mf_lastmsg");
if (pdnce->dwLastMsgTime == 0)
pdnce->dwLastMsgTime = CompareContacts2_getLMTime(pdnce->hContact);
}
@@ -132,9 +132,9 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam)
if (cws->value.wVal == ID_STATUS_OFFLINE)
if (g_CluiData.bRemoveAwayMessageForOffline)
- db_set_s(hContact, "CList", "StatusMsg", "");
+ g_plugin.setString(hContact, "StatusMsg", "");
- if ((db_get_w(0, "CList", "SecondLineType", 0) == TEXT_STATUS_MESSAGE || db_get_w(0, "CList", "ThirdLineType", 0) == TEXT_STATUS_MESSAGE) && pdnce->hContact && pdnce->szProto)
+ if ((g_plugin.getWord("SecondLineType", 0) == TEXT_STATUS_MESSAGE || g_plugin.getWord("ThirdLineType", 0) == TEXT_STATUS_MESSAGE) && pdnce->hContact && pdnce->szProto)
amRequestAwayMsg(hContact);
Clist_Broadcast(INTM_STATUSCHANGED, hContact, 0);
@@ -143,7 +143,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam)
if (g_clistApi.hwndContactTree && g_flag_bOnModulesLoadedCalled)
Clist_InitAutoRebuild(g_clistApi.hwndContactTree);
- if ((db_get_w(0, "CList", "SecondLineType", SETTING_SECONDLINE_TYPE_DEFAULT) == TEXT_STATUS_MESSAGE || db_get_w(0, "CList", "ThirdLineType", SETTING_THIRDLINE_TYPE_DEFAULT) == TEXT_STATUS_MESSAGE) && pdnce->hContact && pdnce->szProto)
+ if ((g_plugin.getWord("SecondLineType", SETTING_SECONDLINE_TYPE_DEFAULT) == TEXT_STATUS_MESSAGE || g_plugin.getWord("ThirdLineType", SETTING_THIRDLINE_TYPE_DEFAULT) == TEXT_STATUS_MESSAGE) && pdnce->hContact && pdnce->szProto)
amRequestAwayMsg(hContact);
}
else if (!strcmp(cws->szSetting, "ApparentMode"))
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp
index 071c807f36..3716f735d0 100644
--- a/plugins/Clist_modern/src/modern_clisttray.cpp
+++ b/plugins/Clist_modern/src/modern_clisttray.cpp
@@ -120,10 +120,10 @@ static VOID CALLBACK TrayIconAutoHideTimer(HWND hwnd, UINT, UINT_PTR idEvent, DW
int cliTrayIconPauseAutoHide(WPARAM, LPARAM)
{
- if (db_get_b(0, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
+ if (g_plugin.getByte("AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
if (GetActiveWindow() != g_clistApi.hwndContactList && GetWindow(GetParent(GetActiveWindow()), GW_OWNER) != g_clistApi.hwndContactList) {
KillTimer(nullptr, autoHideTimerId);
- autoHideTimerId = CLUI_SafeSetTimer(nullptr, 0, 1000 * db_get_w(0, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
+ autoHideTimerId = CLUI_SafeSetTimer(nullptr, 0, 1000 * g_plugin.getWord("HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
}
}
@@ -143,7 +143,7 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
break;
case TIM_CALLBACK:
- if ((GetAsyncKeyState(VK_CONTROL) & 0x8000) && msg->lParam == WM_LBUTTONDOWN && !db_get_b(0, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT)) {
+ if ((GetAsyncKeyState(VK_CONTROL) & 0x8000) && msg->lParam == WM_LBUTTONDOWN && !g_plugin.getByte("Tray1Click", SETTING_TRAY1CLICK_DEFAULT)) {
POINT pt;
HMENU hMenu = Menu_GetStatusMenu();
g_mutex_bOnTrayRightClick = 1;
@@ -169,9 +169,9 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
{
HWND h1 = (HWND)msg->lParam;
HWND h2 = h1 ? GetParent(h1) : nullptr;
- if (db_get_b(0, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
+ if (g_plugin.getByte("AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
if (LOWORD(msg->wParam) == WA_INACTIVE && h2 != g_clistApi.hwndContactList)
- autoHideTimerId = CLUI_SafeSetTimer(nullptr, 0, 1000 * db_get_w(0, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
+ autoHideTimerId = CLUI_SafeSetTimer(nullptr, 0, 1000 * g_plugin.getWord("HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
else {
KillTimer(nullptr, autoHideTimerId);
autoHideTimerId = 0;
@@ -216,47 +216,47 @@ VOID CALLBACK cliTrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD)
void SettingsMigrate(void)
{
- BYTE TrayIcon = db_get_b(0, "CList", "TrayIcon", 0);
- BYTE AlwaysPrimary = db_get_b(0, "CList", "AlwaysPrimary", 0);
- BYTE AlwaysMulti = db_get_b(0, "CList", "AlwaysMulti", 0);
- ptrA PrimaryStatus(db_get_sa(0, "CList", "PrimaryStatus"));
+ BYTE TrayIcon = g_plugin.getByte("TrayIcon");
+ BYTE AlwaysPrimary = g_plugin.getByte("AlwaysPrimary");
+ BYTE AlwaysMulti = g_plugin.getByte("AlwaysMulti");
+ ptrA PrimaryStatus(g_plugin.getStringA("PrimaryStatus"));
// these strings must always be set
if (PrimaryStatus) {
- db_set_s(0, "CList", "tiAccS", PrimaryStatus);
- db_set_s(0, "CList", "tiAccV", PrimaryStatus);
+ g_plugin.setString("tiAccS", PrimaryStatus);
+ g_plugin.setString("tiAccV", PrimaryStatus);
}
else {
- db_set_s(0, "CList", "tiAccS", "");
- db_set_s(0, "CList", "tiAccV", "");
+ g_plugin.setString("tiAccS", "");
+ g_plugin.setString("tiAccV", "");
}
switch (TrayIcon) {
case 0: // global or single acc
if (AlwaysPrimary) {
if (!PrimaryStatus) { // global always
- db_set_b(0, "CList", "tiModeS", TRAY_ICON_MODE_GLOBAL);
- db_set_b(0, "CList", "tiModeV", TRAY_ICON_MODE_GLOBAL);
+ g_plugin.setByte("tiModeS", TRAY_ICON_MODE_GLOBAL);
+ g_plugin.setByte("tiModeV", TRAY_ICON_MODE_GLOBAL);
}
else { // single acc always
- db_set_b(0, "CList", "tiModeS", TRAY_ICON_MODE_ACC);
- db_set_b(0, "CList", "tiModeV", TRAY_ICON_MODE_ACC);
+ g_plugin.setByte("tiModeS", TRAY_ICON_MODE_ACC);
+ g_plugin.setByte("tiModeV", TRAY_ICON_MODE_ACC);
}
}
else {
- db_set_b(0, "CList", "tiModeS", TRAY_ICON_MODE_GLOBAL);
- db_set_b(0, "CList", "tiModeV", (PrimaryStatus) ? TRAY_ICON_MODE_ACC : TRAY_ICON_MODE_GLOBAL);
+ g_plugin.setByte("tiModeS", TRAY_ICON_MODE_GLOBAL);
+ g_plugin.setByte("tiModeV", (PrimaryStatus) ? TRAY_ICON_MODE_ACC : TRAY_ICON_MODE_GLOBAL);
}
break;
case 1: // cycle
- db_set_b(0, "CList", "tiModeS", TRAY_ICON_MODE_CYCLE);
- db_set_b(0, "CList", "tiModeV", TRAY_ICON_MODE_CYCLE);
+ g_plugin.setByte("tiModeS", TRAY_ICON_MODE_CYCLE);
+ g_plugin.setByte("tiModeV", TRAY_ICON_MODE_CYCLE);
break;
case 2: // multiple
- db_set_b(0, "CList", "tiModeS", (AlwaysMulti) ? TRAY_ICON_MODE_ALL : TRAY_ICON_MODE_GLOBAL);
- db_set_b(0, "CList", "tiModeV", TRAY_ICON_MODE_ALL);
+ g_plugin.setByte("tiModeS", (AlwaysMulti) ? TRAY_ICON_MODE_ALL : TRAY_ICON_MODE_GLOBAL);
+ g_plugin.setByte("tiModeV", TRAY_ICON_MODE_ALL);
break;
}
}
@@ -303,7 +303,7 @@ int cliTrayIconInit(HWND hwnd)
}
// Присутствуют ли в базе новые настройки? Если да, то обновление не нужно.
- if (-1 == db_get_b(0, "CList", "tiModeS", -1))
+ if (-1 == g_plugin.getByte("tiModeS", -1))
SettingsMigrate();
// Нужно узнать количество годных аккаунтов и неодинаковость их статусов.
@@ -320,9 +320,9 @@ int cliTrayIconInit(HWND hwnd)
BYTE Mode;
if (!bDiffers) // all equal
- OldMode = Mode = db_get_b(0, "CList", "tiModeS", TRAY_ICON_MODE_GLOBAL);
+ OldMode = Mode = g_plugin.getByte("tiModeS", TRAY_ICON_MODE_GLOBAL);
else
- OldMode = Mode = db_get_b(0, "CList", "tiModeV", TRAY_ICON_MODE_GLOBAL);
+ OldMode = Mode = g_plugin.getByte("tiModeV", TRAY_ICON_MODE_GLOBAL);
// Некоторые режимы всегда показывают единственную иконку.
if (Mode < 8)
@@ -338,7 +338,7 @@ int cliTrayIconInit(HWND hwnd)
case TRAY_ICON_MODE_ACC:
{
- ptrA szProto(db_get_sa(0, "CList", (!bDiffers) ? "tiAccS" : "tiAccV"));
+ ptrA szProto(g_plugin.getStringA((!bDiffers) ? "tiAccS" : "tiAccV"));
if (!szProto)
break;
@@ -356,7 +356,7 @@ int cliTrayIconInit(HWND hwnd)
cliTrayCycleTimerProc(nullptr, 0, 0, 0); // force icon update
// Не сохраняем ID таймера в pcli, чтобы fnTrayIconUpdateBase не убивала его.
- TimerID = CLUI_SafeSetTimer(nullptr, 0, db_get_w(0, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, cliTrayCycleTimerProc);
+ TimerID = CLUI_SafeSetTimer(nullptr, 0, g_plugin.getWord("CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, cliTrayCycleTimerProc);
break;
case TRAY_ICON_MODE_ALL:
@@ -384,7 +384,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int)
GetGoodAccNum(&bDiffers, &bConn);
// if the icon number to be changed, reinitialize module from scratch
- BYTE Mode = db_get_b(0, "CList", (!bDiffers) ? "tiModeS" : "tiModeV", TRAY_ICON_MODE_GLOBAL);
+ BYTE Mode = g_plugin.getByte((!bDiffers) ? "tiModeS" : "tiModeV", TRAY_ICON_MODE_GLOBAL);
if (Mode != OldMode) {
OldMode = Mode;
Clist_TrayIconIconsChanged();
@@ -402,7 +402,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int)
case TRAY_ICON_MODE_ACC:
// В этом режиме показывается иконка совершенно определённого аккаунта, и не всегда это szChangedProto.
{
- ptrA szProto(db_get_sa(0, "CList", bDiffers ? "tiAccV" : "tiAccS"));
+ ptrA szProto(g_plugin.getStringA(bDiffers ? "tiAccV" : "tiAccS"));
if (szProto == nullptr)
break;
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 25949d6a19..4c32578dd9 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -191,12 +191,12 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM, LPARAM)
MCONTACT hItem = (MCONTACT)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
Menu_ShowItem(hRenameMenuItem, hItem != 0);
- if (!hItem || !IsHContactContact(hItem) || !db_get_b(0, "CList", "AvatarsShow", SETTINGS_SHOWAVATARS_DEFAULT)) {
+ if (!hItem || !IsHContactContact(hItem) || !g_plugin.getByte("AvatarsShow", SETTINGS_SHOWAVATARS_DEFAULT)) {
Menu_ShowItem(hShowAvatarMenuItem, false);
Menu_ShowItem(hHideAvatarMenuItem, false);
}
else {
- bool bHideAvatar = db_get_b(hItem, "CList", "HideContactAvatar", 0) != 0;
+ bool bHideAvatar = g_plugin.getByte(hItem, "HideContactAvatar") != 0;
Menu_ShowItem(hShowAvatarMenuItem, bHideAvatar);
Menu_ShowItem(hHideAvatarMenuItem, !bHideAvatar);
}
@@ -222,7 +222,7 @@ INT_PTR CLUI::Service_ShowStatusMenu(WPARAM, LPARAM)
INT_PTR CLUI::Service_Menu_ShowContactAvatar(WPARAM hContact, LPARAM)
{
- db_set_b(hContact, "CList", "HideContactAvatar", 0);
+ g_plugin.setByte(hContact, "HideContactAvatar", 0);
Clist_Broadcast(INTM_AVATARCHANGED, hContact, 0);
return 0;
@@ -230,7 +230,7 @@ INT_PTR CLUI::Service_Menu_ShowContactAvatar(WPARAM hContact, LPARAM)
INT_PTR CLUI::Service_Menu_HideContactAvatar(WPARAM hContact, LPARAM)
{
- db_set_b(hContact, "CList", "HideContactAvatar", 1);
+ g_plugin.setByte(hContact, "HideContactAvatar", 1);
Clist_Broadcast(INTM_AVATARCHANGED, hContact, 0);
return 0;
@@ -275,10 +275,10 @@ m_hDwmapiDll(nullptr)
LoadCLUIFramesModule();
g_CluiData.boldHideOffline = -1;
- bOldHideOffline = db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
+ bOldHideOffline = g_plugin.getByte("HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
g_CluiData.bOldUseGroups = -1;
- bOldUseGroups = db_get_b(0, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT);
+ bOldUseGroups = g_plugin.getByte("UseGroups", SETTING_USEGROUPS_DEFAULT);
}
CLUI::~CLUI()
@@ -338,9 +338,9 @@ HRESULT CLUI::CreateCLCWindow(const HWND hwndClui)
{
g_clistApi.hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"",
WS_CHILD | WS_CLIPCHILDREN | CLS_CONTACTLIST
- | (db_get_b(0, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
- | (db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0)
- | (db_get_b(0, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? CLS_HIDEEMPTYGROUPS : 0
+ | (g_plugin.getByte("UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
+ | (g_plugin.getByte("HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0)
+ | (g_plugin.getByte("HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? CLS_HIDEEMPTYGROUPS : 0
| CLS_MULTICOLUMN),
0, 0, 0, 0, hwndClui, nullptr, g_plugin.getInst(), nullptr);
@@ -496,13 +496,13 @@ int CLUI_ShowWindowMod(HWND hWnd, int nCmd)
}
if (!g_mutex_bChangingMode && !g_CluiData.fLayered) {
- if (nCmd == SW_HIDE && db_get_b(0, "CList", "WindowShadow", SETTING_WINDOWSHADOW_DEFAULT)) {
+ if (nCmd == SW_HIDE && g_plugin.getByte("WindowShadow", SETTING_WINDOWSHADOW_DEFAULT)) {
ShowWindow(hWnd, SW_MINIMIZE); // removing of shadow
return ShowWindow(hWnd, nCmd);
}
if (nCmd == SW_RESTORE && g_CluiData.fSmoothAnimation && !g_bTransparentFlag) {
- if (db_get_b(0, "CList", "WindowShadow", SETTING_WINDOWSHADOW_DEFAULT))
+ if (g_plugin.getByte("WindowShadow", SETTING_WINDOWSHADOW_DEFAULT))
CLUI_SmoothAlphaTransition(hWnd, 255, 1);
else {
int ret = ShowWindow(hWnd, nCmd);
@@ -600,7 +600,7 @@ void CLUI_ChangeWindowMode()
if (!g_clistApi.hwndContactList) return;
g_mutex_bChangingMode = TRUE;
- g_bTransparentFlag = db_get_b(0, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT);
+ g_bTransparentFlag = g_plugin.getByte("Transparent", SETTING_TRANSPARENT_DEFAULT);
g_CluiData.fSmoothAnimation = db_get_b(0, "CLUI", "FadeInOut", SETTING_FADEIN_DEFAULT) != 0;
if (g_bTransparentFlag == 0 && g_CluiData.bCurrentAlpha != 0)
g_CluiData.bCurrentAlpha = 255;
@@ -609,12 +609,12 @@ void CLUI_ChangeWindowMode()
if (!g_CluiData.fLayered) {
style = 0;
styleEx = 0;
- if (db_get_b(0, "CList", "ThinBorder", SETTING_THINBORDER_DEFAULT) || (db_get_b(0, "CList", "NoBorder", SETTING_NOBORDER_DEFAULT))) {
- style = WS_CLIPCHILDREN | (db_get_b(0, "CList", "ThinBorder", SETTING_THINBORDER_DEFAULT) ? WS_BORDER : 0);
+ if (g_plugin.getByte("ThinBorder", SETTING_THINBORDER_DEFAULT) || (g_plugin.getByte("NoBorder", SETTING_NOBORDER_DEFAULT))) {
+ style = WS_CLIPCHILDREN | (g_plugin.getByte("ThinBorder", SETTING_THINBORDER_DEFAULT) ? WS_BORDER : 0);
styleEx = WS_EX_TOOLWINDOW;
styleMaskEx |= WS_EX_APPWINDOW;
}
- else if (db_get_b(0, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) && db_get_b(0, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT)) {
+ else if (db_get_b(0, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) && g_plugin.getByte("ToolWindow", SETTING_TOOLWINDOW_DEFAULT)) {
styleEx = WS_EX_TOOLWINDOW/*|WS_EX_WINDOWEDGE*/;
style = WS_CAPTION | WS_POPUPWINDOW | WS_CLIPCHILDREN | WS_THICKFRAME;
styleMaskEx |= WS_EX_APPWINDOW;
@@ -640,7 +640,7 @@ void CLUI_ChangeWindowMode()
// 4 - Set Title
wchar_t titleText[255] = { 0 };
DBVARIANT dbv;
- if (db_get_ws(0, "CList", "TitleText", &dbv))
+ if (g_plugin.getWString("TitleText", &dbv))
wcsncpy_s(titleText, _A2W(MIRANDANAME), _TRUNCATE);
else {
wcsncpy_s(titleText, dbv.pwszVal, _TRUNCATE);
@@ -650,7 +650,7 @@ void CLUI_ChangeWindowMode()
// < ->
// 1 - If visible store it and hide
- if (g_CluiData.fLayered && (db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT))) {
+ if (g_CluiData.fLayered && (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT))) {
SetParent(g_clistApi.hwndContactList, nullptr);
Sync(CLUIFrames_SetParentForContainers, (HWND)nullptr);
UpdateWindow(g_clistApi.hwndContactList);
@@ -681,11 +681,11 @@ void CLUI_ChangeWindowMode()
else
SetMenu(g_clistApi.hwndContactList, g_clistApi.hMenuMain);
- if (g_CluiData.fLayered && (db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT)))
+ if (g_CluiData.fLayered && (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT)))
ske_UpdateWindowImage();
// 6 - Pin to desktop mode
- if (db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
+ if (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
HWND hProgMan = FindWindow(L"Progman", nullptr);
if (IsWindow(hProgMan)) {
SetParent(g_clistApi.hwndContactList, hProgMan);
@@ -1211,12 +1211,12 @@ void CLUI_cli_LoadCluiGlobalOpts()
BOOL tLayeredFlag = TRUE;
tLayeredFlag &= db_get_b(0, "ModernData", "EnableLayering", tLayeredFlag);
if (tLayeredFlag) {
- if (db_get_b(0, "CList", "WindowShadow", SETTING_WINDOWSHADOW_DEFAULT) == 1)
- db_set_b(0, "CList", "WindowShadow", 2);
+ if (g_plugin.getByte("WindowShadow", SETTING_WINDOWSHADOW_DEFAULT) == 1)
+ g_plugin.setByte("WindowShadow", 2);
}
else {
- if (db_get_b(0, "CList", "WindowShadow", SETTING_WINDOWSHADOW_DEFAULT) == 2)
- db_set_b(0, "CList", "WindowShadow", 1);
+ if (g_plugin.getByte("WindowShadow", SETTING_WINDOWSHADOW_DEFAULT) == 2)
+ g_plugin.setByte("WindowShadow", 1);
}
corecli.pfnLoadCluiGlobalOpts();
}
@@ -1235,7 +1235,7 @@ int CLUI_TestCursorOnBorders()
if (CLUI_CheckOwnedByClui(hAux)) {
if (g_bTransparentFlag) {
if (!bTransparentFocus && gf != hwnd) {
- CLUI_SmoothAlphaTransition(hwnd, db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), 1);
+ CLUI_SmoothAlphaTransition(hwnd, g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT), 1);
bTransparentFocus = 1;
CLUI_SafeSetTimer(hwnd, TM_AUTOALPHA, 250, nullptr);
}
@@ -1658,11 +1658,11 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam)
Sync(CLUIFrames_OnMoving, m_hWnd, &rc);
if (!IsIconic(m_hWnd)) {
if (!Clist_IsDocked()) { // if g_CluiData.fDocked, dont remember pos (except for width)
- db_set_dw(0, "CList", "Height", (DWORD)(rc.bottom - rc.top));
- db_set_dw(0, "CList", "x", (DWORD)rc.left);
- db_set_dw(0, "CList", "y", (DWORD)rc.top);
+ g_plugin.setDword("Height", (DWORD)(rc.bottom - rc.top));
+ g_plugin.setDword("x", (DWORD)rc.left);
+ g_plugin.setDword("y", (DWORD)rc.top);
}
- db_set_dw(0, "CList", "Width", (DWORD)(rc.right - rc.left));
+ g_plugin.setDword("Width", (DWORD)(rc.right - rc.left));
}
}
return TRUE;
@@ -1695,12 +1695,12 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam)
// if g_CluiData.fDocked, dont remember pos (except for width)
if (!Clist_IsDocked()) {
- db_set_dw(0, "CList", "Height", (DWORD)(rc.bottom - rc.top));
- db_set_dw(0, "CList", "x", (DWORD)rc.left);
- db_set_dw(0, "CList", "y", (DWORD)rc.top);
+ g_plugin.setDword("Height", (DWORD)(rc.bottom - rc.top));
+ g_plugin.setDword("x", (DWORD)rc.left);
+ g_plugin.setDword("y", (DWORD)rc.top);
}
else SetWindowRgn(m_hWnd, nullptr, 0);
- db_set_dw(0, "CList", "Width", (DWORD)(rc.right - rc.left));
+ g_plugin.setDword("Width", (DWORD)(rc.right - rc.left));
if (!g_CluiData.fLayered) {
HRGN hRgn1;
@@ -1721,11 +1721,11 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam)
}
}
else {
- if (db_get_b(0, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) {
+ if (g_plugin.getByte("Min2Tray", SETTING_MIN2TRAY_DEFAULT)) {
CLUI_ShowWindowMod(m_hWnd, SW_HIDE);
- db_set_b(0, "CList", "State", SETTING_STATE_HIDDEN);
+ g_plugin.setByte("State", SETTING_STATE_HIDDEN);
}
- else db_set_b(0, "CList", "State", SETTING_STATE_MINIMIZED);
+ else g_plugin.setByte("State", SETTING_STATE_MINIMIZED);
SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
}
return TRUE;
@@ -1874,7 +1874,7 @@ LRESULT CLUI::OnSetAllExtraIcons(UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*lPara
LRESULT CLUI::OnCreateClc(UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*lParam*/)
{
CreateCLC();
- if (db_get_b(0, "CList", "ShowOnStart", SETTING_SHOWONSTART_DEFAULT))
+ if (g_plugin.getByte("ShowOnStart", SETTING_SHOWONSTART_DEFAULT))
cliShowHide(true);
Clist_InitAutoRebuild(g_clistApi.hwndContactTree);
return FALSE;
@@ -1972,9 +1972,9 @@ LRESULT CLUI::OnAutoAlphaTimer(UINT, WPARAM, LPARAM)
// change
bTransparentFocus = inwnd;
if (bTransparentFocus)
- CLUI_SmoothAlphaTransition(m_hWnd, (BYTE)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), 1);
+ CLUI_SmoothAlphaTransition(m_hWnd, (BYTE)g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT), 1);
else
- CLUI_SmoothAlphaTransition(m_hWnd, (BYTE)(g_bTransparentFlag ? db_get_b(0, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT) : 255), 1);
+ CLUI_SmoothAlphaTransition(m_hWnd, (BYTE)(g_bTransparentFlag ? g_plugin.getByte("AutoAlpha", SETTING_AUTOALPHA_DEFAULT) : 255), 1);
}
if (!bTransparentFocus)
KillTimer(m_hWnd, TM_AUTOALPHA);
@@ -2083,11 +2083,11 @@ LRESULT CLUI::OnActivate(UINT msg, WPARAM wParam, LPARAM lParam)
CLUI_SafeSetTimer(m_hWnd, TM_AUTOALPHA, 250, nullptr);
}
else {
- if (!db_get_b(0, "CList", "OnTop", SETTING_ONTOP_DEFAULT))
+ if (!g_plugin.getByte("OnTop", SETTING_ONTOP_DEFAULT))
Sync(CLUIFrames_ActivateSubContainers, TRUE);
if (g_bTransparentFlag) {
KillTimer(m_hWnd, TM_AUTOALPHA);
- CLUI_SmoothAlphaTransition(m_hWnd, db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), 1);
+ CLUI_SmoothAlphaTransition(m_hWnd, g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT), 1);
bTransparentFocus = 1;
}
}
@@ -2095,9 +2095,9 @@ LRESULT CLUI::OnActivate(UINT msg, WPARAM wParam, LPARAM lParam)
if (g_bTransparentFlag) {
BYTE alpha;
if (wParam != WA_INACTIVE || CLUI_CheckOwnedByClui((HWND)lParam) || ((HWND)lParam == m_hWnd) || GetParent((HWND)lParam) == m_hWnd)
- alpha = db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT);
+ alpha = g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT);
else
- alpha = g_bTransparentFlag ? db_get_b(0, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT) : 255;
+ alpha = g_bTransparentFlag ? g_plugin.getByte("AutoAlpha", SETTING_AUTOALPHA_DEFAULT) : 255;
CLUI_SmoothAlphaTransition(m_hWnd, alpha, 1);
return 1;
}
@@ -2110,7 +2110,7 @@ LRESULT CLUI::OnSetCursor(UINT, WPARAM, LPARAM)
if (g_CluiData.nBehindEdgeState >= 0) CLUI_UpdateTimer();
if (g_bTransparentFlag) {
if (!bTransparentFocus && gf != m_hWnd) {
- CLUI_SmoothAlphaTransition(m_hWnd, db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), 1);
+ CLUI_SmoothAlphaTransition(m_hWnd, g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT), 1);
bTransparentFocus = 1;
CLUI_SafeSetTimer(m_hWnd, TM_AUTOALPHA, 250, nullptr);
}
@@ -2183,7 +2183,7 @@ LRESULT CLUI::OnShowWindow(UINT, WPARAM wParam, LPARAM lParam)
if (lParam) return 0;
if (mutex_bShowHideCalledFromAnimation) return 1;
- BYTE gAlpha = (!wParam) ? 0 : (db_get_b(0, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT) ? db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT) : 255);
+ BYTE gAlpha = (!wParam) ? 0 : (g_plugin.getByte("Transparent", SETTING_TRANSPARENT_DEFAULT) ? g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT) : 255);
if (wParam) {
g_CluiData.bCurrentAlpha = 0;
Sync(CLUIFrames_OnShowHide, 1);
@@ -2205,7 +2205,7 @@ LRESULT CLUI::OnSysCommand(UINT msg, WPARAM wParam, LPARAM lParam)
}
DefWindowProc(m_hWnd, msg, wParam, lParam);
- if (db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT))
+ if (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT))
Sync(CLUIFrames_ActivateSubContainers, TRUE);
return FALSE;
}
@@ -2473,7 +2473,7 @@ LRESULT CLUI::OnDrawItem(UINT, WPARAM, LPARAM lParam)
LRESULT CLUI::OnDestroy(UINT, WPARAM, LPARAM)
{
- int state = db_get_b(0, "CList", "State", SETTING_STATE_NORMAL);
+ int state = g_plugin.getByte("State", SETTING_STATE_NORMAL);
BOOL wait = FALSE;
AniAva_UnloadModule();
@@ -2519,14 +2519,14 @@ LRESULT CLUI::OnDestroy(UINT, WPARAM, LPARAM)
r.top = r.bottom - CLUIFrames_GetTotalHeight();
else
r.bottom = r.top + CLUIFrames_GetTotalHeight();
- db_set_dw(0, "CList", "y", r.top);
- db_set_dw(0, "CList", "Height", r.bottom - r.top);
+ g_plugin.setDword("y", r.top);
+ g_plugin.setDword("Height", r.bottom - r.top);
}
UnLoadCLUIFramesModule();
//ExtFrames_Uninit();
TRACE("CLUI.c: WM_DESTROY - UnLoadCLUIFramesModule DONE\n");
- db_set_b(0, "CList", "State", (BYTE)state);
+ g_plugin.setByte("State", (BYTE)state);
ske_UnloadSkin(&g_SkinObjectList);
delete m_pCLUI;
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp
index bbd309e280..2ea455d701 100644
--- a/plugins/Clist_modern/src/modern_contact.cpp
+++ b/plugins/Clist_modern/src/modern_contact.cpp
@@ -159,7 +159,7 @@ INT_PTR SetUseGroups(WPARAM wParam, LPARAM)
if (!newVal == (int)wParam) return 0;
newVal = wParam;
}
- db_set_b(0, "CList", "UseGroups", (BYTE)newVal);
+ g_plugin.setByte("UseGroups", (BYTE)newVal);
SendMessage(g_clistApi.hwndContactTree, CLM_SETUSEGROUPS, newVal, 0);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_defsettings.h b/plugins/Clist_modern/src/modern_defsettings.h
index e40f532d2f..381486b1b6 100644
--- a/plugins/Clist_modern/src/modern_defsettings.h
+++ b/plugins/Clist_modern/src/modern_defsettings.h
@@ -30,200 +30,200 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#pragma once
-#define SETTING_TOOLWINDOW_DEFAULT 1 //"CList","ToolWindow"
-#define SETTING_ONTOP_DEFAULT 1 //"CList","OnTop"
-#define SETTING_MIN2TRAY_DEFAULT 1 //"CList","Min2Tray"
-#define SETTING_HIDEOFFLINE_DEFAULT 0 //"CList", "HideOffline"
-#define SETTING_HIDEEMPTYGROUPS_DEFAULT 0 //"CList","HideEmptyGroups"
-#define SETTING_USEGROUPS_DEFAULT 1 //"CList","UseGroups"
-#define SETTING_PLACEOFFLINETOROOT_DEFAULT 0 //"CList","PlaceOfflineToRoot"
-#define SETTING_DISABLETRAYFLASH_DEFAULT 0 //! "CList","DisableTrayFlash"
-#define SETTING_ICONFLASHTIME_DEFAULT 550 //! "CList","IconFlashTime"
-#define SETTING_THINBORDER_DEFAULT 0 //! "CList","ThinBorder"
-#define SETTING_NOBORDER_DEFAULT 0 //! "CList","NoBorder"
-#define SETTING_WINDOWSHADOW_DEFAULT 0 //! "CList","WindowShadow"
-#define SETTING_ONDESKTOP_DEFAULT 0 //! "CList","OnDesktop"
-#define SETTING_DISABLEWORKINGSET_DEFAULT 1 //! "CList","DisableWorkingSet"
-#define SETTING_NOICONBLINF_DEFAULT 0 //! "CList","NoIconBlink"
-#define SETTING_ALWAYSVISICON_DEFAULT 0 //! "CList","AlwaysShowAlwaysVisIcon"
-
-#define SETTING_SHOWMAINMENU_DEFAULT 1 //"CLUI","ShowMainMenu"
-#define SETTING_SHOWCAPTION_DEFAULT 1 //"CLUI","ShowCaption"
-#define SETTING_CLIENTDRAG_DEFAULT 1 //"CLUI","ClientAreaDrag"
-#define SETTING_SHOWSBAR_DEFAULT 1 //! "CLUI","ShowSBar"
-#define SETTING_SBARPERPROTO_DEFAULT 0 //! "CLUI","SBarPerProto"
-#define SETTING_USECONNECTINGICON_DEFAULT 1 //! "CLUI","UseConnectingIcon"
-#define SETTING_SHOWXSTATUS_DEFAULT 6 //! "CLUI","ShowXStatus"
-#define SETTING_SHOWUNREADEMAILS_DEFAULT 1 //! "CLUI","ShowUnreadEmails"
-#define SETTING_SBARSHOW_DEFAULT 3 //! "CLUI","SBarShow"
-#define SETTING_SBARACCOUNTISCUSTOM_DEFAULT 0 //! "CLUI","AccountIsCustom"
-#define SETTING_SBARHIDEACCOUNT_DEFAULT 0 //! "CLUI","HideAccount"
-#define SETTING_SBARRIGHTCLK_DEFAULT 0 //! "CLUI","SBarRightClk"
-#define SETTING_EQUALSECTIONS_DEFAULT 0 //! "CLUI","EqualSections"
-#define SETTING_LEFTOFFSET_DEFAULT 0 //! "CLUI","LeftOffset"
-#define SETTING_RIGHTOFFSET_DEFAULT 0 //! "CLUI","RightOffset
-#define SETTING_TOPOFFSET_DEFAULT 0 //! "CLUI","TopOffset"
-#define SETTING_BOTTOMOFFSET_DEFAULT 0 //! "CLUI","BottomOffset
-#define SETTING_SPACEBETWEEN_DEFAULT 0 //! "CLUI","SpaceBetween"
-#define SETTING_ALIGN_DEFAULT 0 //! "CLUI","Align"
-#define SETTING_VALIGN_DEFAULT 1 //! "CLUI","VAlign"
-#define SETTING_PADDINGLEFT_DEFAULT 0 //! "CLUI","PaddingLeft_*"
-#define SETTING_PADDINGRIGHT_DEFAULT 0 //! "CLUI","PaddingRight_*"
-#define SETTING_DRAGTOSCROLL_DEFAULT 0 //! "CLUI","DragToScroll"
-#define SETTING_AUTOSIZE_DEFAULT 0 //! "CLUI","AutoSize"
-#define SETTING_LOCKSIZE_DEFAULT 0 //! "CLUI","LockSize"
-#define SETTING_MINHEIGTH_DEFAULT 0 //! "CLUI","MinHeight"
-#define SETTING_MINWIDTH_DEFAULT 18 //! "CLUI","MinWidth"
-#define SETTING_MAXSIZEHEIGHT_DEFAULT 75 //! "CLUI","MaxSizeHeight"
-#define SETTING_MINSIZEHEIGHT_DEFAULT 10 //! "CLUI","MinSizeHeight"
-#define SETTING_AUTOSIZEUPWARD_DEFAULT 0 //! "CLUI","AutoSizeUpward"
-#define SETTING_SNAPTOEDGES_DEFAULT 1 //! "CLUI","SnapToEdges"
-#define SETTING_DOCKTOSIDES_DEFAULT 1 //! "CLUI","DockToSides",
-
-#define SETTING_PROTOSPERLINE_DEFAULT 0 //! "CLUI","StatusBarProtosPerLine"
-#define SETTING_TEXTEFFECTID_DEFAULT 0xFF //! "StatusBar","TextEffectID"
-#define SETTING_TEXTEFFECTCOLOR1_DEFAULT 0 //! "StatusBar","TextEffectColor1"
-#define SETTING_TEXTEFFECTCOLOR2_DEFAULT 0 //! "StatusBar","TextEffectColor2"
-#define SETTING_SBHILIGHTMODE_DEFAULT 0 //! "StatusBar","HiLightMode"
-#define SETTING_HIDETOOLTIPTIME_DEFAULT 5000 //! "CLUIFrames","HideToolTipTime"
-
-#define SETTING_EXTRACOLUMNSPACE_DEFAULT 18 //! "CLUI","ExtraColumnSpace"
-
-#define SETTING_HIDEBEHIND_DEFAULT 0 //! "ModernData","HideBehind" //(0-none, 1-leftedge, 2-rightedge)
-#define SETTING_BEHINDEDGE_DEFAULT 0 //! "ModernData", "BehindEdge"
-#define SETTING_SHOWDELAY_DEFAULT 3 //! "ModernData","ShowDelay"
-#define SETTING_HIDEDELAY_DEFAULT 3 //! "ModernData","HideDelay"
-#define SETTING_HIDEBEHINDBORDERSIZE_DEFAULT 0 //! "ModernData","HideBehindBorderSize"
-#define SETTING_AEROGLASS_DEFAULT 0 //! "ModernData","AeroGlass"
-
-#define SETTING_ROUNDCORNERS_DEFAULT 0 //! "CLC","RoundCorners"
-#define SETTING_GAPFRAMES_DEFAULT 1 //! "CLUIFrames","GapBetweenFrames"
-#define SETTING_GAPTITLEBAR_DEFAULT 1 //! "CLUIFrames","GapBetweenTitleBar"
-#define SETTING_LEFTCLIENTMARIGN_DEFAULT 0 //! "CLUI","LeftClientMargin"
-#define SETTING_RIGHTCLIENTMARIGN_DEFAULT 0 //! "CLUI","RightClientMargin"
-#define SETTING_TOPCLIENTMARIGN_DEFAULT 0 //! "CLUI","TopClientMargin"
-#define SETTING_BOTTOMCLIENTMARIGN_DEFAULT 0 //! "CLUI","BottomClientMargin"
-#define SETTING_KEYCOLOR_DEFAULT RGB(255,0,255) //! "ModernSettings","KeyColor"
-#define SETTING_LINEUNDERMENU_DEFAULT 0 //! "CLUI","LineUnderMenu"
-#define SETTING_SHOWONSTART_DEFAULT 0 //! "CList","ShowOnStart"
-
-#define SETTING_INTERNALAWAYMSGREQUEST_DEFAULT 1 //"ModernData","InternalAwayMsgDiscovery"
-#define SETTING_REMOVEAWAYMSGFOROFFLINE_DEFAULT 1 //"ModernData","RemoveAwayMessageForOffline"
-#define SETTING_FILTERSEARCH_DEFAULT 0 //"ModernData","FilterSearch"
-#define SETTING_METAAVOIDDBLCLICK_DEFAULT 1 //"CLC","MetaDoubleClick"
-#define SETTING_METAIGNOREEMPTYEXTRA_DEFAULT 1 //"CLC","MetaIgnoreEmptyExtra"
-#define SETTING_METAHIDEEXTRA_DEFAULT 0 //"CLC","MetaHideExtra"
-#define SETTING_METAEXPANDING_DEFAULT 1 //"CLC","MetaExpanding"
-#define SETTING_USEMETAICON_DEFAULT 1 //"CLC","Meta"
-#define SETTING_DRAWOVERLAYEDSTATUS_DEFAULT 3 //todo replace by contstants
-
-
-#define SETTING_SORTBY1_DEFAULT SORTBY_RATE //"CList","SortBy1"
-#define SETTING_SORTBY2_DEFAULT SORTBY_NAME_LOCALE //"CList","SortBy2"
-#define SETTING_SORTBY3_DEFAULT SORTBY_PROTO //"CList","SortBy3"
-
-#define SETTING_NOOFFLINEBOTTOM_DEFAULT 0 //"CList","NoOfflineBottom"
-#define SETTING_HIDEOFFLINEATROOT_DEFAULT 0 //"CLC","HideOfflineRoot"
-#define SETTING_HILIGHTMODE_DEFAULT 1 //todo replace by constant //"CLC","HiLightMode"
-
-#define SETTING_DISABLESKIN_DEFAULT 0 //"ModernData","DisableEngine"
-#define SETTING_ENABLELAYERING_DEFAULT 1 //! "ModernData","EnableLayering"
-#define SETTING_COMPACTMODE_DEFAULT 0 //"CLC","CompactMode"
-
-#define SETTING_EVENTAREAMODE_DEFAULT 1 //autohide todo replace by const //"CLUI","EventArea"
-#define SETTING_SHOWEVENTAREAFRAME_DEFAULT 1 //"CLUI","ShowEventArea"
-
-#define SETTING_TRAYOPTION_DEFAULT 15 //show combined icon
-#define SETTING_FADEIN_DEFAULT 0 //"CLUI","FadeInOut"
+#define SETTING_TOOLWINDOW_DEFAULT 1 // "CList","ToolWindow"
+#define SETTING_ONTOP_DEFAULT 1 // "CList","OnTop"
+#define SETTING_MIN2TRAY_DEFAULT 1 // "CList","Min2Tray"
+#define SETTING_HIDEOFFLINE_DEFAULT 0 // "CList", "HideOffline"
+#define SETTING_HIDEEMPTYGROUPS_DEFAULT 0 // "CList","HideEmptyGroups"
+#define SETTING_USEGROUPS_DEFAULT 1 // "CList","UseGroups"
+#define SETTING_PLACEOFFLINETOROOT_DEFAULT 0 // "CList","PlaceOfflineToRoot"
+#define SETTING_DISABLETRAYFLASH_DEFAULT 0 // "CList","DisableTrayFlash"
+#define SETTING_ICONFLASHTIME_DEFAULT 550 // "CList","IconFlashTime"
+#define SETTING_THINBORDER_DEFAULT 0 // "CList","ThinBorder"
+#define SETTING_NOBORDER_DEFAULT 0 // "CList","NoBorder"
+#define SETTING_WINDOWSHADOW_DEFAULT 0 // "CList","WindowShadow"
+#define SETTING_ONDESKTOP_DEFAULT 0 // "CList","OnDesktop"
+#define SETTING_DISABLEWORKINGSET_DEFAULT 1 // "CList","DisableWorkingSet"
+#define SETTING_NOICONBLINF_DEFAULT 0 // "CList","NoIconBlink"
+#define SETTING_ALWAYSVISICON_DEFAULT 0 // "CList","AlwaysShowAlwaysVisIcon"
+
+#define SETTING_SHOWMAINMENU_DEFAULT 1 // "CLUI","ShowMainMenu"
+#define SETTING_SHOWCAPTION_DEFAULT 1 // "CLUI","ShowCaption"
+#define SETTING_CLIENTDRAG_DEFAULT 1 // "CLUI","ClientAreaDrag"
+#define SETTING_SHOWSBAR_DEFAULT 1 // "CLUI","ShowSBar"
+#define SETTING_SBARPERPROTO_DEFAULT 0 // "CLUI","SBarPerProto"
+#define SETTING_USECONNECTINGICON_DEFAULT 1 // "CLUI","UseConnectingIcon"
+#define SETTING_SHOWXSTATUS_DEFAULT 6 // "CLUI","ShowXStatus"
+#define SETTING_SHOWUNREADEMAILS_DEFAULT 1 // "CLUI","ShowUnreadEmails"
+#define SETTING_SBARSHOW_DEFAULT 3 // "CLUI","SBarShow"
+#define SETTING_SBARACCOUNTISCUSTOM_DEFAULT 0 // "CLUI","AccountIsCustom"
+#define SETTING_SBARHIDEACCOUNT_DEFAULT 0 // "CLUI","HideAccount"
+#define SETTING_SBARRIGHTCLK_DEFAULT 0 // "CLUI","SBarRightClk"
+#define SETTING_EQUALSECTIONS_DEFAULT 0 // "CLUI","EqualSections"
+#define SETTING_LEFTOFFSET_DEFAULT 0 // "CLUI","LeftOffset"
+#define SETTING_RIGHTOFFSET_DEFAULT 0 // "CLUI","RightOffset
+#define SETTING_TOPOFFSET_DEFAULT 0 // "CLUI","TopOffset"
+#define SETTING_BOTTOMOFFSET_DEFAULT 0 // "CLUI","BottomOffset
+#define SETTING_SPACEBETWEEN_DEFAULT 0 // "CLUI","SpaceBetween"
+#define SETTING_ALIGN_DEFAULT 0 // "CLUI","Align"
+#define SETTING_VALIGN_DEFAULT 1 // "CLUI","VAlign"
+#define SETTING_PADDINGLEFT_DEFAULT 0 // "CLUI","PaddingLeft_*"
+#define SETTING_PADDINGRIGHT_DEFAULT 0 // "CLUI","PaddingRight_*"
+#define SETTING_DRAGTOSCROLL_DEFAULT 0 // "CLUI","DragToScroll"
+#define SETTING_AUTOSIZE_DEFAULT 0 // "CLUI","AutoSize"
+#define SETTING_LOCKSIZE_DEFAULT 0 // "CLUI","LockSize"
+#define SETTING_MINHEIGTH_DEFAULT 0 // "CLUI","MinHeight"
+#define SETTING_MINWIDTH_DEFAULT 18 // "CLUI","MinWidth"
+#define SETTING_MAXSIZEHEIGHT_DEFAULT 75 // "CLUI","MaxSizeHeight"
+#define SETTING_MINSIZEHEIGHT_DEFAULT 10 // "CLUI","MinSizeHeight"
+#define SETTING_AUTOSIZEUPWARD_DEFAULT 0 // "CLUI","AutoSizeUpward"
+#define SETTING_SNAPTOEDGES_DEFAULT 1 // "CLUI","SnapToEdges"
+#define SETTING_DOCKTOSIDES_DEFAULT 1 // "CLUI","DockToSides",
+
+#define SETTING_PROTOSPERLINE_DEFAULT 0 // "CLUI","StatusBarProtosPerLine"
+#define SETTING_TEXTEFFECTID_DEFAULT 0xFF // "StatusBar","TextEffectID"
+#define SETTING_TEXTEFFECTCOLOR1_DEFAULT 0 // "StatusBar","TextEffectColor1"
+#define SETTING_TEXTEFFECTCOLOR2_DEFAULT 0 // "StatusBar","TextEffectColor2"
+#define SETTING_SBHILIGHTMODE_DEFAULT 0 // "StatusBar","HiLightMode"
+#define SETTING_HIDETOOLTIPTIME_DEFAULT 5000 // "CLUIFrames","HideToolTipTime"
+
+#define SETTING_EXTRACOLUMNSPACE_DEFAULT 18 // "CLUI","ExtraColumnSpace"
+
+#define SETTING_HIDEBEHIND_DEFAULT 0 // "ModernData","HideBehind" //(0-none, 1-leftedge, 2-rightedge)
+#define SETTING_BEHINDEDGE_DEFAULT 0 // "ModernData", "BehindEdge"
+#define SETTING_SHOWDELAY_DEFAULT 3 // "ModernData","ShowDelay"
+#define SETTING_HIDEDELAY_DEFAULT 3 // "ModernData","HideDelay"
+#define SETTING_HIDEBEHINDBORDERSIZE_DEFAULT 0 // "ModernData","HideBehindBorderSize"
+#define SETTING_AEROGLASS_DEFAULT 0 // "ModernData","AeroGlass"
+
+#define SETTING_ROUNDCORNERS_DEFAULT 0 // "CLC","RoundCorners"
+#define SETTING_GAPFRAMES_DEFAULT 1 // "CLUIFrames","GapBetweenFrames"
+#define SETTING_GAPTITLEBAR_DEFAULT 1 // "CLUIFrames","GapBetweenTitleBar"
+#define SETTING_LEFTCLIENTMARIGN_DEFAULT 0 // "CLUI","LeftClientMargin"
+#define SETTING_RIGHTCLIENTMARIGN_DEFAULT 0 // "CLUI","RightClientMargin"
+#define SETTING_TOPCLIENTMARIGN_DEFAULT 0 // "CLUI","TopClientMargin"
+#define SETTING_BOTTOMCLIENTMARIGN_DEFAULT 0 // "CLUI","BottomClientMargin"
+#define SETTING_KEYCOLOR_DEFAULT RGB(255,0,255) // "ModernSettings","KeyColor"
+#define SETTING_LINEUNDERMENU_DEFAULT 0 // "CLUI","LineUnderMenu"
+#define SETTING_SHOWONSTART_DEFAULT 0 // "CList","ShowOnStart"
+
+#define SETTING_INTERNALAWAYMSGREQUEST_DEFAULT 1 // "ModernData","InternalAwayMsgDiscovery"
+#define SETTING_REMOVEAWAYMSGFOROFFLINE_DEFAULT 1 // "ModernData","RemoveAwayMessageForOffline"
+#define SETTING_FILTERSEARCH_DEFAULT 0 // "ModernData","FilterSearch"
+#define SETTING_METAAVOIDDBLCLICK_DEFAULT 1 // "CLC","MetaDoubleClick"
+#define SETTING_METAIGNOREEMPTYEXTRA_DEFAULT 1 // "CLC","MetaIgnoreEmptyExtra"
+#define SETTING_METAHIDEEXTRA_DEFAULT 0 // "CLC","MetaHideExtra"
+#define SETTING_METAEXPANDING_DEFAULT 1 // "CLC","MetaExpanding"
+#define SETTING_USEMETAICON_DEFAULT 1 // "CLC","Meta"
+#define SETTING_DRAWOVERLAYEDSTATUS_DEFAULT 3 // todo replace by contstants
+
+
+#define SETTING_SORTBY1_DEFAULT SORTBY_RATE // "CList","SortBy1"
+#define SETTING_SORTBY2_DEFAULT SORTBY_NAME_LOCALE // "CList","SortBy2"
+#define SETTING_SORTBY3_DEFAULT SORTBY_PROTO // "CList","SortBy3"
+
+#define SETTING_NOOFFLINEBOTTOM_DEFAULT 0 // "CList","NoOfflineBottom"
+#define SETTING_HIDEOFFLINEATROOT_DEFAULT 0 // "CLC","HideOfflineRoot"
+#define SETTING_HILIGHTMODE_DEFAULT 1 // todo replace by constant //"CLC","HiLightMode"
+
+#define SETTING_DISABLESKIN_DEFAULT 0 // "ModernData","DisableEngine"
+#define SETTING_ENABLELAYERING_DEFAULT 1 // "ModernData","EnableLayering"
+#define SETTING_COMPACTMODE_DEFAULT 0 // "CLC","CompactMode"
+
+#define SETTING_EVENTAREAMODE_DEFAULT 1 // autohide todo replace by const //"CLUI","EventArea"
+#define SETTING_SHOWEVENTAREAFRAME_DEFAULT 1 // "CLUI","ShowEventArea"
+
+#define SETTING_TRAYOPTION_DEFAULT 15 // show combined icon
+#define SETTING_FADEIN_DEFAULT 0 // "CLUI","FadeInOut"
//////////////////////////////////////////////////////////////////////////
// ROW SETTINGS
-#define SETTING_ROWBORDER_DEFAULT 1 //"CList","RowBorder"
-#define SETTING_ROW_ADVANCEDLAYOUT_DEFAULT 0 //"ModernData","UseAdvancedRowLayout"
-#define SETTING_ROW_ROWBORDER_DEFAULT 1 //"CList","RowBorder"
-#define SETTING_VARIABLEROWHEIGHT_DEFAULT 1 //"CList","VariableRowHeight"
-#define SETTING_ALIGNLEFTTOLEFT_DEFAULT 1 //"CList","AlignLeftItemsToLeft"
-#define SETTING_ALIGNRIGHTORIGHT_DEFAULT 1 //"CList","AlignRightItemsToRight"
-#define SETTING_HIDEGROUPSICON_DEFAULT 0 //"CList","HideGroupsIcon"
-#define SETTING_ALIGNGROPCAPTION_DEFAULT 0 //left todo replace by const //"CList","AlignGroupCaptions"
+#define SETTING_ROWBORDER_DEFAULT 1 // "CList","RowBorder"
+#define SETTING_ROW_ADVANCEDLAYOUT_DEFAULT 0 // "ModernData","UseAdvancedRowLayout"
+#define SETTING_ROW_ROWBORDER_DEFAULT 1 // "CList","RowBorder"
+#define SETTING_VARIABLEROWHEIGHT_DEFAULT 1 // "CList","VariableRowHeight"
+#define SETTING_ALIGNLEFTTOLEFT_DEFAULT 1 // "CList","AlignLeftItemsToLeft"
+#define SETTING_ALIGNRIGHTORIGHT_DEFAULT 1 // "CList","AlignRightItemsToRight"
+#define SETTING_HIDEGROUPSICON_DEFAULT 0 // "CList","HideGroupsIcon"
+#define SETTING_ALIGNGROPCAPTION_DEFAULT 0 // left todo replace by const //"CList","AlignGroupCaptions"
#define SETTINS_ROWITEMORDER_DEFAULT {ITEM_AVATAR, ITEM_ICON, ITEM_TEXT, ITEM_CONTACT_TIME, ITEM_EXTRA_ICONS}
-#define SETTINGS_SHOWAVATARS_DEFAULT 0 //"CList","AvatarsShow"
-#define SETTINGS_AVATARDRAWBORDER_DEFAULT 0 //"CList","AvatarsDrawBorders"
-#define SETTINGS_AVATARBORDERCOLOR_DEFAULT RGB(0,0,0) //"CList","AvatarsBorderColor"
-#define SETTINGS_AVATARROUNDCORNERS_DEFAULT 0 //"CList","AvatarsRoundCorners"
-#define SETTINGS_AVATARUSECUTOMCORNERSIZE_DEFAULT 0 //"CList","AvatarsUseCustomCornerSize"
-#define SETTINGS_AVATARCORNERSIZE_DEFAULT 4 //"CList","AvatarsCustomCornerSize"
-#define SETTINGS_AVATARIGNORESIZEFORROW_DEFAULT 0 //"CList","AvatarsIgnoreSizeForRow"
-#define SETTINGS_AVATARDRAWOVERLAY_DEFAULT 0 //"CList","AvatarsDrawOverlay"
-#define SETTINGS_AVATAROVERLAYTYPE_DEFAULT SETTING_AVATAR_OVERLAY_TYPE_NORMAL
-#define SETTING_AVATARHEIGHT_DEFAULT 24 //"CList","AvatarsSize"
-#define SETTING_AVATARWIDTH_DEFAULT 24 //"CList","AvatarsWidth"
-#define SETTINGS_AVATARINSEPARATE_DEFAULT 0 //"CList","AvatarsInSeparateWnd",
-
-#define SETTING_HIDEICONONAVATAR_DEFAULT 0 //"CList","IconHideOnAvatar"
-#define SETTING_ICONONAVATARPLACE_DEFAULT 0 //"CList","IconDrawOnAvatarSpace"
-#define SETTING_ICONIGNORESIZE_DEFAULT 0 //"CList","IconIgnoreSizeForRownHeight"
-#define SETTING_SHOWTIME_DEFAULT 0 //"CList","ContactTimeShow"
-#define SETTING_SHOWTIMEIFDIFF_DEFAULT 1 //"CList","ContactTimeShowOnlyIfDifferent"
-
-#define SETTING_TEXT_RTL_DEFAULT 0 //"CList","TextRTL"
-#define SETTING_TEXT_RIGHTALIGN_DEFAULT 0 //"CList","TextAlignToRight"
-#define SETTING_TEXT_SMILEY_DEFAULT 1 //"CList","TextReplaceSmileys"
-#define SETTING_TEXT_RESIZESMILEY_DEFAULT 1 //"CList","TextResizeSmileys"
-#define SETTING_TEXT_PROTOSMILEY_DEFAULT 1 //"CList","TextUseProtocolSmileys"
-#define SETTING_TEXT_IGNORESIZE_DEFAULT 0 //"CList","TextIgnoreSizeForRownHeight"
-
-#define SETTING_FIRSTLINE_SMILEYS_DEFAULT 0 //"CList","FirstLineDrawSmileys"
-#define SETTING_FIRSTLINE_APPENDNICK_DEFAULT 0 //"CList","FirstLineAppendNick"
-#define SETTING_FIRSTLINE_TRIMTEXT_DEFAULT 1 //"CList","TrimText"
-
-#define SETTING_SECONDLINE_SHOW_DEFAULT 0 //"CList","SecondLineShow"
-#define SETTING_SECONDLINE_TOPSPACE_DEFAULT 2 //"CList","SecondLineTopSpace"
-#define SETTING_SECONDLINE_SMILEYS_DEFAULT 1 //"CList","SecondLineDrawSmileys"
-#define SETTING_SECONDLINE_TYPE_DEFAULT TEXT_STATUS_MESSAGE //"CList","SecondLineType"
-#define SETTING_SECONDLINE_XSTATUS_DEFAULT 1 //"CList","SecondLineXStatusHasPriority"
-#define SETTING_SECONDLINE_XSTATUSNAMETEXT_DEFAULT 0 //"CList","SecondLineUseNameAndMessageForXStatus"
-#define SETTING_SECONDLINE_STATUSIFNOAWAY_DEFAULT 1 //"CList","SecondLineShowStatusIfNoAway"
-#define SETTING_SECONDLINE_LISTENINGIFNOAWAY_DEFAULT 1 //"CList","SecondLineShowListeningIfNoAway"
-
-#define SETTING_THIRDLINE_SHOW_DEFAULT 0 //"CList","ThirdLineShow"
-#define SETTING_THIRDLINE_TOPSPACE_DEFAULT 2 //"CList","ThirdLineTopSpace"
-#define SETTING_THIRDLINE_SMILEYS_DEFAULT 0 //"CList","ThirdLineDrawSmileys"
-#define SETTING_THIRDLINE_TYPE_DEFAULT TEXT_STATUS_MESSAGE //"CList","ThirdLineType"
-#define SETTING_THIRDLINE_XSTATUS_DEFAULT 1 //"ThirdLineXStatusHasPriority"
-#define SETTING_THIRDLINE_XSTATUSNAMETEXT_DEFAULT 0 //"ThirdLineUseNameAndMessageForXStatus"
-#define SETTING_THIRDLINE_STATUSIFNOAWAY_DEFAULT 0 //"CList","ThirdLineShowStatusIfNoAway"
-#define SETTING_THIRDLINE_LISTENINGIFNOAWAY_DEFAULT 0 //"ThirdLineShowListeningIfNoAway"
-
-#define SETTING_TRANSPARENT_DEFAULT 0 //"CList","Transparent"
-#define SETTING_AUTOALPHA_DEFAULT 150 //"CList","AutoAlpha"
-#define SETTING_CONFIRMDELETE_DEFAULT 1 //"CList","ConfirmDelete"
-#define SETTING_AUTOHIDE_DEFAULT 0 //"CList","AutoHide"
-#define SETTING_HIDETIME_DEFAULT 30 //"CList","HideTime"
-#define SETTING_CYCLETIME_DEFAULT 4 //"CList","CycleTime"
-#define SETTING_TRAYICON_DEFAULT SETTING_TRAYICON_SINGLE //"CList","TrayIcon"
-#define SETTING_ALWAYSSTATUS_DEFAULT 0 //"CList","AlwaysStatus"
-
-#define SETTING_BLENDINACTIVESTATE_DEFAULT 0 //"CLC","BlendInActiveState"
-
-#define CLCDEFAULT_MODERN_SELTEXTCOLOUR (g_CluiData.fDisableSkinEngine?GetSysColor(COLOR_HIGHLIGHTTEXT):RGB(0,0,128))
-#define CLCDEFAULT_MODERN_HOTTEXTCOLOUR (g_CluiData.fDisableSkinEngine ? CLCDEFAULT_MODERN_SELTEXTCOLOUR : RGB(0,0,255))
-#define CLCDEFAULT_MODERN_QUICKSEARCHCOLOUR RGB(255,255,0)
-#define CLCDEFAULT_NOVSCROLL 0 //"CLC","NoVScrollBar"
-#define CLCDEFAULT_INFOTIPTIME 750 //"! "CLC","InfoTipHoverTime"
-#define CLCDEFAULT_COLLICONTOLEFT 0 //"! "FrameTitleBar","AlignCOLLIconToLeft"
-
-#define SKIN_OFFSET_TOP_DEFAULT 0 //! "ModernSkin","SizeMarginOffset_Top"
-#define SKIN_OFFSET_BOTTOM_DEFAULT 0 //! "ModernSkin","SizeMarginOffset_Bottom"
-#define SKIN_OFFSET_LEFT_DEFAULT 0 //! "ModernSkin","SizeMarginOffset_Left"
-#define SKIN_OFFSET_RIGHT_DEFAULT 0 //! "ModernSkin","SizeMarginOffset_Right"
-#define SKIN_SPACEBEFOREGROUP_DEFAULT 0 //! "ModernSkin","SpaceBeforeGroup"
-
-#define SETTINGS_BARBTNWIDTH_DEFAULT 22 //"ModernToolBar", "option_Bar0_BtnWidth"
-#define SETTINGS_BARBTNHEIGHT_DEFAULT 22 //"ModernToolBar", "option_Bar0_BtnHeight"
-#define SETTINGS_BARBTNSPACE_DEFAULT 0 //"ModernToolBar", "option_Bar0_BtnSpace"
-#define SETTINGS_BARAUTOSIZE_DEFAULT 1 //"ModernToolBar", "option_Bar0_Autosize"
-#define SETTINGS_BARMULTILINE_DEFAULT 1 //"ModernToolBar", "option_Bar0_Multiline"
-
-#define SETTING_ENABLESOUNDS_DEFAULT 1 // !"Skin", "UseSound",
+#define SETTINGS_SHOWAVATARS_DEFAULT 0 // "CList","AvatarsShow"
+#define SETTINGS_AVATARDRAWBORDER_DEFAULT 0 // "CList","AvatarsDrawBorders"
+#define SETTINGS_AVATARBORDERCOLOR_DEFAULT RGB(0,0,0) // "CList","AvatarsBorderColor"
+#define SETTINGS_AVATARROUNDCORNERS_DEFAULT 0 // "CList","AvatarsRoundCorners"
+#define SETTINGS_AVATARUSECUTOMCORNERSIZE_DEFAULT 0 // "CList","AvatarsUseCustomCornerSize"
+#define SETTINGS_AVATARCORNERSIZE_DEFAULT 4 // "CList","AvatarsCustomCornerSize"
+#define SETTINGS_AVATARIGNORESIZEFORROW_DEFAULT 0 // "CList","AvatarsIgnoreSizeForRow"
+#define SETTINGS_AVATARDRAWOVERLAY_DEFAULT 0 // "CList","AvatarsDrawOverlay"
+#define SETTINGS_AVATAROVERLAYTYPE_DEFAULT SETTING_AVATAR_OVERLAY_TYPE_NORMAL
+#define SETTING_AVATARHEIGHT_DEFAULT 24 // "CList","AvatarsSize"
+#define SETTING_AVATARWIDTH_DEFAULT 24 // "CList","AvatarsWidth"
+#define SETTINGS_AVATARINSEPARATE_DEFAULT 0 // "CList","AvatarsInSeparateWnd",
+
+#define SETTING_HIDEICONONAVATAR_DEFAULT 0 // "CList","IconHideOnAvatar"
+#define SETTING_ICONONAVATARPLACE_DEFAULT 0 // "CList","IconDrawOnAvatarSpace"
+#define SETTING_ICONIGNORESIZE_DEFAULT 0 // "CList","IconIgnoreSizeForRownHeight"
+#define SETTING_SHOWTIME_DEFAULT 0 // "CList","ContactTimeShow"
+#define SETTING_SHOWTIMEIFDIFF_DEFAULT 1 // "CList","ContactTimeShowOnlyIfDifferent"
+
+#define SETTING_TEXT_RTL_DEFAULT 0 // "CList","TextRTL"
+#define SETTING_TEXT_RIGHTALIGN_DEFAULT 0 // "CList","TextAlignToRight"
+#define SETTING_TEXT_SMILEY_DEFAULT 1 // "CList","TextReplaceSmileys"
+#define SETTING_TEXT_RESIZESMILEY_DEFAULT 1 // "CList","TextResizeSmileys"
+#define SETTING_TEXT_PROTOSMILEY_DEFAULT 1 // "CList","TextUseProtocolSmileys"
+#define SETTING_TEXT_IGNORESIZE_DEFAULT 0 // "CList","TextIgnoreSizeForRownHeight"
+
+#define SETTING_FIRSTLINE_SMILEYS_DEFAULT 0 // "CList","FirstLineDrawSmileys"
+#define SETTING_FIRSTLINE_APPENDNICK_DEFAULT 0 // "CList","FirstLineAppendNick"
+#define SETTING_FIRSTLINE_TRIMTEXT_DEFAULT 1 // "CList","TrimText"
+
+#define SETTING_SECONDLINE_SHOW_DEFAULT 0 // "CList","SecondLineShow"
+#define SETTING_SECONDLINE_TOPSPACE_DEFAULT 2 // "CList","SecondLineTopSpace"
+#define SETTING_SECONDLINE_SMILEYS_DEFAULT 1 // "CList","SecondLineDrawSmileys"
+#define SETTING_SECONDLINE_TYPE_DEFAULT TEXT_STATUS_MESSAGE // "CList","SecondLineType"
+#define SETTING_SECONDLINE_XSTATUS_DEFAULT 1 // "CList","SecondLineXStatusHasPriority"
+#define SETTING_SECONDLINE_XSTATUSNAMETEXT_DEFAULT 0 // "CList","SecondLineUseNameAndMessageForXStatus"
+#define SETTING_SECONDLINE_STATUSIFNOAWAY_DEFAULT 1 // "CList","SecondLineShowStatusIfNoAway"
+#define SETTING_SECONDLINE_LISTENINGIFNOAWAY_DEFAULT 1 // "CList","SecondLineShowListeningIfNoAway"
+
+#define SETTING_THIRDLINE_SHOW_DEFAULT 0 // "CList","ThirdLineShow"
+#define SETTING_THIRDLINE_TOPSPACE_DEFAULT 2 // "CList","ThirdLineTopSpace"
+#define SETTING_THIRDLINE_SMILEYS_DEFAULT 0 // "CList","ThirdLineDrawSmileys"
+#define SETTING_THIRDLINE_TYPE_DEFAULT TEXT_STATUS_MESSAGE // "CList","ThirdLineType"
+#define SETTING_THIRDLINE_XSTATUS_DEFAULT 1 // "ThirdLineXStatusHasPriority"
+#define SETTING_THIRDLINE_XSTATUSNAMETEXT_DEFAULT 0 // "ThirdLineUseNameAndMessageForXStatus"
+#define SETTING_THIRDLINE_STATUSIFNOAWAY_DEFAULT 0 // "CList","ThirdLineShowStatusIfNoAway"
+#define SETTING_THIRDLINE_LISTENINGIFNOAWAY_DEFAULT 0 // "ThirdLineShowListeningIfNoAway"
+
+#define SETTING_TRANSPARENT_DEFAULT 0 // "CList","Transparent"
+#define SETTING_AUTOALPHA_DEFAULT 150 // "CList","AutoAlpha"
+#define SETTING_CONFIRMDELETE_DEFAULT 1 // "CList","ConfirmDelete"
+#define SETTING_AUTOHIDE_DEFAULT 0 // "CList","AutoHide"
+#define SETTING_HIDETIME_DEFAULT 30 // "CList","HideTime"
+#define SETTING_CYCLETIME_DEFAULT 4 // "CList","CycleTime"
+#define SETTING_TRAYICON_DEFAULT SETTING_TRAYICON_SINGLE // "CList","TrayIcon"
+#define SETTING_ALWAYSSTATUS_DEFAULT 0 // "CList","AlwaysStatus"
+
+#define SETTING_BLENDINACTIVESTATE_DEFAULT 0 //"CLC","BlendInActiveState"
+
+#define CLCDEFAULT_MODERN_SELTEXTCOLOUR (g_CluiData.fDisableSkinEngine?GetSysColor(COLOR_HIGHLIGHTTEXT):RGB(0,0,128))
+#define CLCDEFAULT_MODERN_HOTTEXTCOLOUR (g_CluiData.fDisableSkinEngine ? CLCDEFAULT_MODERN_SELTEXTCOLOUR : RGB(0,0,255))
+#define CLCDEFAULT_MODERN_QUICKSEARCHCOLOUR RGB(255,255,0)
+#define CLCDEFAULT_NOVSCROLL 0 // "CLC","NoVScrollBar"
+#define CLCDEFAULT_INFOTIPTIME 750 // "CLC","InfoTipHoverTime"
+#define CLCDEFAULT_COLLICONTOLEFT 0 // "FrameTitleBar","AlignCOLLIconToLeft"
+
+#define SKIN_OFFSET_TOP_DEFAULT 0 // "ModernSkin","SizeMarginOffset_Top"
+#define SKIN_OFFSET_BOTTOM_DEFAULT 0 // "ModernSkin","SizeMarginOffset_Bottom"
+#define SKIN_OFFSET_LEFT_DEFAULT 0 // "ModernSkin","SizeMarginOffset_Left"
+#define SKIN_OFFSET_RIGHT_DEFAULT 0 // "ModernSkin","SizeMarginOffset_Right"
+#define SKIN_SPACEBEFOREGROUP_DEFAULT 0 // "ModernSkin","SpaceBeforeGroup"
+
+#define SETTINGS_BARBTNWIDTH_DEFAULT 22 // "ModernToolBar", "option_Bar0_BtnWidth"
+#define SETTINGS_BARBTNHEIGHT_DEFAULT 22 // "ModernToolBar", "option_Bar0_BtnHeight"
+#define SETTINGS_BARBTNSPACE_DEFAULT 0 // "ModernToolBar", "option_Bar0_BtnSpace"
+#define SETTINGS_BARAUTOSIZE_DEFAULT 1 // "ModernToolBar", "option_Bar0_Autosize"
+#define SETTINGS_BARMULTILINE_DEFAULT 1 // "ModernToolBar", "option_Bar0_Multiline"
+
+#define SETTING_ENABLESOUNDS_DEFAULT 1 // "Skin", "UseSound",
diff --git a/plugins/Clist_modern/src/modern_docking.cpp b/plugins/Clist_modern/src/modern_docking.cpp
index 424ddb4d2a..d5cbe30064 100644
--- a/plugins/Clist_modern/src/modern_docking.cpp
+++ b/plugins/Clist_modern/src/modern_docking.cpp
@@ -102,13 +102,13 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
MSG *msg = (MSG*)wParam;
if (msg->message == WM_DESTROY)
- db_set_b(0, "CList", "Docked", (BYTE)g_CluiData.fDocked);
+ g_plugin.setByte("Docked", (BYTE)g_CluiData.fDocked);
if (!g_CluiData.fDocked && msg->message != WM_CREATE && msg->message != WM_MOVING && msg->message != WM_CREATEDOCKED && msg->message != WM_MOVE && msg->message != WM_SIZE) return 0;
switch (msg->message) {
case WM_CREATE:
//if (GetSystemMetrics(SM_CMONITORS)>1) return 0;
- if (db_get_b(0, "CList", "Docked", 0) && db_get_b(0, "CLUI", "DockToSides", SETTING_DOCKTOSIDES_DEFAULT))
+ if (g_plugin.getByte("Docked", 0) && db_get_b(0, "CLUI", "DockToSides", SETTING_DOCKTOSIDES_DEFAULT))
{
PostMessage(msg->hwnd, WM_CREATEDOCKED, 0, 0);
}
@@ -117,7 +117,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
case WM_CREATEDOCKED:
//we need to post a message just after creation to let main message function do some work
- g_CluiData.fDocked = (BOOL)db_get_b(0, "CList", "Docked", 0);
+ g_CluiData.fDocked = (BOOL)g_plugin.getByte("Docked", 0);
if (IsWindowVisible(msg->hwnd) && !IsIconic(msg->hwnd)) {
RECT rc, rcMonitor;
memset(&abd, 0, sizeof(abd));
@@ -197,7 +197,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
Sync(CLUIFrames_OnMoving, msg->hwnd, (LPRECT)msg->lParam);
g_CluiData.mutexPreventDockMoving = 1;
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
- db_set_b(0, "CList", "Docked", (BYTE)g_CluiData.fDocked);
+ g_plugin.setByte("Docked", (BYTE)g_CluiData.fDocked);
ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
return TRUE;
}
@@ -293,8 +293,8 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
g_CluiData.fDocked = 0;
GetCursorPos(&pt);
PostMessage(msg->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(pt.x, pt.y));
- SetWindowPos(msg->hwnd, nullptr, pt.x - rc.right / 2, pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2, db_get_dw(0, "CList", "Width", 0), db_get_dw(0, "CList", "Height", 0), SWP_NOZORDER);
- db_set_b(0, "CList", "Docked", (BYTE)g_CluiData.fDocked);
+ SetWindowPos(msg->hwnd, nullptr, pt.x - rc.right / 2, pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2, g_plugin.getDword("Width", 0), g_plugin.getDword("Height", 0), SWP_NOZORDER);
+ g_plugin.setByte("Docked", (BYTE)g_CluiData.fDocked);
// ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
}
return 1;
diff --git a/plugins/Clist_modern/src/modern_keyboard.cpp b/plugins/Clist_modern/src/modern_keyboard.cpp
index 219e89a7ef..5bd897495e 100644
--- a/plugins/Clist_modern/src/modern_keyboard.cpp
+++ b/plugins/Clist_modern/src/modern_keyboard.cpp
@@ -34,7 +34,7 @@ INT_PTR hkCloseMiranda(WPARAM, LPARAM)
INT_PTR hkRestoreStatus(WPARAM, LPARAM)
{
- int nStatus = db_get_w(0, "CList", "Status", ID_STATUS_OFFLINE);
+ int nStatus = g_plugin.getWord("Status", ID_STATUS_OFFLINE);
Clist_SetStatusMode(nStatus);
return 0;
diff --git a/plugins/Clist_modern/src/modern_newrowopts.cpp b/plugins/Clist_modern/src/modern_newrowopts.cpp
deleted file mode 100644
index d318e7cfd7..0000000000
--- a/plugins/Clist_modern/src/modern_newrowopts.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (c) 2012-18 Miranda NG team (https://miranda-ng.org),
-Copyright (c) 2000-03 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-/************************************************************************/
-/* Author Artem Shpynov (shpynov@nm.ru) */
-/************************************************************************/
-
-/************************************************************************/
-/********* New row design options file handle ********/
-/************************************************************************/
-
-
-#include "stdafx.h"
-
-#define EMPTY_PLACE 255
-#define COLUMNS_PLACE 254
-#define ROWS_PLACE 253
-
-typedef struct _NodeList
-{
- BYTE bType;
- int pData;
- DWORD AllocatedChilds;
- struct _NodeList * childNodes;
- struct _NodeList * itemParent;
-} NodeList;
-
-NodeList * RootNode = nullptr;
-
-NodeList * AddNode(NodeList * Parent)
-{
- NodeList * res;
- if (!Parent)
- {
- res = (NodeList *)mir_alloc(sizeof(NodeList));
- memset(res, 0, sizeof(NodeList));
- return res;
- }
- Parent->childNodes = (NodeList*)mir_realloc(Parent->childNodes, sizeof(NodeList)*(Parent->AllocatedChilds + 1));
- memset(&(Parent->childNodes[Parent->AllocatedChilds]), 0, sizeof(NodeList));
- Parent->childNodes[Parent->AllocatedChilds].itemParent = Parent;
- Parent->AllocatedChilds++;
- return &(Parent->childNodes[Parent->AllocatedChilds - 1]);
-}
-
-
-BOOL RemoveChildNode(NodeList * FromList, DWORD index)
-{
- if (!FromList) return FALSE;
- if (FromList->AllocatedChilds <= index) return FALSE;
- NodeList *work = &(FromList->childNodes[index]);
- for (size_t i = 0; i < work->AllocatedChilds; i++)
- if (work->childNodes[i].AllocatedChilds)
- RemoveChildNode(work->childNodes, (DWORD)i);
-
- if (work->AllocatedChilds) {
- mir_free_and_nil(work->childNodes);
- work->AllocatedChilds = 0;
- }
- memmove(FromList->childNodes + index, FromList->childNodes + index + 1, sizeof(NodeList)*(FromList->AllocatedChilds - index - 1));
- FromList->AllocatedChilds--;
- return TRUE;
-}
-
-BOOL RemoveNode(NodeList * FromList)
-{
- if (!FromList) return FALSE;
- if (FromList->itemParent)
- {
- DWORD k;
- for (k = 0; k < FromList->itemParent->AllocatedChilds; k++)
- if (&(FromList->itemParent->childNodes[k]) == FromList)
- {
- BOOL res = RemoveChildNode(FromList->itemParent, k);
- return res;
- }
- }
- do
- {
- RemoveChildNode(FromList, 0);
- } while (FromList->AllocatedChilds>0);
- mir_free_and_nil(FromList->childNodes);
- mir_free_and_nil(FromList);
- return TRUE;
-}
-int ident = 0;
-void PrintIdent()
-{
- int k;
- for (k = 0; k < ident; k++)
- TRACE("-");
-}
-
-void TraceTreeLevel(NodeList * node)
-{
- DWORD i;
- if (!node) return;
- PrintIdent();
- {
- char buf[255];
- mir_snprintf(buf, "%d\n", node->pData);
- TRACE(buf);
- }
- ident += 5;
- for (i = 0; i < node->AllocatedChilds; i++)
- {
-
- if (node->childNodes[i].AllocatedChilds>0)
- TraceTreeLevel(&(node->childNodes[i]));
- else
- {
- PrintIdent();
- {
- char buf[255];
- mir_snprintf(buf, "%d\n", node->childNodes[i].pData);
- TRACE(buf);
- }
- }
- }
- ident -= 5;
-}
-
-BOOL CALLBACK DlgProcItemNewRowOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
-{
- switch (msg)
- {
- case WM_INITDIALOG:
- {
- NodeList * res1, *res2, *res3;
- int i = 0;
- RootNode = AddNode(nullptr);
- RootNode->pData = i++;
- res1 = AddNode(RootNode);
- res1->pData = i++;
- res1 = AddNode(RootNode);
- res1->pData = i++;
- res2 = AddNode(res1);
- res2->pData = i++;
- res2 = AddNode(res1);
- res2->pData = i++;
- res3 = AddNode(res2);
- res3->pData = i++;
- res3 = AddNode(res1);
- res3->pData = i++;
- res3 = AddNode(RootNode);
- res3->pData = i++;
- TRACE("*********** Nodes DUMP 1 ***********\n");
- TraceTreeLevel(RootNode);
- if (RemoveNode(res1)) res1 = nullptr;
- TRACE("*********** Nodes DUMP 2 ***********\n");
- TraceTreeLevel(RootNode);
- //CheckDlgButton(hwndDlg, IDC_HIDE_ICON_ON_AVATAR, db_get_b(0,"CList","IconHideOnAvatar",SETTING_HIDEICONONAVATAR_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
- MessageBox(hwndDlg, L"Init NewRow Dialog", L"Notify", MB_OK);
- break;
- }
- case WM_NOTIFY:
- {
- switch (((LPNMHDR)lParam)->idFrom)
- {
- case 0:
- {
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- {
- return TRUE;
- }
- }
- }
- }
- }
- }
- return 0;
-};
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp
index e972a3f12b..708a4058e5 100644
--- a/plugins/Clist_modern/src/modern_toolbar.cpp
+++ b/plugins/Clist_modern/src/modern_toolbar.cpp
@@ -85,8 +85,8 @@ void Modern_InitButtons()
BTNS[i].hButton = g_plugin.addTTB(&tbb);
}
- SetButtonPressed(3, db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
- SetButtonPressed(6, db_get_b(0, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT));
+ SetButtonPressed(3, g_plugin.getByte("HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
+ SetButtonPressed(6, g_plugin.getByte("UseGroups", SETTING_USEGROUPS_DEFAULT));
SetButtonPressed(7, db_get_b(0, "Skin", "UseSound", SETTING_ENABLESOUNDS_DEFAULT));
}
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index 67136c7d3c..095cc4edc9 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -1325,7 +1325,7 @@ void ApplyViewMode(const char *Name, bool onlySelector)
if (g_CluiData.bFilterEffective & CLVM_FILTER_STATUS) {
if (g_CluiData.boldHideOffline == (BYTE)-1)
- g_CluiData.boldHideOffline = db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
+ g_CluiData.boldHideOffline = g_plugin.getByte("HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
g_clistApi.pfnSetHideOffline(false);
}
@@ -1343,7 +1343,7 @@ void ApplyViewMode(const char *Name, bool onlySelector)
if (bUseGroups != -1) {
if (g_CluiData.bOldUseGroups == (BYTE)-1)
- g_CluiData.bOldUseGroups = db_get_b(0, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT);
+ g_CluiData.bOldUseGroups = g_plugin.getByte("UseGroups", SETTING_USEGROUPS_DEFAULT);
CallService(MS_CLIST_SETUSEGROUPS, bUseGroups, 0);
}