mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
+ chg: use only base file name from file path for InfoBox() dialog (avoid text cutoff on long paths)
This commit is contained in:
parent
78bc7280c0
commit
5bb7f43dc4
@ -3519,11 +3519,11 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
dwFileAttributes |= FILE_ATTRIBUTE_READONLY;
|
||||
}
|
||||
if (!SetFileAttributes(Globals.CurrentFile, dwFileAttributes)) {
|
||||
InfoBoxLng(MB_ICONWARNING, NULL, IDS_MUI_READONLY_MODIFY, Globals.CurrentFile);
|
||||
InfoBoxLng(MB_ICONWARNING, NULL, IDS_MUI_READONLY_MODIFY, PathFindFileName(Globals.CurrentFile));
|
||||
}
|
||||
}
|
||||
else {
|
||||
InfoBoxLng(MB_ICONWARNING, NULL, IDS_MUI_READONLY_MODIFY, Globals.CurrentFile);
|
||||
InfoBoxLng(MB_ICONWARNING, NULL, IDS_MUI_READONLY_MODIFY, PathFindFileName(Globals.CurrentFile));
|
||||
}
|
||||
dwFileAttributes = GetFileAttributes(Globals.CurrentFile);
|
||||
if (dwFileAttributes != INVALID_FILE_ATTRIBUTES)
|
||||
@ -9387,7 +9387,7 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload,
|
||||
{
|
||||
bool bCreateFile = s_flagQuietCreate;
|
||||
if (!bCreateFile) {
|
||||
INT_PTR const answer = InfoBoxLng(MB_YESNO | MB_ICONQUESTION, NULL, IDS_MUI_ASK_CREATE, szFileName);
|
||||
INT_PTR const answer = InfoBoxLng(MB_YESNO | MB_ICONQUESTION, NULL, IDS_MUI_ASK_CREATE, PathFindFileName(szFileName));
|
||||
if ((IDOK == answer) || (IDYES == answer)) {
|
||||
bCreateFile = true;
|
||||
}
|
||||
@ -9574,7 +9574,7 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload,
|
||||
|
||||
}
|
||||
else if (!(fioStatus.bFileTooBig || fioStatus.bUnknownExt)) {
|
||||
InfoBoxLng(MB_ICONWARNING, NULL, IDS_MUI_ERR_LOADFILE, szFileName);
|
||||
InfoBoxLng(MB_ICONWARNING, NULL, IDS_MUI_ERR_LOADFILE, PathFindFileName(szFileName));
|
||||
}
|
||||
|
||||
UpdateAllBars(true);
|
||||
@ -9784,7 +9784,7 @@ bool FileSave(bool bSaveAlways, bool bAsk, bool bSaveAs, bool bSaveCopy)
|
||||
s_bFileReadOnly = (dwFileAttributes & FILE_ATTRIBUTE_READONLY);
|
||||
if (s_bFileReadOnly) {
|
||||
UpdateToolbar();
|
||||
INT_PTR const answer = InfoBoxLng(MB_YESNO | MB_ICONWARNING, NULL, IDS_MUI_READONLY_SAVE, Globals.CurrentFile);
|
||||
INT_PTR const answer = InfoBoxLng(MB_YESNO | MB_ICONWARNING, NULL, IDS_MUI_READONLY_SAVE, PathFindFileName(Globals.CurrentFile));
|
||||
if ((IDOK == answer) || (IDYES == answer)) {
|
||||
bSaveAs = true;
|
||||
}
|
||||
@ -9866,7 +9866,7 @@ bool FileSave(bool bSaveAlways, bool bAsk, bool bSaveAs, bool bSaveCopy)
|
||||
{
|
||||
if (!s_bIsElevated && (Globals.dwLastError == ERROR_ACCESS_DENIED))
|
||||
{
|
||||
INT_PTR const answer = InfoBoxLng(MB_YESNO | MB_ICONWARNING, NULL, IDS_MUI_ERR_ACCESSDENIED, Globals.CurrentFile);
|
||||
INT_PTR const answer = InfoBoxLng(MB_YESNO | MB_ICONWARNING, NULL, IDS_MUI_ERR_ACCESSDENIED, PathFindFileName(Globals.CurrentFile));
|
||||
if ((IDOK == answer) || (IDYES == answer)) {
|
||||
if (DoElevatedRelaunch(&fioStatus))
|
||||
{
|
||||
@ -9875,13 +9875,13 @@ bool FileSave(bool bSaveAlways, bool bAsk, bool bSaveAs, bool bSaveCopy)
|
||||
else {
|
||||
s_flagAppIsClosing = false;
|
||||
UpdateToolbar();
|
||||
InfoBoxLng(MB_ICONWARNING, NULL, IDS_MUI_ERR_SAVEFILE, Globals.CurrentFile);
|
||||
InfoBoxLng(MB_ICONWARNING, NULL, IDS_MUI_ERR_SAVEFILE, PathFindFileName(Globals.CurrentFile));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
UpdateToolbar();
|
||||
InfoBoxLng(MB_ICONWARNING, NULL, IDS_MUI_ERR_SAVEFILE, Globals.CurrentFile);
|
||||
InfoBoxLng(MB_ICONWARNING, NULL, IDS_MUI_ERR_SAVEFILE, PathFindFileName(Globals.CurrentFile));
|
||||
}
|
||||
}
|
||||
return fSuccess;
|
||||
|
||||
@ -674,7 +674,7 @@ bool Style_Export(HWND hwnd)
|
||||
Globals.dwLastError = Style_ExportToFile(szFile, true);
|
||||
|
||||
if (Globals.dwLastError != ERROR_SUCCESS) {
|
||||
InfoBoxLng(MB_ICONERROR, NULL, IDS_MUI_EXPORT_FAIL, szFile);
|
||||
InfoBoxLng(MB_ICONERROR, NULL, IDS_MUI_EXPORT_FAIL, PathFindFileName(szFile));
|
||||
}
|
||||
}
|
||||
return (Globals.dwLastError == ERROR_SUCCESS);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user