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:
authorTherzok <teromario@yahoo.com>2013-11-25 15:43:10 +0400
committerTherzok <teromario@yahoo.com>2013-11-25 15:43:10 +0400
commitc28934510d7fae39845078723134d0353ac57f14 (patch)
tree93f7f0ef684b481c4ab89e12f762c0507bf2187d /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels
parent7c75a60c41a328786e8fc052c8108a52546b5fc2 (diff)
Bug 14332 - The "Use MSBuild build engine" should be in the Build section
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineMSBuildOptions.cs85
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/GeneralProjectOptions.cs33
2 files changed, 86 insertions, 32 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineMSBuildOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineMSBuildOptions.cs
new file mode 100644
index 0000000000..66760993c8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineMSBuildOptions.cs
@@ -0,0 +1,85 @@
+//
+// CombineMSBuildWidget.cs
+//
+// Author:
+// Marius Ungureanu <marius.ungureanu@xamarin.com>
+//
+// Copyright (c) 2013 Marius Ungureanu
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.Gui.Dialogs;
+using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.Core;
+using MonoDevelop.Components;
+
+namespace MonoDevelop.Ide.Projects.OptionPanels
+{
+ class CombineMSBuildOptions : ItemOptionsPanel
+ {
+ Xwt.CheckBox checkMSBuild;
+
+ public override Gtk.Widget CreatePanelWidget ()
+ {
+ var box = new Xwt.VBox ();
+ box.Spacing = 6;
+ box.Margin = 12;
+
+ bool byDefault, require;
+ MSBuildProjectService.CheckHandlerUsesMSBuildEngine (ConfiguredProject, out byDefault, out require);
+ if (require) {
+ box.Visible = false;
+ return box.ToGtkWidget ();
+ }
+
+ box.PackStart (new Xwt.Label {
+ Markup = "<b>Build Engine</b>"
+ });
+
+ checkMSBuild = new Xwt.CheckBox (byDefault ?
+ GettextCatalog.GetString ("Use MSBuild build engine (recommended for this project type)") :
+ GettextCatalog.GetString ("Use MSBuild build engine (unsupported for this project type)")) {
+ Active = ConfiguredProject.UseMSBuildEngine ?? byDefault
+ };
+ var hbox = new Xwt.HBox ();
+ // Use the same hack as in other pads. TODO: Change it in all.
+ hbox.PackStart (new Xwt.Label {
+ WidthRequest = 18
+ });
+ hbox.PackStart (checkMSBuild);
+ box.PackStart (hbox);
+ box.Show ();
+ return box.ToGtkWidget ();
+ }
+
+ public override void ApplyChanges ()
+ {
+ bool byDefault, require;
+ MSBuildProjectService.CheckHandlerUsesMSBuildEngine (ConfiguredProject, out byDefault, out require);
+ if (!require) {
+ var active = checkMSBuild.Active;
+ if (active == byDefault)
+ ConfiguredProject.UseMSBuildEngine = null;
+ else
+ ConfiguredProject.UseMSBuildEngine = active;
+ }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/GeneralProjectOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/GeneralProjectOptions.cs
index 1a289fa5b1..39d1c9e07b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/GeneralProjectOptions.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/GeneralProjectOptions.cs
@@ -28,9 +28,6 @@ using MonoDevelop.Ide.Gui.Dialogs;
using Gtk;
using MonoDevelop.Projects;
-using System.Runtime.InteropServices;
-using MonoDevelop.Projects.Formats.MSBuild;
-using MonoDevelop.Core;
namespace MonoDevelop.Ide.Projects.OptionPanels
{
@@ -67,29 +64,12 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
projectNameEntry.Text = project.Name;
projectDescriptionTextView.Buffer.Text = project.Description;
-
- // TODO msbuild Move to build panel?
+
if (project is DotNetProject) {
projectDefaultNamespaceEntry.Text = ((DotNetProject)project).DefaultNamespace;
-
- bool byDefault, require;
- MSBuildProjectService.CheckHandlerUsesMSBuildEngine (project, out byDefault, out require);
- if (require) {
- this.msbuildOptionsSection.Visible = false;
- this.msbuildHeaderLabel.Visible = false;
- } else {
- this.msbuildCheck.Active = project.UseMSBuildEngine ?? byDefault;
- if (byDefault) {
- msbuildCheck.Label = GettextCatalog.GetString ("Use MSBuild build engine (recommended for this project type)");
- } else {
- msbuildCheck.Label = GettextCatalog.GetString ("Use MSBuild build engine (unsupported for this project type)");
- }
- }
} else {
defaultNamespaceLabel.Visible = false;
projectDefaultNamespaceEntry.Visible = false;
- this.msbuildOptionsSection.Visible = false;
- this.msbuildHeaderLabel.Visible = false;
}
switch (project.NewFileSearch)
@@ -134,17 +114,6 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
project.Description = projectDescriptionTextView.Buffer.Text;
if (project is DotNetProject) {
((DotNetProject)project).DefaultNamespace = projectDefaultNamespaceEntry.Text;
-
- bool byDefault, require;
- MSBuildProjectService.CheckHandlerUsesMSBuildEngine (project, out byDefault, out require);
- if (!require) {
- var active = msbuildCheck.Active;
- if (active == byDefault) {
- project.UseMSBuildEngine = null;
- } else {
- project.UseMSBuildEngine = active;
- }
- }
}
if (newFilesOnLoadCheckButton.Active) {