diff options
Diffstat (limited to 'plugins/FingerPrintModPlus/src')
-rw-r--r-- | plugins/FingerPrintModPlus/src/fingerprint.cpp | 59 | ||||
-rw-r--r-- | plugins/FingerPrintModPlus/src/global.h | 4 | ||||
-rw-r--r-- | plugins/FingerPrintModPlus/src/main.cpp | 7 | ||||
-rw-r--r-- | plugins/FingerPrintModPlus/src/options.cpp | 29 |
4 files changed, 10 insertions, 89 deletions
diff --git a/plugins/FingerPrintModPlus/src/fingerprint.cpp b/plugins/FingerPrintModPlus/src/fingerprint.cpp index 89825499db..f89b51374a 100644 --- a/plugins/FingerPrintModPlus/src/fingerprint.cpp +++ b/plugins/FingerPrintModPlus/src/fingerprint.cpp @@ -133,28 +133,13 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) {
g_LPCodePage = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
- g_bExtraIcon_Register_ServiceExist = ServiceExists(MS_EXTRAICON_REGISTER);
- g_bCList_Extra_Set_Icon_ServiceExist = ServiceExists(MS_CLIST_EXTRA_SET_ICON);
-
//Hook necessary events
HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged);
HookEvent(ME_OPT_INITIALISE, OnOptInitialise);
- if (g_bExtraIcon_Register_ServiceExist) {
- EXTRAICON_INFO ico = { 0 };
-
- ico.cbSize = sizeof(ico);
- ico.type = EXTRAICON_TYPE_CALLBACK;
- ico.RebuildIcons = OnExtraIconListRebuild;
- ico.ApplyIcon = OnExtraImageApply;
- ico.OnClick = (MIRANDAHOOKPARAM)OnExtraIconClick;
- ico.name = "Client";
- ico.description= "Fingerprint";
- ico.descIcon = "client_Miranda_Unknown";
- hExtraIcon = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
- }
- else InitFingerEvents();
+ hExtraIcon = ExtraIcon_Register("Client","Fingerprint","client_Miranda_Unknown",
+ OnExtraIconListRebuild,OnExtraImageApply,OnExtraIconClick);
if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) {
hIconFolder = FoldersRegisterCustomPathT("Fingerprint", "Icons", _T(MIRANDA_PATH) _T("\\") DEFAULT_SKIN_FOLDER);
@@ -166,13 +151,6 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) return 0;
}
-int OnExtraIconClicked(WPARAM wParam, LPARAM lParam)
-{
- if (lParam == bColumn)
- CallService(MS_USERINFO_SHOWDIALOG, wParam, NULL);
- return 0;
-}
-
/* ApplyFingerprintImage
* 1)Try to find appropriate mask
* 2)Register icon in extraimage list if not yet registered (0xFF)
@@ -188,38 +166,13 @@ int FASTCALL ApplyFingerprintImage(HANDLE hContact, LPTSTR szMirVer) if (szMirVer)
hImage = GetIconIndexFromFI(szMirVer);
- if (g_bCList_Extra_Set_Icon_ServiceExist && !g_bExtraIcon_Register_ServiceExist) {
- IconExtraColumn iec;
- WORD bColumn = DBGetContactSettingWord(NULL, "Finger", "Column", EXTRA_ICON_CLIENT);
-
- if (bColumn <= 0 || bColumn > EXTRA_ICON_COUNT)
- bColumn = EXTRA_ICON_CLIENT;
-
- iec.cbSize = sizeof(IconExtraColumn);
- iec.hImage = hImage;
- iec.ColumnType = bColumn;
-
- CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&iec);
- }
- else if (g_bExtraIcon_Register_ServiceExist && hExtraIcon != INVALID_HANDLE_VALUE && hExtraIcon != NULL) {
- EXTRAICON ei = { 0 };
- ei.cbSize = sizeof(ei);
- ei.hExtraIcon = hExtraIcon;
- ei.hContact = hContact;
- ei.hImage = hImage;
- CallService(MS_EXTRAICON_SET_ICON, (WPARAM)&ei, 0);
- }
+ if (hExtraIcon != INVALID_HANDLE_VALUE && hExtraIcon != NULL)
+ ExtraIcon_SetIcon(hExtraIcon,hContact,hImage);
+
return 0;
}
-void InitFingerEvents()
-{
- HookEvent(ME_CLIST_EXTRA_CLICK, OnExtraIconClicked);
- HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, OnExtraIconListRebuild);
- HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnExtraImageApply);
-}
-
-int OnExtraIconClick(WPARAM wParam, LPARAM lParam)
+int OnExtraIconClick(WPARAM wParam, LPARAM lParam,LPARAM)
{
CallService(MS_USERINFO_SHOWDIALOG, wParam, NULL);
return 0;
diff --git a/plugins/FingerPrintModPlus/src/global.h b/plugins/FingerPrintModPlus/src/global.h index 7978721cf4..f4971c1cee 100644 --- a/plugins/FingerPrintModPlus/src/global.h +++ b/plugins/FingerPrintModPlus/src/global.h @@ -131,11 +131,10 @@ typedef struct _foundInfo #define DEFAULT_SKIN_FOLDER _T("Icons\\Fp_ClientIcons")
-void InitFingerEvents();
void FASTCALL ClearFI();
int OnIconsChanged(WPARAM wParam, LPARAM lParam);
-int OnExtraIconClick(WPARAM wParam, LPARAM lParam);
+int OnExtraIconClick(WPARAM wParam, LPARAM lParam,LPARAM);
int OnExtraIconListRebuild(WPARAM wParam, LPARAM lParam);
int OnExtraImageApply(WPARAM wParam, LPARAM lParam);
int OnContactSettingChanged(WPARAM wParam, LPARAM lParam);
@@ -164,7 +163,6 @@ void RegisterIcons(); #define WildCompare WildCompareW
#define GetIconsIndexes GetIconsIndexesW
-extern int g_bExtraIcon_Register_ServiceExist, g_bCList_Extra_Set_Icon_ServiceExist;
extern HINSTANCE g_hInst;
extern HANDLE hHeap;
extern LPSTR g_szClientDescription;
diff --git a/plugins/FingerPrintModPlus/src/main.cpp b/plugins/FingerPrintModPlus/src/main.cpp index c2073b7098..4de8a793a2 100644 --- a/plugins/FingerPrintModPlus/src/main.cpp +++ b/plugins/FingerPrintModPlus/src/main.cpp @@ -24,15 +24,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define LIB_REG 2
#define LIB_USE 3
-#define REGISTER_BETA
-
HINSTANCE g_hInst;
int hLangpack;
HANDLE hHeap = NULL;
-HANDLE hExtraImageListRebuild = NULL; // hook event handle for ME_CLIST_EXTRA_LIST_REBUILD
-HANDLE hExtraImageApply = NULL; // hook event handle for ME_CLIST_EXTRA_IMAGE_APPLY
-HANDLE hExtraIconClick = NULL; // hook event handle for ME_CLIST_EXTRA_CLICK
HANDLE compClientServA = NULL;
HANDLE getClientIconA = NULL;
@@ -43,8 +38,6 @@ LPSTR g_szClientDescription = NULL; HANDLE hStaticHooks[1] = { NULL };
-int g_bExtraIcon_Register_ServiceExist = FALSE, g_bCList_Extra_Set_Icon_ServiceExist = FALSE;
-
//End of header
// PluginInfo & PluginInfoEx
diff --git a/plugins/FingerPrintModPlus/src/options.cpp b/plugins/FingerPrintModPlus/src/options.cpp index c1d3e5230c..8d6378053b 100644 --- a/plugins/FingerPrintModPlus/src/options.cpp +++ b/plugins/FingerPrintModPlus/src/options.cpp @@ -83,26 +83,6 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP else
LoadDBCheckState(hwndDlg, settings[i].idCtrl, settings[i].szSetName, 1);
}
- LPTSTR CIdComboBox[] =
- {
- _T("Email"),
- _T("Protocol"),
- _T("SMS"),
- _T("Advanced 1"),
- _T("Advanced 2"),
- _T("Web"),
- _T("Client (default)"),
- _T("VisMode"),
- _T("Advanced 3"),
- _T("Advanced 4")
- };
-
- for(int i = 0; i < SIZEOF(CIdComboBox); i++)
- ComboBoxAddString(GetDlgItem(hwndDlg, IDC_ADVICON), CIdComboBox[i], i);
-
- SendDlgItemMessage(hwndDlg, IDC_ADVICON, CB_SETCURSEL, (DBGetContactSettingWord(NULL, "Finger", "Column", EXTRA_ICON_CLIENT)) - 1, 0);
- if (g_bExtraIcon_Register_ServiceExist)
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADVICON), FALSE);
ShowWindow(GetDlgItem(hwndDlg, IDC_OPTCHANGENOTE), SW_HIDE);
}
@@ -151,9 +131,6 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
NMHDR *hdr = (NMHDR *)lParam;
if (hdr && hdr->code == PSN_APPLY) {
- int i = SendDlgItemMessage(hwndDlg, IDC_ADVICON, CB_GETCURSEL, 0, 0) + 1;
- DBWriteContactSettingWord(NULL, "Finger", "Column", (WORD)i);
-
for (int i = 0; i < SIZEOF(settings); i++)
StoreDBCheckState(hwndDlg, settings[i].idCtrl, settings[i].szSetName);
@@ -171,11 +148,11 @@ int OnOptInitialise(WPARAM wParam, LPARAM lParam) OPTIONSDIALOGPAGE odp = { 0 };
odp.cbSize = sizeof(odp);
odp.hInstance = g_hInst;
- odp.pszGroup = LPGEN("Customize");
+ odp.ptszGroup = LPGENT("Customize");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG);
- odp.pszTitle = LPGEN("Fingerprint");
+ odp.ptszTitle = LPGENT("Fingerprint");
odp.pfnDlgProc = DlgProcOptions;
- odp.flags = ODPF_BOLDGROUPS;
+ odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR;;
Options_AddPage(wParam, &odp);
return 0;
}
|