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

TarballBuilderEditorWidget.cs « MonoDevelop.Autotools « addins « src « main - github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: edd2eebbdd278d455bbf177a9d1ff60647371083 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88

using System;
using MonoDevelop.Projects;

namespace MonoDevelop.Autotools
{
	
	
	public partial class TarballBuilderEditorWidget : Gtk.Bin
	{
		TarballDeployTarget target;
		
		public TarballBuilderEditorWidget (TarballDeployTarget target)
		{
			this.Build();
			alignment1.Xalign = 0.16f;
			alignment1.Xscale = 0.04f;
			
			this.target = target;
			SolutionItem targetCombine = target.RootSolutionItem;
			folderEntry.Path = target.TargetDir;
			
			if (string.IsNullOrEmpty (target.DefaultConfiguration)) {
				target.DefaultConfiguration = targetCombine.ParentSolution.GetConfigurations () [0];
			}
			
			for (int ii=0; ii < targetCombine.ParentSolution.Configurations.Count; ii++)
			{
				string cc = targetCombine.ParentSolution.Configurations [ii].Id;
				comboConfigs.AppendText ( cc );
				if ( cc == target.DefaultConfiguration ) comboConfigs.Active = ii;
			}
			if (target.GenerateFiles)
				radioGenerate.Active = true;
			else
				radioUseExisting.Active = true;

			rbAutotools.Active = target.GenerateAutotools;
			rbSimple.Active = !target.GenerateAutotools;
			
			UpdateControls ();
		}
		
		void UpdateControls ()
		{
			boxGenerate.Sensitive = target.GenerateFiles;
		}

		protected virtual void OnRadioGenerateClicked(object sender, System.EventArgs e)
		{
			target.GenerateFiles = true;
			UpdateControls ();
		}

		protected virtual void OnRadioUseExistingClicked(object sender, System.EventArgs e)
		{
			target.GenerateFiles = false;
			UpdateControls ();
		}

		protected virtual void OnComboConfigsChanged(object sender, System.EventArgs e)
		{
			target.DefaultConfiguration = comboConfigs.ActiveText;
		}

		protected virtual void OnFolderEntryPathChanged(object sender, System.EventArgs e)
		{
			target.TargetDir = folderEntry.Path;
		}

		protected virtual void OnRbSimpleToggled (object sender, System.EventArgs e)
		{
			target.GenerateAutotools = rbAutotools.Active;
		}

		protected virtual void OnRbAutotoolsToggled (object sender, System.EventArgs e)
		{
			target.GenerateAutotools = rbAutotools.Active;
		}

		protected virtual void OnAutofooPropertiesClicked (object sender, System.EventArgs e)
		{
			MakefileSwitchEditor editor = new MakefileSwitchEditor (target);
			editor.ShowAll ();
			MonoDevelop.Ide.MessageService.ShowCustomDialog (editor, this.Toplevel as Gtk.Window);
		}
	}
}