diff options
author | Jeffrey Stedfast <jeff@xamarin.com> | 2014-03-18 00:52:36 +0400 |
---|---|---|
committer | Jeffrey Stedfast <jeff@xamarin.com> | 2014-03-18 00:52:36 +0400 |
commit | 9550f47363dc0db5a89c7bdcccf3392f39f3cacf (patch) | |
tree | b3f72f7949d6b9b79675d047fd659f3442eeda78 /main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Visualizer | |
parent | 5b2bf29674cd1fb97e2b41d077eb1ccb9c6a23da (diff) |
[Debugger] Improved DebuggerVisualizerDialog usability
Fixes bug #17274
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Visualizer')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Visualizer/ValueVisualizerDialog.cs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Visualizer/ValueVisualizerDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Visualizer/ValueVisualizerDialog.cs index ab85147757..731fae5a82 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Visualizer/ValueVisualizerDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Visualizer/ValueVisualizerDialog.cs @@ -47,41 +47,43 @@ namespace MonoDevelop.Debugger.Viewers { value = val; visualizers = new List<ValueVisualizer> (DebuggingService.GetValueVisualizers (val)); - visualizers.Sort (delegate (ValueVisualizer v1, ValueVisualizer v2) { - return v1.Name.CompareTo (v2.Name); - }); + visualizers.Sort ((v1, v2) => string.Compare (v1.Name, v2.Name, StringComparison.CurrentCultureIgnoreCase)); int defaultVis = 0; int n = 0; + foreach (ValueVisualizer vis in visualizers) { comboVisualizers.AppendText (vis.Name); if (vis.IsDefaultVisualizer (val)) defaultVis = n; n++; } + comboVisualizers.Active = defaultVis; - if (val.IsReadOnly || !visualizers.Where (v => v.CanEdit (val)).Any ()) { - buttonCancel.Hide (); - buttonOk.Label = Gtk.Stock.Close; + if (val.IsReadOnly || !visualizers.Any (v => v.CanEdit (val))) { + buttonCancel.Label = Gtk.Stock.Close; + buttonSave.Hide (); } } - protected virtual void OnComboVisualizersChanged (object sender, System.EventArgs e) + protected virtual void OnComboVisualizersChanged (object sender, EventArgs e) { if (currentWidget != null) mainBox.Remove (currentWidget); + if (comboVisualizers.Active == -1) { - buttonOk.Sensitive = false; + buttonSave.Sensitive = false; return; } - buttonOk.Sensitive = true; + currentVisualizer = visualizers [comboVisualizers.Active]; currentWidget = currentVisualizer.GetVisualizerWidget (value); + buttonSave.Sensitive = currentVisualizer.CanEdit (value); mainBox.PackStart (currentWidget, true, true, 0); currentWidget.Show (); } - protected virtual void OnButtonOkClicked (object sender, System.EventArgs e) + protected virtual void OnSaveClicked (object sender, EventArgs e) { if (value.IsReadOnly || currentVisualizer == null || currentVisualizer.StoreValue (value)) Respond (Gtk.ResponseType.Ok); |