[Monodevelop-patches-list] r966 - in trunk/MonoDevelop: data/resources/glade src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs src/AddIns/DisplayBindings/SourceEditor/Search src/AddIns/DisplayBindings/SourceEditor/Search/DocumentIterator src/AddIns/DisplayBindings/SourceEditor/Search/SearchResult

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Fri Feb 20 14:58:27 EST 2004


Author: tberman
Date: 2004-02-20 14:58:27 -0500 (Fri, 20 Feb 2004)
New Revision: 966

Modified:
   trunk/MonoDevelop/data/resources/glade/texteditoraddin.glade
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceInFilesDialog.cs
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/DocumentIterator/ProvidedDocumentInformation.cs
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceInFilesManager.cs
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchResult/DefaultSearchResult.cs
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchResult/ISearchResult.cs
Log:
working find in files, cpl small bugs, will get to them.

replace is next on the list.


Modified: trunk/MonoDevelop/data/resources/glade/texteditoraddin.glade
===================================================================
--- trunk/MonoDevelop/data/resources/glade/texteditoraddin.glade	2004-02-20 08:13:56 UTC (rev 965)
+++ trunk/MonoDevelop/data/resources/glade/texteditoraddin.glade	2004-02-20 19:58:27 UTC (rev 966)
@@ -941,6 +941,24 @@
 	  </child>
 
 	  <child>
+	    <widget class="GtkCheckButton" id="includeSubdirectoriesCheckBox">
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label" translatable="yes">checkbutton1</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>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
+
+	  <child>
 	    <widget class="GtkCheckButton" id="ignoreCaseCheckBox">
 	      <property name="visible">True</property>
 	      <property name="can_focus">True</property>
@@ -1067,23 +1085,6 @@
 	    </packing>
 	  </child>
 
-	  <child>
-	    <widget class="GtkCheckButton" id="includeSubdirectoriesCheckBox">
-	      <property name="visible">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="label" translatable="yes">checkbutton1</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>
-	    </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/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceInFilesDialog.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceInFilesDialog.cs	2004-02-20 08:13:56 UTC (rev 965)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceInFilesDialog.cs	2004-02-20 19:58:27 UTC (rev 966)
@@ -63,11 +63,14 @@
 		void InitDialog ()
 		{
 			label1.Text = stringParserService.Parse ("${res:Dialog.NewProject.SearchReplace.FindWhat}");
-			searchLocationLabel.Text = stringParserService.Parse ("${res:Dialog.NewProject.SearchReplace.SearchIn}");		
+			searchLocationLabel.Text = stringParserService.Parse ("${res:Dialog.NewProject.SearchReplace.SearchIn}");
+			label6.Text = stringParserService.Parse ("${res:NewProject.SearchReplace.FileMask}");
+			label7.Text = stringParserService.Parse ("${res:NewProject.SearchReplace.Directory}");
 			//findButton.Label = stringParserService.Parse ("${res:Dialog.NewProject.SearchReplace.FindNextButton}");			
 			//closeButton.Label = stringParserService.Parse ("${res:Global.CloseButtonText}");
 			findButton.UseUnderline = true;			
-			closeButton.UseUnderline = true;			
+			closeButton.UseUnderline = true;
+			includeSubdirectoriesCheckBox.Label = stringParserService.Parse ("${res:NewProject.SearchReplace.IncludeSubdirectories}");
 			ignoreCaseCheckBox.Label = stringParserService.Parse ("${res:Dialog.NewProject.SearchReplace.CaseSensitive}");
 			searchWholeWordOnlyCheckBox.Label = stringParserService.Parse ("${res:Dialog.NewProject.SearchReplace.WholeWord}");
 			useSpecialSearchStrategyCheckBox.Label = stringParserService.Parse ("${res:Dialog.NewProject.SearchReplace.UseMethodLabel}");			
@@ -79,9 +82,15 @@
 			SizeGroup options = new SizeGroup(SizeGroupMode.Horizontal);
 			SizeGroup helpButtons = new SizeGroup(SizeGroupMode.Horizontal);
 			SizeGroup checkButtons = new SizeGroup(SizeGroupMode.Horizontal);
-			labels.AddWidget(label1);			
+			labels.AddWidget(label1);
+			labels.AddWidget(label6);
+			labels.AddWidget(label7);
 			combos.AddWidget(searchPatternComboBox);
+			combos.AddWidget(directoryTextBox);
+			combos.AddWidget(fileMaskTextBox);
 			helpButtons.AddWidget(findHelpButton);
+			helpButtons.AddWidget(browseButton);
+			checkButtons.AddWidget (includeSubdirectoriesCheckBox);
 			checkButtons.AddWidget(ignoreCaseCheckBox);
 			checkButtons.AddWidget(searchWholeWordOnlyCheckBox);
 			checkButtons.AddWidget(useSpecialSearchStrategyCheckBox);

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/DocumentIterator/ProvidedDocumentInformation.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/DocumentIterator/ProvidedDocumentInformation.cs	2004-02-20 08:13:56 UTC (rev 965)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/DocumentIterator/ProvidedDocumentInformation.cs	2004-02-20 19:58:27 UTC (rev 966)
@@ -86,13 +86,16 @@
 			}
 		}
 		
-		/*public IDocument CreateDocument()
+		public SourceEditor CreateDocument()
 		{
 			if (document != null) {
 				return document;
 			}
-			return new DocumentFactory().CreateFromFile(fileName);
-		}*/		
+			
+			SourceEditorDisplayBindingWrapper w = new SourceEditorDisplayBindingWrapper ();
+			w.Load (fileName);
+			return (SourceEditor) w.Control;	
+		}		
 		
 		public ProvidedDocumentInformation (SourceEditor document, string fileName)
 		{

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceInFilesManager.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceInFilesManager.cs	2004-02-20 08:13:56 UTC (rev 965)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceInFilesManager.cs	2004-02-20 19:58:27 UTC (rev 966)
@@ -16,6 +16,10 @@
 using ICSharpCode.SharpDevelop.Gui.Dialogs;
 using ICSharpCode.SharpDevelop.Gui.Pads;
 
+using MonoDevelop.SourceEditor.Gui;
+
+using Gtk;
+
 namespace ICSharpCode.TextEditor.Document
 {
 	public class SearchReplaceInFilesManager
@@ -26,7 +30,7 @@
 		static PropertyService      propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
 		
 		static string              currentFileName = String.Empty;
-		//static IDocument currentDocument = null;
+		static SourceEditor        currentDocument = null;
 		
 		public static SearchOptions SearchOptions {
 			get {
@@ -64,13 +68,19 @@
 			if (currentFileName != result.FileName) {
 				// if not, create new document
 				currentFileName = result.FileName;
-				//currentDocument = result.CreateDocument(); 
+				currentDocument = result.CreateDocument(); 
 			}
 			
 			// get line out of the document and display it in the task list
 			//int lineNumber = currentDocument.GetLineNumberForOffset(Math.Min(currentDocument.TextLength, result.Offset));
+			TextIter resultIter = currentDocument.Buffer.GetIterAtOffset (result.Offset);
+			int lineNumber = resultIter.Line;
+
+			TextIter start_line = resultIter, end_line = resultIter;
+			start_line.LineOffset = 0;
+			end_line.ForwardToLineEnd ();
 			//LineSegment line = currentDocument.GetLineSegment(lineNumber);
-			//taskService.Tasks.Add(new Task(result.FileName, currentDocument.GetText(line.Offset, line.Length), result.Offset - line.Offset, lineNumber));
+			taskService.Tasks.Add(new Task(result.FileName, currentDocument.Buffer.GetText(start_line.Offset, end_line.Offset - start_line.Offset), resultIter.LineOffset, lineNumber));
 		}
 		
 		static bool InitializeSearchInFiles()
@@ -86,7 +96,7 @@
 			find.SearchStrategy.CompilePattern(searchOptions);
 			
 			currentFileName = String.Empty;
-			//currentDocument = null;
+			currentDocument = null;
 			
 			return true;
 		}

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchResult/DefaultSearchResult.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchResult/DefaultSearchResult.cs	2004-02-20 08:13:56 UTC (rev 965)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchResult/DefaultSearchResult.cs	2004-02-20 19:58:27 UTC (rev 966)
@@ -12,6 +12,8 @@
 using ICSharpCode.Core.Properties;
 using ICSharpCode.SharpDevelop.Internal.Undo;
 
+using MonoDevelop.SourceEditor.Gui;
+
 namespace ICSharpCode.TextEditor.Document
 {
 	public class DefaultSearchResult : ISearchResult
@@ -49,10 +51,10 @@
 			return pattern;
 		}
 		
-		/*public IDocument CreateDocument()
+		public SourceEditor CreateDocument()
 		{
 			return providedDocumentInformation.CreateDocument();
-		}*/
+		}
 		
 		public DefaultSearchResult(int offset, int length)
 		{

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchResult/ISearchResult.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchResult/ISearchResult.cs	2004-02-20 08:13:56 UTC (rev 965)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchResult/ISearchResult.cs	2004-02-20 19:58:27 UTC (rev 966)
@@ -12,6 +12,8 @@
 using ICSharpCode.Core.Properties;
 using ICSharpCode.SharpDevelop.Internal.Undo;
 
+using MonoDevelop.SourceEditor.Gui;
+
 namespace ICSharpCode.TextEditor.Document
 {
 	/// <summary>
@@ -56,6 +58,7 @@
 		/// This method creates a document for the file FileName. This method works
 		/// only after the ProvidedDocumentInformation is set.
 		/// </remarks>
+		SourceEditor CreateDocument ();
 		
 		/// <remarks>
 		/// Replace operations must transform the replace pattern with this




More information about the Monodevelop-patches-list mailing list