[Monodevelop-patches-list] r726 - in trunk/MonoDevelop: data/resources/glade src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Fri Jan 30 18:19:42 EST 2004


Author: dkor
Date: 2004-01-30 18:19:42 -0500 (Fri, 30 Jan 2004)
New Revision: 726

Modified:
   trunk/MonoDevelop/data/resources/glade/Base.glade
   trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/ProjectAndCombinePanel.cs
Log:
Gladed the ProjectAndCombinePanel

Modified: trunk/MonoDevelop/data/resources/glade/Base.glade
===================================================================
--- trunk/MonoDevelop/data/resources/glade/Base.glade	2004-01-30 21:55:07 UTC (rev 725)
+++ trunk/MonoDevelop/data/resources/glade/Base.glade	2004-01-30 23:19:42 UTC (rev 726)
@@ -931,7 +931,7 @@
 	      <property name="spacing">0</property>
 
 	      <child>
-		<widget class="GtkLabel" id="label16">
+		<widget class="GtkLabel" id="label27">
 		  <property name="visible">True</property>
 		  <property name="label" translatable="yes">    </property>
 		  <property name="use_underline">False</property>
@@ -1656,4 +1656,418 @@
   </child>
 </widget>
 
+<widget class="GtkWindow" id="ProjectAndCombinePanel">
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">ProjectAndCombinePanel</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">True</property>
+  <property name="destroy_with_parent">False</property>
+
+  <child>
+    <widget class="GtkVBox" id="vbox23">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">6</property>
+
+      <child>
+	<widget class="GtkVBox" id="vbox24">
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">6</property>
+
+	  <child>
+	    <widget class="GtkLabel" id="settingsLabel">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">&lt;b&gt;Settings-&lt;/b&gt;</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">True</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</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="GtkHBox" id="hbox15">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">6</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label26">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">    </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="GtkVBox" id="vbox26">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">6</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="locationLabel">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Default _combine location-</property>
+		      <property name="use_underline">True</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</property>
+		      <property name="yalign">0</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="GnomeFileEntry" id="projectLocationTextBox">
+		      <property name="visible">True</property>
+		      <property name="max_saved">10</property>
+		      <property name="directory_entry">False</property>
+		      <property name="modal">False</property>
+
+		      <child internal-child="entry">
+			<widget class="GtkEntry" id="combo-entry1">
+			  <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">False</property>
+			</widget>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkCheckButton" id="loadPrevProjectCheckBox">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">_Load previous combine on startup-</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+		</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">False</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkVBox" id="vbox25">
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">6</property>
+
+	  <child>
+	    <widget class="GtkLabel" id="buildAndRunOptionsLabel">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">&lt;b&gt;Build And Run Options-&lt;/b&gt;</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">True</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</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="GtkHBox" id="hbox16">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label28">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">    </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="GtkVBox" id="vbox27">
+		  <property name="border_width">6</property>
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkVBox" id="vbox28">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">6</property>
+
+		      <child>
+			<widget class="GtkHBox" id="hbox17">
+			  <property name="visible">True</property>
+			  <property name="homogeneous">False</property>
+			  <property name="spacing">6</property>
+
+			  <child>
+			    <widget class="GtkLabel" id="label32">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">    </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="GtkVBox" id="vbox29">
+			      <property name="border_width">6</property>
+			      <property name="visible">True</property>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">0</property>
+
+			      <child>
+				<widget class="GtkRadioButton" id="saveChangesRadioButton">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="label" translatable="yes">_Save Changes to open documents-</property>
+				  <property name="use_underline">True</property>
+				  <property name="relief">GTK_RELIEF_NORMAL</property>
+				  <property name="active">False</property>
+				  <property name="inconsistent">False</property>
+				  <property name="draw_indicator">True</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkRadioButton" id="promptChangesRadioButton">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="label" translatable="yes">_Prompt to save changes to open documents-</property>
+				  <property name="use_underline">True</property>
+				  <property name="relief">GTK_RELIEF_NORMAL</property>
+				  <property name="active">False</property>
+				  <property name="inconsistent">False</property>
+				  <property name="draw_indicator">True</property>
+				  <property name="group">saveChangesRadioButton</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkRadioButton" id="noSaveRadioButton">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="label" translatable="yes">_Don't save changes to open documents -</property>
+				  <property name="use_underline">True</property>
+				  <property name="relief">GTK_RELIEF_NORMAL</property>
+				  <property name="active">False</property>
+				  <property name="inconsistent">False</property>
+				  <property name="draw_indicator">True</property>
+				  <property name="group">saveChangesRadioButton</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">True</property>
+			    </packing>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkVBox" id="vbox30">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkCheckButton" id="showOutputCheckBox">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">Show _task list pad if build finished with errors-</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">True</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkCheckButton" id="showTaskListCheckBox">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">Show _output pad when build starts-</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
 </glade-interface>

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/ProjectAndCombinePanel.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/ProjectAndCombinePanel.cs	2004-01-30 21:55:07 UTC (rev 725)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/ProjectAndCombinePanel.cs	2004-01-30 23:19:42 UTC (rev 726)
@@ -20,126 +20,124 @@
 
 //using System.Windows.Forms;
 using Gtk;
+using MonoDevelop.Gui.Widgets;
 
 namespace ICSharpCode.SharpDevelop.Gui.Dialogs.OptionPanels
 {
 	public class ProjectAndCombinePanel : AbstractOptionPanel
 	{
-		//
-		// Gtk controls
-		//
-		Gnome.FileEntry projectLocationTextBox;
-		Gtk.RadioButton saveChangesRadioButton;
-		Gtk.RadioButton promptChangesRadioButton;
-		Gtk.RadioButton noSaveRadioButton;
-		Gtk.CheckButton loadPrevProjectCheckBox;
-		Gtk.CheckButton showTaskListCheckBox;
-		Gtk.CheckButton showOutputCheckBox;
-		
 		// service instances needed
-		StringParserService StringParserService = (StringParserService)ServiceManager.Services.GetService (typeof (StringParserService));
 		PropertyService PropertyService = (PropertyService)ServiceManager.Services.GetService (typeof (PropertyService));
 		FileUtilityService FileUtilityService = (FileUtilityService)ServiceManager.Services.GetService (typeof (FileUtilityService));
 		MessageService MessageService = (MessageService)ServiceManager.Services.GetService (typeof (MessageService));
-		
+		ProjectAndCombinePanelWidget widget;
+		const string projectAndCombineProperty = "SharpDevelop.UI.ProjectAndCombineOptions";
+
 		public override void LoadPanelContents()
 		{
-			// set up the form controls instance
-			SetupPanelInstance();
-			
-			// read properties
-			projectLocationTextBox.GtkEntry.Text = PropertyService.GetProperty("ICSharpCode.SharpDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath", System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "SharpDevelop Projects")).ToString();
-			
-			BeforeCompileAction action = (BeforeCompileAction)PropertyService.GetProperty("SharpDevelop.Services.DefaultParserService.BeforeCompileAction", BeforeCompileAction.SaveAllFiles);
-			
-			saveChangesRadioButton.Active = action.Equals(BeforeCompileAction.SaveAllFiles);
-			promptChangesRadioButton.Active = action.Equals(BeforeCompileAction.PromptForSave);
-			noSaveRadioButton.Active = action.Equals(BeforeCompileAction.Nothing);
-			
-			loadPrevProjectCheckBox.Active = (bool)PropertyService.GetProperty("SharpDevelop.LoadPrevProjectOnStartup", false);
-
-			showTaskListCheckBox.Active = (bool)PropertyService.GetProperty("SharpDevelop.ShowTaskListAfterBuild", true);
-			showOutputCheckBox.Active = (bool)PropertyService.GetProperty("SharpDevelop.ShowOutputWindowAtBuild", true);
-			
+			IProperties p = (IProperties) PropertyService.GetProperty (projectAndCombineProperty, new DefaultProperties ());
+			Add (widget = new  ProjectAndCombinePanelWidget (p));
 		}
 		
 		public override bool StorePanelContents()
 		{
+			IProperties p = (IProperties) PropertyService.GetProperty (projectAndCombineProperty, new DefaultProperties ());
+
 			// check for correct settings
-			string projectPath = projectLocationTextBox.GtkEntry.Text;
+			string projectPath = widget.projectLocationTextBox.GtkEntry.Text;
 			if (projectPath.Length > 0) {
 				if (!FileUtilityService.IsValidFileName(projectPath)) {
 					MessageService.ShowError("Invalid project path specified");
 					return false;
 				}
 			}
-			
-			// set properties
-			PropertyService.SetProperty("ICSharpCode.SharpDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath", projectPath);
-			
-			if (saveChangesRadioButton.Active) {
-				PropertyService.SetProperty("SharpDevelop.Services.DefaultParserService.BeforeCompileAction", BeforeCompileAction.SaveAllFiles);
-			} else if (promptChangesRadioButton.Active) {
-				PropertyService.SetProperty("SharpDevelop.Services.DefaultParserService.BeforeCompileAction", BeforeCompileAction.PromptForSave);
-			} else if (noSaveRadioButton.Active) {
-				PropertyService.SetProperty("SharpDevelop.Services.DefaultParserService.BeforeCompileAction", BeforeCompileAction.Nothing);
-			}
-			
-			PropertyService.SetProperty("SharpDevelop.LoadPrevProjectOnStartup", loadPrevProjectCheckBox.Active);
-			
-			PropertyService.SetProperty("SharpDevelop.ShowTaskListAfterBuild", showTaskListCheckBox.Active);
-			PropertyService.SetProperty("SharpDevelop.ShowOutputWindowAtBuild", showOutputCheckBox.Active);
-			
+			p.SetProperty("ICSharpCode.SharpDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath", projectPath);
+
+			widget.Store (p);
+			PropertyService.SetProperty(projectAndCombineProperty, p);
 			return true;
 		}
 		
 		
-		private void SetupPanelInstance()
+		public class ProjectAndCombinePanelWidget :  GladeWidgetExtract 
 		{
-			Gtk.Frame frame1 = new Gtk.Frame(StringParserService.Parse("${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.SettingsGroupBox}"));
+			// service instances needed
+			StringParserService StringParserService = (StringParserService)ServiceManager.Services.GetService (typeof (StringParserService));
+
 			//
-			// set up the Project Settings options
+			// Gtk controls
 			//
-			// instantiate all the controls
-			Gtk.VBox vBox1 = new Gtk.VBox(false,2);
-			Gtk.Label label1 = new Gtk.Label(StringParserService.Parse("${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.ProjectLocationLabel}"));
-				// make the location text box and button
-				Gtk.HBox hBox1 = new Gtk.HBox(false,2);
-				projectLocationTextBox = new Gnome.FileEntry ("", "Choose Location");
+			[Glade.Widget] public Gnome.FileEntry projectLocationTextBox;
+			[Glade.Widget] public Gtk.RadioButton saveChangesRadioButton, promptChangesRadioButton, noSaveRadioButton;
+			[Glade.Widget] public Gtk.CheckButton loadPrevProjectCheckBox, showTaskListCheckBox, showOutputCheckBox;
+			[Glade.Widget] public Gtk.Label locationLabel, settingsLabel, buildAndRunOptionsLabel;   
+
+			public  ProjectAndCombinePanelWidget (IProperties p) : base ("Base.glade", "ProjectAndCombinePanel")
+			{
+				
+				settingsLabel.Markup = "<b> " + StringParserService.Parse(
+					"${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.SettingsGroupBox}") + "</b>";
+				//
+				// set up the Project Settings options
+				//
+				locationLabel.TextWithMnemonic = StringParserService.Parse(
+					"${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.ProjectLocationLabel}");
+				//projectLocationTextBox = new Gnome.FileEntry ("", "Choose Location");
 				projectLocationTextBox.DirectoryEntry = true;
-				hBox1.PackStart(projectLocationTextBox, true, true, 2);
-			loadPrevProjectCheckBox = new Gtk.CheckButton (StringParserService.Parse("${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.LoadPrevProjectCheckBox}"));
-			// pack them all
-			vBox1.PackStart(label1, false, false, 2);
-			vBox1.PackStart(hBox1, false, false, 2);
-			vBox1.PackStart(loadPrevProjectCheckBox, false, false, 2);
-			frame1.Add(vBox1);
+				loadPrevProjectCheckBox.Label = StringParserService.Parse(
+				"${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.LoadPrevProjectCheckBox}");
+			        //
+			        // setup the save options
+			        //
+				buildAndRunOptionsLabel.Markup = "<b> " + StringParserService.Parse(
+					"${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.BuildAndRunGroupBox}") + "</b>";
+				saveChangesRadioButton.Label = StringParserService.Parse(
+					"${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.SaveChangesRadioButton}");
+				promptChangesRadioButton.Label = StringParserService.Parse(
+					"${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.PromptToSaveRadioButton}");
+				noSaveRadioButton.Label = StringParserService.Parse(
+					"${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.DontSaveRadioButton}");
+				showOutputCheckBox.Label = StringParserService.Parse(
+					"${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.ShowOutputPadCheckBox}");
+				showTaskListCheckBox.Label = StringParserService.Parse(
+					"${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.ShowTaskListPadCheckBox}");
+				// read properties
+				projectLocationTextBox.GtkEntry.Text = p.GetProperty(
+					"ICSharpCode.SharpDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath", 
+					System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal),
+							"SharpDevelop Projects")).ToString();
+				BeforeCompileAction action = (BeforeCompileAction) p.GetProperty(
+					"SharpDevelop.Services.DefaultParserService.BeforeCompileAction", 
+					BeforeCompileAction.SaveAllFiles);
+				saveChangesRadioButton.Active = action.Equals(BeforeCompileAction.SaveAllFiles);
+				promptChangesRadioButton.Active = action.Equals(BeforeCompileAction.PromptForSave);
+				noSaveRadioButton.Active = action.Equals(BeforeCompileAction.Nothing);
+				loadPrevProjectCheckBox.Active = (bool)p.GetProperty(
+					"SharpDevelop.LoadPrevProjectOnStartup", false);
+				showTaskListCheckBox.Active = (bool)p.GetProperty(
+					"SharpDevelop.ShowTaskListAfterBuild", true);
+				showOutputCheckBox.Active = (bool)p.GetProperty(
+					"SharpDevelop.ShowOutputWindowAtBuild", true);
+			}
 			
-			//
-			// setup the save options
-			//
-			//instantiate all the controls
-			Gtk.Frame frame2 = new Gtk.Frame(StringParserService.Parse("${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.BuildAndRunGroupBox}"));
-			Gtk.VBox vBox2 = new Gtk.VBox(false, 2);
-			saveChangesRadioButton = new RadioButton(StringParserService.Parse("${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.SaveChangesRadioButton}"));
-			promptChangesRadioButton = new RadioButton(saveChangesRadioButton, StringParserService.Parse("${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.PromptToSaveRadioButton}"));
-			noSaveRadioButton = new RadioButton (promptChangesRadioButton, StringParserService.Parse("${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.DontSaveRadioButton}"));
-			showOutputCheckBox = new CheckButton (StringParserService.Parse("${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.ShowOutputPadCheckBox}"));;
-			showTaskListCheckBox = new CheckButton (StringParserService.Parse("${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.ShowTaskListPadCheckBox}"));
-			// pack them all
-			vBox2.PackStart(saveChangesRadioButton, false, false, 2);
-			vBox2.PackStart(promptChangesRadioButton, false, false, 2);
-			vBox2.PackStart(noSaveRadioButton, false, false, 2);
-			vBox2.PackStart(showOutputCheckBox, false, false, 2);
-			vBox2.PackStart(showTaskListCheckBox, false, false, 2);
-			frame2.Add(vBox2);
-			
-			// create the main box
-			Gtk.VBox mainBox = new Gtk.VBox(false, 2);
-			mainBox.PackStart(frame1, false, false, 2);
-			mainBox.PackStart(frame2, false, false, 2);
-			
-			this.Add(mainBox);		
-		}		
+			public void Store (IProperties p)
+			{
+				// set properties
+				if (saveChangesRadioButton.Active) {
+					p.SetProperty("SharpDevelop.Services.DefaultParserService.BeforeCompileAction", 
+							BeforeCompileAction.SaveAllFiles);
+				} else if (promptChangesRadioButton.Active) {
+					p.SetProperty("SharpDevelop.Services.DefaultParserService.BeforeCompileAction", 
+							BeforeCompileAction.PromptForSave);
+				} else if (noSaveRadioButton.Active) {
+					p.SetProperty("SharpDevelop.Services.DefaultParserService.BeforeCompileAction", 
+							BeforeCompileAction.Nothing);
+				}
+				
+				p.SetProperty("SharpDevelop.LoadPrevProjectOnStartup", loadPrevProjectCheckBox.Active);
+				p.SetProperty("SharpDevelop.ShowTaskListAfterBuild", showTaskListCheckBox.Active);
+				p.SetProperty("SharpDevelop.ShowOutputWindowAtBuild", showOutputCheckBox.Active);
+			}
+		}
 	}
 }




More information about the Monodevelop-patches-list mailing list