static void   sttReloadButtons()
{
	int i=0;
	tbcheck ;
	tblock;
	{
		int vis=ModernGetSettingByte(NULL,"CLUI","ShowButtonBar",SETTINGS_SHOWBUTTONBAR_DEFAULT);
		WindowList_Broadcast(tbdat.hToolBarWindowList,MTBM_UPDATEFRAMEVISIBILITY,(WPARAM)ModernGetSettingByte(NULL,"CLUI","ShowButtonBar",SETTINGS_SHOWBUTTONBAR_DEFAULT),0);
	}

	WindowList_Broadcast(tbdat.hToolBarWindowList, MTBM_REMOVE_ALL_BUTTONS, 0,0);
	for (i=0; i<tbdat.listOfButtons->realCount; i++)
	{	
		BYTE bVisible;
		BYTE bPanel;
		DWORD dwOrder;

		MTB_BUTTONINFO * mtbi = (MTB_BUTTONINFO *)tbdat.listOfButtons->items[i];
		
		bVisible=mtbi->bVisible;
		sttGetButtonSettings(mtbi->szButtonID, &bVisible, &dwOrder, &bPanel);
		
		mtbi->nOrderValue = dwOrder ? dwOrder : mtbi->nOrderValue;
		mtbi->bVisible = bVisible;
		mtbi->bPanelID = bPanel;
		
		if (mtbi->bVisible) 
			ToolBar_AddButtonToBars(mtbi);
	}
	tbunlock;
	sttSetButtonPressed( "ShowHideOffline", (BOOL) ModernGetSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) );
	sttSetButtonPressed( "UseGroups", (BOOL) ModernGetSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) );
	sttSetButtonPressed( "EnableSounds", (BOOL) ModernGetSettingByte(NULL, "Skin", "UseSound", SETTING_ENABLESOUNDS_DEFAULT ) );

}
Beispiel #2
0
int OnSystemPreshutdown(WPARAM, LPARAM)
{
	WindowList_Broadcast(g_dat.hMessageWindowList, WM_CLOSE, 0, 0);
	WindowList_Broadcast(g_dat.hParentWindowList, WM_CLOSE, 0, 0);
	DeinitStatusIcons();
	return 0;
}
Beispiel #3
0
static int IconsChanged(WPARAM, LPARAM)
{
	FreeMsgLogIcons();
	LoadMsgLogIcons();
	WindowList_Broadcast(g_dat.hMessageWindowList, DM_REMAKELOG, 0, 0);
	// change all the icons
	WindowList_Broadcast(g_dat.hMessageWindowList, DM_UPDATEWINICON, 0, 0);
	return 0;
}
Beispiel #4
0
static int HookContactSettingChanged(WPARAM hContact, LPARAM lParam)
{
	DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
	char *szProto = GetContactProto(hContact);
	if (strcmpnull(cws->szModule, "CList") && strcmpnull(cws->szModule, szProto))
		return 0;

	WindowList_Broadcast(g_hSendWindowList, DM_UPDATETITLE, 0, 0);
	WindowList_Broadcast(g_hRecvWindowList, DM_UPDATETITLE, 0, 0);
	return 0;
}
Beispiel #5
0
int AwayMsgPreShutdown(void)
{
	if (hWindowList) {
		WindowList_Broadcast(hWindowList, WM_CLOSE, 0, 0);
		WindowList_Destroy(hWindowList);
	}
	if (hWindowList2) {
		WindowList_Broadcast(hWindowList2, WM_CLOSE, 0, 0);
		WindowList_Destroy(hWindowList2);
	}
	return 0;
}
Beispiel #6
0
int WeatherShutdown(WPARAM, LPARAM)
{
	KillTimer(NULL, timerId);		// kill update timer

	SaveOptions();					// save options once more
	status = ID_STATUS_OFFLINE;		// set status to offline

	CallService(MS_NETLIB_SHUTDOWN, (WPARAM)hNetlibHttp, 0);

	WindowList_Broadcast(hWindowList, WM_CLOSE, 0, 0);
	WindowList_Broadcast(hDataWindowList, WM_CLOSE, 0, 0);
	SendMessage(hWndSetup, WM_CLOSE, 0, 0);

	return 0;
}
int AddStickyStatusIcon(WPARAM wParam, LPARAM lParam) {
	StatusIconData *sid = (StatusIconData *)lParam;
	struct StatusIconListNode *siln = (struct StatusIconListNode *)mir_alloc(sizeof(struct StatusIconListNode));
	struct StatusIconListNode *siln2 = status_icon_list;

	siln->sid.cbSize = sid->cbSize;
	siln->sid.szModule = mir_strdup(sid->szModule);
	siln->sid.dwId = sid->dwId;
	siln->sid.hIcon = DuplicateIcon(NULL, sid->hIcon);
	siln->sid.hIconDisabled = DuplicateIcon(NULL, sid->hIconDisabled);
	siln->sid.flags = sid->flags;
	if(sid->szTooltip) siln->sid.szTooltip = mir_strdup(sid->szTooltip);
	else siln->sid.szTooltip = 0;
	siln->next = NULL;

	while(siln2 && siln2->next) {
		siln2 = siln2->next;
	}
	if (siln2) {
		siln2->next = siln;
	} else {
		status_icon_list = siln;
	}

	status_icon_list_size++;

	WindowList_Broadcast(g_dat->hParentWindowList, DM_STATUSICONCHANGE, 0, 0);
	return 0;
}
Beispiel #8
0
INT_PTR RemoveStatusIcon(WPARAM wParam, LPARAM lParam) {
	StatusIconData *sid = (StatusIconData *)lParam;
	struct StatusIconListNode *current = status_icon_list, *prev = 0;

	while(current) {
		if(strcmp(current->sid.szModule, sid->szModule) == 0 && current->sid.dwId == sid->dwId) {
			if(prev) prev->next = current->next;
			else status_icon_list = current->next;

			status_icon_list_size--;

			mir_free(current->sid.szModule);
			DestroyIcon(current->sid.hIcon);
			if(current->sid.hIconDisabled) DestroyIcon(current->sid.hIconDisabled);
			mir_free(current->sid.szTooltip);
			mir_free(current);
			WindowList_Broadcast(g_dat->hMessageWindowList, DM_STATUSICONCHANGE, 0, 0);
			return 0;
		}

		prev = current;
		current = current->next;
	}

	return 1;
}
Beispiel #9
0
int PreshutdownSendRecv(WPARAM, LPARAM)
{
	WindowList_Broadcast(g_dat.hMessageWindowList, WM_CLOSE, 0, 0);

	DeinitStatusIcons();
	return 0;
}
Beispiel #10
0
static int MessageSettingChanged(WPARAM hContact, LPARAM lParam)
{
	DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)lParam;
	char *szProto = GetContactProto(hContact); // szProto maybe NULL
	if (!strcmp(cws->szModule, "CList") || !mir_strcmp(cws->szModule, szProto))
		WindowList_Broadcast(g_dat.hMessageWindowList, DM_CLISTSETTINGSCHANGED, hContact, lParam);
	return 0;
}
Beispiel #11
0
static int PreShutdownHistoryModule(WPARAM, LPARAM)
{
	if (hWindowList) {
		WindowList_Broadcast(hWindowList, WM_DESTROY, 0, 0);
		WindowList_Destroy(hWindowList);
	}
	return 0;
}
Beispiel #12
0
extern "C" int __declspec(dllexport) Unload()
{
	DestroyServices();

	WindowList_Broadcast(hOpenWindowsList, WM_CLOSE, 0, 0);
	WindowList_Destroy(hOpenWindowsList);
	return 0;
}
Beispiel #13
0
void DeinitAlarmWin()
{	
	WindowList_Broadcast(hAlarmWindowList, WM_COMMAND, IDC_SNOOZE, 0);
	WindowList_Destroy(hAlarmWindowList);

	if (hBackgroundBrush) DeleteObject(hBackgroundBrush);
	if (hTitleFont) DeleteObject(hTitleFont);
	if (hWindowFont) DeleteObject(hWindowFont);
}
Beispiel #14
0
static int AvatarChanged(WPARAM wParam, LPARAM lParam) {
	if (wParam == 0) {			// protocol picture has changed...
		WindowList_Broadcast(g_dat->hMessageWindowList, DM_AVATARCHANGED, wParam, lParam);
	} else {
	    HWND hwnd = WindowList_Find(g_dat->hMessageWindowList, (HANDLE)wParam);
		SendMessage(hwnd, DM_AVATARCHANGED, wParam, lParam);
	}
    return 0;
}
Beispiel #15
0
//
//  wParam - Section name
//  lParam - Icon ID
//
int OnSkinIconsChanged(WPARAM wParam,LPARAM lParam)
{
	for(int indx = 0; indx < SIZEOF(hIcons); indx++)
		hIcons[indx] = Skin_GetIconByHandle( iconList[indx].hIcolib );

	WindowList_Broadcast(hFileList, WM_FE_SKINCHANGE, 0,0);

	return 0;
}
static INT_PTR    svcToolBarRemoveButton(WPARAM wParam, LPARAM lParam)
{
	HANDLE hButton=(HANDLE)wParam;
	tbcheck 0;
	tblock;
	WindowList_Broadcast(tbdat.hToolBarWindowList, MTBM_REMOVEBUTTON, wParam, lParam);
	tbunlock;
	return 0;
}
Beispiel #17
0
static int MessageSettingChanged(WPARAM hContact, LPARAM lParam)
{
	DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
	if (cws->szModule == NULL)
		return 0;

	if (!mir_strcmp(cws->szModule, "CList"))
		WindowList_Broadcast(g_dat.hMessageWindowList, DM_UPDATETITLE, (WPARAM)cws, 0);
	else if (hContact) {
		if (cws->szSetting && !mir_strcmp(cws->szSetting, "Timezone"))
			WindowList_Broadcast(g_dat.hMessageWindowList, DM_NEWTIMEZONE, (WPARAM)cws, 0);
		else {
			char *szProto = GetContactProto(hContact);
			if (szProto && !mir_strcmp(cws->szModule, szProto))
				WindowList_Broadcast(g_dat.hMessageWindowList, DM_UPDATETITLE, (WPARAM)cws, 0);
		}
	}
	return 0;
}
Beispiel #18
0
static int ContactSettingChanged(WPARAM wParam, LPARAM lParam)
{
	DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
	char *szProto = GetContactProto(wParam);
	if (mir_strcmp(cws->szModule, "CList") && (szProto == NULL || mir_strcmp(cws->szModule, szProto)))
		return 0;

	WindowList_Broadcast(hUrlWindowList, DM_UPDATETITLE, 0, 0);
	return 0;
}
Beispiel #19
0
static int MessageSettingChanged(WPARAM wParam, LPARAM lParam)
{
	DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
	char *szProto;

	szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
	if (lstrcmpA(cws->szModule, "CList") && (szProto == NULL || lstrcmpA(cws->szModule, szProto)))
		return 0;
	WindowList_Broadcast(g_dat->hMessageWindowList, DM_UPDATETITLE, (WPARAM) cws, 0);
	return 0;
}
Beispiel #20
0
int NewsAggrPreShutdown(WPARAM, LPARAM)
{
	if (hAddFeedDlg)
		SendMessage(hAddFeedDlg, WM_CLOSE, 0, 0);

	WindowList_Broadcast(hChangeFeedDlgList, WM_CLOSE, 0, 0);

	KillTimer(NULL, timerId);
	NetlibUnInit();
	return 0;
}
Beispiel #21
0
static int OnSrmmIconChanged(WPARAM hContact, LPARAM)
{
	if (hContact == NULL)
		WindowList_Broadcast(g_dat.hMessageWindowList, DM_STATUSICONCHANGE, 0, 0);
	else {
		HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, hContact);
		if (hwnd != NULL)
			PostMessage(hwnd, DM_STATUSICONCHANGE, 0, 0);
	}
	return 0;
}
static MTB_BUTTONINFO * ToolBar_AddButtonToBars(MTB_BUTTONINFO * mtbi)
{	
	int result=0;
	if (!mtbi->bVisible) return 0;
	WindowList_Broadcast(tbdat.hToolBarWindowList, MTBM_ADDBUTTON, (WPARAM)mtbi, 0);
	if (mtbi->hWindow) 
		sttUpdateButtonState( mtbi );
	if (mtbi->hwndToolBar) 
		SendMessage( mtbi->hwndToolBar, MTBM_REPOSBUTTONS, 0, 0);
	return mtbi;
}
Beispiel #23
0
int IconsChanged(WPARAM wParam, LPARAM lParam)
{
	if (hMsgMenuItem) {
		int j;
		CLISTMENUITEM mi;
		mi.cbSize = sizeof(mi);
		mi.flags = CMIM_ICON;
		mi.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
		for (j = 0; j < hMsgMenuItemCount; j++) {
			CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hMsgMenuItem[j], (LPARAM) & mi);
		}
	}
	FreeMsgLogIcons();
	LoadMsgLogIcons();
	LoadProtocolIcons();
	WindowList_Broadcast(g_dat->hMessageWindowList, DM_REMAKELOG, 0, 0);
	// change all the icons
	WindowList_Broadcast(g_dat->hMessageWindowList, DM_CHANGEICONS, 0, 0);
	WindowList_Broadcast(g_dat->hMessageWindowList, DM_UPDATETITLE, 0, 0);
	return 0;
}
Beispiel #24
0
int NewsAggrPreShutdown(WPARAM wParam, LPARAM lParam)
{
	if (hAddFeedDlg)
		SendMessage(hAddFeedDlg, WM_CLOSE, 0, 0);

	WindowList_Broadcast(hChangeFeedDlgList, WM_CLOSE, 0, 0);

	KillTimer(NULL, timerId);
	NetlibUnInit();

	CallService(MS_HOTKEY_UNREGISTER, 0, (LPARAM)"NewsAggregator/CheckAllFeeds");
	return 0;
}
static int PreShutdown(WPARAM wParam, LPARAM lParam)
{
	int i;

	for (i = 0; i < MAX_REGS(hHooks); i++)
		UnhookEvent(hHooks[i]);

	for (i = 0; i < MAX_REGS(hServices); i++)
		DestroyServiceFunction(hServices[i]);

	WindowList_Broadcast(hAvatarWindowsList,WM_CLOSE,0,0);

	return 0;
}
Beispiel #26
0
static int SRUrlShutdown(WPARAM, LPARAM)
{
	if (hEventContactSettingChange)
		UnhookEvent(hEventContactSettingChange);

	if (hContactDeleted)
		UnhookEvent(hContactDeleted);

	if (hUrlWindowList) {
		WindowList_Broadcast(hUrlWindowList, WM_CLOSE, 0, 0);
		WindowList_Destroy(hUrlWindowList);
	}
	return 0;
}
Beispiel #27
0
void RemoveAllStatusIcons(void) {
	struct StatusIconListNode *current;

	while(status_icon_list) {
		current = status_icon_list;
		status_icon_list = status_icon_list->next;
		status_icon_list_size--;

		mir_free(current->sid.szModule);
		DestroyIcon(current->sid.hIcon);
		if(current->sid.hIconDisabled) DestroyIcon(current->sid.hIconDisabled);
		if(current->sid.szTooltip) mir_free(current->sid.szTooltip);
		mir_free(current);
	}

	WindowList_Broadcast(g_dat->hMessageWindowList, DM_STATUSICONCHANGE, 0, 0);
}
static int ModifyStatusIcon(WPARAM wParam, LPARAM lParam) {
	HANDLE hContact = (HANDLE)wParam;

	StatusIconData *sid = (StatusIconData *)lParam;
	struct StatusIconListNode *current = status_icon_list;

	while(current) {
		if(strcmp(current->sid.szModule, sid->szModule) == 0 && current->sid.dwId == sid->dwId) {
			if(!hContact) {
				current->sid.flags = sid->flags;
				if(sid->hIcon) {
					DestroyIcon(current->sid.hIcon);
					current->sid.hIcon = DuplicateIcon(NULL, sid->hIcon);
				}
				if(sid->hIconDisabled) {
					DestroyIcon(current->sid.hIconDisabled);
					current->sid.hIconDisabled = DuplicateIcon(NULL, sid->hIconDisabled);
				}
				if(sid->szTooltip) {
					if(current->sid.szTooltip) mir_free(current->sid.szTooltip);
					current->sid.szTooltip = mir_strdup(sid->szTooltip);
				}

				WindowList_Broadcast(g_dat->hParentWindowList, DM_STATUSICONCHANGE, 0, 0);
			} else {
				char buff[256];
				HWND hwnd;
				sprintf(buff, "SRMMStatusIconFlags%d", (int)sid->dwId);
				DBWriteContactSettingByte(hContact, sid->szModule, buff, (BYTE)sid->flags);
				hwnd = WindowList_Find(g_dat->hMessageWindowList, hContact);
				if (hwnd == NULL) {
					hwnd = SM_FindWindowByContact(hContact);

				}
				if (hwnd != NULL) {
					PostMessage(GetParent(hwnd), DM_STATUSICONCHANGE, 0, 0);
				}
			}
			return 0;
		}

		current = current->next;
	}

	return 1;
}
Beispiel #29
0
int ReloadFonts(WPARAM, LPARAM)
{
	LOGFONT log_font;
	title_font_colour = CallService(MS_FONT_GETT, (WPARAM)&title_font_id, (LPARAM)&log_font);
	DeleteObject(hTitleFont);
	hTitleFont = CreateFontIndirect(&log_font);

	window_font_colour = CallService(MS_FONT_GETT, (WPARAM)&window_font_id, (LPARAM)&log_font);
	DeleteObject(hWindowFont);
	hWindowFont = CreateFontIndirect(&log_font);

	COLORREF bkCol = CallService(MS_COLOUR_GETT, (WPARAM)&bk_colour_id, 0);
	DeleteObject(hBackgroundBrush);
	hBackgroundBrush = CreateSolidBrush(bkCol);

	WindowList_Broadcast(hAlarmWindowList, WMU_REFRESH, 0, 0);
	return 0;
}
Beispiel #30
0
int ReloadFonts(WPARAM, LPARAM)
{
	LOGFONT log_font;
	title_font_colour = Font_GetW(title_font_id, &log_font);
	DeleteObject(hTitleFont);
	hTitleFont = CreateFontIndirect(&log_font);

	window_font_colour = Font_GetW(window_font_id, &log_font);
	DeleteObject(hWindowFont);
	hWindowFont = CreateFontIndirect(&log_font);

	COLORREF bkCol = Colour_GetW(bk_colour_id);
	DeleteObject(hBackgroundBrush);
	hBackgroundBrush = CreateSolidBrush(bkCol);

	WindowList_Broadcast(hAlarmWindowList, WMU_REFRESH, 0, 0);
	return 0;
}