[Monodevelop-patches-list] r1016 - in trunk/MonoDevelop: data/resources/glade src/AddIns/DisplayBindings/SourceEditor/Gui src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels src/Main/Base/Gui/Dialogs/ReferenceDialog

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Tue Feb 24 08:32:12 EST 2004


Author: jba
Date: 2004-02-24 08:32:12 -0500 (Tue, 24 Feb 2004)
New Revision: 1016

Modified:
   trunk/MonoDevelop/data/resources/glade/EditorBindings.glade
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/BehaviorTextEditorPanel.cs
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/MarkersTextEditorPanel.cs
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs
Log:
add .net assembly reference tab and fixed sourceeditor indent style binding to allow none and auto

Modified: trunk/MonoDevelop/data/resources/glade/EditorBindings.glade
===================================================================
--- trunk/MonoDevelop/data/resources/glade/EditorBindings.glade	2004-02-24 05:50:05 UTC (rev 1015)
+++ trunk/MonoDevelop/data/resources/glade/EditorBindings.glade	2004-02-24 13:32:12 UTC (rev 1016)
@@ -1395,22 +1395,7 @@
 			  </child>
 
 			  <child>
-			    <widget class="GtkRadioButton" id="smartIndentStyle">
-			      <property name="visible">True</property>
-			      <property name="can_focus">True</property>
-			      <property name="label" translatable="yes">Smart</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">noneIndentStyle</property>
-			    </widget>
-			    <packing>
-			      <property name="padding">0</property>
-			      <property name="expand">False</property>
-			      <property name="fill">False</property>
-			    </packing>
+			    <placeholder/>
 			  </child>
 			</widget>
 			<packing>

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/BehaviorTextEditorPanel.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/BehaviorTextEditorPanel.cs	2004-02-24 05:50:05 UTC (rev 1015)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/BehaviorTextEditorPanel.cs	2004-02-24 13:32:12 UTC (rev 1016)
@@ -74,7 +74,8 @@
 				//FIXME: i8n the following Labels
 				noneIndentStyle.Label =      "None";
 				automaticIndentStyle.Label = "Automatic"; 
-				smartIndentStyle.Label =     "Smart";
+				// FIXME: renable this when smart indent is back
+				//smartIndentStyle.Label =     "Smart";
 
 				tabsGroupBoxLabel.Markup = "<b>" + StringParserService.Parse(
 					"${res:Dialog.Options.IDEOptions.TextEditor.Behaviour.TabsGroupBox}")  + "</b>";
@@ -129,17 +130,18 @@
 				else if (IndentStyle.Smart.Equals(
 						 (IndentStyle) ((IProperties)CustomizationObject).GetProperty(
 							 "IndentStyle", IndentStyle.Smart))){
-					smartIndentStyle.Active = true;
+					// FIXME: renable this when smart indent is back
+					//smartIndentStyle.Active = true;
 				}
 				
 				// FIXME: re-enable these when their options are implemented
 				autoinsertCurlyBraceCheckBox.Sensitive = false;
 				hideMouseCursorCheckBox.Sensitive = false;
 				caretBehindEOLCheckBox.Sensitive = false;
-				autoInsertTemplatesCheckBox.Sensitive = false;	// FIXME: there is no reason why this option couldn't ber wired in right now
-				noneIndentStyle.Sensitive = false;
-				automaticIndentStyle.Sensitive = false;
-				smartIndentStyle.Sensitive = false;
+                // FIXME: there is no reason why this option couldn't ber wired in right now				
+                autoInsertTemplatesCheckBox.Sensitive = false;	
+   				// FIXME: renable this when smart indent is back
+				//smartIndentStyle.Sensitive = false;
 			}
 
 			public void Store (IProperties CustomizationObject)
@@ -159,8 +161,9 @@
 					((IProperties)CustomizationObject).SetProperty("IndentStyle", IndentStyle.None);
 				else if (automaticIndentStyle.Active)
 					((IProperties)CustomizationObject).SetProperty("IndentStyle", IndentStyle.Auto);
-				else if (smartIndentStyle.Active)
-					((IProperties)CustomizationObject).SetProperty("IndentStyle", IndentStyle.Smart);
+				// FIXME: renable this when smart indent is back
+				//else if (smartIndentStyle.Active)
+				//	((IProperties)CustomizationObject).SetProperty("IndentStyle", IndentStyle.Smart);
 				
 				//FIXME: Only one of these should be selected to save the value
 				((IProperties)CustomizationObject).SetProperty("TabIndent", indentAndTabSizeSpinButton.Value);

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/MarkersTextEditorPanel.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/MarkersTextEditorPanel.cs	2004-02-24 05:50:05 UTC (rev 1015)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/MarkersTextEditorPanel.cs	2004-02-24 13:32:12 UTC (rev 1016)
@@ -121,7 +121,7 @@
 			
 				vRulerRowTextBox.Value = ((IProperties)CustomizationObject).GetProperty("VRulerRow", 80);
 
-				// FIXME: reenable these widhet's when they're implemented
+				// FIXME: reenable these widget's when they're implemented
 				showInvalidLinesCheckBox.Sensitive = false;
 				showHRulerCheckBox.Sensitive = false;
 			}

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2004-02-24 05:50:05 UTC (rev 1015)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2004-02-24 13:32:12 UTC (rev 1016)
@@ -348,7 +348,10 @@
 					// convert tabs to spaces
 					se.View.InsertSpacesInsteadOfTabs = TextEditorProperties.ConvertTabsToSpaces;
 					break;
-					
+				case "IndentStyle":
+					// FIXME: should also be able to handle Smart indent, for now treating smart as None					
+					se.View.AutoIndent = (TextEditorProperties.IndentStyle == IndentStyle.Auto);
+					break;
 				default:
 					System.Console.WriteLine(e.Key + " = " + e.NewValue + "(from " + e.OldValue + ")" );
 					// The items below can't be done (since there is no support for it in gtksourceview)
@@ -356,8 +359,7 @@
 					// CANTDO: show tabs				Key = "ShowTabs"
 					// CANTDO eol makers				Key = "ShowEOLMarkers"
 					// CANTDO: show horizontal ruler	Key = "ShowHRuler"		
-					// CANTDO: underline errors			Key = "ShowErrors"
-					// CANTDO: indentation 				Key = "IndentStyle"
+					// CANTDO: underline errors			Key = "ShowErrors"					
 					// DONOTDO: auto insert braces		Key = "AutoInsertCurlyBracket"
 					// TODO: Show Invalid Lines			Key = "ShowInvalidLines"
 					// TODO: CodeCompletion				Key = "EnableCodeCompletion"

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs	2004-02-24 05:50:05 UTC (rev 1015)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs	2004-02-24 13:32:12 UTC (rev 1016)
@@ -32,7 +32,6 @@
 		public SourceEditorView (SourceEditorBuffer buf, SourceEditor parent) : base (type)
 		{
 			this.ParentEditor = parent;
-			//FIXME: hook into the options
 			this.TabsWidth = 4;
 			Buffer = this.buf = buf;
 			AutoIndent = true;

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs	2004-02-24 05:50:05 UTC (rev 1015)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs	2004-02-24 13:32:12 UTC (rev 1016)
@@ -15,46 +15,62 @@
 using ICSharpCode.SharpDevelop.Internal.Project;
 using ICSharpCode.Core.Services;
 
+using Gtk;
+
 namespace ICSharpCode.SharpDevelop.Gui.Dialogs
-{/*
-	public class AssemblyReferencePanel : Panel//, IReferencePanel
+{
+	public class AssemblyReferencePanel : VButtonBox, IReferencePanel
 	{
 		SelectReferenceDialog selectDialog;
 		
 		public AssemblyReferencePanel(SelectReferenceDialog selectDialog)
 		{
 			this.selectDialog = selectDialog;
-			
-			Button browseButton   = new Button();
-			browseButton.Location = new Point(10, 10);
-			browseButton.Text     = "Browse";
-			browseButton.Click   += new EventHandler(SelectReferenceDialog);
-			Controls.Add(browseButton);
+			// FIXME: il8n this
+			Gtk.Button browseButton = new Gtk.Button("Browse");
+			browseButton.Clicked += new EventHandler(SelectReferenceDialog);
+			PackStart(browseButton, false, false, 6);
+			ShowAll();
 		}
 		
 		void SelectReferenceDialog(object sender, EventArgs e)
 		{
-			using (OpenFileDialog fdiag  = new OpenFileDialog()) {
-				fdiag.AddExtension    = true;
-				StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
-				fdiag.Filter = stringParserService.Parse("${res:SharpDevelop.FileFilter.AssemblyFiles}|*.dll;*.exe|${res:SharpDevelop.FileFilter.AllFiles}|*.*");
-				fdiag.Multiselect     = true;
-				fdiag.CheckFileExists = true;
-				
-				if (fdiag.ShowDialog() == DialogResult.OK) {
-					foreach (string file in fdiag.FileNames) {
-						selectDialog.AddReference(ReferenceType.Assembly,
-						                          Path.GetFileName(file),
-						                          file);
-						
+			// FIXME: il8n the dialog name
+			StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
+			FileSelection fdiag = new FileSelection("Find .Net Assembly");			
+			// FIXME: this should only allow dll's and exe's
+			fdiag.Complete("*");
+			fdiag.SelectMultiple = true;
+			int response = fdiag.Run();
+			string[] selectedFiles = new string[fdiag.Selections.Length];
+			fdiag.Selections.CopyTo(selectedFiles, 0);
+			fdiag.Destroy();
+			
+			if (response == (int) ResponseType.Ok) {
+				foreach (string file in selectedFiles) {
+					bool isAssembly = true;
+					try	{
+						System.Reflection.AssemblyName.GetAssemblyName(System.IO.Path.GetFileName(file));
+					} catch (Exception assemblyExcep) {
+						isAssembly = false;
 					}
+					
+					if (isAssembly) {
+					selectDialog.AddReference(ReferenceType.Assembly,
+											  System.IO.Path.GetFileName(file),
+											  file);
+					} else {
+						IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
+						// FIXME: il8n this
+						messageService.ShowError("File " + file + "is not a valid .Net Assembly");
+					}
 				}
 			}
 		}
 		
 		public void AddReference(object sender, EventArgs e)
 		{
-			MessageBox.Show("This panel will contain a file browser, but so long use the browse button :)");
+			System.Console.WriteLine("This panel will contain a file browser, but so long use the browse button :)");
 		}
-	}*/
+	}
 }

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs	2004-02-24 05:50:05 UTC (rev 1015)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs	2004-02-24 13:32:12 UTC (rev 1016)
@@ -92,8 +92,9 @@
 			}
 			mainBook.RemovePage (mainBook.CurrentPage);
 			mainBook.AppendPage (gacRefPanel, new Gtk.Label (resourceService.GetString("Dialog.SelectReferenceDialog.GacTabPage")));
-			mainBook.AppendPage (new ProjectReferencePanel (this), new Gtk.Label (resourceService.GetString("Dialog.SelectReferenceDialog.ProjectTabPage")));
-			//browserTabPage.Controls.Add(new AssemblyReferencePanel(this));
+			mainBook.AppendPage (new ProjectReferencePanel (this), new Gtk.Label (resourceService.GetString("Dialog.SelectReferenceDialog.ProjectTabPage")));			
+			// FIXME il8n the assembly tab name			
+			mainBook.AppendPage (new AssemblyReferencePanel (this), new Gtk.Label (".Net Assembly"));
 			//comTabPage.Controls.Add(new COMReferencePanel(this));
 			AddReferenceDialog.ShowAll ();
 		}




More information about the Monodevelop-patches-list mailing list