Make sounds for indicating a warning or error work
authorSven Strickroth <email@cs-ware.de>
Sun, 21 Apr 2013 13:24:48 +0000 (21 15:24 +0200)
committerSven Strickroth <email@cs-ware.de>
Sun, 21 Apr 2013 13:35:13 +0000 (21 15:35 +0200)
Signed-off-by: Sven Strickroth <email@cs-ware.de>
12 files changed:
src/Changelog.txt
src/Resources/TortoiseGit_Error.wav [moved from src/Resources/TortoiseSVN_Error.wav with 100% similarity]
src/Resources/TortoiseGit_Notification.wav [moved from src/Resources/TortoiseSVN_Notification.wav with 100% similarity]
src/Resources/TortoiseGit_Warning.wav [moved from src/Resources/TortoiseSVN_warning.wav with 100% similarity]
src/TortoiseGitSetup/FeaturesFragment.wxi
src/TortoiseGitSetup/Includes.wxi
src/TortoiseGitSetup/StructureFragment.wxi
src/TortoiseProc/ProgressDlg.cpp
src/TortoiseProc/Settings/SetMainPage.cpp
src/TortoiseProc/SyncDlg.cpp
src/TortoiseProc/TortoiseProc.cpp
src/Utils/SoundUtils.cpp

index 0aa743a..1eb305c 100644 (file)
@@ -9,6 +9,7 @@ Released: unreleased
  * Fixed issue #1376: Daemon starting from Tortoise UI\r
  * Fixed issue #1737: Make a button to rename remote\r
  * Repository Browser: Allow to copy tree / blob hashes to clipboard\r
+ * Added sound support for indicating warnings and errors\r
 \r
 == Bug Fixes ==\r
  * Fixed issue #1729: crash when commit\r
index f1d19e3..006cc7e 100644 (file)
@@ -35,6 +35,7 @@
 \r
                <ComponentRef Id="C__ProgramMenuFolder" />\r
                <ComponentRef Id="C__Sounds" />\r
+               <ComponentRef Id="C__SoundsRegistry" />\r
                <ComponentRef Id="C__DiffScripts" />\r
                <ComponentRef Id="C__touch" />\r
 \r
index 5227e12..844a314 100644 (file)
@@ -87,6 +87,7 @@
        <?define GuidTortoiseMergeShortcuts="659A37E6-CE9A-4a30-AFF5-6FA1A077AA33"?>\r
        <?define GuidTortoiseGitBlameShortcuts="FEE5C1A9-0319-4ea8-A5C7-AD470F52481A"?>\r
        <?define GuidSounds="504B02AA-9C6E-4639-99BC-8F5A885BACBD"?>\r
+       <?define GuidSoundsReg="3837AB83-3904-404B-B7DB-81C86471ECB9"?>\r
        <?define GuidTortoiseBlame="4B84CF65-1FE5-4736-B880-F04490D150C5"?>\r
        <?define GuidTortoiseIDiff="75D19614-B4D4-4661-A7EB-683CEE849CF3"?>\r
        <?define GuidTortoiseIDiffShortcuts="7312EFB9-4775-4b9c-8FE8-4E9F8C1D5586"?>\r
        <?define GuidTortoiseMergeShortcuts="C22CF21D-57F0-471b-80AE-E8C101AA27CA"?>\r
        <?define GuidTortoiseGitBlameShortcuts="8184046F-7E9C-4f26-9B74-8ADC7DDF9882"?>\r
        <?define GuidSounds="0DD7EE86-517F-49a1-AA47-69EA7F171050"?>\r
+       <?define GuidSoundsReg="E40A86F1-19DF-4B12-9AF5-C98471779278"?>\r
        <?define GuidTortoiseBlame="6C0D7DE5-7CDA-4fa2-9939-0AA274C929A7"?>\r
        <?define GuidTortoiseIDiff="742E7CF3-0255-4100-B241-E753BF92F9F0"?>\r
        <?define GuidTortoiseIDiffShortcuts="85832CAF-32F7-48ef-8E18-A4271C1DB5ED"?>\r
index 07d25cf..da82347 100644 (file)
                                        </Component>\r
 \r
                                        <Component Id="C__Sounds" Guid="$(var.GuidSounds)" Win64="$(var.Win64YesNo)">\r
-                                               <File Id="F__sounderror" ShortName="TERROR.WAV" Name="TortoiseSVN_error.wav" DiskId="1" Source="..\Resources\TortoiseSVN_error.wav" KeyPath="yes" />\r
-                                               <File Id="F__soundwarning" ShortName="TWARN.WAV" Name="TortoiseSVN_Warning.wav" DiskId="1" Source="..\Resources\TortoiseSVN_Warning.wav" />\r
-                                               <File Id="F__soundnotification" ShortName="TNOTIFY.WAV" Name="TortoiseSVN_Notification.wav" DiskId="1" Source="..\Resources\TortoiseSVN_Notification.wav" />\r
+                                               <File Id="F__sounderror" ShortName="TERROR.WAV" Name="TortoiseGit_Error.wav" DiskId="1" Source="..\Resources\TortoiseGit_Error.wav" KeyPath="yes" />\r
+                                               <File Id="F__soundwarning" ShortName="TWARN.WAV" Name="TortoiseGit_Warning.wav" DiskId="1" Source="..\Resources\TortoiseGit_Warning.wav" />\r
+                                               <File Id="F__soundnotification" ShortName="TNOTIFY.WAV" Name="TortoiseGit_Notification.wav" DiskId="1" Source="..\Resources\TortoiseGit_Notification.wav" />\r
+                                       </Component>\r
+\r
+                                       <Component Id="C__SoundsRegistry" Guid="$(var.GuidSoundsReg)" Win64="$(var.Win64YesNo)">\r
+                                               <!-- only used because this component needs a key path! -->\r
+                                               <RegistryValue Root="HKCU" Key="Software\TortoiseGit" KeyPath="yes" Name="SoundUtils KeyPath" Value="keypath" Type="string" />\r
+                                               <RemoveRegistryKey Action="removeOnUninstall" Root="HKCU" Key="AppEvents\EventLabels\TGit_Error" />\r
+                                               <RemoveRegistryKey Action="removeOnUninstall" Root="HKCU" Key="AppEvents\EventLabels\TGit_Warning" />\r
+                                               <RemoveRegistryKey Action="removeOnUninstall" Root="HKCU" Key="AppEvents\EventLabels\TGit_Notification" />\r
+                                               <RemoveRegistryKey Action="removeOnUninstall" Root="HKCU" Key="AppEvents\Schemes\Apps\TortoiseGitProc" />\r
                                        </Component>\r
 \r
                                        <Component Id="C__TortoiseBlame" Guid="$(var.GuidTortoiseBlame)" Win64="$(var.Win64YesNo)">\r
index 4ff18d2..e1de8c6 100644 (file)
@@ -32,6 +32,7 @@
 #include "SmartHandle.h"\r
 #include "../TGitCache/CacheInterface.h"\r
 #include "LoglistUtils.h"\r
+#include "SoundUtils.h"\r
 \r
 // CProgressDlg dialog\r
 \r
@@ -329,6 +330,7 @@ LRESULT CProgressDlg::OnProgressUpdateUI(WPARAM wParam,LPARAM lParam)
                        CString err;\r
                        err.Format(_T("\r\n\r\n%s (%d ms @ %s)\r\n"), log, tickSpent, strEndTime);\r
                        InsertColorText(this->m_Log, err, RGB(255,0,0));\r
+                       CSoundUtils::PlayTGitError();\r
                }\r
                else {\r
                        if (m_pTaskbarList)\r
index 663279a..3b0fd9a 100644 (file)
@@ -88,10 +88,6 @@ BOOL CSetMainPage::OnInitDialog()
 {\r
        ISettingsPropPage::OnInitDialog();\r
 \r
-       // disable features that have not yet been implemented\r
-       GetDlgItem(IDC_SOUNDS)->EnableWindow( FALSE );\r
-       GetDlgItem(IDC_SOUNDS_TEXT)->EnableWindow( FALSE );\r
-\r
        EnableToolTips();\r
 \r
 \r
index 1574e5a..643171a 100644 (file)
@@ -30,6 +30,7 @@
 #include "RebaseDlg.h"\r
 #include "hooks.h"\r
 #include "SmartHandle.h"\r
+#include "SoundUtils.h"\r
 \r
 // CSyncDlg dialog\r
 \r
@@ -1167,6 +1168,7 @@ LRESULT CSyncDlg::OnProgressUpdateUI(WPARAM wParam,LPARAM lParam)
                        CString err;\r
                        err.Format(_T("\r\n\r\n%s (%d ms @ %s)\r\n"), log, tickSpent, strEndTime);\r
                        CProgressDlg::InsertColorText(this->m_ctrlCmdOut, err, RGB(255,0,0));\r
+                       CSoundUtils::PlayTGitError();\r
                }\r
                else\r
                {\r
index 0f805e3..82d1c1b 100644 (file)
@@ -43,6 +43,7 @@
 #include "Libraries.h"\r
 #include "TaskbarUUID.h"\r
 #include "GitConfig.h"\r
+#include "SoundUtils.h"\r
 \r
 #define STRUCT_IOVEC_DEFINED\r
 \r
@@ -548,15 +549,9 @@ void CTortoiseProcApp::CheckUpgrade()
                }\r
        }\r
 \r
-#if 0\r
-       if (lVersion <= 0x01010300)\r
-       {\r
-               CSoundUtils::RegisterTSVNSounds();\r
-       }\r
-#endif\r
-\r
        if (lVersion <= 0x01080202)\r
        {\r
+               CSoundUtils::RegisterTGitSounds();\r
                // upgrade to 1.8.3: force recreation of all diff scripts.\r
                CAppUtils::SetupDiffScripts(true, CString());\r
        }\r
index c61942d..e9310fd 100644 (file)
@@ -1,6 +1,7 @@
 // TortoiseGit - a Windows shell extension for easy version control\r
 \r
-// Copyright (C) 2003-2006 - Stefan Kueng\r
+// Copyright (C) 2009,2013 - TortoiseGit\r
+// Copyright (C) 2003-2006 - TortoiseSVN\r
 \r
 // This program is free software; you can redistribute it and/or\r
 // modify it under the terms of the GNU General Public License\r
@@ -21,7 +22,7 @@
 #include "..\TortoiseProc\resource.h"\r
 #include "..\TortoiseProc\AppUtils.h"\r
 #include "PathUtils.h"\r
-#include ".\soundutils.h"\r
+#include "SoundUtils.h"\r
 #include "mmsystem.h"\r
 \r
 #pragma comment(lib, "Winmm")\r
@@ -44,7 +45,7 @@ void CSoundUtils::RegisterTGitSounds()
        CRegString eventlabelnote = CRegString(_T("AppEvents\\EventLabels\\TGit_Notification\\"));\r
        eventlabelnote = CString(MAKEINTRESOURCE(IDS_WARN_NOTE));\r
 \r
-       CRegString appscheme = CRegString(_T("AppEvents\\Schemes\\Apps\\TortoiseProc\\"));\r
+       CRegString appscheme = CRegString(_T("AppEvents\\Schemes\\Apps\\TortoiseGitProc\\"));\r
        appscheme = _T("TortoiseGit");\r
 \r
        CString apppath = CPathUtils::GetAppDirectory();\r
@@ -62,19 +63,19 @@ void CSoundUtils::RegisterTGitSounds()
                CString name = schemenames.GetNext(pos);\r
                if ((name.CompareNoCase(_T(".none"))!=0)&&(name.CompareNoCase(_T(".nosound"))!=0))\r
                {\r
-                       CString errorkey = _T("AppEvents\\Schemes\\Apps\\TortoiseProc\\TGit_Error\\") + name + _T("\\");\r
+                       CString errorkey = _T("AppEvents\\Schemes\\Apps\\TortoiseGitProc\\TGit_Error\\") + name + _T("\\");\r
                        CRegString errorkeyval = CRegString(errorkey);\r
                        if (((CString)(errorkeyval)).IsEmpty())\r
                        {\r
                                errorkeyval = apppath + _T("TortoiseGit_Error.wav");\r
                        }\r
-                       CString warnkey = _T("AppEvents\\Schemes\\Apps\\TortoiseProc\\TGit_Warning\\") + name + _T("\\");\r
+                       CString warnkey = _T("AppEvents\\Schemes\\Apps\\TortoiseGitProc\\TGit_Warning\\") + name + _T("\\");\r
                        CRegString warnkeyval = CRegString(warnkey);\r
                        if (((CString)(warnkeyval)).IsEmpty())\r
                        {\r
                                warnkeyval = apppath + _T("TortoiseGit_Warning.wav");\r
                        }\r
-                       CString notificationkey = _T("AppEvents\\Schemes\\Apps\\TortoiseProc\\TGit_Notification\\") + name + _T("\\");\r
+                       CString notificationkey = _T("AppEvents\\Schemes\\Apps\\TortoiseGitProc\\TGit_Notification\\") + name + _T("\\");\r
                        CRegString notificationkeyval = CRegString(notificationkey);\r
                        if (((CString)(notificationkeyval)).IsEmpty())\r
                        {\r