Author: lluis
Date: 2006-08-08 07:25:09 -0400 (Tue, 08 Aug 2006)
New Revision: 63472
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.Pads/OpenTaskView.cs
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectOperations.cs
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.mdp
Log:
2006-08-08 Lluis Sanchez Gual <[EMAIL PROTECTED]>
* MonoDevelop.Ide.Commands/ProjectCommands.cs: Added deploy command.
Build the project before deploying.
* MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Set the pad as command
target when showing the context menu. Fixes bug #76141.
* MonoDevelop.Ide.Gui.Pads/OpenTaskView.cs: Added null check.
* MonoDevelop.Ide.addin.xml: Added deploy command.
* MonoDevelop.Ide.Gui/ProjectOperations.cs: Added Deploy method.
Modified: trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog 2006-08-08
11:24:40 UTC (rev 63471)
+++ trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog 2006-08-08
11:25:09 UTC (rev 63472)
@@ -1,3 +1,13 @@
+2006-08-08 Lluis Sanchez Gual <[EMAIL PROTECTED]>
+
+ * MonoDevelop.Ide.Commands/ProjectCommands.cs: Added deploy command.
+ Build the project before deploying.
+ * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Set the pad as command
+ target when showing the context menu. Fixes bug #76141.
+ * MonoDevelop.Ide.Gui.Pads/OpenTaskView.cs: Added null check.
+ * MonoDevelop.Ide.addin.xml: Added deploy command.
+ * MonoDevelop.Ide.Gui/ProjectOperations.cs: Added Deploy method.
+
2006-08-04 Lluis Sanchez Gual <[EMAIL PROTECTED]>
* MonoDevelop.Ide.Gui.Content/IEncodedTextContent.cs: New interface.
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs
2006-08-08 11:24:40 UTC (rev 63471)
+++
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs
2006-08-08 11:25:09 UTC (rev 63472)
@@ -364,24 +364,38 @@
}
}
+ internal class DeployHandler: CommandHandler
+ {
+ protected override void Run ()
+ {
+ CombineEntry e =
IdeApp.ProjectOperations.CurrentSelectedCombineEntry;
+ IAsyncOperation op = IdeApp.ProjectOperations.Build (e);
+ op.Completed += delegate {
+ if (op.Success)
+ IdeApp.ProjectOperations.Deploy (e,
e.DefaultDeployTarget);
+ };
+ }
+
+ protected override void Update (CommandInfo info)
+ {
+ CombineEntry e =
IdeApp.ProjectOperations.CurrentSelectedCombineEntry;
+ if (e != null && e.DefaultDeployTarget != null) {
+ info.Enabled = true;
+ } else
+ info.Enabled = false;
+ }
+ }
+
internal class DeployTargetListHandler: CommandHandler
{
protected override void Run (object dt)
{
- MessageDialogProgressMonitor mon = new
MessageDialogProgressMonitor (true, false, true, false);
-
- // Run the deploy command in a background thread to
avoid
- // deadlocks with the gui thread
-
- Thread t = new Thread (
- delegate () {
- using (mon) {
- ((DeployTarget)dt).Deploy (mon);
- }
- }
- );
- t.IsBackground = true;
- t.Start ();
+ CombineEntry ce =
IdeApp.ProjectOperations.CurrentSelectedCombineEntry;
+ IAsyncOperation op = IdeApp.ProjectOperations.Build
(ce);
+ op.Completed += delegate {
+ if (op.Success)
+ IdeApp.ProjectOperations.Deploy (ce,
(DeployTarget)dt);
+ };
}
protected override void Update (CommandArrayInfo info)
@@ -394,6 +408,8 @@
continue;
CommandInfo cinfo = new
CommandInfo ();
cinfo.Text = dt.Name;
+ if (ce.DefaultDeployTarget ==
dt)
+ cinfo.Text += " " +
GettextCatalog.GetString ("(default)");
cinfo.Icon =
dt.DeployHandler.Icon;
info.Add (cinfo, dt);
}
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectOperations.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectOperations.cs
2006-08-08 11:24:40 UTC (rev 63471)
+++
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectOperations.cs
2006-08-08 11:25:09 UTC (rev 63472)
@@ -38,6 +38,7 @@
using MonoDevelop.Projects.Gui.Dialogs;
using MonoDevelop.Projects.Parser;
using MonoDevelop.Projects.CodeGeneration;
+using MonoDevelop.Projects.Deployment;
using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Core.AddIns;
@@ -671,7 +672,27 @@
Runtime.LoggingService.Warn("Could not save
solution preferences: " + fileToSave as object, e);
}
}
+
+ public IAsyncOperation Deploy (CombineEntry entry, DeployTarget
target)
+ {
+ IProgressMonitor mon =
IdeApp.Workbench.ProgressMonitors.GetOutputProgressMonitor
(GettextCatalog.GetString ("Deploy Output"),
MonoDevelop.Core.Gui.Stock.RunProgramIcon, true, true);
+ // Run the deploy command in a background thread to
avoid
+ // deadlocks with the gui thread
+
+ System.Threading.Thread t = new System.Threading.Thread
(
+ delegate () {
+ using (mon) {
+ target.Deploy (mon);
+ }
+ }
+ );
+ t.IsBackground = true;
+ t.Start ();
+
+ return mon.AsyncOperation;
+ }
+
public IAsyncOperation Execute (CombineEntry entry)
{
if (currentRunOperation != null &&
!currentRunOperation.IsCompleted) return currentRunOperation;
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/OpenTaskView.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/OpenTaskView.cs
2006-08-08 11:24:40 UTC (rev 63471)
+++
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/OpenTaskView.cs
2006-08-08 11:25:09 UTC (rev 63472)
@@ -275,7 +275,9 @@
try {
Task task = (Task) store.GetValue (iter,
COL_TASK);
- if (task.TaskType == TaskType.Error &&
errorBtn.Active) canShow = true;
+ if (task == null)
+ return true;
+ if (task.TaskType == TaskType.Error &&
errorBtn.Active) canShow = true;
else if (task.TaskType == TaskType.Warning &&
warnBtn.Active) canShow = true;
else if (task.TaskType == TaskType.Comment &&
msgBtn.Active) canShow = true;
} catch {
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs
2006-08-08 11:24:40 UTC (rev 63471)
+++
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs
2006-08-08 11:25:09 UTC (rev 63472)
@@ -1021,7 +1021,7 @@
opset.AddItem
(ViewCommands.TreeDisplayOptionList);
opset.AddItem (Command.Separator);
opset.AddItem
(ViewCommands.ResetTreeDisplayOptions);
- IdeApp.CommandService.ShowContextMenu
(opset);
+ IdeApp.CommandService.ShowContextMenu
(opset, this);
}
} else {
CommandEntrySet eset =
IdeApp.CommandService.CreateCommandEntrySet (nb.ContextMenuAddinPath);
@@ -1031,7 +1031,7 @@
opset.AddItem (Command.Separator);
opset.AddItem
(ViewCommands.ResetTreeDisplayOptions);
opset.AddItem (ViewCommands.RefreshTree);
- IdeApp.CommandService.ShowContextMenu (eset);
+ IdeApp.CommandService.ShowContextMenu (eset,
this);
}
}
Modified: trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml
2006-08-08 11:24:40 UTC (rev 63471)
+++ trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml
2006-08-08 11:25:09 UTC (rev 63472)
@@ -235,6 +235,10 @@
type = "custom"
widget =
"MonoDevelop.Ide.Gui.ConfigurationComboBox"
_label = "Active Configuration" />
+ <Command id = "MonoDevelop.Ide.Commands.ProjectCommands.Deploy"
+ defaultHandler =
"MonoDevelop.Ide.Commands.DeployHandler"
+ shortcut = "Shift|F7"
+ _label = "Deploy" />
<Command id =
"MonoDevelop.Ide.Commands.ProjectCommands.DeployTargetList"
defaultHandler =
"MonoDevelop.Ide.Commands.DeployTargetListHandler"
type="array"
@@ -480,7 +484,9 @@
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.Build" />
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.Rebuild" />
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.Clean" />
- <ItemSet id = "CombineDeployMenu" _label = "Deploy" >
+ <SeparatorItem id = "DeploySeparator" />
+ <CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.Deploy" />
+ <ItemSet id = "CombineDeployMenu" _label = "Deploy to" >
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.DeployTargetList" />
<SeparatorItem id = "DeploySeparator" />
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.ConfigureDeployTargets" />
@@ -527,12 +533,6 @@
<CommandItem id =
"MonoDevelop.Ide.Commands.ViewCommands.OpenWithList" />
</ItemSet>
<SeparatorItem id = "OpenSeparator" />
- <ItemSet id = "Add" _label = "Add">
- <CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.AddNewFiles" />
- <CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.AddFiles" />
- <SeparatorItem id = "Separator1" />
- <CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.NewFolder" />
- </ItemSet>
<ItemSet id = "Include" _label = "Include">
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.IncludeInBuild" />
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.IncludeInDeploy" />
@@ -581,6 +581,13 @@
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.Build" />
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.Rebuild"/>
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.Clean" />
+ <SeparatorItem id = "DeploySeparator" />
+ <CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.Deploy" />
+ <ItemSet id = "CombineDeployMenu" _label = "Deploy to" >
+ <CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.DeployTargetList" />
+ <SeparatorItem id = "DeploySeparator" />
+ <CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.ConfigureDeployTargets" />
+ </ItemSet>
<SeparatorItem id = "RunSeparator" />
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.RunEntry" />
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.DebugEntry" />
@@ -840,7 +847,8 @@
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.Rebuild" />
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.Clean" />
<SeparatorItem id = "DeploySeparator" />
- <ItemSet id = "DeployTargets" _label = "Deploy">
+ <CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.Deploy" />
+ <ItemSet id = "DeployTargets" _label = "Deploy to">
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.DeployTargetList" />
</ItemSet>
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.ConfigureDeployTargets" />
Modified: trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.mdp
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.mdp
2006-08-08 11:24:40 UTC (rev 63471)
+++ trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.mdp
2006-08-08 11:25:09 UTC (rev 63472)
@@ -246,6 +246,7 @@
<File name="./Makefile.am" subtype="Code" buildaction="Nothing" />
<File name="./MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs"
subtype="Code" buildaction="Compile" />
<File name="./MonoDevelop.Ide.Gui.Content/IEncodedTextContent.cs"
subtype="Code" buildaction="Compile" />
+ <File name="./MonoDevelop.Ide.addin.xml" subtype="Code"
buildaction="Nothing" />
</Contents>
<References>
<ProjectReference type="Project" localcopy="True" refto="MonoDevelop.Core"
/>
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches