Author: lluis
Date: 2006-01-18 13:34:38 -0500 (Wed, 18 Jan 2006)
New Revision: 55749
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
Log:
2006-01-18 Lluis Sanchez Gual <[EMAIL PROTECTED]>
* MonoDevelop.Ide.Commands/ProjectCommands.cs: Disable build and
run commands if the current file is not a valid build target.
* MonoDevelop.Ide.Gui/Document.cs: Added IsBuildTarget property.
Modified: trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog 2006-01-18
18:34:15 UTC (rev 55748)
+++ trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog 2006-01-18
18:34:38 UTC (rev 55749)
@@ -1,3 +1,9 @@
+2006-01-18 Lluis Sanchez Gual <[EMAIL PROTECTED]>
+
+ * MonoDevelop.Ide.Commands/ProjectCommands.cs: Disable build and
+ run commands if the current file is not a valid build target.
+ * MonoDevelop.Ide.Gui/Document.cs: Added IsBuildTarget property.
+
2006-01-18 Lluis Sanchez Gual <[EMAIL PROTECTED]>
* MonoDevelop.Ide.Templates/FileTemplate.cs: Added an Id property,
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs
2006-01-18 18:34:15 UTC (rev 55748)
+++
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs
2006-01-18 18:34:38 UTC (rev 55749)
@@ -75,7 +75,7 @@
if (IdeApp.ProjectOperations.CurrentOpenCombine !=
null) {
info.Enabled =
IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted;
} else {
- info.Enabled = (IdeApp.Workbench.ActiveDocument
!= null);
+ info.Enabled = (IdeApp.Workbench.ActiveDocument
!= null && IdeApp.Workbench.ActiveDocument.IsBuildTarget);
}
}
@@ -158,7 +158,7 @@
if (IdeApp.ProjectOperations.CurrentOpenCombine !=
null) {
info.Enabled =
IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted;
} else {
- info.Enabled = (IdeApp.Workbench.ActiveDocument
!= null);
+ info.Enabled = (IdeApp.Workbench.ActiveDocument
!= null && IdeApp.Workbench.ActiveDocument.IsBuildTarget);
}
}
@@ -235,7 +235,7 @@
info.Enabled = false;
}
} else {
- if (IdeApp.Workbench.ActiveDocument != null) {
+ if (IdeApp.Workbench.ActiveDocument != null &&
IdeApp.Workbench.ActiveDocument.IsBuildTarget) {
info.Enabled =
IdeApp.ProjectOperations.CurrentBuildOperation.IsCompleted;
string file = Path.GetFileName
(IdeApp.Workbench.ActiveDocument.FileName);
info.Text = info.Description =
string.Format (GettextCatalog.GetString ("Build {0}"), file);
@@ -272,7 +272,7 @@
info.Enabled = false;
}
} else {
- if (IdeApp.Workbench.ActiveDocument != null) {
+ if (IdeApp.Workbench.ActiveDocument != null &&
IdeApp.Workbench.ActiveDocument.IsBuildTarget) {
info.Enabled =
IdeApp.ProjectOperations.CurrentBuildOperation.IsCompleted;
string file = Path.GetFileName
(IdeApp.Workbench.ActiveDocument.FileName);
info.Text = info.Description =
string.Format (GettextCatalog.GetString ("Rebuild {0}"), file);
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
2006-01-18 18:34:15 UTC (rev 55748)
+++ trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
2006-01-18 18:34:38 UTC (rev 55749)
@@ -163,6 +163,9 @@
OnSaved (EventArgs.Empty);
}
+ public virtual bool IsBuildTarget {
+ get { return
Services.ProjectService.CanCreateSingleFileProject
(Window.ViewContent.ContentName); }
+ }
public virtual IAsyncOperation Build ()
{
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches