[Monodevelop-patches-list] r605 - in trunk/MonoDevelop: data/resources/glade src/Main/Base/Gui/CompletionDatabaseWizard src/Main/Base/Gui/Dialogs

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Tue Jan 20 19:31:07 EST 2004


Author: benm
Date: 2004-01-20 19:31:07 -0500 (Tue, 20 Jan 2004)
New Revision: 605

Modified:
   trunk/MonoDevelop/data/resources/glade/Base.glade
   trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/ChooseLocationPanel.cs
   trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/UseExistingFilePanel.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/NewProjectDialog.cs
Log:
revertify the Gnome.FileEntry, it is really borked

Modified: trunk/MonoDevelop/data/resources/glade/Base.glade
===================================================================
--- trunk/MonoDevelop/data/resources/glade/Base.glade	2004-01-21 00:13:33 UTC (rev 604)
+++ trunk/MonoDevelop/data/resources/glade/Base.glade	2004-01-21 00:31:07 UTC (rev 605)
@@ -624,32 +624,7 @@
 			  <property name="spacing">0</property>
 
 			  <child>
-			    <widget class="GnomeFileEntry" id="entry_location">
-			      <property name="visible">True</property>
-			      <property name="max_saved">10</property>
-			      <property name="browse_dialog_title" translatable="yes">Combine location</property>
-			      <property name="directory_entry">True</property>
-			      <property name="modal">True</property>
-
-			      <child internal-child="entry">
-				<widget class="GtkEntry" id="location">
-				  <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">True</property>
-			      <property name="fill">True</property>
-			    </packing>
+			    <placeholder/>
 			  </child>
 			</widget>
 			<packing>

Modified: trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/ChooseLocationPanel.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/ChooseLocationPanel.cs	2004-01-21 00:13:33 UTC (rev 604)
+++ trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/ChooseLocationPanel.cs	2004-01-21 00:31:07 UTC (rev 605)
@@ -8,6 +8,7 @@
 using System;
 using System.IO;
 using Gtk;
+using MonoDevelop.Gui;
 
 using ICSharpCode.SharpDevelop.Internal.Project;
 using ICSharpCode.Core.Properties;
@@ -25,7 +26,7 @@
 		Button browseButton;
 		RadioButton specifyLocationRadioButton;
 		RadioButton sharpDevelopDirRadioButton;
-		Gnome.FileEntry locationTextBox = new Gnome.FileEntry ("locationTextBox", "Choose the location in which you want the code completion files to be generated");
+		Entry locationTextBox = new Entry ();
 		
 		public override bool ReceiveDialogMessage(DialogMessage message)
 		{
@@ -35,7 +36,7 @@
 			} else if (message == DialogMessage.Next || message == DialogMessage.OK) {
 				string path = null;				
 				if (specifyLocationRadioButton.Active) {
-					path = locationTextBox.GtkEntry.Text.TrimEnd (System.IO.Path.DirectorySeparatorChar);
+					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));
@@ -72,14 +73,24 @@
 			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)
 		{
 			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
 			try
 			{
 				EnableFinish = EnableNext = !specifyLocationRadioButton.Active ||
-  			                            (fileUtilityService.IsValidFileName(locationTextBox.GtkEntry.Text) && 
-  			                            Directory.Exists(locationTextBox.GtkEntry.Text));
+  			                            (fileUtilityService.IsValidFileName(locationTextBox.Text) && 
+  			                            Directory.Exists(locationTextBox.Text));
 			}
 			catch
 			{
@@ -98,9 +109,9 @@
 			VBox mainVBox = new VBox (false, 0);
 			NextWizardPanelID = "CreateDatabasePanel";
 			
-			locationTextBox.DirectoryEntry = true;
-			locationTextBox.Modal = true;
-			locationTextBox.GtkEntry.WidthChars = 50;
+			browseButton = new Button ("...");
+			browseButton.Clicked += new EventHandler (BrowseLocationEvent);
+			
 			locationTextBox.Changed += new EventHandler (SetFinishedState);
 			
 			ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
@@ -121,6 +132,7 @@
 			
 			HBox hbox = new HBox (false, 0);
 			hbox.PackStart (locationTextBox);
+			hbox.PackStart (browseButton, false, false, 3);
 		
 			mainVBox.PackStart (t, true, true, 0);
 			mainVBox.PackStart (specifyLocationRadioButton, false, true, 6);

Modified: trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/UseExistingFilePanel.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/UseExistingFilePanel.cs	2004-01-21 00:13:33 UTC (rev 604)
+++ trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/UseExistingFilePanel.cs	2004-01-21 00:31:07 UTC (rev 605)
@@ -13,6 +13,7 @@
 using ICSharpCode.Core.Properties;
 using ICSharpCode.Core.Services;
 
+using MonoDevelop.Gui;
 using ICSharpCode.Core.AddIns.Codons;
 
 namespace ICSharpCode.SharpDevelop.Gui.Dialogs.OptionPanels.CompletionDatabaseWizard
@@ -21,7 +22,7 @@
 	{
 		static FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
 		IProperties properties;
-		Gnome.FileEntry locationTextBox;
+		Entry locationTextBox;
 		
 		public override bool ReceiveDialogMessage(DialogMessage message)
 		{
@@ -39,7 +40,7 @@
 		void SetFinishedState(object sender, EventArgs e)
 		{
 			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
-			string path = locationTextBox.GtkEntry.Text;
+			string path = locationTextBox.Text;
 			EnableFinish = fileUtilityService.IsValidFileName(path) &&
 			               Directory.Exists(path) && 
 			               File.Exists(fileUtilityService.GetDirectoryNameWithSeparator(path) + "CodeCompletionProxyDataV02.bin");
@@ -54,6 +55,17 @@
 			properties = (IProperties)CustomizationObject;
 		}
 		
+		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;
+			}
+		}
+		
 		static PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
 		public UseExistingFilePanel()
 		{
@@ -68,13 +80,14 @@
 			mainVBox.PackStart (textBox, false, true, 0);
 			mainVBox.PackStart (new Label ("Specify location of existing code completion database."));
 			
-			locationTextBox = new Gnome.FileEntry ("locationTextBox", "choose the location in which you want the code completion files to be generated");
-			locationTextBox.DirectoryEntry = true;
-			locationTextBox.Modal = true;
-			locationTextBox.GtkEntry.WidthChars = 50;
+			locationTextBox = new Entry ();
+			locationTextBox.WidthChars = 50;
 			locationTextBox.Changed += new EventHandler(SetFinishedState);
+			Button browseButton = new Button ("...");
+			browseButton.Clicked += new EventHandler(BrowseLocationEvent);
 			HBox hbox = new HBox (false, 0);
 			hbox.PackStart (locationTextBox, false, true, 0);
+			hbox.PackStart (browseButton, false, true, 0);
 			SetFinishedState(this, EventArgs.Empty);
 			CustomizationObjectChanged += new EventHandler(SetValues);
 			

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/NewProjectDialog.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/NewProjectDialog.cs	2004-01-21 00:13:33 UTC (rev 604)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/NewProjectDialog.cs	2004-01-21 00:31:07 UTC (rev 605)
@@ -12,12 +12,12 @@
 using ICSharpCode.Core.AddIns;
 using ICSharpCode.Core.Properties;
 using ICSharpCode.Core.Services;
+
 using ICSharpCode.SharpDevelop.Services;
 using ICSharpCode.SharpDevelop.Gui;
 using ICSharpCode.SharpDevelop.Internal.Project;
 using ICSharpCode.SharpDevelop.Internal.Templates;
 using ICSharpCode.SharpDevelop.Gui.XmlForms;
-
 using MonoDevelop.Gui;
 using Gtk;
 using GladeSharp;
@@ -34,6 +34,7 @@
 		Hashtable icons        = new Hashtable();
 		
 		IconView TemplateView;
+		FolderEntry entry_location;
 		TreeStore catStore;
 		
 		[Glade.Widget ("NewProjectDialog")] Dialog dialog;
@@ -46,7 +47,6 @@
 		
 		[Glade.Widget] Gtk.Entry txt_name, txt_subdirectory;
 		[Glade.Widget] CheckButton chk_combine_directory;
-		[Glade.Widget] Gnome.FileEntry entry_location;
 		
 		[Glade.Widget] Gtk.TreeView lst_template_types;
 		[Glade.Widget] HBox hbox_template, hbox_for_browser;
@@ -181,9 +181,9 @@
 		string ProjectLocation {
 			get {
 				if (chk_combine_directory.Active)
-					return System.IO.Path.Combine (entry_location.GtkEntry.Text, txt_name.Text);
+					return Path.Combine (entry_location.Path, txt_name.Text);
 				
-				return entry_location.GtkEntry.Text;
+				return entry_location.Path;
 			}
 		}
 		
@@ -228,8 +228,7 @@
 			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
 			string solution = txt_subdirectory.Text;
 			string name     = txt_name.Text;
-			string location = entry_location.GtkEntry.Text;
-			
+			string location = entry_location.Path;
 			if ((solution != null && solution.Trim () != "" 
 				&& (!fileUtilityService.IsValidFileName (solution) || solution.IndexOf(System.IO.Path.DirectorySeparatorChar) >= 0)) ||
 			    !fileUtilityService.IsValidFileName(name)     || name.IndexOf(System.IO.Path.DirectorySeparatorChar) >= 0 ||
@@ -363,16 +362,17 @@
 			//label = stringParserService.Parse ("${res:Dialog.NewProject.NameLabelText}");
 			//label = stringParserService.Parse ("${res:Dialog.NewProject.checkBox1Text}");
 			//label = stringParserService.Parse ("${res:Dialog.NewProject.autoCreateSubDirCheckBox}");
+			entry_location = new FolderEntry ("Combine Location");
+			hbox_for_browser.PackStart (entry_location, true, true, 0);
 			
 			
 			entry_location.DefaultPath = propertyService.GetProperty ("ICSharpCode.SharpDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath", fileUtilityService.GetDirectoryNameWithSeparator (Environment.GetFolderPath (Environment.SpecialFolder.Personal)) + "MonoDevelopProjects").ToString ();
-			entry_location.GtkEntry.Text = entry_location.DefaultPath;
 			
 			PathChanged (null, null);
 			
 			TemplateView.IconSelected += new EventHandler(SelectedIndexChange);
 			TemplateView.IconDoubleClicked += new EventHandler(OpenEvent);
-			entry_location.Changed += new EventHandler (PathChanged);
+			entry_location.PathChanged += new EventHandler (PathChanged);
 		}
 		
 		/// <summary>




More information about the Monodevelop-patches-list mailing list