From a447216c8e0ae1226220b9a47dc12122457969fb Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sat, 23 Mar 2013 20:18:56 +0000 Subject: -fixes for x64 version -fixed double translations (since r3194) -fixed background setting git-svn-id: http://svn.miranda-ng.org/main/trunk@4169 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AutoShutdown/src/frame.cpp | 4 +-- plugins/AutoShutdown/src/shutdownsvc.cpp | 54 ++++++++++++++++---------------- plugins/AutoShutdown/src/utils.cpp | 4 ++- plugins/AutoShutdown/src/utils.h | 2 +- 4 files changed, 33 insertions(+), 31 deletions(-) (limited to 'plugins/AutoShutdown/src') diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index ad40340a57..c48c3927d1 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -597,9 +597,9 @@ static int FrameModulesLoaded(WPARAM wParam,LPARAM lParam) BOOL (WINAPI *pfnIsThemeActive)(VOID); /* built-in font module is not available before this hook */ clr=GetDefaultColor(FRAMEELEMENT_TEXT); - FontService_RegisterFont("AutoShutdown","CountdownFont",TranslateT("Automatic Shutdown"),TranslateT("Countdown on Frame"),0,FALSE,GetDefaultFont(&lf),clr); + FontService_RegisterFont("AutoShutdown","CountdownFont",LPGENT("Automatic Shutdown"),LPGENT("Countdown on Frame"),LPGENT("Automatic Shutdown"),LPGENT("Background"),0,FALSE,GetDefaultFont(&lf),clr); clr=GetDefaultColor(FRAMEELEMENT_BKGRND); - FontService_RegisterColor("AutoShutdown","BkgColor",TranslateT("Automatic Shutdown"),TranslateT("Background"),clr); + FontService_RegisterColor("AutoShutdown","BkgColor",LPGENT("Automatic Shutdown"),LPGENT("Background"),clr); /* progressbar color can only be changed in windows classic theme */ /* FIXME: should be registered/unregistered on WM_THEMECHANGED/ME_OPT_INITIALISE msg, * currently not possible as no such font service exists */ diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index f367b57ad2..889040cc03 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -440,15 +440,15 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR return TRUE; case M_UPDATE_COUNTDOWN: /* lParam=(WORD)countdown */ { TCHAR szText[256]; - TCHAR *desc[]={TranslateT("Miranda NG is going to be automatically closed in %u second(s)."), - TranslateT("All Miranda NG protocols are going to be set to offline in %u second(s)."), - TranslateT("You will be logged off automatically in %u second(s)."), - TranslateT("The computer will automatically be restarted in %u second(s)."), - TranslateT("The computer will automatically be set to standby mode in %u second(s)."), - TranslateT("The computer will automatically be set to hibernate mode in %u second(s)."), - TranslateT("The workstation will automatically get locked in %u second(s)."), - TranslateT("All dialup connections will be closed in %u second(s)."), - TranslateT("The computer will automatically be shut down in %u second(s).")}; + TCHAR *desc[]={LPGENT("Miranda NG is going to be automatically closed in %u second(s)."), + LPGENT("All Miranda NG protocols are going to be set to offline in %u second(s)."), + LPGENT("You will be logged off automatically in %u second(s)."), + LPGENT("The computer will automatically be restarted in %u second(s)."), + LPGENT("The computer will automatically be set to standby mode in %u second(s)."), + LPGENT("The computer will automatically be set to hibernate mode in %u second(s)."), + LPGENT("The workstation will automatically get locked in %u second(s)."), + LPGENT("All dialup connections will be closed in %u second(s)."), + LPGENT("The computer will automatically be shut down in %u second(s).")}; mir_sntprintf(szText,SIZEOF(szText),TranslateTS(desc[shutdownType-1]),lParam); SetDlgItemText(hwndDlg,IDC_TEXT_HEADER,szText); /* countdown finished */ @@ -517,22 +517,22 @@ INT_PTR ServiceIsTypeEnabled(WPARAM wParam,LPARAM lParam) INT_PTR ServiceGetTypeDescription(WPARAM wParam,LPARAM lParam) { TCHAR *pszDesc; - const TCHAR *apszShort[]={TranslateT("Close Miranda NG"),TranslateT("Set Miranda NG offline"),TranslateT("Log off user"), - TranslateT("Restart computer"),TranslateT("Shutdown computer"),TranslateT("Standby mode"),TranslateT("Hibernate mode"), - TranslateT("Lock workstation"),TranslateT("Hang up dialup connections"),TranslateT("Close Miranda NG"), - TranslateT("Set Miranda NG offline"),TranslateT("Log off user"),TranslateT("Restart computer"),TranslateT("Shutdown computer"), - TranslateT("Standby mode"),TranslateT("Hibernate mode"),TranslateT("Lock workstation"),TranslateT("Hang up dialup connections")}; - const TCHAR *apszLong[]={TranslateT("Sets all Miranda NG protocols to offline and closes Miranda NG."), - TranslateT("Sets all Miranda NG protocols to offline."), - TranslateT("Logs the current Windows user off so that another user can log in."), - TranslateT("Shuts down Windows and then restarts Windows."), - TranslateT("Closes all running programs and shuts down Windows to a point at which it is safe to turn off the power."), - TranslateT("Saves the current Windows session in memory and sets the system to suspend mode."), - TranslateT("Saves the current Windows session on harddisc, so that the power can be turned off."), - TranslateT("Locks the computer. To unlock the computer, you must log in."), - TranslateT("Sets all protocols to offline and closes all RAS connections.")}; + const TCHAR *apszShort[]={LPGENT("Close Miranda NG"),LPGENT("Set Miranda NG offline"),LPGENT("Log off user"), + LPGENT("Restart computer"),LPGENT("Shutdown computer"),LPGENT("Standby mode"),LPGENT("Hibernate mode"), + LPGENT("Lock workstation"),LPGENT("Hang up dialup connections"),LPGENT("Close Miranda NG"), + LPGENT("Set Miranda NG offline"),LPGENT("Log off user"),LPGENT("Restart computer"),LPGENT("Shutdown computer"), + LPGENT("Standby mode"),LPGENT("Hibernate mode"),LPGENT("Lock workstation"),LPGENT("Hang up dialup connections")}; + const TCHAR *apszLong[]={LPGENT("Sets all Miranda NG protocols to offline and closes Miranda NG."), + LPGENT("Sets all Miranda NG protocols to offline."), + LPGENT("Logs the current Windows user off so that another user can log in."), + LPGENT("Shuts down Windows and then restarts Windows."), + LPGENT("Closes all running programs and shuts down Windows to a point at which it is safe to turn off the power."), + LPGENT("Saves the current Windows session in memory and sets the system to suspend mode."), + LPGENT("Saves the current Windows session on harddisc, so that the power can be turned off."), + LPGENT("Locks the computer. To unlock the computer, you must log in."), + LPGENT("Sets all protocols to offline and closes all RAS connections.")}; /* shutdownType range check */ - if(!wParam || (BYTE)wParam>SDSDT_MAX) return (int)NULL; + if(!wParam || (BYTE)wParam>SDSDT_MAX) return 0; /* select description */ pszDesc=(TCHAR*)((lParam&GSTDF_LONGDESC)?apszLong:apszShort)[wParam-1]; if(!(lParam&GSTDF_UNTRANSLATED)) pszDesc=TranslateTS(pszDesc); @@ -540,12 +540,12 @@ INT_PTR ServiceGetTypeDescription(WPARAM wParam,LPARAM lParam) if(!(lParam&GSTDF_UNICODE)) { static char szConvBuf[128]; char *buf=u2a(pszDesc); - if(buf==NULL) return (int)NULL; + if(buf==NULL) return 0; lstrcpynA(szConvBuf,buf,sizeof(szConvBuf)); mir_free(buf); - return (int)szConvBuf; + return (INT_PTR)szConvBuf; } - return (int)pszDesc; + return (INT_PTR)pszDesc; } /************************* Misc ***************************************/ diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp index 35dc388557..18c893a77d 100644 --- a/plugins/AutoShutdown/src/utils.cpp +++ b/plugins/AutoShutdown/src/utils.cpp @@ -210,7 +210,7 @@ BOOL GetFormatedDateTime(TCHAR *pszOut,int nSize,time_t timestamp,BOOL fShowDate /************************* Fonts & Colors *************************/ -int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,int position,BOOL bAllowEffects,LOGFONT *plfDefault,COLORREF clrDefault) +int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,const TCHAR* pszBackgroundGroup,const TCHAR* pszBackgroundName,int position,BOOL bAllowEffects,LOGFONT *plfDefault,COLORREF clrDefault) { FontIDT fid; ZeroMemory(&fid,sizeof(fid)); @@ -219,6 +219,8 @@ int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const lstrcpynA(fid.prefix,pszDbName,sizeof(fid.prefix)); /* buffer safe */ lstrcpyn(fid.group,pszSection,SIZEOF(fid.group)); /* buffer safe */ lstrcpyn(fid.name,pszDescription,SIZEOF(fid.name)); /* buffer safe */ + lstrcpyn(fid.backgroundGroup,pszBackgroundGroup,SIZEOF(fid.backgroundGroup)); /* buffer safe */ + lstrcpyn(fid.backgroundName,pszBackgroundName,SIZEOF(fid.backgroundName)); /* buffer safe */ fid.flags=FIDF_ALLOWREREGISTER; if(bAllowEffects) fid.flags|=FIDF_ALLOWEFFECTS; fid.order=position; diff --git a/plugins/AutoShutdown/src/utils.h b/plugins/AutoShutdown/src/utils.h index be5a8dfd6c..b2e65c7705 100644 --- a/plugins/AutoShutdown/src/utils.h +++ b/plugins/AutoShutdown/src/utils.h @@ -35,7 +35,7 @@ BOOL GetFormatedCountdown(TCHAR *pszOut,int nSize,time_t countdown); BOOL GetFormatedDateTime(TCHAR *pszOut,int nSize,time_t timestamp,BOOL fShowDateEvenToday); /* Fonts & Colors */ -int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,int position,BOOL bAllowEffects,LOGFONT *plfDefault,COLORREF clrDefault); +int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,const TCHAR* pszBackgroundGroup,const TCHAR* pszBackgroundName,int position,BOOL bAllowEffects,LOGFONT *plfDefault,COLORREF clrDefault); int FontService_GetFont(const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF *pclr,LOGFONT *plf); int FontService_RegisterColor(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF clrDefault); int FontService_GetColor(const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF *pclr); -- cgit v1.2.3