diff options
author | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-20 19:07:51 +0300 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-20 19:07:51 +0300 |
commit | 95408b1a41b31b645f3a8c3323ab7d3ca4bff26b (patch) | |
tree | f8f137cddcb9a40499d303be95722fd2c6081bce /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs | |
parent | b70e4e04b4e41b8ec28d7e4b220b401ecf467e7a (diff) | |
parent | de043d330a8bf5855d4d983c804cd36727cb2406 (diff) |
Merge remote-tracking branch 'origin/roslyn' into new-project-model
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs index f4e64d6990..451299685d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs @@ -37,6 +37,11 @@ using MonoDevelop.Ide.Gui.Content; namespace MonoDevelop.Ide.FindInFiles { + public enum PathMode { + Absolute, + Hidden + } + public partial class FindInFilesDialog : Gtk.Dialog { readonly bool writeScope = true; @@ -191,7 +196,7 @@ namespace MonoDevelop.Ide.FindInFiles toggleFindInFiles.Toggle (); if (IdeApp.Workbench.ActiveDocument != null) { - var view = IdeApp.Workbench.ActiveDocument.GetContent<ITextBuffer> (); + var view = IdeApp.Workbench.ActiveDocument.Editor; if (view != null) { string selectedText = FormatPatternToSelectionOption (view.SelectedText, properties.Get ("RegexSearch", false)); if (!string.IsNullOrEmpty (selectedText)) { @@ -668,9 +673,17 @@ namespace MonoDevelop.Ide.FindInFiles switch ((SearchScope) comboboxScope.Active) { case SearchScope.CurrentDocument: + if (IdeApp.Workbench.ActiveDocument == null) { + MessageService.ShowError (GettextCatalog.GetString ("Currently there is no open document.")); + return null; + } scope = new DocumentScope (); break; case SearchScope.Selection: + if (IdeApp.Workbench.ActiveDocument == null) { + MessageService.ShowError (GettextCatalog.GetString ("Currently there is no open document.")); + return null; + } scope = new SelectionScope (); break; case SearchScope.WholeWorkspace: @@ -699,6 +712,10 @@ namespace MonoDevelop.Ide.FindInFiles MessageService.ShowError (GettextCatalog.GetString ("Currently there is no open solution.")); return null; case SearchScope.AllOpenFiles: + if (IdeApp.Workbench.Documents.Count == 0) { + MessageService.ShowError (GettextCatalog.GetString ("Currently there are no open documents.")); + return null; + } scope = new AllOpenFilesScope (); break; case SearchScope.Directories: @@ -790,6 +807,9 @@ namespace MonoDevelop.Ide.FindInFiles ThreadPool.QueueUserWorkItem (delegate { CancellationTokenSource cancelSource = new CancellationTokenSource (); using (SearchProgressMonitor searchMonitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, cancellationTokenSource:cancelSource)) { + + searchMonitor.PathMode = scope.PathMode; + searchMonitor.ReportStatus (scope.GetDescription (options, pattern, null)); lock (searchesInProgress) searchesInProgress.Add (cancelSource); |