예제 #1
0
int MirandaLoaded(WPARAM wParam, LPARAM lParam)
{
	InitPcre();
	ModuleLoad(0, 0);
	COptPage PopupOptPage(g_PopupOptPage);
	PopupOptPage.DBToMem();
	RecompileRegexps(*(TCString*)PopupOptPage.GetValue(IDC_POPUPOPTDLG_IGNORESTRINGS));
	HookEvent(ME_OPT_INITIALISE, OptionsDlgInit);
	HookEvent(ME_SYSTEM_MODULELOAD, ModuleLoad);
	HookEvent(ME_SYSTEM_MODULEUNLOAD, ModuleLoad);
	HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ContactSettingChanged);
	SkinAddNewSoundEx(CLIENTCHANGED_SOUND, NULL, LPGEN("ClientChangeNotify: Client changed"));

	if (bPopupExists) {
		CreateServiceFunction(MS_CCN_TOGGLEPOPUPS, srvTogglePopups);
		HookEvent(ME_CLIST_PREBUILDMAINMENU, PrebuildMainMenu);
	
		CLISTMENUITEM mi = { sizeof(mi) };
		mi.flags = CMIF_TCHAR;
		if (g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY))
			mi.ptszName = LPGENT("Disable c&lient change notification");
		else
			mi.ptszName = LPGENT("Enable c&lient change notification");

		mi.pszService = MS_CCN_TOGGLEPOPUPS;
		mi.ptszPopupName = LPGENT("Popups");
		g_hTogglePopupsMenuItem = Menu_AddMainMenuItem(&mi);
	}

	// seems that Fingerprint is not installed
	if (!bFingerprintExists && !db_get_b(NULL, MOD_NAME, DB_NO_FINGERPRINT_ERROR, 0))
		CreateDialog(g_hInstance, MAKEINTRESOURCE(IDD_CCN_ERROR), NULL, CCNErrorDlgProc);

	return 0;
}
예제 #2
0
static int MirandaLoaded(WPARAM, LPARAM)
{
	ModuleLoad(0, 0);
	COptPage PopupOptPage(g_PopupOptPage);
	PopupOptPage.DBToMem();
	RecompileRegexps(*(TCString*)PopupOptPage.GetValue(IDC_POPUPOPTDLG_IGNORESTRINGS));
	HookEvent(ME_OPT_INITIALISE, OptionsDlgInit);
	HookEvent(ME_SYSTEM_MODULELOAD, ModuleLoad);
	HookEvent(ME_SYSTEM_MODULEUNLOAD, ModuleLoad);
	HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ContactSettingChanged);

	g_plugin.addSound(CLIENTCHANGED_SOUND, nullptr, LPGENW("ClientChangeNotify: Client changed"));

	if (bPopupExists) {
		CreateServiceFunction(MS_CCN_TOGGLEPOPUPS, srvTogglePopups);
		HookEvent(ME_CLIST_PREBUILDMAINMENU, PrebuildMainMenu);

		CMenuItem mi(g_plugin);
		SET_UID(mi, 0xfabb9181, 0xdb92, 0x43f4, 0x86, 0x40, 0xca, 0xb6, 0x4c, 0x93, 0x34, 0x27);
		mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Popups"), 0);
		mi.flags = CMIF_UNICODE;
		if (g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY))
			mi.name.w = LPGENW("Disable c&lient change notification");
		else
			mi.name.w = LPGENW("Enable c&lient change notification");

		mi.pszService = MS_CCN_TOGGLEPOPUPS;
		g_hTogglePopupsMenuItem = Menu_AddMainMenuItem(&mi);
	}

	// seems that Fingerprint is not installed
	if (!bFingerprintExists && !db_get_b(NULL, MODULENAME, DB_NO_FINGERPRINT_ERROR, 0))
		CreateDialog(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CCN_ERROR), nullptr, CCNErrorDlgProc);

	return 0;
}