diff options
author | George Hazan <ghazan@miranda.im> | 2022-08-03 15:10:51 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-08-03 15:10:51 +0300 |
commit | 22ad532bfa626867529355baa5ea96f2fafdc233 (patch) | |
tree | 1b2c01381ddcf0d21f93535c687b661065ed42e8 | |
parent | 7cc95adf48a3c04dbbe364f2d57edd09ff76c0dd (diff) |
fixes #3131 (StdUserInfo & metacontacts)
-rw-r--r-- | include/m_options.h | 1 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/userinfo.cpp | 9 | ||||
-rw-r--r-- | src/core/stduserinfo/res/contact.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | src/core/stduserinfo/res/folder.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | src/core/stduserinfo/res/item.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | src/core/stduserinfo/res/location.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | src/core/stduserinfo/res/notes.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | src/core/stduserinfo/res/resource.rc | 17 | ||||
-rw-r--r-- | src/core/stduserinfo/res/summary.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | src/core/stduserinfo/res/work.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | src/core/stduserinfo/src/contactinfo.cpp | 1 | ||||
-rw-r--r-- | src/core/stduserinfo/src/resource.h | 62 | ||||
-rw-r--r-- | src/core/stduserinfo/src/stdafx.h | 25 | ||||
-rw-r--r-- | src/core/stduserinfo/src/stdinfo.cpp | 7 | ||||
-rw-r--r-- | src/core/stduserinfo/src/userinfo.cpp | 167 | ||||
-rw-r--r-- | src/core/stduserinfo/stduserinfo.vcxproj | 4 | ||||
-rw-r--r-- | src/core/stduserinfo/stduserinfo.vcxproj.filters | 8 |
17 files changed, 216 insertions, 85 deletions
diff --git a/include/m_options.h b/include/m_options.h index b8af09a177..b60b84a711 100644 --- a/include/m_options.h +++ b/include/m_options.h @@ -77,6 +77,7 @@ struct OPTIONSDIALOGPAGE };
};
+#define ODPF_ICON 2 // dwInitParam contains icon id
#define ODPF_BOLDGROUPS 4 // give group box titles a bold font
#define ODPF_UNICODE 8 // string fields in OPTIONSDIALOGPAGE are wchar_t*
#define ODPF_USERINFOTAB 16 // options page is tabbed
diff --git a/protocols/ICQ-WIM/src/userinfo.cpp b/protocols/ICQ-WIM/src/userinfo.cpp index 259796a268..3be4624d13 100644 --- a/protocols/ICQ-WIM/src/userinfo.cpp +++ b/protocols/ICQ-WIM/src/userinfo.cpp @@ -52,13 +52,10 @@ int CIcqProto::OnUserInfoInit(WPARAM wParam, LPARAM hContact) return 0; USERINFOPAGE uip = {}; - uip.flags = ODPF_UNICODE; - if (hContact == 0) { - uip.flags |= ODPF_DONTTRANSLATE; - uip.szTitle.w = m_tszUserName; - } - else uip.szTitle.w = L"ICQ"; + uip.flags = ODPF_UNICODE | ODPF_USERINFOTAB | ODPF_DONTTRANSLATE; + uip.szGroup.w = m_tszUserName; + uip.szTitle.w = L"ICQ"; uip.position = -1900000000; uip.pDialog = new IcqUserInfoDlg(this); g_plugin.addUserInfo(wParam, &uip); diff --git a/src/core/stduserinfo/res/contact.ico b/src/core/stduserinfo/res/contact.ico Binary files differnew file mode 100644 index 0000000000..a577261846 --- /dev/null +++ b/src/core/stduserinfo/res/contact.ico diff --git a/src/core/stduserinfo/res/folder.ico b/src/core/stduserinfo/res/folder.ico Binary files differnew file mode 100644 index 0000000000..d2b95c4e0e --- /dev/null +++ b/src/core/stduserinfo/res/folder.ico diff --git a/src/core/stduserinfo/res/item.ico b/src/core/stduserinfo/res/item.ico Binary files differnew file mode 100644 index 0000000000..2eaa5d4825 --- /dev/null +++ b/src/core/stduserinfo/res/item.ico diff --git a/src/core/stduserinfo/res/location.ico b/src/core/stduserinfo/res/location.ico Binary files differnew file mode 100644 index 0000000000..fa12c2410b --- /dev/null +++ b/src/core/stduserinfo/res/location.ico diff --git a/src/core/stduserinfo/res/notes.ico b/src/core/stduserinfo/res/notes.ico Binary files differnew file mode 100644 index 0000000000..f13902cdf8 --- /dev/null +++ b/src/core/stduserinfo/res/notes.ico diff --git a/src/core/stduserinfo/res/resource.rc b/src/core/stduserinfo/res/resource.rc index d918243365..dd6c350006 100644 --- a/src/core/stduserinfo/res/resource.rc +++ b/src/core/stduserinfo/res/resource.rc @@ -1,6 +1,6 @@ // Microsoft Visual C++ generated resource script.
//
-#include "..\..\..\mir_app\src\resource.h"
+#include "..\src\resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
@@ -22,6 +22,19 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US /////////////////////////////////////////////////////////////////////////////
//
+// Icon
+//
+
+IDI_FOLDER ICON "folder.ico"
+IDI_ITEM ICON "item.ico"
+IDI_CONTACT ICON "contact.ico"
+IDI_NOTES ICON "notes.ico"
+IDI_SUMMARY ICON "summary.ico"
+IDI_WORK ICON "work.ico"
+IDI_LOCATION ICON "location.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
// Cursor
//
@@ -288,7 +301,7 @@ END 1 TEXTINCLUDE
BEGIN
- "..\\..\\..\\mir_app\\src\\resource.h\0"
+ "..\\src\\resource.h\0"
END
2 TEXTINCLUDE
diff --git a/src/core/stduserinfo/res/summary.ico b/src/core/stduserinfo/res/summary.ico Binary files differnew file mode 100644 index 0000000000..bee8e00d05 --- /dev/null +++ b/src/core/stduserinfo/res/summary.ico diff --git a/src/core/stduserinfo/res/work.ico b/src/core/stduserinfo/res/work.ico Binary files differnew file mode 100644 index 0000000000..2610f64522 --- /dev/null +++ b/src/core/stduserinfo/res/work.ico diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp index a66401ea6d..250c8dd5b2 100644 --- a/src/core/stduserinfo/src/contactinfo.cpp +++ b/src/core/stduserinfo/src/contactinfo.cpp @@ -553,5 +553,6 @@ void InitContactInfo(WPARAM wParam, USERINFOPAGE &uip) {
uip.pDialog = new CContactPage();
uip.szTitle.a = LPGEN("Contact");
+ uip.dwInitParam = IDI_CONTACT;
g_plugin.addUserInfo(wParam, &uip);
}
diff --git a/src/core/stduserinfo/src/resource.h b/src/core/stduserinfo/src/resource.h new file mode 100644 index 0000000000..e67870cef5 --- /dev/null +++ b/src/core/stduserinfo/src/resource.h @@ -0,0 +1,62 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by w:\miranda-ng\src\mir_app\res\resource.rc +// + +#define IDI_FOLDER 101 +#define IDI_ITEM 102 +#define IDI_CONTACT 103 +#define IDI_NOTES 104 +#define IDI_SUMMARY 105 +#define IDI_WORK 106 +#define IDD_ADDPHONE 107 +#define IDD_ADDEMAIL 108 +#define IDD_DETAILS 109 +#define IDD_INFO_SUMMARY 110 +#define IDD_INFO_CONTACT 111 +#define IDD_INFO_BACKGROUND 112 +#define IDD_INFO_NOTES 113 +#define IDD_INFO_LOCATION 114 +#define IDD_INFO_WORK 115 +#define IDI_LOCATION 116 + +#define IDC_COUNTRY 1001 +#define IDC_AREA 1002 +#define IDC_NUMBER 1003 +#define IDC_PHONE 1004 +#define IDC_EMAIL 1005 +#define IDC_HEADERBAR 1006 +#define IDC_PAGETREE 1007 +#define IDC_UPDATE 1008 +#define IDC_UPDATING 1009 +#define IDC_TABS 1010 +#define IDC_NICK 1011 +#define IDC_FIRSTNAME 1012 +#define IDC_GENDER 1013 +#define IDC_LASTNAME 1014 +#define IDC_AGE 1015 +#define IDC_SMS 1016 +#define IDC_DOBDAY 1017 +#define IDC_DOBMONTH 1018 +#define IDC_DOBYEAR 1019 +#define IDC_MARITAL 1020 +#define IDC_EMAILS 1021 +#define IDC_PHONES 1022 +#define IDC_WEBPAGE 1023 +#define IDC_PAST 1024 +#define IDC_INTERESTS 1025 +#define IDC_ABOUT 1026 +#define IDC_MYNOTES 1027 +#define IDC_STREET 1028 +#define IDC_CITY 1029 +#define IDC_STATE 1030 +#define IDC_ZIP 1031 +#define IDC_LANGUAGE1 1032 +#define IDC_LANGUAGE2 1033 +#define IDC_LANGUAGE3 1034 +#define IDC_TIMEZONE 1035 +#define IDC_LOCALTIME 1036 +#define IDC_TIMEZONESELECT 1037 +#define IDC_COMPANY 1038 +#define IDC_DEPARTMENT 1039 +#define IDC_POSITION 1040 diff --git a/src/core/stduserinfo/src/stdafx.h b/src/core/stduserinfo/src/stdafx.h index 9e2c046e9f..a4f3d878bc 100644 --- a/src/core/stduserinfo/src/stdafx.h +++ b/src/core/stduserinfo/src/stdafx.h @@ -44,31 +44,30 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <map>
#include <string>
-#include <m_system.h>
-#include <m_core.h>
#include <newpluginapi.h>
+#include <m_button.h>
+#include <m_clist.h>
+#include <m_contacts.h>
+#include <m_crypto.h>
#include <m_database.h>
+#include <m_findadd.h>
#include <m_gui.h>
-#include <m_netlib.h>
-#include <m_crypto.h>
+#include <m_icolib.h>
#include <m_langpack.h>
-#include <m_clist.h>
-#include <m_button.h>
+#include <m_message.h>
+#include <m_metacontacts.h>
+#include <m_netlib.h>
+#include <m_options.h>
#include <m_protosvc.h>
#include <m_protocols.h>
-#include <m_options.h>
#include <m_skin.h>
-#include <m_contacts.h>
-#include <m_message.h>
-#include <m_userinfo.h>
-#include <m_findadd.h>
-#include <m_icolib.h>
#include <m_timezones.h>
#include <m_toptoolbar.h>
+#include <m_userinfo.h>
#include "version.h"
-#include "../../mir_app/src/resource.h"
+#include "resource.h"
#define MODULENAME "UserInfo"
diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp index eb11d5807b..f7e823f5c5 100644 --- a/src/core/stduserinfo/src/stdinfo.cpp +++ b/src/core/stduserinfo/src/stdinfo.cpp @@ -568,27 +568,34 @@ int DetailsInit(WPARAM wParam, LPARAM lParam) return 0;
USERINFOPAGE uip = {};
+ uip.flags = ODPF_ICON;
+
uip.pDialog = new CSummaryDlg();
uip.szGroup.a = LPGEN("General");
uip.szTitle.a = LPGEN("Summary");
+ uip.dwInitParam = IDI_SUMMARY;
g_plugin.addUserInfo(wParam, &uip);
InitContactInfo(wParam, uip);
uip.pDialog = new CLocationDlg();
uip.szTitle.a = LPGEN("Location");
+ uip.dwInitParam = IDI_LOCATION;
g_plugin.addUserInfo(wParam, &uip);
uip.pDialog = new CWorkDlg();
uip.szTitle.a = LPGEN("Work");
+ uip.dwInitParam = IDI_WORK;
g_plugin.addUserInfo(wParam, &uip);
uip.pDialog = new CBackgroundDlg();
uip.szTitle.a = LPGEN("Background info");
+ uip.dwInitParam = 0;
g_plugin.addUserInfo(wParam, &uip);
uip.pDialog = new CNotesDlg();
uip.szTitle.a = LPGEN("Notes");
+ uip.dwInitParam = IDI_NOTES;
g_plugin.addUserInfo(wParam, &uip);
return 0;
}
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index d1deb514b9..85e328ef4c 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -31,10 +31,12 @@ struct DetailsPageData : public MNonCopyable, public MZeroedObject CUserInfoPageDlg *pDialog;
HWND hwnd;
HTREEITEM hItem;
+ MCONTACT hContact;
HPLUGIN pPlugin;
int changed;
uint32_t dwFlags;
wchar_t *pwszTitle, *pwszGroup;
+ INT_PTR lParam;
~DetailsPageData()
{
@@ -68,6 +70,18 @@ static void ThemeDialogBackground(HWND hwnd) EnableThemeDialogTexture(hwnd, ETDT_ENABLETAB);
}
+static int PageSortProc(const DetailsPageData *item1, const DetailsPageData *item2)
+{
+ wchar_t *s1 = item1->getGroup(), *s2 = item2->getGroup();
+ if (int res = mir_wstrcmp(s1, s2))
+ return res;
+
+ s1 = item1->getTitle(), s2 = item2->getTitle();
+ if (!mir_wstrcmp(s1, TranslateT("Summary"))) return -1;
+ if (!mir_wstrcmp(s2, TranslateT("Summary"))) return 1;
+ return mir_wstrcmp(s1, s2);
+}
+
static int UserInfoContactDelete(WPARAM wParam, LPARAM)
{
HWND hwnd = WindowList_Find(hWindowList, wParam);
@@ -81,64 +95,117 @@ static int UserInfoContactDelete(WPARAM wParam, LPARAM) class CUserInfoDlg : public CDlgBase
{
- MCONTACT m_hContact;
- HINSTANCE m_hInstIcmp = 0;
- HFONT m_hBoldFont = 0;
- int m_updateAnimFrame = 0;
- wchar_t m_szUpdating[64];
- int *m_infosUpdated = 0;
+ MCONTACT m_hContact;
+ HINSTANCE m_hInstIcmp = 0;
+ int m_updateAnimFrame = 0;
+ wchar_t m_szUpdating[64];
+ int *m_infosUpdated = 0;
+ bool m_bIsMeta;
- HANDLE m_hProtoAckEvent = 0;
- HANDLE m_hDllUnloadEvent = 0;
+ HANDLE m_hProtoAckEvent = 0;
+ HANDLE m_hDllUnloadEvent = 0;
+ HIMAGELIST m_imageList = 0;
OBJLIST<DetailsPageData> m_pages;
DetailsPageData *m_pCurrent = nullptr;
- void BuildTree()
+ void PopulateContact(MCONTACT hContact, int iFolderImage)
{
ptrW ptszLastTab(g_plugin.getWStringA("LastTab"));
m_pCurrent = nullptr;
std::map<std::wstring, HTREEITEM> parents;
- for (auto &it : m_pages) {
- wchar_t *pwszGroup = (it->getGroup() == nullptr) ? TranslateT("General") : it->getGroup();
+ LIST<DetailsPageData> items(1, PageSortProc);
+ NotifyEventHooks(hDetailsInitEvent, (WPARAM)&items, hContact);
+ if (items.getCount() == 0)
+ return;
+
+ wchar_t *pwszGeneral = TranslateT("General");
+
+ for (auto &it : items) {
+ wchar_t *pwszGroup = it->getGroup();
+ wchar_t *pwszText = (pwszGroup == nullptr) ? pwszGeneral : pwszGroup;
HTREEITEM hParent;
- auto p = parents.find(pwszGroup);
+ auto p = parents.find(pwszText);
if (p == parents.end()) {
TVINSERTSTRUCT tvis = {};
tvis.hInsertAfter = TVI_LAST;
tvis.item.lParam = (LPARAM)it;
- tvis.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
+ tvis.item.iImage = tvis.item.iSelectedImage = iFolderImage;
+ tvis.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvis.item.state = tvis.item.stateMask = TVIS_EXPANDED;
- tvis.item.pszText = pwszGroup;
- hParent = parents[pwszGroup] = m_tree.InsertItem(&tvis);
+ if (pwszGroup != nullptr) {
+ tvis.item.pszText = pwszGroup;
+ tvis.hParent = (m_bIsMeta) ? parents.find(pwszGeneral)->second : nullptr;
+ }
+ else tvis.item.pszText = pwszGeneral;
+
+ hParent = parents[pwszText] = m_tree.InsertItem(&tvis);
}
else hParent = p->second;
+ int iImage = 1;
+ if ((it->dwFlags & ODPF_ICON) && it->lParam) {
+ HICON hIcon = g_plugin.getIcon(it->lParam);
+ if (hIcon)
+ iImage = ImageList_AddIcon(m_imageList, hIcon);
+ }
+
TVINSERTSTRUCT tvis;
tvis.hParent = hParent;
tvis.hInsertAfter = TVI_LAST;
- tvis.item.mask = TVIF_TEXT | TVIF_PARAM;
+ tvis.item.iImage = tvis.item.iSelectedImage = iImage;
+ tvis.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvis.item.lParam = (LPARAM)it;
tvis.item.pszText = it->getTitle();
if (ptszLastTab && !mir_wstrcmp(tvis.item.pszText, ptszLastTab))
m_pCurrent = it;
+
it->hItem = m_tree.InsertItem(&tvis);
+
+ it->hContact = hContact;
+ m_pages.insert(it);
}
if (!m_pCurrent)
m_pCurrent = &m_pages[0];
}
+ void BuildTree()
+ {
+ if (m_imageList)
+ ImageList_Destroy(m_imageList);
+ m_imageList = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 2, 1);
+
+ ImageList_AddIcon(m_imageList, g_plugin.getIcon(IDI_FOLDER));
+ ImageList_AddIcon(m_imageList, g_plugin.getIcon(IDI_ITEM));
+
+ m_tree.SetImageList(m_imageList, TVSIL_NORMAL);
+
+ PopulateContact(m_hContact, 0);
+
+ if (m_bIsMeta) {
+ int nSubs = db_mc_getSubCount(m_hContact);
+
+ for (int i = 0; i < nSubs; i++) {
+ MCONTACT hSub = db_mc_getSub(m_hContact, i);
+ if (hSub > 0) {
+ auto *szProto = Proto_GetBaseAccountName(hSub);
+ PopulateContact(hSub, ImageList_AddIcon(m_imageList, IcoLib_GetIconByHandle(Skin_GetProtoIcon(szProto, ID_STATUS_ONLINE))));
+ }
+ }
+ }
+ }
+
void CheckOnline()
{
if (m_hContact == 0)
return;
char *szProto = Proto_GetBaseAccountName(m_hContact);
- if (szProto == nullptr)
+ if (szProto == nullptr || m_bIsMeta)
btnUpdate.Disable();
else {
if (Proto_GetStatus(szProto) < ID_STATUS_ONLINE)
@@ -155,7 +222,7 @@ class CUserInfoDlg : public CDlgBase return;
pDlg->SetParent(m_hwnd);
- pDlg->SetContact(m_hContact);
+ pDlg->SetContact(ppg->hContact);
pDlg->Create();
ppg->hwnd = pDlg->GetHwnd();
@@ -175,35 +242,30 @@ class CUserInfoDlg : public CDlgBase SetWindowPos(m_pCurrent->hwnd, HWND_TOP, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, 0);
}
- CCtrlBase m_white, m_place;
+ CCtrlBase m_place;
CCtrlButton btnUpdate;
CCtrlTreeView m_tree;
CTimer updateTimer;
public:
- CUserInfoDlg(MCONTACT hContact, const LIST<DetailsPageData> &items) :
+ CUserInfoDlg(MCONTACT hContact) :
CDlgBase(g_plugin, IDD_DETAILS),
m_hContact(hContact),
+ m_bIsMeta(db_mc_isMeta(hContact)),
m_pages(1),
m_tree(this, IDC_PAGETREE),
m_place(this, IDC_TABS),
- m_white(this, IDC_WHITERECT),
btnUpdate(this, IDC_UPDATE),
updateTimer(this, 1)
{
SetMinSize(480, 382);
- m_white.UseSystemColors();
-
m_tree.OnSelChanged = Callback(this, &CUserInfoDlg::onSelChanged_Tree);
m_tree.OnSelChanging = Callback(this, &CUserInfoDlg::onSelChanging);
btnUpdate.OnClick = Callback(this, &CUserInfoDlg::onClick_Update);
updateTimer.OnEvent = Callback(this, &CUserInfoDlg::onTimer);
-
- for (auto odp: items)
- m_pages.insert(odp);
}
bool OnInitDialog() override
@@ -226,14 +288,6 @@ public: mir_snwprintf(newTitle, oldTitle, name);
SetWindowText(m_hwnd, newTitle);
- //////////////////////////////////////////////////////////////////////
- LOGFONT lf;
- HFONT hNormalFont = (HFONT)SendDlgItemMessage(m_hwnd, IDC_NAME, WM_GETFONT, 0, 0);
- GetObject(hNormalFont, sizeof(lf), &lf);
- lf.lfWeight = FW_BOLD;
- m_hBoldFont = CreateFontIndirect(&lf);
- SendDlgItemMessage(m_hwnd, IDC_NAME, WM_SETFONT, (WPARAM)m_hBoldFont, 0);
-
BuildTree();
//////////////////////////////////////////////////////////////////////
@@ -293,7 +347,6 @@ public: return RD_ANCHORX_RIGHT | RD_ANCHORY_BOTTOM;
case IDC_HEADERBAR:
- case IDC_WHITERECT:
return RD_ANCHORX_WIDTH | RD_ANCHORY_TOP;
case IDC_PAGETREE:
@@ -316,11 +369,12 @@ public: g_plugin.setWString("LastTab", name);
}
+ if (m_imageList)
+ ImageList_Destroy(m_imageList);
+
Utils_SaveWindowPosition(m_hwnd, 0, MODULENAME, "main");
Window_FreeIcon_IcoLib(m_hwnd);
- SendDlgItemMessage(m_hwnd, IDC_NAME, WM_SETFONT, SendDlgItemMessage(m_hwnd, IDC_WHITERECT, WM_GETFONT, 0, 0), 0);
- DeleteObject(m_hBoldFont);
WindowList_Remove(hWindowList, m_hwnd);
UnhookEvent(m_hProtoAckEvent);
@@ -377,7 +431,10 @@ public: CheckOnline();
break;
}
- if (ack->hContact != m_hContact || ack->type != ACKTYPE_GETINFO)
+
+ if (ack->type != ACKTYPE_GETINFO)
+ break;
+ if (ack->hContact != m_hContact && !(m_bIsMeta && db_mc_getMeta(ack->hContact) == m_hContact))
break;
SendMessage(m_hwnd, PSM_FORCECHANGED, 0, 0);
@@ -514,24 +571,13 @@ static INT_PTR AddDetailsPage(WPARAM wParam, LPARAM lParam) }
pNew->dwFlags = uip->flags;
+ pNew->lParam = uip->dwInitParam;
pList->insert(pNew);
return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////
-static int PageSortProc(const DetailsPageData *item1, const DetailsPageData *item2)
-{
- wchar_t *s1 = item1->getGroup(), *s2 = item2->getGroup();
- if (int res = mir_wstrcmp(s1, s2))
- return res;
-
- s1 = item1->getTitle(), s2 = item2->getTitle();
- if (!mir_wstrcmp(s1, TranslateT("Summary"))) return -1;
- if (!mir_wstrcmp(s2, TranslateT("Summary"))) return 1;
- return mir_wstrcmp(s1, s2);
-}
-
static INT_PTR ShowDetailsDialogCommand(WPARAM hContact, LPARAM)
{
if (HWND hwnd = WindowList_Find(hWindowList, hContact)) {
@@ -540,12 +586,7 @@ static INT_PTR ShowDetailsDialogCommand(WPARAM hContact, LPARAM) return 0;
}
- LIST<DetailsPageData> items(1, PageSortProc);
- NotifyEventHooks(hDetailsInitEvent, (WPARAM)&items, hContact);
- if (items.getCount() == 0)
- return 0;
-
- auto *pDlg = new CUserInfoDlg(hContact, items);
+ auto *pDlg = new CUserInfoDlg(hContact);
pDlg->Show();
return 0;
}
@@ -571,8 +612,22 @@ static int OnTopToolBarLoaded(WPARAM, LPARAM) return 0;
}
+static IconItem iconList[] =
+{
+ { LPGEN("Folder"), "folder", IDI_FOLDER },
+ { LPGEN("Page"), "page", IDI_ITEM },
+ { LPGEN("Contact"), "contact", IDI_CONTACT },
+ { LPGEN("Location"), "location", IDI_LOCATION },
+ { LPGEN("Notes"), "notes", IDI_NOTES },
+ { LPGEN("Page"), "Page", IDI_ITEM },
+ { LPGEN("Summary"), "summary", IDI_SUMMARY },
+ { LPGEN("Work"), "work", IDI_WORK },
+};
+
int LoadUserInfoModule(void)
{
+ g_plugin.registerIcon(MODULENAME, iconList);
+
CreateServiceFunction("UserInfo/AddPage", AddDetailsPage);
CreateServiceFunction(MS_USERINFO_SHOWDIALOG, ShowDetailsDialogCommand);
diff --git a/src/core/stduserinfo/stduserinfo.vcxproj b/src/core/stduserinfo/stduserinfo.vcxproj index 90b5de2fb9..95a73fb2c7 100644 --- a/src/core/stduserinfo/stduserinfo.vcxproj +++ b/src/core/stduserinfo/stduserinfo.vcxproj @@ -35,12 +35,10 @@ <ClCompile Include="src\userinfo.cpp" />
<ClInclude Include="src\stdafx.h" />
<ClInclude Include="src\version.h" />
+ <ClInclude Include="src\resource.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\resource.rc" />
<ResourceCompile Include="res\version.rc" />
</ItemGroup>
- <ItemGroup>
- <None Include="res\cursor_hyperlink.cur" />
- </ItemGroup>
</Project>
\ No newline at end of file diff --git a/src/core/stduserinfo/stduserinfo.vcxproj.filters b/src/core/stduserinfo/stduserinfo.vcxproj.filters index 21fb202501..67b20cd02b 100644 --- a/src/core/stduserinfo/stduserinfo.vcxproj.filters +++ b/src/core/stduserinfo/stduserinfo.vcxproj.filters @@ -25,6 +25,9 @@ <ClInclude Include="src\version.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="src\resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\resource.rc">
@@ -34,9 +37,4 @@ <Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
- <ItemGroup>
- <None Include="res\cursor_hyperlink.cur">
- <Filter>Resource Files</Filter>
- </None>
- </ItemGroup>
</Project>
\ No newline at end of file |