summaryrefslogtreecommitdiff
path: root/plugins/AutoShutdown
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2013-02-12 19:10:10 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2013-02-12 19:10:10 +0000
commita3ff000eb0e2e29c77c38d184d65597e1ad32fcc (patch)
tree105d0871ac304fc372012bb879ab71382226c0f4 /plugins/AutoShutdown
parent37d75985201293402712edfecb611fc14aaa1c3a (diff)
fixed sound registration (fixes #233)
git-svn-id: http://svn.miranda-ng.org/main/trunk@3581 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AutoShutdown')
-rw-r--r--plugins/AutoShutdown/src/main.cpp29
-rw-r--r--plugins/AutoShutdown/src/shutdownsvc.cpp2
-rw-r--r--plugins/AutoShutdown/src/utils.cpp26
-rw-r--r--plugins/AutoShutdown/src/utils.h1
4 files changed, 1 insertions, 57 deletions
diff --git a/plugins/AutoShutdown/src/main.cpp b/plugins/AutoShutdown/src/main.cpp
index daa4dbb611..b65d990d7a 100644
--- a/plugins/AutoShutdown/src/main.cpp
+++ b/plugins/AutoShutdown/src/main.cpp
@@ -51,35 +51,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, VOID *pReserved)
return TRUE;
}
-static void InstallFile(const TCHAR *pszFileName,const TCHAR *pszDestSubDir)
-{
- TCHAR szFileFrom[MAX_PATH+1],szFileTo[MAX_PATH+1],*p;
- HANDLE hFile;
-
- if(!GetModuleFileName(hInst,szFileFrom,SIZEOF(szFileFrom)-lstrlen(pszFileName)))
- return;
- p=_tcsrchr(szFileFrom,_T('\\'));
- if(p!=NULL) *(++p)=0;
- lstrcat(szFileFrom,pszFileName); /* buffer safe */
-
- hFile=CreateFile(szFileFrom,0,FILE_SHARE_READ,0,OPEN_EXISTING,0,0);
- if(hFile==INVALID_HANDLE_VALUE) return;
- CloseHandle(hFile);
-
- if(!GetModuleFileName(NULL,szFileTo,SIZEOF(szFileTo)-lstrlen(pszDestSubDir)-lstrlen(pszFileName)))
- return;
- p=_tcsrchr(szFileTo,_T('\\'));
- if(p!=NULL) *(++p)=0;
- lstrcat(szFileTo,pszDestSubDir); /* buffer safe */
- CreateDirectory(szFileTo,NULL);
- lstrcat(szFileTo,pszFileName); /* buffer safe */
-
- if(!MoveFile(szFileFrom,szFileTo) && GetLastError()==ERROR_ALREADY_EXISTS) {
- DeleteFile(szFileTo);
- MoveFile(szFileFrom,szFileTo);
- }
-}
-
static int ShutdownModulesLoaded(WPARAM wParam,LPARAM lParam)
{
if(ServiceExists("DBEditorpp/RegisterSingleModule"))
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp
index ac3efef3d7..f367b57ad2 100644
--- a/plugins/AutoShutdown/src/shutdownsvc.cpp
+++ b/plugins/AutoShutdown/src/shutdownsvc.cpp
@@ -554,7 +554,7 @@ void InitShutdownSvc(void)
{
/* Shutdown Dialog */
hwndShutdownDlg=NULL;
- SkinAddNewSoundBundled("AutoShutdown_Countdown",Translate("Alerts"),Translate("Automatic Shutdown Countdown"),"Sounds\\","countdown.wav");
+ SkinAddNewSoundExT("AutoShutdown_Countdown",LPGENT("Alerts"),LPGENT("Automatic Shutdown Countdown"));
/* Services */
hEventOkToShutdown=CreateHookableEvent(ME_AUTOSHUTDOWN_OKTOSHUTDOWN);
hEventShutdown=CreateHookableEvent(ME_AUTOSHUTDOWN_SHUTDOWN);
diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp
index 21f3349b6d..35dc388557 100644
--- a/plugins/AutoShutdown/src/utils.cpp
+++ b/plugins/AutoShutdown/src/utils.cpp
@@ -291,32 +291,6 @@ HANDLE IcoLib_AddIconRes(const char *pszDbName,const TCHAR *pszSection,const TCH
return Skin_AddIcon(&sid);
}
-int SkinAddNewSoundBundled(const char *pszDbName,const char *pszSection,const char *pszDesc,const char *pszSubDir,const char *pszDefaultFile)
-{
- SKINSOUNDDESCEX ssd;
- char szFile[MAX_PATH],*p;
- HANDLE hFile;
-
- ssd.cbSize=sizeof(ssd);
- ssd.pszName=pszDbName;
- ssd.pszSection=pszSection;
- ssd.pszDescription=pszDesc;
- ssd.pszDefaultFile=NULL;
- if(GetModuleFileNameA(NULL,szFile,SIZEOF(szFile)-lstrlenA(pszSubDir)-lstrlenA(pszDefaultFile))) {
- p=strrchr(szFile,'\\');
- if(p!=NULL) *(++p)=0;
- lstrcatA(lstrcatA(szFile,pszSubDir),pszDefaultFile); /* buffer safe */
- /* check if sound file exist */
- hFile=CreateFileA(szFile,0,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,NULL);
- if(hFile!=INVALID_HANDLE_VALUE) {
- ssd.pszDefaultFile=szFile; /* MS_UTILS_PATHTORELATIVET called automatically */
- CloseHandle(hFile);
- }
- }
- Skin_AddSound(&ssd);
- return 0;
-}
-
void AddHotkey()
{
HOTKEYDESC hkd = {0};
diff --git a/plugins/AutoShutdown/src/utils.h b/plugins/AutoShutdown/src/utils.h
index 189906e57a..be5a8dfd6c 100644
--- a/plugins/AutoShutdown/src/utils.h
+++ b/plugins/AutoShutdown/src/utils.h
@@ -42,5 +42,4 @@ int FontService_GetColor(const TCHAR *pszSection,const TCHAR *pszDescription,COL
/* Skin */
HANDLE IcoLib_AddIconRes(const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDesc,HINSTANCE hInst,WORD idRes,BOOL fLarge);
-int SkinAddNewSoundBundled(const char *pszDbName,const char *pszSection,const char *pszDesc,const char *pszSubDir,const char *pszDefaultFile);
void AddHotkey();