[Monodevelop-patches-list] r416 - trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Fri Jan 9 19:25:20 EST 2004


Author: jluke
Date: 2004-01-09 19:25:20 -0500 (Fri, 09 Jan 2004)
New Revision: 416

Modified:
   trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/ChooseLocationPanel.cs
   trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/SetupPanel.cs
Log:
update RadioButton stuff to Gtk# cvs


Modified: trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/ChooseLocationPanel.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/ChooseLocationPanel.cs	2004-01-09 19:54:22 UTC (rev 415)
+++ trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/ChooseLocationPanel.cs	2004-01-10 00:25:20 UTC (rev 416)
@@ -1,152 +1,149 @@
-// <file>
-//     <copyright see="prj:///doc/copyright.txt"/>
-//     <license see="prj:///doc/license.txt"/>
-//     <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
-//     <version value="$version"/>
-// </file>
-
-using System;
-using System.IO;
+// <file>
+//     <copyright see="prj:///doc/copyright.txt"/>
+//     <license see="prj:///doc/license.txt"/>
+//     <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
+//     <version value="$version"/>
+// </file>
+
+using System;
+using System.IO;
 using Gtk;
-using MonoDevelop.Gui;
-
-using ICSharpCode.SharpDevelop.Internal.Project;
-using ICSharpCode.Core.Properties;
-using ICSharpCode.Core.Services;
-
-using ICSharpCode.Core.AddIns.Codons;
-
-namespace ICSharpCode.SharpDevelop.Gui.Dialogs.OptionPanels.CompletionDatabaseWizard
-{
-	public class ChooseLocationPanel : AbstractWizardPanel
-	{
-		IProperties properties;
+using MonoDevelop.Gui;
+
+using ICSharpCode.SharpDevelop.Internal.Project;
+using ICSharpCode.Core.Properties;
+using ICSharpCode.Core.Services;
+
+using ICSharpCode.Core.AddIns.Codons;
+
+namespace ICSharpCode.SharpDevelop.Gui.Dialogs.OptionPanels.CompletionDatabaseWizard
+{
+	public class ChooseLocationPanel : AbstractWizardPanel
+	{
+		IProperties properties;
 		static FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
 		
 		Button browseButton;
 		RadioButton specifyLocationRadioButton;
 		RadioButton sharpDevelopDirRadioButton;
-		Entry locationTextBox = new Entry ();
-		
-		public override bool ReceiveDialogMessage(DialogMessage message)
-		{
-			//Console.WriteLine ("Inside ReceiveDialogMessage");
-			if (message == DialogMessage.Cancel) {
-				properties.SetProperty("SharpDevelop.CodeCompletion.DataDirectory", String.Empty);
-			} else if (message == DialogMessage.Next || message == DialogMessage.OK) {
-				string path = null;				
-				if (specifyLocationRadioButton.Active) {
-					path = locationTextBox.Text.TrimEnd (System.IO.Path.DirectorySeparatorChar);
-				} else if (sharpDevelopDirRadioButton.Active) {
-					FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
-					PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
-				
-					path = propertyService.DataDirectory + 
-					       System.IO.Path.DirectorySeparatorChar + "CodeCompletionData"; 
-				} else {
-					PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
-					path = propertyService.ConfigDirectory + "CodeCompletionTemp";
-				}
-				
-				if (!Directory.Exists(path)) {
-					Directory.CreateDirectory(path);
-				}
-				
-				//Console.WriteLine ("Setting path to: " + path);
-				properties.SetProperty("SharpDevelop.CodeCompletion.DataDirectory", path);
-				propertyService.SetProperty ("SharpDevelop.CodeCompletion.DataDirectory", path);
-				propertyService.SaveProperties ();
-			}
-	    		return true;
-		}
-		
-		void SetEnableStatus(object sender, EventArgs e)
+		Entry locationTextBox = new Entry ();
+		
+		public override bool ReceiveDialogMessage(DialogMessage message)
 		{
+			//Console.WriteLine ("Inside ReceiveDialogMessage");
+			if (message == DialogMessage.Cancel) {
+				properties.SetProperty("SharpDevelop.CodeCompletion.DataDirectory", String.Empty);
+			} else if (message == DialogMessage.Next || message == DialogMessage.OK) {
+				string path = null;				
+				if (specifyLocationRadioButton.Active) {
+					path = locationTextBox.Text.TrimEnd (System.IO.Path.DirectorySeparatorChar);
+				} else if (sharpDevelopDirRadioButton.Active) {
+					FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
+					PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
+				
+					path = propertyService.DataDirectory + 
+					       System.IO.Path.DirectorySeparatorChar + "CodeCompletionData"; 
+				} else {
+					PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
+					path = propertyService.ConfigDirectory + "CodeCompletionTemp";
+				}
+				
+				if (!Directory.Exists(path)) {
+					Directory.CreateDirectory(path);
+				}
+				
+				//Console.WriteLine ("Setting path to: " + path);
+				properties.SetProperty("SharpDevelop.CodeCompletion.DataDirectory", path);
+				propertyService.SetProperty ("SharpDevelop.CodeCompletion.DataDirectory", path);
+				propertyService.SaveProperties ();
+			}
+	    		return true;
+		}
+		
+		void SetEnableStatus(object sender, EventArgs e)
+		{
 			try
-			{
+			{
 				browseButton.Sensitive = locationTextBox.Sensitive = specifyLocationRadioButton.Active;
 			}
 			catch
 			{
 			}
-			
-			SetFinishedState(sender, e);
-		}
-		
-		void BrowseLocationEvent(object sender, EventArgs e)
+			
+			SetFinishedState(sender, e);
+		}
+		
+		void BrowseLocationEvent(object sender, EventArgs e)
 		{
 			FolderDialog fd = new FolderDialog ("choose the location in which you want the code completion files to be generated");
 			int response = fd.Run ();
-			fd.Hide ();
-			if (response == (int) ResponseType.Ok) {
-				locationTextBox.Text = fd.Filename;
-			}
-		}
-		
-		void SetFinishedState(object sender, EventArgs e)
-		{
+			fd.Hide ();
+			if (response == (int) ResponseType.Ok) {
+				locationTextBox.Text = fd.Filename;
+			}
+		}
+		
+		void SetFinishedState(object sender, EventArgs e)
+		{
 			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
 			try
-			{
-				EnableFinish = EnableNext = !specifyLocationRadioButton.Active ||
-  			                            (fileUtilityService.IsValidFileName(locationTextBox.Text) && 
+			{
+				EnableFinish = EnableNext = !specifyLocationRadioButton.Active ||
+  			                            (fileUtilityService.IsValidFileName(locationTextBox.Text) && 
   			                            Directory.Exists(locationTextBox.Text));
 			}
 			catch
 			{
-			}
-		}
-		
-		void SetValues(object sender, EventArgs e)
-		{
-			properties = (IProperties)CustomizationObject;
-		}
-		
-		static PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
-		
-		public ChooseLocationPanel() : base()
+			}
+		}
+		
+		void SetValues(object sender, EventArgs e)
 		{
-			VBox mainVBox = new VBox (false, 0);
-			NextWizardPanelID = "CreateDatabasePanel";
+			properties = (IProperties)CustomizationObject;
+		}
+		
+		static PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
+		
+		public ChooseLocationPanel() : base()
+		{
+			VBox mainVBox = new VBox (false, 0);
+			NextWizardPanelID = "CreateDatabasePanel";
 			
-			browseButton = new Button ("...");
+			browseButton = new Button ("...");
 			browseButton.Clicked += new EventHandler (BrowseLocationEvent);
-			
-			locationTextBox.Changed += new EventHandler (SetFinishedState);
 			
+			locationTextBox.Changed += new EventHandler (SetFinishedState);
+			
 			ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
 			
-			//RadioButton appDirRadioButton = new RadioButton ("Use current user's application directory");
-			RadioButton appDirRadioButton = RadioButton.NewWithLabel (null, "Use current user's application directory");
+			RadioButton appDirRadioButton = new RadioButton ("Use current user's application directory");
 			appDirRadioButton.Toggled += new EventHandler (SetEnableStatus);
-			sharpDevelopDirRadioButton = new RadioButton (appDirRadioButton);
+			sharpDevelopDirRadioButton = new RadioButton (appDirRadioButton, "Use SharpDevelop application directory");
 			sharpDevelopDirRadioButton.Active = true;
-			sharpDevelopDirRadioButton.Label = "Use SharpDevelop application directory";
 			sharpDevelopDirRadioButton.Toggled += new EventHandler (SetEnableStatus);
-			specifyLocationRadioButton = new RadioButton (appDirRadioButton);
-			specifyLocationRadioButton.Label = "Specify code completion database location";
-			specifyLocationRadioButton.Toggled += new EventHandler (SetEnableStatus);
-
-			TextView t = new TextView ();
-			t.Buffer.Text = resourceService.GetString ("Dialog.Wizards.CodeCompletionDatabaseWizard.ChooseLocationPanel.DescriptionText");
+			specifyLocationRadioButton = new RadioButton (appDirRadioButton, "Specify code completion database location");
+			specifyLocationRadioButton.Toggled += new EventHandler (SetEnableStatus);
+
+			TextView t = new TextView ();
+			t.Buffer.Text = resourceService.GetString ("Dialog.Wizards.CodeCompletionDatabaseWizard.ChooseLocationPanel.DescriptionText");
 			t.Editable = false;
-			t.CursorVisible = false;
+			t.CursorVisible = false;
 			t.WrapMode = Gtk.WrapMode.Word;
 			
 			HBox hbox = new HBox (false, 0);
 			hbox.PackStart (locationTextBox);
-			hbox.PackStart (browseButton, false, false, 3);
+			hbox.PackStart (browseButton, false, false, 3);
 		
 			mainVBox.PackStart (t, true, true, 0);
 			mainVBox.PackStart (specifyLocationRadioButton, false, true, 6);
 			mainVBox.PackStart (hbox, false, true, 6);
 			mainVBox.PackStart (sharpDevelopDirRadioButton, false, true, 6);
-			mainVBox.PackStart (appDirRadioButton, false, true, 6);
-			this.Add (mainVBox);
-		
-			SetFinishedState(this, EventArgs.Empty);
-			SetEnableStatus(this, EventArgs.Empty);
-			CustomizationObjectChanged += new EventHandler(SetValues);
-		}
-	}
-}
+			mainVBox.PackStart (appDirRadioButton, false, true, 6);
+			this.Add (mainVBox);
+		
+			SetFinishedState(this, EventArgs.Empty);
+			SetEnableStatus(this, EventArgs.Empty);
+			CustomizationObjectChanged += new EventHandler(SetValues);
+		}
+	}
+}

Modified: trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/SetupPanel.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/SetupPanel.cs	2004-01-09 19:54:22 UTC (rev 415)
+++ trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/SetupPanel.cs	2004-01-10 00:25:20 UTC (rev 416)
@@ -1,75 +1,71 @@
-// <file>
-//     <copyright see="prj:///doc/copyright.txt"/>
-//     <license see="prj:///doc/license.txt"/>
-//     <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
-//     <version value="$version"/>
-// </file>
-
-using System;
-using Gtk;
-
-using ICSharpCode.SharpDevelop.Internal.Project;
-using ICSharpCode.Core.Properties;
-
-using ICSharpCode.Core.Services;
-using ICSharpCode.Core.AddIns.Codons;
-
-namespace ICSharpCode.SharpDevelop.Gui.Dialogs.OptionPanels.CompletionDatabaseWizard
-{
-	public class SetupPanel : AbstractWizardPanel
-	{
+// <file>
+//     <copyright see="prj:///doc/copyright.txt"/>
+//     <license see="prj:///doc/license.txt"/>
+//     <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
+//     <version value="$version"/>
+// </file>
+
+using System;
+using Gtk;
+
+using ICSharpCode.SharpDevelop.Internal.Project;
+using ICSharpCode.Core.Properties;
+
+using ICSharpCode.Core.Services;
+using ICSharpCode.Core.AddIns.Codons;
+
+namespace ICSharpCode.SharpDevelop.Gui.Dialogs.OptionPanels.CompletionDatabaseWizard
+{
+	public class SetupPanel : AbstractWizardPanel
+	{
 		static FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
 		
 		RadioButton useExistingRadioButton;
 		RadioButton createNewRadioButton;
 		RadioButton skipCreationRadioButton;
-		
-		void SetSuccessor(object sender, EventArgs e)
-		{
-			IsLastPanel = skipCreationRadioButton.Active;
-			
-			if (createNewRadioButton.Active) {
-				NextWizardPanelID = "ChooseLocationPanel";
-			} else if (useExistingRadioButton.Active) {
-				NextWizardPanelID = "UseExistingFilePanel";
-			}
-		}
-		
-		static PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
-		
-		public SetupPanel() : base()
-		{
-			ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
+		
+		void SetSuccessor(object sender, EventArgs e)
+		{
+			IsLastPanel = skipCreationRadioButton.Active;
+			
+			if (createNewRadioButton.Active) {
+				NextWizardPanelID = "ChooseLocationPanel";
+			} else if (useExistingRadioButton.Active) {
+				NextWizardPanelID = "UseExistingFilePanel";
+			}
+		}
+		
+		static PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
+		
+		public SetupPanel() : base()
+		{
+			ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
 			string text = resourceService.GetString("Dialog.Wizards.CodeCompletionDatabaseWizard.SetupPanel.DescriptionText");
-			VBox mainVBox = new VBox (false, 0);
+			VBox mainVBox = new VBox (false, 0);
 
-			//useExistingRadioButton = new RadioButton ("Use existing code completion database");
-			useExistingRadioButton = RadioButton.NewWithLabel (null, "Use existing code completion database");
+			useExistingRadioButton = new RadioButton ("Use existing code completion database");
 			
-			createNewRadioButton = new RadioButton (useExistingRadioButton);
+			createNewRadioButton = new RadioButton (useExistingRadioButton, "Create new code completion database");
 			createNewRadioButton.Active = true;
-			createNewRadioButton.Label = "Create new code completion database";
 			
-			skipCreationRadioButton = new RadioButton (useExistingRadioButton);
-			skipCreationRadioButton.Label = "Do not create code completion database now";
-			TextView t = new TextView ();
-			t.Buffer.Text = "This dialog is a place holder for right now, it should ask to skip, create new, or use existing files...\n\n";
-			t.Buffer.Text += text;
-
-			t.WrapMode = Gtk.WrapMode.Word;
+			skipCreationRadioButton = new RadioButton (useExistingRadioButton, "Do not create code completion database now");
+			TextView t = new TextView ();
+			t.Buffer.Text = text;
+
+			t.WrapMode = Gtk.WrapMode.Word;
 			t.Editable = false;
-			t.CursorVisible = false;
+			t.CursorVisible = false;
 
 			mainVBox.PackStart (t);
 			mainVBox.PackStart (useExistingRadioButton, false, true, 6);
 			mainVBox.PackStart (createNewRadioButton, false, true, 6);
-			mainVBox.PackStart (skipCreationRadioButton, false, true, 6);
-			this.Add (mainVBox);
+			mainVBox.PackStart (skipCreationRadioButton, false, true, 6);
+			this.Add (mainVBox);
 			
-			// FIXME: use an event that is only fired once
-			skipCreationRadioButton.Toggled += new EventHandler(SetSuccessor);
-			createNewRadioButton.Toggled += new EventHandler(SetSuccessor);
-			useExistingRadioButton.Toggled += new EventHandler(SetSuccessor);
-		}
-	}
-}
+			// FIXME: use an event that is only fired once
+			skipCreationRadioButton.Toggled += new EventHandler(SetSuccessor);
+			createNewRadioButton.Toggled += new EventHandler(SetSuccessor);
+			useExistingRadioButton.Toggled += new EventHandler(SetSuccessor);
+		}
+	}
+}




More information about the Monodevelop-patches-list mailing list