mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-27 07:44:24 +02:00
Fixed Read-Only flag (user read only) flag issue
Close #4943, fix #4942
This commit is contained in:
parent
6ceda544a6
commit
ab4c2edde6
@ -1978,19 +1978,13 @@ void Notepad_plus::checkDocState()
|
|||||||
enableCommand(IDM_VIEW_LOAD_IN_NEW_INSTANCE, !(isCurrentDirty || isCurrentUntitled), MENU);
|
enableCommand(IDM_VIEW_LOAD_IN_NEW_INSTANCE, !(isCurrentDirty || isCurrentUntitled), MENU);
|
||||||
|
|
||||||
bool isSysReadOnly = curBuf->getFileReadOnly();
|
bool isSysReadOnly = curBuf->getFileReadOnly();
|
||||||
if (isSysReadOnly)
|
enableCommand(IDM_EDIT_CLEARREADONLY, isSysReadOnly, MENU);
|
||||||
{
|
|
||||||
::CheckMenuItem(_mainMenuHandle, IDM_EDIT_SETREADONLY, MF_BYCOMMAND | MF_UNCHECKED);
|
bool doEnable = not (curBuf->isMonitoringOn() || isSysReadOnly);
|
||||||
enableCommand(IDM_EDIT_SETREADONLY, false, MENU);
|
enableCommand(IDM_EDIT_SETREADONLY, doEnable, MENU);
|
||||||
enableCommand(IDM_EDIT_CLEARREADONLY, true, MENU);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
enableCommand(IDM_EDIT_SETREADONLY, true, MENU);
|
|
||||||
enableCommand(IDM_EDIT_CLEARREADONLY, false, MENU);
|
|
||||||
bool isUserReadOnly = curBuf->getUserReadOnly();
|
bool isUserReadOnly = curBuf->getUserReadOnly();
|
||||||
::CheckMenuItem(_mainMenuHandle, IDM_EDIT_SETREADONLY, MF_BYCOMMAND | (isUserReadOnly?MF_CHECKED:MF_UNCHECKED));
|
::CheckMenuItem(_mainMenuHandle, IDM_EDIT_SETREADONLY, MF_BYCOMMAND | (isUserReadOnly ? MF_CHECKED : MF_UNCHECKED));
|
||||||
}
|
|
||||||
|
|
||||||
enableCommand(IDM_FILE_DELETE, isFileExisting, MENU);
|
enableCommand(IDM_FILE_DELETE, isFileExisting, MENU);
|
||||||
//enableCommand(IDM_FILE_RENAME, isFileExisting, MENU);
|
//enableCommand(IDM_FILE_RENAME, isFileExisting, MENU);
|
||||||
@ -2013,7 +2007,6 @@ void Notepad_plus::checkDocState()
|
|||||||
_pAnsiCharPanel->switchEncoding();
|
_pAnsiCharPanel->switchEncoding();
|
||||||
|
|
||||||
enableCommand(IDM_VIEW_MONITORING, not curBuf->isUntitled(), MENU | TOOLBAR);
|
enableCommand(IDM_VIEW_MONITORING, not curBuf->isUntitled(), MENU | TOOLBAR);
|
||||||
enableCommand(IDM_EDIT_SETREADONLY, not curBuf->isMonitoringOn(), MENU);
|
|
||||||
checkMenuItem(IDM_VIEW_MONITORING, curBuf->isMonitoringOn());
|
checkMenuItem(IDM_VIEW_MONITORING, curBuf->isMonitoringOn());
|
||||||
_toolBar.setCheck(IDM_VIEW_MONITORING, curBuf->isMonitoringOn());
|
_toolBar.setCheck(IDM_VIEW_MONITORING, curBuf->isMonitoringOn());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user