diff options
| author | Tobias Weimer <wishmaster51@googlemail.com> | 2012-12-05 19:56:06 +0000 | 
|---|---|---|
| committer | Tobias Weimer <wishmaster51@googlemail.com> | 2012-12-05 19:56:06 +0000 | 
| commit | 2cc3a9b83f61b8ddc3338574c466c892ffe8c02b (patch) | |
| tree | 46bf7da3a7e6bf0ac6997fb0c028a5dba32fbb05 /plugins/WhenWasIt/src | |
| parent | 3cd022db126b5de4ba485172875a3919b79d00ca (diff) | |
fixed popup icons
git-svn-id: http://svn.miranda-ng.org/main/trunk@2656 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/WhenWasIt/src')
| -rw-r--r-- | plugins/WhenWasIt/src/dlg_handlers.h | 2 | ||||
| -rw-r--r-- | plugins/WhenWasIt/src/icons.cpp | 7 | ||||
| -rw-r--r-- | plugins/WhenWasIt/src/notifiers.cpp | 20 | 
3 files changed, 11 insertions, 18 deletions
diff --git a/plugins/WhenWasIt/src/dlg_handlers.h b/plugins/WhenWasIt/src/dlg_handlers.h index 10e1b1ff2b..e33df200ad 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.h +++ b/plugins/WhenWasIt/src/dlg_handlers.h @@ -40,6 +40,6 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara  INT_PTR CALLBACK DlgProcBirthdays(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
  INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
  INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
 -INT_PTR CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
 +LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
  #endif //M_WWI_DIALOG_HANDLERS_H
\ No newline at end of file diff --git a/plugins/WhenWasIt/src/icons.cpp b/plugins/WhenWasIt/src/icons.cpp index 14db9fbd71..3e153a2533 100644 --- a/plugins/WhenWasIt/src/icons.cpp +++ b/plugins/WhenWasIt/src/icons.cpp @@ -33,7 +33,7 @@ HANDLE hWWIExtraIcons = (HANDLE) -1;  static HANDLE AddIcon(char *name, char *description, TCHAR *tszPath, int iDefaultIdx)
  {
  	SKINICONDESC sid = { sizeof(sid) };
 -	sid.flags = SIDF_PATH_UNICODE;
 +	sid.flags = SIDF_PATH_TCHAR;
  	sid.pszSection = "WhenWasIt";
  	sid.cx = sid.cy = 16;
  	sid.pszDescription = description;
 @@ -74,8 +74,5 @@ int AddIcons()  HANDLE GetDTBIconHandle(int dtb)
  {
 -	if (dtb >= cDTB || dtb < 0)
 -		return hDTBMore;
 -
 -	return hDTB[dtb];
 +	return ((dtb >= cDTB || dtb < 0) ? hDTBMore : hDTB[dtb]);
  }
 diff --git a/plugins/WhenWasIt/src/notifiers.cpp b/plugins/WhenWasIt/src/notifiers.cpp index 6921a19619..3ae570bf70 100644 --- a/plugins/WhenWasIt/src/notifiers.cpp +++ b/plugins/WhenWasIt/src/notifiers.cpp @@ -39,8 +39,6 @@ void PopupNotifyNoBirthdays()  	_tcscpy(pd.lptzContactName, TranslateT("WhenWasIt"));
  	_tcscpy(pd.lptzText, TranslateT("No upcoming birthdays."));
  	PUAddPopUpT(&pd);
 -
 -	Skin_ReleaseIcon(pd.lchIcon);
  }
  TCHAR *BuildDTBText(int dtb, TCHAR *name, TCHAR *text, int size)
 @@ -87,10 +85,10 @@ int PopupNotifyBirthday(HANDLE hContact, int dtb, int age)  	POPUPDATAT pd = {0};
  	FillPopupData(pd, dtb);
  	pd.lchContact = hContact;
 -	pd.PluginWindowProc = (WNDPROC)DlgProcPopup;
 +	pd.PluginWindowProc = DlgProcPopup;
  	pd.lchIcon = GetDTBIcon(dtb);
 -	_stprintf(pd.lptzContactName, TranslateT("Birthday - %s"), name);
 +	mir_sntprintf(pd.lptzContactName, MAX_CONTACTNAME, TranslateT("Birthday - %s"), name);
  	TCHAR *sex;
  	switch (toupper(gender)) {
  	case _T('M'):
 @@ -104,13 +102,12 @@ int PopupNotifyBirthday(HANDLE hContact, int dtb, int age)  		break;
  	}
  	if (dtb > 0)
 -		_stprintf(pd.lptzText, TranslateT("%s\n%s will be %d years old."), text, sex, age);
 +		mir_sntprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s will be %d years old."), text, sex, age);
  	else
 -		_stprintf(pd.lptzText, TranslateT("%s\n%s just turned %d."), text, sex, age);
 +		mir_sntprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s just turned %d."), text, sex, age);
  	PUAddPopUpT(&pd);
 -	Skin_ReleaseIcon(pd.lchIcon);
  	free(name);
  	return 0;
  }
 @@ -132,10 +129,10 @@ int PopupNotifyMissedBirthday(HANDLE hContact, int dab, int age)  	POPUPDATAT pd = {0};
  	FillPopupData(pd, dab);
  	pd.lchContact = hContact;
 -	pd.PluginWindowProc = (WNDPROC)DlgProcPopup;
 +	pd.PluginWindowProc = DlgProcPopup;
  	pd.lchIcon = GetDTBIcon(dab);
 -	_stprintf(pd.lptzContactName, TranslateT("Birthday - %s"), name);
 +	mir_sntprintf(pd.lptzContactName, MAX_CONTACTNAME, TranslateT("Birthday - %s"), name);
  	TCHAR *sex;
  	switch (toupper(gender)) {
  	case _T('M'): 
 @@ -149,13 +146,12 @@ int PopupNotifyMissedBirthday(HANDLE hContact, int dab, int age)  		break;
  	}
  	if (dab > 0)
 -		_stprintf(pd.lptzText, TranslateT("%s\n%s just turned %d."), text, sex, age);
 +		mir_sntprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s just turned %d."), text, sex, age);
  	else
 -		_stprintf(pd.lptzText, TranslateT("%s\n%s just turned %d."), text, sex, age);
 +		mir_sntprintf(pd.lptzText, MAX_SECONDLINE, TranslateT("%s\n%s just turned %d."), text, sex, age);
  	PUAddPopUpT(&pd);
 -	Skin_ReleaseIcon(pd.lchIcon);
  	free(name);
  	return 0;
  }
  | 
