diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2012-01-02 16:29:27 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2012-01-02 16:29:27 +0400 |
commit | c1ee09f0217e56b30c672bec2f76a55ff85449ba (patch) | |
tree | b90ac1bbd0e40093b30ae05c8062eb661cb24e6f | |
parent | 795e73c6c1cafc5898afeac022aa520974675888 (diff) | |
parent | 45132db7a43b404c9075a85a7754915c43648278 (diff) |
Merge branch 'master' into newresolver
Conflicts:
main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs
88 files changed, 2246 insertions, 1429 deletions
@@ -36,7 +36,6 @@ distcheck: distcheck-recursive distclean: distclean-recursive rm -rf config.make local-config - dist: dist-recursive rm -rf tarballs @@ -50,7 +49,7 @@ dist: dist-recursive gunzip $$t ;\ done for t in `ls tarballs/*.tar`; do \ - bzip2 $$t ;\ + bzip2 $$t ;\ done rm -rf specs mkdir -p specs @@ -62,7 +61,10 @@ dist: dist-recursive run: cd main && make run - + +run-gdb: + cd main && make run-gdb + test: cd main/tests/UnitTests && make test fixture=$(fixture) diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionNodeBuilder.cs index c5c2fa6fdc..4095a15a48 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionNodeBuilder.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionNodeBuilder.cs @@ -64,7 +64,7 @@ namespace MonoDevelop.AddinAuthoring.NodeBuilders public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Pixbuf icon, ref Pixbuf closedIcon) { Extension ext = (Extension) dataObject; - label = Util.GetDisplayName (ext); + label = EscapeTextForMarkup (Util.GetDisplayName (ext)); icon = Context.GetIcon ("md-extension"); } diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionPointNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionPointNodeBuilder.cs index 76446829e1..2e7cfa5693 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionPointNodeBuilder.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/ExtensionPointNodeBuilder.cs @@ -71,7 +71,7 @@ namespace MonoDevelop.AddinAuthoring.NodeBuilders public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Pixbuf icon, ref Pixbuf closedIcon) { ExtensionPoint ep = (ExtensionPoint) dataObject; - label = !string.IsNullOrEmpty (ep.Name) ? ep.Name : ep.Path; + label = EscapeTextForMarkup (!string.IsNullOrEmpty (ep.Name) ? ep.Name : ep.Path); icon = Context.GetIcon ("md-extension-point"); } diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/SolutionNodeBuilder.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/SolutionNodeBuilder.cs index 0df58e778f..0382b13032 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/SolutionNodeBuilder.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.NodeBuilders/SolutionNodeBuilder.cs @@ -71,7 +71,7 @@ namespace MonoDevelop.AddinAuthoring.NodeBuilders public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon) { Solution sol = (Solution) dataObject; - label = sol.Name; + label = EscapeTextForMarkup (sol.Name); icon = Context.GetIcon (MonoDevelop.Ide.Gui.Stock.Solution); } diff --git a/extras/MonoDevelop.Database/MonoDevelop.Database.Sql/Dialect/AbstractSqlDialect.cs b/extras/MonoDevelop.Database/MonoDevelop.Database.Sql/Dialect/AbstractSqlDialect.cs index 2d5d5e3185..9d801c0a41 100644 --- a/extras/MonoDevelop.Database/MonoDevelop.Database.Sql/Dialect/AbstractSqlDialect.cs +++ b/extras/MonoDevelop.Database/MonoDevelop.Database.Sql/Dialect/AbstractSqlDialect.cs @@ -244,8 +244,8 @@ namespace MonoDevelop.Database.Sql int columnCount = statement.Columns.Count; for (int i=0; i<columnCount; i++) { OperatorExpression expr = new OperatorExpression (statement.Columns[i], Operator.Equals, statement.Values[i]); - sb.Append (expr); - sb.Append (i == (columnCount - 1) ? ", " : ""); + sb.Append (GetExpressionSql (expr)); + sb.Append (i != (columnCount - 1) ? ", " : ""); } if (statement.Where != null) { diff --git a/extras/MonoDevelop.Database/MonoDevelop.Database.Sql/Providers/AbstractSchemaProvider.cs b/extras/MonoDevelop.Database/MonoDevelop.Database.Sql/Providers/AbstractSchemaProvider.cs index 0d4f1bd594..6b13b2e3a0 100644 --- a/extras/MonoDevelop.Database/MonoDevelop.Database.Sql/Providers/AbstractSchemaProvider.cs +++ b/extras/MonoDevelop.Database/MonoDevelop.Database.Sql/Providers/AbstractSchemaProvider.cs @@ -813,42 +813,32 @@ namespace MonoDevelop.Database.Sql public virtual string GetSelectQuery (TableSchema table)
{
- StringBuilder sb = new StringBuilder ("SELECT ");
- bool coma = false;
+ ISqlDialect dialect = this.ConnectionPool.DbFactory.Dialect;
+ IdentifierExpression tableId = new IdentifierExpression (table.Name);
+ List<IdentifierExpression> columns = new List<IdentifierExpression>();
+
foreach (ColumnSchema col in table.Columns) {
- if (coma)
- sb.AppendFormat(",");
- coma = true;
- sb.AppendLine ();
- sb.AppendFormat ("{0}{1}", Convert.ToString (Convert.ToChar (9)), col.Name);
+ columns.Add(new IdentifierExpression(col.Name));
}
- sb.AppendLine ();
- sb.AppendFormat ("FROM {0}", table.Name);
- return sb.ToString ();
+
+ SelectStatement sel = new SelectStatement (new FromTableClause (tableId),columns);
+ return dialect.GetSql(sel);
}
public virtual string GetUpdateQuery (TableSchema table)
{
- StringBuilder sb = new StringBuilder ("UPDATE ");
- sb.AppendFormat ("{0} {1}{1}{2}SET", table.Name, Convert.ToString (Convert.ToChar (9)), Environment.NewLine);
- bool coma = false;
+ ISqlDialect dialect = this.ConnectionPool.DbFactory.Dialect;
+ IdentifierExpression tableId = new IdentifierExpression (table.Name);
+ List<IdentifierExpression> columns = new List<IdentifierExpression>();
+ List<IExpression> values = new List<IExpression>();
+
foreach (ColumnSchema col in table.Columns) {
- if (coma)
- sb.AppendFormat(",");
- coma = true;
- sb.AppendLine ();
- if (col.DataType.FullName.IndexOf ("varchar", StringComparison.OrdinalIgnoreCase) > -1 ||
- col.DataType.FullName.IndexOf ("char", StringComparison.OrdinalIgnoreCase) > -1 ||
- col.DataType.FullName.IndexOf ("nvarchar", StringComparison.OrdinalIgnoreCase) > -1 ||
- col.DataType.FullName.IndexOf ("varbinary", StringComparison.OrdinalIgnoreCase) > -1 ||
- col.DataType.FullName.IndexOf ("nchar", StringComparison.OrdinalIgnoreCase) > -1)
- sb.AppendFormat ("{2}{0} = <{1}({3})> ", col.Name, col.DataType.FullName, Convert.ToString (Convert.ToChar (9)), col.DataType.LengthRange.Max);
- else
- sb.AppendFormat ("{2}{0} = <{1}> ", col.Name, col.DataType.FullName, Convert.ToString (Convert.ToChar (9)));
+ columns.Add(new IdentifierExpression(col.Name));
+ values.Add(new IdentifierExpression(col.DataTypeName));
}
- sb.AppendLine ();
- sb.Append ("WHERE ");
- return sb.ToString ();
+
+ UpdateStatement upd = new UpdateStatement (tableId, columns, values);
+ return dialect.GetSql(upd);
}
public virtual string GetInsertQuery (TableSchema table)
diff --git a/extras/MonoDevelop.MonoMac/MonoDevelop.MonoMac/MonoMacProject.cs b/extras/MonoDevelop.MonoMac/MonoDevelop.MonoMac/MonoMacProject.cs index 9cc8697e07..9e87d60c6e 100644 --- a/extras/MonoDevelop.MonoMac/MonoDevelop.MonoMac/MonoMacProject.cs +++ b/extras/MonoDevelop.MonoMac/MonoDevelop.MonoMac/MonoMacProject.cs @@ -264,5 +264,16 @@ namespace MonoDevelop.MonoMac doc.WriteToFile (name); return AddFile (name); } + + protected override IList<string> GetCommonBuildActions () + { + return new string[] { + BuildAction.None, + BuildAction.Compile, + BuildAction.Content, + BuildAction.EmbeddedResource, + BuildAction.InterfaceDefinition, + }; + } } } diff --git a/main/Makefile.am b/main/Makefile.am index 673bd8ed04..b940c685ca 100644 --- a/main/Makefile.am +++ b/main/Makefile.am @@ -110,6 +110,11 @@ runmd: $(PROGRAM) run-debug: $(PROGRAM) MONODEVELOP_CONSOLE_LOG_LEVEL=All $(MD_LAUNCH) --debug=casts $(MD_BIN_PATH)/MonoDevelop.exe +run-gdb: $(PROGRAM) + echo "run --debug $(MD_BIN_PATH)/MonoDevelop.exe" > gdb.commands + $(MD_LAUNCH_SETUP) gdb $(RUNTIME) -x gdb.commands + rm -f gdb.commands + run-profile: $(PROGRAM) $(MD_LAUNCH) -O=inline --profile $(MD_BIN_PATH)/MonoDevelop.exe @@ -125,7 +130,7 @@ plot-trace: run-profile-heap: $(PROGRAM) $(MD_LAUNCH) -O=inline --profile=heap:heaplog $(MD_BIN_PATH)/MonoDevelop.exe - + check-addins: $(MDTOOL_RUN) setup reg-build -v @@ -156,7 +161,7 @@ include $(top_srcdir)/Makefile.include filter_stale_uninstalled = \ | egrep -v '^.*/share/mime/.*$$' \ | egrep -v '^.*./share/icons/hicolor/icon-theme\.cache$$' - + filter_stale_buildfiles = | egrep -v '^./report.out$$' distuninstallcheck_listfiles = find . -type f -print # automake-1.9 setting distuninstallcheck_listfiles += $(filter_stale_uninstalled) # amend by required filtering diff --git a/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj b/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj index d3c6b3a9d2..e3c1ac0039 100644 --- a/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj +++ b/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj @@ -120,6 +120,7 @@ <ProjectReference Include="..\Mono.Cecil\Mono.Cecil.csproj"> <Project>{3EC06433-F168-4C5B-A885-99CE4AB617E1}</Project> <Name>Mono.Cecil</Name> + <Private>False</Private> </ProjectReference> </ItemGroup> <ProjectExtensions> diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.DeployFileListWidget.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.DeployFileListWidget.cs index cbc6fe7d76..3a6a61f074 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.DeployFileListWidget.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.DeployFileListWidget.cs @@ -11,7 +11,7 @@ namespace MonoDevelop.Deployment private global::Gtk.ScrolledWindow scrolledwindow1; private global::Gtk.TreeView fileList; private global::Gtk.HBox hbox2; - + protected virtual void Build () { global::Stetic.Gui.Initialize (this); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.FileReplaceDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.FileReplaceDialog.cs index ff3b88c85c..2ef71e78f3 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.FileReplaceDialog.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.FileReplaceDialog.cs @@ -42,7 +42,7 @@ namespace MonoDevelop.Deployment private global::Gtk.Label label11; private global::Gtk.Button cancelButton; private global::Gtk.Button okButton; - + protected virtual void Build () { global::Stetic.Gui.Initialize (this); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.BinariesZipEditorWidget.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.BinariesZipEditorWidget.cs index 42d55638b8..35b70886c9 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.BinariesZipEditorWidget.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.BinariesZipEditorWidget.cs @@ -17,7 +17,7 @@ namespace MonoDevelop.Deployment.Gui private global::Gtk.Label label2; private global::Gtk.Label label3; private global::Gtk.Label label5; - + protected virtual void Build () { global::Stetic.Gui.Initialize (this); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.EntrySelectionTree.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.EntrySelectionTree.cs index c43d8bf994..7ac1d4336c 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.EntrySelectionTree.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.EntrySelectionTree.cs @@ -6,7 +6,7 @@ namespace MonoDevelop.Deployment.Gui { private global::Gtk.ScrolledWindow scrolledwindow1; private global::Gtk.TreeView tree; - + protected virtual void Build () { global::Stetic.Gui.Initialize (this); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.InstallDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.InstallDialog.cs index 0a7270dde5..67b5bce548 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.InstallDialog.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.InstallDialog.cs @@ -12,7 +12,7 @@ namespace MonoDevelop.Deployment.Gui private global::Gtk.Entry nameEntry; private global::Gtk.Button button19; private global::Gtk.Button buttonOk; - + protected virtual void Build () { global::Stetic.Gui.Initialize (this); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.PackagingFeatureWidget.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.PackagingFeatureWidget.cs index 5a6c53a50d..b7eb2557db 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.PackagingFeatureWidget.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.PackagingFeatureWidget.cs @@ -5,7 +5,7 @@ namespace MonoDevelop.Deployment.Gui internal partial class PackagingFeatureWidget { private global::Gtk.VBox box; - + protected virtual void Build () { global::Stetic.Gui.Initialize (this); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.SourcesZipEditorWidget.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.SourcesZipEditorWidget.cs index 5c49a8f9f6..66ea2e8b5f 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.SourcesZipEditorWidget.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.SourcesZipEditorWidget.cs @@ -15,7 +15,7 @@ namespace MonoDevelop.Deployment.Gui private global::Gtk.Label label1; private global::Gtk.Label label2; private global::Gtk.Label label3; - + protected virtual void Build () { global::Stetic.Gui.Initialize (this); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.SshFuseFileCopyConfigurationEditorWidget.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.SshFuseFileCopyConfigurationEditorWidget.cs index 69122aea33..b1166a7869 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.SshFuseFileCopyConfigurationEditorWidget.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.SshFuseFileCopyConfigurationEditorWidget.cs @@ -12,7 +12,7 @@ namespace MonoDevelop.Deployment.Gui private global::Gtk.Label label2; private global::Gtk.Label label3; private global::Gtk.Label label4; - + protected virtual void Build () { global::Stetic.Gui.Initialize (this); diff --git a/main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs b/main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs index 1909789e0d..2e8357dc33 100644 --- a/main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs +++ b/main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs @@ -86,11 +86,11 @@ namespace MonoDevelop.MacIntegration if (button.IsStockButton) label = Gtk.Stock.Lookup (label).Label; label = label.Replace ("_", ""); - + //this message seems to be a standard Mac message since alert handles it specially if (button == AlertButton.CloseWithoutSave) label = GettextCatalog.GetString ("Don't Save"); - + alert.AddButton (label); } diff --git a/main/src/addins/MacPlatform/Dialogs/MacExceptionDialogHandler.cs b/main/src/addins/MacPlatform/Dialogs/MacExceptionDialogHandler.cs index d094ab4321..e2173bf6e1 100644 --- a/main/src/addins/MacPlatform/Dialogs/MacExceptionDialogHandler.cs +++ b/main/src/addins/MacPlatform/Dialogs/MacExceptionDialogHandler.cs @@ -41,46 +41,217 @@ namespace MonoDevelop.MacIntegration { class MacExceptionDialogHandler : IExceptionDialogHandler { + class MyTextView : NSTextView + { + public MyTextView (RectangleF frame) + : base (frame) + { + + } + + public override void KeyDown (NSEvent theEvent) + { + if (theEvent.ModifierFlags.HasFlag (NSEventModifierMask.CommandKeyMask)) { + switch (theEvent.Characters) { + case "x": + Cut (this); + break; + case "c": + Copy (this); + break; + case "a": + SelectAll (this); + break; + } + } + + base.KeyDown (theEvent); + } + } + public bool Run (ExceptionDialogData data) { - using (var alert = new NSAlert ()) { - alert.AlertStyle = NSAlertStyle.Critical; + using (var alert = new NSAlert { AlertStyle = NSAlertStyle.Critical }) { + alert.Icon = NSApplication.SharedApplication.ApplicationIconImage; - var pix = ImageService.GetPixbuf (Gtk.Stock.DialogError, Gtk.IconSize.Dialog); - byte[] buf = pix.SaveToBuffer ("tiff"); - alert.Icon = new NSImage (NSData.FromArray (buf)); + alert.MessageText = data.Title ?? GettextCatalog.GetString ("Error"); - alert.MessageText = data.Title ?? "Some Message"; - alert.InformativeText = data.Message ?? "Some Info"; + if (!string.IsNullOrEmpty (data.Message)) { + alert.InformativeText = data.Message; + } - if (data.Exception != null) { + List<AlertButton> buttons = null; + if (data.Buttons != null && data.Buttons.Length > 0) + buttons = data.Buttons.Reverse ().ToList (); + + if (buttons != null) { + foreach (var button in buttons) { + var label = button.Label; + if (button.IsStockButton) + label = Gtk.Stock.Lookup (label).Label; + label = label.Replace ("_", ""); + + //this message seems to be a standard Mac message since alert handles it specially + if (button == AlertButton.CloseWithoutSave) + label = GettextCatalog.GetString ("Don't Save"); + + alert.AddButton (label); + } + } - var text = new NSTextView (new RectangleF (0, 0, float.MaxValue, float.MaxValue)); - text.HorizontallyResizable = true; + if (data.Exception != null) { + var scrollSize = new SizeF (400, 130); + float spacing = 4; + + string title = GettextCatalog.GetString ("View details"); + string altTitle = GettextCatalog.GetString ("Hide details"); + + var buttonFrame = new RectangleF (0, 0, 0, 0); + var button = new NSButton (buttonFrame) { + BezelStyle = NSBezelStyle.Disclosure, + Title = "", + AlternateTitle = "", + }; + button.SetButtonType (NSButtonType.OnOff); + button.SizeToFit (); + + var label = new MDClickableLabel (title) { + Alignment = NSTextAlignment.Left, + }; + label.SizeToFit (); + + button.SetFrameSize (new SizeF (button.Frame.Width, Math.Max (button.Frame.Height, label.Frame.Height))); + label.SetFrameOrigin (new PointF (button.Frame.Width + 5, button.Frame.Y)); + + var text = new MyTextView (new RectangleF (0, 0, float.MaxValue, float.MaxValue)) { + HorizontallyResizable = true, + }; text.TextContainer.ContainerSize = new SizeF (float.MaxValue, float.MaxValue); - text.TextContainer.WidthTracksTextView = false; + text.TextContainer.WidthTracksTextView = true; text.InsertText (new NSString (data.Exception.ToString ())); text.Editable = false; - - var scrollView = new NSScrollView (new RectangleF (0, 0, 450, 150)) { + + var scrollView = new NSScrollView (new RectangleF (PointF.Empty, SizeF.Empty)) { HasHorizontalScroller = true, - DocumentView = text, + HasVerticalScroller = true, }; -; - alert.AccessoryView = scrollView; + + var accessory = new NSView (new RectangleF (0, 0, scrollSize.Width, button.Frame.Height)); + accessory.AddSubview (scrollView); + accessory.AddSubview (button); + accessory.AddSubview (label); + + alert.AccessoryView = accessory; + + button.Activated += delegate { + float change; + if (button.State == NSCellStateValue.On) { + change = scrollSize.Height + spacing; + label.StringValue = altTitle; + scrollView.Hidden = false; + scrollView.Frame = new RectangleF (PointF.Empty, scrollSize); + scrollView.DocumentView = text; + } else { + change = -(scrollSize.Height + spacing); + label.StringValue = title; + scrollView.Hidden = true; + scrollView.Frame = new RectangleF (PointF.Empty, SizeF.Empty); + } + var f = accessory.Frame; + f.Height += change; + accessory.Frame = f; + var lf = label.Frame; + lf.Y += change; + label.Frame = lf; + var bf = button.Frame; + bf.Y += change; + button.Frame = bf; + label.SizeToFit (); + var panel = (NSPanel) alert.Window; + var pf = panel.Frame; + pf.Height += change; + pf.Y -= change; + panel.SetFrame (pf, true, true); + //unless we assign the icon again, it starts nesting old icon into the warning icon + alert.Icon = NSApplication.SharedApplication.ApplicationIconImage; + alert.Layout (); + }; + label.OnMouseUp += (sender, e) => button.PerformClick (e.Event); } - - // Hack up a slightly wider than normal alert dialog. I don't know how to do this in a nicer way - // as the min size constraints are apparently ignored. - var frame = ((NSPanel) alert.Window).Frame; - ((NSPanel) alert.Window).SetFrame (new RectangleF (frame.X, frame.Y, Math.Max (frame.Width, 600), frame.Height), true); - + int result = alert.RunModal () - (int)NSAlertButtonReturn.First; - + data.ResultButton = buttons != null ? buttons [result] : null; GtkQuartz.FocusWindow (data.TransientFor ?? MessageService.RootWindow); } return true; } + + class MDClickableLabel: MDLabel + { + public MDClickableLabel (string text) : base (text) + { + } + + public override void MouseDown (NSEvent theEvent) + { + if (OnMouseDown != null) + OnMouseDown (this, new NSEventArgs (theEvent)); + else + base.MouseDown (theEvent); + } + + public event EventHandler<NSEventArgs> OnMouseDown; + + public override void MouseUp (NSEvent theEvent) + { + if (OnMouseUp != null) + OnMouseUp (this, new NSEventArgs (theEvent)); + else + base.MouseUp (theEvent); + } + + public event EventHandler<NSEventArgs> OnMouseUp; + + public override void MouseEntered (NSEvent theEvent) + { + if (OnMouseEntered != null) + OnMouseEntered (this, new NSEventArgs (theEvent)); + else + base.MouseEntered (theEvent); + } + + public event EventHandler<NSEventArgs> OnMouseEntered; + + public override void MouseExited (NSEvent theEvent) + { + if (OnMouseExited != null) + OnMouseExited (this, new NSEventArgs (theEvent)); + else + base.MouseExited (theEvent); + } + + public event EventHandler<NSEventArgs> OnMouseExited; + + public override void MouseMoved (NSEvent theEvent) + { + if (OnMouseMoved != null) + OnMouseMoved (this, new NSEventArgs (theEvent)); + else + base.MouseMoved (theEvent); + } + + public event EventHandler<NSEventArgs> OnMouseMoved; + } + + class NSEventArgs : EventArgs + { + public NSEventArgs (NSEvent evt) + { + this.Event = evt; + } + + public NSEvent Event { get; private set; } + } } -} +}
\ No newline at end of file diff --git a/main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs b/main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs index 137f540cf0..c5296fa5b9 100644 --- a/main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs +++ b/main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs @@ -147,7 +147,7 @@ namespace MonoDevelop.MacIntegration var selection = MacSelectFileDialogHandler.GetSelectedFiles (panel); bool slnViewerSelected = false; if (viewerSelector != null) { - FillViewers (currentViewers, viewerSelector, selection); + FillViewers (currentViewers, viewerSelector, closeSolutionButton, selection); if (currentViewers.Count == 0 || currentViewers[0] != null) { if (closeSolutionButton != null) closeSolutionButton.Hidden = true; @@ -158,6 +158,15 @@ namespace MonoDevelop.MacIntegration slnViewerSelected = true; } box.Layout (); + + //re-center the accessory view in its parent, Cocoa does this for us initially and after + //resizing the window, but we need to do it again after altering its layout + var superFrame = box.View.Superview.Frame; + var frame = box.View.Frame; + //not sure why it's ceiling, but this matches the Cocoa layout + frame.X = (float) Math.Ceiling ((superFrame.Width - frame.Width) / 2); + frame.Y = (float) Math.Ceiling ((superFrame.Height - frame.Height) / 2); + box.View.Frame = frame; } if (encodingSelector != null) encodingSelector.Enabled = !slnViewerSelected; @@ -195,7 +204,7 @@ namespace MonoDevelop.MacIntegration return true; } - static void FillViewers (List<FileViewer> currentViewers, NSPopUpButton button, FilePath[] filenames) + static void FillViewers (List<FileViewer> currentViewers, NSPopUpButton button, NSButton closeSolutionButton, FilePath[] filenames) { button.Menu.RemoveAllItems (); currentViewers.Clear (); @@ -209,20 +218,37 @@ namespace MonoDevelop.MacIntegration if (System.IO.Directory.Exists (filename)) return; + int selected = 0; + int i = 0; + if (IdeApp.Services.ProjectService.IsWorkspaceItemFile (filename) || IdeApp.Services.ProjectService.IsSolutionItemFile (filename)) { button.Menu.AddItem (new NSMenuItem () { Title = GettextCatalog.GetString ("Solution Workbench") }); currentViewers.Add (null); + + if (closeSolutionButton != null) + closeSolutionButton.State = NSCellStateValue.On; + + i++; } + foreach (var vw in DisplayBindingService.GetFileViewers (filename, null)) { if (!vw.IsExternal) { button.Menu.AddItem (new NSMenuItem () { Title = vw.Title }); currentViewers.Add (vw); + + if (vw.CanUseAsDefault) { + if (closeSolutionButton != null) + closeSolutionButton.State = NSCellStateValue.Off; + + selected = i; + } + + i++; } } + button.Enabled = currentViewers.Count > 1; - button.SelectItem (0); + button.SelectItem (selected); } } - - } diff --git a/main/src/addins/MacPlatform/MacPlatform.cs b/main/src/addins/MacPlatform/MacPlatform.cs index 21e8ee50db..0c7351405e 100644 --- a/main/src/addins/MacPlatform/MacPlatform.cs +++ b/main/src/addins/MacPlatform/MacPlatform.cs @@ -480,7 +480,7 @@ end tell", directory.ToString ().Replace ("\"", "\\\""))); float x, y, width, height; if (visible.Height <= frame.Height) { - float dockHeight = visible.Y; + float dockHeight = visible.Y - frame.Y; float menubarHeight = (frame.Height - visible.Height) - dockHeight; height = frame.Height - menubarHeight - dockHeight; diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs index 334fbb9363..c5b89addad 100644 --- a/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs +++ b/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs @@ -1,262 +1,262 @@ -
-// This file has been generated by the GUI designer. Do not modify.
+ +// This file has been generated by the GUI designer. Do not modify. namespace MonoDevelop.AssemblyBrowser -{
+{ internal partial class AssemblyBrowserWidget - {
- private global::Gtk.UIManager UIManager;
- private global::Gtk.Action NavigateBackwardAction;
- private global::Gtk.Action NavigateForwardAction;
- private global::Gtk.Action goBackAction;
- private global::Gtk.Action goForwardAction;
- private global::Gtk.Action goBackAction1;
- private global::Gtk.VBox vbox1;
- private global::Gtk.HBox hbox2;
- private global::Gtk.Button buttonBack;
- private global::Gtk.Button buttonForeward;
- private global::Gtk.Label label3;
- private global::Gtk.ComboBox languageCombobox;
- private global::Gtk.Label label1;
- private global::MonoDevelop.Components.SearchEntry searchentry1;
- private global::Gtk.Label label2;
- private global::Gtk.ComboBox comboboxVisibilty;
- private global::Gtk.HPaned hpaned1;
- private global::Gtk.Alignment treeViewPlaceholder;
- private global::Gtk.VBox vbox3;
- private global::Gtk.Notebook notebook1;
- private global::Gtk.Notebook notebookInspection;
- private global::Gtk.ScrolledWindow documentationScrolledWindow;
- private global::Gtk.Label documentationLabel;
- private global::Gtk.Label label4;
- private global::Gtk.ScrolledWindow scrolledwindowEditor;
- private global::Gtk.Label label5;
- private global::Gtk.VBox searchWidget;
- private global::Gtk.ScrolledWindow scrolledwindow1;
- private global::Gtk.TreeView searchTreeview;
-
+ { + private global::Gtk.UIManager UIManager; + private global::Gtk.Action NavigateBackwardAction; + private global::Gtk.Action NavigateForwardAction; + private global::Gtk.Action goBackAction; + private global::Gtk.Action goForwardAction; + private global::Gtk.Action goBackAction1; + private global::Gtk.VBox vbox1; + private global::Gtk.HBox hbox2; + private global::Gtk.Button buttonBack; + private global::Gtk.Button buttonForeward; + private global::Gtk.Label label3; + private global::Gtk.ComboBox languageCombobox; + private global::Gtk.Label label1; + private global::MonoDevelop.Components.SearchEntry searchentry1; + private global::Gtk.Label label2; + private global::Gtk.ComboBox comboboxVisibilty; + private global::Gtk.HPaned hpaned1; + private global::Gtk.Alignment treeViewPlaceholder; + private global::Gtk.VBox vbox3; + private global::Gtk.Notebook notebook1; + private global::Gtk.Notebook notebookInspection; + private global::Gtk.ScrolledWindow documentationScrolledWindow; + private global::Gtk.Label documentationLabel; + private global::Gtk.Label label4; + private global::Gtk.ScrolledWindow scrolledwindowEditor; + private global::Gtk.Label label5; + private global::Gtk.VBox searchWidget; + private global::Gtk.ScrolledWindow scrolledwindow1; + private global::Gtk.TreeView searchTreeview; + protected virtual void Build () - {
- global::Stetic.Gui.Initialize (this);
- // Widget MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget
- Stetic.BinContainer w1 = global::Stetic.BinContainer.Attach (this);
- this.UIManager = new global::Gtk.UIManager ();
- global::Gtk.ActionGroup w2 = new global::Gtk.ActionGroup ("Default");
- this.NavigateBackwardAction = new global::Gtk.Action ("NavigateBackwardAction", global::Mono.Unix.Catalog.GetString ("Navigate backward"), null, "gtk-go-back");
- this.NavigateBackwardAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Navigate backward");
- w2.Add (this.NavigateBackwardAction, null);
- this.NavigateForwardAction = new global::Gtk.Action ("NavigateForwardAction", global::Mono.Unix.Catalog.GetString ("Navigate forward"), null, "gtk-go-forward");
- this.NavigateForwardAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Navigate forward");
- w2.Add (this.NavigateForwardAction, null);
- this.goBackAction = new global::Gtk.Action ("goBackAction", null, null, "gtk-go-back");
- w2.Add (this.goBackAction, null);
- this.goForwardAction = new global::Gtk.Action ("goForwardAction", null, null, "gtk-go-forward");
- w2.Add (this.goForwardAction, null);
- this.goBackAction1 = new global::Gtk.Action ("goBackAction1", null, null, "gtk-go-back");
- w2.Add (this.goBackAction1, null);
- this.UIManager.InsertActionGroup (w2, 0);
- this.Name = "MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget";
- // Container child MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.Gtk.Container+ContainerChild
- this.vbox1 = new global::Gtk.VBox ();
- this.vbox1.Name = "vbox1";
- this.vbox1.Spacing = 2;
- // Container child vbox1.Gtk.Box+BoxChild
- this.hbox2 = new global::Gtk.HBox ();
- this.hbox2.Name = "hbox2";
- this.hbox2.Spacing = 6;
- // Container child hbox2.Gtk.Box+BoxChild
- this.buttonBack = new global::Gtk.Button ();
- this.buttonBack.CanFocus = true;
- this.buttonBack.Name = "buttonBack";
- this.buttonBack.UseStock = true;
- this.buttonBack.UseUnderline = true;
- this.buttonBack.Label = "gtk-go-back";
- this.hbox2.Add (this.buttonBack);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.buttonBack]));
- w3.Position = 0;
- w3.Expand = false;
- w3.Fill = false;
- // Container child hbox2.Gtk.Box+BoxChild
- this.buttonForeward = new global::Gtk.Button ();
- this.buttonForeward.CanFocus = true;
- this.buttonForeward.Name = "buttonForeward";
- this.buttonForeward.UseStock = true;
- this.buttonForeward.UseUnderline = true;
- this.buttonForeward.Label = "gtk-go-forward";
- this.hbox2.Add (this.buttonForeward);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.buttonForeward]));
- w4.Position = 1;
- w4.Expand = false;
- w4.Fill = false;
- // Container child hbox2.Gtk.Box+BoxChild
- this.label3 = new global::Gtk.Label ();
- this.label3.Name = "label3";
- this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("_Visibility:");
- this.label3.UseUnderline = true;
- this.hbox2.Add (this.label3);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.label3]));
- w5.Position = 2;
- w5.Expand = false;
- w5.Fill = false;
- // Container child hbox2.Gtk.Box+BoxChild
- this.languageCombobox = global::Gtk.ComboBox.NewText ();
- this.languageCombobox.Name = "languageCombobox";
- this.hbox2.Add (this.languageCombobox);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.languageCombobox]));
- w6.PackType = ((global::Gtk.PackType)(1));
- w6.Position = 3;
- w6.Expand = false;
- w6.Fill = false;
- // Container child hbox2.Gtk.Box+BoxChild
- this.label1 = new global::Gtk.Label ();
- this.label1.Name = "label1";
- this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("_Language:");
- this.label1.UseUnderline = true;
- this.hbox2.Add (this.label1);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.label1]));
- w7.PackType = ((global::Gtk.PackType)(1));
- w7.Position = 4;
- w7.Expand = false;
- w7.Fill = false;
- // Container child hbox2.Gtk.Box+BoxChild
- this.searchentry1 = new global::MonoDevelop.Components.SearchEntry ();
- this.searchentry1.Name = "searchentry1";
- this.searchentry1.ForceFilterButtonVisible = false;
- this.searchentry1.IsCheckMenu = false;
- this.searchentry1.ActiveFilterID = 0;
- this.searchentry1.Ready = false;
- this.searchentry1.HasFocus = false;
- this.hbox2.Add (this.searchentry1);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.searchentry1]));
- w8.PackType = ((global::Gtk.PackType)(1));
- w8.Position = 5;
- // Container child hbox2.Gtk.Box+BoxChild
- this.label2 = new global::Gtk.Label ();
- this.label2.Name = "label2";
- this.label2.Xalign = 1F;
- this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("_Search:");
- this.label2.UseUnderline = true;
- this.hbox2.Add (this.label2);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.label2]));
- w9.PackType = ((global::Gtk.PackType)(1));
- w9.Position = 6;
- // Container child hbox2.Gtk.Box+BoxChild
- this.comboboxVisibilty = global::Gtk.ComboBox.NewText ();
- this.comboboxVisibilty.Name = "comboboxVisibilty";
- this.hbox2.Add (this.comboboxVisibilty);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.comboboxVisibilty]));
- w10.PackType = ((global::Gtk.PackType)(1));
- w10.Position = 7;
- w10.Expand = false;
- w10.Fill = false;
- this.vbox1.Add (this.hbox2);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox2]));
- w11.Position = 0;
- w11.Expand = false;
- w11.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.hpaned1 = new global::Gtk.HPaned ();
- this.hpaned1.CanFocus = true;
- this.hpaned1.Name = "hpaned1";
- this.hpaned1.Position = 271;
- // Container child hpaned1.Gtk.Paned+PanedChild
- this.treeViewPlaceholder = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
- this.treeViewPlaceholder.Name = "treeViewPlaceholder";
- this.hpaned1.Add (this.treeViewPlaceholder);
- global::Gtk.Paned.PanedChild w12 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.treeViewPlaceholder]));
- w12.Resize = false;
- // Container child hpaned1.Gtk.Paned+PanedChild
- this.vbox3 = new global::Gtk.VBox ();
- this.vbox3.Name = "vbox3";
- this.vbox3.Spacing = 6;
- // Container child vbox3.Gtk.Box+BoxChild
- this.notebook1 = new global::Gtk.Notebook ();
- this.notebook1.CanFocus = true;
- this.notebook1.Name = "notebook1";
- this.notebook1.CurrentPage = 0;
- this.notebook1.ShowBorder = false;
- // Container child notebook1.Gtk.Notebook+NotebookChild
- this.notebookInspection = new global::Gtk.Notebook ();
- this.notebookInspection.CanFocus = true;
- this.notebookInspection.Name = "notebookInspection";
- this.notebookInspection.CurrentPage = 1;
- // Container child notebookInspection.Gtk.Notebook+NotebookChild
- this.documentationScrolledWindow = new global::Gtk.ScrolledWindow ();
- this.documentationScrolledWindow.Name = "documentationScrolledWindow";
- this.documentationScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child documentationScrolledWindow.Gtk.Container+ContainerChild
- global::Gtk.Viewport w13 = new global::Gtk.Viewport ();
- w13.ShadowType = ((global::Gtk.ShadowType)(0));
- // Container child GtkViewport.Gtk.Container+ContainerChild
- this.documentationLabel = new global::Gtk.Label ();
- this.documentationLabel.Name = "documentationLabel";
- this.documentationLabel.Xpad = 6;
- this.documentationLabel.Ypad = 6;
- this.documentationLabel.Xalign = 0F;
- this.documentationLabel.Yalign = 0F;
- this.documentationLabel.UseMarkup = true;
- this.documentationLabel.Selectable = true;
- w13.Add (this.documentationLabel);
- this.documentationScrolledWindow.Add (w13);
- this.notebookInspection.Add (this.documentationScrolledWindow);
- // Notebook tab
- this.label4 = new global::Gtk.Label ();
- this.label4.Name = "label4";
- this.label4.LabelProp = global::Mono.Unix.Catalog.GetString ("summary");
- this.notebookInspection.SetTabLabel (this.documentationScrolledWindow, this.label4);
- this.label4.ShowAll ();
- // Container child notebookInspection.Gtk.Notebook+NotebookChild
- this.scrolledwindowEditor = new global::Gtk.ScrolledWindow ();
- this.scrolledwindowEditor.CanFocus = true;
- this.scrolledwindowEditor.Name = "scrolledwindowEditor";
- this.scrolledwindowEditor.ShadowType = ((global::Gtk.ShadowType)(1));
- this.notebookInspection.Add (this.scrolledwindowEditor);
- global::Gtk.Notebook.NotebookChild w17 = ((global::Gtk.Notebook.NotebookChild)(this.notebookInspection [this.scrolledwindowEditor]));
- w17.Position = 1;
- // Notebook tab
- this.label5 = new global::Gtk.Label ();
- this.label5.Name = "label5";
- this.label5.LabelProp = global::Mono.Unix.Catalog.GetString ("decompiler");
- this.notebookInspection.SetTabLabel (this.scrolledwindowEditor, this.label5);
- this.label5.ShowAll ();
- this.notebook1.Add (this.notebookInspection);
- // Container child notebook1.Gtk.Notebook+NotebookChild
- this.searchWidget = new global::Gtk.VBox ();
- this.searchWidget.Name = "searchWidget";
- this.searchWidget.Spacing = 6;
- // Container child searchWidget.Gtk.Box+BoxChild
- this.scrolledwindow1 = new global::Gtk.ScrolledWindow ();
- this.scrolledwindow1.CanFocus = true;
- this.scrolledwindow1.Name = "scrolledwindow1";
- this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child scrolledwindow1.Gtk.Container+ContainerChild
- this.searchTreeview = new global::Gtk.TreeView ();
- this.searchTreeview.CanFocus = true;
- this.searchTreeview.Name = "searchTreeview";
- this.scrolledwindow1.Add (this.searchTreeview);
- this.searchWidget.Add (this.scrolledwindow1);
- global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.searchWidget [this.scrolledwindow1]));
- w20.Position = 0;
- this.notebook1.Add (this.searchWidget);
- global::Gtk.Notebook.NotebookChild w21 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.searchWidget]));
- w21.Position = 1;
- this.vbox3.Add (this.notebook1);
- global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.notebook1]));
- w22.Position = 0;
- this.hpaned1.Add (this.vbox3);
- this.vbox1.Add (this.hpaned1);
- global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hpaned1]));
- w24.Position = 1;
- this.Add (this.vbox1);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- w1.SetUiManager (UIManager);
- this.label3.MnemonicWidget = this.comboboxVisibilty;
- this.label1.MnemonicWidget = this.languageCombobox;
- this.label2.MnemonicWidget = this.searchentry1;
- this.Show ();
- this.NavigateBackwardAction.Activated += new global::System.EventHandler (this.OnNavigateBackwardActionActivated);
- this.NavigateForwardAction.Activated += new global::System.EventHandler (this.OnNavigateForwardActionActivated);
- }
- }
-}
+ { + global::Stetic.Gui.Initialize (this); + // Widget MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget + Stetic.BinContainer w1 = global::Stetic.BinContainer.Attach (this); + this.UIManager = new global::Gtk.UIManager (); + global::Gtk.ActionGroup w2 = new global::Gtk.ActionGroup ("Default"); + this.NavigateBackwardAction = new global::Gtk.Action ("NavigateBackwardAction", global::Mono.Unix.Catalog.GetString ("Navigate backward"), null, "gtk-go-back"); + this.NavigateBackwardAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Navigate backward"); + w2.Add (this.NavigateBackwardAction, null); + this.NavigateForwardAction = new global::Gtk.Action ("NavigateForwardAction", global::Mono.Unix.Catalog.GetString ("Navigate forward"), null, "gtk-go-forward"); + this.NavigateForwardAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Navigate forward"); + w2.Add (this.NavigateForwardAction, null); + this.goBackAction = new global::Gtk.Action ("goBackAction", null, null, "gtk-go-back"); + w2.Add (this.goBackAction, null); + this.goForwardAction = new global::Gtk.Action ("goForwardAction", null, null, "gtk-go-forward"); + w2.Add (this.goForwardAction, null); + this.goBackAction1 = new global::Gtk.Action ("goBackAction1", null, null, "gtk-go-back"); + w2.Add (this.goBackAction1, null); + this.UIManager.InsertActionGroup (w2, 0); + this.Name = "MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget"; + // Container child MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.Gtk.Container+ContainerChild + this.vbox1 = new global::Gtk.VBox (); + this.vbox1.Name = "vbox1"; + this.vbox1.Spacing = 2; + // Container child vbox1.Gtk.Box+BoxChild + this.hbox2 = new global::Gtk.HBox (); + this.hbox2.Name = "hbox2"; + this.hbox2.Spacing = 6; + // Container child hbox2.Gtk.Box+BoxChild + this.buttonBack = new global::Gtk.Button (); + this.buttonBack.CanFocus = true; + this.buttonBack.Name = "buttonBack"; + this.buttonBack.UseStock = true; + this.buttonBack.UseUnderline = true; + this.buttonBack.Label = "gtk-go-back"; + this.hbox2.Add (this.buttonBack); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.buttonBack])); + w3.Position = 0; + w3.Expand = false; + w3.Fill = false; + // Container child hbox2.Gtk.Box+BoxChild + this.buttonForeward = new global::Gtk.Button (); + this.buttonForeward.CanFocus = true; + this.buttonForeward.Name = "buttonForeward"; + this.buttonForeward.UseStock = true; + this.buttonForeward.UseUnderline = true; + this.buttonForeward.Label = "gtk-go-forward"; + this.hbox2.Add (this.buttonForeward); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.buttonForeward])); + w4.Position = 1; + w4.Expand = false; + w4.Fill = false; + // Container child hbox2.Gtk.Box+BoxChild + this.label3 = new global::Gtk.Label (); + this.label3.Name = "label3"; + this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("_Visibility:"); + this.label3.UseUnderline = true; + this.hbox2.Add (this.label3); + global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.label3])); + w5.Position = 2; + w5.Expand = false; + w5.Fill = false; + // Container child hbox2.Gtk.Box+BoxChild + this.languageCombobox = global::Gtk.ComboBox.NewText (); + this.languageCombobox.Name = "languageCombobox"; + this.hbox2.Add (this.languageCombobox); + global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.languageCombobox])); + w6.PackType = ((global::Gtk.PackType)(1)); + w6.Position = 3; + w6.Expand = false; + w6.Fill = false; + // Container child hbox2.Gtk.Box+BoxChild + this.label1 = new global::Gtk.Label (); + this.label1.Name = "label1"; + this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("_Language:"); + this.label1.UseUnderline = true; + this.hbox2.Add (this.label1); + global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.label1])); + w7.PackType = ((global::Gtk.PackType)(1)); + w7.Position = 4; + w7.Expand = false; + w7.Fill = false; + // Container child hbox2.Gtk.Box+BoxChild + this.searchentry1 = new global::MonoDevelop.Components.SearchEntry (); + this.searchentry1.Name = "searchentry1"; + this.searchentry1.ForceFilterButtonVisible = false; + this.searchentry1.IsCheckMenu = false; + this.searchentry1.ActiveFilterID = 0; + this.searchentry1.Ready = false; + this.searchentry1.HasFocus = false; + this.hbox2.Add (this.searchentry1); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.searchentry1])); + w8.PackType = ((global::Gtk.PackType)(1)); + w8.Position = 5; + // Container child hbox2.Gtk.Box+BoxChild + this.label2 = new global::Gtk.Label (); + this.label2.Name = "label2"; + this.label2.Xalign = 1F; + this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("_Search:"); + this.label2.UseUnderline = true; + this.hbox2.Add (this.label2); + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.label2])); + w9.PackType = ((global::Gtk.PackType)(1)); + w9.Position = 6; + // Container child hbox2.Gtk.Box+BoxChild + this.comboboxVisibilty = global::Gtk.ComboBox.NewText (); + this.comboboxVisibilty.Name = "comboboxVisibilty"; + this.hbox2.Add (this.comboboxVisibilty); + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.comboboxVisibilty])); + w10.PackType = ((global::Gtk.PackType)(1)); + w10.Position = 7; + w10.Expand = false; + w10.Fill = false; + this.vbox1.Add (this.hbox2); + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox2])); + w11.Position = 0; + w11.Expand = false; + w11.Fill = false; + // Container child vbox1.Gtk.Box+BoxChild + this.hpaned1 = new global::Gtk.HPaned (); + this.hpaned1.CanFocus = true; + this.hpaned1.Name = "hpaned1"; + this.hpaned1.Position = 271; + // Container child hpaned1.Gtk.Paned+PanedChild + this.treeViewPlaceholder = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); + this.treeViewPlaceholder.Name = "treeViewPlaceholder"; + this.hpaned1.Add (this.treeViewPlaceholder); + global::Gtk.Paned.PanedChild w12 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.treeViewPlaceholder])); + w12.Resize = false; + // Container child hpaned1.Gtk.Paned+PanedChild + this.vbox3 = new global::Gtk.VBox (); + this.vbox3.Name = "vbox3"; + this.vbox3.Spacing = 6; + // Container child vbox3.Gtk.Box+BoxChild + this.notebook1 = new global::Gtk.Notebook (); + this.notebook1.CanFocus = true; + this.notebook1.Name = "notebook1"; + this.notebook1.CurrentPage = 0; + this.notebook1.ShowBorder = false; + // Container child notebook1.Gtk.Notebook+NotebookChild + this.notebookInspection = new global::Gtk.Notebook (); + this.notebookInspection.CanFocus = true; + this.notebookInspection.Name = "notebookInspection"; + this.notebookInspection.CurrentPage = 1; + // Container child notebookInspection.Gtk.Notebook+NotebookChild + this.documentationScrolledWindow = new global::Gtk.ScrolledWindow (); + this.documentationScrolledWindow.Name = "documentationScrolledWindow"; + this.documentationScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); + // Container child documentationScrolledWindow.Gtk.Container+ContainerChild + global::Gtk.Viewport w13 = new global::Gtk.Viewport (); + w13.ShadowType = ((global::Gtk.ShadowType)(0)); + // Container child GtkViewport.Gtk.Container+ContainerChild + this.documentationLabel = new global::Gtk.Label (); + this.documentationLabel.Name = "documentationLabel"; + this.documentationLabel.Xpad = 6; + this.documentationLabel.Ypad = 6; + this.documentationLabel.Xalign = 0F; + this.documentationLabel.Yalign = 0F; + this.documentationLabel.UseMarkup = true; + this.documentationLabel.Selectable = true; + w13.Add (this.documentationLabel); + this.documentationScrolledWindow.Add (w13); + this.notebookInspection.Add (this.documentationScrolledWindow); + // Notebook tab + this.label4 = new global::Gtk.Label (); + this.label4.Name = "label4"; + this.label4.LabelProp = global::Mono.Unix.Catalog.GetString ("summary"); + this.notebookInspection.SetTabLabel (this.documentationScrolledWindow, this.label4); + this.label4.ShowAll (); + // Container child notebookInspection.Gtk.Notebook+NotebookChild + this.scrolledwindowEditor = new global::Gtk.ScrolledWindow (); + this.scrolledwindowEditor.CanFocus = true; + this.scrolledwindowEditor.Name = "scrolledwindowEditor"; + this.scrolledwindowEditor.ShadowType = ((global::Gtk.ShadowType)(1)); + this.notebookInspection.Add (this.scrolledwindowEditor); + global::Gtk.Notebook.NotebookChild w17 = ((global::Gtk.Notebook.NotebookChild)(this.notebookInspection [this.scrolledwindowEditor])); + w17.Position = 1; + // Notebook tab + this.label5 = new global::Gtk.Label (); + this.label5.Name = "label5"; + this.label5.LabelProp = global::Mono.Unix.Catalog.GetString ("decompiler"); + this.notebookInspection.SetTabLabel (this.scrolledwindowEditor, this.label5); + this.label5.ShowAll (); + this.notebook1.Add (this.notebookInspection); + // Container child notebook1.Gtk.Notebook+NotebookChild + this.searchWidget = new global::Gtk.VBox (); + this.searchWidget.Name = "searchWidget"; + this.searchWidget.Spacing = 6; + // Container child searchWidget.Gtk.Box+BoxChild + this.scrolledwindow1 = new global::Gtk.ScrolledWindow (); + this.scrolledwindow1.CanFocus = true; + this.scrolledwindow1.Name = "scrolledwindow1"; + this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1)); + // Container child scrolledwindow1.Gtk.Container+ContainerChild + this.searchTreeview = new global::Gtk.TreeView (); + this.searchTreeview.CanFocus = true; + this.searchTreeview.Name = "searchTreeview"; + this.scrolledwindow1.Add (this.searchTreeview); + this.searchWidget.Add (this.scrolledwindow1); + global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.searchWidget [this.scrolledwindow1])); + w20.Position = 0; + this.notebook1.Add (this.searchWidget); + global::Gtk.Notebook.NotebookChild w21 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.searchWidget])); + w21.Position = 1; + this.vbox3.Add (this.notebook1); + global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.notebook1])); + w22.Position = 0; + this.hpaned1.Add (this.vbox3); + this.vbox1.Add (this.hpaned1); + global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hpaned1])); + w24.Position = 1; + this.Add (this.vbox1); + if ((this.Child != null)) { + this.Child.ShowAll (); + } + w1.SetUiManager (UIManager); + this.label3.MnemonicWidget = this.comboboxVisibilty; + this.label1.MnemonicWidget = this.languageCombobox; + this.label2.MnemonicWidget = this.searchentry1; + this.Show (); + this.NavigateBackwardAction.Activated += new global::System.EventHandler (this.OnNavigateBackwardActionActivated); + this.NavigateForwardAction.Activated += new global::System.EventHandler (this.OnNavigateForwardActionActivated); + } + } +} diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/generated.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/generated.cs index fbd31747d9..8d3a3ae5d9 100644 --- a/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/generated.cs +++ b/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/generated.cs @@ -1,82 +1,81 @@ -
-// This file has been generated by the GUI designer. Do not modify.
+ +// This file has been generated by the GUI designer. Do not modify. namespace Stetic -{
+{ internal class Gui - {
- private static bool initialized;
-
+ { + private static bool initialized; + internal static void Initialize (Gtk.Widget iconRenderer) - {
- if ((Stetic.Gui.initialized == false)) {
- Stetic.Gui.initialized = true;
- }
- }
- }
-
+ { + if ((Stetic.Gui.initialized == false)) { + Stetic.Gui.initialized = true; + } + } + } + internal class BinContainer - {
- private Gtk.Widget child;
- private Gtk.UIManager uimanager;
-
+ { + private Gtk.Widget child; + private Gtk.UIManager uimanager; + public static BinContainer Attach (Gtk.Bin bin) - {
- BinContainer bc = new BinContainer ();
- bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested);
- bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated);
- bin.Added += new Gtk.AddedHandler (bc.OnAdded);
- return bc;
- }
-
+ { + BinContainer bc = new BinContainer (); + bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested); + bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated); + bin.Added += new Gtk.AddedHandler (bc.OnAdded); + return bc; + } + private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args) - {
- if ((this.child != null)) {
- args.Requisition = this.child.SizeRequest ();
- }
- }
-
+ { + if ((this.child != null)) { + args.Requisition = this.child.SizeRequest (); + } + } + private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args) - {
- if ((this.child != null)) {
- this.child.Allocation = args.Allocation;
- }
- }
-
+ { + if ((this.child != null)) { + this.child.Allocation = args.Allocation; + } + } + private void OnAdded (object sender, Gtk.AddedArgs args) - {
- this.child = args.Widget;
- }
-
+ { + this.child = args.Widget; + } + public void SetUiManager (Gtk.UIManager uim) - {
- this.uimanager = uim;
- this.child.Realized += new System.EventHandler (this.OnRealized);
- }
-
+ { + this.uimanager = uim; + this.child.Realized += new System.EventHandler (this.OnRealized); + } + private void OnRealized (object sender, System.EventArgs args) - {
- if ((this.uimanager != null)) {
- Gtk.Widget w;
- w = this.child.Toplevel;
- if (((w != null)
- && typeof(Gtk.Window).IsInstanceOfType (w))) {
- ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
- this.uimanager = null;
- }
- }
- }
- }
-
+ { + if ((this.uimanager != null)) { + Gtk.Widget w; + w = this.child.Toplevel; + if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) { + ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup); + this.uimanager = null; + } + } + } + } + internal class ActionGroups - {
+ { public static Gtk.ActionGroup GetActionGroup (System.Type type) - {
- return Stetic.ActionGroups.GetActionGroup (type.FullName);
- }
-
+ { + return Stetic.ActionGroups.GetActionGroup (type.FullName); + } + public static Gtk.ActionGroup GetActionGroup (string name) - {
- return null;
- }
- }
-}
+ { + return null; + } + } +} diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj b/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj index ffbe8b705e..a203426380 100644 --- a/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj +++ b/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj @@ -37,6 +37,7 @@ <ProjectReference Include="..\..\..\..\contrib\Mono.Debugger.Soft\Mono.Debugger.Soft.csproj"> <Project>{372E8E3E-29D5-4B4D-88A2-4711CD628C4E}</Project> <Name>Mono.Debugger.Soft</Name> + <Private>False</Private> </ProjectReference> <ProjectReference Include="..\..\..\..\contrib\Mono.Cecil\Mono.Cecil.csproj"> <Project>{3EC06433-F168-4C5B-A885-99CE4AB617E1}</Project> diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs b/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs index 41ae288c58..8d665c59c4 100644 --- a/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs +++ b/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs @@ -249,21 +249,83 @@ namespace Mono.Debugging.Soft return new PropertyValueReference (ctx, props[i], target, null, values); } - bool IsCompilerGeneratedType (SoftEvaluationContext cx, TypeMirror tm) - { - return tm.Name.IndexOf (">c__AnonStorey") != -1 || tm.Name.IndexOf (">c__Iterator") != -1; - } - - bool InCompilerGeneratedType (EvaluationContext ctx) + static bool InGeneratedClosureOrIteratorType (EvaluationContext ctx) { SoftEvaluationContext cx = (SoftEvaluationContext) ctx; if (cx.Frame.Method.IsStatic) return false; TypeMirror tm = cx.Frame.Method.DeclaringType; - return IsCompilerGeneratedType (cx, tm); + return IsGeneratedClosureOrIteratorType (tm); + } + + static bool IsGeneratedClosureOrIteratorType (TypeMirror tm) + { + return IsGeneratedClosureType (tm) || IsGeneratedIteratorType (tm); + } + + static bool IsGeneratedClosureType (TypeMirror tm) + { + return tm.Name.IndexOf (">c__") != -1; + } + + static bool IsGeneratedIteratorType (TypeMirror tm) + { + return + //mcs + tm.Name.IndexOf (">c__Iterator") != -1 + //csc is of form <NAME>d__NUMBER + || (tm.Name.StartsWith ("<") && tm.Name.IndexOf (">d__") > -1); + } + + static bool IsHoistedThisReference (FieldInfoMirror field) + { + // mcs is "<>f__this" + // csc is "<>4__this" + return field.Name.StartsWith ("<>") && field.Name.EndsWith ("__this"); + } + + static bool IsClosureReferenceField (FieldInfoMirror field) + { + // mcs is "<>f__ref" + // csc is "CS$<>" + return field.Name.StartsWith ("CS$<>") || field.Name.StartsWith ("<>f__ref"); + } + + static bool IsClosureReferenceLocal (LocalVariable local) + { + if (local.Name == null) + return false; + + return + // mcs + local.Name.Length == 0 || local.Name.StartsWith ("<") || local.Name.StartsWith ("$locvar") + // csc + || local.Name.StartsWith ("CS$<>"); + } + + static bool IsGeneratedTemporaryLocal (LocalVariable local) + { + return local.Name != null && local.Name.StartsWith ("CS$"); + } + + static string GetHoistedIteratorLocalName (FieldInfoMirror field) + { + //mcs captured args, of form <$>name + if (field.Name.StartsWith ("<$>")) { + return field.Name.Substring (3); + } + + // csc, mcs locals of form <name>__0 + if (field.Name.StartsWith ("<")) { + int i = field.Name.IndexOf ('>'); + if (i > 1) { + return field.Name.Substring (1, i - 1); + } + } + return null; } - IEnumerable<ValueReference> GetCompilerGeneratedLocalVariables (SoftEvaluationContext cx, ValueReference vthis) + IEnumerable<ValueReference> GetHoistedLocalVariables (SoftEvaluationContext cx, ValueReference vthis) { if (vthis == null) return new ValueReference [0]; @@ -273,49 +335,70 @@ namespace Mono.Debugging.Soft return new ValueReference [0]; TypeMirror tm = (TypeMirror) vthis.Type; - bool isIterator = tm.Name.IndexOf (">c__Iterator") != -1; + bool isIterator = IsGeneratedIteratorType (tm); var list = new List<ValueReference> (); TypeMirror type = (TypeMirror) vthis.Type; foreach (FieldInfoMirror field in type.GetFields ()) { - if (field.Name == "<>f__this") + if (IsHoistedThisReference (field)) continue; - if (field.Name.StartsWith ("<>f__ref")) { - list.AddRange (GetCompilerGeneratedLocalVariables (cx, new FieldValueReference (cx, field, val, type))); + if (IsClosureReferenceField (field)) { + list.AddRange (GetHoistedLocalVariables (cx, new FieldValueReference (cx, field, val, type))); continue; } if (field.Name.StartsWith ("<")) { if (isIterator) { - int i = field.Name.IndexOf ('>'); - if (i > 1) { - string vname = field.Name.Substring (1, i - 1); - list.Add (new FieldValueReference (cx, field, val, type, vname, ObjectValueFlags.Variable)); + var name = GetHoistedIteratorLocalName (field); + if (!string.IsNullOrEmpty (name)) { + list.Add (new FieldValueReference (cx, field, val, type, name, ObjectValueFlags.Variable)); } } - } - else + } else if (!field.Name.Contains ("$")) { list.Add (new FieldValueReference (cx, field, val, type, field.Name, ObjectValueFlags.Variable)); + } } return list; } - ValueReference GetCompilerGeneratedThisReference (SoftEvaluationContext cx) + ValueReference GetHoistedThisReference (SoftEvaluationContext cx) { try { Value val = cx.Frame.GetThis (); TypeMirror type = (TypeMirror) GetValueType (cx, val); - FieldInfoMirror field = type.GetField ("<>f__this"); - if (field != null) - return new FieldValueReference (cx, field, val, type, "this", ObjectValueFlags.Literal); + return GetHoistedThisReference (cx, type, val); } catch (AbsentInformationException) { } return null; } + ValueReference GetHoistedThisReference (SoftEvaluationContext cx, TypeMirror type, object val) + { + foreach (FieldInfoMirror field in type.GetFields ()) { + if (IsHoistedThisReference (field)) { + return new FieldValueReference (cx, field, val, type, "this", ObjectValueFlags.Literal); + } else if (IsClosureReferenceField (field)) { + var fieldRef = new FieldValueReference (cx, field, val, type); + var thisRef = GetHoistedThisReference (cx, field.FieldType, fieldRef.Value); + if (thisRef != null) + return thisRef; + } + } + return null; + } + + // if the local does not have a name, constructs one from the index + static string GetLocalName (SoftEvaluationContext cx, LocalVariable local) + { + var name = local.Name; + if (!string.IsNullOrEmpty (local.Name) || cx.SourceCodeAvailable) + return name; + return "loc" + local.Index; + } + protected override ValueReference OnGetLocalVariable (EvaluationContext ctx, string name) { SoftEvaluationContext cx = (SoftEvaluationContext) ctx; - if (InCompilerGeneratedType (cx)) + if (InGeneratedClosureOrIteratorType (cx)) return FindByName (OnGetLocalVariables (cx), v => v.Name, name, ctx.CaseSensitive); try { @@ -326,12 +409,13 @@ namespace Mono.Debugging.Soft if (int.TryParse (name.Substring (3), out idx)) local = cx.Frame.Method.GetLocals ().FirstOrDefault (loc => loc.Index == idx); } - } else - local = ctx.CaseSensitive ? cx.Frame.GetVisibleVariableByName (name) : FindByName (cx.Frame.GetVisibleVariables(), v => v.Name, name, false); - + } else { + local = ctx.CaseSensitive + ? cx.Frame.GetVisibleVariableByName (name) + : FindByName (cx.Frame.GetVisibleVariables(), v => v.Name, name, false); + } if (local != null) { - string vname = !string.IsNullOrEmpty (local.Name) || cx.SourceCodeAvailable ? local.Name : "loc" + local.Index; - return new VariableValueReference (ctx, vname, local); + return new VariableValueReference (ctx, GetLocalName (cx, local), local); } return FindByName (OnGetLocalVariables (ctx), v => v.Name, name, ctx.CaseSensitive);; } catch (AbsentInformationException) { @@ -342,9 +426,9 @@ namespace Mono.Debugging.Soft protected override IEnumerable<ValueReference> OnGetLocalVariables (EvaluationContext ctx) { SoftEvaluationContext cx = (SoftEvaluationContext) ctx; - if (InCompilerGeneratedType (cx)) { + if (InGeneratedClosureOrIteratorType (cx)) { ValueReference vthis = GetThisReference (cx); - return GetCompilerGeneratedLocalVariables (cx, vthis).Union (GetLocalVariables (cx)); + return GetHoistedLocalVariables (cx, vthis).Union (GetLocalVariables (cx)); } else return GetLocalVariables (cx); @@ -358,17 +442,15 @@ namespace Mono.Debugging.Soft } catch (AbsentInformationException) { yield break; } - foreach (LocalVariable var in locals) { - if (!var.IsArg) { - string name = !string.IsNullOrEmpty (var.Name) || cx.SourceCodeAvailable ? var.Name : "loc" + var.Index; - if (name.Length == 0 || name.StartsWith ("<") || name.StartsWith ("$locvar")) { - if (IsCompilerGeneratedType (cx, var.Type)) { - foreach (var gv in GetCompilerGeneratedLocalVariables (cx, new VariableValueReference (cx, name, var))) - yield return gv; - } + foreach (LocalVariable local in locals) { + if (local.IsArg) + continue; + if (IsClosureReferenceLocal (local) && IsGeneratedClosureType (local.Type)) { + foreach (var gv in GetHoistedLocalVariables (cx, new VariableValueReference (cx, local.Name, local))) { + yield return gv; } - else - yield return new VariableValueReference (cx, name, var); + } else if (!IsGeneratedTemporaryLocal (local)) { + yield return new VariableValueReference (cx, GetLocalName (cx, local), local); } } } @@ -508,8 +590,8 @@ namespace Mono.Debugging.Soft protected override ValueReference OnGetThisReference (EvaluationContext ctx) { SoftEvaluationContext cx = (SoftEvaluationContext) ctx; - if (InCompilerGeneratedType (cx)) - return GetCompilerGeneratedThisReference (cx); + if (InGeneratedClosureOrIteratorType (cx)) + return GetHoistedThisReference (cx); else return GetThisReference (cx); } diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs b/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs index e67fbaee8f..abea838aaf 100644 --- a/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs +++ b/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs @@ -759,6 +759,18 @@ namespace Mono.Debugging.Soft if (vm.Version.AtLeast (2, 9)) { var sourceFileList = pending_bes.Where (b => b.FileName != null).Select (b => b.FileName).ToArray (); if (sourceFileList.Length > 0) { + //HACK: explicitly try lowercased drivename on windows, since csc (when not hosted in VS) lowercases + //the drivename in the pdb files that get converted to mdbs as-is + //FIXME: we should really do a case-insensitive request on Win/Mac, when sdb supports that + if (IsWindows) { + int originalCount = sourceFileList.Length; + Array.Resize (ref sourceFileList, originalCount * 2); + for (int i = 0; i < originalCount; i++) { + string n = sourceFileList[i]; + sourceFileList[originalCount + i] = char.ToLower (n[0]) + n.Substring (1); + } + } + if (typeLoadReq == null) { typeLoadReq = vm.CreateTypeLoadRequest (); } @@ -766,6 +778,7 @@ namespace Mono.Debugging.Soft typeLoadReq.SourceFileFilter = sourceFileList; typeLoadReq.Enabled = true; } + var typeNameList = pending_bes.Where (b => b.ExceptionName != null).Select (b => b.ExceptionName).ToArray (); if (typeNameList.Length > 0) { // Use a separate request since the filters are ANDed together @@ -841,7 +854,17 @@ namespace Mono.Debugging.Soft // just the ones which match a source file with an existing breakpoint. // if (vm.Version.AtLeast (2, 9)) { - foreach (TypeMirror t in vm.GetTypesForSourceFile (filename, false)) + //FIXME: do a case insensitive request on Win/Mac when sdb supports it (currently asserts NOTIMPLEMENTED) + var typesInFile = vm.GetTypesForSourceFile (filename, false); + + //HACK: explicitly try lowercased drivename on windows, since csc (when not hosted in VS) lowercases + //the drivename in the pdb files that get converted to mdbs as-is + if (typesInFile.Count == 0 && IsWindows) { + string alternateCaseFilename = char.ToLower (filename[0]) + filename.Substring (1); + typesInFile = vm.GetTypesForSourceFile (alternateCaseFilename, false); + } + + foreach (TypeMirror t in typesInFile) ProcessType (t); } @@ -1718,11 +1741,17 @@ namespace Mono.Debugging.Soft readonly static bool IsMac; readonly static StringComparer PathComparer; + static bool IgnoreFilenameCase { + get { + return IsMac || IsWindows; + } + } + static SoftDebuggerSession () { IsWindows = Path.DirectorySeparatorChar == '\\'; IsMac = !IsWindows && IsRunningOnMac(); - PathComparer = (IsWindows || IsMac)? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; + PathComparer = (IgnoreFilenameCase)? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; } //From Managed.Windows.Forms/XplatUI diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs index 254a6bf35a..98b74f57f0 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs @@ -137,7 +137,7 @@ namespace MonoDevelop.DesignerSupport public override object ConvertTo (System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { - return MonoDevelop.Projects.BuildAction.Translate ((string)value); + return (string)value; } public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) @@ -151,7 +151,7 @@ namespace MonoDevelop.DesignerSupport if (!IsValid (context, value)) throw new FormatException ("Invalid build target name"); - return MonoDevelop.Projects.BuildAction.ReTranslate ((string)value); + return (string)value; } public override bool IsValid (ITypeDescriptorContext context, object value) @@ -159,7 +159,7 @@ namespace MonoDevelop.DesignerSupport if (!(value is string)) return false; - string str = MonoDevelop.Projects.BuildAction.ReTranslate ((string) value); + string str = (string) value; if (string.IsNullOrEmpty (str) || !char.IsLetter (str[0])) return false; diff --git a/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/ImageChooser.cs b/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/ImageChooser.cs index 6370bce99d..9ffde3cac0 100644 --- a/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/ImageChooser.cs +++ b/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/ImageChooser.cs @@ -130,7 +130,7 @@ namespace MonoDevelop.MacDev.PlistEditor } else if (!SupportedFormats.Contains (type.Name)) { var formats = string.Join (", ", SupportedFormats.Select (f => "'" + f + "'")); errorTitle = GettextCatalog.GetString ("Invalid image selected"); - errorMessage = GettextCatalog.GetString ("An image of type '{0}' has been selected but you must select an image of type '{1}'.", formats); + errorMessage = GettextCatalog.GetString ("An image of type '{0}' has been selected but you must select an image of type '{1}'.", type.Name, formats); } else { return true; } @@ -200,14 +200,14 @@ namespace MonoDevelop.MacDev.PlistEditor cr.Translate (imgAlloc.X, imgAlloc.Y); using (var layout = new Pango.Layout (PangoContext)) { - layout.SetText (string.Format ("({0}x{1})", displaySize.Width, displaySize.Height)); - - layout.Width = (int)((imgAlloc.Width - 16) * Pango.Scale.PangoScale); + layout.SetText (string.Format ("({0}x{1})", acceptedSize.Width, acceptedSize.Height)); + layout.Width = (int) (imgAlloc.Width * Pango.Scale.PangoScale); layout.Wrap = Pango.WrapMode.WordChar; layout.Alignment = Pango.Alignment.Center; + int pw, ph; layout.GetPixelSize (out pw, out ph); - cr.MoveTo ((imgAlloc.Width - layout.Width / Pango.Scale.PangoScale) / 2, (imgAlloc.Height - ph) / 2); + cr.MoveTo (0, (imgAlloc.Height - ph) / 2); cr.Color = new Cairo.Color (0.5, 0.5, 0.5); cr.ShowLayout (layout); } diff --git a/main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectTypeInfo.cs b/main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectTypeInfo.cs index dfa1d0db53..20e1809205 100755 --- a/main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectTypeInfo.cs +++ b/main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectTypeInfo.cs @@ -203,6 +203,10 @@ namespace MonoDevelop.MacDev.ObjCIntegration sw.WriteLine ("@end"); } + + var lastSourceUpdateTime = DefinedIn.Max (f => File.GetLastWriteTime (f)); + File.SetLastWriteTime (hFilePath, lastSourceUpdateTime); + File.SetLastWriteTime (mFilePath, lastSourceUpdateTime); } static string AsId (string objcType) diff --git a/main/src/addins/MonoDevelop.MacDev/XcodeInterfaceBuilderDisplayBinding.cs b/main/src/addins/MonoDevelop.MacDev/XcodeInterfaceBuilderDisplayBinding.cs index 9a8b57066e..b297d2244a 100644 --- a/main/src/addins/MonoDevelop.MacDev/XcodeInterfaceBuilderDisplayBinding.cs +++ b/main/src/addins/MonoDevelop.MacDev/XcodeInterfaceBuilderDisplayBinding.cs @@ -69,8 +69,11 @@ namespace MonoDevelop.MacDev public override void Launch (params string[] files) { - if (!AppleSdkSettings.IsXcode42) - throw new UserException (string.Format ("XCode 4.2 is required to open file {0}", files [0])); + // Users without paid apple developer accounts do not have access to Xcode 4.2 so we + // cannot rely on people having it installed. As such, if we want to support MonoMac + // development on Snow Leopard we should just check that Xcode is installed. + if (!AppleSdkSettings.IsValid) + throw new UserException (string.Format ("XCode is required to open file {0}", files [0])); project.XcodeProjectTracker.OpenDocument (files[0]); } diff --git a/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs b/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs index 7df6f9ac5b..5c1c9878d7 100644 --- a/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs +++ b/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs @@ -366,7 +366,9 @@ end tell"; const string XCODE_OPEN_PROJECT_FILE = @"tell application ""{0}"" activate + activate open ""{1}"" + activate open ""{2}"" end tell"; diff --git a/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeSyncedContent.cs b/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeSyncedContent.cs index a1bc4b6e64..602211f824 100644 --- a/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeSyncedContent.cs +++ b/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeSyncedContent.cs @@ -64,6 +64,7 @@ namespace MonoDevelop.MacDev.XcodeSyncing if (File.Exists (target)) File.Delete (target); File.Copy (source, target); + File.SetLastWriteTime (target, File.GetLastWriteTime (source)); context.UpdateSyncTime (targetRelative); } diff --git a/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeSyncedType.cs b/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeSyncedType.cs index b22ee9782e..1d3453affa 100644 --- a/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeSyncedType.cs +++ b/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeSyncedType.cs @@ -54,9 +54,8 @@ namespace MonoDevelop.MacDev.XcodeSyncing //FIXME: types dep on other types on project, need better regeneration skipping var h = Type.ObjCName + ".h"; var path = context.ProjectDir.Combine (h); - if (File.Exists (path) && context.GetSyncTime (h) != Type.DefinedIn.Max (f => File.GetLastWriteTime (f))) - return false; - return true; + + return !File.Exists (path) || context.GetSyncTime (h) != Type.DefinedIn.Max (f => File.GetLastWriteTime (f)); } public override void SyncOut (XcodeSyncContext context) diff --git a/main/src/addins/MonoDevelop.Moonlight/MonoDevelop.Moonlight/MoonlightProject.cs b/main/src/addins/MonoDevelop.Moonlight/MonoDevelop.Moonlight/MoonlightProject.cs index 5880d7fe0c..e1834884fe 100644 --- a/main/src/addins/MonoDevelop.Moonlight/MonoDevelop.Moonlight/MoonlightProject.cs +++ b/main/src/addins/MonoDevelop.Moonlight/MonoDevelop.Moonlight/MoonlightProject.cs @@ -420,6 +420,18 @@ namespace MonoDevelop.Moonlight } } + protected override IList<string> GetCommonBuildActions () + { + return new string[] { + BuildAction.None, + BuildAction.Compile, + BuildAction.Content, + BuildAction.EmbeddedResource, + BuildAction.Resource, + BuildAction.ApplicationDefinition, + }; + } + #endregion } } diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs index bdeef02157..9ac1982068 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs @@ -635,46 +635,46 @@ namespace MonoDevelop.Refactoring } } -// public class ResolveNameOperation -// { -// ITypeResolveContext ctx; -// Document doc; -// string ns; -// ResolveResult resolveResult; -// -// public ResolveNameOperation (ITypeResolveContext ctx, Document doc, ResolveResult resolveResult, string ns) -// { -// this.ctx = ctx; -// this.doc = doc; -// this.resolveResult = resolveResult; -// this.ns = ns; -// } -// -// public void AddImport () -// { -// CodeRefactorer refactorer = IdeApp.Workspace.GetCodeRefactorer (IdeApp.ProjectOperations.CurrentSelectedSolution); -// -// if (resolveResult is NamespaceResolveResult) { -// refactorer.AddLocalNamespaceImport (ctx, doc.FileName, ns, resolveResult.ResolvedExpression.Region.Start); -// } else { -// refactorer.AddGlobalNamespaceImport (ctx, doc.FileName, ns); -// } -// } -// -// public void ResolveName () -// { -// int pos = doc.Editor.Document.LocationToOffset (resolveResult.ResolvedExpression.Region.BeginLine, resolveResult.ResolvedExpression.Region.BeginColumn); -// if (pos < 0) { -// LoggingService.LogError ("Invalie expression position: " + resolveResult.ResolvedExpression); -// return; -// } -// doc.Editor.Insert (pos, ns + "."); -// if (doc.Editor.Caret.Offset >= pos) -// doc.Editor.Caret.Offset += (ns + ".").Length; -// doc.Editor.Document.CommitLineUpdate (resolveResult.ResolvedExpression.Region.BeginLine); -// } -// } - +/* public class ResolveNameOperation + { + ProjectDom ctx; + Document doc; + string ns; + ResolveResult resolveResult; + + public ResolveNameOperation (ProjectDom ctx, Document doc, ResolveResult resolveResult, string ns) + { + this.ctx = ctx; + this.doc = doc; + this.resolveResult = resolveResult; + this.ns = ns; + } + + public void AddImport () + { + CodeRefactorer refactorer = IdeApp.Workspace.GetCodeRefactorer (IdeApp.ProjectOperations.CurrentSelectedSolution); + + if (resolveResult is NamespaceResolveResult) { + refactorer.AddLocalNamespaceImport (ctx, doc.FileName, ns, resolveResult.ResolvedExpression.Region.Start); + } else { + refactorer.AddGlobalNamespaceImport (ctx, doc.FileName, ns); + } + } + + public void ResolveName () + { + int pos = doc.Editor.Document.LocationToOffset (resolveResult.ResolvedExpression.Region.Start.Line, resolveResult.ResolvedExpression.Region.Start.Column); + if (pos < 0) { + LoggingService.LogError ("Invalid expression position: " + resolveResult.ResolvedExpression); + return; + } + doc.Editor.Insert (pos, ns + "."); + if (doc.Editor.Caret.Offset >= pos) + doc.Editor.Caret.Offset += (ns + ".").Length; + doc.Editor.Document.CommitLineUpdate (resolveResult.ResolvedExpression.Region.Start.Line); + } + } +*/ bool IsModifiable (object member) { IType t = member as IType; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs index f5bd3bbfbb..fba0b01fbc 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs @@ -43,8 +43,15 @@ namespace MonoDevelop.SourceEditor public TooltipItem GetItem (Mono.TextEditor.TextEditor editor, int offset) { - ExtensibleTextEditor ed = (ExtensibleTextEditor) editor; - return new TooltipItem (ed.GetErrorInformationAt (offset), editor.Document.GetLineByOffset (offset)); + var ed = editor as ExtensibleTextEditor; + if (ed == null) + return null; + + string errorInformation = ed.GetErrorInformationAt (offset); + if (string.IsNullOrEmpty (errorInformation)) + return null; + + return new TooltipItem (errorInformation, editor.Document.GetLineByOffset (offset)); } public Gtk.Window CreateTooltipWindow (Mono.TextEditor.TextEditor editor, int offset, Gdk.ModifierType modifierState, TooltipItem item) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs index b868515cb5..b1d2db6e7a 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs @@ -95,7 +95,7 @@ namespace MonoDevelop.SourceEditor tree.RootPinAlwaysVisible = true; tree.PinnedWatch = watch; DocumentLocation location = editor.Document.OffsetToLocation (offset); - tree.PinnedWatchLine = location.Line + 1; + tree.PinnedWatchLine = location.Line; tree.PinnedWatchFile = ((ExtensibleTextEditor)editor).View.ContentName; tree.AddValue (value); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs index 1569005d25..59ea5fdea3 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs @@ -1,225 +1,225 @@ -
-// This file has been generated by the GUI designer. Do not modify.
-namespace MonoDevelop.SourceEditor.OptionPanels
-{
- public partial class MarkerPanel
- {
- private global::Gtk.VBox vbox1;
- private global::Gtk.Label GtkLabel9;
- private global::Gtk.Alignment alignment1;
- private global::Gtk.VBox vbox3;
- private global::Gtk.CheckButton showLineNumbersCheckbutton;
- private global::Gtk.CheckButton underlineErrorsCheckbutton;
- private global::Gtk.CheckButton highlightMatchingBracketCheckbutton;
- private global::Gtk.CheckButton highlightCurrentLineCheckbutton;
- private global::Gtk.CheckButton showRulerCheckbutton;
- private global::Gtk.CheckButton enableAnimationCheckbutton1;
- private global::Gtk.CheckButton enableHighlightUsagesCheckbutton;
- private global::Gtk.Label GtkLabel10;
- private global::Gtk.Alignment GtkAlignment;
- private global::Gtk.VBox vbox2;
- private global::Gtk.CheckButton showInvLinesCheckbutton;
- private global::Gtk.CheckButton showSpacesCheckbutton;
- private global::Gtk.CheckButton showTabsCheckbutton;
- private global::Gtk.CheckButton showEolCheckbutton;
-
- protected virtual void Build ()
- {
- global::Stetic.Gui.Initialize (this);
- // Widget MonoDevelop.SourceEditor.OptionPanels.MarkerPanel
- global::Stetic.BinContainer.Attach (this);
- this.Name = "MonoDevelop.SourceEditor.OptionPanels.MarkerPanel";
- // Container child MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.Gtk.Container+ContainerChild
- this.vbox1 = new global::Gtk.VBox ();
- this.vbox1.Name = "vbox1";
- this.vbox1.Spacing = 6;
- // Container child vbox1.Gtk.Box+BoxChild
- this.GtkLabel9 = new global::Gtk.Label ();
- this.GtkLabel9.Name = "GtkLabel9";
- this.GtkLabel9.Xalign = 0F;
- this.GtkLabel9.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>General</b>");
- this.GtkLabel9.UseMarkup = true;
- this.vbox1.Add (this.GtkLabel9);
- global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel9]));
- w1.Position = 0;
- w1.Expand = false;
- w1.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.alignment1 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
- this.alignment1.Name = "alignment1";
- this.alignment1.LeftPadding = ((uint)(12));
- // Container child alignment1.Gtk.Container+ContainerChild
- this.vbox3 = new global::Gtk.VBox ();
- this.vbox3.Name = "vbox3";
- this.vbox3.Spacing = 6;
- // Container child vbox3.Gtk.Box+BoxChild
- this.showLineNumbersCheckbutton = new global::Gtk.CheckButton ();
- this.showLineNumbersCheckbutton.CanFocus = true;
- this.showLineNumbersCheckbutton.Name = "showLineNumbersCheckbutton";
- this.showLineNumbersCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Show line numbers");
- this.showLineNumbersCheckbutton.DrawIndicator = true;
- this.showLineNumbersCheckbutton.UseUnderline = true;
- this.vbox3.Add (this.showLineNumbersCheckbutton);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.showLineNumbersCheckbutton]));
- w2.Position = 0;
- w2.Expand = false;
- w2.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.underlineErrorsCheckbutton = new global::Gtk.CheckButton ();
- this.underlineErrorsCheckbutton.CanFocus = true;
- this.underlineErrorsCheckbutton.Name = "underlineErrorsCheckbutton";
- this.underlineErrorsCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Underline errors");
- this.underlineErrorsCheckbutton.DrawIndicator = true;
- this.underlineErrorsCheckbutton.UseUnderline = true;
- this.vbox3.Add (this.underlineErrorsCheckbutton);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.underlineErrorsCheckbutton]));
- w3.Position = 1;
- w3.Expand = false;
- w3.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.highlightMatchingBracketCheckbutton = new global::Gtk.CheckButton ();
- this.highlightMatchingBracketCheckbutton.CanFocus = true;
- this.highlightMatchingBracketCheckbutton.Name = "highlightMatchingBracketCheckbutton";
- this.highlightMatchingBracketCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Highlight matching bracket");
- this.highlightMatchingBracketCheckbutton.DrawIndicator = true;
- this.highlightMatchingBracketCheckbutton.UseUnderline = true;
- this.vbox3.Add (this.highlightMatchingBracketCheckbutton);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.highlightMatchingBracketCheckbutton]));
- w4.Position = 2;
- w4.Expand = false;
- w4.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.highlightCurrentLineCheckbutton = new global::Gtk.CheckButton ();
- this.highlightCurrentLineCheckbutton.CanFocus = true;
- this.highlightCurrentLineCheckbutton.Name = "highlightCurrentLineCheckbutton";
- this.highlightCurrentLineCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("Highlight _current line");
- this.highlightCurrentLineCheckbutton.DrawIndicator = true;
- this.highlightCurrentLineCheckbutton.UseUnderline = true;
- this.vbox3.Add (this.highlightCurrentLineCheckbutton);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.highlightCurrentLineCheckbutton]));
- w5.Position = 3;
- w5.Expand = false;
- w5.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.showRulerCheckbutton = new global::Gtk.CheckButton ();
- this.showRulerCheckbutton.CanFocus = true;
- this.showRulerCheckbutton.Name = "showRulerCheckbutton";
- this.showRulerCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("Show _column ruler");
- this.showRulerCheckbutton.DrawIndicator = true;
- this.showRulerCheckbutton.UseUnderline = true;
- this.vbox3.Add (this.showRulerCheckbutton);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.showRulerCheckbutton]));
- w6.Position = 4;
- w6.Expand = false;
- w6.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.enableAnimationCheckbutton1 = new global::Gtk.CheckButton ();
- this.enableAnimationCheckbutton1.CanFocus = true;
- this.enableAnimationCheckbutton1.Name = "enableAnimationCheckbutton1";
- this.enableAnimationCheckbutton1.Label = global::Mono.Unix.Catalog.GetString ("_Animations enabled");
- this.enableAnimationCheckbutton1.DrawIndicator = true;
- this.enableAnimationCheckbutton1.UseUnderline = true;
- this.vbox3.Add (this.enableAnimationCheckbutton1);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.enableAnimationCheckbutton1]));
- w7.Position = 5;
- w7.Expand = false;
- w7.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.enableHighlightUsagesCheckbutton = new global::Gtk.CheckButton ();
- this.enableHighlightUsagesCheckbutton.CanFocus = true;
- this.enableHighlightUsagesCheckbutton.Name = "enableHighlightUsagesCheckbutton";
- this.enableHighlightUsagesCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Enable highlighting of usages");
- this.enableHighlightUsagesCheckbutton.DrawIndicator = true;
- this.enableHighlightUsagesCheckbutton.UseUnderline = true;
- this.vbox3.Add (this.enableHighlightUsagesCheckbutton);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.enableHighlightUsagesCheckbutton]));
- w8.Position = 6;
- w8.Expand = false;
- w8.Fill = false;
- this.alignment1.Add (this.vbox3);
- this.vbox1.Add (this.alignment1);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment1]));
- w10.Position = 1;
- w10.Expand = false;
- w10.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.GtkLabel10 = new global::Gtk.Label ();
- this.GtkLabel10.Name = "GtkLabel10";
- this.GtkLabel10.Xalign = 0F;
- this.GtkLabel10.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Whitespace Markers</b>");
- this.GtkLabel10.UseMarkup = true;
- this.vbox1.Add (this.GtkLabel10);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel10]));
- w11.Position = 2;
- w11.Expand = false;
- w11.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.GtkAlignment = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
- this.GtkAlignment.Name = "GtkAlignment";
- this.GtkAlignment.LeftPadding = ((uint)(12));
- // Container child GtkAlignment.Gtk.Container+ContainerChild
- this.vbox2 = new global::Gtk.VBox ();
- this.vbox2.Name = "vbox2";
- this.vbox2.Spacing = 6;
- // Container child vbox2.Gtk.Box+BoxChild
- this.showInvLinesCheckbutton = new global::Gtk.CheckButton ();
- this.showInvLinesCheckbutton.CanFocus = true;
- this.showInvLinesCheckbutton.Name = "showInvLinesCheckbutton";
- this.showInvLinesCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Invalid lines");
- this.showInvLinesCheckbutton.DrawIndicator = true;
- this.showInvLinesCheckbutton.UseUnderline = true;
- this.vbox2.Add (this.showInvLinesCheckbutton);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.showInvLinesCheckbutton]));
- w12.Position = 0;
- w12.Expand = false;
- w12.Fill = false;
- // Container child vbox2.Gtk.Box+BoxChild
- this.showSpacesCheckbutton = new global::Gtk.CheckButton ();
- this.showSpacesCheckbutton.CanFocus = true;
- this.showSpacesCheckbutton.Name = "showSpacesCheckbutton";
- this.showSpacesCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("S_paces");
- this.showSpacesCheckbutton.DrawIndicator = true;
- this.showSpacesCheckbutton.UseUnderline = true;
- this.vbox2.Add (this.showSpacesCheckbutton);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.showSpacesCheckbutton]));
- w13.Position = 1;
- w13.Expand = false;
- w13.Fill = false;
- // Container child vbox2.Gtk.Box+BoxChild
- this.showTabsCheckbutton = new global::Gtk.CheckButton ();
- this.showTabsCheckbutton.CanFocus = true;
- this.showTabsCheckbutton.Name = "showTabsCheckbutton";
- this.showTabsCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Tabs");
- this.showTabsCheckbutton.DrawIndicator = true;
- this.showTabsCheckbutton.UseUnderline = true;
- this.vbox2.Add (this.showTabsCheckbutton);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.showTabsCheckbutton]));
- w14.Position = 2;
- w14.Expand = false;
- w14.Fill = false;
- // Container child vbox2.Gtk.Box+BoxChild
- this.showEolCheckbutton = new global::Gtk.CheckButton ();
- this.showEolCheckbutton.CanFocus = true;
- this.showEolCheckbutton.Name = "showEolCheckbutton";
- this.showEolCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_End of line");
- this.showEolCheckbutton.DrawIndicator = true;
- this.showEolCheckbutton.UseUnderline = true;
- this.vbox2.Add (this.showEolCheckbutton);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.showEolCheckbutton]));
- w15.Position = 3;
- w15.Expand = false;
- w15.Fill = false;
- this.GtkAlignment.Add (this.vbox2);
- this.vbox1.Add (this.GtkAlignment);
- global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkAlignment]));
- w17.Position = 3;
- w17.Expand = false;
- w17.Fill = false;
- this.Add (this.vbox1);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- this.Show ();
- }
- }
-}
+ +// This file has been generated by the GUI designer. Do not modify. +namespace MonoDevelop.SourceEditor.OptionPanels +{ + public partial class MarkerPanel + { + private global::Gtk.VBox vbox1; + private global::Gtk.Label GtkLabel9; + private global::Gtk.Alignment alignment1; + private global::Gtk.VBox vbox3; + private global::Gtk.CheckButton showLineNumbersCheckbutton; + private global::Gtk.CheckButton underlineErrorsCheckbutton; + private global::Gtk.CheckButton highlightMatchingBracketCheckbutton; + private global::Gtk.CheckButton highlightCurrentLineCheckbutton; + private global::Gtk.CheckButton showRulerCheckbutton; + private global::Gtk.CheckButton enableAnimationCheckbutton1; + private global::Gtk.CheckButton enableHighlightUsagesCheckbutton; + private global::Gtk.Label GtkLabel10; + private global::Gtk.Alignment GtkAlignment; + private global::Gtk.VBox vbox2; + private global::Gtk.CheckButton showInvLinesCheckbutton; + private global::Gtk.CheckButton showSpacesCheckbutton; + private global::Gtk.CheckButton showTabsCheckbutton; + private global::Gtk.CheckButton showEolCheckbutton; + + protected virtual void Build () + { + global::Stetic.Gui.Initialize (this); + // Widget MonoDevelop.SourceEditor.OptionPanels.MarkerPanel + global::Stetic.BinContainer.Attach (this); + this.Name = "MonoDevelop.SourceEditor.OptionPanels.MarkerPanel"; + // Container child MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.Gtk.Container+ContainerChild + this.vbox1 = new global::Gtk.VBox (); + this.vbox1.Name = "vbox1"; + this.vbox1.Spacing = 6; + // Container child vbox1.Gtk.Box+BoxChild + this.GtkLabel9 = new global::Gtk.Label (); + this.GtkLabel9.Name = "GtkLabel9"; + this.GtkLabel9.Xalign = 0F; + this.GtkLabel9.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>General</b>"); + this.GtkLabel9.UseMarkup = true; + this.vbox1.Add (this.GtkLabel9); + global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel9])); + w1.Position = 0; + w1.Expand = false; + w1.Fill = false; + // Container child vbox1.Gtk.Box+BoxChild + this.alignment1 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); + this.alignment1.Name = "alignment1"; + this.alignment1.LeftPadding = ((uint)(12)); + // Container child alignment1.Gtk.Container+ContainerChild + this.vbox3 = new global::Gtk.VBox (); + this.vbox3.Name = "vbox3"; + this.vbox3.Spacing = 6; + // Container child vbox3.Gtk.Box+BoxChild + this.showLineNumbersCheckbutton = new global::Gtk.CheckButton (); + this.showLineNumbersCheckbutton.CanFocus = true; + this.showLineNumbersCheckbutton.Name = "showLineNumbersCheckbutton"; + this.showLineNumbersCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Show line numbers"); + this.showLineNumbersCheckbutton.DrawIndicator = true; + this.showLineNumbersCheckbutton.UseUnderline = true; + this.vbox3.Add (this.showLineNumbersCheckbutton); + global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.showLineNumbersCheckbutton])); + w2.Position = 0; + w2.Expand = false; + w2.Fill = false; + // Container child vbox3.Gtk.Box+BoxChild + this.underlineErrorsCheckbutton = new global::Gtk.CheckButton (); + this.underlineErrorsCheckbutton.CanFocus = true; + this.underlineErrorsCheckbutton.Name = "underlineErrorsCheckbutton"; + this.underlineErrorsCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Underline errors"); + this.underlineErrorsCheckbutton.DrawIndicator = true; + this.underlineErrorsCheckbutton.UseUnderline = true; + this.vbox3.Add (this.underlineErrorsCheckbutton); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.underlineErrorsCheckbutton])); + w3.Position = 1; + w3.Expand = false; + w3.Fill = false; + // Container child vbox3.Gtk.Box+BoxChild + this.highlightMatchingBracketCheckbutton = new global::Gtk.CheckButton (); + this.highlightMatchingBracketCheckbutton.CanFocus = true; + this.highlightMatchingBracketCheckbutton.Name = "highlightMatchingBracketCheckbutton"; + this.highlightMatchingBracketCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Highlight matching bracket"); + this.highlightMatchingBracketCheckbutton.DrawIndicator = true; + this.highlightMatchingBracketCheckbutton.UseUnderline = true; + this.vbox3.Add (this.highlightMatchingBracketCheckbutton); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.highlightMatchingBracketCheckbutton])); + w4.Position = 2; + w4.Expand = false; + w4.Fill = false; + // Container child vbox3.Gtk.Box+BoxChild + this.highlightCurrentLineCheckbutton = new global::Gtk.CheckButton (); + this.highlightCurrentLineCheckbutton.CanFocus = true; + this.highlightCurrentLineCheckbutton.Name = "highlightCurrentLineCheckbutton"; + this.highlightCurrentLineCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("Highlight _current line"); + this.highlightCurrentLineCheckbutton.DrawIndicator = true; + this.highlightCurrentLineCheckbutton.UseUnderline = true; + this.vbox3.Add (this.highlightCurrentLineCheckbutton); + global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.highlightCurrentLineCheckbutton])); + w5.Position = 3; + w5.Expand = false; + w5.Fill = false; + // Container child vbox3.Gtk.Box+BoxChild + this.showRulerCheckbutton = new global::Gtk.CheckButton (); + this.showRulerCheckbutton.CanFocus = true; + this.showRulerCheckbutton.Name = "showRulerCheckbutton"; + this.showRulerCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("Show _column ruler"); + this.showRulerCheckbutton.DrawIndicator = true; + this.showRulerCheckbutton.UseUnderline = true; + this.vbox3.Add (this.showRulerCheckbutton); + global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.showRulerCheckbutton])); + w6.Position = 4; + w6.Expand = false; + w6.Fill = false; + // Container child vbox3.Gtk.Box+BoxChild + this.enableAnimationCheckbutton1 = new global::Gtk.CheckButton (); + this.enableAnimationCheckbutton1.CanFocus = true; + this.enableAnimationCheckbutton1.Name = "enableAnimationCheckbutton1"; + this.enableAnimationCheckbutton1.Label = global::Mono.Unix.Catalog.GetString ("_Animations enabled"); + this.enableAnimationCheckbutton1.DrawIndicator = true; + this.enableAnimationCheckbutton1.UseUnderline = true; + this.vbox3.Add (this.enableAnimationCheckbutton1); + global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.enableAnimationCheckbutton1])); + w7.Position = 5; + w7.Expand = false; + w7.Fill = false; + // Container child vbox3.Gtk.Box+BoxChild + this.enableHighlightUsagesCheckbutton = new global::Gtk.CheckButton (); + this.enableHighlightUsagesCheckbutton.CanFocus = true; + this.enableHighlightUsagesCheckbutton.Name = "enableHighlightUsagesCheckbutton"; + this.enableHighlightUsagesCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Enable highlighting of usages"); + this.enableHighlightUsagesCheckbutton.DrawIndicator = true; + this.enableHighlightUsagesCheckbutton.UseUnderline = true; + this.vbox3.Add (this.enableHighlightUsagesCheckbutton); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.enableHighlightUsagesCheckbutton])); + w8.Position = 6; + w8.Expand = false; + w8.Fill = false; + this.alignment1.Add (this.vbox3); + this.vbox1.Add (this.alignment1); + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment1])); + w10.Position = 1; + w10.Expand = false; + w10.Fill = false; + // Container child vbox1.Gtk.Box+BoxChild + this.GtkLabel10 = new global::Gtk.Label (); + this.GtkLabel10.Name = "GtkLabel10"; + this.GtkLabel10.Xalign = 0F; + this.GtkLabel10.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Whitespace Markers</b>"); + this.GtkLabel10.UseMarkup = true; + this.vbox1.Add (this.GtkLabel10); + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel10])); + w11.Position = 2; + w11.Expand = false; + w11.Fill = false; + // Container child vbox1.Gtk.Box+BoxChild + this.GtkAlignment = new global::Gtk.Alignment (0F, 0F, 1F, 1F); + this.GtkAlignment.Name = "GtkAlignment"; + this.GtkAlignment.LeftPadding = ((uint)(12)); + // Container child GtkAlignment.Gtk.Container+ContainerChild + this.vbox2 = new global::Gtk.VBox (); + this.vbox2.Name = "vbox2"; + this.vbox2.Spacing = 6; + // Container child vbox2.Gtk.Box+BoxChild + this.showInvLinesCheckbutton = new global::Gtk.CheckButton (); + this.showInvLinesCheckbutton.CanFocus = true; + this.showInvLinesCheckbutton.Name = "showInvLinesCheckbutton"; + this.showInvLinesCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Invalid lines"); + this.showInvLinesCheckbutton.DrawIndicator = true; + this.showInvLinesCheckbutton.UseUnderline = true; + this.vbox2.Add (this.showInvLinesCheckbutton); + global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.showInvLinesCheckbutton])); + w12.Position = 0; + w12.Expand = false; + w12.Fill = false; + // Container child vbox2.Gtk.Box+BoxChild + this.showSpacesCheckbutton = new global::Gtk.CheckButton (); + this.showSpacesCheckbutton.CanFocus = true; + this.showSpacesCheckbutton.Name = "showSpacesCheckbutton"; + this.showSpacesCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("S_paces"); + this.showSpacesCheckbutton.DrawIndicator = true; + this.showSpacesCheckbutton.UseUnderline = true; + this.vbox2.Add (this.showSpacesCheckbutton); + global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.showSpacesCheckbutton])); + w13.Position = 1; + w13.Expand = false; + w13.Fill = false; + // Container child vbox2.Gtk.Box+BoxChild + this.showTabsCheckbutton = new global::Gtk.CheckButton (); + this.showTabsCheckbutton.CanFocus = true; + this.showTabsCheckbutton.Name = "showTabsCheckbutton"; + this.showTabsCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Tabs"); + this.showTabsCheckbutton.DrawIndicator = true; + this.showTabsCheckbutton.UseUnderline = true; + this.vbox2.Add (this.showTabsCheckbutton); + global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.showTabsCheckbutton])); + w14.Position = 2; + w14.Expand = false; + w14.Fill = false; + // Container child vbox2.Gtk.Box+BoxChild + this.showEolCheckbutton = new global::Gtk.CheckButton (); + this.showEolCheckbutton.CanFocus = true; + this.showEolCheckbutton.Name = "showEolCheckbutton"; + this.showEolCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_End of line"); + this.showEolCheckbutton.DrawIndicator = true; + this.showEolCheckbutton.UseUnderline = true; + this.vbox2.Add (this.showEolCheckbutton); + global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.showEolCheckbutton])); + w15.Position = 3; + w15.Expand = false; + w15.Fill = false; + this.GtkAlignment.Add (this.vbox2); + this.vbox1.Add (this.GtkAlignment); + global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkAlignment])); + w17.Position = 3; + w17.Expand = false; + w17.Fill = false; + this.Add (this.vbox1); + if ((this.Child != null)) { + this.Child.ShowAll (); + } + this.Show (); + } + } +} diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/generated.cs b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/generated.cs index b965530299..d23ef38e01 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/generated.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/generated.cs @@ -1,120 +1,115 @@ -
-// This file has been generated by the GUI designer. Do not modify.
-namespace Stetic
-{
- internal class Gui
- {
- private static bool initialized;
-
- internal static void Initialize (Gtk.Widget iconRenderer)
- {
- if ((Stetic.Gui.initialized == false)) {
- Stetic.Gui.initialized = true;
- }
- }
- }
-
- internal class BinContainer
- {
- private Gtk.Widget child;
- private Gtk.UIManager uimanager;
-
- public static BinContainer Attach (Gtk.Bin bin)
- {
- BinContainer bc = new BinContainer ();
- bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested);
- bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated);
- bin.Added += new Gtk.AddedHandler (bc.OnAdded);
- return bc;
- }
-
- private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args)
- {
- if ((this.child != null)) {
- args.Requisition = this.child.SizeRequest ();
- }
- }
-
- private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args)
- {
- if ((this.child != null)) {
- this.child.Allocation = args.Allocation;
- }
- }
-
- private void OnAdded (object sender, Gtk.AddedArgs args)
- {
- this.child = args.Widget;
- }
-
- public void SetUiManager (Gtk.UIManager uim)
- {
- this.uimanager = uim;
- this.child.Realized += new System.EventHandler (this.OnRealized);
- }
-
- private void OnRealized (object sender, System.EventArgs args)
- {
- if ((this.uimanager != null)) {
- Gtk.Widget w;
- w = this.child.Toplevel;
- if (((w != null)
- && typeof(Gtk.Window).IsInstanceOfType (w))) {
- ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
- this.uimanager = null;
- }
- }
- }
- }
-
- internal class IconLoader
- {
- public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
- {
- Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
- if ((res != null)) {
- return res;
- } else {
- int sz;
- int sy;
- global::Gtk.Icon.SizeLookup (size, out sz, out sy);
- try {
- return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
- } catch (System.Exception) {
- if ((name != "gtk-missing-image")) {
- return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
- } else {
- Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz);
- Gdk.GC gc = new Gdk.GC (pmap);
- gc.RgbFgColor = new Gdk.Color (255, 255, 255);
- pmap.DrawRectangle (gc, true, 0, 0, sz, sz);
- gc.RgbFgColor = new Gdk.Color (0, 0, 0);
- pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
- gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
- gc.RgbFgColor = new Gdk.Color (255, 0, 0);
- pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1)
- - (sz / 4)), ((sz - 1)
- - (sz / 4)));
- pmap.DrawLine (gc, ((sz - 1)
- - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1)
- - (sz / 4)));
- return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
- }
- }
- }
- }
- }
-
- internal class ActionGroups
- {
- public static Gtk.ActionGroup GetActionGroup (System.Type type)
- {
- return Stetic.ActionGroups.GetActionGroup (type.FullName);
- }
-
- public static Gtk.ActionGroup GetActionGroup (string name)
- {
- return null;
- }
- }
-}
+ +// This file has been generated by the GUI designer. Do not modify. +namespace Stetic +{ + internal class Gui + { + private static bool initialized; + + internal static void Initialize (Gtk.Widget iconRenderer) + { + if ((Stetic.Gui.initialized == false)) { + Stetic.Gui.initialized = true; + } + } + } + + internal class BinContainer + { + private Gtk.Widget child; + private Gtk.UIManager uimanager; + + public static BinContainer Attach (Gtk.Bin bin) + { + BinContainer bc = new BinContainer (); + bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested); + bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated); + bin.Added += new Gtk.AddedHandler (bc.OnAdded); + return bc; + } + + private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args) + { + if ((this.child != null)) { + args.Requisition = this.child.SizeRequest (); + } + } + + private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args) + { + if ((this.child != null)) { + this.child.Allocation = args.Allocation; + } + } + + private void OnAdded (object sender, Gtk.AddedArgs args) + { + this.child = args.Widget; + } + + public void SetUiManager (Gtk.UIManager uim) + { + this.uimanager = uim; + this.child.Realized += new System.EventHandler (this.OnRealized); + } + + private void OnRealized (object sender, System.EventArgs args) + { + if ((this.uimanager != null)) { + Gtk.Widget w; + w = this.child.Toplevel; + if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) { + ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup); + this.uimanager = null; + } + } + } + } + + internal class IconLoader + { + public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size) + { + Gdk.Pixbuf res = widget.RenderIcon (name, size, null); + if ((res != null)) { + return res; + } else { + int sz; + int sy; + global::Gtk.Icon.SizeLookup (size, out sz, out sy); + try { + return Gtk.IconTheme.Default.LoadIcon (name, sz, 0); + } catch (System.Exception) { + if ((name != "gtk-missing-image")) { + return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size); + } else { + Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz); + Gdk.GC gc = new Gdk.GC (pmap); + gc.RgbFgColor = new Gdk.Color (255, 255, 255); + pmap.DrawRectangle (gc, true, 0, 0, sz, sz); + gc.RgbFgColor = new Gdk.Color (0, 0, 0); + pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1)); + gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round); + gc.RgbFgColor = new Gdk.Color (255, 0, 0); + pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4))); + pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4))); + return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz); + } + } + } + } + } + + internal class ActionGroups + { + public static Gtk.ActionGroup GetActionGroup (System.Type type) + { + return Stetic.ActionGroups.GetActionGroup (type.FullName); + } + + public static Gtk.ActionGroup GetActionGroup (string name) + { + return null; + } + } +} diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WebServiceDiscoveryResultWCF.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WebServiceDiscoveryResultWCF.cs index c16366a468..fd5c83c6ae 100644 --- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WebServiceDiscoveryResultWCF.cs +++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WebServiceDiscoveryResultWCF.cs @@ -149,9 +149,12 @@ namespace MonoDevelop.WebReferences.WCF bool targetMonoTouch = dotNetProject.TargetFramework.Id.Identifier == ("MonoTouch"); bool targetMonoDroid = dotNetProject.TargetFramework.Id.Identifier == ("MonoDroid"); + bool targetCoreClr = targetMoonlight || targetMonoDroid || targetMonoTouch; + bool generateSyncMethods = targetMonoDroid | targetMonoTouch; + ServiceContractGenerator generator = new ServiceContractGenerator (ccu); generator.Options = ServiceContractGenerationOptions.ChannelInterface | ServiceContractGenerationOptions.ClientClass; - if (refGroup.ClientOptions.GenerateAsynchronousMethods || targetMoonlight || targetMonoTouch) + if (refGroup.ClientOptions.GenerateAsynchronousMethods || targetCoreClr) generator.Options |= ServiceContractGenerationOptions.AsynchronousMethods; if (refGroup.ClientOptions.GenerateInternalTypes) generator.Options |= ServiceContractGenerationOptions.InternalTypes; @@ -177,11 +180,11 @@ namespace MonoDevelop.WebReferences.WCF foreach (ContractDescription cd in contracts) { cd.Namespace = proxyNamespace; - if (targetMoonlight || targetMonoTouch) { + if (targetCoreClr) { var moonctx = new MoonlightChannelBaseContext (); - cd.Behaviors.Add (new MoonlightChannelBaseContractExtension (moonctx, targetMonoTouch)); + cd.Behaviors.Add (new MoonlightChannelBaseContractExtension (moonctx, generateSyncMethods)); foreach (var od in cd.Operations) - od.Behaviors.Add (new MoonlightChannelBaseOperationExtension (moonctx, targetMonoTouch)); + od.Behaviors.Add (new MoonlightChannelBaseOperationExtension (moonctx, generateSyncMethods)); generator.GenerateServiceContractType (cd); moonctx.Fixup (); } diff --git a/main/src/addins/VBNetBinding/gtk-gui/MonoDevelop.VBNetBinding.ConfigurationOptionsPanelWidget.cs b/main/src/addins/VBNetBinding/gtk-gui/MonoDevelop.VBNetBinding.ConfigurationOptionsPanelWidget.cs index 4d20968303..0861e6b3b7 100644 --- a/main/src/addins/VBNetBinding/gtk-gui/MonoDevelop.VBNetBinding.ConfigurationOptionsPanelWidget.cs +++ b/main/src/addins/VBNetBinding/gtk-gui/MonoDevelop.VBNetBinding.ConfigurationOptionsPanelWidget.cs @@ -39,7 +39,7 @@ namespace MonoDevelop.VBNetBinding private global::Gtk.Label label96; private global::Gtk.Entry txtAdditionalArguments; private global::Gtk.Entry txtDefineConstants; - + protected virtual void Build () { global::Stetic.Gui.Initialize (this); diff --git a/main/src/addins/VBNetBinding/gtk-gui/MonoDevelop.VBNetBinding.ImportsOptionsPanelWidget.cs b/main/src/addins/VBNetBinding/gtk-gui/MonoDevelop.VBNetBinding.ImportsOptionsPanelWidget.cs index eff9c262a7..7cab12ed87 100644 --- a/main/src/addins/VBNetBinding/gtk-gui/MonoDevelop.VBNetBinding.ImportsOptionsPanelWidget.cs +++ b/main/src/addins/VBNetBinding/gtk-gui/MonoDevelop.VBNetBinding.ImportsOptionsPanelWidget.cs @@ -12,7 +12,7 @@ namespace MonoDevelop.VBNetBinding private global::Gtk.VBox vbox1; private global::Gtk.Button cmdRemove; private global::Gtk.Label label10; - + protected virtual void Build () { global::Stetic.Gui.Initialize (this); diff --git a/main/src/addins/VBNetBinding/gtk-gui/MonoDevelop.VBNetBinding.ProjectOptionsPanelWidget.cs b/main/src/addins/VBNetBinding/gtk-gui/MonoDevelop.VBNetBinding.ProjectOptionsPanelWidget.cs index e2c5dc3560..08ce929f46 100644 --- a/main/src/addins/VBNetBinding/gtk-gui/MonoDevelop.VBNetBinding.ProjectOptionsPanelWidget.cs +++ b/main/src/addins/VBNetBinding/gtk-gui/MonoDevelop.VBNetBinding.ProjectOptionsPanelWidget.cs @@ -24,7 +24,7 @@ namespace MonoDevelop.VBNetBinding private global::Gtk.Label label86; private global::Gtk.Label label88; private global::Gtk.ComboBoxEntry txtMyType; - + protected virtual void Build () { global::Stetic.Gui.Initialize (this); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Task.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Task.cs index e10443eedc..105b108e20 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Task.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Task.cs @@ -59,7 +59,6 @@ namespace MonoDevelop.VersionControl msg += " " + e.InnerException.Message; } tracker.ReportError (msg, e); - GLib.ExceptionManager.RaiseUnhandledException (e, false); } finally { threadnotify.WakeupMain(); } diff --git a/main/src/core/Mono.Debugging/Mono.Debugging.Evaluation/FilteredMembersSource.cs b/main/src/core/Mono.Debugging/Mono.Debugging.Evaluation/FilteredMembersSource.cs index be7f2d1b08..deafa047ff 100644 --- a/main/src/core/Mono.Debugging/Mono.Debugging.Evaluation/FilteredMembersSource.cs +++ b/main/src/core/Mono.Debugging/Mono.Debugging.Evaluation/FilteredMembersSource.cs @@ -48,6 +48,7 @@ namespace Mono.Debugging.Evaluation public ObjectValue[] GetChildren (ObjectPath path, int index, int count, EvaluationOptions options) { EvaluationContext cctx = ctx.WithOptions (options); + var names = new ObjectValueNameTracker (cctx); object tdataType = null; TypeDisplayData tdata = null; List<ObjectValue> list = new List<ObjectValue> (); @@ -61,6 +62,7 @@ namespace Mono.Debugging.Evaluation if (state == DebuggerBrowsableState.Never) continue; ObjectValue oval = val.CreateObjectValue (options); + names.Disambiguate (val, oval); list.Add (oval); } if ((bindingFlags & BindingFlags.NonPublic) == 0) { diff --git a/main/src/core/Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs b/main/src/core/Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs index d44441ab84..cdb65ccf8a 100644 --- a/main/src/core/Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs +++ b/main/src/core/Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs @@ -362,7 +362,7 @@ namespace Mono.Debugging.Evaluation // to avoid problems with objects being invalidated due to evaluations in the target, List<ValueReference> list = new List<ValueReference> (); list.AddRange (GetMembersSorted (ctx, objectSource, type, proxy, access)); - + var names = new ObjectValueNameTracker (ctx); object tdataType = type; foreach (ValueReference val in list) { @@ -387,6 +387,7 @@ namespace Mono.Debugging.Evaluation } else { ObjectValue oval = val.CreateObjectValue (true); + names.Disambiguate (val, oval); values.Add (oval); } @@ -1068,6 +1069,44 @@ namespace Mono.Debugging.Evaluation } } + class ObjectValueNameTracker + { + Dictionary<string,KeyValuePair<ObjectValue, ValueReference>> names = new Dictionary<string,KeyValuePair<ObjectValue, ValueReference>> (); + EvaluationContext ctx; + + public ObjectValueNameTracker (EvaluationContext ctx) + { + this.ctx = ctx; + } + + /// <summary> + /// Disambiguate the ObjectValue's name (in the case where the property name also exists in a base class). + /// </summary> + /// <param name='val'> + /// The ValueReference. + /// </param> + /// <param name='oval'> + /// The ObjectValue. + /// </param> + public void Disambiguate (ValueReference val, ObjectValue oval) + { + KeyValuePair<ObjectValue, ValueReference> other; + if (names.TryGetValue (oval.Name, out other)) { + object tn = val.DeclaringType; + + if (tn != null) + oval.Name += " (" + ctx.Adapter.GetDisplayTypeName (ctx, tn) + ")"; + if (!other.Key.Name.EndsWith (")")) { + tn = other.Value.DeclaringType; + if (tn != null) + other.Key.Name += " (" + ctx.Adapter.GetDisplayTypeName (ctx, tn) + ")"; + } + } + + names [oval.Name] = new KeyValuePair<ObjectValue, ValueReference> (oval, val); + } + } + public struct EnumMember { public string Name { get; set; } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMode.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMode.cs index 620c8eeadc..5bfd0c402e 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMode.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMode.cs @@ -129,7 +129,7 @@ namespace Mono.TextEditor.Vi statusText = value + " recording"; } } - + } protected virtual string RunExCommand (string command) @@ -148,7 +148,7 @@ namespace Mono.TextEditor.Vi return "Jumped to beginning of document."; } - Data.Caret.Line = line - 1; + Data.Caret.Line = line; Editor.ScrollToCaret (); return string.Format ("Jumped to line {0}.", line); } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/GtkWorkarounds.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/GtkWorkarounds.cs index a24754014b..be526c3c3c 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/GtkWorkarounds.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/GtkWorkarounds.cs @@ -155,7 +155,7 @@ namespace Mono.TextEditor float x, y, width, height; if (visible.Height < frame.Height) { - float dockHeight = visible.Y; + float dockHeight = visible.Y - frame.Y; float menubarHeight = (frame.Height - visible.Height) - dockHeight; height = frame.Height - menubarHeight - dockHeight; @@ -314,27 +314,28 @@ namespace Mono.TextEditor bool flip_left = true; bool flip_up = false; - int x_over = x + request.Width - geometry.Right; - if (x_over > 0) { + if (x + request.Width > geometry.Right) { if (flip_left) { x -= request.Width; } else { - x -= x_over; + x = geometry.Right - request.Width; } + + if (x < geometry.Left) + x = geometry.Left; } - int y_over = y + request.Height - geometry.Bottom; - if (y_over > 0) { + if (y + request.Height > geometry.Bottom) { if (flip_up) { y -= request.Height; } else { - y -= y_over; + y = geometry.Bottom - request.Height; } + + if (y < geometry.Top) + y = geometry.Top; } - y = System.Math.Max (geometry.Top, System.Math.Min (y, geometry.Bottom - request.Height)); - x = System.Math.Max (geometry.Left, System.Math.Min (x, geometry.Right - request.Width)); - pushIn = false; }; } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorContainer.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorContainer.cs index 97961d7f9c..14e42ce8ce 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorContainer.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorContainer.cs @@ -106,14 +106,6 @@ namespace Mono.TextEditor info.X = x; info.Y = y; containerChildren.Add (info); - - widget.Mapped += (sender, e) => { - Console.WriteLine ("\tChild mapped!"); - }; - - widget.Unmapped += (sender, e) => { - Console.WriteLine ("\tChild unmapped!"); - }; } public void MoveTopLevelWidget (Gtk.Widget widget, int x, int y) @@ -346,7 +338,9 @@ namespace Mono.TextEditor void HandleHAdjustementValueChanged (object sender, EventArgs e) { - SetChildrenPositions (Allocation); + var alloc = this.Allocation; + alloc.X = alloc.Y = 0; + SetChildrenPositions (alloc); } protected override void OnDestroyed () @@ -358,4 +352,4 @@ namespace Mono.TextEditor base.OnDestroyed (); } } -}
\ No newline at end of file +} diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.FileSystem/UnixFileSystemExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.FileSystem/UnixFileSystemExtension.cs index fa3fc03b14..d29c7e9772 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.FileSystem/UnixFileSystemExtension.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.FileSystem/UnixFileSystemExtension.cs @@ -32,13 +32,22 @@ namespace MonoDevelop.Core.FileSystem { class UnixFileSystemExtension : DefaultFileSystemExtension { + const int PATHMAX = 4096 + 1; + [DllImport ("libc")] - static extern string realpath (string path, IntPtr buffer); + static extern IntPtr realpath (string path, IntPtr buffer); public override FilePath ResolveFullPath (FilePath path) { - // Handle symlinks - return realpath (path, IntPtr.Zero); + IntPtr buffer = IntPtr.Zero; + try { + buffer = Marshal.AllocHGlobal (PATHMAX); + var result = realpath (path, buffer); + return result == IntPtr.Zero ? "" : Marshal.PtrToStringAuto (buffer); + } finally { + if (buffer != IntPtr.Zero) + Marshal.FreeHGlobal (buffer); + } } } } diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.LogReporting/LogReportingService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.LogReporting/LogReportingService.cs index 586787d81f..ff4e6713bc 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.LogReporting/LogReportingService.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.LogReporting/LogReportingService.cs @@ -43,7 +43,11 @@ namespace MonoDevelop.Core.LogReporting static int CrashId; static int Processing; - public static Func<bool> ShouldEnableReporting; + // Return value is the new value for 'ReportCrashes' + // First parameter is the current value of 'ReportCrashes + // Second parameter is the exception + // Thirdparameter shows if the exception is fatal or not + public static Func<bool?, Exception, bool, bool?> UnhandledErrorOccured; public static bool? ReportCrashes { get { return PropertyService.Get<bool?> (ReportCrashesKey); } @@ -55,14 +59,10 @@ namespace MonoDevelop.Core.LogReporting set { PropertyService.Set (ReportUsageKey, value); } } - public static void ReportUnhandledException (Exception ex) + public static void ReportUnhandledException (Exception ex, bool willShutDown) { - // if the user hasn't opted in/out yet, ask them - if (!ReportCrashes.HasValue) { - var handler = ShouldEnableReporting; - if (handler != null) - ReportCrashes = handler (); - } + if (UnhandledErrorOccured != null) + ReportCrashes = UnhandledErrorOccured (ReportCrashes, ex, willShutDown); // If crash reporting has been explicitly disabled, disregard this crash if (ReportCrashes.HasValue && !ReportCrashes.Value) @@ -82,10 +82,9 @@ namespace MonoDevelop.Core.LogReporting data = stream.ToArray (); } - // If crash reporting has not been enabled or disabled yet, just log to disk. - // Otherwise log to disk only if uploading fails. + // Log to disk only if uploading fails. var filename = string.Format ("{0}.{1}.crashlog", SystemInformation.SessionUuid, Interlocked.Increment (ref CrashId)); - if (!ReportCrashes.GetValueOrDefault () || !TryUploadReport (filename, data)) { + if (!TryUploadReport (filename, data)) { if (!Directory.Exists (CrashLogDirectory)) Directory.CreateDirectory (CrashLogDirectory); diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs index e8d8bb2588..484808ee53 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs @@ -73,6 +73,20 @@ namespace MonoDevelop.Core } } } + + static FilePath GenericLogFile { + get { return "MonoDevelop.log"; } + } + + static string FormattedGenericLogFile (int value) + { + return string.Format ("MonoDevelop-{0}.log", value); + } + + static string FormattedUniqueFileName (DateTime timestamp) + { + return string.Format ("MonoDevelop.{0}.log", timestamp.ToString ("yyyy-MM-dd__HH-mm-ss")); + } public static void Initialize (bool redirectOutput) { @@ -88,7 +102,7 @@ namespace MonoDevelop.Core if (!Directory.Exists (UserProfile.Current.LogDir)) return; - var files = Directory.EnumerateFiles (UserProfile.Current.LogDir) + var files = Directory.EnumerateFiles (UserProfile.Current.LogDir, "MonoDevelop.*.log") .Select (f => new FileInfo (f)) .Where (f => f.CreationTimeUtc < DateTime.UtcNow.Subtract (TimeSpan.FromDays (30))); @@ -101,29 +115,54 @@ namespace MonoDevelop.Core FilePath logDir = UserProfile.Current.LogDir; if (!Directory.Exists (logDir)) Directory.CreateDirectory (logDir); - - //TODO: log rotation - string file = logDir.Combine (string.Format ("MonoDevelop.{0}.log", SystemInformation.SessionUuid)); + try { if (Platform.IsWindows) { //TODO: redirect the file descriptors on Windows, just plugging in a textwriter won't get everything - RedirectOutputToFileWindows (file); + RedirectOutputToFileWindows (logDir); } else { - RedirectOutputToFileUnix (file); + RedirectOutputToFileUnix (logDir); } } catch { } } - static void RedirectOutputToFileWindows (string file) + static IEnumerable<string> GetGenericLogFiles (FilePath logDirectory) { - var logFile = new StreamWriter (file); + // Look for MonoDevelop.log and also MonoDevelop-XXX.log and move them to MonoDevelop.{timestamp}.log files + // as we cannot symlink on windows and we want 'MonoDevelop.log' to be the newest log file + string additonalGenericLogs = Path.GetFileNameWithoutExtension (GenericLogFile) + "-"; + return Directory.GetFiles (logDirectory) + .Where (f => f == GenericLogFile || f.StartsWith (additonalGenericLogs)) + .OrderBy (f => f); + } + + static void RedirectOutputToFileWindows (FilePath logDirectory) + { + // First try to move any generic MonoDevelop.log files to a timestamped filename + foreach (var path in GetGenericLogFiles (logDirectory)) { + try { + var creationTime = File.GetCreationTime (path); + var destination = logDirectory.Combine (FormattedUniqueFileName (creationTime)); + File.Copy (path, destination, true); + File.Delete (path); + } catch {} + } + + // Find the first free filename, try MonoDevelop.log first and then MonoDevelop-{0}.log + int count = 0; + var newLogFileName = GenericLogFile; + var existingFiles = GetGenericLogFiles (logDirectory).Select (f => Path.GetFileName (f)).ToList (); + while (existingFiles.Contains (newLogFileName)) + newLogFileName = FormattedGenericLogFile (count ++); + + var logFile = new StreamWriter (logDirectory.Combine (newLogFileName)); logFile.AutoFlush = true; Console.SetOut (logFile); Console.SetError (logFile); } - static void RedirectOutputToFileUnix (string file) + static void RedirectOutputToFileUnix (FilePath logDirectory) { const int STDOUT_FILENO = 1; const int STDERR_FILENO = 2; @@ -134,6 +173,7 @@ namespace MonoDevelop.Core | Mono.Unix.Native.FilePermissions.S_IRUSR | Mono.Unix.Native.FilePermissions.S_IWUSR | Mono.Unix.Native.FilePermissions.S_IRGRP | Mono.Unix.Native.FilePermissions.S_IWGRP; + var file = logDirectory.Combine (FormattedUniqueFileName (DateTime.Now)); int fd = Mono.Unix.Native.Syscall.open (file, flags, mode); if (fd < 0) //error @@ -148,6 +188,10 @@ namespace MonoDevelop.Core if (res < 0) //error return; + + var genericLog = logDirectory.Combine (GenericLogFile); + File.Delete (genericLog); + Mono.Unix.Native.Syscall.symlink (file, genericLog); } finally { Mono.Unix.Native.Syscall.close (fd); } diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs index 9d953b1ae2..c0caeb856a 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs @@ -145,6 +145,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild if (elem != null) elem.ParentNode.RemoveChild (elem); else + //FIXME: should this actually log an error? Console.WriteLine ("ppnf:"); } diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildAction.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildAction.cs index af5438cb48..78cc24f9b6 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildAction.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildAction.cs @@ -72,45 +72,8 @@ namespace MonoDevelop.Projects Compile, Content, EmbeddedResource, - ApplicationDefinition, - InterfaceDefinition, - Resource, -// SplashScreen, -// EntityDeploy }; } } - static Dictionary<string, string> translations = new Dictionary<string, string> (); - static BuildAction() - { - translations[None] = GettextCatalog.GetString ("Nothing"); - translations[Compile] = GettextCatalog.GetString ("Compile"); - translations[EmbeddedResource] = GettextCatalog.GetString ("Embed as resource"); - translations[Content] = GettextCatalog.GetString ("Content"); - translations[ApplicationDefinition] = GettextCatalog.GetString ("Application definition"); - translations[Page] = GettextCatalog.GetString ("Page"); - translations[InterfaceDefinition] = GettextCatalog.GetString ("Interface definition"); - translations[Resource] = GettextCatalog.GetString ("Resource"); - translations[SplashScreen] = GettextCatalog.GetString ("Splash screen"); - translations[EntityDeploy] = GettextCatalog.GetString ("Entity deploy"); - } - - public static string ReTranslate (string translatedAction) - { - foreach (KeyValuePair<string, string> translation in translations) { - if (translation.Value == translatedAction) - return translation.Key; - } - return translatedAction; - } - - public static string Translate (string action) - { - string result; - if (translations.TryGetValue (action, out result)) - return result; - return action; - } - } } diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildResult.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildResult.cs index a92aaa9a90..543ec390c1 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildResult.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildResult.cs @@ -30,6 +30,7 @@ using System; using System.CodeDom.Compiler; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Text.RegularExpressions; namespace MonoDevelop.Projects { @@ -290,5 +291,39 @@ namespace MonoDevelop.Projects get { return sourceTarget; } set { sourceTarget = value; } } + + //FIXME: this doesn't get hanlde the complete MSBuild error format, see + //http://blogs.msdn.com/b/msbuild/archive/2006/11/03/msbuild-visual-studio-aware-error-messages-and-message-formats.aspx + static Regex regexError = new Regex ( + @"^(\s*(?<file>[^\(]+)(\((?<line>\d*)(,(?<column>\d*[\+]*))?\))?:\s+)*(?<level>\w+)\s+(?<number>..\d+):\s*(?<message>.*)", + RegexOptions.Compiled | RegexOptions.ExplicitCapture); + + public static BuildError FromMSBuildErrorFormat (string lineText) + { + Match match = regexError.Match (lineText); + if (!match.Success) + return null; + + return new BuildError () { + FileName = match.Result ("${file}") ?? "", + IsWarning = match.Result ("${level}") == "warning", + ErrorNumber = match.Result ("${number}"), + ErrorText = match.Result ("${message}"), + Line = GetLineNumber (match.Result ("${line}")), + Column = GetLineNumber (match.Result ("${column}")), + }; + } + + static int GetLineNumber (string textValue) + { + if (string.IsNullOrEmpty (textValue)) + return 0; + + int val; + if (Int32.TryParse (textValue, out val)) + return val; + + return -1; + } } }
\ No newline at end of file diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetAssemblyProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetAssemblyProject.cs index e1a6f5619d..078d6e1ac3 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetAssemblyProject.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetAssemblyProject.cs @@ -63,7 +63,7 @@ namespace MonoDevelop.Projects case "MSBuild05": return TargetFrameworkMoniker.NET_2_0; case "MSBuild08": - return TargetFrameworkMoniker.NET_3_5; + return TargetFrameworkMoniker.NET_2_0; case "MSBuild10": return TargetFrameworkMoniker.NET_4_0; } diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs index 6e6aa2963b..169a28003b 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs @@ -768,6 +768,36 @@ namespace MonoDevelop.Projects if (base.CheckNeedsBuild (configuration)) return true; + // base.CheckNeedsBuild() checks Project references, but not Assembly, Package, or Custom. + DateTime mtime = GetLastBuildTime (configuration); + foreach (ProjectReference pref in References) { + switch (pref.ReferenceType) { + case ReferenceType.Assembly: + foreach (var file in GetAssemblyRefsRec (pref.Reference, new HashSet<string> ())) { + try { + if (File.GetLastWriteTime (file) > mtime) + return true; + } catch (IOException) { + // Ignore. + } + } + break; + case ReferenceType.Package: + if (pref.Package == null) { + break; + } + foreach (var assembly in pref.Package.Assemblies) { + try { + if (File.GetLastWriteTime (assembly.Location) > mtime) + return true; + } catch (IOException) { + // Ignore. + } + } + break; + } + } + return Files.Any (file => file.BuildAction == BuildAction.EmbeddedResource && String.Compare (Path.GetExtension (file.FilePath), ".resx", StringComparison.OrdinalIgnoreCase) == 0 && MD1DotNetProjectHandler.IsResgenRequired (file.FilePath)); diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFileCollection.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFileCollection.cs index 024c6da642..2dab858328 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFileCollection.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFileCollection.cs @@ -92,8 +92,10 @@ namespace MonoDevelop.Projects { fileName = FileService.GetFullPath (fileName); for (int n=0; n<Count; n++) { - if (Items [n].Name == fileName) + if (Items [n].Name == fileName) { RemoveAt (n); + break; + } } } } diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs index 2b8ceb4266..50a3389707 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs @@ -91,7 +91,7 @@ namespace MonoDevelop.Projects AddinManager.AddExtensionNodeHandler (ProjectBindingsExtensionPath, OnProjectsExtensionChanged); AddinManager.ExtensionChanged += OnExtensionChanged; - defaultFormat = formatManager.GetFileFormat ("MSBuild05"); + defaultFormat = formatManager.GetFileFormat ("MSBuild10"); } public DataContext DataContext { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/ErrorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/ErrorDialog.cs index 9f219d91b8..0b86d75a1e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/ErrorDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/ErrorDialog.cs @@ -25,6 +25,7 @@ // THE SOFTWARE. using System; +using MonoDevelop.Ide; namespace MonoDevelop.Components.Extensions { @@ -34,12 +35,19 @@ namespace MonoDevelop.Components.Extensions public class ExceptionDialogData : PlatformDialogData { + public AlertButton[] Buttons { get; set; } public string Message { get; set; } public Exception Exception { get; set; } + public AlertButton ResultButton { get; set; } } public class ExceptionDialog : PlatformDialog<ExceptionDialogData> { + public AlertButton[] Buttons { + get { return data.Buttons; } + set { data.Buttons = value; } + } + public string Message { get { return data.Message; } set { data.Message = value; } @@ -50,12 +58,19 @@ namespace MonoDevelop.Components.Extensions set { data.Exception = value; } } + public AlertButton ResultButton { + get { return data.ResultButton; } + private set { data.ResultButton = value; } + } + protected override bool RunDefault () { var errorDialog = new MonoDevelop.Ide.Gui.Dialogs.GtkErrorDialog (TransientFor); errorDialog.Message = Message; errorDialog.AddDetails (Exception.ToString (), false); - MonoDevelop.Ide.MessageService.ShowCustomDialog (errorDialog, TransientFor); + errorDialog.Buttons = Buttons; + int result = MonoDevelop.Ide.MessageService.ShowCustomDialog (errorDialog, TransientFor); + ResultButton = result >= 0 ? Buttons [result] : null; return true; } } 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 72917605ba..d21d1af391 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs @@ -38,80 +38,116 @@ namespace MonoDevelop.Ide.FindInFiles { public partial class FindInFilesDialog : Gtk.Dialog {
- readonly bool writeScope = true;
- readonly bool showReplace; + readonly bool writeScope = true; - const int ScopeWholeSolution = 0; - const int ScopeCurrentProject = 1; - const int ScopeAllOpenFiles = 2; - const int ScopeDirectories = 3; - const int ScopeCurrentDocument = 4; - const int ScopeSelection = 5; + enum SearchScope { + WholeSolution, + CurrentProject, + AllOpenFiles, + Directories, + CurrentDocument, + Selection + }
+ + CheckButton checkbuttonRecursively;
+ ComboBoxEntry comboboxentryReplace; + ComboBoxEntry comboboxentryPath; + SearchEntry searchentryFileMask; + Button buttonBrowsePaths; + Button buttonReplace; + Label labelFileMask;
+ Label labelReplace; + Label labelPath; + HBox hboxPath; + + Properties properties = null; + bool replaceMode = false; + + static void SetButtonIcon (Button button, string stockIcon) + { + Alignment alignment = new Alignment (0.5f, 0.5f, 0f, 0f); + Label label = new Label (button.Label); + HBox hbox = new HBox (false, 2); + Image image = new Image (); + + image.Pixbuf = Stetic.IconLoader.LoadIcon (button, stockIcon, IconSize.Button); + image.Show (); + hbox.Add (image); + + label.Show (); + hbox.Add (label); + + hbox.Show (); + alignment.Add (hbox); + + button.Child.Destroy (); + + alignment.Show (); + button.Add (alignment); + } + + static Widget GetChildWidget (Container toplevel, Type type) + { + foreach (var child in ((Container) toplevel).Children) { + if (child.GetType () == type) + return child; + + if (child is Container) { + var w = GetChildWidget ((Container) child, type); + if (w != null) + return w; + } + } + + return null; + } + + static void OverrideStockLabel (Button button, string label) + { + var widget = GetChildWidget ((Container) button.Child, typeof (Label)); + if (widget != null) + ((Label) widget).LabelProp = label; + } - FindInFilesDialog (bool showReplace, string directory) : this(showReplace) + FindInFilesDialog (bool showReplace, string directory) : this (showReplace) { - comboboxScope.Active = ScopeDirectories; + comboboxScope.Active = (int) SearchScope.Directories; comboboxentryPath.Entry.Text = directory; writeScope = false; - }
-
- readonly ComboBoxEntry comboboxentryReplace;
- readonly Label labelReplace; + } FindInFilesDialog (bool showReplace) { - this.showReplace = showReplace; Build (); - Title = showReplace ? GettextCatalog.GetString ("Replace in Files") : GettextCatalog.GetString ("Find in Files"); - TransientFor = IdeApp.Workbench.RootWindow;
- if (!showReplace)
- buttonReplace.Destroy();
-
- if (showReplace) { - tableFindAndReplace.NRows = 4; - labelReplace = new Label {Text = GettextCatalog.GetString("_Replace:"), Xalign = 0f, UseUnderline = true};
- tableFindAndReplace.Add (labelReplace); - - comboboxentryReplace = new ComboBoxEntry (); - tableFindAndReplace.Add (comboboxentryReplace); - - var childLabel = (Table.TableChild)tableFindAndReplace[labelReplace]; - childLabel.TopAttach = 1; - childLabel.BottomAttach = 2; - childLabel.XOptions = childLabel.YOptions = (AttachOptions)4; - - var childCombo = (Table.TableChild)tableFindAndReplace[comboboxentryReplace]; - childCombo.TopAttach = 1; - childCombo.BottomAttach = 2; - childCombo.LeftAttach = 1; - childCombo.RightAttach = 2; - childCombo.XOptions = childCombo.YOptions = (AttachOptions)4; - - childLabel = (Table.TableChild)tableFindAndReplace[labelScope]; - childLabel.TopAttach = 2; - childLabel.BottomAttach = 3; - - childCombo = (Table.TableChild)tableFindAndReplace[hbox2]; - childCombo.TopAttach = 2; - childCombo.BottomAttach = 3; - - childCombo = (Table.TableChild)tableFindAndReplace[labelFileMask]; - childCombo.TopAttach = 3; - childCombo.BottomAttach = 4; - - childCombo = (Table.TableChild)tableFindAndReplace[searchentry1]; - childCombo.TopAttach = 3; - childCombo.BottomAttach = 4; - - Child.ShowAll (); - } - - comboboxentryFind.Entry.Activated += delegate { buttonSearch.Click (); }; + + properties = PropertyService.Get ("MonoDevelop.FindReplaceDialogs.SearchOptions", new Properties ()); + SetButtonIcon (toggleReplaceInFiles, "gtk-find-and-replace"); + SetButtonIcon (toggleFindInFiles, "gtk-find"); + + TransientFor = IdeApp.Workbench.RootWindow; - buttonReplace.Clicked += HandleReplaceClicked; + toggleReplaceInFiles.Active = showReplace; + toggleFindInFiles.Active = !showReplace; + + toggleFindInFiles.Toggled += delegate { + if (toggleFindInFiles.Active) { + Title = GettextCatalog.GetString ("Find in Files"); + HideReplaceUI (); + } + }; + + toggleReplaceInFiles.Toggled += delegate { + if (toggleReplaceInFiles.Active) { + Title = GettextCatalog.GetString ("Replace in Files"); + ShowReplaceUI (); + } + }; + buttonSearch.Clicked += HandleSearchClicked; buttonClose.Clicked += (sender, e) => Destroy (); DeleteEvent += (o, args) => Destroy (); + buttonSearch.GrabDefault (); + buttonStop.Clicked += ButtonStopClicked; var scopeStore = new ListStore (typeof(string)); scopeStore.AppendValues (GettextCatalog.GetString ("Whole solution")); @@ -120,12 +156,16 @@ namespace MonoDevelop.Ide.FindInFiles scopeStore.AppendValues (GettextCatalog.GetString ("Directories")); scopeStore.AppendValues (GettextCatalog.GetString ("Current document")); scopeStore.AppendValues (GettextCatalog.GetString ("Selection")); - comboboxScope.Model = scopeStore; comboboxScope.Changed += HandleScopeChanged; InitFromProperties (); + + if (showReplace) + toggleReplaceInFiles.Toggle (); + else + toggleFindInFiles.Toggle (); if (IdeApp.Workbench.ActiveDocument != null) { var view = IdeApp.Workbench.ActiveDocument.GetContent<ITextBuffer> (); @@ -135,149 +175,317 @@ namespace MonoDevelop.Ide.FindInFiles if (selectedText.Any (c => c == '\n' || c == '\r')) { // comboboxScope.Active = ScopeSelection; } else { - if (comboboxScope.Active == ScopeSelection) - comboboxScope.Active = ScopeCurrentDocument; + if (comboboxScope.Active == (int) SearchScope.Selection) + comboboxScope.Active = (int) SearchScope.CurrentDocument; comboboxentryFind.Entry.Text = selectedText; } - } else if (comboboxScope.Active == ScopeSelection) { - comboboxScope.Active = ScopeCurrentDocument; + } else if (comboboxScope.Active == (int) SearchScope.Selection) { + comboboxScope.Active = (int) SearchScope.CurrentDocument; } } } comboboxentryFind.Entry.SelectRegion (0, comboboxentryFind.ActiveText.Length); - + comboboxentryFind.GrabFocus (); DeleteEvent += delegate { Destroy (); }; UpdateStopButton (); - searchentry1.Ready = true; - searchentry1.Visible = true; - searchentry1.IsCheckMenu = true; - var properties = PropertyService.Get ("MonoDevelop.FindReplaceDialogs.SearchOptions", new Properties ()); + Child.Show (); + } + + static void TableAddRow (Table table, uint row, Widget column1, Widget column2) + { + uint rows = table.NRows; + Table.TableChild tr; + + table.NRows = rows + 1; + + foreach (var child in table.Children) { + tr = (Table.TableChild) table[child]; + uint bottom = tr.BottomAttach; + uint top = tr.TopAttach; + + if (top >= row && top < rows) { + tr.BottomAttach = bottom + 1; + tr.TopAttach = top + 1; + } + } + + if (column1 != null) { + table.Add (column1); + + tr = (Table.TableChild) table[column1]; + tr.XOptions = (AttachOptions) 4; + tr.YOptions = (AttachOptions) 4; + tr.BottomAttach = row + 1; + tr.TopAttach = row; + tr.LeftAttach = 0; + tr.RightAttach = 1; + } + + if (column2 != null) { + table.Add (column2); + + tr = (Table.TableChild) table[column2]; + tr.XOptions = (AttachOptions) 4; + tr.YOptions = (AttachOptions) 4; + tr.BottomAttach = row + 1; + tr.TopAttach = row; + tr.LeftAttach = 1; + tr.RightAttach = 2; + } + } + + static void TableRemoveRow (Table table, uint row, Widget column1, Widget column2, bool destroy) + { + uint rows = table.NRows; + + foreach (var child in table.Children) { + var tr = (Table.TableChild) table[child]; + uint bottom = tr.BottomAttach; + uint top = tr.TopAttach; + + if (top >= row && top < rows) { + tr.BottomAttach = bottom - 1; + tr.TopAttach = top - 1; + } + } + + if (column1 != null) { + table.Remove (column1); + if (destroy) + column1.Destroy (); + } + + if (column2 != null) { + table.Remove (column2); + if (destroy) + column2.Destroy (); + } - CheckMenuItem checkMenuItem = searchentry1.AddFilterOption (0, GettextCatalog.GetString ("Include binary files")); + table.NRows--; + } + + static uint TableGetRowForItem (Table table, Widget item) + { + var child = (Table.TableChild) table[item]; + return child.TopAttach; + } + + void ShowReplaceUI () + { + if (replaceMode) + return; + + labelReplace = new Label { Text = GettextCatalog.GetString ("_Replace:"), Xalign = 0f, UseUnderline = true }; + comboboxentryReplace = new ComboBoxEntry (); + LoadHistory ("MonoDevelop.FindReplaceDialogs.ReplaceHistory", comboboxentryReplace); + comboboxentryReplace.Show (); + labelReplace.Show (); + + TableAddRow (tableFindAndReplace, 1, labelReplace, comboboxentryReplace); + + buttonReplace = new Button () { + Label = "gtk-find-and-replace", + UseUnderline = true, + CanDefault = true, + UseStock = true, + }; + // Note: We override the stock label text instead of using SetButtonIcon() because the + // theme may override whether or not the icons are shown. Using SetButtonIcon() would + // break the theme by forcing icons even if the theme says "no". + OverrideStockLabel (buttonReplace, GettextCatalog.GetString ("R_eplace")); + buttonReplace.Clicked += HandleReplaceClicked; + buttonReplace.Show (); + + AddActionWidget (buttonReplace, 0); + buttonReplace.GrabDefault (); + + replaceMode = true; + + Requisition req = SizeRequest (); + Resize (req.Width, req.Height); + } + + void HideReplaceUI () + { + if (!replaceMode) + return; + + buttonReplace.Destroy (); + buttonReplace = null; + + buttonSearch.GrabDefault (); + + StoreHistory ("MonoDevelop.FindReplaceDialogs.ReplaceHistory", comboboxentryReplace); + TableRemoveRow (tableFindAndReplace, 1, labelReplace, comboboxentryReplace, true); + comboboxentryReplace = null; + labelReplace = null; + + replaceMode = false; + + Requisition req = SizeRequest (); + Resize (req.Width, req.Height); + } + + void ShowDirectoryPathUI () + { + if (labelPath != null) + return; + + // We want to add the Path combo box right below the Scope + uint row = TableGetRowForItem (tableFindAndReplace, labelScope) + 1; + + // DirectoryScope + labelPath = new Label { + LabelProp = GettextCatalog.GetString ("_Path:"), + UseUnderline = true, + Xalign = 0f + }; + labelPath.Show (); + + hboxPath = new HBox (); + comboboxentryPath = new ComboBoxEntry (); + comboboxentryPath.Destroyed += ComboboxentryPathDestroyed; + LoadHistory ("MonoDevelop.FindReplaceDialogs.PathHistory", comboboxentryPath); + comboboxentryPath.Show (); + hboxPath.PackStart (comboboxentryPath); + + labelPath.MnemonicWidget = comboboxentryPath; + + buttonBrowsePaths = new Button { Label = "..." }; + buttonBrowsePaths.Clicked += ButtonBrowsePathsClicked; + buttonBrowsePaths.Show (); + hboxPath.PackStart (buttonBrowsePaths, false, false, 0); + hboxPath.Show (); + + // Add the Directory Path row to the table + TableAddRow (tableFindAndReplace, row++, labelPath, hboxPath); + + // Add a checkbox for searching the directory recursively... + checkbuttonRecursively = new CheckButton { + Label = GettextCatalog.GetString ("Re_cursively"), + Active = properties.Get ("SearchPathRecursively", true), + UseUnderline = true + }; + + checkbuttonRecursively.Destroyed += CheckbuttonRecursivelyDestroyed; + checkbuttonRecursively.Show (); + + TableAddRow (tableFindAndReplace, row, null, checkbuttonRecursively); + } + + void HideDirectoryPathUI () + { + if (labelPath == null) + return; + + uint row = TableGetRowForItem (tableFindAndReplace, checkbuttonRecursively); + TableRemoveRow (tableFindAndReplace, row, null, checkbuttonRecursively, true); + checkbuttonRecursively = null; + + row = TableGetRowForItem (tableFindAndReplace, labelPath); + TableRemoveRow (tableFindAndReplace, row, labelPath, hboxPath, true); + // comboboxentryPath and buttonBrowsePaths are destroyed with hboxPath + buttonBrowsePaths = null; + comboboxentryPath = null; + labelPath = null; + hboxPath = null; + } + + void ShowFileMaskUI () + { + if (labelFileMask != null) + return; + + uint row; + + if (checkbuttonRecursively != null) + row = TableGetRowForItem (tableFindAndReplace, checkbuttonRecursively) + 1; + else + row = TableGetRowForItem (tableFindAndReplace, labelScope) + 1; + + labelFileMask = new Label { + LabelProp = GettextCatalog.GetString ("_File Mask:"), + UseUnderline = true, + Xalign = 0f + }; + labelFileMask.Show (); + + searchentryFileMask = new SearchEntry () { + ForceFilterButtonVisible = false, + IsCheckMenu = true, + ActiveFilterID = 0, + Visible = true, + Ready = true, + }; + + var checkMenuItem = searchentryFileMask.AddFilterOption (0, GettextCatalog.GetString ("Include binary files")); checkMenuItem.DrawAsRadio = false; checkMenuItem.Active = properties.Get ("IncludeBinaryFiles", false); checkMenuItem.Toggled += delegate { properties.Set ("IncludeBinaryFiles", checkMenuItem.Active); }; - CheckMenuItem checkMenuItem1 = searchentry1.AddFilterOption (1, GettextCatalog.GetString ("Include hidden files and directories")); + var checkMenuItem1 = searchentryFileMask.AddFilterOption (1, GettextCatalog.GetString ("Include hidden files and directories")); checkMenuItem1.DrawAsRadio = false; checkMenuItem1.Active = properties.Get ("IncludeHiddenFiles", false); checkMenuItem1.Toggled += delegate { properties.Set ("IncludeHiddenFiles", checkMenuItem1.Active); }; - Child.Show (); + searchentryFileMask.Query = properties.Get ("MonoDevelop.FindReplaceDialogs.FileMask", ""); + + searchentryFileMask.Show (); + + TableAddRow (tableFindAndReplace, row, labelFileMask, searchentryFileMask); } - - Label labelPath; - ComboBoxEntry comboboxentryPath; - HBox hboxPath; - Button buttonBrowsePaths; - CheckButton checkbuttonRecursively; - + + void HideFileMaskUI () + { + if (labelFileMask == null) + return; + + properties.Set ("MonoDevelop.FindReplaceDialogs.FileMask", searchentryFileMask.Query); + + uint row = TableGetRowForItem (tableFindAndReplace, labelFileMask); + TableRemoveRow (tableFindAndReplace, row, labelFileMask, searchentryFileMask, true); + searchentryFileMask = null; + labelFileMask = null; + } + void HandleScopeChanged (object sender, EventArgs e) { - if (hboxPath != null) { - // comboboxentryPath and buttonBrowsePaths are destroyed with hboxPath - foreach (Widget w in new Widget[] { - labelPath, - hboxPath, - checkbuttonRecursively - }) { - tableFindAndReplace.Remove (w); - w.Destroy (); - } - labelPath = null; - hboxPath = null; - comboboxentryPath = null; - buttonBrowsePaths = null; - checkbuttonRecursively = null; - - //tableFindAndReplace.NRows = showReplace ? 4u : 3u; - - var childCombo = (Table.TableChild)tableFindAndReplace[labelFileMask]; - childCombo.TopAttach = tableFindAndReplace.NRows - 3; - childCombo.BottomAttach = tableFindAndReplace.NRows - 2; - - childCombo = (Table.TableChild)tableFindAndReplace[searchentry1]; - childCombo.TopAttach = tableFindAndReplace.NRows - 3; - childCombo.BottomAttach = tableFindAndReplace.NRows - 2; - } - - if (comboboxScope.Active == ScopeDirectories) { - // DirectoryScope - tableFindAndReplace.NRows = showReplace ? 6u : 5u; - labelPath = new Label {
- LabelProp = GettextCatalog.GetString("_Path:"),
- UseUnderline = true,
- Xalign = 0f
- };
-
- tableFindAndReplace.Add (labelPath); - - var childCombo = (Table.TableChild)tableFindAndReplace[labelPath]; - childCombo.TopAttach = tableFindAndReplace.NRows - 3; - childCombo.BottomAttach = tableFindAndReplace.NRows - 2; - childCombo.XOptions = childCombo.YOptions = (AttachOptions)4; - - hboxPath = new HBox (); - var properties = PropertyService.Get ("MonoDevelop.FindReplaceDialogs.SearchOptions", new Properties ()); - comboboxentryPath = new ComboBoxEntry (); - comboboxentryPath.Destroyed += ComboboxentryPathDestroyed; - LoadHistory ("MonoDevelop.FindReplaceDialogs.PathHistory", comboboxentryPath); - hboxPath.PackStart (comboboxentryPath); - - labelPath.MnemonicWidget = comboboxentryPath; - - var boxChild = (Box.BoxChild)hboxPath[comboboxentryPath]; - boxChild.Position = 0; - boxChild.Expand = boxChild.Fill = true; - - buttonBrowsePaths = new Button { Label = "..." };
- buttonBrowsePaths.Clicked += ButtonBrowsePathsClicked; - hboxPath.PackStart (buttonBrowsePaths); - boxChild = (Box.BoxChild)hboxPath[buttonBrowsePaths]; - boxChild.Position = 1; - boxChild.Expand = boxChild.Fill = false; - - tableFindAndReplace.Add (hboxPath); - childCombo = (Table.TableChild)tableFindAndReplace[hboxPath]; - childCombo.TopAttach = tableFindAndReplace.NRows - 3; - childCombo.BottomAttach = tableFindAndReplace.NRows - 2; - childCombo.LeftAttach = 1; - childCombo.RightAttach = 2; - childCombo.XOptions = childCombo.YOptions = (AttachOptions)4; - - checkbuttonRecursively = new CheckButton {
- Label = GettextCatalog.GetString ("Re_cursively"),
- Active = properties.Get ("SearchPathRecursively", true),
- UseUnderline = true
- };
-
- checkbuttonRecursively.Destroyed += CheckbuttonRecursivelyDestroyed; - tableFindAndReplace.Add (checkbuttonRecursively); - childCombo = (Table.TableChild)tableFindAndReplace[checkbuttonRecursively]; - childCombo.TopAttach = tableFindAndReplace.NRows - 2; - childCombo.BottomAttach = tableFindAndReplace.NRows - 1; - childCombo.LeftAttach = 1; - childCombo.RightAttach = 2; - childCombo.XOptions = childCombo.YOptions = (AttachOptions)4; - - childCombo = (Table.TableChild)tableFindAndReplace[labelFileMask]; - childCombo.TopAttach = tableFindAndReplace.NRows - 1; - childCombo.BottomAttach = tableFindAndReplace.NRows; - - childCombo = (Table.TableChild)tableFindAndReplace[searchentry1]; - childCombo.TopAttach = tableFindAndReplace.NRows - 1; - childCombo.BottomAttach = tableFindAndReplace.NRows; + switch ((SearchScope) comboboxScope.Active) { + case SearchScope.WholeSolution: + HideDirectoryPathUI (); + ShowFileMaskUI (); + break; + case SearchScope.CurrentProject: + HideDirectoryPathUI (); + ShowFileMaskUI (); + break; + case SearchScope.AllOpenFiles: + HideDirectoryPathUI (); + ShowFileMaskUI (); + break; + case SearchScope.Directories: + ShowDirectoryPathUI (); + ShowFileMaskUI (); + break; + case SearchScope.CurrentDocument: + HideDirectoryPathUI (); + HideFileMaskUI (); + break; + case SearchScope.Selection: + HideDirectoryPathUI (); + HideFileMaskUI (); + break; } + Requisition req = SizeRequest (); Resize (req.Width, req.Height); - // this.QueueResize (); - ShowAll (); + //this.QueueResize (); } protected override void OnSizeRequested (ref Requisition requisition) @@ -307,28 +515,24 @@ namespace MonoDevelop.Ide.FindInFiles comboboxentryPath.Entry.Text = dlg.SelectedFile; }
- static void CheckbuttonRecursivelyDestroyed (object sender, EventArgs e) + void CheckbuttonRecursivelyDestroyed (object sender, EventArgs e) { - var properties = PropertyService.Get ("MonoDevelop.FindReplaceDialogs.SearchOptions", new Properties ()); properties.Set ("SearchPathRecursively", ((CheckButton)sender).Active); } const char historySeparator = '\n'; void InitFromProperties () { - var properties = PropertyService.Get ("MonoDevelop.FindReplaceDialogs.SearchOptions", new Properties ()); - comboboxScope.Active = properties.Get ("Scope", ScopeWholeSolution); + comboboxScope.Active = properties.Get ("Scope", (int) SearchScope.WholeSolution); //checkbuttonRecursively.Active = properties.Get ("SearchPathRecursively", true); - // checkbuttonFileMask.Active = properties.Get ("UseFileMask", false); + //checkbuttonFileMask.Active = properties.Get ("UseFileMask", false); checkbuttonCaseSensitive.Active = properties.Get ("CaseSensitive", false); checkbuttonWholeWordsOnly.Active = properties.Get ("WholeWordsOnly", false); checkbuttonRegexSearch.Active = properties.Get ("RegexSearch", false); LoadHistory ("MonoDevelop.FindReplaceDialogs.FindHistory", comboboxentryFind); - if (showReplace) - LoadHistory ("MonoDevelop.FindReplaceDialogs.ReplaceHistory", comboboxentryReplace); - searchentry1.Query = properties.Get ("MonoDevelop.FindReplaceDialogs.FileMask", ""); + // LoadHistory ("MonoDevelop.FindReplaceDialogs.PathHistory", comboboxentryPath); // LoadHistory ("MonoDevelop.FindReplaceDialogs.FileMaskHistory", comboboxentryFileMask); } @@ -355,7 +559,6 @@ namespace MonoDevelop.Ide.FindInFiles void StorePoperties () { - var properties = PropertyService.Get ("MonoDevelop.FindReplaceDialogs.SearchOptions", new Properties ()); if (writeScope) properties.Set ("Scope", comboboxScope.Active); // properties.Set ("SearchPathRecursively", checkbuttonRecursively.Active); @@ -365,9 +568,10 @@ namespace MonoDevelop.Ide.FindInFiles properties.Set ("RegexSearch", checkbuttonRegexSearch.Active); StoreHistory ("MonoDevelop.FindReplaceDialogs.FindHistory", comboboxentryFind); - if (showReplace) + if (replaceMode) StoreHistory ("MonoDevelop.FindReplaceDialogs.ReplaceHistory", comboboxentryReplace); - properties.Set ("MonoDevelop.FindReplaceDialogs.FileMask", searchentry1.Query); + if (searchentryFileMask != null) + properties.Set ("MonoDevelop.FindReplaceDialogs.FileMask", searchentryFileMask.Query); // StoreHistory ("MonoDevelop.FindReplaceDialogs.PathHistory", comboboxentryPath); //StoreHistory ("MonoDevelop.FindReplaceDialogs.FileMaskHistory", comboboxentryFileMask); } @@ -428,25 +632,23 @@ namespace MonoDevelop.Ide.FindInFiles Scope GetScope () { - - var properties = PropertyService.Get ("MonoDevelop.FindReplaceDialogs.SearchOptions", new Properties ()); Scope scope = null; - switch (comboboxScope.Active) { - case ScopeCurrentDocument: + switch ((SearchScope) comboboxScope.Active) { + case SearchScope.CurrentDocument: scope = new DocumentScope (); break; - case ScopeSelection: + case SearchScope.Selection: scope = new SelectionScope (); break; - case ScopeWholeSolution: + case SearchScope.WholeSolution: if (!IdeApp.Workspace.IsOpen) { MessageService.ShowError (GettextCatalog.GetString ("Currently there is no open solution.")); return null; } scope = new WholeSolutionScope (); break; - case ScopeCurrentProject: + case SearchScope.CurrentProject: var currentSelectedProject = IdeApp.ProjectOperations.CurrentSelectedProject; if (currentSelectedProject != null) {
scope = new WholeProjectScope (currentSelectedProject); @@ -464,10 +666,10 @@ namespace MonoDevelop.Ide.FindInFiles } MessageService.ShowError (GettextCatalog.GetString ("Currently there is no open solution.")); return null; - case ScopeAllOpenFiles: + case SearchScope.AllOpenFiles: scope = new AllOpenFilesScope (); break; - case ScopeDirectories: + case SearchScope.Directories: if (!System.IO.Directory.Exists (comboboxentryPath.Entry.Text)) { MessageService.ShowError (string.Format (GettextCatalog.GetString ("Directory not found: {0}"), comboboxentryPath.Entry.Text)); @@ -489,7 +691,7 @@ namespace MonoDevelop.Ide.FindInFiles FilterOptions GetFilterOptions () { return new FilterOptions { - FileMask = !string.IsNullOrEmpty (searchentry1.Query) ? searchentry1.Query : "*", + FileMask = searchentryFileMask != null && !string.IsNullOrEmpty (searchentryFileMask.Query) ? searchentryFileMask.Query : "*", CaseSensitive = checkbuttonCaseSensitive.Active, RegexSearch = checkbuttonRegexSearch.Active, WholeWordsOnly = checkbuttonWholeWordsOnly.Active diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeBuilder.cs index 16b91b950c..84a4cb1f0b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeBuilder.cs @@ -27,6 +27,9 @@ // using System; +using System.Text; +using System.Collections.Generic; + using MonoDevelop.Core; namespace MonoDevelop.Ide.Gui.Components @@ -145,5 +148,74 @@ namespace MonoDevelop.Ide.Gui.Components return (nodeAttr & attr) != 0; } + + + static Dictionary<char, string> MarkupSpecials; + + static NodeBuilder () + { + byte c; + + MarkupSpecials = new Dictionary<char, string> (); + MarkupSpecials.Add ('\'', "'"); + MarkupSpecials.Add ('"', """); + MarkupSpecials.Add ('&', "&"); + MarkupSpecials.Add ('<', "<"); + MarkupSpecials.Add ('>', ">"); + + // Escape control characters. + for (c = 0x1; c <= 0x8; c++) + MarkupSpecials.Add ((char) c, string.Format ("�x{0:x};", c)); + for (c = 0xb; c <= 0xc; c++) + MarkupSpecials.Add ((char) c, string.Format ("�x{0:x};", c)); + for (c = 0xe; c <= 0x1f; c++) + MarkupSpecials.Add ((char) c, string.Format ("�x{0:x};", c)); + for (c = 0x7f; c <= 0x84; c++) + MarkupSpecials.Add ((char) c, string.Format ("�x{0:x};", c)); + for (c = 0x86; c <= 0x9f; c++) + MarkupSpecials.Add ((char) c, string.Format ("�x{0:x};", c)); + } + + static int EscapedLength (string text, out int first) + { + int length = text.Length; + string escaped; + + first = -1; + + for (int i = 0; i < text.Length; i++) { + if (MarkupSpecials.TryGetValue (text[i], out escaped)) { + if (first == -1) + first = i; + + length += escaped.Length; + } + } + + return length; + } + + protected static string EscapeTextForMarkup (string text) + { + StringBuilder sb; + int length, i; + + if ((length = EscapedLength (text, out i)) == text.Length) + return text; + + sb = new StringBuilder (text, 0, i, length); + while (i < text.Length) { + string escaped; + + if (MarkupSpecials.TryGetValue (text[i], out escaped)) + sb.Append (escaped); + else + sb.Append (text[i]); + + i++; + } + + return sb.ToString (); + } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs index f7296152b0..0d27654db0 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs @@ -153,10 +153,12 @@ namespace MonoDevelop.Ide.Gui.Components } return ats; } + static int NullSortFunc (Gtk.TreeModel model, Gtk.TreeIter a, Gtk.TreeIter b) { return 0; } + public void AddChildren (IEnumerable dataObjects) { NodeBuilder[] chain = null; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs index 66562d6902..24a598d76b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs @@ -209,17 +209,36 @@ namespace MonoDevelop.Ide.Gui.Dialogs if (Filenames.Length == 0 || Filename.Length == 0 || System.IO.Directory.Exists (Filename)) return; + int selected = 0; + int i = 0; + if (IdeApp.Services.ProjectService.IsWorkspaceItemFile (Filename) || IdeApp.Services.ProjectService.IsSolutionItemFile (Filename)) { viewerSelector.AppendText (GettextCatalog.GetString ("Solution Workbench")); currentViewers.Add (null); + + if (closeWorkspaceCheck.Visible) + closeWorkspaceCheck.Active = true; + + i++; } + foreach (FileViewer vw in DisplayBindingService.GetFileViewers (Filename, null)) { if (!vw.IsExternal) { viewerSelector.AppendText (vw.Title); currentViewers.Add (vw); + + if (vw.CanUseAsDefault) { + if (closeWorkspaceCheck.Visible) + closeWorkspaceCheck.Active = false; + + selected = i; + } + + i++; } } - viewerSelector.Active = 0; + + viewerSelector.Active = selected; viewerLabel.Sensitive = viewerSelector.Sensitive = currentViewers.Count > 1; } @@ -236,7 +255,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs closeWorkspaceCheck.Visible = false; return; } - + if (IdeApp.Services.ProjectService.IsWorkspaceItemFile (Filename) || IdeApp.Services.ProjectService.IsSolutionItemFile (Filename)) { encodingLabel.Sensitive = encodingMenu.Sensitive = (SelectedViewer != null); closeWorkspaceCheck.Visible = viewerLabel.Visible && IdeApp.Workspace.IsOpen; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkErrorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkErrorDialog.cs index 8545cb1bd8..b6edd1e439 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkErrorDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkErrorDialog.cs @@ -51,8 +51,15 @@ namespace MonoDevelop.Ide.Gui.Dialogs detailsTextView.Buffer.TagTable.Add (tagWrap); expander.Visible = false; + + ActionArea.Homogeneous = true; + ActionArea.Remove (okButton); } + public AlertButton[] Buttons { + get; set; + } + public string Message { get { return descriptionLabel.Text; } set { @@ -63,7 +70,18 @@ namespace MonoDevelop.Ide.Gui.Dialogs descriptionLabel.Text = message; } } - + + protected override void OnRealized () + { + for (int i = 0; i < Buttons.Length; i++) { + Gtk.Button button; + button = new Gtk.Button (Buttons[i].Label); + button.ShowAll (); + AddActionWidget (button, i); + } + base.OnRealized (); + } + public void AddDetails (string text, bool wrapped) { TextIter it = detailsTextView.Buffer.EndIter; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs index 5706fd1979..cba2856f1b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs @@ -73,7 +73,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad { ProjectFile file = (ProjectFile) dataObject; - label = file.Link.IsNullOrEmpty ? file.FilePath.FileName : file.Link.FileName; + label = EscapeTextForMarkup (file.Link.IsNullOrEmpty ? file.FilePath.FileName : file.Link.FileName); if (!File.Exists (file.FilePath)) { label = "<span foreground='red'>" + label + "</span>"; } @@ -369,7 +369,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad if (action == "--") { info.AddSeparator (); } else { - CommandInfo ci = info.Add (BuildAction.Translate (action), action); + CommandInfo ci = info.Add (action, action); ci.Checked = toggledActions.Contains (action); if (ci.Checked) ci.CheckedInconsistent = toggledActions.Count > 1; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs index fe22add135..54697fc392 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs @@ -125,7 +125,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad ProjectFolder folder = (ProjectFolder) dataObject; - label = folder.Name; + label = EscapeTextForMarkup (folder.Name); icon = folderOpenIcon; closedIcon = folderClosedIcon; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs index d400ed7001..fb952fa75f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs @@ -113,19 +113,21 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad Project p = dataObject as Project; + string escapedProjectName = EscapeTextForMarkup (p.Name); string iconName; + if (p is DotNetProject && ((DotNetProject)p).LanguageBinding == null) { iconName = Gtk.Stock.DialogError; - label = GettextCatalog.GetString ("{0} <span foreground='red' size='small'>(Unknown language '{1}')</span>", p.Name, ((DotNetProject)p).LanguageName); + label = GettextCatalog.GetString ("{0} <span foreground='red' size='small'>(Unknown language '{1}')</span>", escapedProjectName, ((DotNetProject)p).LanguageName); } else if (p is UnknownProject) { iconName = Gtk.Stock.DialogError; - label = GettextCatalog.GetString ("{0} <span foreground='red' size='small'>(Unknown project type)</span>", p.Name); + label = GettextCatalog.GetString ("{0} <span foreground='red' size='small'>(Unknown project type)</span>", escapedProjectName); } else { iconName = p.StockIcon; if (p.ParentSolution != null && p.ParentSolution.SingleStartup && p.ParentSolution.StartupItem == p) - label = "<b>" + p.Name + "</b>"; + label = "<b>" + escapedProjectName + "</b>"; else - label = p.Name; + label = escapedProjectName; } icon = Context.GetIcon (iconName); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs index cb6e3d25bd..e708277929 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs @@ -73,7 +73,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon) { - label = GettextCatalog.GetString ("References"); + label = EscapeTextForMarkup (GettextCatalog.GetString ("References")); icon = Context.GetIcon (Stock.OpenReferenceFolder); closedIcon = Context.GetIcon (Stock.ClosedReferenceFolder); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs index 5c825ca0a8..0829cf52c9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs @@ -77,6 +77,8 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad icon = Context.GetIcon (Stock.Reference); break; } + + label = EscapeTextForMarkup (label); if (!pref.IsValid) { label = "<span color='red'>" + label + "</span>"; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs index 46108ab3cf..271f2ac781 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs @@ -78,7 +78,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon) { SolutionFolder combine = dataObject as SolutionFolder; - label = combine.Name; + label = EscapeTextForMarkup (combine.Name); icon = Context.GetIcon (Stock.SolutionFolderOpen); closedIcon = Context.GetIcon (Stock.SolutionFolderClosed); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs index c8e9511efd..f935786e63 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs @@ -92,7 +92,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon) { Solution solution = dataObject as Solution; - label = GettextCatalog.GetString ("Solution {0}", solution.Name); + label = EscapeTextForMarkup (GettextCatalog.GetString ("Solution {0}", solution.Name)); icon = Context.GetIcon (Stock.Solution); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs index eda6dda4be..da8c253351 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs @@ -65,7 +65,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon) { SystemFile file = (SystemFile) dataObject; - label = file.Name; + label = EscapeTextForMarkup (file.Name); icon = DesktopService.GetPixbufForFile (file.Path, Gtk.IconSize.Menu); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs index bf6bebe050..fe4d794750 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs @@ -53,7 +53,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad if (entry.LoadError.Length > 0) { icon = Context.GetIcon (Gtk.Stock.DialogError); - label = GettextCatalog.GetString ("{0} <span foreground='red' size='small'>(Load failed)</span>", entry.Name); + label = GettextCatalog.GetString ("{0} <span foreground='red' size='small'>(Load failed)</span>", EscapeTextForMarkup (entry.Name)); } else { icon = Context.GetIcon (MonoDevelop.Ide.Gui.Stock.Project); Gdk.Pixbuf gicon = Context.GetComposedIcon (icon, "fade"); @@ -62,7 +62,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad Context.CacheComposedIcon (icon, "fade", gicon); } icon = gicon; - label = entry.Name; + label = EscapeTextForMarkup (entry.Name); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectDialog.cs index bca050dd11..e6c7c7152d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectDialog.cs @@ -87,7 +87,7 @@ namespace MonoDevelop.Ide.Projects { this.openSolution = openCombine; TransientFor = IdeApp.Workbench.RootWindow; Title = newSolution ? GettextCatalog.GetString ("New Solution") : GettextCatalog.GetString ("New Project"); - + InitializeTemplates (); if (!newSolution) { @@ -303,8 +303,8 @@ namespace MonoDevelop.Ide.Projects { { if (!btn_new.Sensitive) return; + if (notebook.Page == 0) { - if (!CreateProject ()) return; @@ -489,6 +489,8 @@ namespace MonoDevelop.Ide.Projects { } PathChanged (null, null); + + btn_new.GrabDefault (); } catch (Exception ex) { txt_name.Sensitive = false; btn_new.Sensitive = false; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs index 2a00bf821d..3f2a95fa05 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs @@ -266,8 +266,11 @@ namespace MonoDevelop.Ide.Templates string mime = DesktopService.GetMimeTypeForUri (fileName); CodeFormatter formatter = !string.IsNullOrEmpty (mime) ? CodeFormatterService.GetFormatter (mime) : null; - if (formatter != null) - content = formatter.FormatText (policyParent != null ? policyParent.Policies : null, content); + if (formatter != null) { + var formatted = formatter.FormatText (policyParent != null ? policyParent.Policies : null, content); + if (formatted != null) + content = formatted; + } MemoryStream ms = new MemoryStream (); byte[] data; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs index 5bb89973eb..f6d54c0421 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs @@ -466,29 +466,11 @@ namespace MonoDevelop.Ide void HandleException (Exception ex, bool willShutdown) { - var original = LogReportingService.ReportCrashes; + // Log the crash to the MonoDevelop.log file first: + LoggingService.LogError (string.Format ("An unhandled exception has occured. Terminating MonoDevelop? {0}", willShutdown), ex); - // Attempt to log the crash. If the user hasn't opted in, they will get prompted now to opt in/out. - LogReportingService.ReportUnhandledException (ex); - - // If the user has just been prompted to enable crash reporting there is no need to display the - // normal crash dialog this time round unless we are about to shut down. - if (!original.HasValue && !willShutdown) - return; - - - string message; - string title = GettextCatalog.GetString ("An unhandled exception has occurred."); - var report = LogReportingService.ReportCrashes; - if (report.HasValue && report.Value) { - message = GettextCatalog.GetString ("Details of this crash have been automatically submitted for analysis."); - } else { - message = GettextCatalog.GetString ("Details of this crash have not been submitted as error reporting is disabled."); - } - - if (willShutdown) - message += GettextCatalog.GetString (" MonoDevelop will now close."); - MessageService.ShowException (ex, message, title); + // Pass it off to the reporting service now. + LogReportingService.ReportUnhandledException (ex, willShutdown); } /// <summary>SDBM-style hash, bounded to a range of 1000.</summary> diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/LogReportingStartup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/LogReportingStartup.cs index 807eb9b758..412617f48e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/LogReportingStartup.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/LogReportingStartup.cs @@ -39,33 +39,48 @@ namespace MonoDevelop.Ide { protected override void Run () { -// var pid = Process.GetCurrentProcess ().Id; -// var directory = new DirectoryInfo (LogReportingService.CrashLogDirectory); -// -// if (Platform.IsMac) { -// var crashmonitor = Path.Combine (PropertyService.EntryAssemblyPath, "MonoDevelopLogAgent.app"); -// Process.Start (new ProcessStartInfo ("open", string.Format ("-a {0} -n --args -pid {1} -log {2} -session {3}", crashmonitor, pid, directory.FullName, SystemInformation.SessionUuid)) { -// UseShellExecute = false, -// }); -// } - - LogReportingService.ShouldEnableReporting = () => { - var title = GettextCatalog.GetString ("A crash has just occurred"); - var part1 = GettextCatalog.GetString ("Details of this crash, along with anonymous installation " + - "information, can be uploaded to Xamarin to help diagnose the issue. " + - "Do you wish to automatically upload this information for this and future crashes?"); - var part2 = GettextCatalog.GetString ("This setting can be changed in the 'Log Agent' section of the MonoDevelop preferences."); - - var result = MessageService.AskQuestion ( - title, - string.Format ("{0}{1}{1}{2}", part1, Environment.NewLine, part2), - AlertButton.No, AlertButton.Yes); - - return result == AlertButton.Yes; - }; // Process cached crash reports if there are any and uploading is enabled LogReportingService.ProcessCache (); + + // Attach a handler for when exceptions need to be processed + LogReportingService.UnhandledErrorOccured = (enabled, ex, willShutdown) => { + AlertButton[] buttons = null; + string message = null; + string title = GettextCatalog.GetString ("An error has occurred"); + + if (enabled.HasValue) { + if (enabled.Value) { + message = GettextCatalog.GetString ("Details of this error have been automatically submitted for analysis."); + } else { + message = GettextCatalog.GetString ("Details of this error have not been submitted as error reporting is disabled."); + } + if (willShutdown) + message += GettextCatalog.GetString (" MonoDevelop will now close."); + + buttons = new [] { AlertButton.Ok }; + } else { + var part1 = GettextCatalog.GetString ("Details of this error, along with anonymous installation " + + "information, can be uploaded to Xamarin to help diagnose the issue. " + + "Do you wish to automatically upload this information for this and future crashes?"); + var part2 = GettextCatalog.GetString ("This setting can be changed in the 'Log Agent' section of the MonoDevelop preferences."); + message = string.Format ("{0}{1}{1}{2}", part1, Environment.NewLine, part2); + buttons = new [] { AlertButton.Never, AlertButton.ThisTimeOnly, AlertButton.Always }; + } + + var result = MessageService.ShowException (ex, message, title, buttons); + if (enabled.HasValue) { + // In this case we will not change the value + return enabled; + } else if (result == AlertButton.Always) { + return true; + } else if (result == AlertButton.Never) { + return false; + } else { + // The user has decided to submit this one only + return null; + } + }; } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs index 15fffd9dfd..55d9279023 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs @@ -39,8 +39,10 @@ namespace MonoDevelop.Ide { public class AlertButton { + public static AlertButton Always = new AlertButton (GettextCatalog.GetString ("_Always")); public static AlertButton Ok = new AlertButton (Gtk.Stock.Ok, true); public static AlertButton Yes = new AlertButton (Gtk.Stock.Yes, true); + public static AlertButton Never = new AlertButton (GettextCatalog.GetString ("_Never")); public static AlertButton No = new AlertButton (Gtk.Stock.No, true); public static AlertButton Close = new AlertButton (Gtk.Stock.Close, true); public static AlertButton Cancel = new AlertButton (Gtk.Stock.Cancel, true); @@ -59,6 +61,7 @@ namespace MonoDevelop.Ide public static AlertButton Stop = new AlertButton (Gtk.Stock.Stop, true); public static AlertButton Proceed = new AlertButton (GettextCatalog.GetString ("_Proceed")); public static AlertButton Replace = new AlertButton (GettextCatalog.GetString ("_Replace")); + public static AlertButton ThisTimeOnly = new AlertButton (GettextCatalog.GetString ("_This time only")); public static AlertButton OverwriteFile = new AlertButton (GettextCatalog.GetString ("_Overwrite file")); @@ -154,6 +157,11 @@ namespace MonoDevelop.Ide ShowException (RootWindow, e, message, title); } + public static AlertButton ShowException (Exception e, string message, string title, params AlertButton[] buttons) + { + return ShowException (RootWindow, e, message, title, buttons); + } + public static void ShowException (Gtk.Window parent, Exception e) { ShowException (RootWindow, e, e.Message); @@ -161,12 +169,17 @@ namespace MonoDevelop.Ide public static void ShowException (Gtk.Window parent, Exception e, string message) { - ShowException (parent, e, message, "An unhandled exception occured"); + ShowException (parent, e, message, "An unexpected error occured"); } public static void ShowException (Gtk.Window parent, Exception e, string message, string title) { - messageService.ShowException (parent, title, message, e); + ShowException (parent, e, message, title, null); + } + + public static AlertButton ShowException (Gtk.Window parent, Exception e, string message, string title, params AlertButton[] buttons) + { + return messageService.ShowException (parent, title, message, e, buttons); } #endregion @@ -421,15 +434,17 @@ namespace MonoDevelop.Ide //The real GTK# code is wrapped in a GuiSyncObject to make calls synchronous on the GUI thread private class InternalMessageService : GuiSyncObject { - public void ShowException (Gtk.Window parent, string title, string message, Exception e) + public AlertButton ShowException (Gtk.Window parent, string title, string message, Exception e, params AlertButton[] buttons) { var exceptionDialog = new ExceptionDialog () { + Buttons = buttons, Title = title, Message = message, Exception = e, TransientFor = parent, }; exceptionDialog.Run (); + return exceptionDialog.ResultButton; } public AlertButton GenericAlert (MessageDescription message) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs index 2b44fa430e..e7b0c658cf 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs @@ -882,6 +882,7 @@ namespace MonoDevelop.Ide entry.Execute (monitor, context, IdeApp.Workspace.ActiveConfiguration); } catch (Exception ex) { monitor.ReportError (GettextCatalog.GetString ("Execution failed."), ex); + LoggingService.LogError ("Execution failed", ex); } finally { monitor.Dispose (); } @@ -1394,7 +1395,7 @@ namespace MonoDevelop.Ide string fileBuildAction = buildAction; if (string.IsNullOrEmpty (buildAction)) - fileBuildAction = project.GetDefaultBuildAction (file); + fileBuildAction = project.GetDefaultBuildAction (targetPath); //files in the target directory get added directly in their current location without moving/copying if (file.CanonicalPath == targetPath) { @@ -1438,16 +1439,7 @@ namespace MonoDevelop.Ide } if (action == AddAction.Link) { - //FIXME: MD project system doesn't cope with duplicate includes - project save/load will remove the file - ProjectFile pf; - if (filesInProject.TryGetValue (file, out pf)) { - var link = pf.Link; - MessageService.ShowWarning (GettextCatalog.GetString ( - "The link '{0}' in the project already includes the file '{1}'", link, file)); - continue; - } - - pf = new ProjectFile (file, fileBuildAction) { + ProjectFile pf = new ProjectFile (file, fileBuildAction) { Link = vpath }; vpathsInProject.Add (pf.ProjectVirtualPath); @@ -1879,9 +1871,14 @@ namespace MonoDevelop.Ide class ProviderProxy : ITextEditorDataProvider, IEditableTextFile { TextEditorData data; - public ProviderProxy (TextEditorData data) + string encoding; + bool bom; + + public ProviderProxy (TextEditorData data, string encoding, bool bom) { this.data = data; + this.encoding = encoding; + this.bom = bom; } public TextEditorData GetTextEditorData () @@ -1889,6 +1886,11 @@ namespace MonoDevelop.Ide return data; } + void Save () + { + TextFile.WriteFile (Name, Text, encoding, bom); + } + #region IEditableTextFile implementation public FilePath Name { get { return data.Document.FileName; } } @@ -1898,6 +1900,7 @@ namespace MonoDevelop.Ide { return data.GetTextBetween (startPosition, endPosition); } + public char GetCharAt (int position) { return data.GetCharAt (position); @@ -1918,15 +1921,15 @@ namespace MonoDevelop.Ide public int InsertText (int position, string text) { int result = data.Insert (position, text); - File.WriteAllText (Name, Text); + Save (); + return result; } - public void DeleteText (int position, int length) { data.Remove (position, length); - File.WriteAllText (Name, Text); + Save (); } public string Text { @@ -1935,6 +1938,7 @@ namespace MonoDevelop.Ide } set { data.Text = value; + Save (); } } @@ -1951,10 +1955,12 @@ namespace MonoDevelop.Ide } } + TextFile file = TextFile.ReadFile (filePath); TextEditorData data = new TextEditorData (); data.Document.FileName = filePath; - data.Text = File.ReadAllText (filePath); - return new ProviderProxy (data); + data.Text = file.Text; + + return new ProviderProxy (data, file.SourceEncoding, file.HadBOM); } public TextEditorData GetTextEditorData (FilePath filePath) @@ -1972,9 +1978,10 @@ namespace MonoDevelop.Ide } } + TextFile file = TextFile.ReadFile (filePath); TextEditorData data = new TextEditorData (); data.Document.FileName = filePath; - data.Text = File.ReadAllText (filePath); + data.Text = file.Text; isOpen = false; return data; } diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs index eb71ba9369..fbe36dd14c 100644 --- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs +++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs @@ -5,22 +5,23 @@ namespace MonoDevelop.Ide.FindInFiles public partial class FindInFilesDialog { private global::Gtk.VBox vbox2; + private global::Gtk.HBox hbox3; + private global::Gtk.RadioButton toggleFindInFiles; + private global::Gtk.VSeparator vseparator1; + private global::Gtk.RadioButton toggleReplaceInFiles; private global::Gtk.HBox hbox1; private global::Gtk.Table tableFindAndReplace; private global::Gtk.ComboBoxEntry comboboxentryFind; private global::Gtk.HBox hbox2; private global::Gtk.ComboBox comboboxScope; - private global::Gtk.Label labelFileMask; private global::Gtk.Label labelFind; private global::Gtk.Label labelScope; - private global::MonoDevelop.Components.SearchEntry searchentry1; private global::Gtk.Table table1; private global::Gtk.CheckButton checkbuttonCaseSensitive; private global::Gtk.CheckButton checkbuttonRegexSearch; private global::Gtk.CheckButton checkbuttonWholeWordsOnly; private global::Gtk.Button buttonStop; private global::Gtk.Button buttonClose; - private global::Gtk.Button buttonReplace; private global::Gtk.Button buttonSearch; protected virtual void Build () @@ -45,11 +46,54 @@ namespace MonoDevelop.Ide.FindInFiles this.vbox2.Spacing = 6; this.vbox2.BorderWidth = ((uint)(6)); // Container child vbox2.Gtk.Box+BoxChild + this.hbox3 = new global::Gtk.HBox (); + this.hbox3.Name = "hbox3"; + this.hbox3.Spacing = 6; + // Container child hbox3.Gtk.Box+BoxChild + this.toggleFindInFiles = new global::Gtk.RadioButton (global::MonoDevelop.Core.GettextCatalog.GetString ("Find in Files")); + this.toggleFindInFiles.TooltipMarkup = "Switch to Find in Files"; + this.toggleFindInFiles.CanFocus = true; + this.toggleFindInFiles.Name = "toggleFindInFiles"; + this.toggleFindInFiles.DrawIndicator = false; + this.toggleFindInFiles.UseUnderline = true; + this.toggleFindInFiles.Relief = ((global::Gtk.ReliefStyle)(2)); + this.toggleFindInFiles.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.hbox3.Add (this.toggleFindInFiles); + global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.toggleFindInFiles])); + w2.Position = 0; + w2.Expand = false; + // Container child hbox3.Gtk.Box+BoxChild + this.vseparator1 = new global::Gtk.VSeparator (); + this.vseparator1.Name = "vseparator1"; + this.hbox3.Add (this.vseparator1); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.vseparator1])); + w3.Position = 1; + w3.Expand = false; + w3.Fill = false; + // Container child hbox3.Gtk.Box+BoxChild + this.toggleReplaceInFiles = new global::Gtk.RadioButton (global::MonoDevelop.Core.GettextCatalog.GetString ("Replace in Files")); + this.toggleReplaceInFiles.TooltipMarkup = "Switch to Replace in Files"; + this.toggleReplaceInFiles.CanFocus = true; + this.toggleReplaceInFiles.Name = "toggleReplaceInFiles"; + this.toggleReplaceInFiles.DrawIndicator = false; + this.toggleReplaceInFiles.UseUnderline = true; + this.toggleReplaceInFiles.Relief = ((global::Gtk.ReliefStyle)(2)); + this.toggleReplaceInFiles.Group = this.toggleFindInFiles.Group; + this.hbox3.Add (this.toggleReplaceInFiles); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.toggleReplaceInFiles])); + w4.Position = 2; + w4.Expand = false; + this.vbox2.Add (this.hbox3); + global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox3])); + w5.Position = 0; + w5.Expand = false; + w5.Fill = false; + // Container child vbox2.Gtk.Box+BoxChild this.hbox1 = new global::Gtk.HBox (); this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild - this.tableFindAndReplace = new global::Gtk.Table (((uint)(3)), ((uint)(2)), false); + this.tableFindAndReplace = new global::Gtk.Table (((uint)(2)), ((uint)(2)), false); this.tableFindAndReplace.Name = "tableFindAndReplace"; this.tableFindAndReplace.RowSpacing = ((uint)(6)); this.tableFindAndReplace.ColumnSpacing = ((uint)(6)); @@ -57,10 +101,10 @@ namespace MonoDevelop.Ide.FindInFiles this.comboboxentryFind = global::Gtk.ComboBoxEntry.NewText (); this.comboboxentryFind.Name = "comboboxentryFind"; this.tableFindAndReplace.Add (this.comboboxentryFind); - global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.tableFindAndReplace [this.comboboxentryFind])); - w2.LeftAttach = ((uint)(1)); - w2.RightAttach = ((uint)(2)); - w2.YOptions = ((global::Gtk.AttachOptions)(4)); + global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.tableFindAndReplace [this.comboboxentryFind])); + w6.LeftAttach = ((uint)(1)); + w6.RightAttach = ((uint)(2)); + w6.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child tableFindAndReplace.Gtk.Table+TableChild this.hbox2 = new global::Gtk.HBox (); this.hbox2.Name = "hbox2"; @@ -69,30 +113,18 @@ namespace MonoDevelop.Ide.FindInFiles this.comboboxScope = global::Gtk.ComboBox.NewText (); this.comboboxScope.Name = "comboboxScope"; this.hbox2.Add (this.comboboxScope); - global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.comboboxScope])); - w3.Position = 0; - w3.Expand = false; - w3.Fill = false; + global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.comboboxScope])); + w7.Position = 0; + w7.Expand = false; + w7.Fill = false; this.tableFindAndReplace.Add (this.hbox2); - global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.tableFindAndReplace [this.hbox2])); - w4.TopAttach = ((uint)(1)); - w4.BottomAttach = ((uint)(2)); - w4.LeftAttach = ((uint)(1)); - w4.RightAttach = ((uint)(2)); - w4.XOptions = ((global::Gtk.AttachOptions)(4)); - w4.YOptions = ((global::Gtk.AttachOptions)(4)); - // Container child tableFindAndReplace.Gtk.Table+TableChild - this.labelFileMask = new global::Gtk.Label (); - this.labelFileMask.Name = "labelFileMask"; - this.labelFileMask.Xalign = 0F; - this.labelFileMask.LabelProp = global::MonoDevelop.Core.GettextCatalog.GetString ("_File Mask:"); - this.labelFileMask.UseUnderline = true; - this.tableFindAndReplace.Add (this.labelFileMask); - global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.tableFindAndReplace [this.labelFileMask])); - w5.TopAttach = ((uint)(2)); - w5.BottomAttach = ((uint)(3)); - w5.XOptions = ((global::Gtk.AttachOptions)(4)); - w5.YOptions = ((global::Gtk.AttachOptions)(4)); + global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.tableFindAndReplace [this.hbox2])); + w8.TopAttach = ((uint)(1)); + w8.BottomAttach = ((uint)(2)); + w8.LeftAttach = ((uint)(1)); + w8.RightAttach = ((uint)(2)); + w8.XOptions = ((global::Gtk.AttachOptions)(4)); + w8.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child tableFindAndReplace.Gtk.Table+TableChild this.labelFind = new global::Gtk.Label (); this.labelFind.Name = "labelFind"; @@ -100,45 +132,29 @@ namespace MonoDevelop.Ide.FindInFiles this.labelFind.LabelProp = global::MonoDevelop.Core.GettextCatalog.GetString ("_Find:"); this.labelFind.UseUnderline = true; this.tableFindAndReplace.Add (this.labelFind); - global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.tableFindAndReplace [this.labelFind])); - w6.XOptions = ((global::Gtk.AttachOptions)(4)); - w6.YOptions = ((global::Gtk.AttachOptions)(4)); + global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.tableFindAndReplace [this.labelFind])); + w9.XOptions = ((global::Gtk.AttachOptions)(4)); + w9.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child tableFindAndReplace.Gtk.Table+TableChild this.labelScope = new global::Gtk.Label (); this.labelScope.Name = "labelScope"; this.labelScope.Xalign = 0F; - this.labelScope.LabelProp = global::MonoDevelop.Core.GettextCatalog.GetString ("_Scope:"); + this.labelScope.LabelProp = global::MonoDevelop.Core.GettextCatalog.GetString ("_Look in:"); this.labelScope.UseUnderline = true; this.tableFindAndReplace.Add (this.labelScope); - global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.tableFindAndReplace [this.labelScope])); - w7.TopAttach = ((uint)(1)); - w7.BottomAttach = ((uint)(2)); - w7.XOptions = ((global::Gtk.AttachOptions)(4)); - w7.YOptions = ((global::Gtk.AttachOptions)(4)); - // Container child tableFindAndReplace.Gtk.Table+TableChild - this.searchentry1 = new global::MonoDevelop.Components.SearchEntry (); - this.searchentry1.Name = "searchentry1"; - this.searchentry1.ForceFilterButtonVisible = false; - this.searchentry1.IsCheckMenu = false; - this.searchentry1.ActiveFilterID = 0; - this.searchentry1.Ready = false; - this.searchentry1.HasFocus = false; - this.tableFindAndReplace.Add (this.searchentry1); - global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.tableFindAndReplace [this.searchentry1])); - w8.TopAttach = ((uint)(2)); - w8.BottomAttach = ((uint)(3)); - w8.LeftAttach = ((uint)(1)); - w8.RightAttach = ((uint)(2)); - w8.XOptions = ((global::Gtk.AttachOptions)(4)); - w8.YOptions = ((global::Gtk.AttachOptions)(4)); + global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.tableFindAndReplace [this.labelScope])); + w10.TopAttach = ((uint)(1)); + w10.BottomAttach = ((uint)(2)); + w10.XOptions = ((global::Gtk.AttachOptions)(4)); + w10.YOptions = ((global::Gtk.AttachOptions)(4)); this.hbox1.Add (this.tableFindAndReplace); - global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.tableFindAndReplace])); - w9.Position = 0; + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.tableFindAndReplace])); + w11.Position = 0; this.vbox2.Add (this.hbox1); - global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); - w10.Position = 0; - w10.Expand = false; - w10.Fill = false; + global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); + w12.Position = 1; + w12.Expand = false; + w12.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.table1 = new global::Gtk.Table (((uint)(3)), ((uint)(2)), false); this.table1.Name = "table1"; @@ -152,8 +168,8 @@ namespace MonoDevelop.Ide.FindInFiles this.checkbuttonCaseSensitive.DrawIndicator = true; this.checkbuttonCaseSensitive.UseUnderline = true; this.table1.Add (this.checkbuttonCaseSensitive); - global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1 [this.checkbuttonCaseSensitive])); - w11.YOptions = ((global::Gtk.AttachOptions)(4)); + global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1 [this.checkbuttonCaseSensitive])); + w13.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.checkbuttonRegexSearch = new global::Gtk.CheckButton (); this.checkbuttonRegexSearch.CanFocus = true; @@ -162,10 +178,10 @@ namespace MonoDevelop.Ide.FindInFiles this.checkbuttonRegexSearch.DrawIndicator = true; this.checkbuttonRegexSearch.UseUnderline = true; this.table1.Add (this.checkbuttonRegexSearch); - global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1 [this.checkbuttonRegexSearch])); - w12.TopAttach = ((uint)(2)); - w12.BottomAttach = ((uint)(3)); - w12.YOptions = ((global::Gtk.AttachOptions)(4)); + global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1 [this.checkbuttonRegexSearch])); + w14.TopAttach = ((uint)(2)); + w14.BottomAttach = ((uint)(3)); + w14.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.checkbuttonWholeWordsOnly = new global::Gtk.CheckButton (); this.checkbuttonWholeWordsOnly.CanFocus = true; @@ -174,26 +190,26 @@ namespace MonoDevelop.Ide.FindInFiles this.checkbuttonWholeWordsOnly.DrawIndicator = true; this.checkbuttonWholeWordsOnly.UseUnderline = true; this.table1.Add (this.checkbuttonWholeWordsOnly); - global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1 [this.checkbuttonWholeWordsOnly])); - w13.TopAttach = ((uint)(1)); - w13.BottomAttach = ((uint)(2)); - w13.YOptions = ((global::Gtk.AttachOptions)(4)); + global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table1 [this.checkbuttonWholeWordsOnly])); + w15.TopAttach = ((uint)(1)); + w15.BottomAttach = ((uint)(2)); + w15.YOptions = ((global::Gtk.AttachOptions)(4)); this.vbox2.Add (this.table1); - global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.table1])); - w14.Position = 1; - w14.Expand = false; - w14.Fill = false; + global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.table1])); + w16.Position = 2; + w16.Expand = false; + w16.Fill = false; w1.Add (this.vbox2); - global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - w15.Position = 0; - w15.Expand = false; - w15.Fill = false; + global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + w17.Position = 0; + w17.Expand = false; + w17.Fill = false; // Internal child MonoDevelop.Ide.FindInFiles.FindInFilesDialog.ActionArea - global::Gtk.HButtonBox w16 = this.ActionArea; - w16.Name = "dialog1_ActionArea"; - w16.Spacing = 6; - w16.BorderWidth = ((uint)(5)); - w16.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w18 = this.ActionArea; + w18.Name = "dialog1_ActionArea"; + w18.Spacing = 6; + w18.BorderWidth = ((uint)(5)); + w18.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonStop = new global::Gtk.Button (); this.buttonStop.CanFocus = true; @@ -202,9 +218,9 @@ namespace MonoDevelop.Ide.FindInFiles this.buttonStop.UseUnderline = true; this.buttonStop.Label = "gtk-stop"; this.AddActionWidget (this.buttonStop, 0); - global::Gtk.ButtonBox.ButtonBoxChild w17 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w16 [this.buttonStop])); - w17.Expand = false; - w17.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w19 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w18 [this.buttonStop])); + w19.Expand = false; + w19.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonClose = new global::Gtk.Button (); this.buttonClose.CanDefault = true; @@ -214,36 +230,10 @@ namespace MonoDevelop.Ide.FindInFiles this.buttonClose.UseUnderline = true; this.buttonClose.Label = "gtk-close"; this.AddActionWidget (this.buttonClose, -7); - global::Gtk.ButtonBox.ButtonBoxChild w18 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w16 [this.buttonClose])); - w18.Position = 1; - w18.Expand = false; - w18.Fill = false; - // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.buttonReplace = new global::Gtk.Button (); - this.buttonReplace.CanFocus = true; - this.buttonReplace.Name = "buttonReplace"; - this.buttonReplace.UseUnderline = true; - // Container child buttonReplace.Gtk.Container+ContainerChild - global::Gtk.Alignment w19 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w20 = new global::Gtk.HBox (); - w20.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w21 = new global::Gtk.Image (); - w21.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-find-and-replace", global::Gtk.IconSize.Menu); - w20.Add (w21); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w23 = new global::Gtk.Label (); - w23.LabelProp = global::MonoDevelop.Core.GettextCatalog.GetString ("R_eplace"); - w23.UseUnderline = true; - w20.Add (w23); - w19.Add (w20); - this.buttonReplace.Add (w19); - this.AddActionWidget (this.buttonReplace, 0); - global::Gtk.ButtonBox.ButtonBoxChild w27 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w16 [this.buttonReplace])); - w27.Position = 2; - w27.Expand = false; - w27.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w20 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w18 [this.buttonClose])); + w20.Position = 1; + w20.Expand = false; + w20.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonSearch = new global::Gtk.Button (); this.buttonSearch.CanDefault = true; @@ -253,15 +243,15 @@ namespace MonoDevelop.Ide.FindInFiles this.buttonSearch.UseUnderline = true; this.buttonSearch.Label = "gtk-find"; this.AddActionWidget (this.buttonSearch, 0); - global::Gtk.ButtonBox.ButtonBoxChild w28 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w16 [this.buttonSearch])); - w28.Position = 3; - w28.Expand = false; - w28.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w21 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w18 [this.buttonSearch])); + w21.Position = 2; + w21.Expand = false; + w21.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } this.DefaultWidth = 456; - this.DefaultHeight = 289; + this.DefaultHeight = 348; this.labelFind.MnemonicWidget = this.comboboxentryFind; this.labelScope.MnemonicWidget = this.comboboxScope; this.Hide (); diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs index 5bc366d997..890fbc07a9 100644 --- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs +++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs @@ -100,6 +100,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs w7.Fill = false; // Container child hbox5.Gtk.Box+BoxChild this.hbuttonbox1 = new global::Gtk.HButtonBox (); + this.hbuttonbox1.Name = "hbuttonbox1"; this.hbuttonbox1.Spacing = 10; this.hbuttonbox1.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child hbuttonbox1.Gtk.ButtonBox+ButtonBoxChild diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs index 7cca07d7b3..876b67815a 100644 --- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs +++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs @@ -55,6 +55,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels this.radioHour = new global::Gtk.RadioButton (global::MonoDevelop.Core.GettextCatalog.GetString ("Every hour")); this.radioHour.CanFocus = true; this.radioHour.Name = "radioHour"; + this.radioHour.Active = true; this.radioHour.DrawIndicator = true; this.radioHour.UseUnderline = true; this.radioHour.Group = new global::GLib.SList (global::System.IntPtr.Zero); diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic b/main/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic index 832d8246ff..2c7e3f2941 100644 --- a/main/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic +++ b/main/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic @@ -2317,6 +2317,7 @@ Diagnostic</property> <property name="MemberName" /> <property name="CanFocus">True</property> <property name="Label" translatable="yes">Every hour</property> + <property name="Active">True</property> <property name="DrawIndicator">True</property> <property name="HasLabel">True</property> <property name="UseUnderline">True</property> @@ -5522,7 +5523,7 @@ Large</property> </widget> </child> </widget> - <widget class="Gtk.Dialog" id="MonoDevelop.Ide.FindInFiles.FindInFilesDialog" design-size="456 289"> + <widget class="Gtk.Dialog" id="MonoDevelop.Ide.FindInFiles.FindInFilesDialog" design-size="456 348"> <property name="MemberName" /> <property name="Visible">False</property> <property name="TypeHint">Dialog</property> @@ -5531,7 +5532,7 @@ Large</property> <property name="DestroyWithParent">True</property> <property name="SkipPagerHint">True</property> <property name="SkipTaskbarHint">True</property> - <property name="Buttons">4</property> + <property name="Buttons">3</property> <property name="HelpButton">False</property> <child internal-child="VBox"> <widget class="Gtk.VBox" id="dialog1_VBox"> @@ -5544,13 +5545,76 @@ Large</property> <property name="Spacing">6</property> <property name="BorderWidth">6</property> <child> + <widget class="Gtk.HBox" id="hbox3"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.RadioButton" id="toggleFindInFiles"> + <property name="MemberName" /> + <property name="Tooltip" translatable="yes">Switch to Find in Files</property> + <property name="CanFocus">True</property> + <property name="Label" translatable="yes">Find in Files</property> + <property name="Active">True</property> + <property name="DrawIndicator">False</property> + <property name="HasLabel">True</property> + <property name="UseUnderline">True</property> + <property name="Relief">None</property> + <property name="Group">FindInFilesMode</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">False</property> + <property name="Expand">False</property> + </packing> + </child> + <child> + <widget class="Gtk.VSeparator" id="vseparator1"> + <property name="MemberName" /> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.RadioButton" id="toggleReplaceInFiles"> + <property name="MemberName" /> + <property name="Tooltip" translatable="yes">Switch to Replace in Files</property> + <property name="CanFocus">True</property> + <property name="Label" translatable="yes">Replace in Files</property> + <property name="DrawIndicator">False</property> + <property name="HasLabel">True</property> + <property name="UseUnderline">True</property> + <property name="Relief">None</property> + <property name="Group">FindInFilesMode</property> + </widget> + <packing> + <property name="Position">2</property> + <property name="AutoSize">False</property> + <property name="Expand">False</property> + </packing> + </child> + <child> + <placeholder /> + </child> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> <widget class="Gtk.HBox" id="hbox1"> <property name="MemberName" /> <property name="Spacing">6</property> <child> <widget class="Gtk.Table" id="tableFindAndReplace"> <property name="MemberName" /> - <property name="NRows">3</property> + <property name="NRows">2</property> <property name="NColumns">2</property> <property name="RowSpacing">6</property> <property name="ColumnSpacing">6</property> @@ -5608,28 +5672,6 @@ Large</property> </packing> </child> <child> - <widget class="Gtk.Label" id="labelFileMask"> - <property name="MemberName" /> - <property name="Xalign">0</property> - <property name="LabelProp" translatable="yes">_File Mask:</property> - <property name="UseUnderline">True</property> - <property name="MnemonicWidget">comboboxentryFileMask</property> - </widget> - <packing> - <property name="TopAttach">2</property> - <property name="BottomAttach">3</property> - <property name="AutoSize">True</property> - <property name="XOptions">Fill</property> - <property name="YOptions">Fill</property> - <property name="XExpand">False</property> - <property name="XFill">True</property> - <property name="XShrink">False</property> - <property name="YExpand">False</property> - <property name="YFill">True</property> - <property name="YShrink">False</property> - </packing> - </child> - <child> <widget class="Gtk.Label" id="labelFind"> <property name="MemberName" /> <property name="Xalign">0</property> @@ -5653,7 +5695,7 @@ Large</property> <widget class="Gtk.Label" id="labelScope"> <property name="MemberName" /> <property name="Xalign">0</property> - <property name="LabelProp" translatable="yes">_Scope:</property> + <property name="LabelProp" translatable="yes">_Look in:</property> <property name="UseUnderline">True</property> <property name="MnemonicWidget">comboboxScope</property> </widget> @@ -5671,31 +5713,6 @@ Large</property> <property name="YShrink">False</property> </packing> </child> - <child> - <widget class="MonoDevelop.Components.SearchEntry" id="searchentry1"> - <property name="MemberName" /> - <property name="ForceFilterButtonVisible">False</property> - <property name="IsCheckMenu">False</property> - <property name="ActiveFilterID">0</property> - <property name="Ready">False</property> - <property name="HasFocus">False</property> - </widget> - <packing> - <property name="TopAttach">2</property> - <property name="BottomAttach">3</property> - <property name="LeftAttach">1</property> - <property name="RightAttach">2</property> - <property name="AutoSize">True</property> - <property name="XOptions">Fill</property> - <property name="YOptions">Fill</property> - <property name="XExpand">False</property> - <property name="XFill">True</property> - <property name="XShrink">False</property> - <property name="YExpand">False</property> - <property name="YFill">True</property> - <property name="YShrink">False</property> - </packing> - </child> </widget> <packing> <property name="Position">0</property> @@ -5704,7 +5721,7 @@ Large</property> </child> </widget> <packing> - <property name="Position">0</property> + <property name="Position">1</property> <property name="AutoSize">True</property> <property name="Expand">False</property> <property name="Fill">False</property> @@ -5792,7 +5809,7 @@ Large</property> </child> </widget> <packing> - <property name="Position">1</property> + <property name="Position">2</property> <property name="AutoSize">True</property> <property name="Expand">False</property> <property name="Fill">False</property> @@ -5813,7 +5830,7 @@ Large</property> <property name="MemberName" /> <property name="Spacing">6</property> <property name="BorderWidth">5</property> - <property name="Size">4</property> + <property name="Size">3</property> <property name="LayoutStyle">End</property> <child> <widget class="Gtk.Button" id="buttonStop"> @@ -5848,22 +5865,6 @@ Large</property> </packing> </child> <child> - <widget class="Gtk.Button" id="buttonReplace"> - <property name="MemberName" /> - <property name="CanFocus">True</property> - <property name="Type">TextAndIcon</property> - <property name="Icon">stock:gtk-find-and-replace Menu</property> - <property name="Label" translatable="yes">R_eplace</property> - <property name="UseUnderline">True</property> - <property name="ResponseId">0</property> - </widget> - <packing> - <property name="Position">2</property> - <property name="Expand">False</property> - <property name="Fill">False</property> - </packing> - </child> - <child> <widget class="Gtk.Button" id="buttonSearch"> <property name="MemberName" /> <property name="CanDefault">True</property> @@ -5875,7 +5876,7 @@ Large</property> <property name="label">gtk-find</property> </widget> <packing> - <property name="Position">3</property> + <property name="Position">2</property> <property name="Expand">False</property> <property name="Fill">False</property> </packing> diff --git a/main/src/core/MonoDevelop.Ide/templates/EmptyTextFile.xft.xml b/main/src/core/MonoDevelop.Ide/templates/EmptyTextFile.xft.xml index 4f0394b341..f03ac02143 100644 --- a/main/src/core/MonoDevelop.Ide/templates/EmptyTextFile.xft.xml +++ b/main/src/core/MonoDevelop.Ide/templates/EmptyTextFile.xft.xml @@ -9,7 +9,7 @@ </TemplateConfiguration> <TemplateFiles> - <File DefaultExtension=".txt" DefaultName="EmptyTextfile" BuildAction="None"/> + <File DefaultExtension=".txt" DefaultName="EmptyTextFile" /> </TemplateFiles> <FileOptions/> diff --git a/main/src/core/MonoDevelop.Ide/templates/EmptyXMLFile.xft.xml b/main/src/core/MonoDevelop.Ide/templates/EmptyXMLFile.xft.xml index 06dcd401c2..4257807273 100644 --- a/main/src/core/MonoDevelop.Ide/templates/EmptyXMLFile.xft.xml +++ b/main/src/core/MonoDevelop.Ide/templates/EmptyXMLFile.xft.xml @@ -9,7 +9,10 @@ </TemplateConfiguration> <TemplateFiles> - <File DefaultExtension=".xml" DefaultName="EmptyXmlfile" BuildAction="None" /> + <File DefaultExtension=".xml" DefaultName="EmptyXmlFile"> +<![CDATA[<?xml version="1.0" encoding="UTF-8" ?> +]]> + </File> </TemplateFiles> <FileOptions/> diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.cs index 1e79321a5d..47463538ff 100644 --- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.cs +++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.cs @@ -57,7 +57,12 @@ namespace MonoDevelop.Projects.Formats.MSBuild RunSTA (delegate
{
engine = new Engine (binDir);
- engine.GlobalProperties.SetProperty ("BuildingInsideVisualStudio", "true");
+ engine.GlobalProperties.SetProperty ("BuildingInsideVisualStudio", "true"); + + //we don't have host compilers in MD, and this is set to true by some of the MS targets + //which causes it to always run the CoreCompile task if BuildingInsideVisualStudio is also + //true, because the VS in-process compiler would take care of the deps tracking + engine.GlobalProperties.SetProperty ("UseHostCompilerIfAvailable", "false");
consoleLogger = new MDConsoleLogger (LoggerVerbosity.Normal, LogWriteLine, null, null);
engine.RegisterLogger (consoleLogger);
diff --git a/main/src/tools/MacCrashLogger/MacCrashLogger.csproj b/main/src/tools/MacCrashLogger/MacCrashLogger.csproj index a548ac9156..7dc78c06e4 100644 --- a/main/src/tools/MacCrashLogger/MacCrashLogger.csproj +++ b/main/src/tools/MacCrashLogger/MacCrashLogger.csproj @@ -53,7 +53,6 @@ <None Include="MonoMacLaunchScript.sh" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> - <Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" /> <ItemGroup> <InterfaceDefinition Include="MainMenu.xib" /> </ItemGroup> @@ -78,4 +77,4 @@ <Name>MonoDevelop.Core</Name> </ProjectReference> </ItemGroup> -</Project>
\ No newline at end of file +</Project> |