summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Clist_nicer/src')
-rw-r--r--plugins/Clist_nicer/src/Docking.cpp6
-rw-r--r--plugins/Clist_nicer/src/clc.cpp32
-rw-r--r--plugins/Clist_nicer/src/clcitems.cpp68
-rw-r--r--plugins/Clist_nicer/src/clcmsgs.cpp2
-rw-r--r--plugins/Clist_nicer/src/clcopts.cpp114
-rw-r--r--plugins/Clist_nicer/src/clcpaint.cpp8
-rw-r--r--plugins/Clist_nicer/src/clcutils.cpp12
-rw-r--r--plugins/Clist_nicer/src/clistevents.cpp2
-rw-r--r--plugins/Clist_nicer/src/clistmenus.cpp26
-rw-r--r--plugins/Clist_nicer/src/clistmod.cpp12
-rw-r--r--plugins/Clist_nicer/src/clistopts.cpp62
-rw-r--r--plugins/Clist_nicer/src/clisttray.cpp10
-rw-r--r--plugins/Clist_nicer/src/clui.cpp151
-rw-r--r--plugins/Clist_nicer/src/cluiframes.cpp147
-rw-r--r--plugins/Clist_nicer/src/cluiopts.cpp118
-rw-r--r--plugins/Clist_nicer/src/cluiservices.cpp6
-rw-r--r--plugins/Clist_nicer/src/config.cpp104
-rw-r--r--plugins/Clist_nicer/src/config.h28
-rw-r--r--plugins/Clist_nicer/src/contact.cpp32
-rw-r--r--plugins/Clist_nicer/src/extBackg.cpp204
-rw-r--r--plugins/Clist_nicer/src/init.cpp62
-rw-r--r--plugins/Clist_nicer/src/statusbar.cpp6
-rw-r--r--plugins/Clist_nicer/src/viewmodes.cpp64
23 files changed, 558 insertions, 718 deletions
diff --git a/plugins/Clist_nicer/src/Docking.cpp b/plugins/Clist_nicer/src/Docking.cpp
index c8078da592..ef68bea039 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)
- cfg::writeByte("CList", "Docked", (BYTE)docked);
+ db_set_b(NULL, "CList", "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 (cfg::getByte("CList", "Docked", 0))
+ if (db_get_b(NULL, "CList", "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)cfg::getByte("CList", "Docked", 0);
+ docked = (int)(char)db_get_b(NULL, "CList", "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 8de01f2815..18127ae461 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 = { sizeof(dbei) };
db_event_get(lParam, &dbei);
if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) {
- DWORD firstTime = cfg::getDword(hContact, "CList", "mf_firstEvent", 0);
- DWORD count = cfg::getDword(hContact, "CList", "mf_count", 0);
+ DWORD firstTime = db_get_dw(hContact, "CList", "mf_firstEvent", 0);
+ DWORD count = db_get_dw(hContact, "CList", "mf_count", 0);
count++;
new_freq = count ? (dbei.timestamp - firstTime) / count : 0x7fffffff;
- cfg::writeDword(hContact, "CList", "mf_freq", new_freq);
- cfg::writeDword(hContact, "CList", "mf_count", count);
+ db_set_dw(hContact, "CList", "mf_freq", new_freq);
+ db_set_dw(hContact, "CList", "mf_count", count);
TExtraCache *p = cfg::getCache(hContact, NULL);
if (p) {
@@ -125,15 +125,15 @@ static int ClcSettingChanged(WPARAM hContact, LPARAM lParam)
szProto_s = NULL;
else
szProto_s = cws->value.pszVal;
- pcli->pfnChangeContactIcon(hContact, IconFromStatusMode(szProto_s, szProto_s == NULL ? ID_STATUS_OFFLINE : cfg::getWord(hContact, szProto_s, "Status", ID_STATUS_OFFLINE), hContact, NULL));
+ pcli->pfnChangeContactIcon(hContact, IconFromStatusMode(szProto_s, szProto_s == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto_s, "Status", ID_STATUS_OFFLINE), hContact, NULL));
}
// something is being written to a protocol module
if (!__strcmp(szProto, cws->szModule)) {
// was a unique setting key written?
if (!__strcmp(cws->szSetting, "Status")) {
- if (!cfg::getByte(hContact, "CList", "Hidden", 0))
+ if (!db_get_b(hContact, "CList", "Hidden", 0))
if (cws->value.wVal == ID_STATUS_OFFLINE)
- if (cfg::getByte("CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT))
+ if (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT))
return 0;
SendMessage(pcli->hwndContactTree, INTM_STATUSCHANGED, hContact, lParam);
@@ -156,12 +156,12 @@ static int ClcSettingChanged(WPARAM hContact, LPARAM lParam)
}
}
else if (!__strcmp(cws->szModule, "Skin") && !__strcmp(cws->szSetting, "UseSound")) {
- cfg::dat.soundsOff = cfg::getByte(cws->szModule, cws->szSetting, 0) ? 0 : 1;
+ cfg::dat.soundsOff = db_get_b(NULL, cws->szModule, cws->szSetting, 0) ? 0 : 1;
ClcSetButtonState(IDC_TBSOUND, cfg::dat.soundsOff ? BST_CHECKED : BST_UNCHECKED);
SetButtonStates();
}
else if (!__strcmp(cws->szModule, "CList") && !__strcmp(cws->szSetting, "UseGroups")) {
- ClcSetButtonState(IDC_TBHIDEGROUPS, cfg::getByte(cws->szModule, cws->szSetting, SETTING_USEGROUPS_DEFAULT));
+ ClcSetButtonState(IDC_TBHIDEGROUPS, db_get_b(NULL, cws->szModule, cws->szSetting, SETTING_USEGROUPS_DEFAULT));
SetButtonStates();
}
else if (!__strcmp(cws->szModule, "TopToolBar") && !__strcmp(cws->szSetting, "UseFlatButton")) {
@@ -317,7 +317,7 @@ LBL_Def:
if (szProto == NULL)
status = ID_STATUS_OFFLINE;
else
- status = cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ status = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
int shouldShow = (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN ||
!CLVM_GetContactHiddenStatus(hContact, szProto, dat)) && ((cfg::dat.bFilterEffective ? TRUE : !pcli->pfnIsHiddenMode(dat, status)) ||
@@ -416,7 +416,7 @@ LBL_Def:
case INTM_CODEPAGECHANGED:
if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
- contact->codePage = cfg::getDword(wParam, "Tab_SRMsg", "ANSIcodepage", cfg::getDword(wParam, "UserInfo", "ANSIcodepage", CP_ACP));
+ contact->codePage = db_get_dw(wParam, "Tab_SRMsg", "ANSIcodepage", db_get_dw(wParam, "UserInfo", "ANSIcodepage", CP_ACP));
PostMessage(hwnd, INTM_INVALIDATE, 0, 0);
goto LBL_Def;
@@ -445,7 +445,7 @@ LBL_Def:
if (contact->pExtra)
dwFlags = contact->pExtra->dwDFlags;
else
- dwFlags = cfg::getDword(contact->hContact, "CList", "CLN_Flags", 0);
+ dwFlags = db_get_dw(contact->hContact, "CList", "CLN_Flags", 0);
if (cfg::dat.dwFlags & CLUI_FRAME_AVATARS)
contact->cFlags = (dwFlags & ECF_HIDEAVATAR ? contact->cFlags & ~ECF_AVATAR : contact->cFlags | ECF_AVATAR);
else
@@ -473,7 +473,7 @@ LBL_Def:
case INTM_STATUSCHANGED:
if (FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) {
- WORD wStatus = cfg::getWord(wParam, contact->proto, "Status", ID_STATUS_OFFLINE);
+ WORD wStatus = db_get_w(wParam, contact->proto, "Status", ID_STATUS_OFFLINE);
if (cfg::dat.bNoOfflineAvatars && wStatus != ID_STATUS_OFFLINE && contact->wStatus == ID_STATUS_OFFLINE) {
contact->wStatus = wStatus;
if (cfg::dat.bAvatarServiceAvail && contact->ace == NULL)
@@ -538,7 +538,7 @@ LBL_Def:
break;
contact->flags &= ~CONTACTF_IDLE;
- if (cfg::getDword(wParam, szProto, "IdleTS", 0)) {
+ if (db_get_dw(wParam, szProto, "IdleTS", 0)) {
contact->flags |= CONTACTF_IDLE;
}
PostMessage(hwnd, INTM_INVALIDATE, 0, (LPARAM)contact->hContact);
@@ -558,12 +558,12 @@ LBL_Def:
if (!dat->bisEmbedded && szProto) { // may be a subcontact, forward the xstatus
MCONTACT hMasterContact = db_mc_tryMeta(hContact);
if (hMasterContact != hContact) // avoid recursive call of settings handler
- cfg::writeByte(hMasterContact, META_PROTO, "XStatusId", (BYTE)cfg::getByte(hContact, szProto, "XStatusId", 0));
+ db_set_b(hMasterContact, META_PROTO, "XStatusId", (BYTE)db_get_b(hContact, szProto, "XStatusId", 0));
break;
}
}
else {
- contact->xStatus = cfg::getByte(hContact, szProto, "XStatusId", 0);
+ contact->xStatus = db_get_b(hContact, szProto, "XStatusId", 0);
p = contact->pExtra;
}
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp
index 6f4324c90e..0d2f452208 100644
--- a/plugins/Clist_nicer/src/clcitems.cpp
+++ b/plugins/Clist_nicer/src/clcitems.cpp
@@ -83,7 +83,7 @@ void LoadAvatarForContact(ClcContact *p)
if (p->pExtra)
dwFlags = p->pExtra->dwDFlags;
else
- dwFlags = cfg::getDword(p->hContact, "CList", "CLN_Flags", 0);
+ dwFlags = db_get_dw(p->hContact, "CList", "CLN_Flags", 0);
if (cfg::dat.dwFlags & CLUI_FRAME_AVATARS)
p->cFlags = (dwFlags & ECF_HIDEAVATAR ? p->cFlags & ~ECF_AVATAR : p->cFlags | ECF_AVATAR);
@@ -107,8 +107,8 @@ int AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact)
int i = coreCli.pfnAddContactToGroup(dat, group, hContact);
ClcContact* p = group->cl.items[i];
- p->wStatus = cfg::getWord(hContact, p->proto, "Status", ID_STATUS_OFFLINE);
- p->xStatus = cfg::getByte(hContact, p->proto, "XStatusId", 0);
+ p->wStatus = db_get_w(hContact, p->proto, "Status", ID_STATUS_OFFLINE);
+ p->xStatus = db_get_b(hContact, p->proto, "XStatusId", 0);
if (p->proto)
p->bIsMeta = !mir_strcmp(p->proto, META_PROTO);
@@ -124,8 +124,8 @@ int AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact)
p->metaProto = NULL;
}
- p->codePage = cfg::getDword(hContact, "Tab_SRMsg", "ANSIcodepage", cfg::getDword(hContact, "UserInfo", "ANSIcodepage", CP_ACP));
- p->bSecondLine = cfg::getByte(hContact, "CList", "CLN_2ndline", cfg::dat.dualRowMode);
+ 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);
if (dat->bisEmbedded)
p->pExtra = 0;
@@ -143,7 +143,7 @@ int AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact)
RTL_DetectAndSet(p, p->hContact);
p->avatarLeft = p->extraIconRightBegin = -1;
- p->flags |= cfg::getByte(p->hContact, "CList", "Priority", 0) ? CONTACTF_PRIORITY : 0;
+ p->flags |= db_get_b(p->hContact, "CList", "Priority", 0) ? CONTACTF_PRIORITY : 0;
return i;
}
@@ -158,11 +158,11 @@ void RebuildEntireList(HWND hwnd, struct ClcData *dat)
RowHeight::getMaxRowHeight(dat, hwnd);
dat->list.expanded = 1;
- dat->list.hideOffline = cfg::getByte("CLC", "HideOfflineRoot", 0);
+ dat->list.hideOffline = db_get_b(NULL, "CLC", "HideOfflineRoot", 0);
dat->list.cl.count = 0;
dat->list.totalMembers = 0;
dat->selection = -1;
- dat->SelectMode = cfg::getByte("CLC", "SelectMode", 0);
+ dat->SelectMode = db_get_b(NULL, "CLC", "SelectMode", 0);
{
for (int i = 1;; i++) {
DWORD groupFlags;
@@ -176,7 +176,7 @@ void RebuildEntireList(HWND hwnd, struct ClcData *dat)
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (style & CLS_SHOWHIDDEN || !CLVM_GetContactHiddenStatus(hContact, NULL, dat)) {
memset(&dbv, 0, sizeof(dbv));
- if (cfg::getTString(hContact, "CList", "Group", &dbv))
+ if (db_get_ts(hContact, "CList", "Group", &dbv))
group = &dat->list;
else {
group = pcli->pfnAddGroup(hwnd, dat, dbv.ptszVal, (DWORD)-1, 0, 0);
@@ -191,7 +191,7 @@ void RebuildEntireList(HWND hwnd, struct ClcData *dat)
if (!pcli->pfnIsHiddenMode(dat, ID_STATUS_OFFLINE))
AddContactToGroup(dat, group, hContact);
}
- else if (!pcli->pfnIsHiddenMode(dat, (WORD)cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE)))
+ else if (!pcli->pfnIsHiddenMode(dat, (WORD)db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE)))
AddContactToGroup(dat, group, hContact);
}
else AddContactToGroup(dat, group, hContact);
@@ -239,7 +239,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
MCONTACT hContact = p->hContact;
DBVARIANT dbv = { 0 };
- INT_PTR result = cfg::getTString(hContact, "CList", "StatusMsg", &dbv);
+ INT_PTR result = db_get_ts(hContact, "CList", "StatusMsg", &dbv);
if (!result && mir_tstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_CLIST;
else {
@@ -248,11 +248,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
if (szProto) {
if (!result)
db_free(&dbv);
- if (!(result = cfg::getTString(hContact, szProto, "YMsg", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
+ if (!(result = db_get_ts(hContact, szProto, "YMsg", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_YIM;
- else if (!(result = cfg::getTString(hContact, szProto, "StatusDescr", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
+ else if (!(result = db_get_ts(hContact, szProto, "StatusDescr", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_GG;
- else if (!(result = cfg::getTString(hContact, szProto, "XStatusMsg", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
+ else if (!(result = db_get_ts(hContact, szProto, "XStatusMsg", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_XSTATUS;
}
}
@@ -260,7 +260,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
if (p->bStatusMsgValid == STATUSMSG_NOTFOUND) { // no status msg, consider xstatus name (if available)
if (!result)
db_free(&dbv);
- result = cfg::getTString(hContact, szProto, "XStatusName", &dbv);
+ result = db_get_ts(hContact, szProto, "XStatusName", &dbv);
if (!result && mir_tstrlen(dbv.ptszVal) > 1) {
size_t iLen = mir_tstrlen(dbv.ptszVal);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
@@ -402,40 +402,40 @@ void GetExtendedInfo(ClcContact *contact, ClcData *dat)
if (p == NULL)
return;
- p->msgFrequency = cfg::getDword(contact->hContact, "CList", "mf_freq", 0x7fffffff);
+ p->msgFrequency = db_get_dw(contact->hContact, "CList", "mf_freq", 0x7fffffff);
if (p->valid)
return;
p->valid = TRUE;
- p->isChatRoom = cfg::getByte(contact->hContact, contact->proto, "ChatRoom", 0);
+ p->isChatRoom = db_get_b(contact->hContact, contact->proto, "ChatRoom", 0);
}
void LoadSkinItemToCache(TExtraCache *cEntry)
{
MCONTACT hContact = cEntry->hContact;
- if (cfg::getByte(hContact, "EXTBK", "VALID", 0)) {
+ if (db_get_b(hContact, "EXTBK", "VALID", 0)) {
if (cEntry->status_item == NULL)
cEntry->status_item = reinterpret_cast<StatusItems_t *>(malloc(sizeof(StatusItems_t)));
memset(cEntry->status_item, 0, sizeof(StatusItems_t));
mir_strcpy(cEntry->status_item->szName, "{--CONTACT--}"); // mark as "per contact" item
cEntry->status_item->IGNORED = 0;
- cEntry->status_item->TEXTCOLOR = cfg::getDword(hContact, "EXTBK", "TEXT", RGB(20, 20, 20));
- cEntry->status_item->COLOR = cfg::getDword(hContact, "EXTBK", "COLOR1", RGB(224, 224, 224));
- cEntry->status_item->COLOR2 = cfg::getDword(hContact, "EXTBK", "COLOR2", RGB(224, 224, 224));
- cEntry->status_item->ALPHA = (BYTE)cfg::getByte(hContact, "EXTBK", "ALPHA", 100);
+ cEntry->status_item->TEXTCOLOR = db_get_dw(hContact, "EXTBK", "TEXT", RGB(20, 20, 20));
+ cEntry->status_item->COLOR = db_get_dw(hContact, "EXTBK", "COLOR1", RGB(224, 224, 224));
+ cEntry->status_item->COLOR2 = db_get_dw(hContact, "EXTBK", "COLOR2", RGB(224, 224, 224));
+ cEntry->status_item->ALPHA = (BYTE)db_get_b(hContact, "EXTBK", "ALPHA", 100);
- cEntry->status_item->MARGIN_LEFT = (DWORD)cfg::getByte(hContact, "EXTBK", "LEFT", 0);
- cEntry->status_item->MARGIN_RIGHT = (DWORD)cfg::getByte(hContact, "EXTBK", "RIGHT", 0);
- cEntry->status_item->MARGIN_TOP = (DWORD)cfg::getByte(hContact, "EXTBK", "TOP", 0);
- cEntry->status_item->MARGIN_BOTTOM = (DWORD)cfg::getByte(hContact, "EXTBK", "BOTTOM", 0);
+ cEntry->status_item->MARGIN_LEFT = (DWORD)db_get_b(hContact, "EXTBK", "LEFT", 0);
+ cEntry->status_item->MARGIN_RIGHT = (DWORD)db_get_b(hContact, "EXTBK", "RIGHT", 0);
+ cEntry->status_item->MARGIN_TOP = (DWORD)db_get_b(hContact, "EXTBK", "TOP", 0);
+ cEntry->status_item->MARGIN_BOTTOM = (DWORD)db_get_b(hContact, "EXTBK", "BOTTOM", 0);
- cEntry->status_item->COLOR2_TRANSPARENT = (BYTE)cfg::getByte(hContact, "EXTBK", "TRANS", 1);
- cEntry->status_item->BORDERSTYLE = cfg::getDword(hContact, "EXTBK", "BDR", 0);
+ cEntry->status_item->COLOR2_TRANSPARENT = (BYTE)db_get_b(hContact, "EXTBK", "TRANS", 1);
+ cEntry->status_item->BORDERSTYLE = db_get_dw(hContact, "EXTBK", "BDR", 0);
- cEntry->status_item->CORNER = cfg::getByte(hContact, "EXTBK", "CORNER", 0);
- cEntry->status_item->GRADIENT = cfg::getByte(hContact, "EXTBK", "GRAD", 0);
+ cEntry->status_item->CORNER = db_get_b(hContact, "EXTBK", "CORNER", 0);
+ cEntry->status_item->GRADIENT = db_get_b(hContact, "EXTBK", "GRAD", 0);
}
else if (cEntry->status_item) {
free(cEntry->status_item);
@@ -451,7 +451,7 @@ void LoadSkinItemToCache(TExtraCache *cEntry)
int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, struct ClcData *dat)
{
- int dbHidden = cfg::getByte(hContact, "CList", "Hidden", 0); // default hidden state, always respect it.
+ int dbHidden = db_get_b(hContact, "CList", "Hidden", 0); // default hidden state, always respect it.
// always hide subcontacts (but show them on embedded contact lists)
if (dat != NULL && dat->bHideSubcontacts && cfg::dat.bMetaEnabled && db_mc_isSub(hContact))
@@ -464,10 +464,10 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, str
szProto = GetContactProto(hContact);
// check stickies first (priority), only if we really have stickies defined (CLVM_STICKY_CONTACTS is set).
if (cfg::dat.bFilterEffective & CLVM_STICKY_CONTACTS) {
- DWORD dwLocalMask = cfg::getDword(hContact, "CLVM", cfg::dat.current_viewmode, 0);
+ DWORD dwLocalMask = db_get_dw(hContact, "CLVM", cfg::dat.current_viewmode, 0);
if (dwLocalMask != 0) {
if (cfg::dat.bFilterEffective & CLVM_FILTER_STICKYSTATUS) {
- WORD wStatus = cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ WORD wStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
return !((1 << (wStatus - ID_STATUS_OFFLINE)) & HIWORD(dwLocalMask));
}
return 0;
@@ -496,7 +496,7 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, str
}
if (cfg::dat.bFilterEffective & CLVM_FILTER_STATUS) {
- WORD wStatus = cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ WORD wStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
filterResult = (cfg::dat.filterFlags & CLVM_GROUPSTATUS_OP) ? ((filterResult | ((1 << (wStatus - ID_STATUS_OFFLINE)) & cfg::dat.statusMaskFilter ? 1 : 0))) : (filterResult & ((1 << (wStatus - ID_STATUS_OFFLINE)) & cfg::dat.statusMaskFilter ? 1 : 0));
}
diff --git a/plugins/Clist_nicer/src/clcmsgs.cpp b/plugins/Clist_nicer/src/clcmsgs.cpp
index e7ed4ff5fd..3c8e58591b 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;
- cfg::writeByte(contact->hContact, "CList", "Priority", (BYTE)(contact->flags & CONTACTF_PRIORITY ? 1 : 0));
+ db_set_b(contact->hContact, "CList", "Priority", (BYTE)(contact->flags & CONTACTF_PRIORITY ? 1 : 0));
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
}
return 0;
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp
index 654fe2be0b..5a0f2bfb95 100644
--- a/plugins/Clist_nicer/src/clcopts.cpp
+++ b/plugins/Clist_nicer/src/clcopts.cpp
@@ -117,7 +117,7 @@ static void cfgSetFlag(HWND hwndDlg, int ctrlId, DWORD dwMask)
cfg::dat.dwFlags |= dwMask;
else
cfg::dat.dwFlags &= ~dwMask;
- cfg::writeDword("CLUI", "Frameflags", cfg::dat.dwFlags);
+ db_set_dw(NULL, "CLUI", "Frameflags", cfg::dat.dwFlags);
}
void GetDefaultFontSetting(int i, LOGFONT *lf, COLORREF *colour)
@@ -155,26 +155,26 @@ static INT_PTR CALLBACK DlgProcDspGroups(HWND hwndDlg, UINT msg, WPARAM wParam,
SendDlgItemMessage(hwndDlg, IDC_GROUPALIGN, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always right"));
SendDlgItemMessage(hwndDlg, IDC_GROUPALIGN, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Automatic (RTL)"));
- DWORD exStyle = cfg::getDword("CLC", "ExStyle", pcli->pfnGetDefaultExStyle());
+ DWORD exStyle = db_get_dw(NULL, "CLC", "ExStyle", pcli->pfnGetDefaultExStyle());
for (int i = 0; i < _countof(checkBoxToGroupStyleEx); i++)
CheckDlgButton(hwndDlg, checkBoxToGroupStyleEx[i].id, (exStyle & checkBoxToGroupStyleEx[i].flag) ^ (checkBoxToGroupStyleEx[i].flag * checkBoxToGroupStyleEx[i].not_t) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_NOGROUPICON, (cfg::dat.dwFlags & CLUI_FRAME_NOGROUPICON) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CENTERGROUPNAMES, cfg::getByte("CLCExt", "EXBK_CenterGroupnames", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CENTERGROUPNAMES, db_get_b(NULL, "CLCExt", "EXBK_CenterGroupnames", 0) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_GROUPALIGN, CB_SETCURSEL, cfg::dat.bGroupAlign, 0);
SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_SETRANGE, 0, MAKELONG(64, 0));
- SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_SETPOS, 0, cfg::getByte("CLC", "LeftMargin", CLCDEFAULT_LEFTMARGIN));
+ SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLC", "LeftMargin", CLCDEFAULT_LEFTMARGIN));
SendDlgItemMessage(hwndDlg, IDC_RIGHTMARGINSPIN, UDM_SETRANGE, 0, MAKELONG(64, 0));
- SendDlgItemMessage(hwndDlg, IDC_RIGHTMARGINSPIN, UDM_SETPOS, 0, cfg::getByte("CLC", "RightMargin", CLCDEFAULT_LEFTMARGIN));
+ SendDlgItemMessage(hwndDlg, IDC_RIGHTMARGINSPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLC", "RightMargin", CLCDEFAULT_LEFTMARGIN));
SendDlgItemMessage(hwndDlg, IDC_ROWGAPSPIN, UDM_SETRANGE, 0, MAKELONG(10, 0));
SendDlgItemMessage(hwndDlg, IDC_ROWGAPSPIN, UDM_SETPOS, 0, cfg::dat.bRowSpacing);
SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_SETRANGE, 0, MAKELONG(50, 0));
- SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_SETPOS, 0, cfg::getByte("CLC", "GroupIndent", CLCDEFAULT_GROUPINDENT));
+ SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLC", "GroupIndent", CLCDEFAULT_GROUPINDENT));
SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_SETRANGE, 0, MAKELONG(255, 8));
- SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_SETPOS, 0, cfg::getByte("CLC", "RowHeight", CLCDEFAULT_ROWHEIGHT));
+ SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLC", "RowHeight", CLCDEFAULT_ROWHEIGHT));
SendDlgItemMessage(hwndDlg, IDC_GROUPROWHEIGHTSPIN, UDM_SETRANGE, 0, MAKELONG(255, 8));
- SendDlgItemMessage(hwndDlg, IDC_GROUPROWHEIGHTSPIN, UDM_SETPOS, 0, cfg::getByte("CLC", "GRowHeight", CLCDEFAULT_ROWHEIGHT));
+ SendDlgItemMessage(hwndDlg, IDC_GROUPROWHEIGHTSPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLC", "GRowHeight", CLCDEFAULT_ROWHEIGHT));
SendDlgItemMessage(hwndDlg, IDC_AVATARPADDINGSPIN, UDM_SETRANGE, 0, MAKELONG(10, 0));
SendDlgItemMessage(hwndDlg, IDC_AVATARPADDINGSPIN, UDM_SETPOS, 0, cfg::dat.avatarPadding);
}
@@ -193,7 +193,7 @@ static INT_PTR CALLBACK DlgProcDspGroups(HWND hwndDlg, UINT msg, WPARAM wParam,
switch (((LPNMHDR)lParam)->idFrom) {
case 0:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- DWORD exStyle = cfg::getDword("CLC", "ExStyle", pcli->pfnGetDefaultExStyle());
+ DWORD exStyle = db_get_dw(NULL, "CLC", "ExStyle", pcli->pfnGetDefaultExStyle());
for (int i = 0; i < _countof(checkBoxToGroupStyleEx); i++) {
if ((IsDlgButtonChecked(hwndDlg, checkBoxToGroupStyleEx[i].id) == 0) == checkBoxToGroupStyleEx[i].not_t)
@@ -201,30 +201,30 @@ static INT_PTR CALLBACK DlgProcDspGroups(HWND hwndDlg, UINT msg, WPARAM wParam,
else
exStyle &= ~(checkBoxToGroupStyleEx[i].flag);
}
- cfg::writeDword("CLC", "ExStyle", exStyle);
+ db_set_dw(NULL, "CLC", "ExStyle", exStyle);
cfgSetFlag(hwndDlg, IDC_NOGROUPICON, CLUI_FRAME_NOGROUPICON);
- cfg::writeByte("CLCExt", "EXBK_CenterGroupnames", IsDlgButtonChecked(hwndDlg, IDC_CENTERGROUPNAMES) ? 1 : 0);
+ db_set_b(NULL, "CLCExt", "EXBK_CenterGroupnames", IsDlgButtonChecked(hwndDlg, IDC_CENTERGROUPNAMES) ? 1 : 0);
LRESULT curSel = SendDlgItemMessage(hwndDlg, IDC_GROUPALIGN, CB_GETCURSEL, 0, 0);
if (curSel != CB_ERR) {
cfg::dat.bGroupAlign = (BYTE)curSel;
- cfg::writeByte("CLC", "GroupAlign", cfg::dat.bGroupAlign);
+ db_set_b(NULL, "CLC", "GroupAlign", cfg::dat.bGroupAlign);
}
cfg::dat.bRowSpacing = (BYTE)SendDlgItemMessage(hwndDlg, IDC_ROWGAPSPIN, UDM_GETPOS, 0, 0);
- cfg::writeByte("CLC", "RowGap", cfg::dat.bRowSpacing);
+ db_set_b(NULL, "CLC", "RowGap", cfg::dat.bRowSpacing);
BOOL translated;
cfg::dat.avatarPadding = (BYTE)GetDlgItemInt(hwndDlg, IDC_AVATARPADDING, &translated, FALSE);
- cfg::writeByte("CList", "AvatarPadding", cfg::dat.avatarPadding);
+ db_set_b(NULL, "CList", "AvatarPadding", cfg::dat.avatarPadding);
- cfg::writeByte("CLC", "LeftMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
- cfg::writeByte("CLC", "RightMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_RIGHTMARGINSPIN, UDM_GETPOS, 0, 0));
- cfg::writeByte("CLC", "GroupIndent", (BYTE)SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0));
- cfg::writeByte("CLC", "RowHeight", (BYTE)SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_GETPOS, 0, 0));
- cfg::writeByte("CLC", "GRowHeight", (BYTE)SendDlgItemMessage(hwndDlg, IDC_GROUPROWHEIGHTSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(NULL, "CLC", "LeftMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(NULL, "CLC", "RightMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_RIGHTMARGINSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(NULL, "CLC", "GroupIndent", (BYTE)SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(NULL, "CLC", "RowHeight", (BYTE)SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(NULL, "CLC", "GRowHeight", (BYTE)SendDlgItemMessage(hwndDlg, IDC_GROUPROWHEIGHTSPIN, UDM_GETPOS, 0, 0));
return TRUE;
}
break;
@@ -255,7 +255,7 @@ static INT_PTR CALLBACK DlgProcDspItems(HWND hwndDlg, UINT msg, WPARAM wParam, L
SendDlgItemMessage(hwndDlg, IDC_CLISTALIGN, CB_INSERTSTRING, -1, (LPARAM)TranslateT("For RTL only"));
SendDlgItemMessage(hwndDlg, IDC_CLISTALIGN, CB_INSERTSTRING, -1, (LPARAM)TranslateT("RTL TEXT only"));
- FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), offlineValues, sizeof(offlineValues) / sizeof(offlineValues[0]), cfg::getDword("CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES));
+ FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), offlineValues, sizeof(offlineValues) / sizeof(offlineValues[0]), db_get_dw(NULL, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES));
CheckDlgButton(hwndDlg, IDC_EVENTSONTOP, (cfg::dat.dwFlags & CLUI_STICKYEVENTS) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DONTSEPARATE, cfg::dat.bDontSeparateOffline ? BST_CHECKED : BST_UNCHECKED);
for (int i = 0; sortCtrlIDs[i] != 0; i++)
@@ -302,17 +302,17 @@ static INT_PTR CALLBACK DlgProcDspItems(HWND hwndDlg, UINT msg, WPARAM wParam, L
else
cfg::dat.sortOrder[i] = (BYTE)curSel;
}
- cfg::writeDword("CList", "SortOrder", MAKELONG(MAKEWORD(cfg::dat.sortOrder[0], cfg::dat.sortOrder[1]), MAKEWORD(cfg::dat.sortOrder[2], 0)));
+ db_set_dw(NULL, "CList", "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;
- cfg::writeByte("CList", "DontSeparateOffline", (BYTE)cfg::dat.bDontSeparateOffline);
+ db_set_b(NULL, "CList", "DontSeparateOffline", (BYTE)cfg::dat.bDontSeparateOffline);
- cfg::writeDword("CLC", "OfflineModes", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS)));
+ db_set_dw(NULL, "CLC", "OfflineModes", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS)));
cfgSetFlag(hwndDlg, IDC_EVENTSONTOP, CLUI_STICKYEVENTS);
cfg::dat.bUseDCMirroring = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CLISTALIGN, CB_GETCURSEL, 0, 0);
- cfg::writeByte("CLC", "MirrorDC", cfg::dat.bUseDCMirroring);
+ db_set_b(NULL, "CLC", "MirrorDC", cfg::dat.bUseDCMirroring);
return TRUE;
}
break;
@@ -437,23 +437,23 @@ static INT_PTR CALLBACK DlgProcDspAdvanced(HWND hwndDlg, UINT msg, WPARAM wParam
cfgSetFlag(hwndDlg, IDC_SHOWSTATUSMSG, CLUI_FRAME_SHOWSTATUSMSG);
cfg::dat.avatarBorder = SendDlgItemMessage(hwndDlg, IDC_AVATARBORDERCLR, CPM_GETCOLOUR, 0, 0);
- cfg::writeDword("CLC", "avatarborder", cfg::dat.avatarBorder);
+ db_set_dw(NULL, "CLC", "avatarborder", cfg::dat.avatarBorder);
BOOL translated;
cfg::dat.avatarRadius = GetDlgItemInt(hwndDlg, IDC_RADIUS, &translated, FALSE);
- cfg::writeDword("CLC", "avatarradius", cfg::dat.avatarRadius);
+ db_set_dw(NULL, "CLC", "avatarradius", cfg::dat.avatarRadius);
cfg::dat.avatarSize = GetDlgItemInt(hwndDlg, IDC_AVATARHEIGHT, &translated, FALSE);
- cfg::writeWord(NULL, "CList", "AvatarSize", (WORD)cfg::dat.avatarSize);
+ db_set_w(NULL, "CList", "AvatarSize", (WORD)cfg::dat.avatarSize);
cfg::dat.bNoOfflineAvatars = IsDlgButtonChecked(hwndDlg, IDC_NOAVATARSOFFLINE) ? TRUE : FALSE;
- cfg::writeByte("CList", "NoOfflineAV", (BYTE)cfg::dat.bNoOfflineAvatars);
+ db_set_b(NULL, "CList", "NoOfflineAV", (BYTE)cfg::dat.bNoOfflineAvatars);
cfg::dat.bShowLocalTime = IsDlgButtonChecked(hwndDlg, IDC_SHOWLOCALTIME) ? 1 : 0;
- cfg::writeByte("CLC", "ShowLocalTime", (BYTE)cfg::dat.bShowLocalTime);
+ db_set_b(NULL, "CLC", "ShowLocalTime", (BYTE)cfg::dat.bShowLocalTime);
cfg::dat.bShowLocalTimeSelective = IsDlgButtonChecked(hwndDlg, IDC_SHOWLOCALTIMEONLYWHENDIFFERENT) ? 1 : 0;
- cfg::writeByte("CLC", "SelectiveLocalTime", (BYTE)cfg::dat.bShowLocalTimeSelective);
+ db_set_b(NULL, "CLC", "SelectiveLocalTime", (BYTE)cfg::dat.bShowLocalTimeSelective);
KillTimer(pcli->hwndContactTree, TIMERID_REFRESH);
if (cfg::dat.bShowLocalTime)
@@ -462,7 +462,7 @@ static INT_PTR CALLBACK DlgProcDspAdvanced(HWND hwndDlg, UINT msg, WPARAM wParam
cfg::dat.dualRowMode = (BYTE)SendDlgItemMessage(hwndDlg, IDC_DUALROWMODE, CB_GETCURSEL, 0, 0);
if (cfg::dat.dualRowMode == CB_ERR)
cfg::dat.dualRowMode = 0;
- cfg::writeByte("CLC", "DualRowMode", cfg::dat.dualRowMode);
+ db_set_b(NULL, "CLC", "DualRowMode", cfg::dat.dualRowMode);
return TRUE;
}
break;
@@ -484,7 +484,7 @@ static INT_PTR CALLBACK DlgProcIcons(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPar
CheckDlgButton(hwndDlg, IDC_SELECTIVEICONS, (cfg::dat.dwFlags & CLUI_FRAME_SELECTIVEICONS) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_STATUSICONSCENTERED, cfg::dat.bCenterStatusIcons ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_IDLE, cfg::getByte("CLC", "ShowIdle", CLCDEFAULT_SHOWIDLE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_IDLE, db_get_b(NULL, "CLC", "ShowIdle", CLCDEFAULT_SHOWIDLE) ? BST_CHECKED : BST_UNCHECKED);
return TRUE;
case WM_COMMAND:
@@ -500,10 +500,10 @@ static INT_PTR CALLBACK DlgProcIcons(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPar
cfgSetFlag(hwndDlg, IDC_XSTATUSASSTATUS, CLUI_FRAME_USEXSTATUSASSTATUS);
cfgSetFlag(hwndDlg, IDC_SELECTIVEICONS, CLUI_FRAME_SELECTIVEICONS);
- cfg::writeByte("CLC", "ShowIdle", IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0);
+ db_set_b(NULL, "CLC", "ShowIdle", IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0);
cfg::dat.bCenterStatusIcons = IsDlgButtonChecked(hwndDlg, IDC_STATUSICONSCENTERED) ? 1 : 0;
- cfg::writeByte("CLC", "si_centered", (BYTE)cfg::dat.bCenterStatusIcons);
+ db_set_b(NULL, "CLC", "si_centered", (BYTE)cfg::dat.bCenterStatusIcons);
return TRUE;
}
break;
@@ -596,11 +596,11 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam
opt_clc_main_changed = 0;
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
{
- DWORD exStyle = cfg::getDword("CLC", "ExStyle", pcli->pfnGetDefaultExStyle());
+ DWORD exStyle = db_get_dw(NULL, "CLC", "ExStyle", pcli->pfnGetDefaultExStyle());
UDACCEL accel[2] = { { 0, 10 }, { 2, 50 } };
SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_SETRANGE, 0, MAKELONG(999, 0));
SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_SETACCEL, _countof(accel), (LPARAM)&accel);
- SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_SETPOS, 0, MAKELONG(cfg::getWord("CLC", "ScrollTime", CLCDEFAULT_SCROLLTIME), 0));
+ SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, "CLC", "ScrollTime", CLCDEFAULT_SCROLLTIME), 0));
for (int i = 0; i < _countof(checkBoxToStyleEx); i++)
CheckDlgButton(hwndDlg, checkBoxToStyleEx[i].id, (exStyle & checkBoxToStyleEx[i].flag) ^ (checkBoxToStyleEx[i].flag * checkBoxToStyleEx[i].not_t) ? BST_CHECKED : BST_UNCHECKED);
@@ -608,11 +608,11 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam
CheckDlgButton(hwndDlg, IDC_FULLROWSELECT, (cfg::dat.dwFlags & CLUI_FULLROWSELECT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DBLCLKAVATARS, cfg::dat.bDblClkAvatars ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_GREYOUT, cfg::getDword("CLC", "GreyoutFlags", CLCDEFAULT_GREYOUTFLAGS) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_GREYOUT, db_get_dw(NULL, "CLC", "GreyoutFlags", CLCDEFAULT_GREYOUTFLAGS) ? BST_CHECKED : BST_UNCHECKED);
Utils::enableDlgControl(hwndDlg, IDC_SMOOTHTIME, IsDlgButtonChecked(hwndDlg, IDC_NOTNOSMOOTHSCROLLING));
Utils::enableDlgControl(hwndDlg, IDC_GREYOUTOPTS, IsDlgButtonChecked(hwndDlg, IDC_GREYOUT));
- FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), greyoutValues, sizeof(greyoutValues) / sizeof(greyoutValues[0]), cfg::getDword("CLC", "FullGreyoutFlags", CLCDEFAULT_FULLGREYOUTFLAGS));
- CheckDlgButton(hwndDlg, IDC_NOSCROLLBAR, cfg::getByte("CLC", "NoVScrollBar", 0) ? BST_CHECKED : BST_UNCHECKED);
+ FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), greyoutValues, sizeof(greyoutValues) / sizeof(greyoutValues[0]), db_get_dw(NULL, "CLC", "FullGreyoutFlags", CLCDEFAULT_FULLGREYOUTFLAGS));
+ CheckDlgButton(hwndDlg, IDC_NOSCROLLBAR, db_get_b(NULL, "CLC", "NoVScrollBar", 0) ? BST_CHECKED : BST_UNCHECKED);
return TRUE;
case WM_VSCROLL:
@@ -659,7 +659,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam
return TRUE;
int i;
- DWORD exStyle = cfg::getDword("CLC", "ExStyle", CLCDEFAULT_EXSTYLE);
+ DWORD exStyle = db_get_dw(NULL, "CLC", "ExStyle", CLCDEFAULT_EXSTYLE);
for (i = 0; i < sizeof(checkBoxToStyleEx) / sizeof(checkBoxToStyleEx[0]); i++)
exStyle &= ~(checkBoxToStyleEx[i].flag);
@@ -668,21 +668,21 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam
if ((IsDlgButtonChecked(hwndDlg, checkBoxToStyleEx[i].id) == 0) == checkBoxToStyleEx[i].not_t)
exStyle |= checkBoxToStyleEx[i].flag;
}
- cfg::writeDword("CLC", "ExStyle", exStyle);
+ db_set_dw(NULL, "CLC", "ExStyle", exStyle);
DWORD fullGreyoutFlags = MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS));
- cfg::writeDword("CLC", "FullGreyoutFlags", fullGreyoutFlags);
+ db_set_dw(NULL, "CLC", "FullGreyoutFlags", fullGreyoutFlags);
if (IsDlgButtonChecked(hwndDlg, IDC_GREYOUT))
- cfg::writeDword("CLC", "GreyoutFlags", fullGreyoutFlags);
+ db_set_dw(NULL, "CLC", "GreyoutFlags", fullGreyoutFlags);
else
- cfg::writeDword("CLC", "GreyoutFlags", 0);
+ db_set_dw(NULL, "CLC", "GreyoutFlags", 0);
cfgSetFlag(hwndDlg, IDC_FULLROWSELECT, CLUI_FULLROWSELECT);
- cfg::writeWord("CLC", "ScrollTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_GETPOS, 0, 0));
- cfg::writeByte("CLC", "NoVScrollBar", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NOSCROLLBAR) ? 1 : 0));
+ db_set_w(NULL, "CLC", "ScrollTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_GETPOS, 0, 0));
+ db_set_b(NULL, "CLC", "NoVScrollBar", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NOSCROLLBAR) ? 1 : 0));
cfg::dat.bDblClkAvatars = IsDlgButtonChecked(hwndDlg, IDC_DBLCLKAVATARS) ? TRUE : FALSE;
- cfg::writeByte("CLC", "dblclkav", (BYTE)cfg::dat.bDblClkAvatars);
+ db_set_b(NULL, "CLC", "dblclkav", (BYTE)cfg::dat.bDblClkAvatars);
pcli->pfnClcOptionsChanged();
CoolSB_SetupScrollBar();
@@ -704,13 +704,13 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
case WM_INITDIALOG:
opt_clc_bkg_changed = 0;
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_BITMAP, cfg::getByte("CLC", "UseBitmap", CLCDEFAULT_USEBITMAP) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_BITMAP, db_get_b(NULL, "CLC", "UseBitmap", CLCDEFAULT_USEBITMAP) ? BST_CHECKED : BST_UNCHECKED);
SendMessage(hwndDlg, WM_USER + 10, 0, 0);
- CheckDlgButton(hwndDlg, IDC_WINCOLOUR, cfg::getByte("CLC", "UseWinColours", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_WINCOLOUR, db_get_b(NULL, "CLC", "UseWinColours", 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SKINMODE, cfg::dat.bWallpaperMode ? BST_CHECKED : BST_UNCHECKED);
{
DBVARIANT dbv;
- if (!cfg::getTString(NULL, "CLC", "BkBitmap", &dbv)) {
+ if (!db_get_ts(NULL, "CLC", "BkBitmap", &dbv)) {
TCHAR szPath[MAX_PATH];
if (PathToAbsoluteT(dbv.ptszVal, szPath))
SetDlgItemText(hwndDlg, IDC_FILENAME, szPath);
@@ -718,7 +718,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
db_free(&dbv);
}
- WORD bmpUse = cfg::getWord("CLC", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
+ WORD bmpUse = db_get_w(NULL, "CLC", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
CheckDlgButton(hwndDlg, IDC_STRETCHH, bmpUse & CLB_STRETCHH ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_STRETCHV, bmpUse & CLB_STRETCHV ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_TILEH, bmpUse & CLBF_TILEH ? BST_CHECKED : BST_UNCHECKED);
@@ -783,15 +783,15 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
if (!opt_clc_bkg_changed)
return TRUE;
- cfg::writeByte("CLC", "UseBitmap", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
- cfg::writeByte("CLC", "UseWinColours", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_WINCOLOUR));
+ db_set_b(NULL, "CLC", "UseBitmap", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
+ db_set_b(NULL, "CLC", "UseWinColours", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_WINCOLOUR));
char str[MAX_PATH], strrel[MAX_PATH];
GetDlgItemTextA(hwndDlg, IDC_FILENAME, str, _countof(str));
if (PathToRelative(str, strrel))
- cfg::writeString(NULL, "CLC", "BkBitmap", strrel);
+ db_set_s(NULL, "CLC", "BkBitmap", strrel);
else
- cfg::writeString(NULL, "CLC", "BkBitmap", str);
+ db_set_s(NULL, "CLC", "BkBitmap", str);
WORD flags = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_STRETCHH))
@@ -806,9 +806,9 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
flags |= CLBF_SCROLL;
if (IsDlgButtonChecked(hwndDlg, IDC_PROPORTIONAL))
flags |= CLBF_PROPORTIONAL;
- cfg::writeWord("CLC", "BkBmpUse", flags);
+ db_set_w(NULL, "CLC", "BkBmpUse", flags);
cfg::dat.bWallpaperMode = IsDlgButtonChecked(hwndDlg, IDC_SKINMODE) ? 1 : 0;
- cfg::writeByte("CLUI", "UseBkSkin", (BYTE)cfg::dat.bWallpaperMode);
+ db_set_b(NULL, "CLUI", "UseBkSkin", (BYTE)cfg::dat.bWallpaperMode);
pcli->pfnClcOptionsChanged();
PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp
index 9df4d4216f..38cee674ca 100644
--- a/plugins/Clist_nicer/src/clcpaint.cpp
+++ b/plugins/Clist_nicer/src/clcpaint.cpp
@@ -808,7 +808,7 @@ set_bg_l:
rc.top = y + sselected->MARGIN_TOP;
rc.right = clRect->right - sselected->MARGIN_RIGHT - bg_indent_r;
rc.bottom = y + rowHeight - sselected->MARGIN_BOTTOM;
- if (cfg::getByte("CLCExt", "EXBK_EqualSelection", 0) == 1 && savedCORNER != -1)
+ if (db_get_b(NULL, "CLCExt", "EXBK_EqualSelection", 0) == 1 && savedCORNER != -1)
DrawAlpha(hdcMem, &rc, sselected->COLOR, sselected->ALPHA, sselected->COLOR2, sselected->COLOR2_TRANSPARENT, sselected->GRADIENT, savedCORNER, sselected->BORDERSTYLE, sselected->imageItem);
else
DrawAlpha(hdcMem, &rc, sselected->COLOR, sselected->ALPHA, sselected->COLOR2, sselected->COLOR2_TRANSPARENT, sselected->GRADIENT, sselected->CORNER, sselected->BORDERSTYLE, sselected->imageItem);
@@ -1261,7 +1261,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint)
BOOL bFirstNGdrawn = FALSE;
int line_num = -1;
COLORREF tmpbkcolour = style & CLS_CONTACTLIST ? (dat->useWindowsColours ? GetSysColor(COLOR_3DFACE) : dat->bkColour) : dat->bkColour;
- selBlend = cfg::getByte("CLCExt", "EXBK_SelBlend", 1);
+ selBlend = db_get_b(NULL, "CLCExt", "EXBK_SelBlend", 1);
g_inCLCpaint = TRUE;
g_focusWnd = GetFocus();
my_status = GetGeneralisedStatus();
@@ -1292,8 +1292,8 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint)
mirror_always = (cfg::dat.bUseDCMirroring == 1);
mirror_rtltext = (cfg::dat.bUseDCMirroring == 3);
- g_center = cfg::getByte("CLCExt", "EXBK_CenterGroupnames", 0) && !dat->bisEmbedded;
- g_ignoreselforgroups = cfg::getByte("CLC", "IgnoreSelforGroups", 0);
+ g_center = db_get_b(NULL, "CLCExt", "EXBK_CenterGroupnames", 0) && !dat->bisEmbedded;
+ g_ignoreselforgroups = db_get_b(NULL, "CLC", "IgnoreSelforGroups", 0);
if (dat->greyoutFlags & pcli->pfnClcStatusToPf2(my_status) || style & WS_DISABLED)
grey = 1;
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp
index 303556b998..8769a27747 100644
--- a/plugins/Clist_nicer/src/clcutils.cpp
+++ b/plugins/Clist_nicer/src/clcutils.cpp
@@ -579,12 +579,12 @@ void LoadClcOptions(HWND hwnd, struct ClcData *dat, BOOL bFirst)
}
ReleaseDC(hwnd, hdc);
- dat->min_row_heigh = (int)cfg::getByte("CLC", "RowHeight", CLCDEFAULT_ROWHEIGHT);
- dat->group_row_height = (int)cfg::getByte("CLC", "GRowHeight", CLCDEFAULT_ROWHEIGHT);
+ dat->min_row_heigh = (int)db_get_b(NULL, "CLC", "RowHeight", CLCDEFAULT_ROWHEIGHT);
+ dat->group_row_height = (int)db_get_b(NULL, "CLC", "GRowHeight", CLCDEFAULT_ROWHEIGHT);
dat->row_border = 0;
- dat->rightMargin = cfg::getByte("CLC", "RightMargin", CLCDEFAULT_LEFTMARGIN);
- dat->bkColour = cfg::getByte("CLC", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS) ?
- GetSysColor(COLOR_3DFACE) : cfg::getDword("CLC", "BkColour", CLCDEFAULT_BKCOLOUR);
+ dat->rightMargin = db_get_b(NULL, "CLC", "RightMargin", CLCDEFAULT_LEFTMARGIN);
+ dat->bkColour = db_get_b(NULL, "CLC", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS) ?
+ GetSysColor(COLOR_3DFACE) : db_get_dw(NULL, "CLC", "BkColour", CLCDEFAULT_BKCOLOUR);
coreCli.pfnLoadClcOptions(hwnd, dat, bFirst);
@@ -611,7 +611,7 @@ void LoadClcOptions(HWND hwnd, struct ClcData *dat, BOOL bFirst)
}
}
- if (cfg::getByte("CLCExt", "EXBK_FillWallpaper", 0)) {
+ if (db_get_b(NULL, "CLCExt", "EXBK_FillWallpaper", 0)) {
char wpbuf[MAX_PATH];
if (dat->hBmpBackground) {
DeleteObject(dat->hBmpBackground);
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp
index a8b5a7851c..a6d54a3798 100644
--- a/plugins/Clist_nicer/src/clistevents.cpp
+++ b/plugins/Clist_nicer/src/clistevents.cpp
@@ -259,7 +259,7 @@ CListEvent* AddEvent(CLISTEVENT *cle)
NotifyMenuItemExData *nmi = (NotifyMenuItemExData*)malloc(sizeof(NotifyMenuItemExData));
if (nmi) {
TCHAR szBuffer[128];
- TCHAR* szStatus = pcli->pfnGetStatusModeDescription(cfg::getWord(p->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
+ TCHAR* szStatus = pcli->pfnGetStatusModeDescription(db_get_w(p->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
TCHAR szwProto[64];
MultiByteToWideChar(CP_ACP, 0, szProto, -1, szwProto, 64);
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp
index 3806968fce..d48d2c9741 100644
--- a/plugins/Clist_nicer/src/clistmenus.cpp
+++ b/plugins/Clist_nicer/src/clistmenus.cpp
@@ -63,7 +63,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
hContact = lParam;
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)hContact);
- dwMask = cfg::getDword(hContact, "Ignore", "Mask1", 0);
+ dwMask = db_get_dw(hContact, "Ignore", "Mask1", 0);
SendMessage(hWnd, WM_USER + 100, hContact, dwMask);
SendMessage(hWnd, WM_USER + 120, 0, 0);
TranslateDialogDefault(hWnd);
@@ -72,7 +72,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, cfg::getByte(hContact, "CList", "NotOnList", 0));
+ EnableWindow(hwndAdd, db_get_b(hContact, "CList", "NotOnList", 0));
hwndAdd = GetDlgItem(hWnd, IDC_DSP_LOADDEFAULT); // CreateWindowEx(0, _T("CLCButtonClass"), _T("FOO"), WS_VISIBLE | BS_PUSHBUTTON | WS_CHILD | WS_TABSTOP, 200, 276, 106, 24, hWnd, (HMENU)IDC_IGN_ADDPERMANENTLY, g_hInst, NULL);
CustomizeButton(hwndAdd, false, true, false);
@@ -99,8 +99,8 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
}
else {
TCHAR szTitle[512];
- DWORD dwFlags = cfg::getDword(hContact, "CList", "CLN_Flags", 0);
- BYTE bSecondLine = cfg::getByte(hContact, "CList", "CLN_2ndline", -1);
+ DWORD dwFlags = db_get_dw(hContact, "CList", "CLN_Flags", 0);
+ BYTE bSecondLine = db_get_b(hContact, "CList", "CLN_2ndline", -1);
mir_sntprintf(szTitle, TranslateT("Contact list display and ignore options for %s"), contact ? contact->szText : pcli->pfnGetContactDisplayName(hContact, 0));
@@ -109,7 +109,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
pCaps = CallProtoService(contact ? contact->proto : 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, cfg::getByte(hContact, "CList", "Priority", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_IGN_PRIORITY, db_get_b(hContact, "CList", "Priority", 0) ? BST_CHECKED : BST_UNCHECKED);
Utils::enableDlgControl(hWnd, IDC_IGN_PRIORITY, TRUE);
Utils::enableDlgControl(hWnd, IDC_AVATARDISPMODE, TRUE);
Utils::enableDlgControl(hWnd, IDC_SECONDLINEMODE, TRUE);
@@ -170,7 +170,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
break;
case IDC_HIDECONTACT:
- cfg::writeByte(hContact, "CList", "Hidden", (BYTE)(IsDlgButtonChecked(hWnd, IDC_HIDECONTACT) ? 1 : 0));
+ db_set_b(hContact, "CList", "Hidden", (BYTE)(IsDlgButtonChecked(hWnd, IDC_HIDECONTACT) ? 1 : 0));
break;
case IDC_IGN_ADDPERMANENTLY:
@@ -179,7 +179,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
acs.hContact = hContact;
acs.handleType = HANDLE_CONTACT;
CallService(MS_ADDCONTACT_SHOW, (WPARAM)hWnd, (LPARAM)&acs);
- Utils::enableDlgControl(hWnd, IDC_IGN_ADDPERMANENTLY, cfg::getByte(hContact, "CList", "NotOnList", 0));
+ Utils::enableDlgControl(hWnd, IDC_IGN_ADDPERMANENTLY, db_get_b(hContact, "CList", "NotOnList", 0));
}
break;
@@ -196,12 +196,12 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
ClcContact *contact = NULL;
SendMessage(hWnd, WM_USER + 110, 0, (LPARAM)&newMask);
- cfg::writeDword(hContact, "Ignore", "Mask1", newMask);
+ db_set_dw(hContact, "Ignore", "Mask1", newMask);
SendMessage(hWnd, WM_USER + 130, 0, 0);
if (cfg::clcdat) {
LRESULT iSel = SendDlgItemMessage(hWnd, IDC_AVATARDISPMODE, CB_GETCURSEL, 0, 0);
- DWORD dwFlags = cfg::getDword(hContact, "CList", "CLN_Flags", 0), dwXMask = 0;
+ DWORD dwFlags = db_get_dw(hContact, "CList", "CLN_Flags", 0), dwXMask = 0;
LRESULT checked = 0;
FindItem(pcli->hwndContactTree, cfg::clcdat, (HANDLE)hContact, &contact, NULL, NULL);
@@ -230,7 +230,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
else if (checked == BST_UNCHECKED)
dwFlags |= ECF_HIDELOCALTIME;
- cfg::writeDword(hContact, "CList", "CLN_Flags", dwFlags);
+ db_set_dw(hContact, "CList", "CLN_Flags", dwFlags);
if ((iSel = SendDlgItemMessage(hWnd, IDC_SECONDLINEMODE, CB_GETCURSEL, 0, 0)) != CB_ERR) {
if (iSel == 0) {
@@ -244,7 +244,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
contact->bSecondLine = (BYTE)(iSel - 1);
}
}
- cfg::writeDword(hContact, "CList", "CLN_xmask", dwXMask);
+ db_set_dw(hContact, "CList", "CLN_xmask", dwXMask);
if (contact) {
if (contact->pExtra)
contact->pExtra->dwDFlags = dwFlags;
@@ -254,7 +254,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
if (p)
p->dwDFlags = dwFlags;
}
- cfg::writeByte(hContact, "CList", "Priority", (BYTE)(IsDlgButtonChecked(hWnd, IDC_IGN_PRIORITY) ? 1 : 0));
+ db_set_b(hContact, "CList", "Priority", (BYTE)(IsDlgButtonChecked(hWnd, IDC_IGN_PRIORITY) ? 1 : 0));
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
}
}
@@ -293,7 +293,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
ClcContact *contact = NULL;
if (FindItem(pcli->hwndContactTree, cfg::clcdat, (HANDLE)hContact, &contact, NULL, NULL)) {
if (contact) {
- WORD wApparentMode = cfg::getWord(contact->hContact, contact->proto, "ApparentMode", 0);
+ WORD wApparentMode = db_get_w(contact->hContact, contact->proto, "ApparentMode", 0);
CheckDlgButton(hWnd, IDC_IGN_ALWAYSOFFLINE, wApparentMode == ID_STATUS_OFFLINE ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_IGN_ALWAYSONLINE, wApparentMode == ID_STATUS_ONLINE ? BST_CHECKED : BST_UNCHECKED);
diff --git a/plugins/Clist_nicer/src/clistmod.cpp b/plugins/Clist_nicer/src/clistmod.cpp
index 468dfddb44..83ff0f4687 100644
--- a/plugins/Clist_nicer/src/clistmod.cpp
+++ b/plugins/Clist_nicer/src/clistmod.cpp
@@ -49,7 +49,7 @@ int IconFromStatusMode(const char *szProto, int status, MCONTACT hContact, HICON
if (szProto != NULL && !mir_strcmp(szProto, META_PROTO) && hContact != 0 && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) {
MCONTACT hSubContact = db_mc_getMostOnline(hContact);
szFinalProto = GetContactProto(hSubContact);
- finalStatus = (status == 0) ? (WORD)cfg::getWord(hSubContact, szFinalProto, "Status", ID_STATUS_OFFLINE) : status;
+ finalStatus = (status == 0) ? (WORD)db_get_w(hSubContact, szFinalProto, "Status", ID_STATUS_OFFLINE) : status;
hContact = hSubContact;
}
else {
@@ -187,7 +187,7 @@ int ShowHide(WPARAM, LPARAM)
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 (!cfg::getByte("CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT))
+ if (!db_get_b(NULL, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT))
break;
case GWVS_COVERED: //Fall through (and we're already falling)
case GWVS_HIDDEN:
@@ -205,12 +205,12 @@ int ShowHide(WPARAM, LPARAM)
RECT rcWindow;
SetWindowPos(pcli->hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS);
- if (!cfg::getByte("CList", "OnTop", SETTING_ONTOP_DEFAULT))
+ if (!db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT))
SetWindowPos(pcli->hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS);
SetForegroundWindow(pcli->hwndContactList);
//SetActiveWindow(pcli->hwndContactList);
ShowWindow(pcli->hwndContactList, SW_SHOW);
- cfg::writeByte("CList", "State", SETTING_STATE_NORMAL);
+ db_set_b(NULL, "CList", "State", SETTING_STATE_NORMAL);
GetWindowRect(pcli->hwndContactList, &rcWindow);
if (Utils_AssertInsideScreen(&rcWindow) == 1) {
@@ -220,8 +220,8 @@ int ShowHide(WPARAM, LPARAM)
}
else { //It needs to be hidden
ShowWindow(pcli->hwndContactList, SW_HIDE);
- cfg::writeByte("CList", "State", SETTING_STATE_HIDDEN);
- if (cfg::getByte("CList", "DisableWorkingSet", 1))
+ db_set_b(NULL, "CList", "State", SETTING_STATE_HIDDEN);
+ if (db_get_b(NULL, "CList", "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 9496f8b98b..4d8f4772b3 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, cfg::getByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS, cfg::getByte("CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, cfg::getByte("CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE, cfg::getByte("CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS, db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE, db_get_b(NULL, "CList", "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, cfg::getByte("CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ALWAYSSTATUS, cfg::getByte("CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ALWAYSMULTI, !cfg::getByte("CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DONTCYCLE, cfg::getByte("CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CYCLE, cfg::getByte("CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_CYCLE ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_MULTITRAY, cfg::getByte("CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DISABLEBLINK, cfg::getByte("CList", "DisableTrayFlash", 0) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ICONBLINK, cfg::getByte("CList", "NoIconBlink", 0) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONECLK, db_get_b(NULL, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALWAYSSTATUS, db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALWAYSMULTI, !db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DONTCYCLE, db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CYCLE, db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_CYCLE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MULTITRAY, db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DISABLEBLINK, db_get_b(NULL, "CList", "DisableTrayFlash", 0) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ICONBLINK, db_get_b(NULL, "CList", "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,7 +82,7 @@ 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(cfg::getWord("CList", "CycleTime", SETTING_CYCLETIME_DEFAULT), 0));
+ SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT), 0));
{
ptrA szPrimaryStatus(db_get_sa(NULL, "CList", "PrimaryStatus"));
@@ -106,9 +106,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_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_BLINKTIME), 0);
SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETRANGE, 0, MAKELONG(0x3FFF, 250));
- SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETPOS, 0, MAKELONG(cfg::getWord("CList", "IconFlashTime", 550), 0));
+ SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, "CList", "IconFlashTime", 550), 0));
CheckDlgButton(hwndDlg, IDC_NOTRAYINFOTIPS, cfg::dat.bNoTrayTips ? 1 : 0);
- CheckDlgButton(hwndDlg, IDC_APPLYLASTVIEWMODE, cfg::getByte("CList", "AutoApplyLastViewMode", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_APPLYLASTVIEWMODE, db_get_b(NULL, "CList", "AutoApplyLastViewMode", 0) ? BST_CHECKED : BST_UNCHECKED);
return TRUE;
case WM_COMMAND:
@@ -138,19 +138,19 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (!opt_gen_opts_changed)
return TRUE;
- cfg::writeByte("CList", "HideOffline", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEOFFLINE));
- cfg::writeByte("CList", "HideEmptyGroups", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEEMPTYGROUPS));
- cfg::writeByte("CList", "UseGroups", (BYTE)BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DISABLEGROUPS));
- cfg::writeByte("CList", "ConfirmDelete", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CONFIRMDELETE));
- cfg::writeByte("CList", "Tray1Click", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONECLK));
- cfg::writeByte("CList", "AlwaysStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYSSTATUS));
- cfg::writeByte("CList", "AlwaysMulti", (BYTE)BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_ALWAYSMULTI));
- cfg::writeByte("CList", "TrayIcon", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE) ? SETTING_TRAYICON_SINGLE : (IsDlgButtonChecked(hwndDlg, IDC_CYCLE) ? SETTING_TRAYICON_CYCLE : SETTING_TRAYICON_MULTI)));
- cfg::writeWord("CList", "CycleTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_GETPOS, 0, 0));
- cfg::writeWord("CList", "IconFlashTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0));
- cfg::writeByte("CList", "DisableTrayFlash", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
- cfg::writeByte("CList", "NoIconBlink", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ICONBLINK));
- cfg::writeByte("CList", "AutoApplyLastViewMode", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_APPLYLASTVIEWMODE));
+ db_set_b(NULL, "CList", "HideOffline", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEOFFLINE));
+ db_set_b(NULL, "CList", "HideEmptyGroups", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEEMPTYGROUPS));
+ db_set_b(NULL, "CList", "UseGroups", (BYTE)BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DISABLEGROUPS));
+ db_set_b(NULL, "CList", "ConfirmDelete", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CONFIRMDELETE));
+ db_set_b(NULL, "CList", "Tray1Click", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONECLK));
+ db_set_b(NULL, "CList", "AlwaysStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYSSTATUS));
+ db_set_b(NULL, "CList", "AlwaysMulti", (BYTE)BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_ALWAYSMULTI));
+ db_set_b(NULL, "CList", "TrayIcon", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE) ? SETTING_TRAYICON_SINGLE : (IsDlgButtonChecked(hwndDlg, IDC_CYCLE) ? SETTING_TRAYICON_CYCLE : SETTING_TRAYICON_MULTI)));
+ db_set_w(NULL, "CList", "CycleTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_GETPOS, 0, 0));
+ db_set_w(NULL, "CList", "IconFlashTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(NULL, "CList", "DisableTrayFlash", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
+ db_set_b(NULL, "CList", "NoIconBlink", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ICONBLINK));
+ db_set_b(NULL, "CList", "AutoApplyLastViewMode", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_APPLYLASTVIEWMODE));
__setFlag(CLUI_FRAME_EVENTAREASUNKEN, IsDlgButtonChecked(hwndDlg, IDC_EVENTAREASUNKEN));
__setFlag(CLUI_FRAME_AUTOHIDENOTIFY, IsDlgButtonChecked(hwndDlg, IDC_EVENTAREAAUTOHIDE));
@@ -159,17 +159,17 @@ 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;
- cfg::writeByte("CList", "NoTrayTips", (BYTE)cfg::dat.bNoTrayTips);
+ db_set_b(NULL, "CList", "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");
else
- cfg::writeString(NULL, "CList", "PrimaryStatus", pa->szModuleName);
+ db_set_s(NULL, "CList", "PrimaryStatus", pa->szModuleName);
}
pcli->pfnTrayIconIconsChanged();
- cfg::writeDword("CLUI", "Frameflags", cfg::dat.dwFlags);
+ db_set_dw(NULL, "CLUI", "Frameflags", cfg::dat.dwFlags);
ConfigureFrame();
ConfigureCLUIGeometry(1);
ConfigureEventArea();
diff --git a/plugins/Clist_nicer/src/clisttray.cpp b/plugins/Clist_nicer/src/clisttray.cpp
index 9dc29ab078..c7c1e84c1b 100644
--- a/plugins/Clist_nicer/src/clisttray.cpp
+++ b/plugins/Clist_nicer/src/clisttray.cpp
@@ -38,8 +38,8 @@ int TrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCou
if (netProtoCount > 1) {
if (averageMode > 0) {
- if (cfg::getByte("CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI) {
- if (cfg::getByte("CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)) {
+ if (db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI) {
+ if (db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)) {
iIcon = IconFromStatusMode(szChangedProto, averageMode, 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
return pcli->pfnTrayIconSetBaseInfo(hIcon, szChangedProto);
@@ -59,17 +59,17 @@ int TrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCou
}
}
else {
- switch (cfg::getByte("CList", "TrayIcon", SETTING_TRAYICON_DEFAULT)) {
+ switch (db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT)) {
case SETTING_TRAYICON_CYCLE:
iIcon = IconFromStatusMode(szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0), 0, &hIcon);
- pcli->cycleTimerId = SetTimer(NULL, 0, cfg::getWord("CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, pcli->pfnTrayCycleTimerProc);
+ pcli->cycleTimerId = SetTimer(NULL, 0, db_get_w(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, pcli->pfnTrayCycleTimerProc);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
return pcli->pfnTrayIconSetBaseInfo(hIcon, NULL);
case SETTING_TRAYICON_MULTI:
if (!pcli->trayIcon)
pcli->pfnTrayIconRemove(NULL, NULL);
- else if (cfg::getByte("CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)) {
+ else if (db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)) {
iIcon = IconFromStatusMode(szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0), 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
return pcli->pfnTrayIconSetBaseInfo(hIcon, szChangedProto);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index 4da1543aff..65d9b83add 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -66,7 +66,7 @@ extern LRESULT CALLBACK EventAreaWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
extern HANDLE hNotifyFrame;
int LoadCluiServices(void);
-void MF_InitCheck(void);
+void MF_InitCheck(void);
void InitGroupMenus();
void FS_RegisterFonts();
void LoadExtraIconModule();
@@ -145,7 +145,7 @@ static void LayoutButtons(HWND hwnd, RECT *rc)
static int FS_FontsChanged(WPARAM, LPARAM)
{
- COLORREF clr_cluiframes = cfg::getDword("CLUI", "clr_frameborder", RGB(40, 40, 40));
+ COLORREF clr_cluiframes = db_get_dw(NULL, "CLUI", "clr_frameborder", RGB(40, 40, 40));
if (g_hPenCLUIFrames)
DeleteObject(g_hPenCLUIFrames);
@@ -162,10 +162,9 @@ static HWND PreCreateCLC(HWND parent)
{
pcli->hwndContactTree = CreateWindow(_T(CLISTCONTROL_CLASS), _T(""),
WS_CHILD | CLS_CONTACTLIST
- | (cfg::getByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
- | CLS_HIDEOFFLINE
- //| (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0)
- | (cfg::getByte(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? CLS_HIDEEMPTYGROUPS : 0)
+ | (db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
+ | (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0)
+ | (db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? CLS_HIDEEMPTYGROUPS : 0)
| CLS_MULTICOLUMN,
0, 0, 0, 0, parent, NULL, g_hInst, (LPVOID)0xff00ff00);
@@ -347,7 +346,7 @@ void IcoLibReloadIcons()
void ConfigureCLUIGeometry(int mode)
{
RECT rcStatus;
- DWORD clmargins = cfg::getDword("CLUI", "clmargins", 0);
+ DWORD clmargins = db_get_dw(NULL, "CLUI", "clmargins", 0);
cfg::dat.bCLeft = LOBYTE(LOWORD(clmargins));
cfg::dat.bCRight = HIBYTE(LOWORD(clmargins));
@@ -414,7 +413,7 @@ void SetDBButtonStates(MCONTACT hPassedContact)
if (buttonItem->type == DBVT_ASCIIZ) {
DBVARIANT dbv = { 0 };
- if (!cfg::getString(hFinalContact, szModule, szSetting, &dbv)) {
+ if (!db_get_s(hFinalContact, szModule, szSetting, &dbv)) {
result = !mir_strcmp((char *)buttonItem->bValuePush, dbv.pszVal);
db_free(&dbv);
}
@@ -422,17 +421,17 @@ void SetDBButtonStates(MCONTACT hPassedContact)
else {
switch (buttonItem->type) {
case DBVT_BYTE: {
- BYTE val = cfg::getByte(hFinalContact, szModule, szSetting, 0);
+ BYTE val = db_get_b(hFinalContact, szModule, szSetting, 0);
result = (val == buttonItem->bValuePush[0]);
break;
}
case DBVT_WORD: {
- WORD val = cfg::getWord(hFinalContact, szModule, szSetting, 0);
+ WORD val = db_get_w(hFinalContact, szModule, szSetting, 0);
result = (val == *((WORD *)&buttonItem->bValuePush));
break;
}
case DBVT_DWORD:
- DWORD val = cfg::getDword(hFinalContact, szModule, szSetting, 0);
+ DWORD val = db_get_dw(hFinalContact, szModule, szSetting, 0);
result = (val == *((DWORD *)&buttonItem->bValuePush));
break;
}
@@ -455,10 +454,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, cfg::getByte("CList", "HideOffline", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage(buttonItem->hWnd, BM_SETCHECK, db_get_b(NULL, "CList", "HideOffline", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
break;
case IDC_STBHIDEGROUPS:
- SendMessage(buttonItem->hWnd, BM_SETCHECK, cfg::getByte("CList", "UseGroups", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage(buttonItem->hWnd, BM_SETCHECK, db_get_b(NULL, "CList", "UseGroups", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
break;
}
}
@@ -552,23 +551,23 @@ void BlitWallpaper(HDC hdc, RECT *rc, struct ClcData *dat)
void ReloadThemedOptions()
{
- cfg::dat.bSkinnedStatusBar = cfg::getByte("CLUI", "sb_skinned", 0);
- cfg::dat.bUsePerProto = cfg::getByte("CLCExt", "useperproto", 0);
- cfg::dat.bOverridePerStatusColors = cfg::getByte("CLCExt", "override_status", 0);
- cfg::dat.bRowSpacing = cfg::getByte("CLC", "RowGap", 0);
- cfg::dat.bApplyIndentToBg = cfg::getByte("CLCExt", "applyindentbg", 0);
- cfg::dat.bWallpaperMode = cfg::getByte("CLUI", "UseBkSkin", 1);
- cfg::dat.bClipBorder = cfg::getByte("CLUI", "clipborder", 0);
- cfg::dat.cornerRadius = cfg::getByte("CLCExt", "CornerRad", 6);
- cfg::dat.gapBetweenFrames = (BYTE)cfg::getDword("CLUIFrames", "GapBetweenFrames", 1);
- cfg::dat.bUseDCMirroring = cfg::getByte("CLC", "MirrorDC", 0);
- cfg::dat.bGroupAlign = cfg::getByte("CLC", "GroupAlign", 0);
+ cfg::dat.bSkinnedStatusBar = db_get_b(NULL, "CLUI", "sb_skinned", 0);
+ cfg::dat.bUsePerProto = db_get_b(NULL, "CLCExt", "useperproto", 0);
+ cfg::dat.bOverridePerStatusColors = db_get_b(NULL, "CLCExt", "override_status", 0);
+ cfg::dat.bRowSpacing = db_get_b(NULL, "CLC", "RowGap", 0);
+ cfg::dat.bApplyIndentToBg = db_get_b(NULL, "CLCExt", "applyindentbg", 0);
+ cfg::dat.bWallpaperMode = db_get_b(NULL, "CLUI", "UseBkSkin", 1);
+ cfg::dat.bClipBorder = db_get_b(NULL, "CLUI", "clipborder", 0);
+ cfg::dat.cornerRadius = db_get_b(NULL, "CLCExt", "CornerRad", 6);
+ cfg::dat.gapBetweenFrames = (BYTE)db_get_dw(NULL, "CLUIFrames", "GapBetweenFrames", 1);
+ cfg::dat.bUseDCMirroring = db_get_b(NULL, "CLC", "MirrorDC", 0);
+ cfg::dat.bGroupAlign = db_get_b(NULL, "CLC", "GroupAlign", 0);
if (cfg::dat.hBrushColorKey)
DeleteObject(cfg::dat.hBrushColorKey);
cfg::dat.hBrushColorKey = CreateSolidBrush(RGB(255, 0, 255));
- cfg::dat.bWantFastGradients = cfg::getByte("CLCExt", "FastGradients", 0);
- cfg::dat.titleBarHeight = cfg::getByte("CLCExt", "frame_height", DEFAULT_TITLEBAR_HEIGHT);
- cfg::dat.group_padding = cfg::getDword("CLCExt", "grp_padding", 0);
+ cfg::dat.bWantFastGradients = db_get_b(NULL, "CLCExt", "FastGradients", 0);
+ cfg::dat.titleBarHeight = db_get_b(NULL, "CLCExt", "frame_height", DEFAULT_TITLEBAR_HEIGHT);
+ cfg::dat.group_padding = db_get_dw(NULL, "CLCExt", "grp_padding", 0);
}
static RECT rcWindow = { 0 };
@@ -582,7 +581,7 @@ static void sttProcessResize(HWND hwnd, NMCLISTCONTROL *nmc)
if (disableautoupd)
return;
- if (!cfg::getByte("CLUI", "AutoSize", 0))
+ if (!db_get_b(NULL, "CLUI", "AutoSize", 0))
return;
if (Docking_IsDocked(0, 0))
@@ -590,7 +589,7 @@ static void sttProcessResize(HWND hwnd, NMCLISTCONTROL *nmc)
if (hFrameContactTree == 0)
return;
- maxHeight = cfg::getByte("CLUI", "MaxSizeHeight", 75);
+ maxHeight = db_get_b(NULL, "CLUI", "MaxSizeHeight", 75);
rcOld = rcWindow;
GetWindowRect(hwnd, &rcWindow);
@@ -620,7 +619,7 @@ static void sttProcessResize(HWND hwnd, NMCLISTCONTROL *nmc)
if (newHeight > (rcWorkArea.bottom - rcWorkArea.top) * maxHeight / 100)
newHeight = (rcWorkArea.bottom - rcWorkArea.top) * maxHeight / 100;
- if (cfg::getByte("CLUI", "AutoSizeUpward", 0)) {
+ if (db_get_b(NULL, "CLUI", "AutoSizeUpward", 0)) {
rcWindow.top = rcWindow.bottom - newHeight;
if (rcWindow.top < rcWorkArea.top) rcWindow.top = rcWorkArea.top;
}
@@ -735,10 +734,10 @@ static int ServiceParamsOK(ButtonItem *item, WPARAM *wParam, LPARAM *lParam, MCO
static void ShowCLUI(HWND hwnd)
{
int state = old_cliststate;
- int onTop = cfg::getByte("CList", "OnTop", SETTING_ONTOP_DEFAULT);
+ int onTop = db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT);
SendMessage(hwnd, WM_SETREDRAW, FALSE, FALSE);
- if (!cfg::getByte("CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
+ if (!db_get_b(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
SetMenu(pcli->hwndContactList, NULL);
if (state == SETTING_STATE_NORMAL) {
SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
@@ -781,8 +780,8 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
case WM_CREATE:
{
int flags = WS_CHILD | CCS_BOTTOM;
- flags |= cfg::getByte("CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
- flags |= cfg::getByte("CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
+ flags |= db_get_b(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
+ flags |= db_get_b(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, NULL, flags, 0, 0, 0, 0, hwnd, NULL, g_hInst, NULL);
if (flags & WS_VISIBLE) {
ShowWindow(pcli->hwndStatus, SW_SHOW);
@@ -792,8 +791,8 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
SetClassLong(pcli->hwndStatus, GCL_STYLE, GetClassLong(pcli->hwndStatus, GCL_STYLE) & ~(CS_VREDRAW | CS_HREDRAW));
}
g_oldSize.cx = g_oldSize.cy = 0;
- old_cliststate = cfg::getByte("CList", "State", SETTING_STATE_NORMAL);
- cfg::writeByte("CList", "State", SETTING_STATE_HIDDEN);
+ old_cliststate = db_get_b(NULL, "CList", "State", SETTING_STATE_NORMAL);
+ db_set_b(NULL, "CList", "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)
@@ -828,7 +827,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
break;
case M_CREATECLC: {
- if (cfg::getByte("CLUI", "useskin", 0))
+ if (db_get_b(NULL, "CLUI", "useskin", 0))
IMG_LoadItems();
CreateButtonBar(hwnd);
//FYR: to be checked: otherwise it raises double xStatus items
@@ -836,7 +835,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
SendMessage(hwnd, WM_SETREDRAW, FALSE, FALSE);
{
LONG style;
- BYTE windowStyle = cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_TOOLWINDOW);
+ BYTE windowStyle = db_get_b(NULL, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_TOOLWINDOW);
ShowWindow(pcli->hwndContactList, SW_HIDE);
style = GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE);
if (windowStyle != SETTING_WINDOWSTYLE_DEFAULT) {
@@ -845,7 +844,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
}
else {
style &= ~(WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
- if (cfg::getByte("CList", "AlwaysHideOnTB", 1))
+ if (db_get_b(NULL, "CList", "AlwaysHideOnTB", 1))
style &= ~WS_EX_APPWINDOW;
else
style |= WS_EX_APPWINDOW;
@@ -874,13 +873,13 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
Tweak_It(cfg::clcdat->bkColour);
}
- cfg::writeByte("CList", "State", old_cliststate);
+ db_set_b(NULL, "CList", "State", old_cliststate);
- if (cfg::getByte("CList", "AutoApplyLastViewMode", 0)) {
+ if (db_get_b(NULL, "CList", "AutoApplyLastViewMode", 0)) {
DBVARIANT dbv = { 0 };
if (!db_get(NULL, "CList", "LastViewMode", &dbv)) {
if (mir_strlen(dbv.pszVal) > 2) {
- if (cfg::getDword(NULL, CLVM_MODULE, dbv.pszVal, -1) != 0xffffffff)
+ if (db_get_dw(NULL, CLVM_MODULE, dbv.pszVal, -1) != 0xffffffff)
ApplyViewMode((char *)dbv.pszVal);
}
db_free(&dbv);
@@ -1123,11 +1122,11 @@ skipbg:
// if docked, dont remember pos (except for width)
if (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) {
- cfg::writeDword("CList", "Height", (DWORD)(rc.bottom - rc.top));
- cfg::writeDword("CList", "x", (DWORD)rc.left);
- cfg::writeDword("CList", "y", (DWORD)rc.top);
+ db_set_dw(NULL, "CList", "Height", (DWORD)(rc.bottom - rc.top));
+ db_set_dw(NULL, "CList", "x", (DWORD)rc.left);
+ db_set_dw(NULL, "CList", "y", (DWORD)rc.top);
}
- cfg::writeDword("CList", "Width", (DWORD)(rc.right - rc.left));
+ db_set_dw(NULL, "CList", "Width", (DWORD)(rc.right - rc.left));
}
}
return TRUE;
@@ -1137,8 +1136,8 @@ skipbg:
return 0;
case CLUIINTM_REMOVEFROMTASKBAR: {
- BYTE windowStyle = cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT);
- if (windowStyle == SETTING_WINDOWSTYLE_DEFAULT && cfg::getByte("CList", "AlwaysHideOnTB", 0))
+ BYTE windowStyle = db_get_b(NULL, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT);
+ if (windowStyle == SETTING_WINDOWSTYLE_DEFAULT && db_get_b(NULL, "CList", "AlwaysHideOnTB", 0))
RemoveFromTaskBar(hwnd);
return 0;
}
@@ -1160,7 +1159,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(pcli->hwndContactList, cfg::getByte("CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_NOSENDCHANGING);
+ SetWindowPos(pcli->hwndContactList, db_get_b(NULL, "CList", "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);
@@ -1183,7 +1182,7 @@ skipbg:
GetWindowRect(hwnd, &r);
GetCursorPos(&pt);
- if (pt.y <= r.bottom && pt.y >= r.bottom - clip - 6 && !cfg::getByte("CLUI", "AutoSize", 0)) {
+ if (pt.y <= r.bottom && pt.y >= r.bottom - clip - 6 && !db_get_b(NULL, "CLUI", "AutoSize", 0)) {
if (pt.x > r.left + clip + 10 && pt.x < r.right - clip - 10)
return HTBOTTOM;
if (pt.x < r.left + clip + 10)
@@ -1191,7 +1190,7 @@ skipbg:
if (pt.x > r.right - clip - 10)
return HTBOTTOMRIGHT;
}
- else if (pt.y >= r.top && pt.y <= r.top + 3 && !cfg::getByte("CLUI", "AutoSize", 0)) {
+ else if (pt.y >= r.top && pt.y <= r.top + 3 && !db_get_b(NULL, "CLUI", "AutoSize", 0)) {
if (pt.x > r.left + clip + 10 && pt.x < r.right - clip - 10)
return HTTOP;
if (pt.x < r.left + clip + 10)
@@ -1294,14 +1293,14 @@ skipbg:
case WM_SYSCOMMAND:
{
- BYTE bWindowStyle = cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT);
+ BYTE bWindowStyle = db_get_b(NULL, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT);
if (SETTING_WINDOWSTYLE_DEFAULT == bWindowStyle) {
if (wParam == SC_RESTORE) {
CallWindowProc(DefWindowProc, hwnd, msg, wParam, lParam);
SendMessage(hwnd, WM_SIZE, 0, 0);
SendMessage(hwnd, CLUIINTM_REDRAW, 0, 0);
SendMessage(hwnd, CLUIINTM_STATUSBARUPDATE, 0, 0);
- cfg::writeByte("CList", "State", SETTING_STATE_NORMAL);
+ db_set_b(NULL, "CList", "State", SETTING_STATE_NORMAL);
break;
}
}
@@ -1310,8 +1309,8 @@ skipbg:
return 0;
if (wParam == SC_MINIMIZE) {
- if (SETTING_WINDOWSTYLE_DEFAULT == bWindowStyle && !cfg::getByte("CList", "AlwaysHideOnTB", 0)) {
- cfg::writeByte("CList", "State", SETTING_STATE_MINIMIZED);
+ if (SETTING_WINDOWSTYLE_DEFAULT == bWindowStyle && !db_get_b(NULL, "CList", "AlwaysHideOnTB", 0)) {
+ db_set_b(NULL, "CList", "State", SETTING_STATE_MINIMIZED);
break;
}
pcli->pfnShowHide(0, 0);
@@ -1396,16 +1395,16 @@ skipbg:
else {
switch (item->type) {
case DBVT_BYTE:
- cfg::writeByte(finalhContact, szModule, szSetting, pValue[0]);
+ db_set_b(finalhContact, szModule, szSetting, pValue[0]);
break;
case DBVT_WORD:
- cfg::writeWord(finalhContact, szModule, szSetting, *((WORD *)&pValue[0]));
+ db_set_w(finalhContact, szModule, szSetting, *((WORD *)&pValue[0]));
break;
case DBVT_DWORD:
- cfg::writeDword(finalhContact, szModule, szSetting, *((DWORD *)&pValue[0]));
+ db_set_dw(finalhContact, szModule, szSetting, *((DWORD *)&pValue[0]));
break;
case DBVT_ASCIIZ:
- cfg::writeString(finalhContact, szModule, szSetting, (char *)pValue);
+ db_set_s(finalhContact, szModule, szSetting, (char *)pValue);
break;
}
}
@@ -1446,8 +1445,8 @@ skipbg:
case IDC_TBSOUND:
case IDC_STBSOUND:
cfg::dat.soundsOff = !cfg::dat.soundsOff;
- cfg::writeByte("CLUI", "NoSounds", (BYTE)cfg::dat.soundsOff);
- cfg::writeByte("Skin", "UseSound", (BYTE)(cfg::dat.soundsOff ? 0 : 1));
+ db_set_b(NULL, "CLUI", "NoSounds", (BYTE)cfg::dat.soundsOff);
+ db_set_b(NULL, "Skin", "UseSound", (BYTE)(cfg::dat.soundsOff ? 0 : 1));
return 0;
case IDC_TBSELECTVIEWMODE:
@@ -1508,7 +1507,7 @@ buttons_done:
case POPUP_HIDEEMPTYGROUPS:
{
int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS);
- cfg::writeByte("CList", "HideEmptyGroups", (BYTE)newVal);
+ db_set_b(NULL, "CList", "HideEmptyGroups", (BYTE)newVal);
SendMessage(pcli->hwndContactTree, CLM_SETHIDEEMPTYGROUPS, newVal, 0);
}
break;
@@ -1517,7 +1516,7 @@ buttons_done:
case POPUP_DISABLEGROUPS:
{
int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
- cfg::writeByte("CList", "UseGroups", (BYTE)newVal);
+ db_set_b(NULL, "CList", "UseGroups", (BYTE)newVal);
SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, newVal, 0);
ClcSetButtonState(IDC_TBHIDEGROUPS, newVal);
SetButtonStates();
@@ -1542,7 +1541,7 @@ buttons_done:
}
if (dwOldFlags != cfg::dat.dwFlags) {
InvalidateRect(pcli->hwndContactTree, NULL, FALSE);
- cfg::writeDword("CLUI", "Frameflags", cfg::dat.dwFlags);
+ db_set_dw(NULL, "CLUI", "Frameflags", cfg::dat.dwFlags);
if ((dwOldFlags & (CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_CLISTSUNKEN)) != (cfg::dat.dwFlags & (CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_CLISTSUNKEN))) {
ConfigureFrame();
ConfigureCLUIGeometry(1);
@@ -1585,7 +1584,7 @@ buttons_done:
if ((hitFlags & (CLCHT_NOWHERE | CLCHT_INLEFTMARGIN | CLCHT_BELOWITEMS)) == 0)
break;
- if (cfg::getByte("CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT)) {
+ if (db_get_b(NULL, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT)) {
POINT pt;
pt = nm->pt;
ClientToScreen(pcli->hwndContactTree, &pt);
@@ -1620,7 +1619,7 @@ buttons_done:
GetWindowRect(pcli->hwndStatus, &rc);
if (PtInRect(&rc, pt)) {
HMENU hMenu;
- if (cfg::getByte("CLUI", "SBarRightClk", 0))
+ if (db_get_b(NULL, "CLUI", "SBarRightClk", 0))
hMenu = Menu_GetMainMenu();
else
hMenu = Menu_GetStatusMenu();
@@ -1656,7 +1655,7 @@ buttons_done:
int nParts = SendMessage(pcli->hwndStatus, SB_GETPARTS, 0, 0);
SIZE textSize;
- BYTE showOpts = cfg::getByte("CLUI", "SBarShow", 1);
+ BYTE showOpts = db_get_b(NULL, "CLUI", "SBarShow", 1);
char *szProto = pd->RealName;
int status = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
SetBkMode(dis->hDC, TRANSPARENT);
@@ -1692,8 +1691,8 @@ buttons_done:
DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - 16) >> 1, hIcon, 16, 16, 0, NULL, DI_NORMAL);
IcoLib_ReleaseIcon(hIcon);
- if (cfg::getByte("CLUI", "sbar_showlocked", 1)) {
- if (cfg::getByte(szProto, "LockMainStatus", 0)) {
+ if (db_get_b(NULL, "CLUI", "sbar_showlocked", 1)) {
+ if (db_get_b(NULL, szProto, "LockMainStatus", 0)) {
hIcon = Skin_LoadIcon(SKINICON_OTHER_STATUS_LOCKED);
if (hIcon != NULL) {
DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - 16) >> 1, hIcon, 16, 16, 0, NULL, DI_NORMAL);
@@ -1742,7 +1741,7 @@ buttons_done:
return 0;
case WM_CLOSE:
- if (SETTING_WINDOWSTYLE_DEFAULT == cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT) && !cfg::getByte("CList", "AlwaysHideOnTB", 0)) {
+ if (SETTING_WINDOWSTYLE_DEFAULT == db_get_b(NULL, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT) && !db_get_b(NULL, "CList", "AlwaysHideOnTB", 0)) {
PostMessage(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
return 0;
}
@@ -1933,11 +1932,11 @@ void LoadCLUIModule(void)
wndclass.lpszClassName = _T("EventAreaClass");
RegisterClass(&wndclass);
- oldhideoffline = cfg::getByte("CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
- cluiPos.left = cfg::getDword("CList", "x", 600);
- cluiPos.top = cfg::getDword("CList", "y", 200);
- cluiPos.right = cfg::getDword("CList", "Width", 150);
- cluiPos.bottom = cfg::getDword("CList", "Height", 350);
+ oldhideoffline = db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
+ cluiPos.left = db_get_dw(NULL, "CList", "x", 600);
+ cluiPos.top = db_get_dw(NULL, "CList", "y", 200);
+ cluiPos.right = db_get_dw(NULL, "CList", "Width", 150);
+ cluiPos.bottom = db_get_dw(NULL, "CList", "Height", 350);
LoadExtraIconModule();
LoadCLUIFramesModule();
@@ -1946,7 +1945,7 @@ void LoadCLUIModule(void)
CreateServiceFunction(MS_CLUI_SHOWMAINMENU, CLN_ShowMainMenu);
CreateServiceFunction(MS_CLUI_SHOWSTATUSMENU, CLN_ShowStatusMenu);
- if (cfg::getByte("CLUI", "FloaterMode", 0)) {
+ if (db_get_b(NULL, "CLUI", "FloaterMode", 0)) {
MessageBox(NULL,
TranslateT("You need the FloatingContacts plugin, cause the embedded floating contacts were removed."),
TranslateT("Warning"), MB_OK | MB_ICONWARNING);
diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp
index 62868208b4..97f1884ad4 100644
--- a/plugins/Clist_nicer/src/cluiframes.cpp
+++ b/plugins/Clist_nicer/src/cluiframes.cpp
@@ -411,26 +411,26 @@ int DBLoadFrameSettingsAtPos(int pos, int Frameid)
_itoa(pos, sadd, 10);
- Frames[Frameid].collapsed = 0 != cfg::getByte(CLUIFrameModule, AS(buf, "Collapse", sadd), Frames[Frameid].collapsed);
+ Frames[Frameid].collapsed = 0 != db_get_b(NULL, CLUIFrameModule, AS(buf, "Collapse", sadd), Frames[Frameid].collapsed);
- Frames[Frameid].Locked = 0 != cfg::getByte(CLUIFrameModule, AS(buf, "Locked", sadd), Frames[Frameid].Locked);
- Frames[Frameid].visible = 0 != cfg::getByte(CLUIFrameModule, AS(buf, "Visible", sadd), Frames[Frameid].visible);
- Frames[Frameid].TitleBar.ShowTitleBar = 0 != cfg::getByte(CLUIFrameModule, AS(buf, "TBVisile", sadd), Frames[Frameid].TitleBar.ShowTitleBar);
+ Frames[Frameid].Locked = 0 != db_get_b(NULL, CLUIFrameModule, AS(buf, "Locked", sadd), Frames[Frameid].Locked);
+ Frames[Frameid].visible = 0 != db_get_b(NULL, CLUIFrameModule, AS(buf, "Visible", sadd), Frames[Frameid].visible);
+ Frames[Frameid].TitleBar.ShowTitleBar = 0 != db_get_b(NULL, CLUIFrameModule, AS(buf, "TBVisile", sadd), Frames[Frameid].TitleBar.ShowTitleBar);
- Frames[Frameid].height = cfg::getWord(CLUIFrameModule, AS(buf, "Height", sadd), Frames[Frameid].height);
- Frames[Frameid].HeightWhenCollapsed = cfg::getWord(CLUIFrameModule, AS(buf, "HeightCollapsed", sadd), 0);
- Frames[Frameid].align = cfg::getWord(CLUIFrameModule, AS(buf, "Align", sadd), Frames[Frameid].align);
+ Frames[Frameid].height = db_get_w(NULL, CLUIFrameModule, AS(buf, "Height", sadd), Frames[Frameid].height);
+ Frames[Frameid].HeightWhenCollapsed = db_get_w(NULL, CLUIFrameModule, AS(buf, "HeightCollapsed", sadd), 0);
+ Frames[Frameid].align = db_get_w(NULL, CLUIFrameModule, AS(buf, "Align", sadd), Frames[Frameid].align);
Frames[Frameid].FloatingPos.x = DBGetContactSettingRangedWord(0, CLUIFrameModule, AS(buf, "FloatX", sadd), 100, 0, 1024);
Frames[Frameid].FloatingPos.y = DBGetContactSettingRangedWord(0, CLUIFrameModule, AS(buf, "FloatY", sadd), 100, 0, 1024);
Frames[Frameid].FloatingSize.x = DBGetContactSettingRangedWord(0, CLUIFrameModule, AS(buf, "FloatW", sadd), 100, 0, 1024);
Frames[Frameid].FloatingSize.y = DBGetContactSettingRangedWord(0, CLUIFrameModule, AS(buf, "FloatH", sadd), 100, 0, 1024);
- Frames[Frameid].floating = 0 != cfg::getByte(CLUIFrameModule, AS(buf, "Floating", sadd), 0);
- Frames[Frameid].order = cfg::getWord(CLUIFrameModule, AS(buf, "Order", sadd), 0);
+ Frames[Frameid].floating = 0 != db_get_b(NULL, CLUIFrameModule, AS(buf, "Floating", sadd), 0);
+ Frames[Frameid].order = db_get_w(NULL, CLUIFrameModule, AS(buf, "Order", sadd), 0);
- Frames[Frameid].UseBorder = 0 != cfg::getByte(CLUIFrameModule, AS(buf, "UseBorder", sadd), Frames[Frameid].UseBorder);
- Frames[Frameid].Skinned = 0 != cfg::getByte(CLUIFrameModule, AS(buf, "Skinned", sadd), Frames[Frameid].Skinned);
+ Frames[Frameid].UseBorder = 0 != db_get_b(NULL, CLUIFrameModule, AS(buf, "UseBorder", sadd), Frames[Frameid].UseBorder);
+ Frames[Frameid].Skinned = 0 != db_get_b(NULL, CLUIFrameModule, AS(buf, "Skinned", sadd), Frames[Frameid].Skinned);
return 0;
}
@@ -441,27 +441,27 @@ int DBStoreFrameSettingsAtPos(int pos, int Frameid)
_itoa(pos, sadd, 10);
- cfg::writeTString(0, CLUIFrameModule, AS(buf, "Name", sadd), Frames[Frameid].name);
+ db_set_ts(0, CLUIFrameModule, AS(buf, "Name", sadd), Frames[Frameid].name);
//boolean
- cfg::writeByte(0, CLUIFrameModule, AS(buf, "Collapse", sadd), (BYTE)btoint(Frames[Frameid].collapsed));
- cfg::writeByte(0, CLUIFrameModule, AS(buf, "Locked", sadd), (BYTE)btoint(Frames[Frameid].Locked));
- cfg::writeByte(0, CLUIFrameModule, AS(buf, "Visible", sadd), (BYTE)btoint(Frames[Frameid].visible));
- cfg::writeByte(0, CLUIFrameModule, AS(buf, "TBVisile", sadd), (BYTE)btoint(Frames[Frameid].TitleBar.ShowTitleBar));
-
- cfg::writeWord(CLUIFrameModule, AS(buf, "Height", sadd), (WORD)Frames[Frameid].height);
- cfg::writeWord(CLUIFrameModule, AS(buf, "HeightCollapsed", sadd), (WORD)Frames[Frameid].HeightWhenCollapsed);
- cfg::writeWord(CLUIFrameModule, AS(buf, "Align", sadd), (WORD)Frames[Frameid].align);
+ db_set_b(0, CLUIFrameModule, AS(buf, "Collapse", sadd), (BYTE)btoint(Frames[Frameid].collapsed));
+ db_set_b(0, CLUIFrameModule, AS(buf, "Locked", sadd), (BYTE)btoint(Frames[Frameid].Locked));
+ db_set_b(0, CLUIFrameModule, AS(buf, "Visible", sadd), (BYTE)btoint(Frames[Frameid].visible));
+ db_set_b(0, CLUIFrameModule, AS(buf, "TBVisile", sadd), (BYTE)btoint(Frames[Frameid].TitleBar.ShowTitleBar));
+
+ db_set_w(NULL, CLUIFrameModule, AS(buf, "Height", sadd), (WORD)Frames[Frameid].height);
+ db_set_w(NULL, CLUIFrameModule, AS(buf, "HeightCollapsed", sadd), (WORD)Frames[Frameid].HeightWhenCollapsed);
+ db_set_w(NULL, CLUIFrameModule, AS(buf, "Align", sadd), (WORD)Frames[Frameid].align);
//FloatingPos
- cfg::writeWord(CLUIFrameModule, AS(buf, "FloatX", sadd), (WORD)Frames[Frameid].FloatingPos.x);
- cfg::writeWord(CLUIFrameModule, AS(buf, "FloatY", sadd), (WORD)Frames[Frameid].FloatingPos.y);
- cfg::writeWord(CLUIFrameModule, AS(buf, "FloatW", sadd), (WORD)Frames[Frameid].FloatingSize.x);
- cfg::writeWord(0, CLUIFrameModule, AS(buf, "FloatH", sadd), (WORD)Frames[Frameid].FloatingSize.y);
+ db_set_w(NULL, CLUIFrameModule, AS(buf, "FloatX", sadd), (WORD)Frames[Frameid].FloatingPos.x);
+ db_set_w(NULL, CLUIFrameModule, AS(buf, "FloatY", sadd), (WORD)Frames[Frameid].FloatingPos.y);
+ db_set_w(NULL, CLUIFrameModule, AS(buf, "FloatW", sadd), (WORD)Frames[Frameid].FloatingSize.x);
+ db_set_w(0, CLUIFrameModule, AS(buf, "FloatH", sadd), (WORD)Frames[Frameid].FloatingSize.y);
- cfg::writeByte(0, CLUIFrameModule, AS(buf, "Floating", sadd), (BYTE)btoint(Frames[Frameid].floating));
- cfg::writeByte(0, CLUIFrameModule, AS(buf, "UseBorder", sadd), (BYTE)btoint(Frames[Frameid].UseBorder));
- cfg::writeWord(0, CLUIFrameModule, AS(buf, "Order", sadd), (WORD)Frames[Frameid].order);
+ db_set_b(0, CLUIFrameModule, AS(buf, "Floating", sadd), (BYTE)btoint(Frames[Frameid].floating));
+ db_set_b(0, CLUIFrameModule, AS(buf, "UseBorder", sadd), (BYTE)btoint(Frames[Frameid].UseBorder));
+ db_set_w(0, CLUIFrameModule, AS(buf, "Order", sadd), (WORD)Frames[Frameid].order);
- cfg::writeByte(CLUIFrameModule, AS(buf, "Skinned", sadd), Frames[Frameid].Skinned);
+ db_set_b(NULL, CLUIFrameModule, AS(buf, "Skinned", sadd), Frames[Frameid].Skinned);
return 0;
}
@@ -489,7 +489,7 @@ int CLUIFramesLoadFrameSettings(int Frameid)
if (Frameid < 0 || Frameid >= nFramescount)
return -1;
- maxstored = cfg::getWord(CLUIFrameModule, "StoredFrames", -1);
+ maxstored = db_get_w(NULL, CLUIFrameModule, "StoredFrames", -1);
if (maxstored == -1)
return 0;
@@ -511,7 +511,7 @@ int CLUIFramesStoreFrameSettings(int Frameid)
if (Frameid < 0 || Frameid >= nFramescount)
return -1;
- maxstored = cfg::getWord(CLUIFrameModule, "StoredFrames", -1);
+ maxstored = db_get_w(NULL, CLUIFrameModule, "StoredFrames", -1);
if (maxstored == -1)
maxstored = 0;
@@ -522,7 +522,7 @@ int CLUIFramesStoreFrameSettings(int Frameid)
}
DBStoreFrameSettingsAtPos(storpos, Frameid);
- cfg::writeWord(CLUIFrameModule, "StoredFrames", (WORD)maxstored);
+ db_set_w(NULL, CLUIFrameModule, "StoredFrames", (WORD)maxstored);
return 0;
}
@@ -1237,7 +1237,7 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam, LPARAM)
if (CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0))
return 0;
- if (cfg::getByte("CLUI", "AutoSize", 0))
+ if (db_get_b(NULL, "CLUI", "AutoSize", 0))
return 0;
GetWindowRect(pcli->hwndContactList, &rc);
@@ -1622,7 +1622,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM)
// create frame
Frames[nFramescount].TitleBar.hwnd =
CreateWindow(CLUIFrameTitleBarClassName, Frames[nFramescount].name,
- (cfg::getByte(CLUIFrameModule, "RemoveAllTitleBarBorders", 1) ? 0 : WS_BORDER)
+ (db_get_b(NULL, CLUIFrameModule, "RemoveAllTitleBarBorders", 1) ? 0 : WS_BORDER)
| WS_CHILD | WS_CLIPCHILDREN | (Frames[nFramescount].TitleBar.ShowTitleBar ? WS_VISIBLE : 0) |
WS_CLIPCHILDREN, 0, 0, 0, 0, pcli->hwndContactList, NULL, g_hInst, NULL);
@@ -1844,27 +1844,23 @@ int SizeMoveNewSizes()
int CLUIFramesResize(const RECT newsize)
{
- int sumheight = 9999999, newheight;
- int prevframe, prevframebottomline;
- int tbh, curfrmtbh;
- int drawitems;
- int clientfrm, clientframe = -1;
+ int sumheight = 9999999;
+ int clientframe = -1;
int i, j;
- int sepw;
int topOff = 0, botOff = 0, last_bottomtop;
GapBetweenFrames = cfg::dat.gapBetweenFrames;
- sepw = GapBetweenFrames;
+ int sepw = GapBetweenFrames;
if (nFramescount < 1 || cfg::shutDown)
return 0;
- newheight = newsize.bottom - newsize.top;
+ int newheight = newsize.bottom - newsize.top;
TitleBarH = cfg::dat.titleBarHeight;
// search for alClient frame and get the titlebar's height
- tbh = 0;
- clientfrm = CLUIFramesGetalClientFrame();
+ int tbh = 0;
+ int clientfrm = CLUIFramesGetalClientFrame();
if (clientfrm != -1)
tbh = (TitleBarH)* btoint(Frames[clientfrm].TitleBar.ShowTitleBar);
@@ -1886,7 +1882,7 @@ int CLUIFramesResize(const RECT newsize)
qsort(g_sd, nFramescount, sizeof(SortData), sortfunc);
}
- drawitems = nFramescount;
+ int drawitems = nFramescount;
while (sumheight >(newheight - tbh) && drawitems > 0) {
sumheight = 0;
drawitems = 0;
@@ -1894,7 +1890,7 @@ int CLUIFramesResize(const RECT newsize)
FRAMEWND &F = Frames[i];
if (((F.align != alClient)) && (!F.floating) && (F.visible) && (!F.needhide)) {
drawitems++;
- curfrmtbh = (TitleBarH)* btoint(F.TitleBar.ShowTitleBar);
+ int curfrmtbh = (TitleBarH)* btoint(F.TitleBar.ShowTitleBar);
sumheight += (F.height) + curfrmtbh + (i > 0 ? sepw : 0) + (F.UseBorder ? 2 : 0);
if (sumheight > newheight - tbh) {
sumheight -= (F.height) + curfrmtbh + (i > 0 ? sepw : 0);
@@ -1906,14 +1902,14 @@ int CLUIFramesResize(const RECT newsize)
}
}
- prevframe = -1;
- prevframebottomline = 0;
+ int prevframe = -1;
+ int prevframebottomline = 0;
for (j = 0; j < nFramescount; j++) {
- //move all alTop frames
+ // move all alTop frames
i = g_sd[j].realpos;
FRAMEWND &F = Frames[i];
if ((!F.needhide) && (!F.floating) && (F.visible) && (F.align == alTop)) {
- curfrmtbh = (TitleBarH)* btoint(F.TitleBar.ShowTitleBar);
+ int curfrmtbh = (TitleBarH)* btoint(F.TitleBar.ShowTitleBar);
F.wndSize.top = prevframebottomline + (prevframebottomline > 0 ? sepw : 0) + (curfrmtbh);
F.wndSize.bottom = F.height + F.wndSize.top + (F.UseBorder ? 2 : 0);
F.prevvisframe = prevframe;
@@ -1925,7 +1921,7 @@ int CLUIFramesResize(const RECT newsize)
if (sumheight < newheight) {
for (j = 0; j < nFramescount; j++) {
- //move alClient frame
+ // move alClient frame
i = g_sd[j].realpos;
FRAMEWND &F = Frames[i];
if ((!F.needhide) && (!F.floating) && (F.visible) && (F.align == alClient)) {
@@ -1939,23 +1935,22 @@ int CLUIFramesResize(const RECT newsize)
prevframe = i;
prevframebottomline = F.wndSize.bottom;
if (prevframebottomline > newheight) {
- //prevframebottomline-=F.height+(tbh+1);
- //F.needhide=TRUE;
+ // prevframebottomline-=F.height+(tbh+1);
+ // F.needhide=TRUE;
}
break;
}
}
}
- //newheight
+ // newheight
prevframebottomline = last_bottomtop = newheight;
- //prevframe=-1;
for (j = nFramescount - 1; j >= 0; j--) {
- //move all alBottom frames
+ // move all alBottom frames
i = g_sd[j].realpos;
FRAMEWND &F = Frames[i];
if ((F.visible) && (!F.floating) && (!F.needhide) && (F.align == alBottom)) {
- curfrmtbh = (TitleBarH)* btoint(F.TitleBar.ShowTitleBar);
+ int curfrmtbh = (TitleBarH)* btoint(F.TitleBar.ShowTitleBar);
F.wndSize.bottom = prevframebottomline - ((prevframebottomline < newheight) ? sepw : 0);
F.wndSize.top = F.wndSize.bottom - F.height - (F.UseBorder ? 2 : 0);
F.prevvisframe = prevframe;
@@ -1976,7 +1971,6 @@ int CLUIFramesResize(const RECT newsize)
INT_PTR CLUIFramesUpdateFrame(WPARAM wParam, LPARAM lParam)
{
- int pos;
if (FramesSysNotStarted)
return -1;
@@ -1989,7 +1983,7 @@ INT_PTR CLUIFramesUpdateFrame(WPARAM wParam, LPARAM lParam)
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 1);
mir_cslock lck(csFrameHook);
- pos = id2pos(wParam);
+ int pos = id2pos(wParam);
if (pos < 0 || pos >= nFramescount)
return -1;
@@ -2023,9 +2017,6 @@ RECT old_window_rect = { 0 }, new_window_rect = { 0 };
int SizeFramesByWindowRect(RECT *r)
{
- RECT nRect;
- DWORD noSize = 0;
-
if (FramesSysNotStarted)
return -1;
@@ -2034,8 +2025,7 @@ int SizeFramesByWindowRect(RECT *r)
mir_cslock lck(csFrameHook);
GapBetweenFrames = cfg::dat.gapBetweenFrames;
- nRect = *r;
-
+ RECT nRect = *r;
nRect.bottom -= (cfg::dat.statusBarHeight + cfg::dat.bottomOffset);
nRect.right -= cfg::dat.bCRight;
nRect.left = cfg::dat.bCLeft;
@@ -2049,17 +2039,9 @@ int SizeFramesByWindowRect(RECT *r)
FRAMEWND &F = Frames[i];
if (!F.floating) {
if (F.OwnerWindow && F.OwnerWindow != (HWND)-2) {
- /*
- if (F.wndSize.right - F.wndSize.left == F.oldWndSize.right - F.oldWndSize.left &&
- F.wndSize.bottom - F.wndSize.top == F.oldWndSize.bottom - F.oldWndSize.top)
- noSize = SWP_NOSIZE;
- else {
- noSize = 0;
- CopyRect(&F.oldWndSize, &F.wndSize);
- }*/
SetWindowPos(F.hWnd, NULL, F.wndSize.left + cfg::dat.bCLeft, F.wndSize.top + cfg::dat.topOffset,
(F.wndSize.right - F.wndSize.left),
- (F.wndSize.bottom - F.wndSize.top), SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS | noSize);
+ (F.wndSize.bottom - F.wndSize.top), SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
if (F.TitleBar.ShowTitleBar) {
SetWindowPos(F.TitleBar.hwnd, NULL, F.wndSize.left + cfg::dat.bCLeft, F.wndSize.top + cfg::dat.topOffset - TitleBarH,
@@ -2079,7 +2061,6 @@ int SizeFramesByWindowRect(RECT *r)
(F.wndSize.right - F.wndSize.left),
TitleBarH + (F.UseBorder ? (!F.collapsed ? (F.align == alClient ? 0 : 2) : 1) : 0), SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOREDRAW);
}
- //UpdateWindow(F.hWnd);
if (F.TitleBar.ShowTitleBar)
UpdateWindow(F.TitleBar.hwnd);
}
@@ -2164,19 +2145,19 @@ boolean AlignCOLLIconToLeft; //will hide frame icon
int OnFrameTitleBarBackgroundChange()
{
- AlignCOLLIconToLeft = cfg::getByte("FrameTitleBar", "AlignCOLLIconToLeft", 0);
- bkColour = cfg::getDword("FrameTitleBar", "BkColour", CLCDEFAULT_BKCOLOUR);
+ AlignCOLLIconToLeft = db_get_b(NULL, "FrameTitleBar", "AlignCOLLIconToLeft", 0);
+ bkColour = db_get_dw(NULL, "FrameTitleBar", "BkColour", CLCDEFAULT_BKCOLOUR);
if (hBmpBackground) {
DeleteObject(hBmpBackground);
hBmpBackground = NULL;
}
- if (cfg::getByte("FrameTitleBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
+ if (db_get_b(NULL, "FrameTitleBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
ptrT tszBitmapName(db_get_tsa(NULL, "FrameTitleBar", "BkBitmap"));
if (tszBitmapName != NULL)
hBmpBackground = Bitmap_Load(tszBitmapName);
}
- backgroundBmpUse = cfg::getWord("FrameTitleBar", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
+ backgroundBmpUse = db_get_w(NULL, "FrameTitleBar", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
CLUIFramesOnClistResize(0, 0);
return 0;
@@ -2407,7 +2388,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
}
if ((!(wParam&MK_CONTROL)) && Frames[framepos].Locked && (!(Frames[framepos].floating))) {
- if (cfg::getByte("CLUI", "ClientAreaDrag", 0)) {
+ if (db_get_b(NULL, "CLUI", "ClientAreaDrag", 0)) {
POINT pt;
GetCursorPos(&pt);
return SendMessage(GetParent(hwnd), WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y));
@@ -2976,7 +2957,7 @@ int LoadCLUIFramesModule(void)
// create root menu
CMenuItem mi;
- SET_UID(mi, 0x3931AC4, 0x7A32, 0x4D9C, 0x99, 0x92, 0x94, 0xD4, 0xB5, 0x9B, 0xD6, 0xB6);
+ SET_UID(mi, 0x3931AC4, 0x7A32, 0x4D9C, 0x99, 0x92, 0x94, 0xD4, 0xB5, 0x9B, 0xD6, 0xB6);
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_FRAME);
mi.position = 3000090000;
mi.name.a = LPGEN("Frames");
@@ -2989,14 +2970,14 @@ int LoadCLUIFramesModule(void)
mi.flags = CMIF_UNMOVABLE;
// create "show all frames" menu
- mi.uid.d[7]++;
+ mi.uid.d[7]++;
mi.position = 4000090000;
mi.name.a = LPGEN("Show all frames");
mi.pszService = MS_CLIST_FRAMES_SHOWALLFRAMES;
Menu_AddMainMenuItem(&mi);
// create "show all titlebars" menu
- mi.uid.d[7]++;
+ mi.uid.d[7]++;
mi.position++;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_HELP);
mi.name.a = LPGEN("Show all title bars");
@@ -3004,7 +2985,7 @@ int LoadCLUIFramesModule(void)
Menu_AddMainMenuItem(&mi);
// create "hide all titlebars" menu
- mi.uid.d[7]++;
+ mi.uid.d[7]++;
mi.position++;
mi.name.a = LPGEN("Hide all title bars");
mi.pszService = MS_CLIST_FRAMES_HIDEALLFRAMESTB;
@@ -3046,7 +3027,7 @@ int LoadCLUIFramesModule(void)
OnFrameTitleBarBackgroundChange();
FramesSysNotStarted = FALSE;
- g_hPenCLUIFrames = CreatePen(PS_SOLID, 1, cfg::getDword("CLUI", "clr_frameborder", GetSysColor(COLOR_3DDKSHADOW)));
+ g_hPenCLUIFrames = CreatePen(PS_SOLID, 1, db_get_dw(NULL, "CLUI", "clr_frameborder", GetSysColor(COLOR_3DDKSHADOW)));
return 0;
}
diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp
index 5a1ed61b96..003f0dfd7d 100644
--- a/plugins/Clist_nicer/src/cluiopts.cpp
+++ b/plugins/Clist_nicer/src/cluiopts.cpp
@@ -37,24 +37,24 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
TranslateDialogDefault(hwndDlg);
opt_clui_changed = 0;
- CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, cfg::getByte("CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ALWAYSHIDEONTASKBAR, cfg::getByte("CList", "AlwaysHideOnTB", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONTOP, cfg::getByte("CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU, cfg::getByte("CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIENTDRAG, cfg::getByte("CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, db_get_b(NULL, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALWAYSHIDEONTASKBAR, db_get_b(NULL, "CList", "AlwaysHideOnTB", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONTOP, db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU, db_get_b(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIENTDRAG, db_get_b(NULL, "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, cfg::getByte("CList", "WindowShadow", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONDESKTOP, cfg::getByte("CList", "OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DROPSHADOW, db_get_b(NULL, "CList", "WindowShadow", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONDESKTOP, db_get_b(NULL, "CList", "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"));
SendDlgItemMessage(hwndDlg, IDC_BORDERSTYLE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Thin border"));
SendDlgItemMessage(hwndDlg, IDC_BORDERSTYLE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("No border"));
- SendDlgItemMessage(hwndDlg, IDC_BORDERSTYLE, CB_SETCURSEL, cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_TOOLWINDOW), 0);
+ SendDlgItemMessage(hwndDlg, IDC_BORDERSTYLE, CB_SETCURSEL, db_get_b(NULL, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_TOOLWINDOW), 0);
SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETRANGE, 0, MAKELONG(100, 0));
- SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETPOS, 0, cfg::getByte("CLUI", "MaxSizeHeight", 75));
+ SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLUI", "MaxSizeHeight", 75));
SendDlgItemMessage(hwndDlg, IDC_CLIPBORDERSPIN, UDM_SETRANGE, 0, MAKELONG(10, 0));
SendDlgItemMessage(hwndDlg, IDC_CLIPBORDERSPIN, UDM_SETPOS, 0, cfg::dat.bClipBorder);
@@ -69,10 +69,10 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
SendDlgItemMessage(hwndDlg, IDC_CTOPSPIN, UDM_SETPOS, 0, cfg::dat.bCTop);
SendDlgItemMessage(hwndDlg, IDC_CBOTTOMSPIN, UDM_SETPOS, 0, cfg::dat.bCBottom);
- CheckDlgButton(hwndDlg, IDC_AUTOSIZEUPWARD, cfg::getByte("CLUI", "AutoSizeUpward", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOHIDE, cfg::getByte("CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOSIZEUPWARD, db_get_b(NULL, "CLUI", "AutoSizeUpward", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOHIDE, db_get_b(NULL, "CList", "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(cfg::getWord("CList", "HideTime", SETTING_HIDETIME_DEFAULT), 0));
+ SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, "CList", "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));
@@ -166,16 +166,16 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
if (!opt_clui_changed)
return TRUE;
- cfg::writeByte("CLUI", "FadeInOut", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT));
+ db_set_b(NULL, "CLUI", "FadeInOut", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT));
cfg::dat.fadeinout = IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT) ? 1 : 0;
oldFading = cfg::dat.fadeinout;
cfg::dat.fadeinout = FALSE;
- cfg::writeByte("CLUI", "WindowStyle", windowStyle);
+ db_set_b(NULL, "CLUI", "WindowStyle", windowStyle);
cfg::dat.gapBetweenFrames = GetDlgItemInt(hwndDlg, IDC_FRAMEGAP, &translated, FALSE);
- cfg::writeDword("CLUIFrames", "GapBetweenFrames", cfg::dat.gapBetweenFrames);
- cfg::writeByte("CList", "OnTop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
+ db_set_dw(NULL, "CLUIFrames", "GapBetweenFrames", cfg::dat.gapBetweenFrames);
+ db_set_b(NULL, "CList", "OnTop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
SetWindowPos(pcli->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);
@@ -183,11 +183,11 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
cfg::dat.bCTop = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CTOPSPIN, UDM_GETPOS, 0, 0);
cfg::dat.bCBottom = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CBOTTOMSPIN, UDM_GETPOS, 0, 0);
- cfg::writeDword("CLUI", "clmargins", MAKELONG(MAKEWORD(cfg::dat.bCLeft, cfg::dat.bCRight), MAKEWORD(cfg::dat.bCTop, cfg::dat.bCBottom)));
+ db_set_dw(NULL, "CLUI", "clmargins", MAKELONG(MAKEWORD(cfg::dat.bCLeft, cfg::dat.bCRight), MAKEWORD(cfg::dat.bCTop, cfg::dat.bCBottom)));
SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
- cfg::writeByte("CList", "BringToFront", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
- cfg::writeByte("CList", "AlwaysHideOnTB", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYSHIDEONTASKBAR));
+ db_set_b(NULL, "CList", "BringToFront", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
+ db_set_b(NULL, "CList", "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(pcli->hwndContactList, GWL_EXSTYLE);
style &= ~(WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
- if (cfg::getByte("CList", "AlwaysHideOnTB", 1))
+ if (db_get_b(NULL, "CList", "AlwaysHideOnTB", 1))
style &= ~WS_EX_APPWINDOW;
else {
style |= WS_EX_APPWINDOW;
@@ -220,11 +220,11 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
}
cfg::dat.bClipBorder = (BYTE)GetDlgItemInt(hwndDlg, IDC_CLIPBORDER, &translated, FALSE);
- cfg::writeDword("CLUI", "Frameflags", cfg::dat.dwFlags);
- cfg::writeByte("CLUI", "clipborder", cfg::dat.bClipBorder);
+ db_set_dw(NULL, "CLUI", "Frameflags", cfg::dat.dwFlags);
+ db_set_b(NULL, "CLUI", "clipborder", cfg::dat.bClipBorder);
- cfg::writeByte("CLUI", "ShowMainMenu", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU));
- cfg::writeByte("CLUI", "ClientAreaDrag", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG));
+ db_set_b(NULL, "CLUI", "ShowMainMenu", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU));
+ db_set_b(NULL, "CLUI", "ClientAreaDrag", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG));
ApplyCLUIBorderStyle();
@@ -235,33 +235,33 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
TCHAR title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
- cfg::writeTString(NULL, "CList", "TitleText", title);
+ db_set_ts(NULL, "CList", "TitleText", title);
SetWindowText(pcli->hwndContactList, title);
cfg::dat.dwFlags = IsDlgButtonChecked(hwndDlg, IDC_ROUNDEDBORDER) ? cfg::dat.dwFlags | CLUI_FRAME_ROUNDEDFRAME : cfg::dat.dwFlags & ~CLUI_FRAME_ROUNDEDFRAME;
- cfg::writeByte("CLUI", "AutoSize", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
+ db_set_b(NULL, "CLUI", "AutoSize", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
if ((cfg::dat.autosize = IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE) ? 1 : 0)) {
SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0);
}
- cfg::writeByte("CLUI", "MaxSizeHeight", (BYTE)GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, NULL, FALSE));
- cfg::writeByte("CLUI", "AutoSizeUpward", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZEUPWARD));
- cfg::writeByte("CList", "AutoHide", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
- cfg::writeWord("CList", "HideTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0));
+ db_set_b(NULL, "CLUI", "MaxSizeHeight", (BYTE)GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, NULL, FALSE));
+ db_set_b(NULL, "CLUI", "AutoSizeUpward", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZEUPWARD));
+ db_set_b(NULL, "CList", "AutoHide", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ db_set_w(NULL, "CList", "HideTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0));
- cfg::writeByte("CList", "Transparent", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
+ db_set_b(NULL, "CList", "Transparent", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
cfg::dat.isTransparent = IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT) ? 1 : 0;
- cfg::writeByte("CList", "Alpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
+ db_set_b(NULL, "CList", "Alpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
cfg::dat.alpha = (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0);
- cfg::writeByte("CList", "AutoAlpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0));
+ db_set_b(NULL, "CList", "AutoAlpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0));
cfg::dat.autoalpha = (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0);
- cfg::writeByte("CList", "WindowShadow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW));
- cfg::writeByte("CList", "OnDesktop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
- cfg::writeDword("CLUI", "Frameflags", cfg::dat.dwFlags);
+ db_set_b(NULL, "CList", "WindowShadow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW));
+ db_set_b(NULL, "CList", "OnDesktop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
+ db_set_dw(NULL, "CLUI", "Frameflags", cfg::dat.dwFlags);
cfg::dat.bFullTransparent = IsDlgButtonChecked(hwndDlg, IDC_FULLTRANSPARENT) ? 1 : 0;
- cfg::writeByte("CLUI", "fulltransparent", (BYTE)cfg::dat.bFullTransparent);
+ db_set_b(NULL, "CLUI", "fulltransparent", (BYTE)cfg::dat.bFullTransparent);
if (cfg::dat.bLayeredHack)
SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
@@ -269,7 +269,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
if (g_CLUISkinnedBkColorRGB)
cfg::dat.colorkey = g_CLUISkinnedBkColorRGB;
else if (cfg::dat.bClipBorder == 0 && !(cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME))
- cfg::dat.colorkey = cfg::getDword("CLC", "BkColour", CLCDEFAULT_BKCOLOUR);
+ cfg::dat.colorkey = db_get_dw(NULL, "CLC", "BkColour", CLCDEFAULT_BKCOLOUR);
else {
SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
cfg::dat.colorkey = RGB(255, 0, 255);
@@ -314,20 +314,20 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case WM_INITDIALOG:
opt_sbar_changed = 0;
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_SHOWSBAR, cfg::getByte("CLUI", "ShowSBar", 1) ? BST_CHECKED : BST_UNCHECKED); {
- BYTE showOpts = cfg::getByte("CLUI", "SBarShow", 1);
+ CheckDlgButton(hwndDlg, IDC_SHOWSBAR, db_get_b(NULL, "CLUI", "ShowSBar", 1) ? BST_CHECKED : BST_UNCHECKED); {
+ BYTE showOpts = db_get_b(NULL, "CLUI", "SBarShow", 1);
CheckDlgButton(hwndDlg, IDC_SHOWICON, showOpts & 1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWPROTO, showOpts & 2 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWSTATUS, showOpts & 4 ? BST_CHECKED : BST_UNCHECKED);
}
- CheckDlgButton(hwndDlg, IDC_RIGHTSTATUS, cfg::getByte("CLUI", "SBarRightClk", 0) ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_RIGHTSTATUS, db_get_b(NULL, "CLUI", "SBarRightClk", 0) ? BST_UNCHECKED : BST_CHECKED);
CheckDlgButton(hwndDlg, IDC_RIGHTMIRANDA, BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_RIGHTSTATUS) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_EQUALSECTIONS, cfg::dat.bEqualSections ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SBPANELBEVEL, cfg::getByte("CLUI", "SBarBevel", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWGRIP, cfg::getByte("CLUI", "ShowGrip", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SBPANELBEVEL, db_get_b(NULL, "CLUI", "SBarBevel", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWGRIP, db_get_b(NULL, "CLUI", "ShowGrip", 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SKINBACKGROUND, cfg::dat.bSkinnedStatusBar ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWXSTATUS, cfg::dat.bShowXStatusOnSbar ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_MARKLOCKED, cfg::getByte("CLUI", "sbar_showlocked", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MARKLOCKED, db_get_b(NULL, "CLUI", "sbar_showlocked", 1) ? BST_CHECKED : BST_UNCHECKED);
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)) {
Utils::enableDlgControl(hwndDlg, IDC_SHOWICON, FALSE);
@@ -364,28 +364,28 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
if (!opt_sbar_changed)
return TRUE;
- cfg::writeByte("CLUI", "ShowSBar", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
- cfg::writeByte("CLUI", "SBarShow", (BYTE)((IsDlgButtonChecked(hwndDlg, IDC_SHOWICON) ? 1 : 0) | (IsDlgButtonChecked(hwndDlg, IDC_SHOWPROTO) ? 2 : 0) | (IsDlgButtonChecked(hwndDlg, IDC_SHOWSTATUS) ? 4 : 0)));
- cfg::writeByte("CLUI", "SBarRightClk", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RIGHTMIRANDA));
- cfg::writeByte("CLUI", "EqualSections", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS));
- cfg::writeByte("CLUI", "sb_skinned", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SKINBACKGROUND));
- cfg::writeByte("CLUI", "sbar_showlocked", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MARKLOCKED));
+ db_set_b(NULL, "CLUI", "ShowSBar", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
+ db_set_b(NULL, "CLUI", "SBarShow", (BYTE)((IsDlgButtonChecked(hwndDlg, IDC_SHOWICON) ? 1 : 0) | (IsDlgButtonChecked(hwndDlg, IDC_SHOWPROTO) ? 2 : 0) | (IsDlgButtonChecked(hwndDlg, IDC_SHOWSTATUS) ? 4 : 0)));
+ db_set_b(NULL, "CLUI", "SBarRightClk", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RIGHTMIRANDA));
+ db_set_b(NULL, "CLUI", "EqualSections", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS));
+ db_set_b(NULL, "CLUI", "sb_skinned", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SKINBACKGROUND));
+ db_set_b(NULL, "CLUI", "sbar_showlocked", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MARKLOCKED));
cfg::dat.bEqualSections = IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS) ? 1 : 0;
cfg::dat.bSkinnedStatusBar = IsDlgButtonChecked(hwndDlg, IDC_SKINBACKGROUND) ? 1 : 0;
cfg::dat.bShowXStatusOnSbar = IsDlgButtonChecked(hwndDlg, IDC_SHOWXSTATUS) ? 1 : 0;
- cfg::writeByte("CLUI", "xstatus_sbar", (BYTE)cfg::dat.bShowXStatusOnSbar);
- cfg::writeByte("CLUI", "SBarBevel", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SBPANELBEVEL));
- if (cfg::getByte("CLUI", "ShowGrip", 1) != (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) {
+ db_set_b(NULL, "CLUI", "xstatus_sbar", (BYTE)cfg::dat.bShowXStatusOnSbar);
+ db_set_b(NULL, "CLUI", "SBarBevel", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SBPANELBEVEL));
+ if (db_get_b(NULL, "CLUI", "ShowGrip", 1) != (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) {
HWND parent = GetParent(pcli->hwndStatus);
int flags = WS_CHILD | CCS_BOTTOM;
- cfg::writeByte("CLUI", "ShowGrip", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP));
+ db_set_b(NULL, "CLUI", "ShowGrip", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP));
ShowWindow(pcli->hwndStatus, SW_HIDE);
mir_unsubclassWindow(pcli->hwndStatus, NewStatusBarWndProc);
DestroyWindow(pcli->hwndStatus);
- flags |= cfg::getByte("CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
- flags |= cfg::getByte("CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
+ flags |= db_get_b(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
+ flags |= db_get_b(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, NULL, flags, 0, 0, 0, 0, parent, NULL, g_hInst, NULL);
mir_subclassWindow(pcli->hwndStatus, NewStatusBarWndProc);
@@ -399,7 +399,7 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
ShowWindow(pcli->hwndStatus, SW_HIDE);
cfg::dat.dwFlags &= ~CLUI_FRAME_SBARSHOW;
}
- cfg::writeDword("CLUI", "Frameflags", cfg::dat.dwFlags);
+ db_set_dw(NULL, "CLUI", "Frameflags", cfg::dat.dwFlags);
ConfigureCLUIGeometry(1);
SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
CluiProtocolStatusChanged(0, 0);
@@ -428,7 +428,7 @@ DWORD GetCLUIWindowStyle(BYTE style)
void ApplyCLUIBorderStyle()
{
- BYTE windowStyle = cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_TOOLWINDOW);
+ BYTE windowStyle = db_get_b(NULL, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_TOOLWINDOW);
WINDOWPLACEMENT p;
bool minToTray = TRUE;
@@ -454,5 +454,5 @@ void ApplyCLUIBorderStyle()
p.showCmd = SW_HIDE;
SetWindowPlacement(pcli->hwndContactList, &p);
- cfg::writeByte(0, "CList", "Min2Tray", minToTray);
+ db_set_b(0, "CList", "Min2Tray", minToTray);
}
diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp
index 1de847da64..f5257b8f0f 100644
--- a/plugins/Clist_nicer/src/cluiservices.cpp
+++ b/plugins/Clist_nicer/src/cluiservices.cpp
@@ -110,7 +110,7 @@ void CluiProtocolStatusChanged(int, const char*)
}
else {
SIZE textSize;
- BYTE showOpts = cfg::getByte("CLUI", "SBarShow", 1);
+ BYTE showOpts = db_get_b(NULL, "CLUI", "SBarShow", 1);
TCHAR szName[32];
HDC hdc = GetDC(NULL);
@@ -156,7 +156,7 @@ void CluiProtocolStatusChanged(int, const char*)
SendMessage(pcli->hwndStatus, SB_SIMPLE, FALSE, 0);
partWidths[partCount - 1] = -1;
- windowStyle = cfg::getByte("CLUI", "WindowStyle", 0);
+ windowStyle = db_get_b(NULL, "CLUI", "WindowStyle", 0);
SendMessage(pcli->hwndStatus, SB_SETMINHEIGHT, 18 + cfg::dat.bClipBorder + ((windowStyle == SETTING_WINDOWSTYLE_THINBORDER || windowStyle == SETTING_WINDOWSTYLE_NOBORDER) ? 3 : 0), 0);
SendMessage(pcli->hwndStatus, SB_SETPARTS, partCount, (LPARAM)partWidths);
@@ -179,7 +179,7 @@ void CluiProtocolStatusChanged(int, const char*)
{
int flags;
flags = SBT_OWNERDRAW;
- if (cfg::getByte("CLUI", "SBarBevel", 1) == 0)
+ if (db_get_b(NULL, "CLUI", "SBarBevel", 1) == 0)
flags |= SBT_NOBORDERS;
SendMessageA(pcli->hwndStatus, SB_SETTEXTA, partCount | flags, (LPARAM)PD);
}
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp
index 3f83e062f2..6347ce8874 100644
--- a/plugins/Clist_nicer/src/config.cpp
+++ b/plugins/Clist_nicer/src/config.cpp
@@ -47,108 +47,6 @@ int API::exLine = 0;
bool API::exAllowContinue = false;
HMODULE API::hDwm = 0;
-DWORD cfg::getDword(const MCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, DWORD uDefault = 0)
-{
- return ((DWORD)db_get_dw(hContact, szModule, szSetting, uDefault));
-}
-
-// read a setting from our default module (Tab_SRMSG)
-DWORD cfg::getDword(const char *szSetting = 0, DWORD uDefault = 0)
-{
- return ((DWORD)db_get_dw(0, DEFAULT_MODULE, szSetting, uDefault));
-}
-
-// read a setting from module only
-DWORD cfg::getDword(const char *szModule, const char *szSetting, DWORD uDefault)
-{
- return ((DWORD)db_get_dw(0, szModule, szSetting, uDefault));
-}
-
-
-WORD cfg::getWord(const MCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, WORD uDefault = 0)
-{
- return ((WORD)db_get_w(hContact, szModule, szSetting, uDefault));
-}
-
-// read a setting from our default module (Tab_SRMSG)
-WORD cfg::getWord(const char *szSetting = 0, WORD uDefault = 0)
-{
- return ((WORD)db_get_w(0, DEFAULT_MODULE, szSetting, uDefault));
-}
-
-// read a setting from module only
-WORD cfg::getWord(const char *szModule, const char *szSetting, WORD uDefault)
-{
- return ((WORD)db_get_w(0, szModule, szSetting, uDefault));
-}
-
-// same for bytes now
-int cfg::getByte(const MCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, int uDefault = 0)
-{
- return (db_get_b(hContact, szModule, szSetting, uDefault));
-}
-
-int cfg::getByte(const char *szSetting = 0, int uDefault = 0)
-{
- return (db_get_b(0, DEFAULT_MODULE, szSetting, uDefault));
-}
-
-int cfg::getByte(const char *szModule, const char *szSetting, int uDefault)
-{
- return (db_get_b(0, szModule, szSetting, uDefault));
-}
-
-INT_PTR cfg::getTString(const MCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
-{
- return (db_get_ts(hContact, szModule, szSetting, dbv));
-}
-
-INT_PTR cfg::getString(const MCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
-{
- return (db_get_s(hContact, szModule, szSetting, dbv));
-}
-
-// writer functions
-INT_PTR cfg::writeDword(const MCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, DWORD value = 0)
-{
- return (db_set_dw(hContact, szModule, szSetting, value));
-}
-
-INT_PTR cfg::writeDword(const char *szModule = 0, const char *szSetting = 0, DWORD value = 0)
-{
- return (db_set_dw(0, szModule, szSetting, value));
-}
-
-INT_PTR cfg::writeWord(const MCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, WORD value = 0)
-{
- return (db_set_w(hContact, szModule, szSetting, value));
-}
-
-INT_PTR cfg::writeWord(const char *szModule = 0, const char *szSetting = 0, WORD value = 0)
-{
- return (db_set_w(0, szModule, szSetting, value));
-}
-
-INT_PTR cfg::writeByte(const MCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, BYTE value = 0)
-{
- return (db_set_b(hContact, szModule, szSetting, value));
-}
-
-INT_PTR cfg::writeByte(const char *szModule = 0, const char *szSetting = 0, BYTE value = 0)
-{
- return (db_set_b(0, szModule, szSetting, value));
-}
-
-INT_PTR cfg::writeTString(const MCONTACT hContact, const char *szModule = 0, const char *szSetting = 0, const TCHAR *str = 0)
-{
- return (db_set_ts(hContact, szModule, szSetting, str));
-}
-
-INT_PTR cfg::writeString(const MCONTACT hContact, const char *szModule = 0, const char *szSetting = 0, const char *str = 0)
-{
- return (db_set_s(hContact, szModule, szSetting, str));
-}
-
TExtraCache* cfg::getCache(const MCONTACT hContact, const char *szProto)
{
int idx = cfg::arCache.getIndex((TExtraCache*)&hContact);
@@ -226,7 +124,7 @@ void API::updateState()
if (sysConfig.isVistaPlus) {
sysState.isDwmActive = (pfnDwmIsCompositionEnabled && (pfnDwmIsCompositionEnabled(&result) == S_OK) && result) ? true : false;
- sysState.isAero = /* (CSkin::m_skinEnabled == false) && */ cfg::getByte("CLUI", "useAero", 1) /* && CSkin::m_fAeroSkinsValid */ && sysState.isDwmActive;
+ sysState.isAero = /* (CSkin::m_skinEnabled == false) && */ db_get_b(NULL, "CLUI", "useAero", 1) /* && CSkin::m_fAeroSkinsValid */ && sysState.isDwmActive;
}
}
diff --git a/plugins/Clist_nicer/src/config.h b/plugins/Clist_nicer/src/config.h
index 50177812e0..327353432e 100644
--- a/plugins/Clist_nicer/src/config.h
+++ b/plugins/Clist_nicer/src/config.h
@@ -50,36 +50,8 @@ private:
class cfg
{
public:
- static DWORD getDword(const MCONTACT hContact, const char *szModule, const char *szSetting, DWORD uDefault);
- static DWORD getDword(const char *szModule, const char *szSetting, DWORD uDefault);
- static DWORD getDword(const char *szSetting, DWORD uDefault);
-
- static WORD getWord(const MCONTACT hContact, const char *szModule, const char *szSetting, WORD uDefault);
- static WORD getWord(const char *szModule, const char *szSetting, WORD uDefault);
- static WORD getWord(const char *szSetting, WORD uDefault);
-
- static int getByte(const MCONTACT hContact, const char *szModule, const char *szSetting, int uDefault);
- static int getByte(const char *szModule, const char *szSetting, int uDefault);
- static int getByte(const char *szSetting, int uDefault);
-
- static INT_PTR getTString(const MCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
- static INT_PTR getString(const MCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
-
- static INT_PTR writeDword(const MCONTACT hContact, const char *szModule, const char *szSetting, DWORD value);
- static INT_PTR writeDword(const char *szModule, const char *szSetting, DWORD value);
-
- static INT_PTR writeWord(const MCONTACT hContact, const char *szModule, const char *szSetting, WORD value);
- static INT_PTR writeWord(const char *szModule, const char *szSetting, WORD value);
-
- static INT_PTR writeByte(const MCONTACT hContact, const char *szModule, const char *szSetting, BYTE value);
- static INT_PTR writeByte(const char *szModule, const char *szSetting, BYTE value);
-
- static INT_PTR writeTString(const MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *st);
- static INT_PTR writeString(const MCONTACT hContact, const char *szModule, const char *szSetting, const char *st);
-
static TExtraCache* getCache(const MCONTACT hContact, const char *szProto);
-public:
static TCluiData dat;
static ClcData* clcdat;
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp
index 382ae75e70..ad46597c14 100644
--- a/plugins/Clist_nicer/src/contact.cpp
+++ b/plugins/Clist_nicer/src/contact.cpp
@@ -49,7 +49,7 @@ static int GetContactStatus(MCONTACT hContact)
szProto = GetContactProto(hContact);
if (szProto == NULL)
return ID_STATUS_OFFLINE;
- return cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ return db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
}
int __forceinline GetStatusModeOrdering(int statusMode)
@@ -90,15 +90,15 @@ static void MF_CalcFrequency(MCONTACT hContact, DWORD dwCutoffDays, int doSleep)
if (eventCount == 0) {
frequency = 0x7fffffff;
- cfg::writeDword(hContact, "CList", "mf_firstEvent", curTime - (dwCutoffDays * 86400));
+ db_set_dw(hContact, "CList", "mf_firstEvent", curTime - (dwCutoffDays * 86400));
}
else {
frequency = (curTime - dbei.timestamp) / eventCount;
- cfg::writeDword(hContact, "CList", "mf_firstEvent", dbei.timestamp);
+ db_set_dw(hContact, "CList", "mf_firstEvent", dbei.timestamp);
}
- cfg::writeDword(hContact, "CList", "mf_freq", frequency);
- cfg::writeDword(hContact, "CList", "mf_count", eventCount);
+ db_set_dw(hContact, "CList", "mf_freq", frequency);
+ db_set_dw(hContact, "CList", "mf_count", eventCount);
}
extern TCHAR g_ptszEventName[];
@@ -126,11 +126,11 @@ void MF_UpdateThread(LPVOID)
void MF_InitCheck(void)
{
- BYTE bMsgFrequency = cfg::getByte("CList", "fhistdata", 0);
+ BYTE bMsgFrequency = db_get_b(NULL, "CList", "fhistdata", 0);
if (!bMsgFrequency) {
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
MF_CalcFrequency(hContact, 100, 0);
- cfg::writeByte("CList", "fhistdata", 1);
+ db_set_b(NULL, "CList", "fhistdata", 1);
}
}
@@ -249,21 +249,11 @@ int CompareContacts(const ClcContact* c1, const ClcContact* c2)
#undef SAFESTRING
-int SetHideOffline(WPARAM wParam, LPARAM)
+int SetHideOffline(int iValue)
{
- int newVal = (int)wParam;
- switch ((int)wParam) {
- case 0:
- cfg::writeByte("CList", "HideOffline", 0); break;
- case 1:
- cfg::writeByte("CList", "HideOffline", 1); break;
- case -1:
- newVal = !cfg::getByte("CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
- cfg::writeByte("CList", "HideOffline", (BYTE)newVal);
- break;
- }
+ int newVal = coreCli.pfnSetHideOffline(iValue);
+
SetButtonStates();
ClcSetButtonState(IDC_TBHIDEOFFLINE, newVal);
- pcli->pfnLoadContactTree();
- return 0;
+ return newVal;
}
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp
index 3ea300cd80..ff9f79b847 100644
--- a/plugins/Clist_nicer/src/extBackg.cpp
+++ b/plugins/Clist_nicer/src/extBackg.cpp
@@ -303,19 +303,19 @@ void LoadExtBkSettingsFromDB()
p->imageItem = 0;
char buffer[255], *pszEnd = buffer + mir_snprintf(buffer, "%s_", p->szDBname);
- mir_strcpy(pszEnd, "IGNORE"); p->IGNORED = (BYTE)cfg::getByte("CLCExt", buffer, p->IGNORED);
- mir_strcpy(pszEnd, "GRADIENT"); p->GRADIENT = (BYTE)cfg::getDword("CLCExt", buffer, p->GRADIENT);
- mir_strcpy(pszEnd, "CORNER"); p->CORNER = (BYTE)cfg::getDword("CLCExt", buffer, p->CORNER);
- mir_strcpy(pszEnd, "COLOR"); p->COLOR = cfg::getDword("CLCExt", buffer, p->COLOR);
- mir_strcpy(pszEnd, "COLOR2"); p->COLOR2 = cfg::getDword(NULL, "CLCExt", buffer, p->COLOR2);
- mir_strcpy(pszEnd, "COLOR2_TRANSPARENT"); p->COLOR2_TRANSPARENT = (BYTE)cfg::getByte("CLCExt", buffer, p->COLOR2_TRANSPARENT);
- mir_strcpy(pszEnd, "TEXTCOLOR"); p->TEXTCOLOR = cfg::getDword("CLCExt", buffer, p->TEXTCOLOR);
- mir_strcpy(pszEnd, "ALPHA"); p->ALPHA = cfg::getByte("CLCExt", buffer, p->ALPHA);
- mir_strcpy(pszEnd, "MRGN_LEFT"); p->MARGIN_LEFT = cfg::getByte("CLCExt", buffer, p->MARGIN_LEFT);
- mir_strcpy(pszEnd, "MRGN_TOP"); p->MARGIN_TOP = cfg::getByte("CLCExt", buffer, p->MARGIN_TOP);
- mir_strcpy(pszEnd, "MRGN_RIGHT"); p->MARGIN_RIGHT = cfg::getByte("CLCExt", buffer, p->MARGIN_RIGHT);
- mir_strcpy(pszEnd, "MRGN_BOTTOM"); p->MARGIN_BOTTOM = cfg::getByte("CLCExt", buffer, p->MARGIN_BOTTOM);
- mir_strcpy(pszEnd, "BDRSTYLE"); p->BORDERSTYLE = cfg::getDword("CLCExt", buffer, p->BORDERSTYLE);
+ mir_strcpy(pszEnd, "IGNORE"); p->IGNORED = (BYTE)db_get_b(NULL, "CLCExt", buffer, p->IGNORED);
+ mir_strcpy(pszEnd, "GRADIENT"); p->GRADIENT = (BYTE)db_get_dw(NULL, "CLCExt", buffer, p->GRADIENT);
+ mir_strcpy(pszEnd, "CORNER"); p->CORNER = (BYTE)db_get_dw(NULL, "CLCExt", buffer, p->CORNER);
+ mir_strcpy(pszEnd, "COLOR"); p->COLOR = db_get_dw(NULL, "CLCExt", buffer, p->COLOR);
+ mir_strcpy(pszEnd, "COLOR2"); p->COLOR2 = db_get_dw(NULL, "CLCExt", buffer, p->COLOR2);
+ mir_strcpy(pszEnd, "COLOR2_TRANSPARENT"); p->COLOR2_TRANSPARENT = (BYTE)db_get_b(NULL, "CLCExt", buffer, p->COLOR2_TRANSPARENT);
+ mir_strcpy(pszEnd, "TEXTCOLOR"); p->TEXTCOLOR = db_get_dw(NULL, "CLCExt", buffer, p->TEXTCOLOR);
+ mir_strcpy(pszEnd, "ALPHA"); p->ALPHA = db_get_b(NULL, "CLCExt", buffer, p->ALPHA);
+ mir_strcpy(pszEnd, "MRGN_LEFT"); p->MARGIN_LEFT = db_get_b(NULL, "CLCExt", buffer, p->MARGIN_LEFT);
+ mir_strcpy(pszEnd, "MRGN_TOP"); p->MARGIN_TOP = db_get_b(NULL, "CLCExt", buffer, p->MARGIN_TOP);
+ mir_strcpy(pszEnd, "MRGN_RIGHT"); p->MARGIN_RIGHT = db_get_b(NULL, "CLCExt", buffer, p->MARGIN_RIGHT);
+ mir_strcpy(pszEnd, "MRGN_BOTTOM"); p->MARGIN_BOTTOM = db_get_b(NULL, "CLCExt", buffer, p->MARGIN_BOTTOM);
+ mir_strcpy(pszEnd, "BDRSTYLE"); p->BORDERSTYLE = db_get_dw(NULL, "CLCExt", buffer, p->BORDERSTYLE);
}
if (cfg::dat.bFirstRun) {
@@ -339,39 +339,39 @@ static void SaveCompleteStructToDB()
if (p->statusID != ID_EXTBKSEPARATOR) {
char buffer[255];
mir_snprintf(buffer, "%s_IGNORE", p->szDBname);
- cfg::writeByte("CLCExt", buffer, p->IGNORED);
+ db_set_b(NULL, "CLCExt", buffer, p->IGNORED);
mir_snprintf(buffer, "%s_GRADIENT", p->szDBname);
- cfg::writeDword("CLCExt", buffer, p->GRADIENT);
+ db_set_dw(NULL, "CLCExt", buffer, p->GRADIENT);
mir_snprintf(buffer, "%s_CORNER", p->szDBname);
- cfg::writeDword("CLCExt", buffer, p->CORNER);
+ db_set_dw(NULL, "CLCExt", buffer, p->CORNER);
mir_snprintf(buffer, "%s_COLOR", p->szDBname);
- cfg::writeDword("CLCExt", buffer, p->COLOR);
+ db_set_dw(NULL, "CLCExt", buffer, p->COLOR);
mir_snprintf(buffer, "%s_COLOR2", p->szDBname);
- cfg::writeDword("CLCExt", buffer, p->COLOR2);
+ db_set_dw(NULL, "CLCExt", buffer, p->COLOR2);
mir_snprintf(buffer, "%s_COLOR2_TRANSPARENT", p->szDBname);
- cfg::writeByte("CLCExt", buffer, p->COLOR2_TRANSPARENT);
+ db_set_b(NULL, "CLCExt", buffer, p->COLOR2_TRANSPARENT);
mir_snprintf(buffer, "%s_TEXTCOLOR", p->szDBname);
- cfg::writeDword("CLCExt", buffer, p->TEXTCOLOR);
+ db_set_dw(NULL, "CLCExt", buffer, p->TEXTCOLOR);
mir_snprintf(buffer, "%s_ALPHA", p->szDBname);
- cfg::writeByte("CLCExt", buffer, (BYTE)p->ALPHA);
+ db_set_b(NULL, "CLCExt", buffer, (BYTE)p->ALPHA);
mir_snprintf(buffer, "%s_MRGN_LEFT", p->szDBname);
- cfg::writeByte("CLCExt", buffer, (BYTE)p->MARGIN_LEFT);
+ db_set_b(NULL, "CLCExt", buffer, (BYTE)p->MARGIN_LEFT);
mir_snprintf(buffer, "%s_MRGN_TOP", p->szDBname);
- cfg::writeByte("CLCExt", buffer, (BYTE)p->MARGIN_TOP);
+ db_set_b(NULL, "CLCExt", buffer, (BYTE)p->MARGIN_TOP);
mir_snprintf(buffer, "%s_MRGN_RIGHT", p->szDBname);
- cfg::writeByte("CLCExt", buffer, (BYTE)p->MARGIN_RIGHT);
+ db_set_b(NULL, "CLCExt", buffer, (BYTE)p->MARGIN_RIGHT);
mir_snprintf(buffer, "%s_MRGN_BOTTOM", p->szDBname);
- cfg::writeByte("CLCExt", buffer, (BYTE)p->MARGIN_BOTTOM);
+ db_set_b(NULL, "CLCExt", buffer, (BYTE)p->MARGIN_BOTTOM);
mir_snprintf(buffer, "%s_BDRSTYLE", p->szDBname);
- cfg::writeDword("CLCExt", buffer, p->BORDERSTYLE);
+ db_set_dw(NULL, "CLCExt", buffer, p->BORDERSTYLE);
}
}
}
void SetButtonToSkinned()
{
- bool bSkinned = (cfg::dat.bSkinnedButtonMode = cfg::getByte("CLCExt", "bskinned", 0)) != 0;
- bool bFlat = bSkinned || (cfg::getByte("TopToolBar", "UseFlatButton", 0) != 0);
+ bool bSkinned = (cfg::dat.bSkinnedButtonMode = db_get_b(NULL, "CLCExt", "bskinned", 0)) != 0;
+ bool bFlat = bSkinned || (db_get_b(NULL, "TopToolBar", "UseFlatButton", 0) != 0);
for (int i = 0;; i++) {
if (BTNS[i].pszButtonID == NULL)
@@ -392,8 +392,8 @@ void Reload3dBevelColors()
if (cfg::dat.hPen3DDark)
DeleteObject(cfg::dat.hPen3DDark);
- cfg::dat.hPen3DBright = CreatePen(PS_SOLID, 1, cfg::getDword("CLCExt", "3dbright", GetSysColor(COLOR_3DLIGHT)));
- cfg::dat.hPen3DDark = CreatePen(PS_SOLID, 1, cfg::getDword("CLCExt", "3ddark", GetSysColor(COLOR_3DSHADOW)));
+ cfg::dat.hPen3DBright = CreatePen(PS_SOLID, 1, db_get_dw(NULL, "CLCExt", "3dbright", GetSysColor(COLOR_3DLIGHT)));
+ cfg::dat.hPen3DDark = CreatePen(PS_SOLID, 1, db_get_dw(NULL, "CLCExt", "3ddark", GetSysColor(COLOR_3DSHADOW)));
}
// Save Non-arStatusItems Settings
@@ -401,8 +401,8 @@ void SaveNonStatusItemsSettings(HWND hwndDlg)
{
BOOL translated;
- cfg::writeByte("CLCExt", "EXBK_EqualSelection", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EQUALSELECTION));
- cfg::writeByte("CLCExt", "EXBK_SelBlend", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SELBLEND));
+ db_set_b(NULL, "CLCExt", "EXBK_EqualSelection", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EQUALSELECTION));
+ db_set_b(NULL, "CLCExt", "EXBK_SelBlend", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SELBLEND));
cfg::dat.cornerRadius = GetDlgItemInt(hwndDlg, IDC_CORNERRAD, &translated, FALSE);
cfg::dat.bApplyIndentToBg = IsDlgButtonChecked(hwndDlg, IDC_APPLYINDENTBG) ? 1 : 0;
@@ -412,16 +412,16 @@ void SaveNonStatusItemsSettings(HWND hwndDlg)
cfg::dat.titleBarHeight = (BYTE)GetDlgItemInt(hwndDlg, IDC_LASTITEMPADDING, &translated, FALSE);
cfg::dat.group_padding = GetDlgItemInt(hwndDlg, IDC_GRPTOPPADDING, &translated, FALSE);
- cfg::writeByte("CLCExt", "CornerRad", cfg::dat.cornerRadius);
- cfg::writeByte("CLCExt", "applyindentbg", (BYTE)cfg::dat.bApplyIndentToBg);
- cfg::writeByte("CLCExt", "useperproto", (BYTE)cfg::dat.bUsePerProto);
- cfg::writeByte("CLCExt", "override_status", (BYTE)cfg::dat.bOverridePerStatusColors);
- cfg::writeByte("CLCExt", "bskinned", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SETALLBUTTONSKINNED) ? 1 : 0));
- cfg::writeByte("CLCExt", "FastGradients", cfg::dat.bWantFastGradients);
- cfg::writeByte("CLC", "IgnoreSelforGroups", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNORESELFORGROUPS));
+ db_set_b(NULL, "CLCExt", "CornerRad", cfg::dat.cornerRadius);
+ db_set_b(NULL, "CLCExt", "applyindentbg", (BYTE)cfg::dat.bApplyIndentToBg);
+ db_set_b(NULL, "CLCExt", "useperproto", (BYTE)cfg::dat.bUsePerProto);
+ db_set_b(NULL, "CLCExt", "override_status", (BYTE)cfg::dat.bOverridePerStatusColors);
+ db_set_b(NULL, "CLCExt", "bskinned", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SETALLBUTTONSKINNED) ? 1 : 0));
+ db_set_b(NULL, "CLCExt", "FastGradients", cfg::dat.bWantFastGradients);
+ db_set_b(NULL, "CLC", "IgnoreSelforGroups", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNORESELFORGROUPS));
- cfg::writeDword("CLCExt", "grp_padding", cfg::dat.group_padding);
- cfg::writeByte("CLCExt", "frame_height", cfg::dat.titleBarHeight);
+ db_set_dw(NULL, "CLCExt", "grp_padding", cfg::dat.group_padding);
+ db_set_b(NULL, "CLCExt", "frame_height", cfg::dat.titleBarHeight);
Reload3dBevelColors();
SetButtonToSkinned();
@@ -490,32 +490,32 @@ void extbk_export(char *file)
mir_snprintf(szSection, "Font%d", n);
mir_snprintf(szKey, "Font%dName", n);
- if (!cfg::getString(NULL, "CLC", szKey, &dbv)) {
+ if (!db_get_s(NULL, "CLC", szKey, &dbv)) {
WritePrivateProfileStringA(szSection, "Name", dbv.pszVal, file);
mir_free(dbv.pszVal);
}
mir_snprintf(szKey, "Font%dSize", n);
- data = (DWORD)cfg::getByte("CLC", szKey, 8);
+ data = (DWORD)db_get_b(NULL, "CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "Size", &data, 1, file);
mir_snprintf(szKey, "Font%dSty", n);
- data = (DWORD)cfg::getByte("CLC", szKey, 8);
+ data = (DWORD)db_get_b(NULL, "CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "Style", &data, 1, file);
mir_snprintf(szKey, "Font%dSet", n);
- data = (DWORD)cfg::getByte("CLC", szKey, 8);
+ data = (DWORD)db_get_b(NULL, "CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "Set", &data, 1, file);
mir_snprintf(szKey, "Font%dCol", n);
- data = cfg::getDword("CLC", szKey, 8);
+ data = db_get_dw(NULL, "CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "Color", &data, 4, file);
mir_snprintf(szKey, "Font%dFlags", n);
- data = (DWORD)cfg::getDword("CLC", szKey, 8);
+ data = (DWORD)db_get_dw(NULL, "CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "Flags", &data, 4, file);
mir_snprintf(szKey, "Font%dAs", n);
- data = (DWORD)cfg::getWord("CLC", szKey, 8);
+ data = (DWORD)db_get_w(NULL, "CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "SameAs", &data, 2, file);
}
@@ -524,20 +524,20 @@ void extbk_export(char *file)
data = 0;
switch (_tagSettings[i].size) {
case 1:
- data = (DWORD)cfg::getByte(_tagSettings[i].szModule, _tagSettings[i].szSetting, (BYTE)_tagSettings[i].defaultval);
+ data = (DWORD)db_get_b(NULL, _tagSettings[i].szModule, _tagSettings[i].szSetting, (BYTE)_tagSettings[i].defaultval);
break;
case 2:
- data = (DWORD)cfg::getWord(_tagSettings[i].szModule, _tagSettings[i].szSetting, (DWORD)_tagSettings[i].defaultval);
+ data = (DWORD)db_get_w(NULL, _tagSettings[i].szModule, _tagSettings[i].szSetting, (DWORD)_tagSettings[i].defaultval);
break;
case 4:
- data = (DWORD)cfg::getDword(_tagSettings[i].szModule, _tagSettings[i].szSetting, (DWORD)_tagSettings[i].defaultval);
+ data = (DWORD)db_get_dw(NULL, _tagSettings[i].szModule, _tagSettings[i].szSetting, (DWORD)_tagSettings[i].defaultval);
break;
}
WritePrivateProfileStructA("Global", _tagSettings[i].szSetting, &data, _tagSettings[i].size, file);
i++;
}
- if (!cfg::getString(NULL, "CLC", "BkBitmap", &dbv)) {
+ if (!db_get_s(NULL, "CLC", "BkBitmap", &dbv)) {
WritePrivateProfileStringA("Global", "BkBitmap", dbv.pszVal, file);
db_free(&dbv);
}
@@ -874,7 +874,7 @@ done_with_glyph:
GetPrivateProfileStringA(itemname, "Colorkey", "e5e5e5", buffer, 500, szFileName);
COLORREF clr = HexStringToLong(buffer);
cfg::dat.colorkey = clr;
- cfg::writeDword("CLUI", "ColorKey", clr);
+ db_set_dw(NULL, "CLUI", "ColorKey", clr);
if (g_CLUISkinnedBkColor)
DeleteObject(g_CLUISkinnedBkColor);
g_CLUISkinnedBkColor = CreateSolidBrush(clr);
@@ -1166,7 +1166,7 @@ static void BTN_ReadItem(char *itemName, char *file)
void IMG_LoadItems()
{
DBVARIANT dbv;
- if (cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv))
+ if (db_get_ts(NULL, "CLC", "AdvancedSkin", &dbv))
return;
TCHAR tszFileName[MAX_PATH];
@@ -1206,14 +1206,14 @@ void IMG_LoadItems()
free(szSections);
if (g_ImageItems) {
- cfg::writeByte("CLCExt", "bskinned", 1);
+ db_set_b(NULL, "CLCExt", "bskinned", 1);
SetButtonToSkinned();
}
if (g_CLUIImageItem) {
cfg::dat.bFullTransparent = TRUE;
cfg::dat.dwFlags &= ~CLUI_FRAME_CLISTSUNKEN;
- cfg::writeByte("CLUI", "fulltransparent", (BYTE)cfg::dat.bFullTransparent);
- cfg::writeByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_NOBORDER);
+ db_set_b(NULL, "CLUI", "fulltransparent", (BYTE)cfg::dat.bFullTransparent);
+ db_set_b(NULL, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_NOBORDER);
ApplyCLUIBorderStyle();
SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
SetLayeredWindowAttributes(pcli->hwndContactList, cfg::dat.colorkey, 0, LWA_COLORKEY);
@@ -1289,30 +1289,30 @@ void LoadPerContactSkins(TCHAR *tszFileName)
for (j = 0; j < i - 1; j++) {
if (!mir_strcmp(szProto, items[j].szName) && !mir_strcmp(UIN, items[j].szDBname) &&
mir_strlen(szProto) == mir_strlen(items[j].szName) && mir_strlen(UIN) == mir_strlen(items[j].szDBname)) {
- cfg::writeDword(hContact, "EXTBK", "TEXT", items[j].TEXTCOLOR);
- cfg::writeDword(hContact, "EXTBK", "COLOR1", items[j].COLOR);
- cfg::writeDword(hContact, "EXTBK", "COLOR2", items[j].COLOR2);
- cfg::writeByte(hContact, "EXTBK", "ALPHA", (BYTE)items[j].ALPHA);
+ db_set_dw(hContact, "EXTBK", "TEXT", items[j].TEXTCOLOR);
+ db_set_dw(hContact, "EXTBK", "COLOR1", items[j].COLOR);
+ db_set_dw(hContact, "EXTBK", "COLOR2", items[j].COLOR2);
+ db_set_b(hContact, "EXTBK", "ALPHA", (BYTE)items[j].ALPHA);
- cfg::writeByte(hContact, "EXTBK", "LEFT", (BYTE)items[j].MARGIN_LEFT);
- cfg::writeByte(hContact, "EXTBK", "RIGHT", (BYTE)items[j].MARGIN_RIGHT);
- cfg::writeByte(hContact, "EXTBK", "TOP", (BYTE)items[j].MARGIN_TOP);
- cfg::writeByte(hContact, "EXTBK", "BOTTOM", (BYTE)items[j].MARGIN_BOTTOM);
+ db_set_b(hContact, "EXTBK", "LEFT", (BYTE)items[j].MARGIN_LEFT);
+ db_set_b(hContact, "EXTBK", "RIGHT", (BYTE)items[j].MARGIN_RIGHT);
+ db_set_b(hContact, "EXTBK", "TOP", (BYTE)items[j].MARGIN_TOP);
+ db_set_b(hContact, "EXTBK", "BOTTOM", (BYTE)items[j].MARGIN_BOTTOM);
- cfg::writeByte(hContact, "EXTBK", "TRANS", items[j].COLOR2_TRANSPARENT);
- cfg::writeDword(hContact, "EXTBK", "BDR", items[j].BORDERSTYLE);
+ db_set_b(hContact, "EXTBK", "TRANS", items[j].COLOR2_TRANSPARENT);
+ db_set_dw(hContact, "EXTBK", "BDR", items[j].BORDERSTYLE);
- cfg::writeByte(hContact, "EXTBK", "CORNER", items[j].CORNER);
- cfg::writeByte(hContact, "EXTBK", "GRAD", items[j].GRADIENT);
- cfg::writeByte(hContact, "EXTBK", "TRANS", items[j].COLOR2_TRANSPARENT);
+ db_set_b(hContact, "EXTBK", "CORNER", items[j].CORNER);
+ db_set_b(hContact, "EXTBK", "GRAD", items[j].GRADIENT);
+ db_set_b(hContact, "EXTBK", "TRANS", items[j].COLOR2_TRANSPARENT);
- cfg::writeByte(hContact, "EXTBK", "VALID", 1);
+ db_set_b(hContact, "EXTBK", "VALID", 1);
break;
}
}
if (j == i - 1) // disable the db copy if it has been disabled in the skin .ini file
- if (cfg::getByte(hContact, "EXTBK", "VALID", 0))
- cfg::writeByte(hContact, "EXTBK", "VALID", 0);
+ if (db_get_b(hContact, "EXTBK", "VALID", 0))
+ db_set_b(hContact, "EXTBK", "VALID", 0);
}
}
free(items);
@@ -1367,37 +1367,37 @@ void extbk_import(char *file, HWND hwndDlg)
mir_snprintf(szKey, "Font%dName", n);
GetPrivateProfileStringA(szSection, "Name", "Arial", buffer, sizeof(buffer), file);
- cfg::writeString(NULL, "CLC", szKey, buffer);
+ db_set_s(NULL, "CLC", szKey, buffer);
mir_snprintf(szKey, "Font%dSize", n);
data = 0;
GetPrivateProfileStructA(szSection, "Size", &data, 1, file);
- cfg::writeByte("CLC", szKey, (BYTE)data);
+ db_set_b(NULL, "CLC", szKey, (BYTE)data);
mir_snprintf(szKey, "Font%dSty", n);
data = 0;
GetPrivateProfileStructA(szSection, "Style", &data, 1, file);
- cfg::writeByte("CLC", szKey, (BYTE)data);
+ db_set_b(NULL, "CLC", szKey, (BYTE)data);
mir_snprintf(szKey, "Font%dSet", n);
data = 0;
GetPrivateProfileStructA(szSection, "Set", &data, 1, file);
- cfg::writeByte("CLC", szKey, (BYTE)data);
+ db_set_b(NULL, "CLC", szKey, (BYTE)data);
mir_snprintf(szKey, "Font%dCol", n);
data = 0;
GetPrivateProfileStructA(szSection, "Color", &data, 4, file);
- cfg::writeDword("CLC", szKey, data);
+ db_set_dw(NULL, "CLC", szKey, data);
mir_snprintf(szKey, "Font%dFlags", n);
data = 0;
GetPrivateProfileStructA(szSection, "Flags", &data, 4, file);
- cfg::writeDword("CLC", szKey, (WORD)data);
+ db_set_dw(NULL, "CLC", szKey, (WORD)data);
mir_snprintf(szKey, "Font%dAs", n);
data = 0;
GetPrivateProfileStructA(szSection, "SameAs", &data, 2, file);
- cfg::writeDword("CLC", szKey, (WORD)data);
+ db_set_dw(NULL, "CLC", szKey, (WORD)data);
}
}
i = 0;
@@ -1410,20 +1410,20 @@ void extbk_import(char *file, HWND hwndDlg)
GetPrivateProfileStructA("Global", _tagSettings[i].szSetting, &data, _tagSettings[i].size, file);
switch (_tagSettings[i].size) {
case 1:
- cfg::writeByte(NULL, _tagSettings[i].szModule, _tagSettings[i].szSetting, (BYTE)data);
+ db_set_b(NULL, _tagSettings[i].szModule, _tagSettings[i].szSetting, (BYTE)data);
break;
case 4:
- cfg::writeDword(NULL, _tagSettings[i].szModule, _tagSettings[i].szSetting, data);
+ db_set_dw(NULL, _tagSettings[i].szModule, _tagSettings[i].szSetting, data);
break;
case 2:
- cfg::writeWord(_tagSettings[i].szModule, _tagSettings[i].szSetting, (WORD)data);
+ db_set_w(NULL, _tagSettings[i].szModule, _tagSettings[i].szSetting, (WORD)data);
break;
}
i++;
}
GetPrivateProfileStringA("Global", "BkBitmap", "", szString, MAX_PATH, file);
if (szString[0] != 0)
- cfg::writeString(NULL, "CLC", "BkBitmap", szString);
+ db_set_s(NULL, "CLC", "BkBitmap", szString);
}
Reload3dBevelColors();
@@ -1443,15 +1443,15 @@ static void ApplyCLUISkin()
DBVARIANT dbv = { 0 };
TCHAR tszFinalName[MAX_PATH];
char szFinalName[MAX_PATH];
- if (!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
+ if (!db_get_ts(NULL, "CLC", "AdvancedSkin", &dbv)) {
MY_pathToAbsolute(dbv.ptszVal, tszFinalName);
WideCharToMultiByte(CP_ACP, 0, tszFinalName, MAX_PATH, szFinalName, MAX_PATH, 0, 0);
- if (cfg::getByte("CLUI", "skin_changed", 0)) {
+ if (db_get_b(NULL, "CLUI", "skin_changed", 0)) {
extbk_import(szFinalName, 0);
SaveCompleteStructToDB();
- cfg::writeByte("CLUI", "skin_changed", 0);
+ db_set_b(NULL, "CLUI", "skin_changed", 0);
}
IMG_LoadItems();
ShowWindow(pcli->hwndContactList, SW_SHOWNORMAL);
@@ -1469,9 +1469,9 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
DBVARIANT dbv;
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_EQUALSELECTION, (cfg::getByte("CLCExt", "EXBK_EqualSelection", 1) == 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SELBLEND, cfg::getByte("CLCExt", "EXBK_SelBlend", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SETALLBUTTONSKINNED, cfg::getByte("CLCExt", "bskinned", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_EQUALSELECTION, (db_get_b(NULL, "CLCExt", "EXBK_EqualSelection", 1) == 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SELBLEND, db_get_b(NULL, "CLCExt", "EXBK_SelBlend", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SETALLBUTTONSKINNED, db_get_b(NULL, "CLCExt", "bskinned", 0) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_CORNERSPIN, UDM_SETRANGE, 0, MAKELONG(10, 0));
SendDlgItemMessage(hwndDlg, IDC_CORNERSPIN, UDM_SETPOS, 0, cfg::dat.cornerRadius);
@@ -1486,17 +1486,17 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
CheckDlgButton(hwndDlg, IDC_USEPERPROTO, cfg::dat.bUsePerProto ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_OVERRIDEPERSTATUSCOLOR, cfg::dat.bOverridePerStatusColors ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_FASTGRADIENT, cfg::dat.bWantFastGradients ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_IGNORESELFORGROUPS, cfg::getByte("CLC", "IgnoreSelforGroups", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_IGNORESELFORGROUPS, db_get_b(NULL, "CLC", "IgnoreSelforGroups", 0) ? BST_CHECKED : BST_UNCHECKED);
- if (!cfg::getString(NULL, "CLC", "ContactSkins", &dbv)) {
+ if (!db_get_s(NULL, "CLC", "ContactSkins", &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_SKINFILE, dbv.pszVal);
db_free(&dbv);
Utils::enableDlgControl(hwndDlg, IDC_RELOAD, TRUE);
}
else
Utils::enableDlgControl(hwndDlg, IDC_RELOAD, FALSE);
- CheckDlgButton(hwndDlg, IDC_USESKIN, cfg::getByte("CLUI", "useskin", 0) ? BST_CHECKED : BST_UNCHECKED);
- if (!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
+ CheckDlgButton(hwndDlg, IDC_USESKIN, db_get_b(NULL, "CLUI", "useskin", 0) ? BST_CHECKED : BST_UNCHECKED);
+ if (!db_get_ts(NULL, "CLC", "AdvancedSkin", &dbv)) {
SetDlgItemText(hwndDlg, IDC_SKINFILENAME, dbv.ptszVal);
db_free(&dbv);
}
@@ -1509,7 +1509,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
case IDC_USESKIN:
{
int useskin = IsDlgButtonChecked(hwndDlg, IDC_USESKIN);
- cfg::writeByte("CLUI", "useskin", (BYTE)(useskin ? 1 : 0));
+ db_set_b(NULL, "CLUI", "useskin", (BYTE)(useskin ? 1 : 0));
}
break;
@@ -1542,22 +1542,22 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
int skinChanged = 0;
DBVARIANT dbv = { 0 };
- if (!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
+ if (!db_get_ts(NULL, "CLC", "AdvancedSkin", &dbv)) {
if (mir_tstrcmp(dbv.ptszVal, final_path))
skinChanged = TRUE;
db_free(&dbv);
}
else
skinChanged = TRUE;
- cfg::writeTString(NULL, "CLC", "AdvancedSkin", final_path);
- cfg::writeByte("CLUI", "skin_changed", (BYTE)skinChanged);
+ db_set_ts(NULL, "CLC", "AdvancedSkin", final_path);
+ db_set_b(NULL, "CLUI", "skin_changed", (BYTE)skinChanged);
SetDlgItemText(hwndDlg, IDC_SKINFILENAME, final_path);
}
}
break;
case IDC_RELOADSKIN:
- cfg::writeByte("CLUI", "skin_changed", 1);
+ db_set_b(NULL, "CLUI", "skin_changed", 1);
ApplyCLUISkin();
break;
@@ -1606,7 +1606,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
case WM_INITDIALOG:
TranslateDialogDefault(hwnd);
{
- int oPage = cfg::getByte("CLUI", "opage", 0);
+ int oPage = db_get_b(NULL, "CLUI", "opage", 0);
RECT rcClient;
GetClientRect(hwnd, &rcClient);
@@ -1723,7 +1723,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
tci.mask = TCIF_PARAM;
TabCtrl_GetItem(GetDlgItem(hwnd, IDC_OPTIONSTAB), TabCtrl_GetCurSel(GetDlgItem(hwnd, IDC_OPTIONSTAB)), &tci);
ShowWindow((HWND)tci.lParam, SW_SHOW);
- cfg::writeByte("CLUI", "opage", (BYTE)TabCtrl_GetCurSel(GetDlgItem(hwnd, IDC_OPTIONSTAB)));
+ db_set_b(NULL, "CLUI", "opage", (BYTE)TabCtrl_GetCurSel(GetDlgItem(hwnd, IDC_OPTIONSTAB)));
Utils::enableDlgControl(hwnd, IDC_EXPORT, TabCtrl_GetCurSel(GetDlgItem(hwnd, IDC_OPTIONSTAB)) != 0);
Utils::enableDlgControl(hwnd, IDC_IMPORT, TabCtrl_GetCurSel(GetDlgItem(hwnd, IDC_OPTIONSTAB)) != 0);
break;
@@ -1765,7 +1765,7 @@ int CoolSB_SetupScrollBar()
!arStatusItems[ID_EXTBKSCROLLBUTTONPRESSED - ID_STATUS_OFFLINE]->imageItem)
cfg::dat.bSkinnedScrollbar = FALSE;
- if (cfg::getByte("CLC", "NoVScrollBar", 0)) {
+ if (db_get_b(NULL, "CLC", "NoVScrollBar", 0)) {
UninitializeCoolSB(pcli->hwndContactTree);
return 0;
}
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp
index 218a20d758..6fa5357254 100644
--- a/plugins/Clist_nicer/src/init.cpp
+++ b/plugins/Clist_nicer/src/init.cpp
@@ -36,8 +36,8 @@ int hLangpack;
extern HICON overlayicons[10];
-extern int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam);
-extern int SetHideOffline(WPARAM wParam, LPARAM lParam);
+int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam);
+int SetHideOffline(int iValue);
ClcContact *CreateClcContact(void);
void ReloadThemedOptions();
@@ -138,49 +138,49 @@ extern "C" int __declspec(dllexport) CListInitialise()
cfg::dat.hMenuNotify = CreatePopupMenu();
cfg::dat.wNextMenuID = 1;
- cfg::dat.sortTimer = cfg::getDword("CLC", "SortTimer", 150);
- cfg::dat.avatarBorder = (COLORREF)cfg::getDword("CLC", "avatarborder", 0);
- cfg::dat.avatarRadius = (COLORREF)cfg::getDword("CLC", "avatarradius", 4);
+ cfg::dat.sortTimer = db_get_dw(NULL, "CLC", "SortTimer", 150);
+ cfg::dat.avatarBorder = (COLORREF)db_get_dw(NULL, "CLC", "avatarborder", 0);
+ cfg::dat.avatarRadius = (COLORREF)db_get_dw(NULL, "CLC", "avatarradius", 4);
cfg::dat.hBrushAvatarBorder = CreateSolidBrush(cfg::dat.avatarBorder);
- cfg::dat.avatarSize = cfg::getWord("CList", "AvatarSize", 24);
- cfg::dat.dualRowMode = cfg::getByte("CLC", "DualRowMode", 0);
- cfg::dat.avatarPadding = cfg::getByte("CList", "AvatarPadding", 0);
- cfg::dat.isTransparent = cfg::getByte("CList", "Transparent", 0);
- cfg::dat.alpha = cfg::getByte("CList", "Alpha", SETTING_ALPHA_DEFAULT);
- cfg::dat.autoalpha = cfg::getByte("CList", "AutoAlpha", SETTING_ALPHA_DEFAULT);
- cfg::dat.fadeinout = cfg::getByte("CLUI", "FadeInOut", 0);
- cfg::dat.autosize = cfg::getByte("CLUI", "AutoSize", 0);
- cfg::dat.bNoOfflineAvatars = cfg::getByte("CList", "NoOfflineAV", 1);
- cfg::dat.bFullTransparent = cfg::getByte("CLUI", "fulltransparent", 0);
- cfg::dat.bDblClkAvatars = cfg::getByte("CLC", "dblclkav", 0);
- cfg::dat.bEqualSections = cfg::getByte("CLUI", "EqualSections", 0);
- cfg::dat.bCenterStatusIcons = cfg::getByte("CLC", "si_centered", 1);
+ cfg::dat.avatarSize = db_get_w(NULL, "CList", "AvatarSize", 24);
+ cfg::dat.dualRowMode = db_get_b(NULL, "CLC", "DualRowMode", 0);
+ cfg::dat.avatarPadding = db_get_b(NULL, "CList", "AvatarPadding", 0);
+ cfg::dat.isTransparent = db_get_b(NULL, "CList", "Transparent", 0);
+ cfg::dat.alpha = db_get_b(NULL, "CList", "Alpha", SETTING_ALPHA_DEFAULT);
+ cfg::dat.autoalpha = db_get_b(NULL, "CList", "AutoAlpha", SETTING_ALPHA_DEFAULT);
+ cfg::dat.fadeinout = db_get_b(NULL, "CLUI", "FadeInOut", 0);
+ cfg::dat.autosize = db_get_b(NULL, "CLUI", "AutoSize", 0);
+ cfg::dat.bNoOfflineAvatars = db_get_b(NULL, "CList", "NoOfflineAV", 1);
+ cfg::dat.bFullTransparent = db_get_b(NULL, "CLUI", "fulltransparent", 0);
+ cfg::dat.bDblClkAvatars = db_get_b(NULL, "CLC", "dblclkav", 0);
+ cfg::dat.bEqualSections = db_get_b(NULL, "CLUI", "EqualSections", 0);
+ cfg::dat.bCenterStatusIcons = db_get_b(NULL, "CLC", "si_centered", 1);
cfg::dat.boldHideOffline = -1;
cfg::dat.bSecIMAvail = ServiceExists("SecureIM/IsContactSecured") ? 1 : 0;
- cfg::dat.bNoTrayTips = cfg::getByte("CList", "NoTrayTips", 0);
- cfg::dat.bShowLocalTime = cfg::getByte("CLC", "ShowLocalTime", 1);
- cfg::dat.bShowLocalTimeSelective = cfg::getByte("CLC", "SelectiveLocalTime", 1);
- cfg::dat.bDontSeparateOffline = cfg::getByte("CList", "DontSeparateOffline", 0);
- cfg::dat.bShowXStatusOnSbar = cfg::getByte("CLUI", "xstatus_sbar", 0);
- cfg::dat.bLayeredHack = cfg::getByte("CLUI", "layeredhack", 1);
- cfg::dat.bFirstRun = cfg::getByte("CLUI", "firstrun", 1);
+ cfg::dat.bNoTrayTips = db_get_b(NULL, "CList", "NoTrayTips", 0);
+ cfg::dat.bShowLocalTime = db_get_b(NULL, "CLC", "ShowLocalTime", 1);
+ cfg::dat.bShowLocalTimeSelective = db_get_b(NULL, "CLC", "SelectiveLocalTime", 1);
+ cfg::dat.bDontSeparateOffline = db_get_b(NULL, "CList", "DontSeparateOffline", 0);
+ cfg::dat.bShowXStatusOnSbar = db_get_b(NULL, "CLUI", "xstatus_sbar", 0);
+ cfg::dat.bLayeredHack = db_get_b(NULL, "CLUI", "layeredhack", 1);
+ cfg::dat.bFirstRun = db_get_b(NULL, "CLUI", "firstrun", 1);
cfg::dat.langPackCP = Langpack_GetDefaultCodePage();
- cfg::dat.realTimeSaving = cfg::getByte("CLUI", "save_pos_always", 0);
+ cfg::dat.realTimeSaving = db_get_b(NULL, "CLUI", "save_pos_always", 0);
- DWORD sortOrder = cfg::getDword("CList", "SortOrder", SORTBY_NAME);
+ DWORD sortOrder = db_get_dw(NULL, "CList", "SortOrder", SORTBY_NAME);
cfg::dat.sortOrder[0] = LOBYTE(LOWORD(sortOrder));
cfg::dat.sortOrder[1] = HIBYTE(LOWORD(sortOrder));
cfg::dat.sortOrder[2] = LOBYTE(HIWORD(sortOrder));
if (cfg::dat.bFirstRun)
- cfg::writeByte("CLUI", "firstrun", 0);
+ db_set_b(NULL, "CLUI", "firstrun", 0);
ReloadThemedOptions();
Reload3dBevelColors();
- cfg::dat.dwFlags = cfg::getDword("CLUI", "Frameflags", CLUI_FRAME_STATUSICONS | CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_BUTTONSFLAT | CLUI_FRAME_CLISTSUNKEN);
- cfg::dat.dwFlags |= (cfg::getByte("CLUI", "ShowSBar", 1) ? CLUI_FRAME_SBARSHOW : 0);
- cfg::dat.soundsOff = cfg::getByte("Skin", "UseSound", 1) ? 0 : 1;
+ cfg::dat.dwFlags = db_get_dw(NULL, "CLUI", "Frameflags", CLUI_FRAME_STATUSICONS | CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_BUTTONSFLAT | CLUI_FRAME_CLISTSUNKEN);
+ cfg::dat.dwFlags |= (db_get_b(NULL, "CLUI", "ShowSBar", 1) ? CLUI_FRAME_SBARSHOW : 0);
+ cfg::dat.soundsOff = db_get_b(NULL, "Skin", "UseSound", 1) ? 0 : 1;
CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)cfg::dat.tszProfilePath);
_tcslwr(cfg::dat.tszProfilePath);
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp
index 19c01e364d..91ea967a2f 100644
--- a/plugins/Clist_nicer/src/statusbar.cpp
+++ b/plugins/Clist_nicer/src/statusbar.cpp
@@ -88,7 +88,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
HDC hdcMem = CreateCompatibleDC(hdc);
RECT rcClient, rcWindow;
DRAWITEMSTRUCT dis = { 0 };
- BYTE windowStyle = cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT);
+ BYTE windowStyle = db_get_b(NULL, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT);
LONG b_offset = cfg::dat.bClipBorder + (windowStyle == SETTING_WINDOWSTYLE_NOBORDER ? 2 : (windowStyle == SETTING_WINDOWSTYLE_THINBORDER ? 1 : 0));
GetClientRect(hwnd, &rcClient);
@@ -155,9 +155,9 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (NotifyEventHooks(hStatusBarShowToolTipEvent, (WPARAM)PD->RealName, 0) > 0) // a plugin handled this event
tooltip_active = TRUE;
- else if (cfg::getDword("mToolTip", "ShowStatusTip", 0)) {
+ else if (db_get_dw(NULL, "mToolTip", "ShowStatusTip", 0)) {
WORD wStatus = (WORD)CallProtoService(PD->RealName, PS_GETSTATUS, 0, 0);
- BYTE isLocked = cfg::getByte(PD->RealName, "LockMainStatus", 0);
+ BYTE isLocked = db_get_b(NULL, PD->RealName, "LockMainStatus", 0);
TCHAR szTipText[256];
mir_sntprintf(szTipText, _T("<b>%s</b>: %s%s"),
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp
index 8b679f4288..5a403a317f 100644
--- a/plugins/Clist_nicer/src/viewmodes.cpp
+++ b/plugins/Clist_nicer/src/viewmodes.cpp
@@ -142,8 +142,8 @@ static void UpdateStickies()
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
MCONTACT hItem = (MCONTACT)SendDlgItemMessage(sttClvmHwnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
if (hItem)
- SendDlgItemMessage(sttClvmHwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, cfg::getByte(hContact, "CLVM", sttModeName, 0) ? 1 : 0);
- DWORD localMask = HIWORD(cfg::getDword(hContact, "CLVM", sttModeName, 0));
+ SendDlgItemMessage(sttClvmHwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, db_get_b(hContact, "CLVM", sttModeName, 0) ? 1 : 0);
+ DWORD localMask = HIWORD(db_get_dw(hContact, "CLVM", sttModeName, 0));
UpdateClistItem(hItem, (localMask == 0 || localMask == sttStickyStatusMask) ? sttStickyStatusMask : localMask);
}
@@ -301,19 +301,19 @@ void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szPr
char szSetting[512];
mir_snprintf(szSetting, "%c%s_PF", 246, name);
- cfg::writeString(NULL, CLVM_MODULE, szSetting, szProtoFilter);
+ db_set_s(NULL, CLVM_MODULE, szSetting, szProtoFilter);
mir_snprintf(szSetting, "%c%s_GF", 246, name);
- cfg::writeTString(NULL, CLVM_MODULE, szSetting, szGroupFilter);
+ db_set_ts(NULL, CLVM_MODULE, szSetting, szGroupFilter);
mir_snprintf(szSetting, "%c%s_SM", 246, name);
- cfg::writeDword(CLVM_MODULE, szSetting, statusMask);
+ db_set_dw(NULL, CLVM_MODULE, szSetting, statusMask);
mir_snprintf(szSetting, "%c%s_SSM", 246, name);
- cfg::writeDword(CLVM_MODULE, szSetting, stickyStatusMask);
+ db_set_dw(NULL, CLVM_MODULE, szSetting, stickyStatusMask);
mir_snprintf(szSetting, "%c%s_OPT", 246, name);
- cfg::writeDword(CLVM_MODULE, szSetting, options);
+ db_set_dw(NULL, CLVM_MODULE, szSetting, options);
mir_snprintf(szSetting, "%c%s_LM", 246, name);
- cfg::writeDword(CLVM_MODULE, szSetting, lmdat);
+ db_set_dw(NULL, CLVM_MODULE, szSetting, lmdat);
- cfg::writeDword(CLVM_MODULE, name, MAKELONG((unsigned short)operators, (unsigned short)stickies));
+ db_set_dw(NULL, CLVM_MODULE, name, MAKELONG((unsigned short)operators, (unsigned short)stickies));
}
// saves the state of the filter definitions for the current item
@@ -393,11 +393,11 @@ void SaveState()
if (hItem) {
if (SendDlgItemMessage(sttClvmHwnd, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) {
dwLocalMask = GetMaskForItem(hItem);
- cfg::writeDword(hContact, "CLVM", szModeName, MAKELONG(1, (unsigned short)dwLocalMask));
+ db_set_dw(hContact, "CLVM", szModeName, MAKELONG(1, (unsigned short)dwLocalMask));
stickies++;
}
- else if (cfg::getDword(hContact, "CLVM", szModeName, 0))
- cfg::writeDword(hContact, "CLVM", szModeName, 0);
+ else if (db_get_dw(hContact, "CLVM", szModeName, 0))
+ db_set_dw(hContact, "CLVM", szModeName, 0);
}
}
@@ -455,17 +455,17 @@ void UpdateFilters()
if (db_get(NULL, CLVM_MODULE, szSetting, &dbv_pf))
goto cleanup;
mir_snprintf(szSetting, "%c%s_GF", 246, szBuf);
- if (cfg::getTString(NULL, CLVM_MODULE, szSetting, &dbv_gf))
+ if (db_get_ts(NULL, CLVM_MODULE, szSetting, &dbv_gf))
goto cleanup;
mir_snprintf(szSetting, "%c%s_OPT", 246, szBuf);
- if ((opt = cfg::getDword(NULL, CLVM_MODULE, szSetting, -1)) != -1) {
+ if ((opt = db_get_dw(NULL, CLVM_MODULE, szSetting, -1)) != -1) {
SendDlgItemMessage(sttClvmHwnd, IDC_AUTOCLEARSPIN, UDM_SETPOS, 0, MAKELONG(LOWORD(opt), 0));
}
mir_snprintf(szSetting, "%c%s_SM", 246, szBuf);
- statusMask = cfg::getDword(CLVM_MODULE, szSetting, -1);
+ statusMask = db_get_dw(NULL, CLVM_MODULE, szSetting, -1);
mir_snprintf(szSetting, "%c%s_SSM", 246, szBuf);
- sttStickyStatusMask = cfg::getDword(CLVM_MODULE, szSetting, -1);
- dwFlags = cfg::getDword(CLVM_MODULE, szBuf, 0);
+ sttStickyStatusMask = db_get_dw(NULL, CLVM_MODULE, szSetting, -1);
+ dwFlags = db_get_dw(NULL, CLVM_MODULE, szBuf, 0);
{
LVITEMA item = {0};
char szTemp[256];
@@ -539,7 +539,7 @@ void UpdateFilters()
Utils::enableDlgControl(sttClvmHwnd, IDC_LASTMESSAGEUNIT, useLastMsg);
mir_snprintf(szSetting, "%c%s_LM", 246, szBuf);
- lmdat = cfg::getDword(CLVM_MODULE, szSetting, 0);
+ lmdat = db_get_dw(NULL, CLVM_MODULE, szSetting, 0);
SetDlgItemInt(sttClvmHwnd, IDC_LASTMSGVALUE, LOWORD(lmdat), FALSE);
bTmp = LOBYTE(HIWORD(lmdat));
@@ -669,8 +669,8 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SetWindowTextA(hwndSelector, Translate("No view mode"));
}
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
- if (cfg::getDword(hContact, "CLVM", szBuf, -1) != -1)
- cfg::writeDword(hContact, "CLVM", szBuf, 0);
+ if (db_get_dw(hContact, "CLVM", szBuf, -1) != -1)
+ db_set_dw(hContact, "CLVM", szBuf, 0);
SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_DELETESTRING, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), 0);
if (SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_SETCURSEL, 0, 0) != LB_ERR) {
@@ -694,7 +694,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
szBuf[255] = 0;
if (mir_strlen(szBuf) > 2) {
- if (cfg::getDword(CLVM_MODULE, szBuf, -1) != -1)
+ if (db_get_dw(NULL, CLVM_MODULE, szBuf, -1) != -1)
MessageBox(0, TranslateT("A view mode with this name does already exist"), TranslateT("Duplicate name"), MB_OK);
else {
int iNewItem = SendDlgItemMessageA(hwndDlg, IDC_VIEWMODES, LB_INSERTSTRING, -1, (LPARAM)szBuf);
@@ -882,7 +882,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
case WM_USER + 100:
{
- bool bSkinned = cfg::getByte("CLCExt", "bskinned", 0) != 0;
+ bool bSkinned = db_get_b(NULL, "CLCExt", "bskinned", 0) != 0;
for (int i = 0; i < _countof(_buttons); i++) {
HWND hwndButton = GetDlgItem(hwnd, _buttons[i].btn_id);
SendMessage(hwndButton, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(_buttons[i].icon));
@@ -987,7 +987,7 @@ clvm_reset_command:
SetButtonStates();
cfg::dat.current_viewmode[0] = 0;
cfg::dat.old_viewmode[0] = 0;
- cfg::writeString(NULL, "CList", "LastViewMode", "");
+ db_set_s(NULL, "CList", "LastViewMode", "");
break;
case IDC_CONFIGUREMODES:
clvm_config_command:
@@ -1049,7 +1049,7 @@ void ApplyViewMode(const char *name)
cfg::dat.bFilterEffective = 0;
mir_snprintf(szSetting, "%c%s_PF", 246, name);
- if (!cfg::getString(NULL, CLVM_MODULE, szSetting, &dbv)) {
+ if (!db_get_s(NULL, CLVM_MODULE, szSetting, &dbv)) {
if (mir_strlen(dbv.pszVal) >= 2) {
strncpy(cfg::dat.protoFilter, dbv.pszVal, sizeof(cfg::dat.protoFilter));
cfg::dat.protoFilter[sizeof(cfg::dat.protoFilter) - 1] = 0;
@@ -1058,7 +1058,7 @@ void ApplyViewMode(const char *name)
mir_free(dbv.pszVal);
}
mir_snprintf(szSetting, "%c%s_GF", 246, name);
- if (!cfg::getTString(NULL, CLVM_MODULE, szSetting, &dbv)) {
+ if (!db_get_ts(NULL, CLVM_MODULE, szSetting, &dbv)) {
if (mir_tstrlen(dbv.ptszVal) >= 2) {
_tcsncpy(cfg::dat.groupFilter, dbv.ptszVal, _countof(cfg::dat.groupFilter));
cfg::dat.groupFilter[_countof(cfg::dat.groupFilter) - 1] = 0;
@@ -1067,23 +1067,23 @@ void ApplyViewMode(const char *name)
mir_free(dbv.ptszVal);
}
mir_snprintf(szSetting, "%c%s_SM", 246, name);
- cfg::dat.statusMaskFilter = cfg::getDword(CLVM_MODULE, szSetting, -1);
+ cfg::dat.statusMaskFilter = db_get_dw(NULL, CLVM_MODULE, szSetting, -1);
if (cfg::dat.statusMaskFilter >= 1)
cfg::dat.bFilterEffective |= CLVM_FILTER_STATUS;
mir_snprintf(szSetting, "%c%s_SSM", 246, name);
- cfg::dat.stickyMaskFilter = cfg::getDword(CLVM_MODULE, szSetting, -1);
+ cfg::dat.stickyMaskFilter = db_get_dw(NULL, CLVM_MODULE, szSetting, -1);
if (cfg::dat.stickyMaskFilter != -1)
cfg::dat.bFilterEffective |= CLVM_FILTER_STICKYSTATUS;
- cfg::dat.filterFlags = cfg::getDword(CLVM_MODULE, name, 0);
+ cfg::dat.filterFlags = db_get_dw(NULL, CLVM_MODULE, name, 0);
KillTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE);
if (cfg::dat.filterFlags & CLVM_AUTOCLEAR) {
DWORD timerexpire;
mir_snprintf(szSetting, "%c%s_OPT", 246, name);
- timerexpire = LOWORD(cfg::getDword(CLVM_MODULE, szSetting, 0));
+ timerexpire = LOWORD(db_get_dw(NULL, CLVM_MODULE, szSetting, 0));
strncpy(cfg::dat.old_viewmode, cfg::dat.current_viewmode, 256);
cfg::dat.old_viewmode[255] = 0;
SetTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE, timerexpire * 1000, NULL);
@@ -1104,7 +1104,7 @@ void ApplyViewMode(const char *name)
cfg::dat.bFilterEffective |= CLVM_FILTER_LASTMSG;
mir_snprintf(szSetting, "%c%s_LM", 246, name);
- cfg::dat.lastMsgFilter = cfg::getDword(CLVM_MODULE, szSetting, 0);
+ cfg::dat.lastMsgFilter = db_get_dw(NULL, CLVM_MODULE, szSetting, 0);
if (LOBYTE(HIWORD(cfg::dat.lastMsgFilter)))
cfg::dat.bFilterEffective |= CLVM_FILTER_LASTMSG_NEWERTHAN;
else
@@ -1129,12 +1129,12 @@ void ApplyViewMode(const char *name)
cfg::dat.bFilterEffective |= CLVM_STICKY_CONTACTS;
if (cfg::dat.boldHideOffline == (BYTE)-1)
- cfg::dat.boldHideOffline = cfg::getByte("CList", "HideOffline", 0);
+ cfg::dat.boldHideOffline = db_get_b(NULL, "CList", "HideOffline", 0);
CallService(MS_CLIST_SETHIDEOFFLINE, 0, 0);
SetWindowTextA(hwndSelector, name);
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
SetButtonStates();
- cfg::writeString(NULL, "CList", "LastViewMode", cfg::dat.current_viewmode);
+ db_set_s(NULL, "CList", "LastViewMode", cfg::dat.current_viewmode);
}