From a8abd1231246f581e3eb8a70c596de2ef408b8f2 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 21 Apr 2013 15:24:48 +0200 Subject: [PATCH] Make sounds for indicating a warning or error work Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + .../{TortoiseSVN_Error.wav => TortoiseGit_Error.wav} | Bin ...SVN_Notification.wav => TortoiseGit_Notification.wav} | Bin .../{TortoiseSVN_warning.wav => TortoiseGit_Warning.wav} | Bin src/TortoiseGitSetup/FeaturesFragment.wxi | 1 + src/TortoiseGitSetup/Includes.wxi | 2 ++ src/TortoiseGitSetup/StructureFragment.wxi | 15 ++++++++++++--- src/TortoiseProc/ProgressDlg.cpp | 2 ++ src/TortoiseProc/Settings/SetMainPage.cpp | 4 ---- src/TortoiseProc/SyncDlg.cpp | 2 ++ src/TortoiseProc/TortoiseProc.cpp | 9 ++------- src/Utils/SoundUtils.cpp | 13 +++++++------ 12 files changed, 29 insertions(+), 20 deletions(-) rename src/Resources/{TortoiseSVN_Error.wav => TortoiseGit_Error.wav} (100%) rename src/Resources/{TortoiseSVN_Notification.wav => TortoiseGit_Notification.wav} (100%) rename src/Resources/{TortoiseSVN_warning.wav => TortoiseGit_Warning.wav} (100%) diff --git a/src/Changelog.txt b/src/Changelog.txt index 0aa743a1e..1eb305c73 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -9,6 +9,7 @@ Released: unreleased * Fixed issue #1376: Daemon starting from Tortoise UI * Fixed issue #1737: Make a button to rename remote * Repository Browser: Allow to copy tree / blob hashes to clipboard + * Added sound support for indicating warnings and errors == Bug Fixes == * Fixed issue #1729: crash when commit diff --git a/src/Resources/TortoiseSVN_Error.wav b/src/Resources/TortoiseGit_Error.wav similarity index 100% rename from src/Resources/TortoiseSVN_Error.wav rename to src/Resources/TortoiseGit_Error.wav diff --git a/src/Resources/TortoiseSVN_Notification.wav b/src/Resources/TortoiseGit_Notification.wav similarity index 100% rename from src/Resources/TortoiseSVN_Notification.wav rename to src/Resources/TortoiseGit_Notification.wav diff --git a/src/Resources/TortoiseSVN_warning.wav b/src/Resources/TortoiseGit_Warning.wav similarity index 100% rename from src/Resources/TortoiseSVN_warning.wav rename to src/Resources/TortoiseGit_Warning.wav diff --git a/src/TortoiseGitSetup/FeaturesFragment.wxi b/src/TortoiseGitSetup/FeaturesFragment.wxi index f1d19e3a0..006cc7e5a 100644 --- a/src/TortoiseGitSetup/FeaturesFragment.wxi +++ b/src/TortoiseGitSetup/FeaturesFragment.wxi @@ -35,6 +35,7 @@ + diff --git a/src/TortoiseGitSetup/Includes.wxi b/src/TortoiseGitSetup/Includes.wxi index 5227e129d..844a314ea 100644 --- a/src/TortoiseGitSetup/Includes.wxi +++ b/src/TortoiseGitSetup/Includes.wxi @@ -87,6 +87,7 @@ + @@ -154,6 +155,7 @@ + diff --git a/src/TortoiseGitSetup/StructureFragment.wxi b/src/TortoiseGitSetup/StructureFragment.wxi index 07d25cf5a..da8234760 100644 --- a/src/TortoiseGitSetup/StructureFragment.wxi +++ b/src/TortoiseGitSetup/StructureFragment.wxi @@ -683,9 +683,18 @@ - - - + + + + + + + + + + + + diff --git a/src/TortoiseProc/ProgressDlg.cpp b/src/TortoiseProc/ProgressDlg.cpp index 4ff18d258..e1de8c6ba 100644 --- a/src/TortoiseProc/ProgressDlg.cpp +++ b/src/TortoiseProc/ProgressDlg.cpp @@ -32,6 +32,7 @@ #include "SmartHandle.h" #include "../TGitCache/CacheInterface.h" #include "LoglistUtils.h" +#include "SoundUtils.h" // CProgressDlg dialog @@ -329,6 +330,7 @@ LRESULT CProgressDlg::OnProgressUpdateUI(WPARAM wParam,LPARAM lParam) CString err; err.Format(_T("\r\n\r\n%s (%d ms @ %s)\r\n"), log, tickSpent, strEndTime); InsertColorText(this->m_Log, err, RGB(255,0,0)); + CSoundUtils::PlayTGitError(); } else { if (m_pTaskbarList) diff --git a/src/TortoiseProc/Settings/SetMainPage.cpp b/src/TortoiseProc/Settings/SetMainPage.cpp index 663279afb..3b0fd9aa1 100644 --- a/src/TortoiseProc/Settings/SetMainPage.cpp +++ b/src/TortoiseProc/Settings/SetMainPage.cpp @@ -88,10 +88,6 @@ BOOL CSetMainPage::OnInitDialog() { ISettingsPropPage::OnInitDialog(); - // disable features that have not yet been implemented - GetDlgItem(IDC_SOUNDS)->EnableWindow( FALSE ); - GetDlgItem(IDC_SOUNDS_TEXT)->EnableWindow( FALSE ); - EnableToolTips(); diff --git a/src/TortoiseProc/SyncDlg.cpp b/src/TortoiseProc/SyncDlg.cpp index 1574e5af1..643171a3f 100644 --- a/src/TortoiseProc/SyncDlg.cpp +++ b/src/TortoiseProc/SyncDlg.cpp @@ -30,6 +30,7 @@ #include "RebaseDlg.h" #include "hooks.h" #include "SmartHandle.h" +#include "SoundUtils.h" // CSyncDlg dialog @@ -1167,6 +1168,7 @@ LRESULT CSyncDlg::OnProgressUpdateUI(WPARAM wParam,LPARAM lParam) CString err; err.Format(_T("\r\n\r\n%s (%d ms @ %s)\r\n"), log, tickSpent, strEndTime); CProgressDlg::InsertColorText(this->m_ctrlCmdOut, err, RGB(255,0,0)); + CSoundUtils::PlayTGitError(); } else { diff --git a/src/TortoiseProc/TortoiseProc.cpp b/src/TortoiseProc/TortoiseProc.cpp index 0f805e3f7..82d1c1be7 100644 --- a/src/TortoiseProc/TortoiseProc.cpp +++ b/src/TortoiseProc/TortoiseProc.cpp @@ -43,6 +43,7 @@ #include "Libraries.h" #include "TaskbarUUID.h" #include "GitConfig.h" +#include "SoundUtils.h" #define STRUCT_IOVEC_DEFINED @@ -548,15 +549,9 @@ void CTortoiseProcApp::CheckUpgrade() } } -#if 0 - if (lVersion <= 0x01010300) - { - CSoundUtils::RegisterTSVNSounds(); - } -#endif - if (lVersion <= 0x01080202) { + CSoundUtils::RegisterTGitSounds(); // upgrade to 1.8.3: force recreation of all diff scripts. CAppUtils::SetupDiffScripts(true, CString()); } diff --git a/src/Utils/SoundUtils.cpp b/src/Utils/SoundUtils.cpp index c61942d57..e9310fd76 100644 --- a/src/Utils/SoundUtils.cpp +++ b/src/Utils/SoundUtils.cpp @@ -1,6 +1,7 @@ // TortoiseGit - a Windows shell extension for easy version control -// Copyright (C) 2003-2006 - Stefan Kueng +// Copyright (C) 2009,2013 - TortoiseGit +// Copyright (C) 2003-2006 - TortoiseSVN // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -21,7 +22,7 @@ #include "..\TortoiseProc\resource.h" #include "..\TortoiseProc\AppUtils.h" #include "PathUtils.h" -#include ".\soundutils.h" +#include "SoundUtils.h" #include "mmsystem.h" #pragma comment(lib, "Winmm") @@ -44,7 +45,7 @@ void CSoundUtils::RegisterTGitSounds() CRegString eventlabelnote = CRegString(_T("AppEvents\\EventLabels\\TGit_Notification\\")); eventlabelnote = CString(MAKEINTRESOURCE(IDS_WARN_NOTE)); - CRegString appscheme = CRegString(_T("AppEvents\\Schemes\\Apps\\TortoiseProc\\")); + CRegString appscheme = CRegString(_T("AppEvents\\Schemes\\Apps\\TortoiseGitProc\\")); appscheme = _T("TortoiseGit"); CString apppath = CPathUtils::GetAppDirectory(); @@ -62,19 +63,19 @@ void CSoundUtils::RegisterTGitSounds() CString name = schemenames.GetNext(pos); if ((name.CompareNoCase(_T(".none"))!=0)&&(name.CompareNoCase(_T(".nosound"))!=0)) { - CString errorkey = _T("AppEvents\\Schemes\\Apps\\TortoiseProc\\TGit_Error\\") + name + _T("\\"); + CString errorkey = _T("AppEvents\\Schemes\\Apps\\TortoiseGitProc\\TGit_Error\\") + name + _T("\\"); CRegString errorkeyval = CRegString(errorkey); if (((CString)(errorkeyval)).IsEmpty()) { errorkeyval = apppath + _T("TortoiseGit_Error.wav"); } - CString warnkey = _T("AppEvents\\Schemes\\Apps\\TortoiseProc\\TGit_Warning\\") + name + _T("\\"); + CString warnkey = _T("AppEvents\\Schemes\\Apps\\TortoiseGitProc\\TGit_Warning\\") + name + _T("\\"); CRegString warnkeyval = CRegString(warnkey); if (((CString)(warnkeyval)).IsEmpty()) { warnkeyval = apppath + _T("TortoiseGit_Warning.wav"); } - CString notificationkey = _T("AppEvents\\Schemes\\Apps\\TortoiseProc\\TGit_Notification\\") + name + _T("\\"); + CString notificationkey = _T("AppEvents\\Schemes\\Apps\\TortoiseGitProc\\TGit_Notification\\") + name + _T("\\"); CRegString notificationkeyval = CRegString(notificationkey); if (((CString)(notificationkeyval)).IsEmpty()) { -- 2.11.4.GIT