[Monodevelop-patches-list] r2275 - in trunk/MonoDevelop/Core/src: AddIns/DisplayBindings/SourceEditor AddIns/DisplayBindings/SourceEditor/Commands AddIns/DisplayBindings/SourceEditor/Gui/Dialogs AddIns/DisplayBindings/SourceEditor/Search MonoDevelop.Base MonoDevelop.Base/Services
Todd Berman <tberman@sevenl.net>
tberman at mono-cvs.ximian.com
Sat Feb 26 15:59:11 EST 2005
Author: tberman
Date: 2005-02-26 15:59:11 -0500 (Sat, 26 Feb 2005)
New Revision: 2275
Modified:
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Commands/SearchCommands.cs
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceDialog.cs
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceInFilesDialog.cs
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceInFilesManager.cs
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceManager.cs
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/texteditoraddin.glade
trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/MessageService.cs
Log:
In Core/src/MonoDevelop.Base:
2005-02-26 Poul Andersen <pba at mailme.dk>
* Services/MessageService.cs: Added ShowMessage(string message, Gtk.Window parent )
to ensure modal messagebox as window on top.
In Core/src/AddIns/DisplayBindings/SourceEditor:
2005-02-26 Poul Andersen <pba at mailme.dk>
* Gui/Dialogs/ReplaceDialog.cs: Added property DialogPointer.
* Gui/Dialogs/ReplaceInFilesDialog.cs: Added property DialogPointer.
Added StopButton for search in files.
* Commands/SearchCommands.cs: Added call to SetSearchPattern to ensure
selected text in the editor is used for searching.
* Search/SearchReplaceManager.cs: Changed MessageBoxes to call
Runtime.Service... using new "window on top" modal dialog box.
* Search/SearchReplaceInFilesManager.cs: Added property DialogPointer
* texteditoraddin.glade: Added Stop Button for Find in Files.
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog 2005-02-26 20:45:19 UTC (rev 2274)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog 2005-02-26 20:59:11 UTC (rev 2275)
@@ -1,3 +1,14 @@
+2005-02-26 Poul Andersen <pba at mailme.dk>
+ * Gui/Dialogs/ReplaceDialog.cs: Added property DialogPointer.
+ * Gui/Dialogs/ReplaceInFilesDialog.cs: Added property DialogPointer.
+ Added StopButton for search in files.
+ * Commands/SearchCommands.cs: Added call to SetSearchPattern to ensure
+ selected text in the editor is used for searching.
+ * Search/SearchReplaceManager.cs: Changed MessageBoxes to call
+ Runtime.Service... using new "window on top" modal dialog box.
+ * Search/SearchReplaceInFilesManager.cs: Added property DialogPointer
+ * texteditoraddin.glade: Added Stop Button for Find in Files.
+
2005-02-26 John Luke <john.luke at gmail.com>
* Gui/SourceEditorWidget.cs: dont always set Highlight=true
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Commands/SearchCommands.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Commands/SearchCommands.cs 2005-02-26 20:45:19 UTC (rev 2274)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Commands/SearchCommands.cs 2005-02-26 20:59:11 UTC (rev 2275)
@@ -126,13 +126,16 @@
SearchReplaceInFilesManager.SearchOptions.SearchPattern = selectedText.Split ('\n')[0];
}
}
+
+
+
public override void Run ()
{
SetSearchPattern ();
if (SearchReplaceInFilesManager.ReplaceDialog != null) {
if (SearchReplaceInFilesManager.ReplaceDialog.replaceMode == false) {
- //SearchReplaceInFilesManager.ReplaceDialog.SetSearchPattern(SearchReplaceInFilesManager.SearchOptions.SearchPattern);
+ SearchReplaceInFilesManager.ReplaceDialog.SetSearchPattern(SearchReplaceInFilesManager.SearchOptions.SearchPattern);
SearchReplaceInFilesManager.ReplaceDialog.Present ();
} else {
SearchReplaceInFilesManager.ReplaceDialog.Destroy ();
@@ -154,7 +157,7 @@
if (SearchReplaceInFilesManager.ReplaceDialog != null) {
if (SearchReplaceInFilesManager.ReplaceDialog.replaceMode == true) {
- //SearchReplaceInFilesManager.ReplaceDialog.SetSearchPattern(SearchReplaceInFilesManager.SearchOptions.SearchPattern);
+ SearchReplaceInFilesManager.ReplaceDialog.SetSearchPattern(SearchReplaceInFilesManager.SearchOptions.SearchPattern);
SearchReplaceInFilesManager.ReplaceDialog.Present ();
} else {
SearchReplaceInFilesManager.ReplaceDialog.Destroy ();
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceDialog.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceDialog.cs 2005-02-26 20:45:19 UTC (rev 2274)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceDialog.cs 2005-02-26 20:59:11 UTC (rev 2275)
@@ -411,5 +411,12 @@
searchPatternEntry.SelectRegion (0, searchPatternEntry.Text.Length);
}
#endregion
+
+ public Gtk.Dialog DialogPointer
+ {
+ get {
+ return ReplaceDialogPointer;
+ }
+ }
}
}
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceInFilesDialog.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceInFilesDialog.cs 2005-02-26 20:45:19 UTC (rev 2274)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceInFilesDialog.cs 2005-02-26 20:59:11 UTC (rev 2275)
@@ -54,6 +54,8 @@
[Glade.Widget] Gtk.Button browseButton;
[Glade.Widget] Gtk.Label label6;
[Glade.Widget] Gtk.Label label7;
+ [Glade.Widget] Gtk.Button stopButton;
+
Gtk.Dialog ReplaceDialogPointer;
@@ -205,6 +207,8 @@
browseButton.Clicked += new EventHandler(BrowseDirectoryEvent);
findButton.Clicked += new EventHandler(FindEvent);
+
+ stopButton.Clicked += new EventHandler(StopEvent);
searchPatternEntry.Text = SearchReplaceInFilesManager.SearchOptions.SearchPattern;
@@ -226,7 +230,14 @@
if (SetupSearchReplaceInFilesManager ())
SearchReplaceInFilesManager.FindAll ();
}
+
+ void StopEvent (object sender, EventArgs e)
+ {
+ if (SetupSearchReplaceInFilesManager ())
+ SearchReplaceInFilesManager.CancelSearch();
+ }
+
void ReplaceEvent(object sender, EventArgs e)
{
if (SetupSearchReplaceInFilesManager ())
@@ -248,7 +259,7 @@
System.Environment.GetEnvironmentVariable ("HOME"),
"Projects")).ToString ();
}
-
+ fd.SetFilename( defaultFolder );
if (fd.Run() == (int)Gtk.ResponseType.Ok)
{
directoryTextBox.Text = fd.Filename;
@@ -270,6 +281,11 @@
specialSearchStrategyComboBox.Sensitive = useSpecialSearchStrategyCheckBox.Active;
}
+ public void SetSearchPattern(string pattern)
+ {
+ searchPatternEntry.Text = pattern;
+ }
+
bool SetupSearchReplaceInFilesManager()
{
FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
@@ -338,5 +354,11 @@
}
return true;
}
+
+ public Gtk.Dialog DialogPointer {
+ get {
+ return ReplaceDialogPointer;
+ }
+ }
}
}
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceInFilesManager.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceInFilesManager.cs 2005-02-26 20:45:19 UTC (rev 2274)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceInFilesManager.cs 2005-02-26 20:59:11 UTC (rev 2275)
@@ -220,7 +220,7 @@
FinishSearchInFiles ();
}
- static void CancelSearch ()
+ public static void CancelSearch ()
{
if (!searching) return;
cancelled = true;
@@ -233,6 +233,17 @@
}
cancelled = false;
- }
+ }
+
+ public static Gtk.Dialog DialogPointer
+ {
+ get {
+ if ( ReplaceDialog != null ){
+ return ReplaceDialog.DialogPointer;
+ }
+ return null;
+ }
+ }
+
}
}
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceManager.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceManager.cs 2005-02-26 20:45:19 UTC (rev 2274)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceManager.cs 2005-02-26 20:59:11 UTC (rev 2275)
@@ -101,8 +101,7 @@
ISearchResult result = SearchReplaceManager.find.FindNext(searchOptions);
if (result == null) {
- //MessageBox.Show((Form)WorkbenchSingleton.Workbench, "Mark all done", "Finished");
- MessageService.ShowMessage (GettextCatalog.GetString ("Mark all completed"));
+ Runtime.MessageService.ShowMessage(GettextCatalog.GetString ("Mark all completed"), DialogPointer );
find.Reset();
return;
} else {
@@ -134,8 +133,7 @@
ISearchResult result = SearchReplaceManager.find.FindNext(SearchReplaceManager.searchOptions);
if (result == null) {
- //MessageBox.Show((Form)WorkbenchSingleton.Workbench, "Replace all done", "Finished");
- MessageService.ShowMessage (string.Format (GettextCatalog.GetString ("Replace all finished. {0} matches found."), find.MatchCount));
+ Runtime.MessageService.ShowMessage( string.Format (GettextCatalog.GetString ("Replace all finished. {0} matches found."), find.MatchCount), DialogPointer );
find.Reset();
return;
} else {
@@ -173,8 +171,8 @@
find.SearchStrategy.CompilePattern(searchOptions);
ISearchResult result = find.FindNext(searchOptions);
- if (result == null) {
- MessageService.ShowMessage (GettextCatalog.GetString ("Not Found"));
+ if (result == null) {
+ Runtime.MessageService.ShowMessage(GettextCatalog.GetString ("Search string not Found:") + "\n" + SearchOptions.SearchPattern, DialogPointer );
find.Reset();
} else {
SourceEditor_ textArea = OpenTextArea(result.FileName);
@@ -201,6 +199,17 @@
Gtk.Application.RunIteration ();
return ((SourceEditorDisplayBindingWrapper)WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent).Editor;
- }
+ }
+
+ public static Gtk.Dialog DialogPointer
+ {
+ get {
+ if ( ReplaceDialog != null ) {
+ return ReplaceDialog.DialogPointer;
+ }
+ return null;
+ }
+ }
+
}
}
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/texteditoraddin.glade
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/texteditoraddin.glade 2005-02-26 20:45:19 UTC (rev 2274)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/texteditoraddin.glade 2005-02-26 20:59:11 UTC (rev 2275)
@@ -694,6 +694,77 @@
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
+ <widget class="GtkButton" id="stopButton">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">0</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment5">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox20">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image5">
+ <property name="visible">True</property>
+ <property name="stock">gtk-stop</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Stop</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
<widget class="GtkButton" id="closeButton">
<property name="visible">True</property>
<property name="can_default">True</property>
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog 2005-02-26 20:45:19 UTC (rev 2274)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog 2005-02-26 20:59:11 UTC (rev 2275)
@@ -1,3 +1,7 @@
+2005-02-26 Poul Andersen <pba at mailme.dk>
+ * Services/MessageService.cs: Added ShowMessage(string message, Gtk.Window parent )
+ to ensure modal messagebox as window on top.
+
2005-02-20 John Luke <john.luke at gmail.com>
* Gui/Components/SharpMessageBox.cs
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/MessageService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/MessageService.cs 2005-02-26 20:45:19 UTC (rev 2274)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/MessageService.cs 2005-02-26 20:59:11 UTC (rev 2275)
@@ -12,6 +12,7 @@
using MonoDevelop.Core.AddIns;
using MonoDevelop.Core.Properties;
using MonoDevelop.Services;
+using Gtk;
namespace MonoDevelop.Core.Services
{
@@ -147,6 +148,17 @@
md.ShowAll ();
}
+ public void ShowMessage(string message, Gtk.Window parent )
+ {
+ Gtk.MessageDialog md = new Gtk.MessageDialog ((Gtk.Window) WorkbenchSingleton.Workbench, Gtk.DialogFlags.Modal | Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Info, Gtk.ButtonsType.Ok, message );
+ if ( parent != null )
+ {
+ md.TransientFor = parent;
+ }
+ md.Response += new Gtk.ResponseHandler(OnMessageResponse);
+ md.ShowAll ();
+ }
+
void OnMessageResponse (object o, Gtk.ResponseArgs e)
{
((Gtk.MessageDialog)o).Hide ();
More information about the Monodevelop-patches-list
mailing list