Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ward <matt.ward@xamarin.com>2015-07-06 13:34:41 +0300
committerMatt Ward <matt.ward@xamarin.com>2015-07-06 15:28:30 +0300
commit361774e779178abfa8158e3237d5a7e9890a419b (patch)
tree4a8886e4bd5bb2e58eb295ed39cfa2b830c16175 /main/src/addins/WindowsPlatform
parente8053cbb542624a6d1e24dc2d28ba21ac7f85996 (diff)
[Windows] Disable encoding if solution selected in Open File dialog.
Fixed bug #31612 - Mac - 'Auto Detected' dropdown is disabled after selecting any .sln file at "File to Open" window. https://bugzilla.xamarin.com/show_bug.cgi?id=31612 The bug description is incorrect. The problem is that on Windows the File to Open dialog was not disabling the Encoding combo box when the Solution Workbench is selected to open the file with. On the Mac the encoding combo box was disabled. The encoding is ignored if the file is a solution or project file and is opened when Solution Workbench is selected. So the Windows File to Open dialog has been changed to disable the encoding combo box when Solution workbench is selected to make it consistent with the behaviour on the Mac.
Diffstat (limited to 'main/src/addins/WindowsPlatform')
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs13
1 files changed, 12 insertions, 1 deletions
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs
index de3755729a..90ccbb3623 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs
@@ -93,8 +93,17 @@ namespace MonoDevelop.Platform
group.Items.Add (viewerCombo);
dialog.Controls.Add (group);
+ if (encodingCombo != null || IdeApp.Workspace.IsOpen) {
+ viewerCombo.SelectedIndexChanged += (o, e) => {
+ bool solutionWorkbenchSelected = ((ViewerComboItem)viewerCombo.Items [viewerCombo.SelectedIndex]).Viewer == null;
+ if (closeSolution != null)
+ closeSolution.Visible = solutionWorkbenchSelected;
+ if (encodingCombo != null)
+ encodingCombo.Enabled = !solutionWorkbenchSelected;
+ };
+ }
+
if (IdeApp.Workspace.IsOpen) {
- viewerCombo.SelectedIndexChanged += (o, e) => closeSolution.Visible = ((ViewerComboItem)viewerCombo.Items[viewerCombo.SelectedIndex]).Viewer == null;
var group2 = new CommonFileDialogGroupBox ();
// "Close current workspace" is too long and splits the text on 2 lines.
@@ -112,6 +121,8 @@ namespace MonoDevelop.Platform
bool hasBench = FillViewers (viewerCombo, file);
if (closeSolution != null)
closeSolution.Visible = hasBench;
+ if (encodingCombo != null)
+ encodingCombo.Enabled = !hasBench;
dialog.ApplyControlPropertyChange ("Items", viewerCombo);
} catch (Exception ex) {
LoggingService.LogInternalError (ex);