[Monodevelop-patches-list] r562 - in trunk/MonoDevelop/src/Main/Base: Commands Gui/Dialogs

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Sun Jan 18 23:13:09 EST 2004


Author: tberman
Date: 2004-01-18 23:13:08 -0500 (Sun, 18 Jan 2004)
New Revision: 562

Modified:
   trunk/MonoDevelop/src/Main/Base/Commands/ProjectCommands.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ProjectOptionsDialog.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/TreeViewOptions.cs
Log:
basic bit of hookup, needs lots more, but its kinda enough to work with.


Modified: trunk/MonoDevelop/src/Main/Base/Commands/ProjectCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/ProjectCommands.cs	2004-01-19 03:55:17 UTC (rev 561)
+++ trunk/MonoDevelop/src/Main/Base/Commands/ProjectCommands.cs	2004-01-19 04:13:08 UTC (rev 562)
@@ -63,16 +63,10 @@
 			IAddInTreeNode generalOptionsNode          = AddInTreeSingleton.AddInTree.GetTreeNode("/SharpDevelop/Workbench/ProjectOptions/GeneralOptions");
 			IAddInTreeNode configurationPropertiesNode = AddInTreeSingleton.AddInTree.GetTreeNode("/SharpDevelop/Workbench/ProjectOptions/ConfigurationProperties");
 			
-			/*using (ProjectOptionsDialog optionsDialog = new ProjectOptionsDialog(selectedProject,
-			                                                                     generalOptionsNode,
-			                                                                     configurationPropertiesNode)) {
-				optionsDialog.FormBorderStyle = FormBorderStyle.FixedDialog;
-				
-				optionsDialog.Owner = (Form)WorkbenchSingleton.Workbench;
-				if (optionsDialog.ShowDialog() == DialogResult.OK) {
+			ProjectOptionsDialog optionsDialog = new ProjectOptionsDialog(selectedProject, generalOptionsNode, configurationPropertiesNode);
+			if (optionsDialog.Run() == (int)Gtk.ResponseType.Ok) {
 					projectService.MarkProjectDirty(projectService.CurrentSelectedProject);
-				}
-			}*/
+			}
 			
 			projectService.SaveCombine();
 		}

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ProjectOptionsDialog.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ProjectOptionsDialog.cs	2004-01-19 03:55:17 UTC (rev 561)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ProjectOptionsDialog.cs	2004-01-19 04:13:08 UTC (rev 562)
@@ -18,34 +18,36 @@
 using ICSharpCode.SharpDevelop.Internal.Project;
 using ICSharpCode.SharpDevelop.Services;
 namespace ICSharpCode.SharpDevelop.Gui.Dialogs {
-/*
+
 	/// <summary>
 	/// Dialog for viewing the project options (plain treeview isn't good enough :/)
 	/// </summary>
 	public class ProjectOptionsDialog : TreeViewOptions
 	{
 		IProject  project;
-		TreeNode configurationTreeNode;
+		//TreeNode configurationTreeNode;
 		
 		IAddInTreeNode configurationNode;
+	
+		StringParserService StringParserService = (StringParserService)ServiceManager.Services.GetService (typeof(StringParserService));
 		
 		public ProjectOptionsDialog(IProject project, IAddInTreeNode node, IAddInTreeNode configurationNode) : base(null, null)
 		{
 			this.project = project;
 			this.configurationNode = configurationNode;
-			this.Text = StringParserService.Parse("${res:Dialog.Options.ProjectOptions.DialogName}");
+			//this.Title = StringParserService.Parse("${res:Dialog.Options.ProjectOptions.DialogName}");
 			
-			((TreeView)ControlDictionary["optionsTreeView"]).MouseUp        += new MouseEventHandler(TreeViewMouseUp);
-			((TreeView)ControlDictionary["optionsTreeView"]).AfterLabelEdit += new NodeLabelEditEventHandler(AfterLabelEdit);
+			//((TreeView)ControlDictionary["optionsTreeView"]).MouseUp        += new MouseEventHandler(TreeViewMouseUp);
+			//((TreeView)ControlDictionary["optionsTreeView"]).AfterLabelEdit += new NodeLabelEditEventHandler(AfterLabelEdit);
 			
-			((TreeView)ControlDictionary["optionsTreeView"]).Font = boldFont;
+			//((TreeView)ControlDictionary["optionsTreeView"]).Font = boldFont;
 			
 			properties = new DefaultProperties();
 			properties.SetProperty("Project", project);
 			
-			AddNodes(properties, ((TreeView)ControlDictionary["optionsTreeView"]).Nodes, node.BuildChildItems(this));
+			AddNodes(properties, Gtk.TreeIter.Zero, node.BuildChildItems(this));
 			
-			configurationTreeNode = new TreeNode(StringParserService.Parse("${res:Dialog.Options.ProjectOptions.ConfigurationsNodeName}"));
+			/*configurationTreeNode = new TreeNode(StringParserService.Parse("${res:Dialog.Options.ProjectOptions.ConfigurationsNodeName}"));
 			configurationTreeNode.NodeFont = plainFont;
 			
 			foreach (IConfiguration config in project.Configurations) {
@@ -62,12 +64,12 @@
 				AddNodes(configNodeProperties, newNode.Nodes, configurationNode.BuildChildItems(this));
 				configurationTreeNode.Nodes.Add(newNode);
 			} 
-			((TreeView)ControlDictionary["optionsTreeView"]).Nodes.Add(configurationTreeNode);
+			((TreeView)ControlDictionary["optionsTreeView"]).Nodes.Add(configurationTreeNode);*/
 			
 		}
 		
 		public void AddProjectConfiguration()
-		{
+		{/*
 			int    number  = -1;
 			string name    = "New Configuration"; // don't localize this project configs should have per default an english name
 			string newName = name;
@@ -95,11 +97,11 @@
 			configurationTreeNode.Nodes.Add(newNode);
 			((TreeView)ControlDictionary["optionsTreeView"]).SelectedNode = newNode;
 			((TreeView)ControlDictionary["optionsTreeView"]).LabelEdit    = true;
-			newNode.BeginEdit();
+			newNode.BeginEdit();*/
 		}
 		
 		public void RemoveProjectConfiguration()
-		{
+		{/*
 			IConfiguration config = (IConfiguration)((TreeView)ControlDictionary["optionsTreeView"]).SelectedNode.Tag;
 			if (project.Configurations.Count > 1) {
 				bool newActiveConfig = project.ActiveConfiguration == config;
@@ -108,38 +110,38 @@
 				((TreeView)ControlDictionary["optionsTreeView"]).Nodes.Remove(((TreeView)ControlDictionary["optionsTreeView"]).SelectedNode);
 				UpdateBoldConfigurationNode();
 				configurationTreeNode.Expand();
-			}
+			}*/
 		}
 		
 		void UpdateBoldConfigurationNode()
-		{
+		{/*
 			foreach (TreeNode node in configurationTreeNode.Nodes) {
 				if (node == ((TreeView)ControlDictionary["optionsTreeView"]).SelectedNode) {
 					node.NodeFont = boldFont;
 				} else {
 					node.NodeFont = plainFont;
 				}
-			}
+			}*/
 		}
 		
 		public void SetSelectedConfigurationAsStartup()
-		{
+		{/*
 			IConfiguration config = ((TreeView)ControlDictionary["optionsTreeView"]).SelectedNode.Tag as IConfiguration;
 			if (config != null) {
 				project.ActiveConfiguration = config;
 				UpdateBoldConfigurationNode();
-			}
+			}*/
 		}
 		
 		public void RenameProjectConfiguration()
 		{
-			((TreeView)ControlDictionary["optionsTreeView"]).LabelEdit    = true;
-			((TreeView)ControlDictionary["optionsTreeView"]).SelectedNode.BeginEdit();
+			//((TreeView)ControlDictionary["optionsTreeView"]).LabelEdit    = true;
+			//((TreeView)ControlDictionary["optionsTreeView"]).SelectedNode.BeginEdit();
 		}
 		
-		void AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
+		/*void AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 		{
-			((TreeView)ControlDictionary["optionsTreeView"]).LabelEdit = false;
+			//((TreeView)ControlDictionary["optionsTreeView"]).LabelEdit = false;
 			
 			// canceled edit (or empty name)
 			if (e.Label == null || e.Label.Length == 0) {
@@ -159,12 +161,12 @@
 				e.Node.Text = e.Label;
 				((IConfiguration)e.Node.Tag).Name = e.Label;
 			}
-		}
+		}*/
 		
 		static string configNodeMenu = "/SharpDevelop/Workbench/ProjectOptions/ConfigNodeMenu";
 		static string selectConfigNodeMenu = "/SharpDevelop/Workbench/ProjectOptions/SelectedConfigMenu";
 		
-		void TreeViewMouseUp(object sender, MouseEventArgs e)
+		/*void TreeViewMouseUp(object sender, MouseEventArgs e)
 		{
 			TreeNode clickedNode = ((TreeView)ControlDictionary["optionsTreeView"]).GetNodeAt(e.X, e.Y);
 			
@@ -183,6 +185,6 @@
 					menuService.ShowContextMenu(this, selectConfigNodeMenu, this, e.X, e.Y);
 				}
 			}
-		}
-	}*/
+		}*/
+	}
 }

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/TreeViewOptions.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/TreeViewOptions.cs	2004-01-19 03:55:17 UTC (rev 561)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/TreeViewOptions.cs	2004-01-19 04:13:08 UTC (rev 562)
@@ -93,7 +93,12 @@
 			TreeViewOptionDialog.Hide ();
 			//DialogResult = DialogResult.OK;
 		}
-		
+	
+		public int Run ()
+		{
+			return TreeViewOptionDialog.Run ();
+		}
+	
 		protected bool b = true;
 		
 		protected void SetOptionPanelTo(IDialogPanelDescriptor descriptor)




More information about the Monodevelop-patches-list mailing list