Improve option for setting save dialog filter to All Types

Fix #9325, close #9328
pull/9387/head
Scott Sumner 4 years ago committed by Don HO
parent b9f498f041
commit d5ad02521e
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

@ -1042,7 +1042,7 @@ You can define several column markers by using white space to separate the diffe
<Item id="6325" name="Scroll to the last line after update"/> <Item id="6325" name="Scroll to the last line after update"/>
<Item id="6322" name="Session file ext.:"/> <Item id="6322" name="Session file ext.:"/>
<Item id="6323" name="Enable Notepad++ auto-updater"/> <Item id="6323" name="Enable Notepad++ auto-updater"/>
<Item id="6351" name="Set Save dialog file extension filter to .* instead of .txt for Normal Text"/> <Item id="6351" name="Set Save dialog file extension filter to *.*"/>
<Item id="6324" name="Document Switcher (Ctrl+TAB)"/> <Item id="6324" name="Document Switcher (Ctrl+TAB)"/>
<Item id="6331" name="Show only filename in title bar"/> <Item id="6331" name="Show only filename in title bar"/>
<Item id="6334" name="Autodetect character encoding"/> <Item id="6334" name="Autodetect character encoding"/>

@ -1646,8 +1646,7 @@ bool Notepad_plus::fileSaveAs(BufferID id, bool isSaveCopy)
LangType langType = buf->getLangType(); LangType langType = buf->getLangType();
int langTypeIndex = 0; int langTypeIndex = 0;
if (!((NppParameters::getInstance()).getNppGUI()._setSaveDlgExtFiltToAllTypesForNormText && if (!((NppParameters::getInstance()).getNppGUI()._setSaveDlgExtFiltToAllTypes))
buf->isUntitled() && langType == L_TEXT))
{ {
langTypeIndex = setFileOpenSaveDlgFilters(fDlg, false, langType); langTypeIndex = setFileOpenSaveDlgFilters(fDlg, false, langType);
} }

@ -5305,9 +5305,9 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
if (optDocPeekOnMap) if (optDocPeekOnMap)
_nppGUI._isDocPeekOnMap = (lstrcmp(optDocPeekOnMap, TEXT("yes")) == 0); _nppGUI._isDocPeekOnMap = (lstrcmp(optDocPeekOnMap, TEXT("yes")) == 0);
const TCHAR* saveDlgExtFilterToAllTypesForNormText = element->Attribute(TEXT("saveDlgExtFilterToAllTypesForNormalText")); const TCHAR* saveDlgExtFilterToAllTypes = element->Attribute(TEXT("saveDlgExtFilterToAllTypes"));
if (saveDlgExtFilterToAllTypesForNormText) if (saveDlgExtFilterToAllTypes)
_nppGUI._setSaveDlgExtFiltToAllTypesForNormText = (lstrcmp(saveDlgExtFilterToAllTypesForNormText, TEXT("yes")) == 0); _nppGUI._setSaveDlgExtFiltToAllTypes = (lstrcmp(saveDlgExtFilterToAllTypes, TEXT("yes")) == 0);
} }
else if (!lstrcmp(nm, TEXT("commandLineInterpreter"))) else if (!lstrcmp(nm, TEXT("commandLineInterpreter")))
{ {
@ -6229,7 +6229,7 @@ void NppParameters::createXmlTreeFromGUIParams()
GUIConfigElement->SetAttribute(TEXT("setting"), _nppGUI._multiInstSetting); GUIConfigElement->SetAttribute(TEXT("setting"), _nppGUI._multiInstSetting);
} }
// <GUIConfig name="MISC" fileSwitcherWithoutExtColumn="no" backSlashIsEscapeCharacterForSql="yes" newStyleSaveDlg="no" isFolderDroppedOpenFiles="no" saveDlgExtFilterToAllTypesForNormalText="no" /> // <GUIConfig name="MISC" fileSwitcherWithoutExtColumn="no" backSlashIsEscapeCharacterForSql="yes" newStyleSaveDlg="no" isFolderDroppedOpenFiles="no" saveDlgExtFilterToAllTypes="no" />
{ {
TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement();
GUIConfigElement->SetAttribute(TEXT("name"), TEXT("MISC")); GUIConfigElement->SetAttribute(TEXT("name"), TEXT("MISC"));
@ -6241,7 +6241,7 @@ void NppParameters::createXmlTreeFromGUIParams()
GUIConfigElement->SetAttribute(TEXT("isFolderDroppedOpenFiles"), _nppGUI._isFolderDroppedOpenFiles ? TEXT("yes") : TEXT("no")); GUIConfigElement->SetAttribute(TEXT("isFolderDroppedOpenFiles"), _nppGUI._isFolderDroppedOpenFiles ? TEXT("yes") : TEXT("no"));
GUIConfigElement->SetAttribute(TEXT("docPeekOnTab"), _nppGUI._isDocPeekOnTab ? TEXT("yes") : TEXT("no")); GUIConfigElement->SetAttribute(TEXT("docPeekOnTab"), _nppGUI._isDocPeekOnTab ? TEXT("yes") : TEXT("no"));
GUIConfigElement->SetAttribute(TEXT("docPeekOnMap"), _nppGUI._isDocPeekOnMap ? TEXT("yes") : TEXT("no")); GUIConfigElement->SetAttribute(TEXT("docPeekOnMap"), _nppGUI._isDocPeekOnMap ? TEXT("yes") : TEXT("no"));
GUIConfigElement->SetAttribute(TEXT("saveDlgExtFilterToAllTypesForNormalText"), _nppGUI._setSaveDlgExtFiltToAllTypesForNormText ? TEXT("yes") : TEXT("no")); GUIConfigElement->SetAttribute(TEXT("saveDlgExtFilterToAllTypes"), _nppGUI._setSaveDlgExtFiltToAllTypes ? TEXT("yes") : TEXT("no"));
} }
// <GUIConfig name="Searching" "monospacedFontFindDlg"="no" stopFillingFindField="no" findDlgAlwaysVisible="no" confirmReplaceOpenDocs="yes" confirmMacroReplaceOpenDocs="yes" confirmReplaceInFiles="yes" confirmMacroReplaceInFiles="yes" /> // <GUIConfig name="Searching" "monospacedFontFindDlg"="no" stopFillingFindField="no" findDlgAlwaysVisible="no" confirmReplaceOpenDocs="yes" confirmMacroReplaceOpenDocs="yes" confirmReplaceInFiles="yes" confirmMacroReplaceInFiles="yes" />

@ -826,7 +826,7 @@ struct NppGUI final
bool _rememberLastSession = true; // remember next session boolean will be written in the settings bool _rememberLastSession = true; // remember next session boolean will be written in the settings
bool _isCmdlineNosessionActivated = false; // used for if -nosession is indicated on the launch time bool _isCmdlineNosessionActivated = false; // used for if -nosession is indicated on the launch time
bool _detectEncoding = true; bool _detectEncoding = true;
bool _setSaveDlgExtFiltToAllTypesForNormText = false; bool _setSaveDlgExtFiltToAllTypes = false;
bool _doTaskList = true; bool _doTaskList = true;
bool _maitainIndent = true; bool _maitainIndent = true;
bool _enableSmartHilite = true; bool _enableSmartHilite = true;

@ -429,7 +429,7 @@ BEGIN
// "Enable Notepad++ auto-updater" should be always the 1st item, because it'll be hidden if GUP.exe is absent // "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 "Enable Notepad++ auto-updater",IDC_CHECK_AUTOUPDATE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,37,94,217,10
CONTROL "Set Save dialog file extension filter to .* instead of .txt for Normal Text",IDC_CHECK_SAVEDLGEXTFILTALLTYPESFORNORMTEXT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,109,267,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 "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 CONTROL "Minimize to system tray",IDC_CHECK_MIN2SYSTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,139,217,10
CONTROL "Show only filename in title bar",IDC_CHECK_SHORTTITLE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,37,154,217,10 CONTROL "Show only filename in title bar",IDC_CHECK_SHORTTITLE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,37,154,217,10

@ -988,7 +988,7 @@ INT_PTR CALLBACK MiscSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
::SendDlgItemMessage(_hSelf, IDC_CHECK_MIN2SYSTRAY, BM_SETCHECK, nppGUI._isMinimizedToTray, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_MIN2SYSTRAY, BM_SETCHECK, nppGUI._isMinimizedToTray, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_DETECTENCODING, BM_SETCHECK, nppGUI._detectEncoding, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_DETECTENCODING, BM_SETCHECK, nppGUI._detectEncoding, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_AUTOUPDATE, BM_SETCHECK, nppGUI._autoUpdateOpt._doAutoUpdate, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_AUTOUPDATE, BM_SETCHECK, nppGUI._autoUpdateOpt._doAutoUpdate, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_SAVEDLGEXTFILTALLTYPESFORNORMTEXT, BM_SETCHECK, nppGUI._setSaveDlgExtFiltToAllTypesForNormText, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_SAVEDLGEXTFILTALLTYPES, BM_SETCHECK, nppGUI._setSaveDlgExtFiltToAllTypes, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_DIRECTWRITE_ENABLE, BM_SETCHECK, nppGUI._writeTechnologyEngine == directWriteTechnology, 0); ::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_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_ENABLEDOCPEEKONMAP, BM_SETCHECK, nppGUI._isDocPeekOnMap ? BST_CHECKED : BST_UNCHECKED, 0);
@ -1065,8 +1065,8 @@ INT_PTR CALLBACK MiscSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
nppGUI._autoUpdateOpt._doAutoUpdate = isCheckedOrNot(static_cast<int32_t>(wParam)); nppGUI._autoUpdateOpt._doAutoUpdate = isCheckedOrNot(static_cast<int32_t>(wParam));
return TRUE; return TRUE;
case IDC_CHECK_SAVEDLGEXTFILTALLTYPESFORNORMTEXT: case IDC_CHECK_SAVEDLGEXTFILTALLTYPES:
nppGUI._setSaveDlgExtFiltToAllTypesForNormText = isCheckedOrNot(static_cast<int32_t>(wParam)); nppGUI._setSaveDlgExtFiltToAllTypes = isCheckedOrNot(static_cast<int32_t>(wParam));
return TRUE; return TRUE;
case IDC_CHECK_MIN2SYSTRAY: case IDC_CHECK_MIN2SYSTRAY:

@ -204,7 +204,7 @@
#define IDC_CHECK_SMARTHILITEWHOLEWORDONLY (IDD_PREFERENCE_SUB_MISC + 38) #define IDC_CHECK_SMARTHILITEWHOLEWORDONLY (IDD_PREFERENCE_SUB_MISC + 38)
#define IDC_CHECK_SMARTHILITEUSEFINDSETTINGS (IDD_PREFERENCE_SUB_MISC + 39) #define IDC_CHECK_SMARTHILITEUSEFINDSETTINGS (IDD_PREFERENCE_SUB_MISC + 39)
#define IDC_CHECK_SMARTHILITEANOTHERRVIEW (IDD_PREFERENCE_SUB_MISC + 40) #define IDC_CHECK_SMARTHILITEANOTHERRVIEW (IDD_PREFERENCE_SUB_MISC + 40)
#define IDC_CHECK_SAVEDLGEXTFILTALLTYPESFORNORMTEXT (IDD_PREFERENCE_SUB_MISC + 51) #define IDC_CHECK_SAVEDLGEXTFILTALLTYPES (IDD_PREFERENCE_SUB_MISC + 51)
//-- xFileEditViewHistoryParameterGUI: Additional Checkbox for enabling the history for restoring the edit view per file. //-- xFileEditViewHistoryParameterGUI: Additional Checkbox for enabling the history for restoring the edit view per file.
#define IDC_CHECK_REMEMBEREDITVIEWPERFILE (IDD_PREFERENCE_SUB_MISC + 41) #define IDC_CHECK_REMEMBEREDITVIEWPERFILE (IDD_PREFERENCE_SUB_MISC + 41)

Loading…
Cancel
Save