[Monodevelop-patches-list] r2213 - in trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor: . Gui Gui/OptionPanels Properties

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Mon Jan 31 16:14:42 EST 2005


Author: jluke
Date: 2005-01-31 16:14:42 -0500 (Mon, 31 Jan 2005)
New Revision: 2213

Modified:
   trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
   trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/EditorBindings.glade
   trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/BehaviorTextEditorPanel.cs
   trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
   trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs
   trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Properties/TextEditorProperties.cs
Log:
enable AutoInsertTemplates preference


Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog	2005-01-31 20:33:27 UTC (rev 2212)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog	2005-01-31 21:14:42 UTC (rev 2213)
@@ -1,3 +1,13 @@
+2005-01-31  John Luke  <john.luke at gmail.com>
+
+	* EditorBindings.glade:
+	* Gui/SourceEditorView.cs:
+	* Gui/OptionPanels/BehaviorTextEditorPanel.cs:
+	* Gui/SourceEditorDisplayBinding.cs:
+	* Properties/TextEditorProperties.cs:
+	remove a couple useless texteditor props, enable
+	the AutoInsertTemplates property
+
 2005-01-31  Lluis Sanchez Gual  <lluis at novell.com>
 
 	* Gui/SourceEditorDisplayBinding.cs:

Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/EditorBindings.glade
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/EditorBindings.glade	2005-01-31 20:33:27 UTC (rev 2212)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/EditorBindings.glade	2005-01-31 21:14:42 UTC (rev 2213)
@@ -1651,25 +1651,6 @@
 		  <property name="spacing">6</property>
 
 		  <child>
-		    <widget class="GtkCheckButton" id="caretBehindEOLCheckBox">
-		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="label" translatable="yes">_Can move caret behind EOL</property>
-		      <property name="use_underline">True</property>
-		      <property name="relief">GTK_RELIEF_NORMAL</property>
-		      <property name="focus_on_click">True</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="GtkCheckButton" id="autoInsertTemplatesCheckBox">
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
@@ -1706,25 +1687,6 @@
 		      <property name="fill">False</property>
 		    </packing>
 		  </child>
-
-		  <child>
-		    <widget class="GtkCheckButton" id="hideMouseCursorCheckBox">
-		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="label" translatable="yes">_Hide mouse cursor while typing</property>
-		      <property name="use_underline">True</property>
-		      <property name="relief">GTK_RELIEF_NORMAL</property>
-		      <property name="focus_on_click">True</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>

Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/BehaviorTextEditorPanel.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/BehaviorTextEditorPanel.cs	2005-01-31 20:33:27 UTC (rev 2212)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/BehaviorTextEditorPanel.cs	2005-01-31 21:14:42 UTC (rev 2213)
@@ -55,8 +55,6 @@
 			[Glade.Widget] Label indentSizeLabel;
 			[Glade.Widget] Label indentLabel;
 			[Glade.Widget] CheckButton autoinsertCurlyBraceCheckBox;
-			[Glade.Widget] CheckButton hideMouseCursorCheckBox;
-			[Glade.Widget] CheckButton caretBehindEOLCheckBox;
 			[Glade.Widget] CheckButton autoInsertTemplatesCheckBox;
 			[Glade.Widget] CheckButton convertTabsToSpacesCheckBox;
 			[Glade.Widget] RadioButton noneIndentStyle;
@@ -67,15 +65,9 @@
 			public BehaviorTextEditorPanelWidget (IProperties CustomizationObject) :  
 				base ("EditorBindings.glade", "BehaviorTextEditorPanel")
 			{
-				// Set up Text
-
 				// Set up Value
 				autoinsertCurlyBraceCheckBox.Active = ((IProperties)CustomizationObject).GetProperty(
 					"AutoInsertCurlyBracket", true);
-				hideMouseCursorCheckBox.Active      = ((IProperties)CustomizationObject).GetProperty(
-					"HideMouseCursor", true);
-				caretBehindEOLCheckBox.Active       = ((IProperties)CustomizationObject).GetProperty(
-					"CursorBehindEOL", false);
 				autoInsertTemplatesCheckBox.Active  = ((IProperties)CustomizationObject).GetProperty(
 					"AutoInsertTemplates", true);
 				convertTabsToSpacesCheckBox.Active  = ((IProperties)CustomizationObject).GetProperty(
@@ -104,10 +96,6 @@
 				
 				// FIXME: re-enable these when their options are implemented
 				autoinsertCurlyBraceCheckBox.Sensitive = false;
-				hideMouseCursorCheckBox.Sensitive = false;
-				caretBehindEOLCheckBox.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;
 			}
@@ -119,10 +107,6 @@
 				((IProperties)CustomizationObject).SetProperty(
 					"AutoInsertCurlyBracket", autoinsertCurlyBraceCheckBox.Active);
 				((IProperties)CustomizationObject).SetProperty(
-					"HideMouseCursor",        hideMouseCursorCheckBox.Active);
-				((IProperties)CustomizationObject).SetProperty(
-					"CursorBehindEOL",        caretBehindEOLCheckBox.Active);
-				((IProperties)CustomizationObject).SetProperty(
 					"AutoInsertTemplates",    autoInsertTemplatesCheckBox.Active);
 
 				if (noneIndentStyle.Active)

Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2005-01-31 20:33:27 UTC (rev 2212)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2005-01-31 21:14:42 UTC (rev 2213)
@@ -518,6 +518,7 @@
 			
 			se.View.InsertSpacesInsteadOfTabs = TextEditorProperties.ConvertTabsToSpaces;
 			se.View.AutoIndent = (TextEditorProperties.IndentStyle == IndentStyle.Auto);
+			se.View.AutoInsertTemplates = TextEditorProperties.AutoInsertTemplates;
 			
 			//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)

Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs	2005-01-31 20:33:27 UTC (rev 2212)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs	2005-01-31 21:14:42 UTC (rev 2213)
@@ -31,11 +31,17 @@
 		int lineToMark = -1;
 		bool codeCompleteEnabled;
 		bool autoHideCompletionWindow = true;
+		bool autoInsertTemplates;
 
 		public bool EnableCodeCompletion {
 			get { return codeCompleteEnabled; }
 			set { codeCompleteEnabled = value; }
 		}
+
+		public bool AutoInsertTemplates {
+			get { return autoInsertTemplates; }
+			set { autoInsertTemplates = value; }
+		}
 		
 		public SourceEditorView (SourceEditorBuffer buf, SourceEditor parent)
 		{
@@ -306,21 +312,24 @@
 
 			switch ((char)key) {
 			case ' ':
-				string word = GetWordBeforeCaret ();
-				if (word != null) {
-					/*if (word.ToLower () == "new") {
-						if (EnableCodeCompletion) {
-							completionWindow = new CompletionWindow (this, ParentEditor.DisplayBinding.ContentName, new CodeCompletionDataProvider (true));
-							completionWindow.ShowCompletionWindow ((char)key, buf.GetIterAtMark (buf.InsertMark), true);
-						}
-					}*/
-					CodeTemplateGroup templateGroup = CodeTemplateLoader.GetTemplateGroupPerFilename(ParentEditor.DisplayBinding.ContentName);
+				if (AutoInsertTemplates)
+				{
+					string word = GetWordBeforeCaret ();
+					if (word != null) {
+						/*if (word.ToLower () == "new") {
+							if (EnableCodeCompletion) {
+								completionWindow = new CompletionWindow (this, ParentEditor.DisplayBinding.ContentName, new CodeCompletionDataProvider (true));
+								completionWindow.ShowCompletionWindow ((char)key, buf.GetIterAtMark (buf.InsertMark), true);
+							}
+						}*/
+						CodeTemplateGroup templateGroup = CodeTemplateLoader.GetTemplateGroupPerFilename(ParentEditor.DisplayBinding.ContentName);
 					
-					if (templateGroup != null) {
-						foreach (CodeTemplate template in templateGroup.Templates) {
-							if (template.Shortcut == word) {
-								InsertTemplate(template);
-								return false;
+						if (templateGroup != null) {
+							foreach (CodeTemplate template in templateGroup.Templates) {
+								if (template.Shortcut == word) {
+									InsertTemplate(template);
+									return false;
+								}
 							}
 						}
 					}

Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Properties/TextEditorProperties.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Properties/TextEditorProperties.cs	2005-01-31 20:33:27 UTC (rev 2212)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Properties/TextEditorProperties.cs	2005-01-31 21:14:42 UTC (rev 2213)
@@ -272,6 +272,15 @@
 				properties.SetProperty("AutoInsertCurlyBracket", value);
 			}
 		}
+
+		public static bool AutoInsertTemplates {
+			get {
+				return properties.GetProperty("AutoInsertTemplates", true);
+			}
+			set {
+				properties.SetProperty("AutoInsertTemplates", value);
+			}
+		}
 		
 		public static FontDescription Font {
 			get {




More information about the Monodevelop-patches-list mailing list