Add an option to mute all sounds in preferences dialog

Fix #7950, close #9507
pull/9543/head
mere-human 4 years ago committed by Don HO
parent ea33a0cb76
commit 6e43ba6ea5
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

@ -251,7 +251,7 @@ CXX = $(CROSS_COMPILE)g++
CXXFLAGS = $(INCLUDESPECIAL) -DTIXML_USE_STL -DTIXMLA_USE_STL $(UNICODE) -std=c++17 -fpermissive
INCLUDES = $(patsubst %,-I%,$(DIRS)) -I./include
LDFLAGS = -Wl,--subsystem,windows -municode -mwindows
LIBS = -lcomdlg32 -lcomctl32 -lgdi32 -lole32 -loleacc -lshell32 -lshlwapi -ldbghelp -lversion -lcrypt32 -lsensapi -lwininet -lwintrust -lwinmm -luuid
LIBS = -lcomdlg32 -lcomctl32 -lgdi32 -lole32 -loleacc -lshell32 -lshlwapi -ldbghelp -lversion -lcrypt32 -lsensapi -lwininet -lwintrust -luuid
RC = $(CROSS_COMPILE)windres

@ -1052,6 +1052,7 @@ You can define several column markers by using white space to separate the diffe
<Item id="6344" name="Document Peeker"/>
<Item id="6345" name="Peek on tab"/>
<Item id="6346" name="Peek on document map"/>
<Item id="6360" name="Mute all sounds"/>
</MISC>
</Preference>
<MultiMacro title="Run a Macro Multiple Times">

@ -5280,6 +5280,10 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
const TCHAR* saveDlgExtFilterToAllTypes = element->Attribute(TEXT("saveDlgExtFilterToAllTypes"));
if (saveDlgExtFilterToAllTypes)
_nppGUI._setSaveDlgExtFiltToAllTypes = (lstrcmp(saveDlgExtFilterToAllTypes, TEXT("yes")) == 0);
const TCHAR * optMuteSounds = element->Attribute(TEXT("muteSounds"));
if (optMuteSounds)
_nppGUI._muteSounds = lstrcmp(optMuteSounds, TEXT("yes")) == 0;
}
else if (!lstrcmp(nm, TEXT("commandLineInterpreter")))
{
@ -6213,6 +6217,7 @@ void NppParameters::createXmlTreeFromGUIParams()
GUIConfigElement->SetAttribute(TEXT("docPeekOnTab"), _nppGUI._isDocPeekOnTab ? TEXT("yes") : TEXT("no"));
GUIConfigElement->SetAttribute(TEXT("docPeekOnMap"), _nppGUI._isDocPeekOnMap ? TEXT("yes") : TEXT("no"));
GUIConfigElement->SetAttribute(TEXT("saveDlgExtFilterToAllTypes"), _nppGUI._setSaveDlgExtFiltToAllTypes ? TEXT("yes") : TEXT("no"));
GUIConfigElement->SetAttribute(TEXT("muteSounds"), _nppGUI._muteSounds ? TEXT("yes") : TEXT("no"));
}
// <GUIConfig name="Searching" "monospacedFontFindDlg"="no" stopFillingFindField="no" findDlgAlwaysVisible="no" confirmReplaceOpenDocs="yes" confirmMacroReplaceOpenDocs="yes" confirmReplaceInFiles="yes" confirmMacroReplaceInFiles="yes" />

@ -838,6 +838,7 @@ struct NppGUI final
bool _monospacedFontFindDlg = false;
bool _findDlgAlwaysVisible = false;
bool _confirmReplaceInAllOpenDocs = true;
bool _muteSounds = false;
writeTechnologyEngine _writeTechnologyEngine = defaultTechnology;
bool _isWordCharDefault = true;
std::string _customWordChars;

@ -2805,7 +2805,8 @@ void FindReplaceDlg::setStatusbarMessage(const generic_string & msg, FindStatus
{
if (staus == FSNotFound)
{
::PlaySound((LPCTSTR)SND_ALIAS_SYSTEMASTERISK, NULL, SND_ALIAS_ID | SND_ASYNC);
if (!NppParameters::getInstance().getNppGUI()._muteSounds)
::MessageBeep(0xFFFFFFFF);
FLASHWINFO flashInfo;
flashInfo.cbSize = sizeof(FLASHWINFO);

@ -1192,6 +1192,7 @@ void DisplayEditString(HWND hWnd,int SI, const TCHAR* tstring)
}
else
{
if (!NppParameters::getInstance().getNppGUI()._muteSounds)
MessageBeep(0);
}
@ -1400,6 +1401,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
GetClientRect(hWnd, &rect);
InvalidateRect(hWnd,&rect,TRUE);
UpdateWindow(hWnd);
if (!NppParameters::getInstance().getNppGUI()._muteSounds)
MessageBeep(0);
}
break;
@ -1670,6 +1672,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if(FindResult==LB_ERR)
{
if (!NppParameters::getInstance().getNppGUI()._muteSounds)
MessageBeep(0);
}
{

@ -416,7 +416,8 @@ BEGIN
CONTROL "Peek on document map",IDC_CHECK_ENABLEDOCPEEKONMAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,269,71,140,10
// "Enable Notepad++ auto-updater" should be always the 1st item, because it'll be hidden if GUP.exe is absent
CONTROL "Enable Notepad++ auto-updater",IDC_CHECK_AUTOUPDATE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,37,94,217,10
CONTROL "Mute all sounds", IDC_CHECK_MUTE_SOUNDS, "Button", BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP, 37, 94, 217, 10
CONTROL "Enable Notepad++ auto-updater",IDC_CHECK_AUTOUPDATE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP, 37, 78, 210, 10
CONTROL "Set Save dialog file extension filter to *.*",IDC_CHECK_SAVEDLGEXTFILTALLTYPES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,109,267,10
CONTROL "Autodetect character encoding",IDC_CHECK_DETECTENCODING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,124,217,10
CONTROL "Minimize to system tray",IDC_CHECK_MIN2SYSTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,139,217,10

@ -981,6 +981,7 @@ INT_PTR CALLBACK MiscSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
::SendDlgItemMessage(_hSelf, IDC_CHECK_DIRECTWRITE_ENABLE, BM_SETCHECK, nppGUI._writeTechnologyEngine == directWriteTechnology, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_ENABLEDOCPEEKER, BM_SETCHECK, nppGUI._isDocPeekOnTab ? BST_CHECKED : BST_UNCHECKED, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_ENABLEDOCPEEKONMAP, BM_SETCHECK, nppGUI._isDocPeekOnMap ? BST_CHECKED : BST_UNCHECKED, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_MUTE_SOUNDS, BM_SETCHECK, nppGUI._muteSounds ? BST_CHECKED : BST_UNCHECKED, 0);
::ShowWindow(::GetDlgItem(_hSelf, IDC_CHECK_AUTOUPDATE), nppGUI._doesExistUpdater?SW_SHOW:SW_HIDE);
@ -1113,6 +1114,12 @@ INT_PTR CALLBACK MiscSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
return TRUE;
}
case IDC_CHECK_MUTE_SOUNDS:
{
nppGUI._muteSounds = isCheckedOrNot(IDC_CHECK_MUTE_SOUNDS);
return TRUE;
}
default:
{
if (HIWORD(wParam) == CBN_SELCHANGE)

@ -206,6 +206,7 @@
#define IDC_COMBO_FILEUPDATECHOICE (IDD_PREFERENCE_SUB_MISC + 47)
#define IDC_CHECK_DIRECTWRITE_ENABLE (IDD_PREFERENCE_SUB_MISC + 49)
#define IDC_CHECK_CLICKABLELINK_FULLBOXMODE (IDD_PREFERENCE_SUB_MISC + 50)
#define IDC_CHECK_MUTE_SOUNDS (IDD_PREFERENCE_SUB_MISC + 60)
#define IDD_PREFERENCE_SUB_NEWDOCUMENT 6400 //(IDD_PREFERENCE_BOX + 400)
#define IDC_FORMAT_GB_STATIC (IDD_PREFERENCE_SUB_NEWDOCUMENT + 1)

@ -111,7 +111,7 @@
</ClCompile>
<Link>
<AdditionalOptions>/fixed:no %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;Dbghelp.lib;Version.lib;Crypt32.lib;wintrust.lib;Sensapi.lib;winmm.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;Dbghelp.lib;Version.lib;Crypt32.lib;wintrust.lib;Sensapi.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>LinkVerboseLib</ShowProgress>
<OutputFile>$(OutDir)notepad++.exe</OutputFile>
<Version>1.0</Version>
@ -150,7 +150,7 @@
</ClCompile>
<Link>
<AdditionalOptions>/fixed:no %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;Dbghelp.lib;Version.lib;Crypt32.lib;wintrust.lib;Sensapi.lib;winmm.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;Dbghelp.lib;Version.lib;Crypt32.lib;wintrust.lib;Sensapi.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>LinkVerboseLib</ShowProgress>
<OutputFile>$(OutDir)notepad++.exe</OutputFile>
<Version>1.0</Version>
@ -194,7 +194,7 @@
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;Dbghelp.lib;Version.lib;Crypt32.lib;wintrust.lib;Sensapi.lib;winmm.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;Dbghelp.lib;Version.lib;Crypt32.lib;wintrust.lib;Sensapi.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>LinkVerboseLib</ShowProgress>
<OutputFile>$(OutDir)notepad++.exe</OutputFile>
<Version>1.0</Version>
@ -246,7 +246,7 @@ copy ..\src\contextMenu.xml ..\bin\contextMenu.xml
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;Dbghelp.lib;Version.lib;Crypt32.lib;wintrust.lib;Sensapi.lib;winmm.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;Dbghelp.lib;Version.lib;Crypt32.lib;wintrust.lib;Sensapi.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>LinkVerboseLib</ShowProgress>
<OutputFile>$(OutDir)notepad++.exe</OutputFile>
<Version>1.0</Version>

Loading…
Cancel
Save