[Monodevelop-patches-list] r1396 - in trunk/MonoDevelop/src/Main/Base: . Commands/ProjectBrowserCommands
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Tue Apr 6 01:58:43 EDT 2004
Author: tberman
Date: 2004-04-06 01:58:42 -0400 (Tue, 06 Apr 2004)
New Revision: 1396
Modified:
trunk/MonoDevelop/src/Main/Base/ChangeLog
trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/CombineNodeCommands.cs
Log:
fix bug #56429
Modified: trunk/MonoDevelop/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-04-06 05:27:44 UTC (rev 1395)
+++ trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-04-06 05:58:42 UTC (rev 1396)
@@ -1,5 +1,10 @@
-2004-04-04 Todd Berman <tberman at sevenl.net>
+2004-04-06 Todd Berman <tberman at sevenl.net>
+ * Commands/ProjectBrowserCommands/CombineNodeCommands.cs: fix bug
+ #56429.
+
+2004-04-06 Todd Berman <tberman at sevenl.net>
+
* Gui/Workbench/DefaultWorkbench.cs: register gtype. add message about
using proper ctor.
* Gui/BrowserDisplayBinding/HtmlViewPane.cs: remove useless event
Modified: trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/CombineNodeCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/CombineNodeCommands.cs 2004-04-06 05:27:44 UTC (rev 1395)
+++ trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/CombineNodeCommands.cs 2004-04-06 05:58:42 UTC (rev 1396)
@@ -31,18 +31,26 @@
{
public override void Run()
{
- IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.Services.GetService(typeof(IProjectService));
- ProjectBrowserView browser = (ProjectBrowserView)Owner;
- CombineBrowserNode node = browser.SelectedNode as CombineBrowserNode;
+ IProjectService projectService = (IProjectService)ServiceManager.Services.GetService(typeof(IProjectService));
+ ProjectBrowserView browser = (ProjectBrowserView)Owner;
+ CombineBrowserNode node = browser.SelectedNode as CombineBrowserNode;
+ MessageService msg = (MessageService)ServiceManager.Services.GetService (typeof (MessageService));
if (node != null) {
NewProjectDialog npdlg = new NewProjectDialog(false);
if (npdlg.Run() == (int)Gtk.ResponseType.Ok) {
//System.Console.WriteLine("inside if");
- int newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildProjectTreeNode((IProject)node.Combine.AddEntry(npdlg.NewProjectLocation)));
- projectService.SaveCombine();
- // expand to the new node
- node.Nodes[newNodeIndex].Expand();
+ try
+ {
+ int newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildProjectTreeNode((IProject)node.Combine.AddEntry(npdlg.NewProjectLocation)));
+ projectService.SaveCombine();
+ // expand to the new node
+ node.Nodes[newNodeIndex].Expand();
+ }
+ catch
+ {
+ msg.ShowError (GettextCatalog.GetString ("Invalid Project File"));
+ }
}
}
//System.Console.WriteLine("end");
@@ -56,15 +64,23 @@
IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.Services.GetService(typeof(IProjectService));
ProjectBrowserView browser = (ProjectBrowserView)Owner;
CombineBrowserNode node = browser.SelectedNode as CombineBrowserNode;
+ MessageService msg = (MessageService)ServiceManager.Services.GetService (typeof (MessageService));
if (node != null) {
NewProjectDialog npdlg = new NewProjectDialog(false);
if (npdlg.Run() == (int)Gtk.ResponseType.Ok) {
- int newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildCombineTreeNode((Combine)node.Combine.AddEntry(npdlg.NewCombineLocation)));
- projectService.SaveCombine();
-
- // expand to the new node
- node.Nodes[newNodeIndex].Expand();
+ try
+ {
+ int newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildCombineTreeNode((Combine)node.Combine.AddEntry(npdlg.NewCombineLocation)));
+ projectService.SaveCombine();
+
+ // expand to the new node
+ node.Nodes[newNodeIndex].Expand();
+ }
+ catch
+ {
+ msg.ShowError (GettextCatalog.GetString ("Invalid Solution File"));
+ }
}
}
}
@@ -90,19 +106,25 @@
fdiag.Complete (defaultFolder);
fdiag.SelectMultiple = false;
if (fdiag.Run () == (int) Gtk.ResponseType.Ok) {
- object obj = node.Combine.AddEntry(fdiag.Filename);
- int newNodeIndex = -1;
- if (obj is IProject) {
- newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildProjectTreeNode((IProject)obj));
- } else {
- newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildCombineTreeNode((Combine)obj));
- }
- projectService.SaveCombine();
+ try {
+ object obj = node.Combine.AddEntry(fdiag.Filename);
+ int newNodeIndex = -1;
+ if (obj is IProject) {
+ newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildProjectTreeNode((IProject)obj));
+ } else {
+ newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildCombineTreeNode((Combine)obj));
+ }
+ projectService.SaveCombine();
- if (newNodeIndex > -1) {
- // expand to the new node
- node.Nodes[newNodeIndex].Expand();
+ if (newNodeIndex > -1) {
+ // expand to the new node
+ node.Nodes[newNodeIndex].Expand();
+ }
}
+ catch
+ {
+ ((MessageService)ServiceManager.Services.GetService (typeof (MessageService))).ShowError (GettextCatalog.GetString ("Invalid Project File"));
+ }
}
fdiag.Hide ();
@@ -132,18 +154,24 @@
fdiag.Complete (defaultFolder);
fdiag.SelectMultiple = false;
if (fdiag.Run () == (int) Gtk.ResponseType.Ok) {
- object obj = node.Combine.AddEntry(fdiag.Filename);
- int newNodeIndex = -1;
- if (obj is IProject) {
- newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildProjectTreeNode((IProject)obj));
- } else {
- newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildCombineTreeNode((Combine)obj));
+ try {
+ object obj = node.Combine.AddEntry(fdiag.Filename);
+ int newNodeIndex = -1;
+ if (obj is IProject) {
+ newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildProjectTreeNode((IProject)obj));
+ } else {
+ newNodeIndex = node.Nodes.Add(ProjectBrowserView.BuildCombineTreeNode((Combine)obj));
+ }
+ projectService.SaveCombine();
+
+ if (newNodeIndex > -1) {
+ // expand to the new node
+ node.Nodes[newNodeIndex].Expand();
+ }
}
- projectService.SaveCombine();
-
- if (newNodeIndex > -1) {
- // expand to the new node
- node.Nodes[newNodeIndex].Expand();
+ catch
+ {
+ ((MessageService)ServiceManager.Services.GetService (typeof (MessageService))).ShowError (GettextCatalog.GetString ("Invalid Solution File"));
}
}
More information about the Monodevelop-patches-list
mailing list