[Monodevelop-patches-list] r2571 - in trunk/MonoDevelop/Core/src/MonoDevelop.Base: . Gui/Dialogs/ReferenceDialog
Jacob Ilsø Christensen <jacobilsoe@gmail.com>
jacobilsoe at mono-cvs.ximian.com
Wed Jun 1 09:35:49 EDT 2005
Author: jacobilsoe
Date: 2005-06-01 09:35:49 -0400 (Wed, 01 Jun 2005)
New Revision: 2571
Modified:
trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/ReferenceDialog/ProjectReferencePanel.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs
Log:
Prevent a project from referencing itself
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog 2005-06-01 07:16:22 UTC (rev 2570)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog 2005-06-01 13:35:49 UTC (rev 2571)
@@ -1,3 +1,10 @@
+2005-06-01 Jacob Ilsø Christensen <jacobilsoe at gmail.com>
+
+ * Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs:
+ * Gui/Dialogs/ReferenceDialog/ProjectReferencePanel.cs:
+ * Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs:
+ Prevent a project from referencing itself.
+
2005-05-30 Lluis Sanchez Gual <lluis at novell.com>
* Services/StatusBar/DefaultStatusBarService.cs: Added null checks.
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs 2005-06-01 07:16:22 UTC (rev 2570)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs 2005-06-01 13:35:49 UTC (rev 2571)
@@ -82,7 +82,11 @@
public void SignalRefChange (string refLoc, bool newstate)
{
Gtk.TreeIter looping_iter;
- store.GetIterFirst (out looping_iter);
+
+ if (!store.GetIterFirst (out looping_iter)) {
+ return;
+ }
+
do {
if ((string)store.GetValue (looping_iter, 4) == refLoc) {
store.SetValue (looping_iter, 3, newstate);
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/ReferenceDialog/ProjectReferencePanel.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/ReferenceDialog/ProjectReferencePanel.cs 2005-06-01 07:16:22 UTC (rev 2570)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/ReferenceDialog/ProjectReferencePanel.cs 2005-06-01 13:35:49 UTC (rev 2571)
@@ -23,7 +23,7 @@
TreeStore store;
TreeView treeView;
- public ProjectReferencePanel (SelectReferenceDialog selectDialog) : base (false, 6)
+ public ProjectReferencePanel (SelectReferenceDialog selectDialog, Project configureProject) : base (false, 6)
{
this.selectDialog = selectDialog;
@@ -50,7 +50,7 @@
treeView.AppendColumn (firstColumn);
treeView.AppendColumn (GettextCatalog.GetString ("Directory"), new CellRendererText (), "text", 1);
- PopulateListView ();
+ PopulateListView (configureProject);
ScrolledWindow sc = new ScrolledWindow ();
sc.ShadowType = Gtk.ShadowType.In;
sc.Add (treeView);
@@ -82,7 +82,10 @@
public void SignalRefChange (string refLoc, bool newstate)
{
Gtk.TreeIter looping_iter;
- store.GetIterFirst (out looping_iter);
+ if (!store.GetIterFirst (out looping_iter)) {
+ return;
+ }
+
do {
Project project = (Project) store.GetValue (looping_iter, 2);
if (project.Name == refLoc) {
@@ -92,7 +95,7 @@
} while (store.IterNext (ref looping_iter));
}
- void PopulateListView ()
+ void PopulateListView (Project configureProject)
{
Combine openCombine = Runtime.ProjectService.CurrentOpenCombine;
@@ -101,6 +104,11 @@
}
foreach (Project projectEntry in openCombine.GetAllProjects()) {
+
+ if (projectEntry == configureProject) {
+ continue;
+ }
+
string iconName = Runtime.Gui.Icons.GetImageForProjectType (projectEntry.ProjectType);
Gdk.Pixbuf icon = treeView.RenderIcon (iconName, Gtk.IconSize.Menu, "");
store.AppendValues (projectEntry.Name, projectEntry.BaseDirectory, projectEntry, false, icon);
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs 2005-06-01 07:16:22 UTC (rev 2570)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs 2005-06-01 13:35:49 UTC (rev 2571)
@@ -78,7 +78,7 @@
ReferencesTreeView.AppendColumn (GettextCatalog.GetString ("Location"), new CellRendererText (), "text", 2);
gacRefPanel = new GacReferencePanel (this);
- projectRefPanel = new ProjectReferencePanel (this);
+ projectRefPanel = new ProjectReferencePanel (this, configureProject);
foreach (ProjectReference refInfo in configureProject.ProjectReferences) {
switch (refInfo.ReferenceType) {
More information about the Monodevelop-patches-list
mailing list