mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 20:39:01 +00:00
This commit is contained in:
parent
584908bc64
commit
8f4e203ef9
2 changed files with 90 additions and 4 deletions
|
|
@ -57,6 +57,8 @@
|
|||
this.tabPXE = new System.Windows.Forms.TabPage();
|
||||
this.tabUSB = new System.Windows.Forms.TabPage();
|
||||
this.tabISO = new System.Windows.Forms.TabPage();
|
||||
this.lablBuildOnly = new System.Windows.Forms.Label();
|
||||
this.lablDeployText = new System.Windows.Forms.Label();
|
||||
this.TabControl1.SuspendLayout();
|
||||
this.tabDeploy.SuspendLayout();
|
||||
this.tabCompile.SuspendLayout();
|
||||
|
|
@ -87,6 +89,8 @@
|
|||
//
|
||||
// tabDeploy
|
||||
//
|
||||
this.tabDeploy.Controls.Add(this.lablDeployText);
|
||||
this.tabDeploy.Controls.Add(this.lablBuildOnly);
|
||||
this.tabDeploy.Controls.Add(this.lboxDeploy);
|
||||
this.tabDeploy.Location = new System.Drawing.Point(4, 4);
|
||||
this.tabDeploy.Name = "tabDeploy";
|
||||
|
|
@ -399,6 +403,25 @@
|
|||
this.tabISO.Text = "ISO";
|
||||
this.tabISO.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// lablBuildOnly
|
||||
//
|
||||
this.lablBuildOnly.AutoSize = true;
|
||||
this.lablBuildOnly.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lablBuildOnly.ForeColor = System.Drawing.SystemColors.HotTrack;
|
||||
this.lablBuildOnly.Location = new System.Drawing.Point(226, 166);
|
||||
this.lablBuildOnly.Name = "lablBuildOnly";
|
||||
this.lablBuildOnly.Size = new System.Drawing.Size(207, 13);
|
||||
this.lablBuildOnly.TabIndex = 3;
|
||||
this.lablBuildOnly.Text = "You have selected a build only option.";
|
||||
//
|
||||
// lablDeployText
|
||||
//
|
||||
this.lablDeployText.Location = new System.Drawing.Point(226, 13);
|
||||
this.lablDeployText.Name = "lablDeployText";
|
||||
this.lablDeployText.Size = new System.Drawing.Size(226, 83);
|
||||
this.lablDeployText.TabIndex = 4;
|
||||
this.lablDeployText.Text = "label1";
|
||||
//
|
||||
// CosmosPage
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
|
@ -409,6 +432,7 @@
|
|||
this.Controls.SetChildIndex(this.TabControl1, 0);
|
||||
this.TabControl1.ResumeLayout(false);
|
||||
this.tabDeploy.ResumeLayout(false);
|
||||
this.tabDeploy.PerformLayout();
|
||||
this.tabCompile.ResumeLayout(false);
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.panel2.PerformLayout();
|
||||
|
|
@ -455,6 +479,8 @@
|
|||
private System.Windows.Forms.TabPage tabISO;
|
||||
private System.Windows.Forms.TabPage tabDeploy;
|
||||
private System.Windows.Forms.ListBox lboxDeploy;
|
||||
private System.Windows.Forms.Label lablBuildOnly;
|
||||
private System.Windows.Forms.Label lablDeployText;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -23,12 +23,74 @@ namespace Cosmos.VS.Package {
|
|||
public static BuildTarget CurrentBuildTarget = BuildTarget.VMWare;
|
||||
public static event EventHandler BuildTargetChanged;
|
||||
|
||||
protected bool mShowTabDebug;
|
||||
protected bool mShowTabVMWare;
|
||||
protected bool mShowTabPXE;
|
||||
protected bool mShowTabUSB;
|
||||
protected bool mShowTabISO;
|
||||
|
||||
protected void RemoveTab(TabPage aTab) {
|
||||
if (TabControl1.TabPages.Contains(aTab)) {
|
||||
TabControl1.TabPages.Remove(aTab);
|
||||
}
|
||||
}
|
||||
|
||||
protected void UpdateTabs() {
|
||||
RemoveTab(tabDebug);
|
||||
RemoveTab(tabVMWare);
|
||||
RemoveTab(tabPXE);
|
||||
RemoveTab(tabUSB);
|
||||
RemoveTab(tabISO);
|
||||
|
||||
if (mShowTabDebug) {
|
||||
TabControl1.TabPages.Add(tabDebug);
|
||||
}
|
||||
if (mShowTabVMWare) {
|
||||
TabControl1.TabPages.Add(tabVMWare);
|
||||
}
|
||||
if (mShowTabPXE) {
|
||||
TabControl1.TabPages.Add(tabPXE);
|
||||
}
|
||||
if (mShowTabUSB) {
|
||||
TabControl1.TabPages.Add(tabUSB);
|
||||
}
|
||||
if (mShowTabISO) {
|
||||
TabControl1.TabPages.Add(tabISO);
|
||||
}
|
||||
}
|
||||
|
||||
protected static void OnBuildTargetChanged(Object sender, EventArgs e) {
|
||||
if (CosmosPage.BuildTargetChanged != null) {
|
||||
CosmosPage.BuildTargetChanged(sender, e);
|
||||
}
|
||||
}
|
||||
|
||||
protected void SetDeployment(BuildTarget aTarget) {
|
||||
bool xBuildOnly = (aTarget == BuildTarget.ISO || aTarget == BuildTarget.USB);
|
||||
|
||||
mShowTabDebug = !xBuildOnly;
|
||||
mShowTabVMWare = (aTarget == BuildTarget.VMWare || aTarget == BuildTarget.VMWarePXE);
|
||||
mShowTabPXE = (aTarget == BuildTarget.PXE);
|
||||
mShowTabUSB = (aTarget == BuildTarget.USB);
|
||||
mShowTabISO = (aTarget == BuildTarget.ISO);
|
||||
|
||||
UpdateTabs();
|
||||
|
||||
lablBuildOnly.Visible = xBuildOnly;
|
||||
|
||||
if (aTarget == BuildTarget.ISO) {
|
||||
lablDeployText.Text = "Creates a bootable ISO image which can be burned to a DVD.";
|
||||
} else if (aTarget == BuildTarget.USB) {
|
||||
lablDeployText.Text = "Makes a USB device such as a flash drive or external hard disk bootable.";
|
||||
} else if (aTarget == BuildTarget.VMWare) {
|
||||
lablDeployText.Text = "Uses VMWare to deploy and debug in the standard configuration.";
|
||||
} else if (aTarget == BuildTarget.VMWarePXE) {
|
||||
lablDeployText.Text = "Uses VMWare and PXE. Only intended for testing PXE. VMWare (Default) should be used normally.";
|
||||
} else if (aTarget == BuildTarget.PXE) {
|
||||
lablDeployText.Text = "Creates a PXE setup and hosts a DCHP and TFTP server to deploy directly to physical hardware. Allows debugging with a serial cable.";
|
||||
}
|
||||
}
|
||||
|
||||
public CosmosPage() {
|
||||
InitializeComponent();
|
||||
|
||||
|
|
@ -63,8 +125,7 @@ namespace Cosmos.VS.Package {
|
|||
if (value != mProps.BuildTarget) {
|
||||
mProps.BuildTarget = value;
|
||||
IsDirty = true;
|
||||
|
||||
//comboFlavor.Visible = value == TargetHost.VMWare;
|
||||
SetDeployment(value);
|
||||
|
||||
CurrentBuildTarget = value;
|
||||
OnBuildTargetChanged(this, EventArgs.Empty);
|
||||
|
|
@ -132,7 +193,6 @@ namespace Cosmos.VS.Package {
|
|||
|
||||
protected override void FillProperties() {
|
||||
base.FillProperties();
|
||||
|
||||
mProps.Reset();
|
||||
|
||||
//TODO: Why are we copying these one by one instead of automatic?
|
||||
|
|
@ -144,7 +204,7 @@ namespace Cosmos.VS.Package {
|
|||
// We need to manually trigger it once, because the indexchanged event compares
|
||||
// it against the source, and they will of course be the same.
|
||||
CurrentBuildTarget = (BuildTarget)((EnumValue)lboxDeploy.SelectedItem).Value;
|
||||
OnBuildTargetChanged(this, EventArgs.Empty);
|
||||
SetDeployment(CurrentBuildTarget);
|
||||
|
||||
mProps.SetProperty("Framework", GetConfigProperty("Framework"));
|
||||
comboFramework.SelectedItem = EnumValue.Find(comboFramework.Items, mProps.Framework);
|
||||
|
|
|
|||
Loading…
Reference in a new issue