diff options
author | George Hazan <ghazan@miranda.im> | 2018-11-12 22:17:49 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-11-12 22:17:49 +0300 |
commit | b2f4af6c11168157fface019925b40ddbcd18a95 (patch) | |
tree | 059722eec479cc9b4f050807171c238565d8367d /plugins/Clist_nicer | |
parent | b5f2f8c72db1b2eb876169b80083553491abb51d (diff) |
clist_nicer -> g_plugin
Diffstat (limited to 'plugins/Clist_nicer')
-rw-r--r-- | plugins/Clist_nicer/src/CLCButton.cpp | 4 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/Docking.cpp | 6 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clc.cpp | 14 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcitems.cpp | 14 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcmsgs.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcopts.cpp | 10 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clistmenus.cpp | 24 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clistmod.cpp | 10 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clistopts.cpp | 64 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clui.cpp | 54 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/cluiopts.cpp | 42 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/cluiservices.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/config.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/contact.cpp | 12 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/init.cpp | 18 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/viewmodes.cpp | 6 |
16 files changed, 142 insertions, 142 deletions
diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp index 3643f85e35..38bb6e0e2d 100644 --- a/plugins/Clist_nicer/src/CLCButton.cpp +++ b/plugins/Clist_nicer/src/CLCButton.cpp @@ -65,8 +65,8 @@ static void InitDefaultButtons() }
g_index = -1;
- ClcSetButtonState(IDC_TBHIDEOFFLINE, db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
- ClcSetButtonState(IDC_TBHIDEGROUPS, db_get_b(0, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT));
+ ClcSetButtonState(IDC_TBHIDEOFFLINE, g_plugin.getByte("HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
+ ClcSetButtonState(IDC_TBHIDEGROUPS, g_plugin.getByte("UseGroups", SETTING_USEGROUPS_DEFAULT));
ClcSetButtonState(IDC_TBSOUND, db_get_b(0, "Skin", "UseSound", 1) ? BST_UNCHECKED : BST_CHECKED);
}
diff --git a/plugins/Clist_nicer/src/Docking.cpp b/plugins/Clist_nicer/src/Docking.cpp index 69281f2a1f..e62d7363cc 100644 --- a/plugins/Clist_nicer/src/Docking.cpp +++ b/plugins/Clist_nicer/src/Docking.cpp @@ -97,21 +97,21 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) MSG *msg = (MSG *)wParam;
if (msg->message == WM_DESTROY)
- db_set_b(0, "CList", "Docked", (BYTE)docked);
+ g_plugin.setByte("Docked", (BYTE)docked);
if (!docked && msg->message != WM_CREATE && msg->message != WM_MOVING && msg->message != WM_CREATEDOCKED && msg->message != WM_MOVE)
return 0;
switch (msg->message) {
case WM_CREATE:
//if (GetSystemMetrics(SM_CMONITORS)>1) return 0;
- if (db_get_b(0, "CList", "Docked", 0))
+ if (g_plugin.getByte("Docked", 0))
PostMessage(msg->hwnd, WM_CREATEDOCKED, 0, 0);
draggingTitle = 0;
return 0;
case WM_CREATEDOCKED:
//we need to post a message just after creation to let main message function do some work
- docked = (int)(char)db_get_b(0, "CList", "Docked", 0);
+ docked = (int)(char)g_plugin.getByte("Docked", 0);
if (IsWindowVisible(msg->hwnd) && !IsIconic(msg->hwnd)) {
RECT rc, rcMonitor;
memset(&abd, 0, sizeof(abd));
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 5ba3d92a7f..70235526c5 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -73,12 +73,12 @@ static int ClcEventAdded(WPARAM hContact, LPARAM lParam) DBEVENTINFO dbei = {};
db_event_get(lParam, &dbei);
if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) {
- DWORD firstTime = db_get_dw(hContact, "CList", "mf_firstEvent", 0);
- DWORD count = db_get_dw(hContact, "CList", "mf_count", 0);
+ DWORD firstTime = g_plugin.getDword(hContact, "mf_firstEvent");
+ DWORD count = g_plugin.getDword(hContact, "mf_count");
count++;
new_freq = count ? (dbei.timestamp - firstTime) / count : 0x7fffffff;
- db_set_dw(hContact, "CList", "mf_freq", new_freq);
- db_set_dw(hContact, "CList", "mf_count", count);
+ g_plugin.setDword(hContact, "mf_freq", new_freq);
+ g_plugin.setDword(hContact, "mf_count", count);
TExtraCache *p = cfg::getCache(hContact, nullptr);
if (p) {
@@ -131,9 +131,9 @@ static int ClcSettingChanged(WPARAM hContact, LPARAM lParam) if (!__strcmp(szProto, cws->szModule)) {
// was a unique setting key written?
if (!__strcmp(cws->szSetting, "Status")) {
- if (!db_get_b(hContact, "CList", "Hidden", 0))
+ if (!g_plugin.getByte(hContact, "Hidden"))
if (cws->value.wVal == ID_STATUS_OFFLINE)
- if (db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT))
+ if (g_plugin.getByte("HideOffline", SETTING_HIDEOFFLINE_DEFAULT))
return 0;
SendMessage(g_clistApi.hwndContactTree, INTM_STATUSCHANGED, hContact, lParam);
@@ -445,7 +445,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (contact->pExtra)
dwFlags = contact->pExtra->dwDFlags;
else
- dwFlags = db_get_dw(contact->hContact, "CList", "CLN_Flags", 0);
+ dwFlags = g_plugin.getDword(contact->hContact, "CLN_Flags");
if (cfg::dat.dwFlags & CLUI_FRAME_AVATARS)
contact->cFlags = (dwFlags & ECF_HIDEAVATAR ? contact->cFlags & ~ECF_AVATAR : contact->cFlags | ECF_AVATAR);
else
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index cc3f88ed5c..79c80f4d22 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -75,7 +75,7 @@ void LoadAvatarForContact(ClcContact *p) if (p->pExtra)
dwFlags = p->pExtra->dwDFlags;
else
- dwFlags = db_get_dw(p->hContact, "CList", "CLN_Flags", 0);
+ dwFlags = g_plugin.getDword(p->hContact, "CLN_Flags");
if (cfg::dat.dwFlags & CLUI_FRAME_AVATARS)
p->cFlags = (dwFlags & ECF_HIDEAVATAR ? p->cFlags & ~ECF_AVATAR : p->cFlags | ECF_AVATAR);
@@ -114,7 +114,7 @@ ClcContact* AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hCo }
p->codePage = db_get_dw(hContact, "Tab_SRMsg", "ANSIcodepage", db_get_dw(hContact, "UserInfo", "ANSIcodepage", CP_ACP));
- p->bSecondLine = db_get_b(hContact, "CList", "CLN_2ndline", cfg::dat.dualRowMode);
+ p->bSecondLine = g_plugin.getByte(hContact, "CLN_2ndline", cfg::dat.dualRowMode);
if (dat->bisEmbedded)
p->pExtra = nullptr;
@@ -132,7 +132,7 @@ ClcContact* AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hCo RTL_DetectAndSet(p, p->hContact);
p->avatarLeft = p->extraIconRightBegin = -1;
- p->flags |= db_get_b(p->hContact, "CList", "Priority", 0) ? CONTACTF_PRIORITY : 0;
+ p->flags |= g_plugin.getByte(p->hContact, "Priority", 0) ? CONTACTF_PRIORITY : 0;
return p;
}
@@ -161,7 +161,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) MCONTACT hContact = p->hContact;
DBVARIANT dbv = { 0 };
- INT_PTR result = db_get_ws(hContact, "CList", "StatusMsg", &dbv);
+ INT_PTR result = g_plugin.getWString(hContact, "StatusMsg", &dbv);
if (!result && mir_wstrlen(dbv.pwszVal) > 0)
p->bStatusMsgValid = STATUSMSG_CLIST;
else {
@@ -324,7 +324,7 @@ void GetExtendedInfo(ClcContact *contact, ClcData *dat) if (p == nullptr)
return;
- p->msgFrequency = db_get_dw(contact->hContact, "CList", "mf_freq", 0x7fffffff);
+ p->msgFrequency = g_plugin.getDword(contact->hContact, "mf_freq", 0x7fffffff);
if (p->valid)
return;
@@ -373,7 +373,7 @@ void LoadSkinItemToCache(TExtraCache *cEntry) int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, struct 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.
// always hide subcontacts (but show them on embedded contact lists)
if (dat != nullptr && dat->bHideSubcontacts && cfg::dat.bMetaEnabled && db_mc_isSub(hContact))
@@ -405,7 +405,7 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, struct ClcData }
if (cfg::dat.bFilterEffective & CLVM_FILTER_GROUPS) {
- ptrW tszGroup(db_get_wsa(hContact, "CList", "Group"));
+ ptrW tszGroup(g_plugin.getWStringA(hContact, "Group"));
if (tszGroup != NULL) {
wchar_t szGroupMask[256];
mir_snwprintf(szGroupMask, L"%s|", tszGroup);
diff --git a/plugins/Clist_nicer/src/clcmsgs.cpp b/plugins/Clist_nicer/src/clcmsgs.cpp index ff3f8a5611..d053f5b64b 100644 --- a/plugins/Clist_nicer/src/clcmsgs.cpp +++ b/plugins/Clist_nicer/src/clcmsgs.cpp @@ -70,7 +70,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM if (contact->type != CLCIT_CONTACT)
return 0;
contact->flags ^= CONTACTF_PRIORITY;
- db_set_b(contact->hContact, "CList", "Priority", (BYTE)(contact->flags & CONTACTF_PRIORITY ? 1 : 0));
+ g_plugin.setByte(contact->hContact, "Priority", (BYTE)(contact->flags & CONTACTF_PRIORITY ? 1 : 0));
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
}
return 0;
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 54f4b0a99f..a1c4e96ff8 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -218,7 +218,7 @@ static INT_PTR CALLBACK DlgProcDspGroups(HWND hwndDlg, UINT msg, WPARAM wParam, BOOL translated;
cfg::dat.avatarPadding = (BYTE)GetDlgItemInt(hwndDlg, IDC_AVATARPADDING, &translated, FALSE);
- db_set_b(0, "CList", "AvatarPadding", cfg::dat.avatarPadding);
+ g_plugin.setByte("AvatarPadding", cfg::dat.avatarPadding);
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));
@@ -302,10 +302,10 @@ static INT_PTR CALLBACK DlgProcDspItems(HWND hwndDlg, UINT msg, WPARAM wParam, L else
cfg::dat.sortOrder[i] = (BYTE)curSel;
}
- db_set_dw(0, "CList", "SortOrder", MAKELONG(MAKEWORD(cfg::dat.sortOrder[0], cfg::dat.sortOrder[1]), MAKEWORD(cfg::dat.sortOrder[2], 0)));
+ g_plugin.setDword("SortOrder", MAKELONG(MAKEWORD(cfg::dat.sortOrder[0], cfg::dat.sortOrder[1]), MAKEWORD(cfg::dat.sortOrder[2], 0)));
cfg::dat.bDontSeparateOffline = IsDlgButtonChecked(hwndDlg, IDC_DONTSEPARATE) ? 1 : 0;
- db_set_b(0, "CList", "DontSeparateOffline", (BYTE)cfg::dat.bDontSeparateOffline);
+ g_plugin.setByte("DontSeparateOffline", (BYTE)cfg::dat.bDontSeparateOffline);
db_set_dw(0, "CLC", "OfflineModes", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS)));
@@ -444,10 +444,10 @@ static INT_PTR CALLBACK DlgProcDspAdvanced(HWND hwndDlg, UINT msg, WPARAM wParam db_set_dw(0, "CLC", "avatarradius", cfg::dat.avatarRadius);
cfg::dat.avatarSize = GetDlgItemInt(hwndDlg, IDC_AVATARHEIGHT, &translated, FALSE);
- db_set_w(0, "CList", "AvatarSize", (WORD)cfg::dat.avatarSize);
+ g_plugin.setWord("AvatarSize", (WORD)cfg::dat.avatarSize);
cfg::dat.bNoOfflineAvatars = IsDlgButtonChecked(hwndDlg, IDC_NOAVATARSOFFLINE) ? TRUE : FALSE;
- db_set_b(0, "CList", "NoOfflineAV", (BYTE)cfg::dat.bNoOfflineAvatars);
+ g_plugin.setByte("NoOfflineAV", (BYTE)cfg::dat.bNoOfflineAvatars);
cfg::dat.bShowLocalTime = IsDlgButtonChecked(hwndDlg, IDC_SHOWLOCALTIME) ? 1 : 0;
db_set_b(0, "CLC", "ShowLocalTime", (BYTE)cfg::dat.bShowLocalTime);
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index 9856b15cf0..c5fe12a1b9 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -71,7 +71,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA SendMessage(hwndAdd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_ADDCONTACT));
SetWindowText(hwndAdd, TranslateT("Add permanently"));
- EnableWindow(hwndAdd, db_get_b(hContact, "CList", "NotOnList", 0));
+ EnableWindow(hwndAdd, g_plugin.getByte(hContact, "NotOnList"));
hwndAdd = GetDlgItem(hWnd, IDC_DSP_LOADDEFAULT); // CreateWindowEx(0, L"CLCButtonClass", L"FOO", WS_VISIBLE | BS_PUSHBUTTON | WS_CHILD | WS_TABSTOP, 200, 276, 106, 24, hWnd, (HMENU)IDC_IGN_ADDPERMANENTLY, g_plugin.getInst(), NULL);
CustomizeButton(hwndAdd, false, true, false);
@@ -98,8 +98,8 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA }
else {
wchar_t szTitle[512];
- DWORD dwFlags = db_get_dw(hContact, "CList", "CLN_Flags", 0);
- BYTE bSecondLine = db_get_b(hContact, "CList", "CLN_2ndline", -1);
+ DWORD dwFlags = g_plugin.getDword(hContact, "CLN_Flags");
+ BYTE bSecondLine = g_plugin.getByte(hContact, "CLN_2ndline", -1);
mir_snwprintf(szTitle, TranslateT("Contact list display and ignore options for %s"), contact ? contact->szText : Clist_GetContactDisplayName(hContact));
@@ -108,7 +108,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA pCaps = CallProtoService(contact ? contact->pce->szProto : GetContactProto(hContact), PS_GETCAPS, PFLAGNUM_1, 0);
Utils::enableDlgControl(hWnd, IDC_IGN_ALWAYSONLINE, pCaps & PF1_INVISLIST ? TRUE : FALSE);
Utils::enableDlgControl(hWnd, IDC_IGN_ALWAYSOFFLINE, pCaps & PF1_VISLIST ? TRUE : FALSE);
- CheckDlgButton(hWnd, IDC_IGN_PRIORITY, db_get_b(hContact, "CList", "Priority", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_IGN_PRIORITY, g_plugin.getByte(hContact, "Priority") ? BST_CHECKED : BST_UNCHECKED);
Utils::enableDlgControl(hWnd, IDC_IGN_PRIORITY, TRUE);
Utils::enableDlgControl(hWnd, IDC_AVATARDISPMODE, TRUE);
Utils::enableDlgControl(hWnd, IDC_SECONDLINEMODE, TRUE);
@@ -169,12 +169,12 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA break;
case IDC_HIDECONTACT:
- db_set_b(hContact, "CList", "Hidden", (BYTE)(IsDlgButtonChecked(hWnd, IDC_HIDECONTACT) ? 1 : 0));
+ g_plugin.setByte(hContact, "Hidden", (BYTE)(IsDlgButtonChecked(hWnd, IDC_HIDECONTACT) ? 1 : 0));
break;
case IDC_IGN_ADDPERMANENTLY:
Contact_Add(hContact, hWnd);
- Utils::enableDlgControl(hWnd, IDC_IGN_ADDPERMANENTLY, db_get_b(hContact, "CList", "NotOnList", 0));
+ Utils::enableDlgControl(hWnd, IDC_IGN_ADDPERMANENTLY, g_plugin.getByte(hContact, "NotOnList"));
break;
case IDC_DSP_LOADDEFAULT:
@@ -195,7 +195,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA if (cfg::clcdat) {
LRESULT iSel = SendDlgItemMessage(hWnd, IDC_AVATARDISPMODE, CB_GETCURSEL, 0, 0);
- DWORD dwFlags = db_get_dw(hContact, "CList", "CLN_Flags", 0), dwXMask = 0;
+ DWORD dwFlags = g_plugin.getDword(hContact, "CLN_Flags"), dwXMask = 0;
LRESULT checked = 0;
Clist_FindItem(g_clistApi.hwndContactTree, cfg::clcdat, hContact, &contact);
@@ -224,21 +224,21 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA else if (checked == BST_UNCHECKED)
dwFlags |= ECF_HIDELOCALTIME;
- db_set_dw(hContact, "CList", "CLN_Flags", dwFlags);
+ g_plugin.setDword(hContact, "CLN_Flags", dwFlags);
if ((iSel = SendDlgItemMessage(hWnd, IDC_SECONDLINEMODE, CB_GETCURSEL, 0, 0)) != CB_ERR) {
if (iSel == 0) {
- db_unset(hContact, "CList", "CLN_2ndline");
+ g_plugin.delSetting(hContact, "CLN_2ndline");
if (contact)
contact->bSecondLine = cfg::dat.dualRowMode;
}
else {
- db_set_b(hContact, "CList", "CLN_2ndline", (BYTE)(iSel - 1));
+ g_plugin.setByte(hContact, "CLN_2ndline", (BYTE)(iSel - 1));
if (contact)
contact->bSecondLine = (BYTE)(iSel - 1);
}
}
- db_set_dw(hContact, "CList", "CLN_xmask", dwXMask);
+ g_plugin.setDword(hContact, "CLN_xmask", dwXMask);
if (contact) {
if (contact->pExtra)
contact->pExtra->dwDFlags = dwFlags;
@@ -248,7 +248,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA if (p)
p->dwDFlags = dwFlags;
}
- db_set_b(hContact, "CList", "Priority", (BYTE)(IsDlgButtonChecked(hWnd, IDC_IGN_PRIORITY) ? 1 : 0));
+ g_plugin.setByte(hContact, "Priority", (BYTE)(IsDlgButtonChecked(hWnd, IDC_IGN_PRIORITY) ? 1 : 0));
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
}
}
diff --git a/plugins/Clist_nicer/src/clistmod.cpp b/plugins/Clist_nicer/src/clistmod.cpp index 56572798f9..5ba31f3746 100644 --- a/plugins/Clist_nicer/src/clistmod.cpp +++ b/plugins/Clist_nicer/src/clistmod.cpp @@ -176,7 +176,7 @@ int ShowHide() switch (iVisibleState) {
case GWVS_PARTIALLY_COVERED:
//If we don't want to bring it to top, we can use a simple break. This goes against readability ;-) but the comment explains it.
- if (!db_get_b(0, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT))
+ if (!g_plugin.getByte("BringToFront", SETTING_BRINGTOFRONT_DEFAULT))
break;
case GWVS_COVERED: //Fall through (and we're already falling)
case GWVS_HIDDEN:
@@ -194,12 +194,12 @@ int ShowHide() RECT rcWindow;
SetWindowPos(g_clistApi.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS);
- 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 | SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS);
SetForegroundWindow(g_clistApi.hwndContactList);
//SetActiveWindow(g_clistApi.hwndContactList);
ShowWindow(g_clistApi.hwndContactList, SW_SHOW);
- db_set_b(0, "CList", "State", SETTING_STATE_NORMAL);
+ g_plugin.setByte("State", SETTING_STATE_NORMAL);
GetWindowRect(g_clistApi.hwndContactList, &rcWindow);
if (Utils_AssertInsideScreen(&rcWindow) == 1) {
@@ -209,8 +209,8 @@ int ShowHide() }
else { //It needs to be hidden
ShowWindow(g_clistApi.hwndContactList, SW_HIDE);
- db_set_b(0, "CList", "State", SETTING_STATE_HIDDEN);
- if (db_get_b(0, "CList", "DisableWorkingSet", 1))
+ g_plugin.setByte("State", SETTING_STATE_HIDDEN);
+ if (g_plugin.getByte("DisableWorkingSet", 1))
SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
}
return 0;
diff --git a/plugins/Clist_nicer/src/clistopts.cpp b/plugins/Clist_nicer/src/clistopts.cpp index 639c2d3fc9..4e99840bea 100644 --- a/plugins/Clist_nicer/src/clistopts.cpp +++ b/plugins/Clist_nicer/src/clistopts.cpp @@ -51,22 +51,22 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP opt_gen_opts_changed = 0;
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)HookEventMessage(ME_DB_CONTACT_SETTINGCHANGED, hwndDlg, WM_USER + 1));
- 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_SHOWBOTTOMBUTTONS, cfg::dat.dwFlags & CLUI_FRAME_SHOWBOTTOMBUTTONS ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CLISTSUNKEN, cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_EVENTAREAAUTOHIDE, cfg::dat.dwFlags & CLUI_FRAME_AUTOHIDENOTIFY ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_EVENTAREASUNKEN, (cfg::dat.dwFlags & CLUI_FRAME_EVENTAREASUNKEN) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONECLK, db_get_b(0, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ALWAYSSTATUS, db_get_b(0, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ALWAYSMULTI, !db_get_b(0, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DONTCYCLE, db_get_b(0, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CYCLE, db_get_b(0, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_CYCLE ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_MULTITRAY, db_get_b(0, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DISABLEBLINK, db_get_b(0, "CList", "DisableTrayFlash", 0) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ICONBLINK, db_get_b(0, "CList", "NoIconBlink", 0) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONECLK, g_plugin.getByte("Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALWAYSSTATUS, g_plugin.getByte("AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALWAYSMULTI, !g_plugin.getByte("AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DONTCYCLE, g_plugin.getByte("TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CYCLE, g_plugin.getByte("TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_CYCLE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MULTITRAY, g_plugin.getByte("TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DISABLEBLINK, g_plugin.getByte("DisableTrayFlash", 0) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ICONBLINK, g_plugin.getByte("NoIconBlink", 0) == 1 ? BST_CHECKED : BST_UNCHECKED);
if (IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE)) {
Utils::enableDlgControl(hwndDlg, IDC_CYCLETIMESPIN, FALSE);
Utils::enableDlgControl(hwndDlg, IDC_CYCLETIME, FALSE);
@@ -82,9 +82,9 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP Utils::enableDlgControl(hwndDlg, IDC_PRIMARYSTATUS, FALSE);
}
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));
{
- ptrA szPrimaryStatus(db_get_sa(NULL, "CList", "PrimaryStatus"));
+ ptrA szPrimaryStatus(g_plugin.getStringA("PrimaryStatus"));
int item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM)TranslateT("Global"));
SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETITEMDATA, item, (LPARAM)0);
@@ -103,9 +103,9 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETCURSEL, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETRANGE, 0, MAKELONG(0x3FFF, 250));
- SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(0, "CList", "IconFlashTime", 550), 0));
+ SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETPOS, 0, MAKELONG(g_plugin.getWord("IconFlashTime", 550), 0));
CheckDlgButton(hwndDlg, IDC_NOTRAYINFOTIPS, cfg::dat.bNoTrayTips ? 1 : 0);
- CheckDlgButton(hwndDlg, IDC_APPLYLASTVIEWMODE, db_get_b(0, "CList", "AutoApplyLastViewMode", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_APPLYLASTVIEWMODE, g_plugin.getByte("AutoApplyLastViewMode", 0) ? BST_CHECKED : BST_UNCHECKED);
return TRUE;
case WM_COMMAND:
@@ -135,19 +135,19 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (!opt_gen_opts_changed)
return TRUE;
- 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));
- db_set_b(0, "CList", "Tray1Click", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONECLK));
- db_set_b(0, "CList", "AlwaysStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYSSTATUS));
- db_set_b(0, "CList", "AlwaysMulti", (BYTE)BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_ALWAYSMULTI));
- db_set_b(0, "CList", "TrayIcon", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE) ? SETTING_TRAYICON_SINGLE : (IsDlgButtonChecked(hwndDlg, IDC_CYCLE) ? SETTING_TRAYICON_CYCLE : SETTING_TRAYICON_MULTI)));
- db_set_w(0, "CList", "CycleTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_GETPOS, 0, 0));
- 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));
- db_set_b(0, "CList", "NoIconBlink", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ICONBLINK));
- db_set_b(0, "CList", "AutoApplyLastViewMode", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_APPLYLASTVIEWMODE));
+ 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));
+ g_plugin.setByte("Tray1Click", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONECLK));
+ g_plugin.setByte("AlwaysStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYSSTATUS));
+ g_plugin.setByte("AlwaysMulti", (BYTE)BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_ALWAYSMULTI));
+ g_plugin.setByte("TrayIcon", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE) ? SETTING_TRAYICON_SINGLE : (IsDlgButtonChecked(hwndDlg, IDC_CYCLE) ? SETTING_TRAYICON_CYCLE : SETTING_TRAYICON_MULTI)));
+ g_plugin.setWord("CycleTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_GETPOS, 0, 0));
+ g_plugin.setWord("IconFlashTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0));
+ g_plugin.setByte("DisableTrayFlash", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
+ g_plugin.setByte("NoIconBlink", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ICONBLINK));
+ g_plugin.setByte("AutoApplyLastViewMode", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_APPLYLASTVIEWMODE));
__setFlag(CLUI_FRAME_EVENTAREASUNKEN, IsDlgButtonChecked(hwndDlg, IDC_EVENTAREASUNKEN));
__setFlag(CLUI_FRAME_AUTOHIDENOTIFY, IsDlgButtonChecked(hwndDlg, IDC_EVENTAREAAUTOHIDE));
@@ -156,14 +156,14 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP __setFlag(CLUI_FRAME_CLISTSUNKEN, IsDlgButtonChecked(hwndDlg, IDC_CLISTSUNKEN));
cfg::dat.bNoTrayTips = IsDlgButtonChecked(hwndDlg, IDC_NOTRAYINFOTIPS) ? 1 : 0;
- db_set_b(0, "CList", "NoTrayTips", (BYTE)cfg::dat.bNoTrayTips);
+ g_plugin.setByte("NoTrayTips", (BYTE)cfg::dat.bNoTrayTips);
{
int cursel = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETCURSEL, 0, 0);
PROTOACCOUNT *pa = (PROTOACCOUNT *)SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETITEMDATA, cursel, 0);
if (!pa)
- db_unset(NULL, "CList", "PrimaryStatus");
+ g_plugin.delSetting("PrimaryStatus");
else
- db_set_s(0, "CList", "PrimaryStatus", pa->szModuleName);
+ g_plugin.setString("PrimaryStatus", pa->szModuleName);
}
Clist_TrayIconIconsChanged();
db_set_dw(0, "CLUI", "Frameflags", cfg::dat.dwFlags);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 9db6420c46..182be342a1 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -161,9 +161,9 @@ static HWND PreCreateCLC(HWND parent) { g_clistApi.hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"", WS_CHILD | 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, parent, nullptr, g_plugin.getInst(), (LPVOID)0xff00ff00); @@ -450,10 +450,10 @@ void SetButtonStates() SendMessage(buttonItem->hWnd, BM_SETCHECK, cfg::dat.soundsOff ? BST_CHECKED : BST_UNCHECKED, 0); break; case IDC_STBHIDEOFFLINE: - SendMessage(buttonItem->hWnd, BM_SETCHECK, db_get_b(0, "CList", "HideOffline", 0) ? BST_CHECKED : BST_UNCHECKED, 0); + SendMessage(buttonItem->hWnd, BM_SETCHECK, g_plugin.getByte("HideOffline", 0) ? BST_CHECKED : BST_UNCHECKED, 0); break; case IDC_STBHIDEGROUPS: - SendMessage(buttonItem->hWnd, BM_SETCHECK, db_get_b(0, "CList", "UseGroups", 0) ? BST_CHECKED : BST_UNCHECKED, 0); + SendMessage(buttonItem->hWnd, BM_SETCHECK, g_plugin.getByte("UseGroups", 0) ? BST_CHECKED : BST_UNCHECKED, 0); break; } } @@ -730,7 +730,7 @@ static int ServiceParamsOK(ButtonItem *item, WPARAM *wParam, LPARAM *lParam, MCO static void ShowCLUI(HWND hwnd) { int state = old_cliststate; - int onTop = db_get_b(0, "CList", "OnTop", SETTING_ONTOP_DEFAULT); + int onTop = g_plugin.getByte("OnTop", SETTING_ONTOP_DEFAULT); SendMessage(hwnd, WM_SETREDRAW, FALSE, FALSE); @@ -786,8 +786,8 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l SetClassLong(g_clistApi.hwndStatus, GCL_STYLE, GetClassLong(g_clistApi.hwndStatus, GCL_STYLE) & ~(CS_VREDRAW | CS_HREDRAW)); } g_oldSize.cx = g_oldSize.cy = 0; - old_cliststate = db_get_b(0, "CList", "State", SETTING_STATE_NORMAL); - db_set_b(0, "CList", "State", SETTING_STATE_HIDDEN); + old_cliststate = g_plugin.getByte("State", SETTING_STATE_NORMAL); + g_plugin.setByte("State", SETTING_STATE_HIDDEN); SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~WS_VISIBLE); SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | WS_CLIPCHILDREN); if (!cfg::dat.bFirstRun) @@ -837,7 +837,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l } else { style &= ~(WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE); - if (db_get_b(0, "CList", "AlwaysHideOnTB", 1)) + if (g_plugin.getByte("AlwaysHideOnTB", 1)) style &= ~WS_EX_APPWINDOW; else style |= WS_EX_APPWINDOW; @@ -866,11 +866,11 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l Tweak_It(cfg::clcdat->bkColour); } - db_set_b(0, "CList", "State", old_cliststate); + g_plugin.setByte("State", old_cliststate); - if (db_get_b(0, "CList", "AutoApplyLastViewMode", 0)) { + if (g_plugin.getByte("AutoApplyLastViewMode", 0)) { DBVARIANT dbv = { 0 }; - if (!db_get_s(0, "CList", "LastViewMode", &dbv)) { + if (!g_plugin.getString("LastViewMode", &dbv)) { if (mir_strlen(dbv.pszVal) > 2) { if (db_get_dw(0, CLVM_MODULE, dbv.pszVal, -1) != 0xffffffff) ApplyViewMode((char *)dbv.pszVal); @@ -1115,11 +1115,11 @@ skipbg: // if docked, 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); } - db_set_dw(0, "CList", "Width", (DWORD)(rc.right - rc.left)); + g_plugin.setDword("Width", (DWORD)(rc.right - rc.left)); } } return TRUE; @@ -1130,7 +1130,7 @@ skipbg: case CLUIINTM_REMOVEFROMTASKBAR: { BYTE windowStyle = db_get_b(0, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT); - if (windowStyle == SETTING_WINDOWSTYLE_DEFAULT && db_get_b(0, "CList", "AlwaysHideOnTB", 0)) + if (windowStyle == SETTING_WINDOWSTYLE_DEFAULT && g_plugin.getByte("AlwaysHideOnTB", 0)) RemoveFromTaskBar(hwnd); return 0; } @@ -1152,7 +1152,7 @@ skipbg: SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), cfg::dat.alpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0)); transparentFocus = 1; } - SetWindowPos(g_clistApi.hwndContactList, db_get_b(0, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_NOSENDCHANGING); + SetWindowPos(g_clistApi.hwndContactList, g_plugin.getByte("OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_NOSENDCHANGING); } PostMessage(hwnd, CLUIINTM_REMOVEFROMTASKBAR, 0, 0); return DefWindowProc(hwnd, msg, wParam, lParam); @@ -1293,7 +1293,7 @@ skipbg: SendMessage(hwnd, WM_SIZE, 0, 0); SendMessage(hwnd, CLUIINTM_REDRAW, 0, 0); SendMessage(hwnd, CLUIINTM_STATUSBARUPDATE, 0, 0); - db_set_b(0, "CList", "State", SETTING_STATE_NORMAL); + g_plugin.setByte("State", SETTING_STATE_NORMAL); break; } } @@ -1302,8 +1302,8 @@ skipbg: return 0; if (wParam == SC_MINIMIZE) { - if (SETTING_WINDOWSTYLE_DEFAULT == bWindowStyle && !db_get_b(0, "CList", "AlwaysHideOnTB", 0)) { - db_set_b(0, "CList", "State", SETTING_STATE_MINIMIZED); + if (SETTING_WINDOWSTYLE_DEFAULT == bWindowStyle && !g_plugin.getByte("AlwaysHideOnTB", 0)) { + g_plugin.setByte("State", SETTING_STATE_MINIMIZED); break; } g_clistApi.pfnShowHide(); @@ -1716,7 +1716,7 @@ buttons_done: return 0; case WM_CLOSE: - if (SETTING_WINDOWSTYLE_DEFAULT == db_get_b(0, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT) && !db_get_b(0, "CList", "AlwaysHideOnTB", 0)) { + if (SETTING_WINDOWSTYLE_DEFAULT == db_get_b(0, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT) && !g_plugin.getByte("AlwaysHideOnTB", 0)) { PostMessage(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0); return 0; } @@ -1816,11 +1816,11 @@ void LoadCLUIModule(void) wndclass.lpszClassName = L"EventAreaClass"; RegisterClass(&wndclass); - oldhideoffline = db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT); - cluiPos.left = db_get_dw(0, "CList", "x", 600); - cluiPos.top = db_get_dw(0, "CList", "y", 200); - cluiPos.right = db_get_dw(0, "CList", "Width", 150); - cluiPos.bottom = db_get_dw(0, "CList", "Height", 350); + oldhideoffline = g_plugin.getByte("HideOffline", SETTING_HIDEOFFLINE_DEFAULT); + cluiPos.left = g_plugin.getDword("x", 600); + cluiPos.top = g_plugin.getDword("y", 200); + cluiPos.right = g_plugin.getDword("Width", 150); + cluiPos.bottom = g_plugin.getDword("Height", 350); LoadExtraIconModule(); LoadCLUIFramesModule(); diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp index 4798167798..5a62da3965 100644 --- a/plugins/Clist_nicer/src/cluiopts.cpp +++ b/plugins/Clist_nicer/src/cluiopts.cpp @@ -37,15 +37,15 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l TranslateDialogDefault(hwndDlg);
opt_clui_changed = 0;
- CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, db_get_b(0, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ALWAYSHIDEONTASKBAR, db_get_b(0, "CList", "AlwaysHideOnTB", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONTOP, db_get_b(0, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, g_plugin.getByte("BringToFront", SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALWAYSHIDEONTASKBAR, g_plugin.getByte("AlwaysHideOnTB", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONTOP, g_plugin.getByte("OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU, db_get_b(0, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CLIENTDRAG, db_get_b(0, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_FADEINOUT, cfg::dat.fadeinout ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_AUTOSIZE, cfg::dat.autosize ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DROPSHADOW, db_get_b(0, "CList", "WindowShadow", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONDESKTOP, db_get_b(0, "CList", "OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DROPSHADOW, g_plugin.getByte("WindowShadow", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONDESKTOP, g_plugin.getByte("OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_BORDERSTYLE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Title bar"));
SendDlgItemMessage(hwndDlg, IDC_BORDERSTYLE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Tool Window"));
@@ -70,9 +70,9 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l SendDlgItemMessage(hwndDlg, IDC_CBOTTOMSPIN, UDM_SETPOS, 0, cfg::dat.bCBottom);
CheckDlgButton(hwndDlg, IDC_AUTOSIZEUPWARD, db_get_b(0, "CLUI", "AutoSizeUpward", 0) ? 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));
Utils::enableDlgControl(hwndDlg, IDC_HIDETIME, IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
Utils::enableDlgControl(hwndDlg, IDC_HIDETIMESPIN, IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
Utils::enableDlgControl(hwndDlg, IDC_STATIC01, IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
@@ -84,7 +84,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l Utils::enableDlgControl(hwndDlg, IDC_AUTOSIZEUPWARD, FALSE);
}
{
- ptrW tszTitle(db_get_wsa(NULL, "CList", "TitleText"));
+ ptrW tszTitle(g_plugin.getWStringA("TitleText"));
if (tszTitle != NULL)
SetDlgItemText(hwndDlg, IDC_TITLETEXT, tszTitle);
else
@@ -175,7 +175,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l cfg::dat.gapBetweenFrames = GetDlgItemInt(hwndDlg, IDC_FRAMEGAP, &translated, FALSE);
db_set_dw(0, "CLUIFrames", "GapBetweenFrames", cfg::dat.gapBetweenFrames);
- db_set_b(0, "CList", "OnTop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
+ 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);
cfg::dat.bCLeft = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CLEFTSPIN, UDM_GETPOS, 0, 0);
@@ -186,8 +186,8 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l db_set_dw(0, "CLUI", "clmargins", MAKELONG(MAKEWORD(cfg::dat.bCLeft, cfg::dat.bCRight), MAKEWORD(cfg::dat.bCTop, cfg::dat.bCBottom)));
SendMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
- db_set_b(0, "CList", "BringToFront", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
- db_set_b(0, "CList", "AlwaysHideOnTB", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYSHIDEONTASKBAR));
+ g_plugin.setByte("BringToFront", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
+ g_plugin.setByte("AlwaysHideOnTB", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYSHIDEONTASKBAR));
if (windowStyle != SETTING_WINDOWSTYLE_DEFAULT) {
LONG style;
@@ -210,7 +210,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l LONG style;
style = GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE);
style &= ~(WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
- if (db_get_b(0, "CList", "AlwaysHideOnTB", 1))
+ if (g_plugin.getByte("AlwaysHideOnTB", 1))
style &= ~WS_EX_APPWINDOW;
else {
style |= WS_EX_APPWINDOW;
@@ -235,7 +235,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
- db_set_ws(0, "CList", "TitleText", title);
+ g_plugin.setWString("TitleText", title);
SetWindowText(g_clistApi.hwndContactList, title);
cfg::dat.dwFlags = IsDlgButtonChecked(hwndDlg, IDC_ROUNDEDBORDER) ? cfg::dat.dwFlags | CLUI_FRAME_ROUNDEDFRAME : cfg::dat.dwFlags & ~CLUI_FRAME_ROUNDEDFRAME;
@@ -248,17 +248,17 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l db_set_b(0, "CLUI", "MaxSizeHeight", (BYTE)GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, nullptr, FALSE));
db_set_b(0, "CLUI", "AutoSizeUpward", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZEUPWARD));
- 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));
- db_set_b(0, "CList", "Transparent", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
+ g_plugin.setByte("Transparent", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
cfg::dat.isTransparent = IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT) ? 1 : 0;
- db_set_b(0, "CList", "Alpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
+ g_plugin.setByte("Alpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
cfg::dat.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));
+ g_plugin.setByte("AutoAlpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0));
cfg::dat.autoalpha = (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0);
- db_set_b(0, "CList", "WindowShadow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW));
- db_set_b(0, "CList", "OnDesktop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
+ g_plugin.setByte("WindowShadow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW));
+ g_plugin.setByte("OnDesktop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
db_set_dw(0, "CLUI", "Frameflags", cfg::dat.dwFlags);
cfg::dat.bFullTransparent = IsDlgButtonChecked(hwndDlg, IDC_FULLTRANSPARENT) ? 1 : 0;
db_set_b(0, "CLUI", "fulltransparent", (BYTE)cfg::dat.bFullTransparent);
@@ -454,5 +454,5 @@ void ApplyCLUIBorderStyle() p.showCmd = SW_HIDE;
SetWindowPlacement(g_clistApi.hwndContactList, &p);
- db_set_b(0, "CList", "Min2Tray", minToTray);
+ g_plugin.setByte("Min2Tray", minToTray);
}
diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index 60a05ed26c..8f2e53debf 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -164,7 +164,7 @@ void CluiProtocolStatusChanged(int, const char*) int iIcon = 0;
int wStatus = 0;
- ptrA szPrimaryStatus(db_get_sa(NULL, "CList", "PrimaryStatus"));
+ ptrA szPrimaryStatus(g_plugin.getStringA("PrimaryStatus"));
if (szPrimaryStatus != nullptr) {
wStatus = Proto_GetStatus(szPrimaryStatus);
iIcon = IconFromStatusMode(szPrimaryStatus, (int)wStatus, 0);
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp index 284b22380e..5a78cdb154 100644 --- a/plugins/Clist_nicer/src/config.cpp +++ b/plugins/Clist_nicer/src/config.cpp @@ -57,7 +57,7 @@ TExtraCache* cfg::getCache(const MCONTACT hContact, const char *szProto) TExtraCache *p = (TExtraCache*)calloc(sizeof(TExtraCache), 1);
p->hContact = hContact;
LoadSkinItemToCache(p);
- p->dwDFlags = db_get_dw(hContact, "CList", "CLN_Flags", 0);
+ p->dwDFlags = g_plugin.getDword(hContact, "CLN_Flags");
GetCachedStatusMsg(p, const_cast<char *>(szProto));
p->dwLastMsgTime = INTSORT_GetLastMsgTime(hContact);
cfg::arCache.insert(p);
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index 2fcabf7dcb..bd5bc77671 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -90,15 +90,15 @@ static void MF_CalcFrequency(MCONTACT hContact, DWORD dwCutoffDays, int doSleep) if (eventCount == 0) {
frequency = 0x7fffffff;
- db_set_dw(hContact, "CList", "mf_firstEvent", curTime - (dwCutoffDays * 86400));
+ g_plugin.setDword(hContact, "mf_firstEvent", curTime - (dwCutoffDays * 86400));
}
else {
frequency = (curTime - dbei.timestamp) / eventCount;
- db_set_dw(hContact, "CList", "mf_firstEvent", dbei.timestamp);
+ g_plugin.setDword(hContact, "mf_firstEvent", dbei.timestamp);
}
- db_set_dw(hContact, "CList", "mf_freq", frequency);
- db_set_dw(hContact, "CList", "mf_count", eventCount);
+ g_plugin.setDword(hContact, "mf_freq", frequency);
+ g_plugin.setDword(hContact, "mf_count", eventCount);
}
extern wchar_t g_ptszEventName[];
@@ -128,11 +128,11 @@ void MF_UpdateThread(LPVOID) void MF_InitCheck(void)
{
- BYTE bMsgFrequency = db_get_b(0, "CList", "fhistdata", 0);
+ BYTE bMsgFrequency = g_plugin.getByte("fhistdata", 0);
if (!bMsgFrequency) {
for (auto &hContact : Contacts())
MF_CalcFrequency(hContact, 100, 0);
- db_set_b(0, "CList", "fhistdata", 1);
+ g_plugin.setByte("fhistdata", 1);
}
}
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index 94465ed1c6..4109653482 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -128,32 +128,32 @@ int CMPlugin::Load() cfg::dat.avatarBorder = (COLORREF)db_get_dw(0, "CLC", "avatarborder", 0);
cfg::dat.avatarRadius = (COLORREF)db_get_dw(0, "CLC", "avatarradius", 4);
cfg::dat.hBrushAvatarBorder = CreateSolidBrush(cfg::dat.avatarBorder);
- cfg::dat.avatarSize = db_get_w(0, "CList", "AvatarSize", 24);
+ cfg::dat.avatarSize = g_plugin.getWord("AvatarSize", 24);
cfg::dat.dualRowMode = db_get_b(0, "CLC", "DualRowMode", 0);
- cfg::dat.avatarPadding = db_get_b(0, "CList", "AvatarPadding", 0);
- cfg::dat.isTransparent = db_get_b(0, "CList", "Transparent", 0);
- cfg::dat.alpha = db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT);
- cfg::dat.autoalpha = db_get_b(0, "CList", "AutoAlpha", SETTING_ALPHA_DEFAULT);
+ cfg::dat.avatarPadding = g_plugin.getByte("AvatarPadding", 0);
+ cfg::dat.isTransparent = g_plugin.getByte("Transparent", 0);
+ cfg::dat.alpha = g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT);
+ cfg::dat.autoalpha = g_plugin.getByte("AutoAlpha", SETTING_ALPHA_DEFAULT);
cfg::dat.fadeinout = db_get_b(0, "CLUI", "FadeInOut", 0);
cfg::dat.autosize = db_get_b(0, "CLUI", "AutoSize", 0);
- cfg::dat.bNoOfflineAvatars = db_get_b(0, "CList", "NoOfflineAV", 1);
+ cfg::dat.bNoOfflineAvatars = g_plugin.getByte("NoOfflineAV", 1);
cfg::dat.bFullTransparent = db_get_b(0, "CLUI", "fulltransparent", 0);
cfg::dat.bDblClkAvatars = db_get_b(0, "CLC", "dblclkav", 0);
cfg::dat.bEqualSections = db_get_b(0, "CLUI", "EqualSections", 0);
cfg::dat.bCenterStatusIcons = db_get_b(0, "CLC", "si_centered", 1);
cfg::dat.boldHideOffline = -1;
cfg::dat.bSecIMAvail = ServiceExists("SecureIM/IsContactSecured") ? 1 : 0;
- cfg::dat.bNoTrayTips = db_get_b(0, "CList", "NoTrayTips", 0);
+ cfg::dat.bNoTrayTips = g_plugin.getByte("NoTrayTips", 0);
cfg::dat.bShowLocalTime = db_get_b(0, "CLC", "ShowLocalTime", 1);
cfg::dat.bShowLocalTimeSelective = db_get_b(0, "CLC", "SelectiveLocalTime", 1);
- cfg::dat.bDontSeparateOffline = db_get_b(0, "CList", "DontSeparateOffline", 0);
+ cfg::dat.bDontSeparateOffline = g_plugin.getByte("DontSeparateOffline", 0);
cfg::dat.bShowXStatusOnSbar = db_get_b(0, "CLUI", "xstatus_sbar", 0);
cfg::dat.bLayeredHack = db_get_b(0, "CLUI", "layeredhack", 1);
cfg::dat.bFirstRun = db_get_b(0, "CLUI", "firstrun", 1);
cfg::dat.langPackCP = Langpack_GetDefaultCodePage();
cfg::dat.realTimeSaving = db_get_b(0, "CLUI", "save_pos_always", 0);
- DWORD sortOrder = db_get_dw(0, "CList", "SortOrder", SORTBY_NAME);
+ DWORD sortOrder = g_plugin.getDword("SortOrder", SORTBY_NAME);
cfg::dat.sortOrder[0] = LOBYTE(LOWORD(sortOrder));
cfg::dat.sortOrder[1] = HIBYTE(LOWORD(sortOrder));
cfg::dat.sortOrder[2] = LOBYTE(HIWORD(sortOrder));
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 9a36ba6b49..82d6323b93 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -967,7 +967,7 @@ clvm_reset_command: SetButtonStates();
cfg::dat.current_viewmode[0] = 0;
cfg::dat.old_viewmode[0] = 0;
- db_set_s(0, "CList", "LastViewMode", "");
+ g_plugin.setString("LastViewMode", "");
break;
case IDC_CONFIGUREMODES:
@@ -1099,7 +1099,7 @@ void ApplyViewMode(const char *name) cfg::dat.bFilterEffective |= CLVM_STICKY_CONTACTS;
if (cfg::dat.boldHideOffline == (BYTE)-1)
- cfg::dat.boldHideOffline = db_get_b(0, "CList", "HideOffline", 0);
+ cfg::dat.boldHideOffline = g_plugin.getByte("HideOffline", 0);
g_clistApi.pfnSetHideOffline(false);
if (name == nullptr) {
@@ -1112,5 +1112,5 @@ void ApplyViewMode(const char *name) Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
SetButtonStates();
- db_set_s(0, "CList", "LastViewMode", cfg::dat.current_viewmode);
+ g_plugin.setString("LastViewMode", cfg::dat.current_viewmode);
}
|