[Monodevelop-patches-list] r1200 - in trunk/MonoDevelop: . build/AddIns data/resources/glade gdldock/gdl src/Main/Base src/Main/Base/Commands src/Main/Base/Gui src/Main/Base/Gui/Dialogs src/Main/Base/Gui/Workbench/Layouts

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Sat Mar 20 00:17:14 EST 2004


Author: ggiraldez
Date: 2004-03-20 00:17:14 -0500 (Sat, 20 Mar 2004)
New Revision: 1200

Added:
   trunk/MonoDevelop/gdldock/gdl/DockLayout.custom
   trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/NewLayoutDialog.cs
Modified:
   trunk/MonoDevelop/ChangeLog
   trunk/MonoDevelop/build/AddIns/SharpDevelopCore.addin
   trunk/MonoDevelop/data/resources/glade/Base.glade
   trunk/MonoDevelop/gdldock/gdl/Gdl.metadata
   trunk/MonoDevelop/gdldock/gdl/Makefile.am
   trunk/MonoDevelop/src/Main/Base/Commands/MenuItemBuilders.cs
   trunk/MonoDevelop/src/Main/Base/Commands/ToolsCommands.cs
   trunk/MonoDevelop/src/Main/Base/Gui/IWorkbenchLayout.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
   trunk/MonoDevelop/src/Main/Base/Makefile.am
Log:
2004-03-20  Gustavo Gir?\195?\161ldez  <gustavo.giraldez at gmx.net>

	* gdldock/gdl/Makefile.am: 
	* gdldock/gdl/Gdl.metadata: 
	* gdldock/gdl/DockLayout.custom: Provide a customized GetLayouts
	to return a string[] instead of a GLib.List.
	* src/Main/Base/Gui/IWorkbenchLayout.cs:
	* src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs:
	Support for different sets of layouts depending on the workbench
	context.  Implement Layouts property.  Layouts are saved to the
	xml file with fully qualified names such as "Context.Layout
	name".  CurrentLayout hides the context prefix, so the value
	set/retrieved is just the layout name.
	* data/resources/glade/Base.glade:
	* src/Main/Base/Gui/Dialogs/NewLayoutDialog.cs: New dialog used to
	retrieve the name of the layout being created.
	* src/Main/Base/Makefile.am: Add NewLayoutDialog.cs to the build.
	* build/AddIns/SharpDevelopCore.addin:
	* src/Main/Base/Commands/ToolsCommands.cs:
	* src/Main/Base/Commands/MenuItemBuilders.cs: Add layouts menu.



Modified: trunk/MonoDevelop/ChangeLog
===================================================================
--- trunk/MonoDevelop/ChangeLog	2004-03-20 04:28:51 UTC (rev 1199)
+++ trunk/MonoDevelop/ChangeLog	2004-03-20 05:17:14 UTC (rev 1200)
@@ -1,3 +1,24 @@
+2004-03-20  Gustavo Giráldez  <gustavo.giraldez at gmx.net>
+
+	* gdldock/gdl/Makefile.am: 
+	* gdldock/gdl/Gdl.metadata: 
+	* gdldock/gdl/DockLayout.custom: Provide a customized GetLayouts
+	to return a string[] instead of a GLib.List.
+	* src/Main/Base/Gui/IWorkbenchLayout.cs:
+	* src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs:
+	Support for different sets of layouts depending on the workbench
+	context.  Implement Layouts property.  Layouts are saved to the
+	xml file with fully qualified names such as "Context.Layout
+	name".  CurrentLayout hides the context prefix, so the value
+	set/retrieved is just the layout name.
+	* data/resources/glade/Base.glade:
+	* src/Main/Base/Gui/Dialogs/NewLayoutDialog.cs: New dialog used to
+	retrieve the name of the layout being created.
+	* src/Main/Base/Makefile.am: Add NewLayoutDialog.cs to the build.
+	* build/AddIns/SharpDevelopCore.addin:
+	* src/Main/Base/Commands/ToolsCommands.cs:
+	* src/Main/Base/Commands/MenuItemBuilders.cs: Add layouts menu.
+
 2004-03-20	John BouAntoun  <jba-mono at optusnet.com.au>
 
 	* src/Main/Base/Commands/MenuItemBuilders.cs : made it prompt 

Modified: trunk/MonoDevelop/build/AddIns/SharpDevelopCore.addin
===================================================================
--- trunk/MonoDevelop/build/AddIns/SharpDevelopCore.addin	2004-03-20 04:28:51 UTC (rev 1199)
+++ trunk/MonoDevelop/build/AddIns/SharpDevelopCore.addin	2004-03-20 05:17:14 UTC (rev 1200)
@@ -712,7 +712,13 @@
 	        
 	        <MenuItem id = "View" label = "${res:XML.MainMenu.ViewMenu}">
 	                <MenuItem id = "ViewBuilder" label = "" class = "MonoDevelop.Commands.ViewMenuBuilder" />
-	                <MenuItem id = "ViewItemsSeparator" label = "-" /> 
+	                <MenuItem id = "ViewItemsSeparator" label = "-" />
+			<MenuItem id = "ViewLayouts" label = "Layouts">
+				  <MenuItem id = "ViewLayoutsBuilder" label = "" class = "MonoDevelop.Commands.LayoutsMenuBuilder" />
+				  <MenuItem id = "ViewLayoutsSeparator" label = "-" />
+				  <MenuItem id = "ViewLayoutsNew" label = "New" class = "MonoDevelop.Commands.NewLayoutCommand" />
+			</MenuItem>
+	                <MenuItem id = "ViewItemsSeparator2" label = "-" />
 			<MenuItem id = "FullScreen"
 	                          label = "${res:XML.MainMenu.ViewMenu.FullScreen}" 
 	                          icon = "Icons.16x16.FullScreen" 

Modified: trunk/MonoDevelop/data/resources/glade/Base.glade
===================================================================
--- trunk/MonoDevelop/data/resources/glade/Base.glade	2004-03-20 04:28:51 UTC (rev 1199)
+++ trunk/MonoDevelop/data/resources/glade/Base.glade	2004-03-20 05:17:14 UTC (rev 1200)
@@ -4380,4 +4380,116 @@
   </child>
 </widget>
 
+<widget class="GtkDialog" id="newLayoutDialog">
+  <property name="border_width">6</property>
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">New layout</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">False</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="has_separator">False</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox4">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">6</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="dialog-action_area4">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="cancelButton">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-cancel</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="response_id">-6</property>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="newButton">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="has_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-new</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="response_id">-5</property>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkHBox" id="hbox45">
+	  <property name="border_width">6</property>
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">6</property>
+
+	  <child>
+	    <widget class="GtkLabel" id="label72">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">Layout name:</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0.5</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkEntry" id="layoutName">
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="editable">True</property>
+	      <property name="visibility">True</property>
+	      <property name="max_length">0</property>
+	      <property name="text" translatable="yes"></property>
+	      <property name="has_frame">True</property>
+	      <property name="invisible_char" translatable="yes">*</property>
+	      <property name="activates_default">True</property>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
 </glade-interface>

Added: trunk/MonoDevelop/gdldock/gdl/DockLayout.custom
===================================================================
--- trunk/MonoDevelop/gdldock/gdl/DockLayout.custom	2004-03-20 04:28:51 UTC (rev 1199)
+++ trunk/MonoDevelop/gdldock/gdl/DockLayout.custom	2004-03-20 05:17:14 UTC (rev 1200)
@@ -0,0 +1,18 @@
+// DockLayout.custom - customizations to Gdl.DockLayout
+//
+// Authors: Gustavo Giráldez  <gustavo.giraldez at gmx.net>
+
+[DllImport("gdldock")]
+static extern IntPtr gdl_dock_layout_get_layouts(IntPtr raw, bool include_default);
+
+public string[] GetLayouts(bool include_default) {
+	IntPtr list_ptr = gdl_dock_layout_get_layouts(Handle, include_default);
+	GLib.List list = new GLib.List (list_ptr, typeof (string));
+
+	// FIXME: list elements are leaked
+	string[] result = new string [list.Count];
+	for (int i = 0; i < list.Count; i++)
+		result [i] = list [i] as string;
+	
+	return result;
+}

Modified: trunk/MonoDevelop/gdldock/gdl/Gdl.metadata
===================================================================
--- trunk/MonoDevelop/gdldock/gdl/Gdl.metadata	2004-03-20 04:28:51 UTC (rev 1199)
+++ trunk/MonoDevelop/gdldock/gdl/Gdl.metadata	2004-03-20 05:17:14 UTC (rev 1200)
@@ -1,6 +1,7 @@
 <metadata>
   <attr path="/api/namespace/object[@cname='GdlDockObject']/signal[@name='Detach']" name="name">Detached</attr>
   <attr path="/api/namespace/object[@cname='GdlDockObject']/signal[@name='Dock']" name="name">Docked</attr>
+  <attr path="/api/namespace/object[@cname='GdlDockLayout']/method[@name='GetLayouts']" name="hidden">1</attr>
   <attr path="/api/namespace/enum[@cname='GdlDockItemFlags']" name="hidden">1</attr>
   <attr path="/api/namespace/enum[@cname='GdlDockParamFlags']" name="hidden">1</attr>
 </metadata>

Modified: trunk/MonoDevelop/gdldock/gdl/Makefile.am
===================================================================
--- trunk/MonoDevelop/gdldock/gdl/Makefile.am	2004-03-20 04:28:51 UTC (rev 1199)
+++ trunk/MonoDevelop/gdldock/gdl/Makefile.am	2004-03-20 05:17:14 UTC (rev 1200)
@@ -6,17 +6,17 @@
 	@gtksharp_prefix@/share/gapi/gdk-api.xml \
 	@gtksharp_prefix@/share/gapi/gtk-api.xml \
 	@gtksharp_prefix@/share/gapi/atk-api.xml
-	
+
 all: $(ASSEMBLY)
 
-gdl-api.xml:
+gdl-api.xml: $(srcdir)/gdl-api.raw $(srcdir)/Gdl.metadata
 	cp $(srcdir)/gdl-api.raw gdl-api.xml
 	chmod u+w gdl-api.xml
 	gapi-fixup --api=gdl-api.xml --metadata=$(srcdir)/Gdl.metadata
 
 generated-stamp: gdl-api.xml
 	gapi-codegen --generate gdl-api.xml --include $(INCLUDE_APIS) --outdir=generated --customdir=$(srcdir) --assembly-name=gdl-sharp && touch generated-stamp
- 
+
 $(ASSEMBLY): generated-stamp ../../build/bin
 	$(MCS) --unsafe --target library \
 	-r glib-sharp -r gtk-sharp -r gdk-sharp \
@@ -28,7 +28,7 @@
 
 gdldocklibdir = $(prefix)/lib/monodevelop/bin
 gdldocklib_DATA = $(ASSEMBLY)
- 
+
 clean:
 	rm -f $(ASSEMBLY)
 	rm -f generated-stamp
@@ -36,5 +36,5 @@
 
 CLEANFILES=$(ASSEMBLY) generated-stamp generated/* gdl-api.xml
 
-EXTRA_DIST = gdl-api.raw Gdl.metadata DockItemFlags.cs DockParamFlags.cs
+EXTRA_DIST = gdl-api.raw Gdl.metadata DockItemFlags.cs DockParamFlags.cs DockLayout.custom
 

Modified: trunk/MonoDevelop/src/Main/Base/Commands/MenuItemBuilders.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/MenuItemBuilders.cs	2004-03-20 04:28:51 UTC (rev 1199)
+++ trunk/MonoDevelop/src/Main/Base/Commands/MenuItemBuilders.cs	2004-03-20 05:17:14 UTC (rev 1200)
@@ -377,4 +377,50 @@
 			return (Gtk.MenuItem[])items.ToArray(typeof(Gtk.MenuItem));
 		}
 	}
+
+	public class LayoutsMenuBuilder : ISubmenuBuilder
+	{
+		class MyMenuItem : SdMenuCheckBox
+		{
+			string layoutName;
+			
+			bool IsCurrentLayout {
+				get {
+					return (WorkbenchSingleton.Workbench.WorkbenchLayout.CurrentLayout == layoutName);
+				}
+			}
+			
+			public MyMenuItem (string name) : base (null, null, name)
+			{
+				this.layoutName = name;
+				Active = IsCurrentLayout;
+				Toggled += new EventHandler (OnClick);
+			}
+			
+			protected new void OnClick(object o, EventArgs e)
+			{
+				WorkbenchSingleton.Workbench.WorkbenchLayout.CurrentLayout = layoutName;
+			}
+			public override  void UpdateStatus()
+			{
+				base.UpdateStatus();
+			}
+		}
+		
+		public Gtk.MenuItem[] BuildSubmenu(ConditionCollection conditionCollection, object owner)
+		{
+			ArrayList items = new ArrayList();
+			IWorkbench wb = WorkbenchSingleton.Workbench;
+			if (wb.WorkbenchLayout != null)
+			{
+				string[] layouts = wb.WorkbenchLayout.Layouts;
+				Array.Sort (layouts);
+				foreach (string layout in layouts) {
+					items.Add (new MyMenuItem (layout));
+				}
+			}
+			
+			return (Gtk.MenuItem[]) items.ToArray (typeof (Gtk.MenuItem));
+		}
+	}
 }

Modified: trunk/MonoDevelop/src/Main/Base/Commands/ToolsCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/ToolsCommands.cs	2004-03-20 04:28:51 UTC (rev 1199)
+++ trunk/MonoDevelop/src/Main/Base/Commands/ToolsCommands.cs	2004-03-20 05:17:14 UTC (rev 1200)
@@ -43,5 +43,12 @@
 		}
 	}
 	
-	
+	public class NewLayoutCommand : AbstractMenuCommand
+	{
+		public override void Run()
+		{
+			NewLayoutDialog dlg = new NewLayoutDialog ();
+			dlg.Run ();
+		}
+	}
 }

Added: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/NewLayoutDialog.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/NewLayoutDialog.cs	2004-03-20 04:28:51 UTC (rev 1199)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/NewLayoutDialog.cs	2004-03-20 05:17:14 UTC (rev 1200)
@@ -0,0 +1,60 @@
+// NewLayoutDialog.cs
+//
+// Authors: Gustavo Giráldez  <gustavo.giraldez at gmx.net>
+
+using System;
+
+using Gtk;
+
+using MonoDevelop.Gui;
+
+namespace MonoDevelop.Gui.Dialogs
+{
+	public class NewLayoutDialog
+	{
+		IWorkbenchLayout wbLayout = WorkbenchSingleton.Workbench.WorkbenchLayout;
+		string[] existentLayouts;
+
+		[Glade.Widget] Entry layoutName;
+		[Glade.Widget] Button cancelButton;
+		[Glade.Widget] Button newButton;
+		[Glade.Widget] Dialog newLayoutDialog;
+
+		public NewLayoutDialog ()
+		{
+			Glade.XML xml = new Glade.XML (null, "Base.glade",
+			                               "newLayoutDialog", null);
+			xml.Autoconnect (this);
+			
+			newButton.Sensitive = false;
+			newButton.GrabDefault ();
+			
+			layoutName.Changed += new EventHandler (OnNameChanged);
+
+			if (wbLayout != null)
+				existentLayouts = wbLayout.Layouts;
+		}
+
+		void OnNameChanged (object obj, EventArgs args)
+		{
+			newButton.Sensitive = (layoutName.Text != "" &&
+			                       Array.IndexOf (existentLayouts, layoutName.Text) == -1);
+		}
+
+		public void Run ()
+		{
+			if (wbLayout == null)
+				return;
+			
+			ResponseType response = (ResponseType) newLayoutDialog.Run ();
+			switch (response)
+			{
+			case ResponseType.Ok:
+				wbLayout.CurrentLayout = layoutName.Text;
+				break;
+			}
+
+			newLayoutDialog.Destroy ();
+		}
+	}
+}

Modified: trunk/MonoDevelop/src/Main/Base/Gui/IWorkbenchLayout.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/IWorkbenchLayout.cs	2004-03-20 04:28:51 UTC (rev 1199)
+++ trunk/MonoDevelop/src/Main/Base/Gui/IWorkbenchLayout.cs	2004-03-20 05:17:14 UTC (rev 1200)
@@ -29,12 +29,22 @@
 			get;
 		}
 
+		/// <summary>
+		/// The name of the active layout.
+		/// </summary>
 		string CurrentLayout {
 			get;
 			set;
 		}
-		
+
 		/// <summary>
+		/// A list of the currently available layouts for the current workbench context.
+		/// </summary>
+		string[] Layouts {
+			get;
+		}
+
+		/// <summary>
 		/// Attaches this layout manager to a workbench object.
 		/// </summary>
 		void Attach(IWorkbench workbench);

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs	2004-03-20 04:28:51 UTC (rev 1199)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs	2004-03-20 05:17:14 UTC (rev 1200)
@@ -29,9 +29,17 @@
 	{
 		static PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
 		static string configFile = propertyService.ConfigDirectory + "DefaultEditingLayout.xml";
-		private string currentLayout = "";
 
+		// contains the fully qualified name of the current layout (ie. Edit.Default)
+		string currentLayout = "";
+		// list of layout names for the current context, without the context prefix
+		ArrayList layouts = new ArrayList ();
+
 		private IWorkbench workbench;
+
+		// current workbench context
+		WorkbenchContext workbenchContext;
+		
 		Window wbWindow;
 		Container rootWidget;
 		Container toolbarContainer;
@@ -114,6 +122,7 @@
 				dock.AddItem (item, DockPlacement.Left);
 			}
 			// by default, the active pad collection is the full set
+			// will be overriden in CreateDefaultLayout() below
 			activePadCollection = workbench.PadContentCollection;
 
 			// FIXME: GTKize
@@ -129,13 +138,13 @@
 
 		void onContextChanged (object o, EventArgs e)
 		{
-			WorkbenchContext ctxt = workbench.Context;
-			Console.WriteLine ("Workbench changed context to " + ctxt);
-			SwitchContext (ctxt);
+			SwitchContext (workbench.Context);
 		}
 
 		void SwitchContext (WorkbenchContext ctxt)
 		{
+			PropertyService propertyService =
+				(PropertyService) ServiceManager.Services.GetService (typeof (PropertyService));
 			PadContentCollection old = activePadCollection;
 			
 			// switch pad collections
@@ -145,19 +154,23 @@
 				// this is so, for unkwown contexts, we get the full set of pads
 				activePadCollection = workbench.PadContentCollection;
 
-			switch (ctxt)
-			{
-			case WorkbenchContext.Debug:
-				CurrentLayout = "Debug";
-				break;
+			workbenchContext = ctxt;
+			
+			// get the list of layouts
+			string ctxtPrefix = ctxt.ToString () + ".";
+			string[] list = dockLayout.GetLayouts (false);
 
-			default:
-			case WorkbenchContext.Edit:
-				CurrentLayout = "Default";
-				break;
-
+			layouts.Clear ();
+			foreach (string name in list) {
+				if (name.StartsWith (ctxtPrefix)) {
+					layouts.Add (name.Substring (ctxtPrefix.Length));
+				}
 			}
 			
+			// get the default layout for the new context from the property service
+			CurrentLayout = propertyService.GetProperty
+				("MonoDevelop.Gui.SdiWorkbenchLayout." + ctxt.ToString (), "Default");
+			
 			// make sure invalid pads for the new context are not visible
 			foreach (IPadContent content in old)
 			{
@@ -175,24 +188,51 @@
 		}
 		
 		public string CurrentLayout {
-			get
-			{
-				return currentLayout;
+			get {
+				return currentLayout.Substring (currentLayout.IndexOf (".") + 1);
 			}
-			set
-			{
+			set {
+				// save previous layout first
 				if (currentLayout != "")
 					dockLayout.SaveLayout (currentLayout);
 				
-				currentLayout = value;
+				string newLayout = workbench.Context.ToString () + "." + value;
 
-				if (!dockLayout.LoadLayout (value))
-					// if the "Default" layout doesn't exists, load the real default
-					// so old layout xml files work smoothly
-					dockLayout.LoadLayout (null);
+				if (layouts.Contains (value))
+				{
+					dockLayout.LoadLayout (newLayout);
+				}
+				else
+				{
+					if (currentLayout == "")
+						// if the layout doesn't exists and we need to
+						// load a layout (ie.  we've just been
+						// created), load the default so old layout
+						// xml files work smoothly
+						dockLayout.LoadLayout (null);
+					
+					// the layout didn't exist, so save it and add it to our list
+					dockLayout.SaveLayout (newLayout);
+					layouts.Add (value);
+				}
+				currentLayout = newLayout;
+
+				// persist the selected layout for the current context
+				PropertyService propertyService =
+					(PropertyService) ServiceManager.Services.GetService (typeof (PropertyService));
+				propertyService.SetProperty ("MonoDevelop.Gui.SdiWorkbenchLayout." +
+				                             workbenchContext.ToString (), value);
 			}
 		}
 
+		public string[] Layouts {
+			get {
+				string[] result = new string [layouts.Count];
+				layouts.CopyTo (result);
+				return result;
+			}
+		}
+
 		// pad collection for the current workbench context
 		PadContentCollection activePadCollection;
 

Modified: trunk/MonoDevelop/src/Main/Base/Makefile.am
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Makefile.am	2004-03-20 04:28:51 UTC (rev 1199)
+++ trunk/MonoDevelop/src/Main/Base/Makefile.am	2004-03-20 05:17:14 UTC (rev 1200)
@@ -106,6 +106,7 @@
 ./Gui/Dialogs/InputBox.cs \
 ./Gui/Dialogs/NewFileDialog.cs \
 ./Gui/Dialogs/ProjectOptionsDialog.cs \
+./Gui/Dialogs/NewLayoutDialog.cs \
 ./Gui/ContentInterfaces/IBookmarkOperations.cs \
 ./Gui/ContentInterfaces/IClipboardHandler.cs \
 ./Gui/ContentInterfaces/IPrintable.cs \




More information about the Monodevelop-patches-list mailing list