Browse Source

Disable last 3 entries in workbench window context menu (Copy file path, Navigate to file, Open containing folder) when the workbench window does not represent any file.

4.0
Daniel Grunwald 15 years ago
parent
commit
271d06aeed
  1. 8
      src/Main/Base/Project/ICSharpCode.SharpDevelop.addin
  2. 5
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonWorkbenchWindow.cs

8
src/Main/Base/Project/ICSharpCode.SharpDevelop.addin

@ -1009,16 +1009,10 @@
<MenuItem id = "SaveAs" <MenuItem id = "SaveAs"
label = "${res:OpenFileTabEventHandler.ContextMenu.SaveAs}" label = "${res:OpenFileTabEventHandler.ContextMenu.SaveAs}"
class = "ICSharpCode.SharpDevelop.Commands.TabStrip.SaveFileAsTab"/> class = "ICSharpCode.SharpDevelop.Commands.TabStrip.SaveFileAsTab"/>
<Condition name = "OpenWindowState" openwindowstate="Dirty" action="Disable">
<MenuItem id = "SaveAll"
icon = "Icons.16x16.SaveAllIcon"
label = "${res:XML.MainMenu.FileMenu.SaveAll.Description}"
class = "ICSharpCode.SharpDevelop.Commands.SaveAllFiles"/>
</Condition>
<MenuItem id = "SaveSeparator" type = "Separator" /> <MenuItem id = "SaveSeparator" type = "Separator" />
<ComplexCondition action="Disable"> <ComplexCondition action="Disable">
<Not> <Not>
<Condition name = "Ownerstate" ownerstate="FileUntitled" /> <Condition name = "Ownerstate" ownerstate="FileUntitled,ViewContentWithoutFile" />
</Not> </Not>
<MenuItem id = "CopyPathName" <MenuItem id = "CopyPathName"
label = "${res:OpenFileTabEventHandler.CopyPathName}" label = "${res:OpenFileTabEventHandler.CopyPathName}"

5
src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonWorkbenchWindow.cs

@ -79,7 +79,8 @@ namespace ICSharpCode.SharpDevelop.Gui
Nothing = 0, Nothing = 0,
FileDirty = 1, FileDirty = 1,
FileReadOnly = 2, FileReadOnly = 2,
FileUntitled = 4 FileUntitled = 4,
ViewContentWithoutFile = 8
} }
public System.Enum InternalState { public System.Enum InternalState {
@ -93,6 +94,8 @@ namespace ICSharpCode.SharpDevelop.Gui
state |= OpenFileTabStates.FileReadOnly; state |= OpenFileTabStates.FileReadOnly;
if (content.PrimaryFile != null && content.PrimaryFile.IsUntitled) if (content.PrimaryFile != null && content.PrimaryFile.IsUntitled)
state |= OpenFileTabStates.FileUntitled; state |= OpenFileTabStates.FileUntitled;
if (content.PrimaryFile == null)
state |= OpenFileTabStates.ViewContentWithoutFile;
} }
return state; return state;
} }

Loading…
Cancel
Save