[Monodevelop-patches-list] r397 - src/Main/Base/Gui/CompletionDatabaseWizard

commit-watcher at sevenl.net commit-watcher at sevenl.net
Tue Jan 6 19:22:34 EST 2004


Author: jluke
Date: 2004-01-06 19:22:33 -0500 (Tue, 06 Jan 2004)
New Revision: 397

Modified:
   src/Main/Base/Gui/CompletionDatabaseWizard/ChooseLocationPanel.cs
   src/Main/Base/Gui/CompletionDatabaseWizard/CreateDatabasePanel.cs
   src/Main/Base/Gui/CompletionDatabaseWizard/SetupPanel.cs
Log:
enable the logic, etc.


Modified: src/Main/Base/Gui/CompletionDatabaseWizard/ChooseLocationPanel.cs
===================================================================
--- src/Main/Base/Gui/CompletionDatabaseWizard/ChooseLocationPanel.cs	2004-01-06 23:08:53 UTC (rev 396)
+++ src/Main/Base/Gui/CompletionDatabaseWizard/ChooseLocationPanel.cs	2004-01-07 00:22:33 UTC (rev 397)
@@ -24,27 +24,28 @@
 		
 		Button browseButton;
 		RadioButton specifyLocationRadioButton;
+		RadioButton sharpDevelopDirRadioButton;
 		Entry locationTextBox;
 		
 		public override bool ReceiveDialogMessage(DialogMessage message)
 		{
-			Console.WriteLine ("Inside ReceiveDialogMessage");
+			//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 (Path.DirectorySeparatorChar);
-				} else if (sharpDevelopDirRadioButton.Active) {*/
+				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 {
+				} else {
 					PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
 					path = propertyService.ConfigDirectory + "CodeCompletionTemp";
-				}*/
+				}
 				
 				if (!Directory.Exists(path)) {
 					Directory.CreateDirectory(path);
@@ -68,16 +69,16 @@
 		{/*
 			FolderDialog fd = new FolderDialog();
 			if (fd.DisplayDialog("choose the location in which you want the code completion files to be generated") == DialogResult.OK) {
-				ControlDictionary["locationTextBox"].Text = fd.Path;
+				locationTextBox.Text = fd.Path;
 			}*/
 		}
 		
 		void SetFinishedState(object sender, EventArgs e)
-		{/*
+		{
 			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
-			EnableFinish = EnableNext = !((RadioButton)ControlDictionary["specifyLocationRadioButton"]).Active ||
-  			                            (fileUtilityService.IsValidFileName(ControlDictionary["locationTextBox"].Text) && 
-  			                            Directory.Exists(ControlDictionary["locationTextBox"].Text));*/
+			EnableFinish = EnableNext = !specifyLocationRadioButton.Active ||
+  			                            (fileUtilityService.IsValidFileName(locationTextBox.Text) && 
+  			                            Directory.Exists(locationTextBox.Text));
 		}
 		
 		void SetValues(object sender, EventArgs e)
@@ -100,16 +101,15 @@
 			
 			ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
 			
-			RadioButton appDirRadioButton = RadioButton.NewWithLabel (null, "Use current user's application directory");
-			appDirRadioButton.Sensitive = false;
-			appDirRadioButton.Activated += new EventHandler (SetEnableStatus);
-			RadioButton sharpDevelopDirRadioButton = new RadioButton (appDirRadioButton);
+			//RadioButton appDirRadioButton = new RadioButton ("Use current user's application directory");
+			RadioButton appDirRadioButton = RadioButton.NewWithLabel (null, "Use current user's application directory");
+			appDirRadioButton.Toggled += new EventHandler (SetEnableStatus);
+			sharpDevelopDirRadioButton = new RadioButton (appDirRadioButton);
 			sharpDevelopDirRadioButton.Label = "Use SharpDevelop application directory";
-			sharpDevelopDirRadioButton.Activated += new EventHandler (SetEnableStatus);
+			sharpDevelopDirRadioButton.Toggled += new EventHandler (SetEnableStatus);
 			specifyLocationRadioButton = new RadioButton (appDirRadioButton);
 			specifyLocationRadioButton.Label = "Specify code completion database location";
-			specifyLocationRadioButton.Activated += new EventHandler (SetEnableStatus);
-			specifyLocationRadioButton.Sensitive = false;
+			specifyLocationRadioButton.Toggled += new EventHandler (SetEnableStatus);
 
 			TextView t = new TextView ();
 			t.Buffer.Text = resourceService.GetString ("Dialog.Wizards.CodeCompletionDatabaseWizard.ChooseLocationPanel.DescriptionText");

Modified: src/Main/Base/Gui/CompletionDatabaseWizard/CreateDatabasePanel.cs
===================================================================
--- src/Main/Base/Gui/CompletionDatabaseWizard/CreateDatabasePanel.cs	2004-01-06 23:08:53 UTC (rev 396)
+++ src/Main/Base/Gui/CompletionDatabaseWizard/CreateDatabasePanel.cs	2004-01-07 00:22:33 UTC (rev 397)
@@ -24,7 +24,8 @@
 		bool finished = false;
 		bool began = false;
 		int         totalWork = 0;
-		static FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
+		static FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
+		CheckButton fastCreationCheckBox = new CheckButton ("Enable fast database creation (=slower code completion)");
 		
 		public override bool ReceiveDialogMessage(DialogMessage message)
 		{
@@ -43,11 +44,11 @@
 				SetProgressBarValue(0);
 				createButton.Label = resourceService.GetString("Dialog.Wizards.CodeCompletionDatabaseWizard.CreateDatabasePanel.StartCreationButton");
 				EnableCancel = EnablePrevious = true;
-				//fastCreationCheckBox.Active = true;
+				fastCreationCheckBox.Active = true;
 			} else {
 				began = true;
 				EnableCancel = EnablePrevious = false;
-				//fastCreationCheckBox.Active = false;
+				fastCreationCheckBox.Active = false;
 				iterate = new GLib.IdleHandler (CreateDatabase);
 				GLib.Idle.Add (iterate);
 				
@@ -61,11 +62,11 @@
 				DefaultParserService parserService  = (DefaultParserService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(DefaultParserService));
 				string path  = properties.GetProperty("SharpDevelop.CodeCompletion.DataDirectory", String.Empty);
 				Console.WriteLine (path);
-				//if (fastCreationCheckBox.Active) {
-				//	parserService.GenerateCodeCompletionDatabaseFast(path, this);
-				//} else {
+				if (fastCreationCheckBox.Active) {
+					parserService.GenerateCodeCompletionDatabaseFast(path, this);
+				} else {
 					parserService.GenerateEfficientCodeCompletionDatabase(path, this);
-				//}
+				}
 			} catch (Exception e) {
 				ResourceService resourceService = (ResourceService) ServiceManager.Services.GetService (typeof (IResourceService));
 				MessageService messageService = (MessageService) ServiceManager.Services.GetService (typeof (IMessageService));
@@ -104,7 +105,8 @@
 			t.CursorVisible = false;
 			
 			Gtk.VBox mainbox = new Gtk.VBox (false, 2);
-			mainbox.PackStart (t);
+			mainbox.PackStart (t);
+			mainbox.PackStart (fastCreationCheckBox, false, false, 2);
 			mainbox.PackStart (createButton, false, false, 2);
 			mainbox.PackStart (progressBar, false, false, 2);
 		

Modified: src/Main/Base/Gui/CompletionDatabaseWizard/SetupPanel.cs
===================================================================
--- src/Main/Base/Gui/CompletionDatabaseWizard/SetupPanel.cs	2004-01-06 23:08:53 UTC (rev 396)
+++ src/Main/Base/Gui/CompletionDatabaseWizard/SetupPanel.cs	2004-01-07 00:22:33 UTC (rev 397)
@@ -43,13 +43,14 @@
 			string text = resourceService.GetString("Dialog.Wizards.CodeCompletionDatabaseWizard.SetupPanel.DescriptionText");
 			VBox mainVBox = new VBox (false, 0);
 
+			//useExistingRadioButton = new RadioButton ("Use existing code completion database");
 			useExistingRadioButton = RadioButton.NewWithLabel (null, "Use existing code completion database");
-			useExistingRadioButton.Sensitive = false;
+			
 			createNewRadioButton = new RadioButton (useExistingRadioButton);
 			createNewRadioButton.Active = true;
 			createNewRadioButton.Label = "Create new code completion database";
+			
 			skipCreationRadioButton = new RadioButton (useExistingRadioButton);
-			skipCreationRadioButton.Sensitive = false;
 			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";
@@ -64,10 +65,11 @@
 			mainVBox.PackStart (createNewRadioButton, false, true, 6);
 			mainVBox.PackStart (skipCreationRadioButton, false, true, 6);
 			this.Add (mainVBox);
-			
-			skipCreationRadioButton.Activated += new EventHandler(SetSuccessor);
-			createNewRadioButton.Activated += new EventHandler(SetSuccessor);
-			useExistingRadioButton.Activated += 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