4
// Lluis Sanchez Gual <lluis@novell.com>
6
// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
8
// Permission is hereby granted, free of charge, to any person obtaining a copy
9
// of this software and associated documentation files (the "Software"), to deal
10
// in the Software without restriction, including without limitation the rights
11
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
// copies of the Software, and to permit persons to whom the Software is
13
// furnished to do so, subject to the following conditions:
15
// The above copyright notice and this permission notice shall be included in
16
// all copies or substantial portions of the Software.
18
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
31
using MonoDevelop.Projects;
32
using MonoDevelop.Ide.Gui.Dialogs;
33
using MonoDevelop.Components;
34
using MonoDevelop.Core;
39
namespace MonoDevelop.Ide.Projects.OptionPanels
41
internal class RunOptionsPanel : MultiConfigItemOptionsPanel
43
RunOptionsPanelWidget widget;
45
public override Widget CreatePanelWidget()
47
return (widget = new RunOptionsPanelWidget ());
50
public override bool ValidateChanges ()
52
return widget.ValidateChanges ();
55
public override void LoadConfigData ()
57
widget.Load (ConfiguredProject, (ProjectConfiguration) CurrentConfiguration);
61
public override void ApplyChanges()
67
public partial class RunOptionsPanelWidget : Gtk.Bin
69
ProjectConfiguration configuration;
71
public RunOptionsPanelWidget()
74
externalConsoleCheckButton.Toggled += new EventHandler (ExternalConsoleToggle);
77
public void Load (Project project, ProjectConfiguration config)
79
this.configuration = config;
81
parametersEntry.Text = configuration.CommandLineParameters;
82
externalConsoleCheckButton.Active = configuration.ExternalConsole;
83
pauseConsoleOutputCheckButton.Active = configuration.PauseConsoleOutput;
84
pauseConsoleOutputCheckButton.Sensitive = externalConsoleCheckButton.Active;
86
envVarList.LoadValues (configuration.EnvironmentVariables);
89
public bool ValidateChanges ()
96
if (configuration == null)
99
configuration.CommandLineParameters = parametersEntry.Text;
100
configuration.ExternalConsole = externalConsoleCheckButton.Active;
101
configuration.PauseConsoleOutput = pauseConsoleOutputCheckButton.Active;
103
configuration.EnvironmentVariables.Clear ();
104
envVarList.StoreValues (configuration.EnvironmentVariables);
107
void ExternalConsoleToggle (object sender, EventArgs e)
109
if (externalConsoleCheckButton.Active) {
110
pauseConsoleOutputCheckButton.Sensitive = true;
111
pauseConsoleOutputCheckButton.Active = true;
113
pauseConsoleOutputCheckButton.Sensitive = false;
114
pauseConsoleOutputCheckButton.Active = false;