summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-18 20:53:59 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-18 20:53:59 +0000
commit3f23417a1099f73dc28ec1b7d6ec2a1a7fc2b7a2 (patch)
tree3e0bcd88c55dad310da0dc980e252bf9fbfa6dc5 /plugins/UserInfoEx
parent537b94169bf2483798a651ee3b96f7904eebe7b4 (diff)
- PLUGININFO structure removed at all;
- Options_AddPage & UserInfo_AddPage replaced MS_OPT_ADDPAGE & MS_USERINFO_ADDPAGE services respectively - total internal redesign of options' translation - code reformatting git-svn-id: http://svn.miranda-ng.org/main/trunk@477 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx')
-rw-r--r--plugins/UserInfoEx/classPsTree.cpp11
-rw-r--r--plugins/UserInfoEx/dlg_propsheet.cpp30
-rw-r--r--plugins/UserInfoEx/psp_options.cpp10
3 files changed, 19 insertions, 32 deletions
diff --git a/plugins/UserInfoEx/classPsTree.cpp b/plugins/UserInfoEx/classPsTree.cpp
index 55e4fbcd77..ac88130d17 100644
--- a/plugins/UserInfoEx/classPsTree.cpp
+++ b/plugins/UserInfoEx/classPsTree.cpp
@@ -134,26 +134,21 @@ INT CPsTree::AddDummyItem(LPCSTR pszGroup)
if (mir_stricmp(pszGroup, TREE_ROOTITEM))
{
CPsHdr psh;
- OPTIONSDIALOGPAGE odp;
- INT rc;
-
psh._hContact = _pPs->hContact;
psh._pszProto = _pPs->pszProto;
psh._hImages = _hImages;
psh._pPages = _pItems;
psh._numPages = _numItems;
- ZeroMemory(&odp, sizeof(odp));
+ OPTIONSDIALOGPAGE odp = { 0 };
odp.cbSize = sizeof(odp);
odp.hInstance = ghInst;
odp.flags = ODPF_TCHAR;
odp.ptszTitle = mir_utf8decodeT(pszGroup);
- rc = CallService(MS_USERINFO_ADDPAGE, (WPARAM)&psh, (LPARAM)&odp);
+ INT_PTR rc = UserInfo_AddPage((WPARAM)&psh, &odp);
mir_free(odp.ptszTitle);
-
- if (!rc)
- {
+ if (!rc) {
_pItems = psh._pPages;
_numItems = psh._numPages;
return _numItems - 1;
diff --git a/plugins/UserInfoEx/dlg_propsheet.cpp b/plugins/UserInfoEx/dlg_propsheet.cpp
index cefb8e777e..0b9db512cd 100644
--- a/plugins/UserInfoEx/dlg_propsheet.cpp
+++ b/plugins/UserInfoEx/dlg_propsheet.cpp
@@ -43,6 +43,8 @@ Last change by : $Author: ing.u.horn $
#include <m_protocols.h>
#include <m_icq.h>
+#define OPTIONPAGE_OLD_SIZE (offsetof(OPTIONSDIALOGPAGE, hLangpack))
+
#define UPDATEANIMFRAMES 20
// internal dialog message handler
@@ -389,13 +391,9 @@ static INT_PTR AddPage(WPARAM wParam, LPARAM lParam)
// check size of the handled structures
if (pPsh == NULL || odp == NULL || pPsh->_dwSize != sizeof(CPsHdr))
- {
return 1;
- }
- if (odp->cbSize != sizeof(OPTIONSDIALOGPAGE) &&
- odp->cbSize != OPTIONPAGE_OLD_SIZE2 &&
- odp->cbSize != OPTIONPAGE_OLD_SIZE3)
- {
+
+ if (odp->cbSize != sizeof(OPTIONSDIALOGPAGE) && odp->cbSize != OPTIONPAGE_OLD_SIZE) {
MsgErr(NULL, LPGENT("The Page to add has invalid size %d bytes!"), odp->cbSize);
return 1;
}
@@ -403,34 +401,28 @@ static INT_PTR AddPage(WPARAM wParam, LPARAM lParam)
// try to check whether the flag member is initialized or not
odp->flags = odp->flags > (ODPF_UNICODE|ODPF_BOLDGROUPS|ODPF_ICON|PSPF_PROTOPREPENDED) ? 0 : odp->flags;
- if (pPsh->_dwFlags & (PSF_PROTOPAGESONLY|PSF_PROTOPAGESONLY_INIT))
- {
+ if (pPsh->_dwFlags & (PSF_PROTOPAGESONLY|PSF_PROTOPAGESONLY_INIT)) {
BOOLEAN bIsUnicode = (odp->flags & ODPF_UNICODE) == ODPF_UNICODE;
TCHAR* ptszTitle = bIsUnicode ? mir_tstrdup(odp->ptszTitle) : mir_a2t(odp->pszTitle);
// avoid adding pages for a meta subcontact, which have been added for a metacontact.
- if (pPsh->_dwFlags & PSF_PROTOPAGESONLY)
- {
- if (pPsh->_ignore.getIndex(ptszTitle) != -1)
- {
+ if (pPsh->_dwFlags & PSF_PROTOPAGESONLY) {
+ if (pPsh->_ignore.getIndex(ptszTitle) != -1) {
mir_free(ptszTitle);
return 0;
}
}
// init ignore list with pages added by metacontact
else if (pPsh->_dwFlags & PSF_PROTOPAGESONLY_INIT)
- {
pPsh->_ignore.insert(mir_tstrdup(ptszTitle));
- }
+
mir_free(ptszTitle);
}
// create the new tree item
CPsTreeItem *pNew = new CPsTreeItem();
- if (pNew)
- {
- if (pNew->Create(pPsh, odp))
- {
+ if (pNew) {
+ if (pNew->Create(pPsh, odp)) {
MIR_DELETE(pNew);
return 1;
}
@@ -715,7 +707,7 @@ VOID DlgContactInfoLoadModule()
ghDetailsInitEvent = CreateHookableEvent(ME_USERINFO_INITIALISE);
myCreateServiceFunction(MS_USERINFO_SHOWDIALOG, ShowDialog);
- myCreateServiceFunction(MS_USERINFO_ADDPAGE, AddPage);
+ myCreateServiceFunction("UserInfo/AddPage", AddPage);
HookEvent(ME_DB_CONTACT_DELETED, OnDeleteContact);
HookEvent(ME_SYSTEM_PRESHUTDOWN, OnShutdown);
diff --git a/plugins/UserInfoEx/psp_options.cpp b/plugins/UserInfoEx/psp_options.cpp
index cb82943643..d399f82c57 100644
--- a/plugins/UserInfoEx/psp_options.cpp
+++ b/plugins/UserInfoEx/psp_options.cpp
@@ -1527,28 +1527,28 @@ static INT OnInitOptions(WPARAM wParam, LPARAM lParam)
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_COMMON);
odp.pfnDlgProc = DlgProc_CommonOpts;
odp.flags = ODPF_BOLDGROUPS;
- CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
+ Options_AddPage(wParam, &odp);
// Advanced page
odp.pszTab = LPGEN("Advanced");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ADVANCED);
odp.pfnDlgProc = DlgProc_AdvancedOpts;
odp.flags = ODPF_BOLDGROUPS|ODPF_EXPERTONLY;
- CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
+ Options_AddPage(wParam, &odp);
// Details Dialog page
odp.pszTab = LPGEN("Details Dialog");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_DETAILSDLG);
odp.pfnDlgProc = DlgProc_DetailsDlgOpts;
odp.flags = ODPF_BOLDGROUPS;
- CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
+ Options_AddPage(wParam, &odp);
// Reminder page
odp.pszTab = LPGEN("Reminder");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_REMINDER);
odp.pfnDlgProc = DlgProc_ReminderOpts;
odp.flags = ODPF_BOLDGROUPS;
- CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
+ Options_AddPage(wParam, &odp);
// Popups page
if (ServiceExists(MS_POPUP_ADDPOPUPT))
@@ -1558,7 +1558,7 @@ static INT OnInitOptions(WPARAM wParam, LPARAM lParam)
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUP);
odp.pfnDlgProc = DlgProc_Popups;
odp.flags = ODPF_BOLDGROUPS|ODPF_EXPERTONLY;
- CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
+ Options_AddPage(wParam, &odp);
}
return MIR_OK;
}