[Monodevelop-patches-list] r970 - in trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor: Commands Gui/Dialogs Search
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Fri Feb 20 19:03:22 EST 2004
Author: tberman
Date: 2004-02-20 19:03:22 -0500 (Fri, 20 Feb 2004)
New Revision: 970
Modified:
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Commands/SearchCommands.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceInFilesDialog.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceInFilesManager.cs
Log:
more hydra fixes
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Commands/SearchCommands.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Commands/SearchCommands.cs 2004-02-20 23:24:55 UTC (rev 969)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Commands/SearchCommands.cs 2004-02-21 00:03:22 UTC (rev 970)
@@ -134,8 +134,19 @@
public override void Run()
{
SetSearchPattern();
- ReplaceInFilesDialog rd = new ReplaceInFilesDialog(false);
- rd.ShowAll ();
+ if (SearchReplaceInFilesManager.ReplaceDialog != null) {
+ if (SearchReplaceInFilesManager.ReplaceDialog.replaceMode == false) {
+ //SearchReplaceInFilesManager.ReplaceDialog.SetSearchPattern(SearchReplaceInFilesManager.SearchOptions.SearchPattern);
+ SearchReplaceInFilesManager.ReplaceDialog.Present ();
+ } else {
+ SearchReplaceInFilesManager.ReplaceDialog.Destroy ();
+ ReplaceInFilesDialog rd = new ReplaceInFilesDialog (false);
+ rd.ShowAll ();
+ }
+ } else {
+ ReplaceInFilesDialog rd = new ReplaceInFilesDialog(false);
+ rd.ShowAll();
+ }
}
}
@@ -144,8 +155,20 @@
public override void Run()
{
FindInFiles.SetSearchPattern();
- ReplaceInFilesDialog rd = new ReplaceInFilesDialog (true);
- rd.ShowAll ();
+
+ if (SearchReplaceInFilesManager.ReplaceDialog != null) {
+ if (SearchReplaceInFilesManager.ReplaceDialog.replaceMode == true) {
+ //SearchReplaceInFilesManager.ReplaceDialog.SetSearchPattern(SearchReplaceInFilesManager.SearchOptions.SearchPattern);
+ SearchReplaceInFilesManager.ReplaceDialog.Present ();
+ } else {
+ SearchReplaceInFilesManager.ReplaceDialog.Destroy ();
+ ReplaceInFilesDialog rd = new ReplaceInFilesDialog (true);
+ rd.ShowAll ();
+ }
+ } else {
+ ReplaceInFilesDialog rd = new ReplaceInFilesDialog(true);
+ rd.ShowAll();
+ }
}
}
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceInFilesDialog.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceInFilesDialog.cs 2004-02-20 23:24:55 UTC (rev 969)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceInFilesDialog.cs 2004-02-21 00:03:22 UTC (rev 970)
@@ -18,6 +18,8 @@
using ICSharpCode.SharpDevelop.Services;
using ICSharpCode.TextEditor;
+using MonoDevelop.Gui.Widgets;
+
using Glade;
using Gtk;
@@ -29,7 +31,7 @@
IMessageService messageService = (IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService (typeof (StringParserService));
static PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
- bool replaceMode;
+ public bool replaceMode;
[Glade.Widget] Gtk.Combo searchPatternComboBox;
[Glade.Widget] Gtk.Combo replacePatternComboBox;
@@ -108,9 +110,7 @@
// set the label properties
label2.Text = stringParserService.Parse ("${res:Dialog.NewProject.SearchReplace.ReplaceWith}");
//replaceButton.Label = stringParserService.Parse ("${res:Dialog.NewProject.SearchReplace.ReplaceButton}");
- replaceAllButton.Label = stringParserService.Parse ("${res:Dialog.NewProject.SearchReplace.ReplaceAllButton}");
- replaceButton.UseUnderline = true;
- replaceAllButton.UseUnderline = true;
+ //replaceButton.UseUnderline = true;
// set te size groups to include the replace dialog
labels.AddWidget(label2);
@@ -134,9 +134,19 @@
{
// perform the standard closing windows event
OnClosed();
- SearchReplaceManager.ReplaceDialog = null;
+ SearchReplaceInFilesManager.ReplaceDialog = null;
}
+ public void Present ()
+ {
+ ReplaceDialogPointer.Present ();
+ }
+
+ public void Destroy ()
+ {
+ ReplaceDialogPointer.Destroy ();
+ }
+
void CloseDialogEvent(object sender, EventArgs e)
{
ReplaceDialogPointer.Hide();
@@ -146,6 +156,7 @@
public void ShowAll ()
{
ReplaceDialogPointer.ShowAll ();
+ SearchReplaceInFilesManager.ReplaceDialog = this;
}
public ReplaceInFilesDialog(bool replaceMode)
@@ -249,10 +260,14 @@
void BrowseDirectoryEvent(object sender, EventArgs e)
{
- //FolderDialog fd = new FolderDialog();
+ FolderDialog fd = new FolderDialog("Select directory");
//if (fd.DisplayDialog(resourceService.GetString("NewProject.SearchReplace.FindInFilesBrowseLabel")) == DialogResult.OK) {
// ControlDictionary["directoryTextBox"].Text = fd.Path;
//}
+ if (fd.Run() == (int)Gtk.ResponseType.Ok)
+ {
+ directoryTextBox.Text = fd.Filename;
+ }
}
void SearchLocationCheckBoxChangedEvent(object sender, EventArgs e)
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceInFilesManager.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceInFilesManager.cs 2004-02-20 23:24:55 UTC (rev 969)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceInFilesManager.cs 2004-02-21 00:03:22 UTC (rev 970)
@@ -24,6 +24,8 @@
{
public class SearchReplaceInFilesManager
{
+ public static ReplaceInFilesDialog ReplaceDialog;
+
static IFind find = new DefaultFind();
static SearchOptions searchOptions = new SearchOptions("SharpDevelop.SearchAndReplace.SearchAndReplaceInFilesProperties");
More information about the Monodevelop-patches-list
mailing list