From 58c9152351b02b37e63fc193060474478f1e9a65 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 29 May 2017 11:38:11 -0400 Subject: various things from last night --- ShiftOS.WinForms/ShiftOS.WinForms.csproj | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ShiftOS.WinForms/ShiftOS.WinForms.csproj') diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj index 9844657..22bd1d2 100644 --- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj +++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj @@ -388,6 +388,12 @@ ShiftGames.cs + + UserControl + + + ShiftSoft_Ping.cs + @@ -583,6 +589,9 @@ ShiftGames.cs + + ShiftSoft_Ping.cs + UniteLoginDialog.cs -- cgit v1.2.3 From 0451b5d15703987b6be1160917ea31d36f6ee125 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 30 May 2017 16:34:31 -0400 Subject: Slight Shiftnet mods, new default skin. --- ShiftOS.WinForms/Applications/Chat.resx | 6 ++ ShiftOS.WinForms/Applications/Shiftnet.cs | 3 + ShiftOS.WinForms/ShiftOS.WinForms.csproj | 9 ++ .../ShiftnetSites/ShiftSoft.Designer.cs | 61 +++++++++++ ShiftOS.WinForms/ShiftnetSites/ShiftSoft.cs | 38 +++++++ ShiftOS.WinForms/ShiftnetSites/ShiftSoft.resx | 120 +++++++++++++++++++++ ShiftOS.WinForms/ShiftnetSites/ShiftSoft_Ping.cs | 51 +++++---- ShiftOS_TheReturn/Skinning.cs | 12 +-- 8 files changed, 271 insertions(+), 29 deletions(-) create mode 100644 ShiftOS.WinForms/ShiftnetSites/ShiftSoft.Designer.cs create mode 100644 ShiftOS.WinForms/ShiftnetSites/ShiftSoft.cs create mode 100644 ShiftOS.WinForms/ShiftnetSites/ShiftSoft.resx (limited to 'ShiftOS.WinForms/ShiftOS.WinForms.csproj') diff --git a/ShiftOS.WinForms/Applications/Chat.resx b/ShiftOS.WinForms/Applications/Chat.resx index a7b2b93..e4a35ad 100644 --- a/ShiftOS.WinForms/Applications/Chat.resx +++ b/ShiftOS.WinForms/Applications/Chat.resx @@ -123,6 +123,12 @@ 122, 17 + + 17, 17 + + + 122, 17 + diff --git a/ShiftOS.WinForms/Applications/Shiftnet.cs b/ShiftOS.WinForms/Applications/Shiftnet.cs index 7f5d3c1..22b53a0 100644 --- a/ShiftOS.WinForms/Applications/Shiftnet.cs +++ b/ShiftOS.WinForms/Applications/Shiftnet.cs @@ -80,6 +80,7 @@ namespace ShiftOS.WinForms.Applications txturl.Location = new Point(btnforward.Left + btnforward.Width + 2, 2); txturl.Width = flcontrols.Width - btnback.Width - 2 - btnforward.Width - 2 - (btngo.Width*2) - 2; btngo.Location = new Point(flcontrols.Width - btngo.Width - 2, 2); + flcontrols.BackColor = SkinEngine.LoadedSkin.TitleBackgroundColor; } public bool OnUnload() @@ -147,6 +148,7 @@ namespace ShiftOS.WinForms.Applications public void NavigateToUrl(string url) { + txturl.Text = url; foreach(var exe in Directory.GetFiles(Environment.CurrentDirectory)) { @@ -188,6 +190,7 @@ namespace ShiftOS.WinForms.Applications obj.OnUpgrade(); obj.OnSkinLoad(); obj.Setup(); + AppearanceManager.SetWindowTitle(this, attribute.Name + " - Shiftnet"); return; } } diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj index 22bd1d2..65a512e 100644 --- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj +++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj @@ -388,6 +388,12 @@ ShiftGames.cs + + UserControl + + + ShiftSoft.cs + UserControl @@ -589,6 +595,9 @@ ShiftGames.cs + + ShiftSoft.cs + ShiftSoft_Ping.cs diff --git a/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.Designer.cs b/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.Designer.cs new file mode 100644 index 0000000..a62b5a8 --- /dev/null +++ b/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.Designer.cs @@ -0,0 +1,61 @@ +namespace ShiftOS.WinForms.ShiftnetSites +{ + partial class ShiftSoft + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Franklin Gothic Heavy", 24.75F, System.Drawing.FontStyle.Italic); + this.label1.Location = new System.Drawing.Point(13, 17); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(152, 38); + this.label1.TabIndex = 0; + this.label1.Tag = "keepfont"; + this.label1.Text = "Shiftsoft"; + // + // ShiftSoft + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.label1); + this.Name = "ShiftSoft"; + this.Size = new System.Drawing.Size(523, 384); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + } +} diff --git a/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.cs b/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.cs new file mode 100644 index 0000000..18968cd --- /dev/null +++ b/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using ShiftOS.Engine; + +namespace ShiftOS.WinForms.ShiftnetSites +{ + [ShiftnetSite("shiftnet/shiftsoft", "ShiftSoft", "What do you want to shift today?")] + [ShiftnetFundamental] + public partial class ShiftSoft : UserControl, IShiftnetSite + { + public ShiftSoft() + { + InitializeComponent(); + } + + public event Action GoBack; + public event Action GoToUrl; + + public void OnSkinLoad() + { + } + + public void OnUpgrade() + { + } + + public void Setup() + { + } + } +} diff --git a/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.resx b/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ShiftOS.WinForms/ShiftnetSites/ShiftSoft_Ping.cs b/ShiftOS.WinForms/ShiftnetSites/ShiftSoft_Ping.cs index 1c64390..1593117 100644 --- a/ShiftOS.WinForms/ShiftnetSites/ShiftSoft_Ping.cs +++ b/ShiftOS.WinForms/ShiftnetSites/ShiftSoft_Ping.cs @@ -25,11 +25,6 @@ namespace ShiftOS.WinForms.ShiftnetSites public event Action GoBack; public event Action GoToUrl; - public void OnLoad() - { - SetupListing(); - } - public void OnSkinLoad() { ControlManager.SetupControls(this); @@ -38,6 +33,7 @@ namespace ShiftOS.WinForms.ShiftnetSites public void SetupListing() { + fllist.Controls.Clear(); foreach(var exec in Directory.GetFiles(Environment.CurrentDirectory)) { if(exec.ToLower().EndsWith(".exe") || exec.ToLower().EndsWith(".dll")) @@ -50,27 +46,36 @@ namespace ShiftOS.WinForms.ShiftnetSites { if (type.GetInterfaces().Contains(typeof(IShiftnetSite))) { - var attr = type.GetCustomAttributes(false).Where(x => x is ShiftnetSiteAttribute) as ShiftnetSiteAttribute; + var attr = type.GetCustomAttributes(false).FirstOrDefault(x => x is ShiftnetSiteAttribute) as ShiftnetSiteAttribute; if (attr != null) { - var lnk = new LinkLabel(); - lnk.LinkColor = SkinEngine.LoadedSkin.ControlTextColor; - lnk.Tag = "header3"; - lnk.Text = attr.Name; - var desc = new Label(); - desc.AutoSize = true; - lnk.AutoSize = true; - desc.MaximumSize = new Size(this.Width / 3, 0); - desc.Text = attr.Description; - lnk.Click += (o, a) => + if (attr.Url.StartsWith("shiftnet/")) { - GoToUrl?.Invoke(attr.Url); - }; - fllist.Controls.Add(lnk); - fllist.Controls.Add(desc); - ControlManager.SetupControls(lnk); - lnk.Show(); - desc.Show(); + var lnk = new LinkLabel(); + lnk.LinkColor = SkinEngine.LoadedSkin.ControlTextColor; + lnk.Text = attr.Name; + var desc = new Label(); + desc.AutoSize = true; + lnk.AutoSize = true; + desc.MaximumSize = new Size(this.Width / 3, 0); + desc.Text = attr.Description; + desc.Padding = new Padding + { + Bottom = 25, + Top = 0, + Left = 10, + Right = 10 + }; + lnk.Click += (o, a) => + { + GoToUrl?.Invoke(attr.Url); + }; + fllist.Controls.Add(lnk); + fllist.Controls.Add(desc); + ControlManager.SetupControls(lnk); + lnk.Show(); + desc.Show(); + } } } } diff --git a/ShiftOS_TheReturn/Skinning.cs b/ShiftOS_TheReturn/Skinning.cs index f5dd211..5bd4ab1 100644 --- a/ShiftOS_TheReturn/Skinning.cs +++ b/ShiftOS_TheReturn/Skinning.cs @@ -332,18 +332,18 @@ namespace ShiftOS.Engine public class Skin { //borrowing from the discourse theme for the default skin - private static readonly Color DefaultBackground = Color.FromArgb(0, 0x44, 0x00); + private static readonly Color DefaultBackground = Color.FromArgb(0x11, 0x11, 0x11); private static readonly Color DefaultForeground = Color.FromArgb(0xDD, 0xDD, 0xDD); private static readonly Color Accent1 = Color.FromArgb(0x66, 0x66, 0x66); private static readonly Color Accent2 = Color.FromArgb(0x80, 0, 0); - private static readonly Color DesktopBG = Color.FromArgb(0x22, 0x22, 0x22); + private static readonly Color DesktopBG = Color.FromArgb(0x00, 0x00, 0x00); private static readonly Font SysFont = new Font("Tahoma", 9F); private static readonly Font SysFont2 = new Font("Tahoma", 10F, FontStyle.Bold); - private static readonly Font Header1 = new Font("Helvetica", 20F, FontStyle.Bold); - private static readonly Font Header2 = new Font("Helvetica", 17.5F, FontStyle.Bold); - private static readonly Font Header3 = new Font("Tahoma", 15F, FontStyle.Bold); + private static readonly Font Header1 = new Font("Courier New", 20F, FontStyle.Bold); + private static readonly Font Header2 = new Font("Courier New", 17.5F, FontStyle.Bold); + private static readonly Font Header3 = new Font("Courier New", 15F, FontStyle.Bold); - private static readonly Color TitleBG = Color.FromArgb(0x11, 0x11, 0x11); + private static readonly Color TitleBG = Color.FromArgb(0x55, 0x11, 0x11); private static readonly Color TitleFG = Color.FromArgb(0xaa, 0xaa, 0xaa); //Todo: When making Shifter GUI we need to label all these with proper Shifter attributes to get 'em displaying in the right places. -- cgit v1.2.3 From 324104eb0b8650969b2205404e3ad83401fb100e Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 31 May 2017 19:23:40 -0400 Subject: volume control slider and other goodies --- ShiftOS.WinForms/Controls/ShiftedProgressBar.cs | 88 ++++++++------- ShiftOS.WinForms/Properties/Resources.Designer.cs | 16 ++- ShiftOS.WinForms/Properties/Resources.resx | 3 + ShiftOS.WinForms/Resources/iconSpeaker.bmp | Bin 0 -> 3382 bytes ShiftOS.WinForms/ShiftOS.WinForms.csproj | 19 ++++ .../StatusIcons/ShiftnetStatus.Designer.cs | 90 ++++++++++++++++ ShiftOS.WinForms/StatusIcons/ShiftnetStatus.cs | 33 ++++++ ShiftOS.WinForms/StatusIcons/ShiftnetStatus.resx | 120 +++++++++++++++++++++ ShiftOS.WinForms/StatusIcons/Volume.Designer.cs | 59 ++++++++++ ShiftOS.WinForms/StatusIcons/Volume.cs | 67 ++++++++++++ ShiftOS.WinForms/StatusIcons/Volume.resx | 120 +++++++++++++++++++++ ShiftOS.WinForms/Tools/ControlManager.cs | 15 ++- ShiftOS.WinForms/WinformsDesktop.Designer.cs | 29 ++--- ShiftOS.WinForms/WinformsDesktop.cs | 32 +++--- ShiftOS.WinForms/WinformsDesktop.resx | 3 - 15 files changed, 617 insertions(+), 77 deletions(-) create mode 100644 ShiftOS.WinForms/Resources/iconSpeaker.bmp create mode 100644 ShiftOS.WinForms/StatusIcons/ShiftnetStatus.Designer.cs create mode 100644 ShiftOS.WinForms/StatusIcons/ShiftnetStatus.cs create mode 100644 ShiftOS.WinForms/StatusIcons/ShiftnetStatus.resx create mode 100644 ShiftOS.WinForms/StatusIcons/Volume.Designer.cs create mode 100644 ShiftOS.WinForms/StatusIcons/Volume.cs create mode 100644 ShiftOS.WinForms/StatusIcons/Volume.resx (limited to 'ShiftOS.WinForms/ShiftOS.WinForms.csproj') diff --git a/ShiftOS.WinForms/Controls/ShiftedProgressBar.cs b/ShiftOS.WinForms/Controls/ShiftedProgressBar.cs index ceaff02..c5a6d05 100644 --- a/ShiftOS.WinForms/Controls/ShiftedProgressBar.cs +++ b/ShiftOS.WinForms/Controls/ShiftedProgressBar.cs @@ -140,51 +140,65 @@ namespace ShiftOS.WinForms.Controls protected override void OnPaint(PaintEventArgs pe) { - pe.Graphics.Clear(this.RealBackColor); - if(RealBackgroundImage != null) + try { - pe.Graphics.FillRectangle(new TextureBrush(RealBackgroundImage), new Rectangle(0, 0, this.Width, this.Height)); - } - switch (Style) - { - case ProgressBarStyle.Continuous: - double width = linear(this.Value, 0, this.Maximum, 0, this.Width); - if (ProgressImage != null) - { - pe.Graphics.FillRectangle(new TextureBrush(ProgressImage), new RectangleF(0, 0, (float)width, this.Height)); - } - else - { - pe.Graphics.FillRectangle(new SolidBrush(ProgressColor), new RectangleF(0, 0, (float)width, this.Height)); - } - break; - case ProgressBarStyle.Blocks: - int block_count = this.Width / (this.BlockSize + 2); - int blocks = (int)linear(this.Value, 0, this.Maximum, 0, block_count); - for(int i = 0; i < blocks - 1; i++) - { - int position = i * (BlockSize + 2); + pe.Graphics.Clear(this.RealBackColor); + if (RealBackgroundImage != null) + { + pe.Graphics.FillRectangle(new TextureBrush(RealBackgroundImage), new Rectangle(0, 0, this.Width, this.Height)); + } + switch (Style) + { + case ProgressBarStyle.Continuous: + double width = linear(this.Value, 0, this.Maximum, 0, this.Width); if (ProgressImage != null) { - pe.Graphics.FillRectangle(new TextureBrush(ProgressImage), new Rectangle(position, 0, BlockSize, this.Height)); + pe.Graphics.FillRectangle(new TextureBrush(ProgressImage), new RectangleF(0, 0, (float)width, this.Height)); + } + else + { + pe.Graphics.FillRectangle(new SolidBrush(ProgressColor), new RectangleF(0, 0, (float)width, this.Height)); + } + break; + case ProgressBarStyle.Blocks: + int block_count = this.Width / (this.BlockSize + 2); + int blocks = (int)linear(this.Value, 0, this.Maximum, 0, block_count); + for (int i = 0; i < blocks - 1; i++) + { + int position = i * (BlockSize + 2); + if (ProgressImage != null) + { + pe.Graphics.FillRectangle(new TextureBrush(ProgressImage), new Rectangle(position, 0, BlockSize, this.Height)); + } + else + { + pe.Graphics.FillRectangle(new SolidBrush(ProgressColor), new Rectangle(position, 0, BlockSize, this.Height)); + } + } + break; + case ProgressBarStyle.Marquee: + if (ProgressImage != null) + { + pe.Graphics.FillRectangle(new TextureBrush(ProgressImage), new Rectangle(_marqueePos, 0, this.Width / 4, this.Height)); } else { - pe.Graphics.FillRectangle(new SolidBrush(ProgressColor), new Rectangle(position, 0, BlockSize, this.Height)); + pe.Graphics.FillRectangle(new SolidBrush(ProgressColor), new Rectangle(_marqueePos, 0, this.Width / 4, this.Height)); } - } - break; - case ProgressBarStyle.Marquee: - if (ProgressImage != null) - { - pe.Graphics.FillRectangle(new TextureBrush(ProgressImage), new Rectangle(_marqueePos, 0, this.Width / 4, this.Height)); - } - else - { - pe.Graphics.FillRectangle(new SolidBrush(ProgressColor), new Rectangle(_marqueePos, 0, this.Width / 4, this.Height)); - } - break; + break; + } + } + catch + { + pe.Graphics.Clear(Color.Black); + string text = "Preview mode. This control can't be drawn without an initiated ShiftOS engine."; + SizeF sz = pe.Graphics.MeasureString(text, this.Font); + PointF loc = new PointF( + (this.Width - sz.Width) / 2, + (this.Height - sz.Height) / 2 + ); + pe.Graphics.DrawString(text, Font, new SolidBrush(Color.White), loc); } } diff --git a/ShiftOS.WinForms/Properties/Resources.Designer.cs b/ShiftOS.WinForms/Properties/Resources.Designer.cs index 3e83c3f..0386237 100644 --- a/ShiftOS.WinForms/Properties/Resources.Designer.cs +++ b/ShiftOS.WinForms/Properties/Resources.Designer.cs @@ -947,6 +947,16 @@ namespace ShiftOS.WinForms.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap iconSpeaker { + get { + object obj = ResourceManager.GetObject("iconSpeaker", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -1103,9 +1113,9 @@ namespace ShiftOS.WinForms.Properties { /// Category: "Enhancements", /// }, /// { - /// Name: "GUI Based Login Screen", - /// Cost: 500, - /// Description: "Tired of using the text-based login screen in ShiftOS? Well, we have a functioning window manager, and a functioning desktop, w [rest of string was truncated]";. + /// Name: "Shift Progress Bar", + /// Cost: 150, + /// Description: "Want to customize the look of all ShiftOS Progress Bars? Buy this upgrade today and you'll get the ability to set the foreground an [rest of string was truncated]";. /// internal static string Shiftorium { get { diff --git a/ShiftOS.WinForms/Properties/Resources.resx b/ShiftOS.WinForms/Properties/Resources.resx index 1db7a46..d1a3544 100644 --- a/ShiftOS.WinForms/Properties/Resources.resx +++ b/ShiftOS.WinForms/Properties/Resources.resx @@ -34603,4 +34603,7 @@ ..\Resources\notestate_connection_full.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\iconSpeaker.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/ShiftOS.WinForms/Resources/iconSpeaker.bmp b/ShiftOS.WinForms/Resources/iconSpeaker.bmp new file mode 100644 index 0000000..ec2defb Binary files /dev/null and b/ShiftOS.WinForms/Resources/iconSpeaker.bmp differ diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj index 65a512e..fd875e9 100644 --- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj +++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj @@ -403,6 +403,18 @@ + + UserControl + + + ShiftnetStatus.cs + + + UserControl + + + Volume.cs + @@ -601,6 +613,12 @@ ShiftSoft_Ping.cs + + ShiftnetStatus.cs + + + Volume.cs + UniteLoginDialog.cs @@ -827,6 +845,7 @@ + diff --git a/ShiftOS.WinForms/StatusIcons/ShiftnetStatus.Designer.cs b/ShiftOS.WinForms/StatusIcons/ShiftnetStatus.Designer.cs new file mode 100644 index 0000000..65aed28 --- /dev/null +++ b/ShiftOS.WinForms/StatusIcons/ShiftnetStatus.Designer.cs @@ -0,0 +1,90 @@ +namespace ShiftOS.WinForms.StatusIcons +{ + partial class ShiftnetStatus + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.lbserviceprovider = new System.Windows.Forms.Label(); + this.lbstatus = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Dock = System.Windows.Forms.DockStyle.Top; + this.label1.Location = new System.Drawing.Point(0, 0); + this.label1.Name = "label1"; + this.label1.Padding = new System.Windows.Forms.Padding(5); + this.label1.Size = new System.Drawing.Size(53, 23); + this.label1.TabIndex = 0; + this.label1.Tag = "header2"; + this.label1.Text = "Shiftnet"; + // + // lbserviceprovider + // + this.lbserviceprovider.AutoSize = true; + this.lbserviceprovider.Dock = System.Windows.Forms.DockStyle.Top; + this.lbserviceprovider.Location = new System.Drawing.Point(0, 23); + this.lbserviceprovider.Name = "lbserviceprovider"; + this.lbserviceprovider.Padding = new System.Windows.Forms.Padding(5); + this.lbserviceprovider.Size = new System.Drawing.Size(98, 23); + this.lbserviceprovider.TabIndex = 1; + this.lbserviceprovider.Tag = "header3"; + this.lbserviceprovider.Text = "Freebie Solutions"; + // + // lbstatus + // + this.lbstatus.Dock = System.Windows.Forms.DockStyle.Fill; + this.lbstatus.Location = new System.Drawing.Point(0, 46); + this.lbstatus.Name = "lbstatus"; + this.lbstatus.Padding = new System.Windows.Forms.Padding(5); + this.lbstatus.Size = new System.Drawing.Size(331, 144); + this.lbstatus.TabIndex = 2; + this.lbstatus.Text = "This will show the Shiftnet status."; + // + // ShiftnetStatus + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.lbstatus); + this.Controls.Add(this.lbserviceprovider); + this.Controls.Add(this.label1); + this.Name = "ShiftnetStatus"; + this.Size = new System.Drawing.Size(331, 190); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label lbserviceprovider; + private System.Windows.Forms.Label lbstatus; + } +} diff --git a/ShiftOS.WinForms/StatusIcons/ShiftnetStatus.cs b/ShiftOS.WinForms/StatusIcons/ShiftnetStatus.cs new file mode 100644 index 0000000..f1d31af --- /dev/null +++ b/ShiftOS.WinForms/StatusIcons/ShiftnetStatus.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using ShiftOS.Engine; + +namespace ShiftOS.WinForms.StatusIcons +{ + [DefaultIcon("iconShiftnet")] + [RequiresUpgrade("victortran_shiftnet")] + public partial class ShiftnetStatus : UserControl, IStatusIcon + { + public ShiftnetStatus() + { + InitializeComponent(); + } + + public void Setup() + { + var subscription = Applications.DownloadManager.GetAllSubscriptions()[SaveSystem.CurrentSave.ShiftnetSubscription]; + float kilobytes = (float)subscription.DownloadSpeed / 1024F; + lbserviceprovider.Text = subscription.Name; + lbstatus.Text = $@"Company: {subscription.Company} +Download speed (KB/s): {kilobytes}"; + + } + } +} diff --git a/ShiftOS.WinForms/StatusIcons/ShiftnetStatus.resx b/ShiftOS.WinForms/StatusIcons/ShiftnetStatus.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.WinForms/StatusIcons/ShiftnetStatus.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ShiftOS.WinForms/StatusIcons/Volume.Designer.cs b/ShiftOS.WinForms/StatusIcons/Volume.Designer.cs new file mode 100644 index 0000000..aa8aa7a --- /dev/null +++ b/ShiftOS.WinForms/StatusIcons/Volume.Designer.cs @@ -0,0 +1,59 @@ +namespace ShiftOS.WinForms.StatusIcons +{ + partial class Volume + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.lbvolume = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // lbvolume + // + this.lbvolume.AutoSize = true; + this.lbvolume.Location = new System.Drawing.Point(4, 4); + this.lbvolume.Name = "lbvolume"; + this.lbvolume.Size = new System.Drawing.Size(81, 13); + this.lbvolume.TabIndex = 0; + this.lbvolume.Text = "System volume:"; + // + // Volume + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.lbvolume); + this.Name = "Volume"; + this.Size = new System.Drawing.Size(444, 44); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label lbvolume; + } +} diff --git a/ShiftOS.WinForms/StatusIcons/Volume.cs b/ShiftOS.WinForms/StatusIcons/Volume.cs new file mode 100644 index 0000000..329faf0 --- /dev/null +++ b/ShiftOS.WinForms/StatusIcons/Volume.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using ShiftOS.Engine; +using ShiftOS.WinForms.Controls; + +namespace ShiftOS.WinForms.StatusIcons +{ + [DefaultIcon("iconSpeaker")] + public partial class Volume : UserControl, IStatusIcon + { + public Volume() + { + InitializeComponent(); + } + + public void Setup() + { + lbvolume.Top = (this.Height - lbvolume.Height) / 2; + bool moving = false; + var prg = new ShiftedProgressBar(); + prg.Tag = "ignoreal"; //Don't close AL or current widget when this control is clicked. + this.Controls.Add(prg); + prg.Height = this.Height / 3; + prg.Maximum = 100; + prg.Value = SaveSystem.CurrentSave.MusicVolume; + prg.Width = this.Width - lbvolume.Width - 50; + prg.Left = lbvolume.Left + lbvolume.Width + 15; + prg.Top = (this.Height - prg.Height) / 2; + prg.MouseDown += (o, a) => + { + moving = true; + }; + + prg.MouseMove += (o, a) => + { + if (moving) + { + int val = (int)linear(a.X, 0, prg.Width, 0, 100); + SaveSystem.CurrentSave.MusicVolume = val; + prg.Value = val; + } + }; + + prg.MouseUp += (o, a) => + { + moving = false; + }; + prg.Show(); + } + + static public double linear(double x, double x0, double x1, double y0, double y1) + { + if ((x1 - x0) == 0) + { + return (y0 + y1) / 2; + } + return y0 + (x - x0) * (y1 - y0) / (x1 - x0); + } + } +} diff --git a/ShiftOS.WinForms/StatusIcons/Volume.resx b/ShiftOS.WinForms/StatusIcons/Volume.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.WinForms/StatusIcons/Volume.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ShiftOS.WinForms/Tools/ControlManager.cs b/ShiftOS.WinForms/Tools/ControlManager.cs index 92482fa..548a62a 100644 --- a/ShiftOS.WinForms/Tools/ControlManager.cs +++ b/ShiftOS.WinForms/Tools/ControlManager.cs @@ -158,6 +158,15 @@ namespace ShiftOS.WinForms.Tools } catch { } + if (!tag.Contains("ignoreal")) + { + ctrl.Click += (o, a) => + { + Desktop.HideAppLauncher(); + }; + + } + if (!tag.Contains("keepbg")) { if (ctrl.BackColor != Control.DefaultBackColor) @@ -279,6 +288,8 @@ namespace ShiftOS.WinForms.Tools { (ctrl as WindowBorder).Setup(); } + + MakeDoubleBuffered(ctrl); ControlSetup?.Invoke(ctrl); }); @@ -305,10 +316,6 @@ namespace ShiftOS.WinForms.Tools public static void SetupControls(Control frm, bool runInThread = true) { - frm.Click += (o, a) => - { - Desktop.HideAppLauncher(); - }; var ctrls = frm.Controls.ToList(); for (int i = 0; i < ctrls.Count(); i++) { diff --git a/ShiftOS.WinForms/WinformsDesktop.Designer.cs b/ShiftOS.WinForms/WinformsDesktop.Designer.cs index 968a31c..d82bc0c 100644 --- a/ShiftOS.WinForms/WinformsDesktop.Designer.cs +++ b/ShiftOS.WinForms/WinformsDesktop.Designer.cs @@ -55,6 +55,7 @@ namespace ShiftOS.WinForms this.desktoppanel = new System.Windows.Forms.Panel(); this.pnlnotifications = new System.Windows.Forms.Panel(); this.flnotifications = new System.Windows.Forms.FlowLayoutPanel(); + this.ntconnectionstatus = new System.Windows.Forms.PictureBox(); this.lbtime = new System.Windows.Forms.Label(); this.panelbuttonholder = new System.Windows.Forms.FlowLayoutPanel(); this.sysmenuholder = new System.Windows.Forms.Panel(); @@ -63,7 +64,6 @@ namespace ShiftOS.WinForms this.pnlscreensaver = new System.Windows.Forms.Panel(); this.pnlssicon = new System.Windows.Forms.Panel(); this.pnlwidgetlayer = new System.Windows.Forms.Panel(); - this.ntconnectionstatus = new System.Windows.Forms.PictureBox(); this.pnlnotificationbox = new System.Windows.Forms.Panel(); this.lbnotemsg = new System.Windows.Forms.Label(); this.lbnotetitle = new System.Windows.Forms.Label(); @@ -77,10 +77,10 @@ namespace ShiftOS.WinForms this.desktoppanel.SuspendLayout(); this.pnlnotifications.SuspendLayout(); this.flnotifications.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.ntconnectionstatus)).BeginInit(); this.sysmenuholder.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.pnlscreensaver.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.ntconnectionstatus)).BeginInit(); this.pnlnotificationbox.SuspendLayout(); this.pnladvancedal.SuspendLayout(); this.pnlalsystemactions.SuspendLayout(); @@ -121,6 +121,18 @@ namespace ShiftOS.WinForms this.flnotifications.Name = "flnotifications"; this.flnotifications.Size = new System.Drawing.Size(22, 24); this.flnotifications.TabIndex = 1; + this.flnotifications.WrapContents = false; + // + // ntconnectionstatus + // + this.ntconnectionstatus.Image = global::ShiftOS.WinForms.Properties.Resources.notestate_connection_full; + this.ntconnectionstatus.Location = new System.Drawing.Point(3, 3); + this.ntconnectionstatus.Name = "ntconnectionstatus"; + this.ntconnectionstatus.Size = new System.Drawing.Size(16, 16); + this.ntconnectionstatus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.ntconnectionstatus.TabIndex = 0; + this.ntconnectionstatus.TabStop = false; + this.ntconnectionstatus.Tag = "digitalsociety"; // // lbtime // @@ -200,17 +212,6 @@ namespace ShiftOS.WinForms this.pnlwidgetlayer.Size = new System.Drawing.Size(1296, 714); this.pnlwidgetlayer.TabIndex = 1; // - // ntconnectionstatus - // - this.ntconnectionstatus.Image = global::ShiftOS.WinForms.Properties.Resources.notestate_connection_full; - this.ntconnectionstatus.Location = new System.Drawing.Point(3, 3); - this.ntconnectionstatus.Name = "ntconnectionstatus"; - this.ntconnectionstatus.Size = new System.Drawing.Size(16, 16); - this.ntconnectionstatus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.ntconnectionstatus.TabIndex = 0; - this.ntconnectionstatus.TabStop = false; - this.ntconnectionstatus.Tag = "digitalsociety"; - // // pnlnotificationbox // this.pnlnotificationbox.AutoSize = true; @@ -341,12 +342,12 @@ namespace ShiftOS.WinForms this.pnlnotifications.PerformLayout(); this.flnotifications.ResumeLayout(false); this.flnotifications.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.ntconnectionstatus)).EndInit(); this.sysmenuholder.ResumeLayout(false); this.sysmenuholder.PerformLayout(); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.pnlscreensaver.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.ntconnectionstatus)).EndInit(); this.pnlnotificationbox.ResumeLayout(false); this.pnlnotificationbox.PerformLayout(); this.pnladvancedal.ResumeLayout(false); diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs index b9c4f37..f1dbe48 100644 --- a/ShiftOS.WinForms/WinformsDesktop.cs +++ b/ShiftOS.WinForms/WinformsDesktop.cs @@ -85,27 +85,24 @@ namespace ShiftOS.WinForms ic.Tag = itype.Name.ToLower(); //Next get the icon data if any. - var iconattrib = itype.GetCustomAttributes(false).FirstOrDefault(x => x is DefaultIconAttribute) as DefaultIconAttribute; - if(iconattrib != null) - { //We can use this attribute's ID in the skin engine to get an icon. - var img = GetIcon(iconattrib.ID); + var img = GetIcon(itype.Name); //Make it transparent. - (img as Bitmap).MakeTransparent(LoadedSkin.SystemKey); + (img as Bitmap).MakeTransparent(Color.White); //Assign it to the control ic.Image = img; //Set the sizing mode ic.SizeMode = PictureBoxSizeMode.StretchImage; - } - else - { - ic.BackColor = Color.White; //TODO: Make it skinnable. - } - ic.Size = new Size(20, 20); //TODO: make it skinnable + ic.Size = new Size(16, 16); //TODO: make it skinnable //add to the notification tray flnotifications.Controls.Add(ic); ic.Show(); + ic.BringToFront(); + + flnotifications.Show(); + + ic.Click += (o, a) => { HideAppLauncher(); @@ -115,7 +112,14 @@ namespace ShiftOS.WinForms UserControl ctrl = (UserControl)Activator.CreateInstance(itype); (ctrl as IStatusIcon).Setup(); currentSettingsPane = ctrl; - if(LoadedSkin.DesktopPanelPosition == 0) + ControlManager.SetupControls(ctrl); + this.Controls.Add(ctrl); + ctrl.BringToFront(); + int left = ic.Parent.PointToScreen(ic.Location).X; + int realleft = left - ctrl.Width; + realleft += ic.Width; + ctrl.Left = realleft; + if (LoadedSkin.DesktopPanelPosition == 0) { ctrl.Top = desktoppanel.Height; } @@ -123,10 +127,6 @@ namespace ShiftOS.WinForms { ctrl.Top = this.Height - desktoppanel.Height - ctrl.Height; } - int noteleft = flnotifications.PointToScreen(ic.Location).X; - int realleft = (this.Width - (noteleft + ic.Width)) - ctrl.Width; - ctrl.Left = realleft; - ControlManager.SetupControls(ctrl); ctrl.Show(); } diff --git a/ShiftOS.WinForms/WinformsDesktop.resx b/ShiftOS.WinForms/WinformsDesktop.resx index b77504b..d5494e3 100644 --- a/ShiftOS.WinForms/WinformsDesktop.resx +++ b/ShiftOS.WinForms/WinformsDesktop.resx @@ -120,7 +120,4 @@ 17, 17 - - 17, 17 - \ No newline at end of file -- cgit v1.2.3 From 03cf891c53cc648bb1ed4ea3d78755c1a440a713 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 1 Jun 2017 17:09:22 -0400 Subject: Icon Manager and various icon bugfixes. --- .../Applications/IconManager.Designer.cs | 163 ++++++++++++++ ShiftOS.WinForms/Applications/IconManager.cs | 244 +++++++++++++++++++++ ShiftOS.WinForms/Applications/IconManager.resx | 120 ++++++++++ ShiftOS.WinForms/Resources/Shiftorium.txt | 14 ++ ShiftOS.WinForms/ShiftOS.WinForms.csproj | 18 ++ .../StatusIcons/TestStatus.Designer.cs | 60 +++++ ShiftOS.WinForms/StatusIcons/TestStatus.cs | 26 +++ ShiftOS.WinForms/StatusIcons/TestStatus.resx | 120 ++++++++++ ShiftOS_TheReturn/Skinning.cs | 10 +- 9 files changed, 774 insertions(+), 1 deletion(-) create mode 100644 ShiftOS.WinForms/Applications/IconManager.Designer.cs create mode 100644 ShiftOS.WinForms/Applications/IconManager.cs create mode 100644 ShiftOS.WinForms/Applications/IconManager.resx create mode 100644 ShiftOS.WinForms/StatusIcons/TestStatus.Designer.cs create mode 100644 ShiftOS.WinForms/StatusIcons/TestStatus.cs create mode 100644 ShiftOS.WinForms/StatusIcons/TestStatus.resx (limited to 'ShiftOS.WinForms/ShiftOS.WinForms.csproj') diff --git a/ShiftOS.WinForms/Applications/IconManager.Designer.cs b/ShiftOS.WinForms/Applications/IconManager.Designer.cs new file mode 100644 index 0000000..25bcee4 --- /dev/null +++ b/ShiftOS.WinForms/Applications/IconManager.Designer.cs @@ -0,0 +1,163 @@ +namespace ShiftOS.WinForms.Applications +{ + partial class IconManager + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.btnclose = new System.Windows.Forms.Button(); + this.btnreset = new System.Windows.Forms.Button(); + this.btnapply = new System.Windows.Forms.Button(); + this.flbody = new System.Windows.Forms.FlowLayoutPanel(); + this.lbcurrentpage = new System.Windows.Forms.Label(); + this.btnprev = new System.Windows.Forms.Button(); + this.btnnext = new System.Windows.Forms.Button(); + this.flowLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.AutoSize = true; + this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.flowLayoutPanel1.Controls.Add(this.btnclose); + this.flowLayoutPanel1.Controls.Add(this.btnreset); + this.flowLayoutPanel1.Controls.Add(this.btnapply); + this.flowLayoutPanel1.Controls.Add(this.lbcurrentpage); + this.flowLayoutPanel1.Controls.Add(this.btnprev); + this.flowLayoutPanel1.Controls.Add(this.btnnext); + this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 416); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(393, 29); + this.flowLayoutPanel1.TabIndex = 0; + // + // btnclose + // + this.btnclose.AutoSize = true; + this.btnclose.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnclose.Location = new System.Drawing.Point(3, 3); + this.btnclose.Name = "btnclose"; + this.btnclose.Size = new System.Drawing.Size(43, 23); + this.btnclose.TabIndex = 0; + this.btnclose.Text = "Close"; + this.btnclose.UseVisualStyleBackColor = true; + this.btnclose.Click += new System.EventHandler(this.btnclose_Click); + // + // btnreset + // + this.btnreset.AutoSize = true; + this.btnreset.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnreset.Location = new System.Drawing.Point(52, 3); + this.btnreset.Name = "btnreset"; + this.btnreset.Size = new System.Drawing.Size(45, 23); + this.btnreset.TabIndex = 1; + this.btnreset.Text = "Reset"; + this.btnreset.UseVisualStyleBackColor = true; + this.btnreset.Click += new System.EventHandler(this.btnreset_Click); + // + // btnapply + // + this.btnapply.AutoSize = true; + this.btnapply.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnapply.Location = new System.Drawing.Point(103, 3); + this.btnapply.Name = "btnapply"; + this.btnapply.Size = new System.Drawing.Size(43, 23); + this.btnapply.TabIndex = 2; + this.btnapply.Text = "Apply"; + this.btnapply.UseVisualStyleBackColor = true; + this.btnapply.Click += new System.EventHandler(this.btnapply_Click); + // + // flbody + // + this.flbody.Dock = System.Windows.Forms.DockStyle.Fill; + this.flbody.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flbody.Location = new System.Drawing.Point(0, 0); + this.flbody.Name = "flbody"; + this.flbody.Size = new System.Drawing.Size(393, 416); + this.flbody.TabIndex = 1; + this.flbody.WrapContents = false; + // + // lbcurrentpage + // + this.lbcurrentpage.AutoSize = true; + this.lbcurrentpage.Location = new System.Drawing.Point(152, 0); + this.lbcurrentpage.Name = "lbcurrentpage"; + this.lbcurrentpage.Size = new System.Drawing.Size(71, 13); + this.lbcurrentpage.TabIndex = 3; + this.lbcurrentpage.Text = "Current page:"; + // + // btnprev + // + this.btnprev.AutoSize = true; + this.btnprev.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnprev.Location = new System.Drawing.Point(229, 3); + this.btnprev.Name = "btnprev"; + this.btnprev.Size = new System.Drawing.Size(51, 23); + this.btnprev.TabIndex = 4; + this.btnprev.Text = " < Prev"; + this.btnprev.UseVisualStyleBackColor = true; + this.btnprev.Click += new System.EventHandler(this.btnprev_Click); + // + // btnnext + // + this.btnnext.AutoSize = true; + this.btnnext.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnnext.Location = new System.Drawing.Point(286, 3); + this.btnnext.Name = "btnnext"; + this.btnnext.Size = new System.Drawing.Size(48, 23); + this.btnnext.TabIndex = 5; + this.btnnext.Text = "Next >"; + this.btnnext.UseVisualStyleBackColor = true; + this.btnnext.Click += new System.EventHandler(this.btnnext_Click); + // + // IconManager + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.flbody); + this.Controls.Add(this.flowLayoutPanel1); + this.Name = "IconManager"; + this.Size = new System.Drawing.Size(393, 445); + this.flowLayoutPanel1.ResumeLayout(false); + this.flowLayoutPanel1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.Button btnclose; + private System.Windows.Forms.Button btnreset; + private System.Windows.Forms.Button btnapply; + private System.Windows.Forms.FlowLayoutPanel flbody; + private System.Windows.Forms.Label lbcurrentpage; + private System.Windows.Forms.Button btnprev; + private System.Windows.Forms.Button btnnext; + } +} diff --git a/ShiftOS.WinForms/Applications/IconManager.cs b/ShiftOS.WinForms/Applications/IconManager.cs new file mode 100644 index 0000000..0c6e119 --- /dev/null +++ b/ShiftOS.WinForms/Applications/IconManager.cs @@ -0,0 +1,244 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using ShiftOS.Engine; +using System.Reflection; +using ShiftOS.WinForms.Tools; +using Newtonsoft.Json; + +namespace ShiftOS.WinForms.Applications +{ + [RequiresUpgrade("icon_manager")] + [Launcher("Icon Manager", true, "al_icon_manager", "Customization")] + [DefaultTitle("Icon Manager")] + [DefaultIcon("iconIconManager")] + public partial class IconManager : UserControl, IShiftOSWindow + { + public IconManager() + { + InitializeComponent(); + } + + public void OnLoad() + { + LoadIconsFromEngine(); + SetupUI(); + } + + public void OnSkinLoad() + { + LoadIconsFromEngine(); + SetupUI(); + } + + public bool OnUnload() + { + Icons = null; + return true; + } + + private Dictionary Icons = null; + + private const int pageSize = 10; + private int currentPage = 0; + private int pageCount = 0; + + public Image GetIcon(string id) + { + if (!Icons.ContainsKey(id)) + Icons.Add(id, null); + + if (Icons[id] == null) + { + var img = SkinEngine.GetDefaultIcon(id); + using (var mstr = new System.IO.MemoryStream()) + { + img.Save(mstr, System.Drawing.Imaging.ImageFormat.Png); + Icons[id] = mstr.ToArray(); + } + return img; + } + else + { + using (var sr = new System.IO.MemoryStream(Icons[id])) + { + return Image.FromStream(sr); + } + } + } + + public void SetIcon(string key, byte[] raw) + { + if (!Icons.ContainsKey(key)) + Icons.Add(key, raw); + Icons[key] = raw; + } + + public void LoadIconsFromEngine() + { + //We have to serialize the engine icon list to JSON to break references with the data. + string json = JsonConvert.SerializeObject(SkinEngine.LoadedSkin.AppIcons); + //And deserialize to the local instance...essentially making a clone. + Icons = JsonConvert.DeserializeObject>(json); + } + + public void SetupUI() + { + flbody.Controls.Clear(); //Clear the icon list. + + List types = new List(); + + foreach(var exe in System.IO.Directory.GetFiles(Environment.CurrentDirectory)) + { + if(exe.ToLower().EndsWith(".exe") || exe.ToLower().EndsWith(".dll")) + { + try + { + var asm = Assembly.LoadFile(exe); + + var typeList = asm.GetTypes().Where(x => x.GetCustomAttributes(false).FirstOrDefault(y => y is DefaultIconAttribute) != null); + types.AddRange(typeList); + + } + catch { } + } + } + + pageCount = types.ToArray().GetPageCount(pageSize); + + foreach (var type in types.ToArray().GetItemsOnPage(currentPage, pageSize)) + { + if (Shiftorium.UpgradeAttributesUnlocked(type)) + { + var pnl = new Panel(); + pnl.Height = 30; + pnl.Width = flbody.Width - 15; + flbody.Controls.Add(pnl); + pnl.Show(); + var pic = new PictureBox(); + pic.SizeMode = PictureBoxSizeMode.StretchImage; + pic.Size = new Size(24, 24); + pic.Image = GetIcon(type.Name); + pnl.Controls.Add(pic); + pic.Left = 5; + pic.Top = (pnl.Height - pic.Height) / 2; + pic.Show(); + var lbl = new Label(); + lbl.Tag = "header3"; + lbl.AutoSize = true; + lbl.Text = NameChangerBackend.GetNameRaw(type); + ControlManager.SetupControl(lbl); + pnl.Controls.Add(lbl); + lbl.CenterParent(); + lbl.Show(); + var btn = new Button(); + btn.Text = "Change..."; + btn.AutoSize = true; + btn.AutoSizeMode = AutoSizeMode.GrowAndShrink; + pnl.Controls.Add(btn); + btn.Left = (pnl.Width - btn.Width) - 5; + btn.Top = (pnl.Height - btn.Height) / 2; + btn.Click += (o, a) => + { + var gfp = new GraphicPicker(pic.Image, lbl.Text + " icon", ImageLayout.Stretch, (raw, img, layout) => + { + pic.Image = img; + SetIcon(type.Name, raw); + }); + AppearanceManager.SetupDialog(gfp); + }; + btn.Show(); + ControlManager.SetupControls(pnl); + } + } + + btnnext.Visible = (currentPage < pageCount - 1); + btnprev.Visible = (currentPage > 0); + + lbcurrentpage.Text = "Page " + (currentPage + 1).ToString() + " of " + pageCount.ToString(); + } + + public void OnUpgrade() + { + LoadIconsFromEngine(); + SetupUI(); + } + + private void btnprev_Click(object sender, EventArgs e) + { + currentPage--; + SetupUI(); + } + + public void ResetToDefaults() + { + currentPage = 0; + foreach (var key in Icons.Keys) + { + var img = SkinEngine.GetDefaultIcon(key); + using(var ms = new System.IO.MemoryStream()) + { + img.Save(ms, System.Drawing.Imaging.ImageFormat.Png); + Icons[key] = ms.ToArray(); + } + } + SetupUI(); + } + + private void btnnext_Click(object sender, EventArgs e) + { + currentPage++; + SetupUI(); + } + + private void btnclose_Click(object sender, EventArgs e) + { + AppearanceManager.Close(this); + } + + private void btnreset_Click(object sender, EventArgs e) + { + ResetToDefaults(); + } + + private void btnapply_Click(object sender, EventArgs e) + { + SkinEngine.LoadedSkin.AppIcons = Icons; + SkinEngine.SaveSkin(); + SkinEngine.LoadSkin(); + Infobox.Show("Icons applied!", "The new icons have been applied to ShiftOS successfully!"); + } + } + + public static class PaginationExtensions + { + public static int GetPageCount(this IEnumerable collection, int pageSize) + { + return (collection.Count() + pageSize - 1) / pageSize; + } + + public static T[] GetItemsOnPage(this T[] collection, int page, int pageSize) + { + List obj = new List(); + + for (int i = pageSize * page; i <= pageSize + (pageSize * page) && i < collection.Count(); i++) + { + try + { + obj.Add(collection[i]); + } + catch + { + } + } + return obj.ToArray(); + } + } + +} diff --git a/ShiftOS.WinForms/Applications/IconManager.resx b/ShiftOS.WinForms/Applications/IconManager.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.WinForms/Applications/IconManager.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ShiftOS.WinForms/Resources/Shiftorium.txt b/ShiftOS.WinForms/Resources/Shiftorium.txt index 0eac58e..1a6d8c2 100644 --- a/ShiftOS.WinForms/Resources/Shiftorium.txt +++ b/ShiftOS.WinForms/Resources/Shiftorium.txt @@ -7,6 +7,20 @@ Dependencies: "desktop", Category: "Enhancements", }, + { + Name: "Icon Manager", + Cost: 450, + Description: "This tool allows you to add and edit application icons within ShiftOS for the small prive of 450 Codepoints!", + Dependencies: "skinning", + Category: "Application" + }, + { + Name: "AL Icon Manager", + Costs: 150, + Description: "Add an App Launcher entry for the Icon Manager.", + Dependencies: "icon_manager;app_launcher", + Category: "Customization" + }, { Name: "Shift Progress Bar", Cost: 150, diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj index fd875e9..0a59c00 100644 --- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj +++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj @@ -70,6 +70,12 @@ About.cs + + UserControl + + + IconManager.cs + UserControl @@ -409,6 +415,12 @@ ShiftnetStatus.cs + + UserControl + + + TestStatus.cs + UserControl @@ -461,6 +473,9 @@ About.cs + + IconManager.cs + TriPresent.cs @@ -616,6 +631,9 @@ ShiftnetStatus.cs + + TestStatus.cs + Volume.cs diff --git a/ShiftOS.WinForms/StatusIcons/TestStatus.Designer.cs b/ShiftOS.WinForms/StatusIcons/TestStatus.Designer.cs new file mode 100644 index 0000000..3643d2d --- /dev/null +++ b/ShiftOS.WinForms/StatusIcons/TestStatus.Designer.cs @@ -0,0 +1,60 @@ +namespace ShiftOS.WinForms.StatusIcons +{ + partial class TestStatus + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // label1 + // + this.label1.Dock = System.Windows.Forms.DockStyle.Fill; + this.label1.Location = new System.Drawing.Point(0, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(264, 52); + this.label1.TabIndex = 0; + this.label1.Tag = "header1"; + this.label1.Text = "This is a test."; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // TestStatus + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.label1); + this.Name = "TestStatus"; + this.Size = new System.Drawing.Size(264, 52); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label label1; + } +} diff --git a/ShiftOS.WinForms/StatusIcons/TestStatus.cs b/ShiftOS.WinForms/StatusIcons/TestStatus.cs new file mode 100644 index 0000000..90baafc --- /dev/null +++ b/ShiftOS.WinForms/StatusIcons/TestStatus.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using ShiftOS.Engine; + +namespace ShiftOS.WinForms.StatusIcons +{ + [DefaultIcon("iconShiftorium")] + public partial class TestStatus : UserControl, IStatusIcon + { + public TestStatus() + { + InitializeComponent(); + } + + public void Setup() + { + } + } +} diff --git a/ShiftOS.WinForms/StatusIcons/TestStatus.resx b/ShiftOS.WinForms/StatusIcons/TestStatus.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.WinForms/StatusIcons/TestStatus.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ShiftOS_TheReturn/Skinning.cs b/ShiftOS_TheReturn/Skinning.cs index 5bd4ab1..4a073f4 100644 --- a/ShiftOS_TheReturn/Skinning.cs +++ b/ShiftOS_TheReturn/Skinning.cs @@ -287,7 +287,15 @@ namespace ShiftOS.Engine LoadedSkin.AppIcons.Add(id, null); if (LoadedSkin.AppIcons[id] == null) - return GetDefaultIcon(id); + { + var img = GetDefaultIcon(id); + using (var mstr = new MemoryStream()) + { + img.Save(mstr, System.Drawing.Imaging.ImageFormat.Png); + LoadedSkin.AppIcons[id] = mstr.ToArray(); + } + return img; + } else { using (var sr = new MemoryStream(LoadedSkin.AppIcons[id])) -- cgit v1.2.3 From cc55af0c8b4d14053bfb46ec14c3e1887d375f7d Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 3 Jun 2017 09:16:44 -0400 Subject: story objectives system --- ShiftOS.WinForms/ShiftOS.WinForms.csproj | 1 + ShiftOS.WinForms/Stories/DevXSkinningStory.cs | 99 ++++++++++++++++++++++++ ShiftOS_TheReturn/Commands.cs | 15 +++- ShiftOS_TheReturn/Story.cs | 104 +++++++++++++++++++++++++- 4 files changed, 215 insertions(+), 4 deletions(-) create mode 100644 ShiftOS.WinForms/Stories/DevXSkinningStory.cs (limited to 'ShiftOS.WinForms/ShiftOS.WinForms.csproj') diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj index 0a59c00..e1afa84 100644 --- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj +++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj @@ -427,6 +427,7 @@ Volume.cs + diff --git a/ShiftOS.WinForms/Stories/DevXSkinningStory.cs b/ShiftOS.WinForms/Stories/DevXSkinningStory.cs new file mode 100644 index 0000000..09dfd7f --- /dev/null +++ b/ShiftOS.WinForms/Stories/DevXSkinningStory.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using ShiftOS.Engine; + +namespace ShiftOS.WinForms.Stories +{ + public class DevXSkinningStory + { + [Story("devx_1000_codepoints")] + public static void DevX1000CPStory() + { + Desktop.InvokeOnWorkerThread(() => + { + var t = new Applications.Terminal(); + AppearanceManager.SetupWindow(t); + }); + TerminalBackend.InStory = true; + TerminalBackend.PrefixEnabled = false; + Thread.Sleep(3000); + Engine.AudioManager.PlayStream(Properties.Resources._3beepvirus); + Console.WriteLine("devx@anon_127420: Connection established."); + Thread.Sleep(1500); + Console.WriteLine("DevX: Hello, " + SaveSystem.CurrentUser.Username + "@" + SaveSystem.CurrentSave.SystemName + "! I see you've gotten a decent amount of Codepoints."); + Thread.Sleep(2000); + Console.WriteLine("DevX: Have you gotten a chance to install my \"Shifter\" application yet?"); + Thread.Sleep(1500); + if (!Shiftorium.UpgradeInstalled("shifter")) + { + Console.WriteLine("You: Not yet. What's it for?"); + Thread.Sleep(2000); + Console.WriteLine("DevX: The Shifter is a very effective way to make ShiftOS look however you want it to."); + Thread.Sleep(2000); + Console.WriteLine("DevX: It can even be adapted to support other applications, features and upgrades."); + Thread.Sleep(2000); + } + else + { + Console.WriteLine("You: Yeah. Just seems kinda lackluster to me. What is it supposed to do?"); + Thread.Sleep(2000); + Console.WriteLine("DevX: The Shifter is a very effective way to make ShiftOS look however you want it to."); + Thread.Sleep(2000); + Console.WriteLine("DevX: It can even be adapted to support other applications, features and upgrades."); + Thread.Sleep(2000); + Console.WriteLine("DevX: I haven't finished it just yet. Keep upgrading it and you'll notice it gets a lot better."); + Thread.Sleep(2000); + } + Console.WriteLine("DevX: I'd also recommend going for the Skin Loader, that way you can save your creations to the disk. Also, go for the Skinning upgrade - which will allow more rich customization of certain elements."); + Thread.Sleep(2000); + Console.WriteLine("You: This still ain't gonna help me get back to my old system and out of this stupid Digital Society, is it?"); + Thread.Sleep(2000); + Console.WriteLine("DevX: How the...How do you know about the Digital Societ....Who the hell talked!?"); + Thread.Sleep(2000); + Console.WriteLine("You: Whoa! Just... calm down, will ya? I heard about it in the news, shortly before I got infected by this damn virus of an operating system."); + Thread.Sleep(2000); + Console.WriteLine("DevX: Whatever. That doesn't matter yet. Just focus on upgrading ShiftOS and earning Codepoints. I'll let you know when we're done. I've gotta go...work on something else."); + Thread.Sleep(1500); + Console.WriteLine("User disconnected."); + Thread.Sleep(2000); + Console.WriteLine("You: Something doesn't seem right about DevX. I wonder what he's really up to."); + + if (Shiftorium.UpgradeInstalled("shifter")) + PushObjectives(); + else + Story.PushObjective("Buy the Shifter.", "The Shifter is a super-effective way to earn more Codepoints. It is an essential buy if you haven't already bought it. Save up for the Shifter, and buy it using shiftorium.buy{upgrade:\"shifter\"}.", () => + { + return Shiftorium.UpgradeInstalled("shifter"); + }, () => + { + PushObjectives(); + }); + Story.Context.AutoComplete = false; + TerminalBackend.InStory = false; + TerminalBackend.PrefixEnabled = false; + TerminalBackend.PrintPrompt(); + } + + public static void PushObjectives() + { + Story.PushObjective("Buy the Skinning upgrade", "The Skinning upgrade will allow you to set pictures in place of solid colors for most UI elements. If you want richer customization and more Codepoints, this upgrade is a necessity.", () => + { + return Shiftorium.UpgradeInstalled("skinning"); + }, ()=> + { + Story.PushObjective("Buy the Skin Loader.", "The Skin Loader is an application that allows you to save and load .skn files containing Shifter skin data. These files can be loaded in to the Skin Loader and applied to the system to give ShiftOS a completely different feel. It's Shiftorium upgrade ID is \"skin_loader\".", () => + { + return Shiftorium.UpgradeInstalled("skin_loader"); + }, + () => + { + Story.Context.MarkComplete(); + }); + }); + } + } +} diff --git a/ShiftOS_TheReturn/Commands.cs b/ShiftOS_TheReturn/Commands.cs index e379a50..72bccb1 100644 --- a/ShiftOS_TheReturn/Commands.cs +++ b/ShiftOS_TheReturn/Commands.cs @@ -533,11 +533,20 @@ namespace ShiftOS.Engine Codepoints: {SaveSystem.CurrentSave.Codepoints} Upgrades: {SaveSystem.CurrentSave.CountUpgrades()} installed, - {Shiftorium.GetAvailable().Length} available"; + {Shiftorium.GetAvailable().Length} available + +"; - if (Shiftorium.UpgradeInstalled("mud_control_centre")) - status += Environment.NewLine + $"Reputation: {SaveSystem.CurrentSave.RawReputation} ({SaveSystem.CurrentSave.Reputation})"; Console.WriteLine(status); + + if(Story.CurrentObjective != null) + { + Console.WriteLine("CURRENT OBJECTIVE: " + Story.CurrentObjective.Name); + Console.WriteLine("-------------------------------"); + Console.WriteLine(); + Console.WriteLine(Story.CurrentObjective.Description); + } + return true; } } diff --git a/ShiftOS_TheReturn/Story.cs b/ShiftOS_TheReturn/Story.cs index d62dae4..848c757 100644 --- a/ShiftOS_TheReturn/Story.cs +++ b/ShiftOS_TheReturn/Story.cs @@ -35,11 +35,100 @@ using Newtonsoft.Json; namespace ShiftOS.Engine { + public class StoryContext + { + public string Id { get; set; } + public MethodInfo Method { get; set; } + public bool AutoComplete = false; + + public StoryContext() + { + AutoComplete = true; + } + + public void MarkComplete() + { + SaveSystem.CurrentSave.StoriesExperienced.Add(Id); + OnComplete?.Invoke(); + } + + public event Action OnComplete; + } + + public class Objective + { + private Func _completeFunc = null; + + public string Name { get; set; } + public string Description { get; set; } + + public bool IsComplete + { + get + { + return (bool)_completeFunc?.Invoke(); + } + } + + public Objective(string name, string desc, Func completeFunc, Action onComplete) + { + _completeFunc = completeFunc; + Name = name; + Description = desc; + this.onComplete = onComplete; + } + + private Action onComplete = null; + + public void Complete() + { + onComplete?.Invoke(); + } + } + /// /// Storyline management class. /// public static class Story { + public static StoryContext Context { get; private set; } + public static event Action StoryComplete; + public static Objective CurrentObjective { get; private set; } + + public static void PushObjective(string name, string desc, Func completeFunc, Action onComplete) + { + if (CurrentObjective != null) + { + if (CurrentObjective.IsComplete == false) + { + throw new Exception("Cannot start objective - an objective is already running."); + } + else + { + CurrentObjective = null; + } + } + + CurrentObjective = new Objective(name, desc, completeFunc, onComplete); + + var t = new Thread(() => + { + var obj = CurrentObjective; + while (!obj.IsComplete) + { + Thread.Sleep(5000); + } + obj.Complete(); + CurrentObjective = null; + }); + t.IsBackground = true; + t.Start(); + + Console.WriteLine("NEW OBJECTIVE:"); + Console.WriteLine("A new objective has been added to your system. Run sos.status to find out what you need to do."); + } + + /// /// Starts the storyline with the specified Storyline ID. /// @@ -68,8 +157,21 @@ namespace ShiftOS.Engine { new Thread(() => { + Context = new Engine.StoryContext + { + Id = stid, + Method = mth, + AutoComplete = true, + }; + Context.OnComplete += () => + { + StoryComplete?.Invoke(stid); + }; mth.Invoke(null, null); - SaveSystem.CurrentSave.StoriesExperienced.Add(stid); + if (Context.AutoComplete) + { + Context.MarkComplete(); + } }).Start(); return; } -- cgit v1.2.3 From c40d071d58859e25b3781299b949b91caa0548fe Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 10 Jun 2017 10:17:10 -0400 Subject: main menu system + sandbox mode --- ShiftOS.Objects/Save.cs | 6 + ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs | 147 ++++++++++++++++ ShiftOS.WinForms/MainMenu/MainMenu.cs | 100 +++++++++++ ShiftOS.WinForms/MainMenu/MainMenu.resx | 120 +++++++++++++ ShiftOS.WinForms/Program.cs | 35 ++-- ShiftOS.WinForms/ShiftOS.WinForms.csproj | 9 + .../ShiftnetSites/ShiftSoft.Designer.cs | 188 ++++++++++++++++++++- ShiftOS.WinForms/ShiftnetSites/ShiftSoft.cs | 56 ++++++ ShiftOS.WinForms/ShiftnetSites/ShiftSoft.resx | 10 ++ ShiftOS.WinForms/Stories/LegionStory.cs | 42 ++--- ShiftOS.WinForms/WinformsDesktop.cs | 32 +++- ShiftOS_TheReturn/AppearanceManager.cs | 1 + ShiftOS_TheReturn/SaveSystem.cs | 152 ++++++++++++----- ShiftOS_TheReturn/ServerManager.cs | 18 +- ShiftOS_TheReturn/Shiftorium.cs | 3 + ShiftOS_TheReturn/Story.cs | 8 + 16 files changed, 825 insertions(+), 102 deletions(-) create mode 100644 ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs create mode 100644 ShiftOS.WinForms/MainMenu/MainMenu.cs create mode 100644 ShiftOS.WinForms/MainMenu/MainMenu.resx (limited to 'ShiftOS.WinForms/ShiftOS.WinForms.csproj') diff --git a/ShiftOS.Objects/Save.cs b/ShiftOS.Objects/Save.cs index 7891a22..6e7f167 100644 --- a/ShiftOS.Objects/Save.cs +++ b/ShiftOS.Objects/Save.cs @@ -76,10 +76,14 @@ namespace ShiftOS.Objects _setCpCallbacks.Remove(callback); } + public bool IsSandbox = false; + public ulong Codepoints { get { + if (IsSandbox == true) + return 0; if (_updTimer == null) _updTimer = new Timer((o) => syncCp(), null, 0, 300000); lock (_cpLock) @@ -89,6 +93,8 @@ namespace ShiftOS.Objects } set { + if (IsSandbox == true) + return; lock (_cpLock) { _cp = value; diff --git a/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs b/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs new file mode 100644 index 0000000..62db46d --- /dev/null +++ b/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs @@ -0,0 +1,147 @@ +namespace ShiftOS.WinForms.MainMenu +{ + partial class MainMenu + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.flmenu = new System.Windows.Forms.FlowLayoutPanel(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); + this.button5 = new System.Windows.Forms.Button(); + this.lbticker = new System.Windows.Forms.Label(); + this.flmenu.SuspendLayout(); + this.SuspendLayout(); + // + // flmenu + // + this.flmenu.AutoSize = true; + this.flmenu.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.flmenu.Controls.Add(this.button1); + this.flmenu.Controls.Add(this.button2); + this.flmenu.Controls.Add(this.button3); + this.flmenu.Controls.Add(this.button4); + this.flmenu.Controls.Add(this.button5); + this.flmenu.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flmenu.Location = new System.Drawing.Point(46, 218); + this.flmenu.Name = "flmenu"; + this.flmenu.Size = new System.Drawing.Size(187, 145); + this.flmenu.TabIndex = 0; + // + // button1 + // + this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button1.Location = new System.Drawing.Point(3, 3); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(181, 23); + this.button1.TabIndex = 0; + this.button1.Text = "Campaign"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button2.Location = new System.Drawing.Point(3, 32); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(181, 23); + this.button2.TabIndex = 1; + this.button2.Text = "Sandbox"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button3 + // + this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button3.Location = new System.Drawing.Point(3, 61); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(181, 23); + this.button3.TabIndex = 2; + this.button3.Text = "Settings"; + this.button3.UseVisualStyleBackColor = true; + // + // button4 + // + this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button4.Location = new System.Drawing.Point(3, 90); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(181, 23); + this.button4.TabIndex = 3; + this.button4.Text = "About"; + this.button4.UseVisualStyleBackColor = true; + // + // button5 + // + this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button5.Location = new System.Drawing.Point(3, 119); + this.button5.Name = "button5"; + this.button5.Size = new System.Drawing.Size(181, 23); + this.button5.TabIndex = 4; + this.button5.Text = "Exit"; + this.button5.UseVisualStyleBackColor = true; + this.button5.Click += new System.EventHandler(this.button5_Click); + // + // lbticker + // + this.lbticker.AutoSize = true; + this.lbticker.Location = new System.Drawing.Point(29, 515); + this.lbticker.Name = "lbticker"; + this.lbticker.Size = new System.Drawing.Size(93, 13); + this.lbticker.TabIndex = 1; + this.lbticker.Tag = "header3"; + this.lbticker.Text = "This is a tickerbar."; + // + // MainMenu + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Black; + this.ClientSize = new System.Drawing.Size(1161, 566); + this.Controls.Add(this.lbticker); + this.Controls.Add(this.flmenu); + this.ForeColor = System.Drawing.Color.White; + this.Name = "MainMenu"; + this.Text = "MainMenu"; + this.Load += new System.EventHandler(this.MainMenu_Load); + this.flmenu.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.FlowLayoutPanel flmenu; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.Button button5; + private System.Windows.Forms.Label lbticker; + } +} \ No newline at end of file diff --git a/ShiftOS.WinForms/MainMenu/MainMenu.cs b/ShiftOS.WinForms/MainMenu/MainMenu.cs new file mode 100644 index 0000000..20cd4ec --- /dev/null +++ b/ShiftOS.WinForms/MainMenu/MainMenu.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using ShiftOS.Engine; +using ShiftOS.WinForms.Tools; + +namespace ShiftOS.WinForms.MainMenu +{ + public partial class MainMenu : Form + { + public MainMenu(IDesktop desk) + { + InitializeComponent(); + (desk as WinformsDesktop).ParentMenu = this; + + var tickermove = new Timer(); + var tickerreset = new Timer(); + tickermove.Tick += (o, a) => + { + if(lbticker.Left <= (0 - lbticker.Width)) + { + tickermove.Stop(); + tickerreset.Start(); + } + else + { + lbticker.Top = (this.ClientSize.Height - (lbticker.Height * 2)); + lbticker.Left -= 2; + } + }; + tickerreset.Tick += (o, a) => + { + lbticker.Visible = false; + lbticker.Text = GetTickerMessage(); + lbticker.Left = this.Width; + lbticker.Visible = true; + tickerreset.Stop(); + tickermove.Start(); + }; + + tickermove.Interval = 1; + tickerreset.Interval = 1000; + + flmenu.CenterParent(); + + tickerreset.Start(); + } + + private void MainMenu_Load(object sender, EventArgs e) + { + Tools.ControlManager.SetupControls(this); + + } + + private Random rnd = new Random(); + + private string GetTickerMessage() + { + switch (rnd.Next(0, 10)) + { + case 0: + return "Did you know that you can skin this very menu? Just goes to show how much you can shift it your way."; + case 1: + return "Want to pick up a few skins or mods from the community? Head on over to http://getshiftos.ml/Skins!"; + case 2: + return "Sandbox mode is a special version of ShiftOS that allows you to use the operating system without having to deal with Codepoints, the Shiftorium or having to play through the storyline. Handy..."; + case 3: + return "ArtPad not good enough? You can use an external image editor to create ShiftOS skin textures. Just save your files to the Shared Directory and they'll be imported into ShiftOS on the 1:/ drive."; + case 4: + return "Terminal too weird for ya? You can use the Format Editor to generate your own Terminal command parser. No coding knowledge needed!"; + case 5: + return "Contests are a good way to earn heaps of Codepoints. Head on over to http://getshiftos.ml/Contests for info on current community contests."; + default: + return "Good God. We don't know what to put here."; + } + } + + private void button1_Click(object sender, EventArgs e) + { + Desktop.CurrentDesktop.Show(); + } + + private void button5_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void button2_Click(object sender, EventArgs e) + { + (Desktop.CurrentDesktop as WinformsDesktop).IsSandbox = true; + Desktop.CurrentDesktop.Show(); + } + } +} diff --git a/ShiftOS.WinForms/MainMenu/MainMenu.resx b/ShiftOS.WinForms/MainMenu/MainMenu.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.WinForms/MainMenu/MainMenu.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ShiftOS.WinForms/Program.cs b/ShiftOS.WinForms/Program.cs index 8f65265..b07d97a 100644 --- a/ShiftOS.WinForms/Program.cs +++ b/ShiftOS.WinForms/Program.cs @@ -50,6 +50,21 @@ namespace ShiftOS.WinForms Application.SetCompatibleTextRenderingDefault(false); //if ANYONE puts code before those two winforms config lines they will be declared a drunky. - Michael SkinEngine.SetPostProcessor(new DitheringSkinPostProcessor()); + LoginManager.Init(new GUILoginFrontend()); + CrashHandler.SetGameMetadata(Assembly.GetExecutingAssembly()); + SkinEngine.SetIconProber(new ShiftOSIconProvider()); + TerminalBackend.TerminalRequested += () => + { + AppearanceManager.SetupWindow(new Applications.Terminal()); + }; + Localization.RegisterProvider(new WFLanguageProvider()); + Infobox.Init(new Dialog()); + FileSkimmerBackend.Init(new WinformsFSFrontend()); + var desk = new WinformsDesktop(); + Desktop.Init(desk); + OutOfBoxExperience.Init(new Oobe()); + AppearanceManager.Initiate(new WinformsWindowManager()); +#if OLD SaveSystem.PreDigitalSocietyConnection += () => { Action completed = null; @@ -63,25 +78,11 @@ namespace ShiftOS.WinForms Engine.AudioManager.PlayStream(Properties.Resources.dial_up_modem_02); }; - LoginManager.Init(new GUILoginFrontend()); - CrashHandler.SetGameMetadata(Assembly.GetExecutingAssembly()); - SkinEngine.SetIconProber(new ShiftOSIconProvider()); - ShiftOS.Engine.AudioManager.Init(new ShiftOSAudioProvider()); - Localization.RegisterProvider(new WFLanguageProvider()); - TutorialManager.RegisterTutorial(new Oobe()); - - TerminalBackend.TerminalRequested += () => - { - AppearanceManager.SetupWindow(new Applications.Terminal()); - }; - Infobox.Init(new Dialog()); - FileSkimmerBackend.Init(new WinformsFSFrontend()); - var desk = new WinformsDesktop(); - Desktop.Init(desk); - OutOfBoxExperience.Init(new Oobe()); - AppearanceManager.Initiate(new WinformsWindowManager()); Application.Run(desk); +#else + Application.Run(new MainMenu.MainMenu(desk)); +#endif } } diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj index e1afa84..d589ed4 100644 --- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj +++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj @@ -356,6 +356,12 @@ + + Form + + + MainMenu.cs + Form @@ -603,6 +609,9 @@ GUILogin.cs + + MainMenu.cs + Oobe.cs diff --git a/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.Designer.cs b/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.Designer.cs index a62b5a8..b3e408f 100644 --- a/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.Designer.cs +++ b/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.Designer.cs @@ -28,27 +28,198 @@ /// private void InitializeComponent() { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShiftSoft)); this.label1 = new System.Windows.Forms.Label(); + this.pnldivider = new System.Windows.Forms.Panel(); + this.label2 = new System.Windows.Forms.Label(); + this.flbuttons = new System.Windows.Forms.FlowLayoutPanel(); + this.btnhome = new System.Windows.Forms.Button(); + this.btnservices = new System.Windows.Forms.Button(); + this.btnping = new System.Windows.Forms.Button(); + this.pnlhome = new System.Windows.Forms.Panel(); + this.lbwhere = new System.Windows.Forms.Label(); + this.lbdesc = new System.Windows.Forms.Label(); + this.pnlservices = new System.Windows.Forms.Panel(); + this.lbfreebiedesc = new System.Windows.Forms.Label(); + this.lbfreebie = new System.Windows.Forms.Label(); + this.btnjoinfreebie = new System.Windows.Forms.Button(); + this.flbuttons.SuspendLayout(); + this.pnlhome.SuspendLayout(); + this.pnlservices.SuspendLayout(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Franklin Gothic Heavy", 24.75F, System.Drawing.FontStyle.Italic); - this.label1.Location = new System.Drawing.Point(13, 17); + this.label1.Location = new System.Drawing.Point(13, 8); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(152, 38); this.label1.TabIndex = 0; this.label1.Tag = "keepfont"; this.label1.Text = "Shiftsoft"; // + // pnldivider + // + this.pnldivider.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.pnldivider.Location = new System.Drawing.Point(20, 71); + this.pnldivider.Name = "pnldivider"; + this.pnldivider.Size = new System.Drawing.Size(654, 2); + this.pnldivider.TabIndex = 1; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(17, 46); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(163, 13); + this.label2.TabIndex = 2; + this.label2.Text = "What do you want to shift today?"; + // + // flbuttons + // + this.flbuttons.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.flbuttons.AutoSize = true; + this.flbuttons.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.flbuttons.Controls.Add(this.btnhome); + this.flbuttons.Controls.Add(this.btnservices); + this.flbuttons.Controls.Add(this.btnping); + this.flbuttons.Location = new System.Drawing.Point(515, 17); + this.flbuttons.Name = "flbuttons"; + this.flbuttons.Size = new System.Drawing.Size(159, 29); + this.flbuttons.TabIndex = 3; + // + // btnhome + // + this.btnhome.AutoSize = true; + this.btnhome.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnhome.Location = new System.Drawing.Point(3, 3); + this.btnhome.Name = "btnhome"; + this.btnhome.Size = new System.Drawing.Size(45, 23); + this.btnhome.TabIndex = 0; + this.btnhome.Tag = "header3"; + this.btnhome.Text = "Home"; + this.btnhome.UseVisualStyleBackColor = true; + this.btnhome.Click += new System.EventHandler(this.btnhome_Click); + // + // btnservices + // + this.btnservices.AutoSize = true; + this.btnservices.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnservices.Location = new System.Drawing.Point(54, 3); + this.btnservices.Name = "btnservices"; + this.btnservices.Size = new System.Drawing.Size(58, 23); + this.btnservices.TabIndex = 1; + this.btnservices.Tag = "header3"; + this.btnservices.Text = "Services"; + this.btnservices.UseVisualStyleBackColor = true; + this.btnservices.Click += new System.EventHandler(this.btnservices_Click); + // + // btnping + // + this.btnping.AutoSize = true; + this.btnping.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnping.Location = new System.Drawing.Point(118, 3); + this.btnping.Name = "btnping"; + this.btnping.Size = new System.Drawing.Size(38, 23); + this.btnping.TabIndex = 2; + this.btnping.Tag = "header3"; + this.btnping.Text = "Ping"; + this.btnping.UseVisualStyleBackColor = true; + this.btnping.Click += new System.EventHandler(this.btnping_Click); + // + // pnlhome + // + this.pnlhome.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.pnlhome.Controls.Add(this.lbdesc); + this.pnlhome.Controls.Add(this.lbwhere); + this.pnlhome.Location = new System.Drawing.Point(20, 92); + this.pnlhome.Name = "pnlhome"; + this.pnlhome.Size = new System.Drawing.Size(654, 271); + this.pnlhome.TabIndex = 4; + // + // lbwhere + // + this.lbwhere.AutoSize = true; + this.lbwhere.Location = new System.Drawing.Point(4, 4); + this.lbwhere.Name = "lbwhere"; + this.lbwhere.Size = new System.Drawing.Size(169, 13); + this.lbwhere.TabIndex = 0; + this.lbwhere.Tag = "header2"; + this.lbwhere.Text = "Where do you want to shift today?"; + // + // lbdesc + // + this.lbdesc.Location = new System.Drawing.Point(4, 17); + this.lbdesc.Name = "lbdesc"; + this.lbdesc.Size = new System.Drawing.Size(361, 160); + this.lbdesc.TabIndex = 1; + this.lbdesc.Text = resources.GetString("lbdesc.Text"); + // + // pnlservices + // + this.pnlservices.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.pnlservices.Controls.Add(this.btnjoinfreebie); + this.pnlservices.Controls.Add(this.lbfreebiedesc); + this.pnlservices.Controls.Add(this.lbfreebie); + this.pnlservices.Location = new System.Drawing.Point(20, 92); + this.pnlservices.Name = "pnlservices"; + this.pnlservices.Size = new System.Drawing.Size(654, 271); + this.pnlservices.TabIndex = 5; + // + // lbfreebiedesc + // + this.lbfreebiedesc.Location = new System.Drawing.Point(4, 17); + this.lbfreebiedesc.Name = "lbfreebiedesc"; + this.lbfreebiedesc.Size = new System.Drawing.Size(361, 105); + this.lbfreebiedesc.TabIndex = 1; + this.lbfreebiedesc.Text = resources.GetString("lbfreebiedesc.Text"); + // + // lbfreebie + // + this.lbfreebie.AutoSize = true; + this.lbfreebie.Location = new System.Drawing.Point(4, 4); + this.lbfreebie.Name = "lbfreebie"; + this.lbfreebie.Size = new System.Drawing.Size(88, 13); + this.lbfreebie.TabIndex = 0; + this.lbfreebie.Tag = "header2"; + this.lbfreebie.Text = "Freebie Solutions"; + // + // btnjoinfreebie + // + this.btnjoinfreebie.AutoSize = true; + this.btnjoinfreebie.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnjoinfreebie.Location = new System.Drawing.Point(245, 125); + this.btnjoinfreebie.Name = "btnjoinfreebie"; + this.btnjoinfreebie.Size = new System.Drawing.Size(120, 23); + this.btnjoinfreebie.TabIndex = 2; + this.btnjoinfreebie.Text = "Join Freebie Solutions"; + this.btnjoinfreebie.UseVisualStyleBackColor = true; + this.btnjoinfreebie.Click += new System.EventHandler(this.btnjoinfreebie_Click); + // // ShiftSoft // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.pnlservices); + this.Controls.Add(this.pnlhome); + this.Controls.Add(this.flbuttons); + this.Controls.Add(this.label2); + this.Controls.Add(this.pnldivider); this.Controls.Add(this.label1); this.Name = "ShiftSoft"; - this.Size = new System.Drawing.Size(523, 384); + this.Size = new System.Drawing.Size(694, 384); + this.flbuttons.ResumeLayout(false); + this.flbuttons.PerformLayout(); + this.pnlhome.ResumeLayout(false); + this.pnlhome.PerformLayout(); + this.pnlservices.ResumeLayout(false); + this.pnlservices.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -57,5 +228,18 @@ #endregion private System.Windows.Forms.Label label1; + private System.Windows.Forms.Panel pnldivider; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.FlowLayoutPanel flbuttons; + private System.Windows.Forms.Button btnhome; + private System.Windows.Forms.Button btnservices; + private System.Windows.Forms.Button btnping; + private System.Windows.Forms.Panel pnlhome; + private System.Windows.Forms.Label lbdesc; + private System.Windows.Forms.Label lbwhere; + private System.Windows.Forms.Panel pnlservices; + private System.Windows.Forms.Label lbfreebiedesc; + private System.Windows.Forms.Label lbfreebie; + private System.Windows.Forms.Button btnjoinfreebie; } } diff --git a/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.cs b/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.cs index 18968cd..0d84ecc 100644 --- a/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.cs +++ b/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.cs @@ -25,6 +25,18 @@ namespace ShiftOS.WinForms.ShiftnetSites public void OnSkinLoad() { + pnldivider.Tag = "keepbg"; + pnldivider.BackColor = SkinEngine.LoadedSkin.ControlTextColor; + Tools.ControlManager.SetupControls(flbuttons); + Tools.ControlManager.SetupControls(pnlhome); + Tools.ControlManager.SetupControls(pnlservices); + + lbfreebiedesc.Top = lbfreebie.Top + lbfreebie.Height + 5; + btnjoinfreebie.Top = lbfreebiedesc.Top + lbfreebiedesc.Height + 5; + + SetupFreebieUI(); + + lbdesc.Top = lbwhere.Top + lbwhere.Height + 5; } public void OnUpgrade() @@ -33,6 +45,50 @@ namespace ShiftOS.WinForms.ShiftnetSites public void Setup() { + pnlhome.BringToFront(); + } + + private void btnping_Click(object sender, EventArgs e) + { + GoToUrl?.Invoke("shiftnet/shiftsoft/ping"); + } + + private void btnhome_Click(object sender, EventArgs e) + { + pnlhome.BringToFront(); + } + + private void btnservices_Click(object sender, EventArgs e) + { + pnlservices.BringToFront(); + SetupFreebieUI(); + } + + public void SetupFreebieUI() + { + if(SaveSystem.CurrentSave.ShiftnetSubscription == 0) + { + btnjoinfreebie.Enabled = false; + btnjoinfreebie.Text = "You are already subscribed to Freebie Solutions."; + } + else + { + btnjoinfreebie.Enabled = true; + btnjoinfreebie.Text = "Join Freebie Solutions"; + } + btnjoinfreebie.Left = (lbfreebiedesc.Left + lbfreebiedesc.Width) - btnjoinfreebie.Width; + } + + private void btnjoinfreebie_Click(object sender, EventArgs e) + { + Infobox.PromptYesNo("Switch providers", "Would you like to switch from your current Shiftnet provider, " + Applications.DownloadManager.GetAllSubscriptions()[SaveSystem.CurrentSave.ShiftnetSubscription].Name + ", to Freebie Solutions by ShiftSoft?", (res) => + { + if(res == true) + { + SaveSystem.CurrentSave.ShiftnetSubscription = 0; + Infobox.Show("Switch providers", "The operation has completed successfully."); + } + }); } } } diff --git a/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.resx b/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.resx index 1af7de1..cd314f0 100644 --- a/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.resx +++ b/ShiftOS.WinForms/ShiftnetSites/ShiftSoft.resx @@ -117,4 +117,14 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Welcome to ShiftSoft. We understand the troubles of being locked within a digital society. For some, it's a prison. For others, it's all they know. It's what life means for them. + +But for us, it's a safe-haven. We may all be locked within an evolving operating system with no possibility of escaping, but we can at least develop ways of improving life within this binary world, and that's what we at ShiftSoft are doing. + + + The Shiftnet is a wonderful place full of apps, utilities, enhancements and much more for ShiftOS, but it comes at a cost. + +Freebie Solutions takes that cost away. You get free Shiftnet usage, but are locked to sites listed on Ping and you are limited to 256 byte-per-second downloads. Perfect for those situations where Codepoints and shiftnet connectivity are a needed resource. + \ No newline at end of file diff --git a/ShiftOS.WinForms/Stories/LegionStory.cs b/ShiftOS.WinForms/Stories/LegionStory.cs index 056fe85..c52732e 100644 --- a/ShiftOS.WinForms/Stories/LegionStory.cs +++ b/ShiftOS.WinForms/Stories/LegionStory.cs @@ -74,22 +74,10 @@ namespace ShiftOS.WinForms.Stories WriteLine("Anyways, that's all I'll say for now. Have fun on the Shiftnet. I have to go work on something."); WriteLine("One of my friends'll contact you once you've gotten a new service provider."); - Story.PushObjective("Register with a new Shiftnet service provider.", "You've just unlocked the Shiftnet, which has opened up a whole new world of applications and features for ShiftOS. Before you go nuts with it, you may want to register with a better service provider than Freebie Solutions.", () => - { - return SaveSystem.CurrentSave.ShiftnetSubscription != 0; - }, - () => - { - Story.Context.MarkComplete(); - SaveSystem.SaveGame(); - TerminalBackend.PrintPrompt(); - Story.Start("hacker101_breakingbonds_1"); - }); - TerminalBackend.PrefixEnabled = true; - TerminalBackend.PrintPrompt(); - Story.Context.AutoComplete = false; + Story.Context.MarkComplete(); + Story.Start("aiden_shiftnet2"); } [Story("hacker101_breakingbonds_1")] @@ -111,6 +99,9 @@ namespace ShiftOS.WinForms.Stories WriteLine("Before I can do that, however, I need you to do a few things."); WriteLine("I'll assign what I need you to do as an objective. When you're done, I'll tell you what you need to know."); + Story.Context.MarkComplete(); + TerminalBackend.PrefixEnabled = true; + Story.PushObjective("Breaking the Bonds: Errand Boy", @"hacker101 has something he needs to show you, however before he can, you need to do the following: - Buy ""TriWrite"" from Appscape @@ -127,14 +118,25 @@ namespace ShiftOS.WinForms.Stories SaveSystem.SaveGame(); Story.Start("hacker101_breakingbonds_2"); }); - - TerminalBackend.PrefixEnabled = true; - TerminalBackend.PrintPrompt(); - Story.Context.AutoComplete = false; - } + [Story("aiden_shiftnet2")] + public static void AidenShiftnet2() + { + Story.PushObjective("Register with a new Shiftnet service provider.", "You've just unlocked the Shiftnet, which has opened up a whole new world of applications and features for ShiftOS. Before you go nuts with it, you may want to register with a better service provider than Freebie Solutions.", () => + { + return SaveSystem.CurrentSave.ShiftnetSubscription != 0; + }, + () => + { + Story.Context.MarkComplete(); + SaveSystem.SaveGame(); + TerminalBackend.PrintPrompt(); + Story.Start("hacker101_breakingbonds_1"); + }); + Story.Context.AutoComplete = false; + } private static void WriteLine(string text, bool showCharacterName=true) { @@ -159,7 +161,7 @@ namespace ShiftOS.WinForms.Stories { Console.Write(c); ConsoleEx.OnFlush?.Invoke(); - Thread.Sleep(45); + Thread.Sleep(5); } Thread.Sleep(1000); } diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs index 4614842..f6c4383 100644 --- a/ShiftOS.WinForms/WinformsDesktop.cs +++ b/ShiftOS.WinForms/WinformsDesktop.cs @@ -50,6 +50,8 @@ namespace ShiftOS.WinForms [Namespace("desktop")] public partial class WinformsDesktop : Form, IDesktop { + public MainMenu.MainMenu ParentMenu = null; + [Command("pushnote")] [RequiresArgument("target")] [RequiresArgument("title")] @@ -921,7 +923,7 @@ namespace ShiftOS.WinForms /// E. private void Desktop_Load(object sender, EventArgs e) { - + SaveSystem.IsSandbox = this.IsSandbox; SaveSystem.Begin(); SetupDesktop(); @@ -964,6 +966,7 @@ namespace ShiftOS.WinForms } private IWindowBorder focused = null; + internal bool IsSandbox = false; public string DesktopName { @@ -1033,10 +1036,17 @@ namespace ShiftOS.WinForms { try { - this.Invoke(new Action(() => + if (this.Visible == true) { - act?.Invoke(); - })); + this.Invoke(new Action(() => + { + act?.Invoke(); + })); + } + else + { + ParentMenu?.Invoke(act); + } } catch { @@ -1105,12 +1115,16 @@ namespace ShiftOS.WinForms public void HideAppLauncher() { - this.Invoke(new Action(() => + try { - currentSettingsPane?.Hide(); - currentSettingsPane = null; - pnladvancedal.Hide(); - })); + this.Invoke(new Action(() => + { + currentSettingsPane?.Hide(); + currentSettingsPane = null; + pnladvancedal.Hide(); + })); + } + catch { } } } diff --git a/ShiftOS_TheReturn/AppearanceManager.cs b/ShiftOS_TheReturn/AppearanceManager.cs index 7cf06c9..e244b77 100644 --- a/ShiftOS_TheReturn/AppearanceManager.cs +++ b/ShiftOS_TheReturn/AppearanceManager.cs @@ -126,6 +126,7 @@ namespace ShiftOS.Engine } + // Provides a list of all open ShiftOS windows. public static List OpenForms = new List(); diff --git a/ShiftOS_TheReturn/SaveSystem.cs b/ShiftOS_TheReturn/SaveSystem.cs index e98a51e..e36fee6 100644 --- a/ShiftOS_TheReturn/SaveSystem.cs +++ b/ShiftOS_TheReturn/SaveSystem.cs @@ -67,6 +67,7 @@ namespace ShiftOS.Engine /// Boolean representing whether the save system is ready to be used. /// public static bool Ready = false; + public static bool IsSandbox = false; /// /// Occurs before the save system connects to the ShiftOS Digital Society. @@ -140,63 +141,126 @@ namespace ShiftOS.Engine Console.WriteLine("[simpl-conf] Reading configuration files (global-3.conf)"); Console.WriteLine("[termdb] Building command database from filesystem..."); TerminalBackend.PopulateTerminalCommands(); - Console.WriteLine("[inetd] Connecting to network..."); - Ready = false; - - if (PreDigitalSocietyConnection != null) + if (IsSandbox == false) { - PreDigitalSocietyConnection?.Invoke(); + Console.WriteLine("[inetd] Connecting to network..."); + + Ready = false; - while (!Ready) + if (PreDigitalSocietyConnection != null) { - Thread.Sleep(10); + PreDigitalSocietyConnection?.Invoke(); + + while (!Ready) + { + Thread.Sleep(10); + } } - } - - bool guidReceived = false; - ServerManager.GUIDReceived += (str) => - { - //Connection successful! Stop waiting! - guidReceived = true; - Console.WriteLine("[inetd] Connection successful."); - }; - try - { + bool guidReceived = false; + ServerManager.GUIDReceived += (str) => + { + //Connection successful! Stop waiting! + guidReceived = true; + Console.WriteLine("[inetd] Connection successful."); + }; - ServerManager.Initiate(UserConfig.Get().DigitalSocietyAddress, UserConfig.Get().DigitalSocietyPort); - //This haults the client until the connection is successful. - while (ServerManager.thisGuid == new Guid()) + try { - Thread.Sleep(10); + + ServerManager.Initiate(UserConfig.Get().DigitalSocietyAddress, UserConfig.Get().DigitalSocietyPort); + //This haults the client until the connection is successful. + while (ServerManager.thisGuid == new Guid()) + { + Thread.Sleep(10); + } + Console.WriteLine("[inetd] DHCP GUID recieved, finished setup"); + FinishBootstrap(); } - Console.WriteLine("[inetd] DHCP GUID recieved, finished setup"); - FinishBootstrap(); + catch (Exception ex) + { + //No errors, this never gets called. + Console.WriteLine("[inetd] SEVERE: " + ex.Message); + Thread.Sleep(3000); + Console.WriteLine("[sys] SEVERE: Cannot connect to server. Shutting down in 5..."); + Thread.Sleep(1000); + Console.WriteLine("[sys] 4..."); + Thread.Sleep(1000); + Console.WriteLine("[sys] 3..."); + Thread.Sleep(1000); + Console.WriteLine("[sys] 2..."); + Thread.Sleep(1000); + Console.WriteLine("[sys] 1..."); + Thread.Sleep(1000); + Console.WriteLine("[sys] Bye bye."); + System.Diagnostics.Process.GetCurrentProcess().Kill(); + } + + //Nothing happens past this point - but the client IS connected! It shouldn't be stuck in that while loop above. } - catch (Exception ex) + else { - //No errors, this never gets called. - Console.WriteLine("[inetd] SEVERE: " + ex.Message); - Thread.Sleep(3000); - Console.WriteLine("[sys] SEVERE: Cannot connect to server. Shutting down in 5..."); - Thread.Sleep(1000); - Console.WriteLine("[sys] 4..."); - Thread.Sleep(1000); - Console.WriteLine("[sys] 3..."); - Thread.Sleep(1000); - Console.WriteLine("[sys] 2..."); - Thread.Sleep(1000); - Console.WriteLine("[sys] 1..."); - Thread.Sleep(1000); - Console.WriteLine("[sys] Bye bye."); - System.Diagnostics.Process.GetCurrentProcess().Kill(); - } + Console.WriteLine("[inetd] Sandbox mode initiating..."); + CurrentSave = new Save + { + IsSandbox = true, + Username = "sandbox", + Password = "sandbox", + SystemName = "shiftos", + Users = new List + { + new ClientSave + { + Username = "user", + Password = "", + Permissions = 0 + } + }, + Class = 0, + ID = new Guid(), + Upgrades = new Dictionary(), + CurrentLegions = null, + IsMUDAdmin = false, + IsPatreon = false, + Language = "english", + LastMonthPaid = 0, + MajorVersion = 1, + MinorVersion = 0, + MusicEnabled = false, + MusicVolume = 100, + MyShop = "", + PasswordHashed = false, + PickupPoint = "", + RawReputation = 0.0f, + Revision = 0, + ShiftnetSubscription = 0, + SoundEnabled = true, + StoriesExperienced = null, + StoryPosition = 0, + UniteAuthToken = "", + }; + + CurrentUser = CurrentSave.Users.First(); + + Localization.SetupTHETRUEDefaultLocals(); + + Shiftorium.Init(); + + TerminalBackend.InStory = false; + TerminalBackend.PrefixEnabled = true; + + Desktop.InvokeOnWorkerThread(new Action(() => + { + ShiftOS.Engine.Scripting.LuaInterpreter.RunSft(Paths.GetPath("kernel.sft")); + })); - //Nothing happens past this point - but the client IS connected! It shouldn't be stuck in that while loop above. + Desktop.InvokeOnWorkerThread(new Action(() => Desktop.PopulateAppLauncher())); + GameReady?.Invoke(); + } })); thread.IsBackground = true; @@ -243,10 +307,6 @@ namespace ShiftOS.Engine Thread.Sleep(10); } - Localization.SetupTHETRUEDefaultLocals(); - - Shiftorium.Init(); - while (CurrentSave.StoryPosition < 1) { Thread.Sleep(10); diff --git a/ShiftOS_TheReturn/ServerManager.cs b/ShiftOS_TheReturn/ServerManager.cs index 1439c0d..be4f086 100644 --- a/ShiftOS_TheReturn/ServerManager.cs +++ b/ShiftOS_TheReturn/ServerManager.cs @@ -302,15 +302,17 @@ Ping: {ServerManager.DigitalSocietyPing} ms /// The message body public static void SendMessage(string name, string contents) { - var sMsg = new ServerMessage + if (!SaveSystem.IsSandbox) { - Name = name, - Contents = contents, - GUID = thisGuid.ToString(), - }; - PingTimer.Start(); - client.Send(new NetObject("msg", sMsg)); - + var sMsg = new ServerMessage + { + Name = name, + Contents = contents, + GUID = thisGuid.ToString(), + }; + PingTimer.Start(); + client.Send(new NetObject("msg", sMsg)); + } } private static bool singleplayer = false; diff --git a/ShiftOS_TheReturn/Shiftorium.cs b/ShiftOS_TheReturn/Shiftorium.cs index 975939f..7faf336 100644 --- a/ShiftOS_TheReturn/Shiftorium.cs +++ b/ShiftOS_TheReturn/Shiftorium.cs @@ -429,6 +429,9 @@ namespace ShiftOS.Engine /// Whether the upgrade is installed. public static bool UpgradeInstalled(string id) { + if (SaveSystem.IsSandbox == true) + return true; + if (string.IsNullOrWhiteSpace(id)) return true; if (SaveSystem.CurrentSave != null) diff --git a/ShiftOS_TheReturn/Story.cs b/ShiftOS_TheReturn/Story.cs index f473f89..e44d2be 100644 --- a/ShiftOS_TheReturn/Story.cs +++ b/ShiftOS_TheReturn/Story.cs @@ -115,8 +115,16 @@ namespace ShiftOS.Engine t.IsBackground = true; t.Start(); + Console.WriteLine(); + ConsoleEx.ForegroundColor = ConsoleColor.Red; + ConsoleEx.Bold = true; Console.WriteLine("NEW OBJECTIVE:"); + Console.WriteLine(); + + ConsoleEx.ForegroundColor = ConsoleColor.White; + ConsoleEx.Bold = false; Console.WriteLine("A new objective has been added to your system. Run sos.status to find out what you need to do."); + TerminalBackend.PrintPrompt(); } -- cgit v1.2.3 From 7ec048fe8536c9757eda47801af07956b826466d Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 11 Jun 2017 08:21:41 -0400 Subject: More menu work. --- ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs | 41 +++++ ShiftOS.WinForms/MainMenu/MainMenu.cs | 72 +++++++-- ShiftOS.WinForms/Properties/Resources.Designer.cs | 21 ++- ShiftOS.WinForms/Properties/Resources.resx | 189 +++++++++++----------- ShiftOS.WinForms/Resources/ShiftOSFull.png | Bin 0 -> 31942 bytes ShiftOS.WinForms/ShiftOS.WinForms.csproj | 1 + 6 files changed, 214 insertions(+), 110 deletions(-) create mode 100644 ShiftOS.WinForms/Resources/ShiftOSFull.png (limited to 'ShiftOS.WinForms/ShiftOS.WinForms.csproj') diff --git a/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs b/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs index a056866..b716b4e 100644 --- a/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs +++ b/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs @@ -49,10 +49,14 @@ this.btnnewgame = new System.Windows.Forms.Button(); this.btncontinue = new System.Windows.Forms.Button(); this.button10 = new System.Windows.Forms.Button(); + this.lbcurrentui = new System.Windows.Forms.Label(); + this.shiftos = new System.Windows.Forms.PictureBox(); + this.lbbuilddetails = new System.Windows.Forms.Label(); this.flmenu.SuspendLayout(); this.pnloptions.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout(); this.flcampaign.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.shiftos)).BeginInit(); this.SuspendLayout(); // // flmenu @@ -281,12 +285,45 @@ this.button10.UseVisualStyleBackColor = true; this.button10.Click += new System.EventHandler(this.button10_Click); // + // lbcurrentui + // + this.lbcurrentui.AutoSize = true; + this.lbcurrentui.Location = new System.Drawing.Point(704, 259); + this.lbcurrentui.Name = "lbcurrentui"; + this.lbcurrentui.Size = new System.Drawing.Size(35, 13); + this.lbcurrentui.TabIndex = 4; + this.lbcurrentui.Tag = "header2"; + this.lbcurrentui.Text = "label4"; + // + // shiftos + // + this.shiftos.Image = global::ShiftOS.WinForms.Properties.Resources.ShiftOSFull; + this.shiftos.Location = new System.Drawing.Point(432, 381); + this.shiftos.Name = "shiftos"; + this.shiftos.Size = new System.Drawing.Size(468, 109); + this.shiftos.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.shiftos.TabIndex = 5; + this.shiftos.TabStop = false; + // + // lbbuilddetails + // + this.lbbuilddetails.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lbbuilddetails.AutoSize = true; + this.lbbuilddetails.Location = new System.Drawing.Point(1, 553); + this.lbbuilddetails.Name = "lbbuilddetails"; + this.lbbuilddetails.Size = new System.Drawing.Size(35, 13); + this.lbbuilddetails.TabIndex = 6; + this.lbbuilddetails.Text = "label4"; + // // MainMenu // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Black; this.ClientSize = new System.Drawing.Size(1161, 566); + this.Controls.Add(this.lbbuilddetails); + this.Controls.Add(this.shiftos); + this.Controls.Add(this.lbcurrentui); this.Controls.Add(this.flcampaign); this.Controls.Add(this.pnloptions); this.Controls.Add(this.lbticker); @@ -301,6 +338,7 @@ this.flowLayoutPanel1.ResumeLayout(false); this.flowLayoutPanel1.PerformLayout(); this.flcampaign.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.shiftos)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -329,5 +367,8 @@ private System.Windows.Forms.Button btnnewgame; private System.Windows.Forms.Button btncontinue; private System.Windows.Forms.Button button10; + private System.Windows.Forms.Label lbcurrentui; + private System.Windows.Forms.PictureBox shiftos; + private System.Windows.Forms.Label lbbuilddetails; } } \ No newline at end of file diff --git a/ShiftOS.WinForms/MainMenu/MainMenu.cs b/ShiftOS.WinForms/MainMenu/MainMenu.cs index 4b510e2..e11edc2 100644 --- a/ShiftOS.WinForms/MainMenu/MainMenu.cs +++ b/ShiftOS.WinForms/MainMenu/MainMenu.cs @@ -4,6 +4,7 @@ using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; @@ -18,12 +19,60 @@ namespace ShiftOS.WinForms.MainMenu { InitializeComponent(); (desk as WinformsDesktop).ParentMenu = this; + this.FormBorderStyle = FormBorderStyle.None; + this.WindowState = FormWindowState.Maximized; +#if DEBUG + var asm = Assembly.GetExecutingAssembly(); + string asmName = asm.GetName().Name; + string vstring = ""; + var version = asm.GetCustomAttributes(true).FirstOrDefault(x => x is AssemblyVersionAttribute) as AssemblyVersionAttribute; + if (version != null) + vstring = version.Version; + lbbuilddetails.Text = $"{asmName} - version number: {vstring} - THIS IS AN UNSTABLE RELEASE."; + +#else + lbbuilddetails.Hide(); +#endif + } + + public void HideOptions() + { + pnloptions.Hide(); + flmenu.BringToFront(); + flmenu.CenterParent(); + currentMenu = flmenu; + CategoryText = "Main menu"; + } + + public string CategoryText + { + get + { + return lbcurrentui.Text; + } + set + { + lbcurrentui.Text = value; + lbcurrentui.CenterParent(); + lbcurrentui.Top = currentMenu.Top - (lbcurrentui.Height * 2); + } + } + + private Control currentMenu = null; + + private void MainMenu_Load(object sender, EventArgs e) + { + Tools.ControlManager.SetupControls(this); + shiftos.CenterParent(); + shiftos.Top = 35; + + var tickermove = new Timer(); var tickerreset = new Timer(); tickermove.Tick += (o, a) => { - if(lbticker.Left <= (0 - lbticker.Width)) + if (lbticker.Left <= (0 - lbticker.Width)) { tickermove.Stop(); tickerreset.Start(); @@ -52,18 +101,9 @@ namespace ShiftOS.WinForms.MainMenu flmenu.CenterParent(); tickerreset.Start(); - } - public void HideOptions() - { - pnloptions.Hide(); - flmenu.BringToFront(); - flmenu.CenterParent(); - } - - private void MainMenu_Load(object sender, EventArgs e) - { - Tools.ControlManager.SetupControls(this); + currentMenu = flmenu; + CategoryText = "Main menu"; } @@ -110,6 +150,9 @@ namespace ShiftOS.WinForms.MainMenu flcampaign.Show(); flcampaign.BringToFront(); flcampaign.CenterParent(); + currentMenu = flcampaign; + CategoryText = "Campaign"; + } private void button5_Click(object sender, EventArgs e) @@ -135,6 +178,9 @@ namespace ShiftOS.WinForms.MainMenu pnloptions.Show(); pnloptions.BringToFront(); pnloptions.CenterParent(); + currentMenu = pnloptions; + CategoryText = "Settings"; + } private void opt_btncancel_Click(object sender, EventArgs e) @@ -187,6 +233,8 @@ namespace ShiftOS.WinForms.MainMenu flmenu.Show(); flmenu.BringToFront(); flmenu.CenterParent(); + currentMenu = flmenu; + CategoryText = "Main menu"; } private void btncontinue_Click(object sender, EventArgs e) diff --git a/ShiftOS.WinForms/Properties/Resources.Designer.cs b/ShiftOS.WinForms/Properties/Resources.Designer.cs index 0386237..137db4b 100644 --- a/ShiftOS.WinForms/Properties/Resources.Designer.cs +++ b/ShiftOS.WinForms/Properties/Resources.Designer.cs @@ -1092,9 +1092,9 @@ namespace ShiftOS.WinForms.Properties { /// { /// Company: "Shiftcast", /// Name: "NetXtreme Hyper Edition", - /// CostPerMonth: 1500, + /// CostPerMonth: 150, /// DownloadSpeed: 524288, //512 kb/s - /// Description: "It's time to supercharge your Shif [rest of string was truncated]";. + /// Description: "It's time to supercharge your Shift [rest of string was truncated]";. /// internal static string ShiftnetServices { get { @@ -1113,9 +1113,10 @@ namespace ShiftOS.WinForms.Properties { /// Category: "Enhancements", /// }, /// { - /// Name: "Shift Progress Bar", - /// Cost: 150, - /// Description: "Want to customize the look of all ShiftOS Progress Bars? Buy this upgrade today and you'll get the ability to set the foreground an [rest of string was truncated]";. + /// Name: "Icon Manager", + /// Cost: 450, + /// Description: "This tool allows you to add and edit application icons within ShiftOS for the small prive of 450 Codepoints!", + /// Dependencies: "skinning [rest of string was truncated]";. /// internal static string Shiftorium { get { @@ -1133,6 +1134,16 @@ namespace ShiftOS.WinForms.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap ShiftOSFull { + get { + object obj = ResourceManager.GetObject("ShiftOSFull", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/ShiftOS.WinForms/Properties/Resources.resx b/ShiftOS.WinForms/Properties/Resources.resx index d1a3544..05f03c7 100644 --- a/ShiftOS.WinForms/Properties/Resources.resx +++ b/ShiftOS.WinForms/Properties/Resources.resx @@ -830,6 +830,9 @@ ..\Resources\ArtPadlinetool.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\fileicon15.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\SystemIcons\iconshutdown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -948,9 +951,6 @@ ..\Resources\fileicon3.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\systemicons\iconshiftlotto.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\SnakeyTailR.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -966,6 +966,9 @@ ..\Resources\strings_en.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;iso-8859-1 + + ..\Resources\fileiconsaa.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\SweeperTile5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -33760,6 +33763,9 @@ ..\Resources\fileicon19.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\SystemIcons\iconorcwrite.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\SystemIcons\iconTextPad.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -33769,14 +33775,11 @@ ..\Resources\Shiftorium.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 - - ..\Resources\fileicon13.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\SystemIcons\iconAudioPlayer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\SweeperTile0.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ArtPadsquarerubber.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\fileicon4.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -33784,6 +33787,9 @@ ..\Resources\fileicon0.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ArtPadRectangle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\SweeperTileBomb.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -33796,9 +33802,6 @@ ..\Resources\fileicon10.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\SystemIcons\iconfloodgate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\SystemIcons\iconSnakey.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -33820,8 +33823,11 @@ ..\SystemIcons\iconSkinShifter.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\SystemIcons\iconShiftSweeper.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\iconSpeaker.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Ambient3.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\justthes.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -34208,14 +34214,11 @@ ..\SystemIcons\iconIconManager.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\SnakeyTailL.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\ArtPadtexttool.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\sys_shiftoriumstory.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + ..\Resources\Ambient7.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\SystemIcons\iconshutdown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -34241,9 +34244,6 @@ ..\Resources\FloppyDriveIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\SweeperTileFlag.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\SnakeyHeadD.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -34256,6 +34256,9 @@ ..\Resources\fileicon5.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\SnakeyBG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\SystemIcons\iconoctocat.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -34265,20 +34268,23 @@ ..\SystemIcons\iconArtpad.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\SystemIcons\iconPong.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\RegularDesktopGlyph.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\SnakeyBody.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\fileicon1.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\systemicons\iconshiftlotto.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\SweeperClickFace.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Ambient9.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\SystemIcons\iconPong.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\SystemIcons\iconfloodgate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\ArtPadpixelplacer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -34295,18 +34301,24 @@ ..\Resources\languages.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + ..\Resources\Ambient4.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\Resources\ArtPadcirclerubber.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\ArtPaderacer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\fileiconsaa.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\fileicon13.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\SystemIcons\iconInfoBox.fw.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\SuperDesk screenshot.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\SystemIcons\iconFileOpener.fw.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -34319,15 +34331,21 @@ ..\Resources\fileicon18.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\fileicon17.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\SystemIcons\iconShiftSweeper.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\SystemIcons\iconKnowledgeInput.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Ambient5.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\SystemIcons\iconvirusscanner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\SweeperTile3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ArtPadredo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\SystemIcons\iconDownloader.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -34346,18 +34364,24 @@ ..\Resources\SweeperTile2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ArtPadfloodfill.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\fileicon8.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\hello.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 - - ..\Resources\ArtPadpencil.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\SweeperClickFace.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\SnakeyFruit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Ambient1.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\Resources\fileicon2.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -34370,8 +34394,8 @@ ..\Resources\ArtPadnew.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\ShiftOS.rtf;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\sys_shiftoriumstory.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 ..\Resources\ArtPadmagnify.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -34385,17 +34409,17 @@ ..\SystemIcons\iconBitnoteWallet.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\ArtPadsquarerubber.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\SystemIcons\icongraphicpicker.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\fileicon1.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\fileicon12.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\SystemIcons\iconvirusscanner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Ambient2.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\ArtPadpencil.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\fileicon11.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -34403,14 +34427,17 @@ ..\Resources\strings_de.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + ..\Resources\Ambient8.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\Resources\SweeperTile6.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\ArtPadredo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\SystemIcons\iconKnowledgeInput.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\SystemIcons\iconorcwrite.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\SweeperTile0.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\SystemIcons\iconunitytoggle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -34418,8 +34445,8 @@ ..\Resources\fileicon9.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\fileicon16.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\SystemIcons\icongraphicpicker.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\SystemIcons\iconBitnoteDigger.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -34427,26 +34454,35 @@ ..\Resources\SweeperTile1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\fileicon15.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\SnakeyTailL.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\ArtPadopen.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Ambient6.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\ShiftOS.rtf;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\SystemIcons\iconShiftLetters.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\SnakeyBG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\fileicon17.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\SweeperLoseFace.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\notestate_connection_full.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\SnakeyTailD.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\ArtPadfloodfill.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\fileicon16.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\SystemIcons\iconFileSaver.fw.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -34558,8 +34594,8 @@ ..\Resources\ShiftnetServices.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 - - ..\Resources\ArtPadRectangle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\SweeperTileFlag.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\systemicons\iconformateditor.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -34570,40 +34606,7 @@ ..\Resources\SweeperTile8.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\SuperDesk screenshot.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Ambient1.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Ambient2.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Ambient3.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Ambient4.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Ambient5.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Ambient6.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Ambient7.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Ambient8.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Ambient9.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\notestate_connection_full.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\iconSpeaker.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ShiftOSFull.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/ShiftOS.WinForms/Resources/ShiftOSFull.png b/ShiftOS.WinForms/Resources/ShiftOSFull.png new file mode 100644 index 0000000..2d61a45 Binary files /dev/null and b/ShiftOS.WinForms/Resources/ShiftOSFull.png differ diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj index d589ed4..e0a53ea 100644 --- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj +++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj @@ -874,6 +874,7 @@ + -- cgit v1.2.3 From 2acfa34596061a9236bb6a9df1e3f3a0c01d6ff0 Mon Sep 17 00:00:00 2001 From: RogueAI42 Date: Tue, 13 Jun 2017 20:06:38 +1000 Subject: Python API It uses a meta-language and a CSharpCodeProvider on startup. I will release a tutorial on the forums soon showing how to use it. This commit also adds an extremely basic loading screen which shows while Desktop is getting everything ready. Which can take a while if you have any Python mods. Thanks, IronPython. --- ModLauncher/App.config | 8 + ShiftOS.MFSProfiler/App.config | 8 + ShiftOS.Modding.VB.LegacySkinConverter/App.config | 8 + ShiftOS.Modding.VirtualMachine/App.config | 8 + ShiftOS.Updater/App.config | 8 + ShiftOS.WinForms/App.config | 8 + ShiftOS.WinForms/MainMenu/Loading.Designer.cs | 66 + ShiftOS.WinForms/MainMenu/Loading.cs | 31 + ShiftOS.WinForms/MainMenu/Loading.resx | 120 + ShiftOS.WinForms/MainMenu/MainMenu.cs | 13 +- ShiftOS.WinForms/Properties/Resources.Designer.cs | 15 +- ShiftOS.WinForms/ShiftOS.WinForms.csproj | 11 + ShiftOS_TheReturn/App.config | 8 + ShiftOS_TheReturn/Commands.cs | 3 +- ShiftOS_TheReturn/Lib/BaseHTTPServer.py | 614 + ShiftOS_TheReturn/Lib/Bastion.py | 180 + ShiftOS_TheReturn/Lib/CGIHTTPServer.py | 378 + ShiftOS_TheReturn/Lib/ConfigParser.py | 753 ++ ShiftOS_TheReturn/Lib/Cookie.py | 773 ++ ShiftOS_TheReturn/Lib/DocXMLRPCServer.py | 279 + ShiftOS_TheReturn/Lib/HTMLParser.py | 475 + ShiftOS_TheReturn/Lib/MimeWriter.py | 186 + ShiftOS_TheReturn/Lib/Queue.py | 244 + ShiftOS_TheReturn/Lib/SimpleHTTPServer.py | 235 + ShiftOS_TheReturn/Lib/SimpleXMLRPCServer.py | 708 + ShiftOS_TheReturn/Lib/SocketServer.py | 731 + ShiftOS_TheReturn/Lib/StringIO.py | 324 + ShiftOS_TheReturn/Lib/UserDict.py | 213 + ShiftOS_TheReturn/Lib/UserList.py | 88 + ShiftOS_TheReturn/Lib/UserString.py | 228 + ShiftOS_TheReturn/Lib/_LWPCookieJar.py | 170 + ShiftOS_TheReturn/Lib/_MozillaCookieJar.py | 149 + ShiftOS_TheReturn/Lib/__future__.py | 128 + ShiftOS_TheReturn/Lib/__phello__.foo.py | 1 + ShiftOS_TheReturn/Lib/_abcoll.py | 695 + ShiftOS_TheReturn/Lib/_osx_support.py | 502 + ShiftOS_TheReturn/Lib/_pyio.py | 2037 +++ ShiftOS_TheReturn/Lib/_strptime.py | 478 + ShiftOS_TheReturn/Lib/_threading_local.py | 251 + ShiftOS_TheReturn/Lib/_weakrefset.py | 204 + ShiftOS_TheReturn/Lib/abc.py | 185 + ShiftOS_TheReturn/Lib/aifc.py | 989 ++ ShiftOS_TheReturn/Lib/antigravity.py | 4 + ShiftOS_TheReturn/Lib/anydbm.py | 85 + ShiftOS_TheReturn/Lib/argparse.py | 2374 ++++ ShiftOS_TheReturn/Lib/ast.py | 311 + ShiftOS_TheReturn/Lib/asynchat.py | 321 + ShiftOS_TheReturn/Lib/asyncore.py | 659 + ShiftOS_TheReturn/Lib/atexit.py | 65 + ShiftOS_TheReturn/Lib/audiodev.py | 260 + ShiftOS_TheReturn/Lib/base64.py | 367 + ShiftOS_TheReturn/Lib/bdb.py | 645 + ShiftOS_TheReturn/Lib/binhex.py | 518 + ShiftOS_TheReturn/Lib/bisect.py | 92 + ShiftOS_TheReturn/Lib/calendar.py | 713 + ShiftOS_TheReturn/Lib/cgi.py | 1059 ++ ShiftOS_TheReturn/Lib/cgitb.py | 323 + ShiftOS_TheReturn/Lib/chunk.py | 169 + ShiftOS_TheReturn/Lib/cmd.py | 404 + ShiftOS_TheReturn/Lib/code.py | 310 + ShiftOS_TheReturn/Lib/codecs.py | 1113 ++ ShiftOS_TheReturn/Lib/codeop.py | 168 + ShiftOS_TheReturn/Lib/collections.py | 742 ++ ShiftOS_TheReturn/Lib/colorsys.py | 156 + ShiftOS_TheReturn/Lib/commands.py | 90 + ShiftOS_TheReturn/Lib/compileall.py | 227 + ShiftOS_TheReturn/Lib/contextlib.py | 154 + ShiftOS_TheReturn/Lib/cookielib.py | 1810 +++ ShiftOS_TheReturn/Lib/copy.py | 433 + ShiftOS_TheReturn/Lib/csv.py | 456 + ShiftOS_TheReturn/Lib/ctypes/__init__.py | 554 + ShiftOS_TheReturn/Lib/ctypes/_endian.py | 61 + ShiftOS_TheReturn/Lib/ctypes/macholib/__init__.py | 9 + ShiftOS_TheReturn/Lib/ctypes/macholib/dyld.py | 166 + ShiftOS_TheReturn/Lib/ctypes/macholib/dylib.py | 63 + ShiftOS_TheReturn/Lib/ctypes/macholib/framework.py | 65 + ShiftOS_TheReturn/Lib/ctypes/util.py | 271 + ShiftOS_TheReturn/Lib/ctypes/wintypes.py | 181 + ShiftOS_TheReturn/Lib/decimal.py | 6214 +++++++++ ShiftOS_TheReturn/Lib/difflib.py | 2057 +++ ShiftOS_TheReturn/Lib/dircache.py | 41 + ShiftOS_TheReturn/Lib/dis.py | 224 + ShiftOS_TheReturn/Lib/distutils/__init__.py | 13 + ShiftOS_TheReturn/Lib/distutils/archive_util.py | 243 + ShiftOS_TheReturn/Lib/distutils/bcppcompiler.py | 394 + ShiftOS_TheReturn/Lib/distutils/ccompiler.py | 1096 ++ ShiftOS_TheReturn/Lib/distutils/cmd.py | 457 + .../Lib/distutils/command/__init__.py | 33 + ShiftOS_TheReturn/Lib/distutils/command/bdist.py | 146 + .../Lib/distutils/command/bdist_dumb.py | 133 + .../Lib/distutils/command/bdist_rpm.py | 588 + .../Lib/distutils/command/bdist_wininst.py | 368 + ShiftOS_TheReturn/Lib/distutils/command/build.py | 147 + .../Lib/distutils/command/build_clib.py | 209 + .../Lib/distutils/command/build_ext.py | 768 ++ .../Lib/distutils/command/build_py.py | 394 + .../Lib/distutils/command/build_scripts.py | 131 + ShiftOS_TheReturn/Lib/distutils/command/check.py | 149 + ShiftOS_TheReturn/Lib/distutils/command/clean.py | 80 + ShiftOS_TheReturn/Lib/distutils/command/config.py | 357 + ShiftOS_TheReturn/Lib/distutils/command/install.py | 672 + .../Lib/distutils/command/install_data.py | 81 + .../Lib/distutils/command/install_egg_info.py | 78 + .../Lib/distutils/command/install_headers.py | 51 + .../Lib/distutils/command/install_lib.py | 219 + .../Lib/distutils/command/install_scripts.py | 64 + .../Lib/distutils/command/register.py | 315 + ShiftOS_TheReturn/Lib/distutils/command/sdist.py | 477 + ShiftOS_TheReturn/Lib/distutils/command/upload.py | 194 + ShiftOS_TheReturn/Lib/distutils/config.py | 116 + ShiftOS_TheReturn/Lib/distutils/core.py | 239 + ShiftOS_TheReturn/Lib/distutils/cygwinccompiler.py | 463 + ShiftOS_TheReturn/Lib/distutils/debug.py | 7 + ShiftOS_TheReturn/Lib/distutils/dep_util.py | 89 + ShiftOS_TheReturn/Lib/distutils/dir_util.py | 214 + ShiftOS_TheReturn/Lib/distutils/dist.py | 1249 ++ ShiftOS_TheReturn/Lib/distutils/emxccompiler.py | 319 + ShiftOS_TheReturn/Lib/distutils/errors.py | 88 + ShiftOS_TheReturn/Lib/distutils/extension.py | 255 + ShiftOS_TheReturn/Lib/distutils/fancy_getopt.py | 484 + ShiftOS_TheReturn/Lib/distutils/file_util.py | 239 + ShiftOS_TheReturn/Lib/distutils/filelist.py | 343 + ShiftOS_TheReturn/Lib/distutils/log.py | 71 + ShiftOS_TheReturn/Lib/distutils/msvccompiler.py | 659 + ShiftOS_TheReturn/Lib/distutils/spawn.py | 226 + ShiftOS_TheReturn/Lib/distutils/sysconfig.py | 483 + ShiftOS_TheReturn/Lib/distutils/text_file.py | 304 + ShiftOS_TheReturn/Lib/distutils/unixccompiler.py | 310 + ShiftOS_TheReturn/Lib/distutils/util.py | 477 + ShiftOS_TheReturn/Lib/distutils/version.py | 299 + .../Lib/distutils/versionpredicate.py | 164 + ShiftOS_TheReturn/Lib/doctest.py | 2817 ++++ ShiftOS_TheReturn/Lib/dumbdbm.py | 249 + ShiftOS_TheReturn/Lib/dummy_thread.py | 145 + ShiftOS_TheReturn/Lib/dummy_threading.py | 78 + ShiftOS_TheReturn/Lib/email/__init__.py | 123 + ShiftOS_TheReturn/Lib/email/_parseaddr.py | 497 + ShiftOS_TheReturn/Lib/email/base64mime.py | 183 + ShiftOS_TheReturn/Lib/email/charset.py | 397 + ShiftOS_TheReturn/Lib/email/encoders.py | 82 + ShiftOS_TheReturn/Lib/email/errors.py | 57 + ShiftOS_TheReturn/Lib/email/feedparser.py | 505 + ShiftOS_TheReturn/Lib/email/generator.py | 371 + ShiftOS_TheReturn/Lib/email/header.py | 514 + ShiftOS_TheReturn/Lib/email/iterators.py | 73 + ShiftOS_TheReturn/Lib/email/message.py | 797 ++ ShiftOS_TheReturn/Lib/email/mime/__init__.py | 0 ShiftOS_TheReturn/Lib/email/mime/application.py | 36 + ShiftOS_TheReturn/Lib/email/mime/audio.py | 73 + ShiftOS_TheReturn/Lib/email/mime/base.py | 26 + ShiftOS_TheReturn/Lib/email/mime/image.py | 46 + ShiftOS_TheReturn/Lib/email/mime/message.py | 34 + ShiftOS_TheReturn/Lib/email/mime/multipart.py | 47 + ShiftOS_TheReturn/Lib/email/mime/nonmultipart.py | 22 + ShiftOS_TheReturn/Lib/email/mime/text.py | 30 + ShiftOS_TheReturn/Lib/email/parser.py | 91 + ShiftOS_TheReturn/Lib/email/quoprimime.py | 336 + ShiftOS_TheReturn/Lib/email/utils.py | 323 + ShiftOS_TheReturn/Lib/encodings/__init__.py | 157 + ShiftOS_TheReturn/Lib/encodings/aliases.py | 527 + ShiftOS_TheReturn/Lib/encodings/ascii.py | 50 + ShiftOS_TheReturn/Lib/encodings/base64_codec.py | 80 + ShiftOS_TheReturn/Lib/encodings/bz2_codec.py | 103 + ShiftOS_TheReturn/Lib/encodings/charmap.py | 69 + ShiftOS_TheReturn/Lib/encodings/cp037.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp1006.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp1026.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp1140.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp1250.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp1251.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp1252.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp1253.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp1254.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp1255.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp1256.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp1257.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp1258.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp424.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp437.py | 698 + ShiftOS_TheReturn/Lib/encodings/cp500.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp720.py | 309 + ShiftOS_TheReturn/Lib/encodings/cp737.py | 698 + ShiftOS_TheReturn/Lib/encodings/cp775.py | 697 + ShiftOS_TheReturn/Lib/encodings/cp850.py | 698 + ShiftOS_TheReturn/Lib/encodings/cp852.py | 698 + ShiftOS_TheReturn/Lib/encodings/cp855.py | 698 + ShiftOS_TheReturn/Lib/encodings/cp856.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp857.py | 694 + ShiftOS_TheReturn/Lib/encodings/cp858.py | 698 + ShiftOS_TheReturn/Lib/encodings/cp860.py | 698 + ShiftOS_TheReturn/Lib/encodings/cp861.py | 698 + ShiftOS_TheReturn/Lib/encodings/cp862.py | 698 + ShiftOS_TheReturn/Lib/encodings/cp863.py | 698 + ShiftOS_TheReturn/Lib/encodings/cp864.py | 690 + ShiftOS_TheReturn/Lib/encodings/cp865.py | 698 + ShiftOS_TheReturn/Lib/encodings/cp866.py | 698 + ShiftOS_TheReturn/Lib/encodings/cp869.py | 689 + ShiftOS_TheReturn/Lib/encodings/cp874.py | 307 + ShiftOS_TheReturn/Lib/encodings/cp875.py | 307 + ShiftOS_TheReturn/Lib/encodings/hex_codec.py | 80 + ShiftOS_TheReturn/Lib/encodings/hp_roman8.py | 152 + ShiftOS_TheReturn/Lib/encodings/idna.py | 288 + ShiftOS_TheReturn/Lib/encodings/iso8859_1.py | 307 + ShiftOS_TheReturn/Lib/encodings/iso8859_10.py | 307 + ShiftOS_TheReturn/Lib/encodings/iso8859_11.py | 307 + ShiftOS_TheReturn/Lib/encodings/iso8859_13.py | 307 + ShiftOS_TheReturn/Lib/encodings/iso8859_14.py | 307 + ShiftOS_TheReturn/Lib/encodings/iso8859_15.py | 307 + ShiftOS_TheReturn/Lib/encodings/iso8859_16.py | 307 + ShiftOS_TheReturn/Lib/encodings/iso8859_2.py | 307 + ShiftOS_TheReturn/Lib/encodings/iso8859_3.py | 307 + ShiftOS_TheReturn/Lib/encodings/iso8859_4.py | 307 + ShiftOS_TheReturn/Lib/encodings/iso8859_5.py | 307 + ShiftOS_TheReturn/Lib/encodings/iso8859_6.py | 307 + ShiftOS_TheReturn/Lib/encodings/iso8859_7.py | 307 + ShiftOS_TheReturn/Lib/encodings/iso8859_8.py | 307 + ShiftOS_TheReturn/Lib/encodings/iso8859_9.py | 307 + ShiftOS_TheReturn/Lib/encodings/koi8_r.py | 307 + ShiftOS_TheReturn/Lib/encodings/koi8_u.py | 307 + ShiftOS_TheReturn/Lib/encodings/latin_1.py | 50 + ShiftOS_TheReturn/Lib/encodings/mac_arabic.py | 698 + ShiftOS_TheReturn/Lib/encodings/mac_centeuro.py | 307 + ShiftOS_TheReturn/Lib/encodings/mac_croatian.py | 307 + ShiftOS_TheReturn/Lib/encodings/mac_cyrillic.py | 307 + ShiftOS_TheReturn/Lib/encodings/mac_farsi.py | 307 + ShiftOS_TheReturn/Lib/encodings/mac_greek.py | 307 + ShiftOS_TheReturn/Lib/encodings/mac_iceland.py | 307 + ShiftOS_TheReturn/Lib/encodings/mac_latin2.py | 183 + ShiftOS_TheReturn/Lib/encodings/mac_roman.py | 307 + ShiftOS_TheReturn/Lib/encodings/mac_romanian.py | 307 + ShiftOS_TheReturn/Lib/encodings/mac_turkish.py | 307 + ShiftOS_TheReturn/Lib/encodings/mbcs.py | 47 + ShiftOS_TheReturn/Lib/encodings/palmos.py | 83 + ShiftOS_TheReturn/Lib/encodings/ptcp154.py | 175 + ShiftOS_TheReturn/Lib/encodings/punycode.py | 238 + ShiftOS_TheReturn/Lib/encodings/quopri_codec.py | 76 + .../Lib/encodings/raw_unicode_escape.py | 45 + ShiftOS_TheReturn/Lib/encodings/rot_13.py | 119 + ShiftOS_TheReturn/Lib/encodings/string_escape.py | 38 + ShiftOS_TheReturn/Lib/encodings/tis_620.py | 307 + ShiftOS_TheReturn/Lib/encodings/undefined.py | 49 + ShiftOS_TheReturn/Lib/encodings/unicode_escape.py | 45 + .../Lib/encodings/unicode_internal.py | 45 + ShiftOS_TheReturn/Lib/encodings/utf_16.py | 126 + ShiftOS_TheReturn/Lib/encodings/utf_16_be.py | 42 + ShiftOS_TheReturn/Lib/encodings/utf_16_le.py | 42 + ShiftOS_TheReturn/Lib/encodings/utf_32.py | 150 + ShiftOS_TheReturn/Lib/encodings/utf_32_be.py | 37 + ShiftOS_TheReturn/Lib/encodings/utf_32_le.py | 37 + ShiftOS_TheReturn/Lib/encodings/utf_7.py | 38 + ShiftOS_TheReturn/Lib/encodings/utf_8.py | 42 + ShiftOS_TheReturn/Lib/encodings/utf_8_sig.py | 117 + ShiftOS_TheReturn/Lib/encodings/uu_codec.py | 130 + ShiftOS_TheReturn/Lib/encodings/zlib_codec.py | 103 + ShiftOS_TheReturn/Lib/ensurepip/__init__.py | 238 + ShiftOS_TheReturn/Lib/ensurepip/__main__.py | 4 + .../_bundled/pip-8.1.1-py2.py3-none-any.whl | Bin 0 -> 1197706 bytes .../setuptools-20.10.1-py2.py3-none-any.whl | Bin 0 -> 509211 bytes ShiftOS_TheReturn/Lib/ensurepip/_uninstall.py | 30 + ShiftOS_TheReturn/Lib/filecmp.py | 296 + ShiftOS_TheReturn/Lib/fileinput.py | 405 + ShiftOS_TheReturn/Lib/fnmatch.py | 120 + ShiftOS_TheReturn/Lib/formatter.py | 445 + ShiftOS_TheReturn/Lib/fpformat.py | 145 + ShiftOS_TheReturn/Lib/fractions.py | 605 + ShiftOS_TheReturn/Lib/ftplib.py | 1078 ++ ShiftOS_TheReturn/Lib/functools.py | 100 + ShiftOS_TheReturn/Lib/genericpath.py | 113 + ShiftOS_TheReturn/Lib/getopt.py | 210 + ShiftOS_TheReturn/Lib/getpass.py | 179 + ShiftOS_TheReturn/Lib/gettext.py | 594 + ShiftOS_TheReturn/Lib/glob.py | 100 + ShiftOS_TheReturn/Lib/gzip.py | 527 + ShiftOS_TheReturn/Lib/hashlib.py | 221 + ShiftOS_TheReturn/Lib/heapq.py | 485 + ShiftOS_TheReturn/Lib/hmac.py | 136 + ShiftOS_TheReturn/Lib/htmlentitydefs.py | 273 + ShiftOS_TheReturn/Lib/htmllib.py | 491 + ShiftOS_TheReturn/Lib/httplib.py | 1445 ++ ShiftOS_TheReturn/Lib/ihooks.py | 554 + ShiftOS_TheReturn/Lib/imaplib.py | 1536 +++ ShiftOS_TheReturn/Lib/imghdr.py | 159 + ShiftOS_TheReturn/Lib/importlib/__init__.py | 38 + ShiftOS_TheReturn/Lib/imputil.py | 725 + ShiftOS_TheReturn/Lib/inspect.py | 1064 ++ ShiftOS_TheReturn/Lib/io.py | 90 + ShiftOS_TheReturn/Lib/json/__init__.py | 352 + ShiftOS_TheReturn/Lib/json/decoder.py | 383 + ShiftOS_TheReturn/Lib/json/encoder.py | 448 + ShiftOS_TheReturn/Lib/json/scanner.py | 67 + ShiftOS_TheReturn/Lib/json/tool.py | 40 + ShiftOS_TheReturn/Lib/keyword.py | 93 + ShiftOS_TheReturn/Lib/lib2to3/__init__.py | 1 + ShiftOS_TheReturn/Lib/lib2to3/__main__.py | 4 + ShiftOS_TheReturn/Lib/lib2to3/btm_matcher.py | 168 + ShiftOS_TheReturn/Lib/lib2to3/btm_utils.py | 283 + ShiftOS_TheReturn/Lib/lib2to3/fixer_base.py | 189 + ShiftOS_TheReturn/Lib/lib2to3/fixer_util.py | 432 + ShiftOS_TheReturn/Lib/lib2to3/fixes/__init__.py | 1 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_apply.py | 59 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_asserts.py | 34 + .../Lib/lib2to3/fixes/fix_basestring.py | 14 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_buffer.py | 22 + .../Lib/lib2to3/fixes/fix_callable.py | 37 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_dict.py | 107 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_except.py | 93 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_exec.py | 40 + .../Lib/lib2to3/fixes/fix_execfile.py | 52 + .../Lib/lib2to3/fixes/fix_exitfunc.py | 72 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_filter.py | 76 + .../Lib/lib2to3/fixes/fix_funcattrs.py | 21 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_future.py | 22 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_getcwdu.py | 19 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_has_key.py | 110 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_idioms.py | 152 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_import.py | 99 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_imports.py | 145 + .../Lib/lib2to3/fixes/fix_imports2.py | 16 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_input.py | 26 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_intern.py | 46 + .../Lib/lib2to3/fixes/fix_isinstance.py | 52 + .../Lib/lib2to3/fixes/fix_itertools.py | 43 + .../Lib/lib2to3/fixes/fix_itertools_imports.py | 57 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_long.py | 19 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_map.py | 91 + .../Lib/lib2to3/fixes/fix_metaclass.py | 228 + .../Lib/lib2to3/fixes/fix_methodattrs.py | 24 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_ne.py | 23 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_next.py | 103 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_nonzero.py | 21 + .../Lib/lib2to3/fixes/fix_numliterals.py | 28 + .../Lib/lib2to3/fixes/fix_operator.py | 96 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_paren.py | 44 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_print.py | 87 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_raise.py | 90 + .../Lib/lib2to3/fixes/fix_raw_input.py | 17 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_reduce.py | 35 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_renames.py | 70 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_repr.py | 23 + .../Lib/lib2to3/fixes/fix_set_literal.py | 53 + .../Lib/lib2to3/fixes/fix_standarderror.py | 18 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_sys_exc.py | 30 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_throw.py | 56 + .../Lib/lib2to3/fixes/fix_tuple_params.py | 175 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_types.py | 62 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_unicode.py | 42 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_urllib.py | 197 + .../Lib/lib2to3/fixes/fix_ws_comma.py | 39 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_xrange.py | 73 + .../Lib/lib2to3/fixes/fix_xreadlines.py | 25 + ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_zip.py | 35 + ShiftOS_TheReturn/Lib/lib2to3/main.py | 269 + ShiftOS_TheReturn/Lib/lib2to3/patcomp.py | 205 + ShiftOS_TheReturn/Lib/lib2to3/pgen2/__init__.py | 4 + ShiftOS_TheReturn/Lib/lib2to3/pgen2/conv.py | 257 + ShiftOS_TheReturn/Lib/lib2to3/pgen2/driver.py | 157 + ShiftOS_TheReturn/Lib/lib2to3/pgen2/grammar.py | 185 + ShiftOS_TheReturn/Lib/lib2to3/pgen2/literals.py | 60 + ShiftOS_TheReturn/Lib/lib2to3/pgen2/parse.py | 201 + ShiftOS_TheReturn/Lib/lib2to3/pgen2/pgen.py | 386 + ShiftOS_TheReturn/Lib/lib2to3/pgen2/token.py | 83 + ShiftOS_TheReturn/Lib/lib2to3/pgen2/tokenize.py | 502 + ShiftOS_TheReturn/Lib/lib2to3/pygram.py | 40 + ShiftOS_TheReturn/Lib/lib2to3/pytree.py | 887 ++ ShiftOS_TheReturn/Lib/lib2to3/refactor.py | 747 ++ ShiftOS_TheReturn/Lib/linecache.py | 139 + ShiftOS_TheReturn/Lib/locale.py | 2064 +++ ShiftOS_TheReturn/Lib/logging/__init__.py | 1744 +++ ShiftOS_TheReturn/Lib/logging/config.py | 919 ++ ShiftOS_TheReturn/Lib/logging/handlers.py | 1227 ++ ShiftOS_TheReturn/Lib/macpath.py | 216 + ShiftOS_TheReturn/Lib/macurl2path.py | 77 + ShiftOS_TheReturn/Lib/mailbox.py | 2240 ++++ ShiftOS_TheReturn/Lib/mailcap.py | 255 + ShiftOS_TheReturn/Lib/markupbase.py | 396 + ShiftOS_TheReturn/Lib/md5.py | 14 + ShiftOS_TheReturn/Lib/mhlib.py | 1005 ++ ShiftOS_TheReturn/Lib/mimetools.py | 250 + ShiftOS_TheReturn/Lib/mimetypes.py | 598 + ShiftOS_TheReturn/Lib/mimify.py | 468 + ShiftOS_TheReturn/Lib/modulefinder.py | 716 + ShiftOS_TheReturn/Lib/multifile.py | 162 + ShiftOS_TheReturn/Lib/multiprocessing/__init__.py | 281 + .../Lib/multiprocessing/connection.py | 477 + .../Lib/multiprocessing/dummy/__init__.py | 153 + .../Lib/multiprocessing/dummy/connection.py | 87 + ShiftOS_TheReturn/Lib/multiprocessing/forking.py | 526 + ShiftOS_TheReturn/Lib/multiprocessing/heap.py | 254 + ShiftOS_TheReturn/Lib/multiprocessing/managers.py | 1117 ++ ShiftOS_TheReturn/Lib/multiprocessing/pool.py | 744 ++ ShiftOS_TheReturn/Lib/multiprocessing/process.py | 323 + ShiftOS_TheReturn/Lib/multiprocessing/queues.py | 395 + ShiftOS_TheReturn/Lib/multiprocessing/reduction.py | 215 + .../Lib/multiprocessing/sharedctypes.py | 271 + .../Lib/multiprocessing/synchronize.py | 344 + ShiftOS_TheReturn/Lib/multiprocessing/util.py | 350 + ShiftOS_TheReturn/Lib/mutex.py | 55 + ShiftOS_TheReturn/Lib/netrc.py | 145 + ShiftOS_TheReturn/Lib/new.py | 17 + ShiftOS_TheReturn/Lib/nntplib.py | 636 + ShiftOS_TheReturn/Lib/ntpath.py | 550 + ShiftOS_TheReturn/Lib/nturl2path.py | 68 + ShiftOS_TheReturn/Lib/numbers.py | 391 + ShiftOS_TheReturn/Lib/opcode.py | 192 + ShiftOS_TheReturn/Lib/optparse.py | 1704 +++ ShiftOS_TheReturn/Lib/os.py | 742 ++ ShiftOS_TheReturn/Lib/os2emxpath.py | 160 + ShiftOS_TheReturn/Lib/pdb.py | 1341 ++ ShiftOS_TheReturn/Lib/pickle.py | 1397 ++ ShiftOS_TheReturn/Lib/pickletools.py | 2274 ++++ ShiftOS_TheReturn/Lib/pipes.py | 278 + ShiftOS_TheReturn/Lib/pkgutil.py | 591 + ShiftOS_TheReturn/Lib/platform.py | 1604 +++ ShiftOS_TheReturn/Lib/plistlib.py | 474 + ShiftOS_TheReturn/Lib/popen2.py | 201 + ShiftOS_TheReturn/Lib/poplib.py | 427 + ShiftOS_TheReturn/Lib/posixfile.py | 237 + ShiftOS_TheReturn/Lib/posixpath.py | 439 + ShiftOS_TheReturn/Lib/pprint.py | 346 + ShiftOS_TheReturn/Lib/profile.py | 610 + ShiftOS_TheReturn/Lib/pstats.py | 705 + ShiftOS_TheReturn/Lib/py_compile.py | 118 + ShiftOS_TheReturn/Lib/pyclbr.py | 344 + ShiftOS_TheReturn/Lib/pydoc.py | 2409 ++++ ShiftOS_TheReturn/Lib/pydoc_data/__init__.py | 0 ShiftOS_TheReturn/Lib/pydoc_data/topics.py | 13325 +++++++++++++++++++ ShiftOS_TheReturn/Lib/quopri.py | 237 + ShiftOS_TheReturn/Lib/random.py | 910 ++ ShiftOS_TheReturn/Lib/repr.py | 132 + ShiftOS_TheReturn/Lib/rexec.py | 588 + ShiftOS_TheReturn/Lib/rfc822.py | 1016 ++ ShiftOS_TheReturn/Lib/rlcompleter.py | 172 + ShiftOS_TheReturn/Lib/robotparser.py | 233 + ShiftOS_TheReturn/Lib/runpy.py | 290 + ShiftOS_TheReturn/Lib/sched.py | 134 + ShiftOS_TheReturn/Lib/sets.py | 557 + ShiftOS_TheReturn/Lib/sgmllib.py | 553 + ShiftOS_TheReturn/Lib/sha.py | 15 + ShiftOS_TheReturn/Lib/shelve.py | 243 + ShiftOS_TheReturn/Lib/shlex.py | 292 + ShiftOS_TheReturn/Lib/shutil.py | 564 + ShiftOS_TheReturn/Lib/site-packages/README.txt | 2 + ShiftOS_TheReturn/Lib/site.py | 604 + ShiftOS_TheReturn/Lib/smtpd.py | 555 + ShiftOS_TheReturn/Lib/smtplib.py | 883 ++ ShiftOS_TheReturn/Lib/sndhdr.py | 228 + ShiftOS_TheReturn/Lib/sqlite3/__init__.py | 32 + ShiftOS_TheReturn/Lib/sqlite3/dbapi2.py | 90 + ShiftOS_TheReturn/Lib/sqlite3/dump.py | 70 + ShiftOS_TheReturn/Lib/sre_compile.py | 596 + ShiftOS_TheReturn/Lib/sre_constants.py | 263 + ShiftOS_TheReturn/Lib/sre_parse.py | 834 ++ ShiftOS_TheReturn/Lib/ssl.py | 1037 ++ ShiftOS_TheReturn/Lib/stat.py | 96 + ShiftOS_TheReturn/Lib/statvfs.py | 18 + ShiftOS_TheReturn/Lib/string.py | 656 + ShiftOS_TheReturn/Lib/stringold.py | 432 + ShiftOS_TheReturn/Lib/stringprep.py | 272 + ShiftOS_TheReturn/Lib/struct.py | 3 + ShiftOS_TheReturn/Lib/subprocess.py | 1748 +++ ShiftOS_TheReturn/Lib/sunau.py | 493 + ShiftOS_TheReturn/Lib/sunaudio.py | 49 + ShiftOS_TheReturn/Lib/symbol.py | 114 + ShiftOS_TheReturn/Lib/sysconfig.py | 642 + ShiftOS_TheReturn/Lib/tabnanny.py | 329 + ShiftOS_TheReturn/Lib/tarfile.py | 2628 ++++ ShiftOS_TheReturn/Lib/telnetlib.py | 791 ++ ShiftOS_TheReturn/Lib/tempfile.py | 640 + ShiftOS_TheReturn/Lib/textwrap.py | 429 + ShiftOS_TheReturn/Lib/this.py | 28 + ShiftOS_TheReturn/Lib/threading.py | 1322 ++ ShiftOS_TheReturn/Lib/timeit.py | 343 + ShiftOS_TheReturn/Lib/toaiff.py | 110 + ShiftOS_TheReturn/Lib/token.py | 140 + ShiftOS_TheReturn/Lib/tokenize.py | 449 + ShiftOS_TheReturn/Lib/trace.py | 819 ++ ShiftOS_TheReturn/Lib/traceback.py | 320 + ShiftOS_TheReturn/Lib/types.py | 86 + ShiftOS_TheReturn/Lib/unittest/__init__.py | 69 + ShiftOS_TheReturn/Lib/unittest/__main__.py | 12 + ShiftOS_TheReturn/Lib/unittest/case.py | 1076 ++ ShiftOS_TheReturn/Lib/unittest/loader.py | 316 + ShiftOS_TheReturn/Lib/unittest/main.py | 236 + ShiftOS_TheReturn/Lib/unittest/result.py | 193 + ShiftOS_TheReturn/Lib/unittest/runner.py | 196 + ShiftOS_TheReturn/Lib/unittest/signals.py | 71 + ShiftOS_TheReturn/Lib/unittest/suite.py | 303 + ShiftOS_TheReturn/Lib/unittest/util.py | 156 + ShiftOS_TheReturn/Lib/urllib.py | 1660 +++ ShiftOS_TheReturn/Lib/urllib2.py | 1489 +++ ShiftOS_TheReturn/Lib/urlparse.py | 428 + ShiftOS_TheReturn/Lib/user.py | 48 + ShiftOS_TheReturn/Lib/uu.py | 196 + ShiftOS_TheReturn/Lib/uuid.py | 597 + ShiftOS_TheReturn/Lib/warnings.py | 422 + ShiftOS_TheReturn/Lib/wave.py | 517 + ShiftOS_TheReturn/Lib/weakref.py | 458 + ShiftOS_TheReturn/Lib/webbrowser.py | 704 + ShiftOS_TheReturn/Lib/whichdb.py | 117 + ShiftOS_TheReturn/Lib/wsgiref/__init__.py | 23 + ShiftOS_TheReturn/Lib/wsgiref/handlers.py | 450 + ShiftOS_TheReturn/Lib/wsgiref/headers.py | 169 + ShiftOS_TheReturn/Lib/wsgiref/simple_server.py | 163 + ShiftOS_TheReturn/Lib/wsgiref/util.py | 165 + ShiftOS_TheReturn/Lib/wsgiref/validate.py | 432 + ShiftOS_TheReturn/Lib/xdrlib.py | 248 + ShiftOS_TheReturn/Lib/xml/__init__.py | 41 + ShiftOS_TheReturn/Lib/xml/dom/NodeFilter.py | 27 + ShiftOS_TheReturn/Lib/xml/dom/__init__.py | 139 + ShiftOS_TheReturn/Lib/xml/dom/domreg.py | 99 + ShiftOS_TheReturn/Lib/xml/dom/minicompat.py | 110 + ShiftOS_TheReturn/Lib/xml/dom/minidom.py | 1941 +++ ShiftOS_TheReturn/Lib/xml/dom/pulldom.py | 351 + ShiftOS_TheReturn/Lib/xml/dom/xmlbuilder.py | 386 + ShiftOS_TheReturn/Lib/xml/etree/ElementInclude.py | 142 + ShiftOS_TheReturn/Lib/xml/etree/ElementPath.py | 303 + ShiftOS_TheReturn/Lib/xml/etree/ElementTree.py | 1684 +++ .../Lib/xml/etree/SimpleXMLTreeBuilder.py | 143 + ShiftOS_TheReturn/Lib/xml/etree/__init__.py | 33 + ShiftOS_TheReturn/Lib/xml/parsers/__init__.py | 8 + ShiftOS_TheReturn/Lib/xml/sax/__init__.py | 108 + ShiftOS_TheReturn/Lib/xml/sax/_exceptions.py | 131 + ShiftOS_TheReturn/Lib/xml/sax/handler.py | 342 + ShiftOS_TheReturn/Lib/xml/sax/saxutils.py | 353 + ShiftOS_TheReturn/Lib/xml/sax/xmlreader.py | 381 + ShiftOS_TheReturn/Lib/xmllib.py | 930 ++ ShiftOS_TheReturn/Lib/xmlrpclib.py | 1656 +++ ShiftOS_TheReturn/Lib/zipfile.py | 1541 +++ ShiftOS_TheReturn/Properties/Resources.Designer.cs | 74 +- ShiftOS_TheReturn/Properties/Resources.resx | 3 + ShiftOS_TheReturn/PythonAPI.cs | 309 + ShiftOS_TheReturn/ReflectMan.cs | 45 +- ShiftOS_TheReturn/Resources/pywintemplate.txt | 68 + ShiftOS_TheReturn/ShiftOS.Engine.csproj | 1575 +++ ShiftOS_TheReturn/packages.config | 4 + 535 files changed, 208623 insertions(+), 65 deletions(-) create mode 100644 ShiftOS.WinForms/MainMenu/Loading.Designer.cs create mode 100644 ShiftOS.WinForms/MainMenu/Loading.cs create mode 100644 ShiftOS.WinForms/MainMenu/Loading.resx create mode 100644 ShiftOS_TheReturn/Lib/BaseHTTPServer.py create mode 100644 ShiftOS_TheReturn/Lib/Bastion.py create mode 100644 ShiftOS_TheReturn/Lib/CGIHTTPServer.py create mode 100644 ShiftOS_TheReturn/Lib/ConfigParser.py create mode 100644 ShiftOS_TheReturn/Lib/Cookie.py create mode 100644 ShiftOS_TheReturn/Lib/DocXMLRPCServer.py create mode 100644 ShiftOS_TheReturn/Lib/HTMLParser.py create mode 100644 ShiftOS_TheReturn/Lib/MimeWriter.py create mode 100644 ShiftOS_TheReturn/Lib/Queue.py create mode 100644 ShiftOS_TheReturn/Lib/SimpleHTTPServer.py create mode 100644 ShiftOS_TheReturn/Lib/SimpleXMLRPCServer.py create mode 100644 ShiftOS_TheReturn/Lib/SocketServer.py create mode 100644 ShiftOS_TheReturn/Lib/StringIO.py create mode 100644 ShiftOS_TheReturn/Lib/UserDict.py create mode 100644 ShiftOS_TheReturn/Lib/UserList.py create mode 100644 ShiftOS_TheReturn/Lib/UserString.py create mode 100644 ShiftOS_TheReturn/Lib/_LWPCookieJar.py create mode 100644 ShiftOS_TheReturn/Lib/_MozillaCookieJar.py create mode 100644 ShiftOS_TheReturn/Lib/__future__.py create mode 100644 ShiftOS_TheReturn/Lib/__phello__.foo.py create mode 100644 ShiftOS_TheReturn/Lib/_abcoll.py create mode 100644 ShiftOS_TheReturn/Lib/_osx_support.py create mode 100644 ShiftOS_TheReturn/Lib/_pyio.py create mode 100644 ShiftOS_TheReturn/Lib/_strptime.py create mode 100644 ShiftOS_TheReturn/Lib/_threading_local.py create mode 100644 ShiftOS_TheReturn/Lib/_weakrefset.py create mode 100644 ShiftOS_TheReturn/Lib/abc.py create mode 100644 ShiftOS_TheReturn/Lib/aifc.py create mode 100644 ShiftOS_TheReturn/Lib/antigravity.py create mode 100644 ShiftOS_TheReturn/Lib/anydbm.py create mode 100644 ShiftOS_TheReturn/Lib/argparse.py create mode 100644 ShiftOS_TheReturn/Lib/ast.py create mode 100644 ShiftOS_TheReturn/Lib/asynchat.py create mode 100644 ShiftOS_TheReturn/Lib/asyncore.py create mode 100644 ShiftOS_TheReturn/Lib/atexit.py create mode 100644 ShiftOS_TheReturn/Lib/audiodev.py create mode 100644 ShiftOS_TheReturn/Lib/base64.py create mode 100644 ShiftOS_TheReturn/Lib/bdb.py create mode 100644 ShiftOS_TheReturn/Lib/binhex.py create mode 100644 ShiftOS_TheReturn/Lib/bisect.py create mode 100644 ShiftOS_TheReturn/Lib/calendar.py create mode 100644 ShiftOS_TheReturn/Lib/cgi.py create mode 100644 ShiftOS_TheReturn/Lib/cgitb.py create mode 100644 ShiftOS_TheReturn/Lib/chunk.py create mode 100644 ShiftOS_TheReturn/Lib/cmd.py create mode 100644 ShiftOS_TheReturn/Lib/code.py create mode 100644 ShiftOS_TheReturn/Lib/codecs.py create mode 100644 ShiftOS_TheReturn/Lib/codeop.py create mode 100644 ShiftOS_TheReturn/Lib/collections.py create mode 100644 ShiftOS_TheReturn/Lib/colorsys.py create mode 100644 ShiftOS_TheReturn/Lib/commands.py create mode 100644 ShiftOS_TheReturn/Lib/compileall.py create mode 100644 ShiftOS_TheReturn/Lib/contextlib.py create mode 100644 ShiftOS_TheReturn/Lib/cookielib.py create mode 100644 ShiftOS_TheReturn/Lib/copy.py create mode 100644 ShiftOS_TheReturn/Lib/csv.py create mode 100644 ShiftOS_TheReturn/Lib/ctypes/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/ctypes/_endian.py create mode 100644 ShiftOS_TheReturn/Lib/ctypes/macholib/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/ctypes/macholib/dyld.py create mode 100644 ShiftOS_TheReturn/Lib/ctypes/macholib/dylib.py create mode 100644 ShiftOS_TheReturn/Lib/ctypes/macholib/framework.py create mode 100644 ShiftOS_TheReturn/Lib/ctypes/util.py create mode 100644 ShiftOS_TheReturn/Lib/ctypes/wintypes.py create mode 100644 ShiftOS_TheReturn/Lib/decimal.py create mode 100644 ShiftOS_TheReturn/Lib/difflib.py create mode 100644 ShiftOS_TheReturn/Lib/dircache.py create mode 100644 ShiftOS_TheReturn/Lib/dis.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/archive_util.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/bcppcompiler.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/ccompiler.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/cmd.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/bdist.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/bdist_dumb.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/bdist_rpm.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/bdist_wininst.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/build.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/build_clib.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/build_ext.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/build_py.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/build_scripts.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/check.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/clean.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/config.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/install.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/install_data.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/install_egg_info.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/install_headers.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/install_lib.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/install_scripts.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/register.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/sdist.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/command/upload.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/config.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/core.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/cygwinccompiler.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/debug.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/dep_util.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/dir_util.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/dist.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/emxccompiler.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/errors.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/extension.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/fancy_getopt.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/file_util.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/filelist.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/log.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/msvccompiler.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/spawn.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/sysconfig.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/text_file.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/unixccompiler.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/util.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/version.py create mode 100644 ShiftOS_TheReturn/Lib/distutils/versionpredicate.py create mode 100644 ShiftOS_TheReturn/Lib/doctest.py create mode 100644 ShiftOS_TheReturn/Lib/dumbdbm.py create mode 100644 ShiftOS_TheReturn/Lib/dummy_thread.py create mode 100644 ShiftOS_TheReturn/Lib/dummy_threading.py create mode 100644 ShiftOS_TheReturn/Lib/email/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/email/_parseaddr.py create mode 100644 ShiftOS_TheReturn/Lib/email/base64mime.py create mode 100644 ShiftOS_TheReturn/Lib/email/charset.py create mode 100644 ShiftOS_TheReturn/Lib/email/encoders.py create mode 100644 ShiftOS_TheReturn/Lib/email/errors.py create mode 100644 ShiftOS_TheReturn/Lib/email/feedparser.py create mode 100644 ShiftOS_TheReturn/Lib/email/generator.py create mode 100644 ShiftOS_TheReturn/Lib/email/header.py create mode 100644 ShiftOS_TheReturn/Lib/email/iterators.py create mode 100644 ShiftOS_TheReturn/Lib/email/message.py create mode 100644 ShiftOS_TheReturn/Lib/email/mime/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/email/mime/application.py create mode 100644 ShiftOS_TheReturn/Lib/email/mime/audio.py create mode 100644 ShiftOS_TheReturn/Lib/email/mime/base.py create mode 100644 ShiftOS_TheReturn/Lib/email/mime/image.py create mode 100644 ShiftOS_TheReturn/Lib/email/mime/message.py create mode 100644 ShiftOS_TheReturn/Lib/email/mime/multipart.py create mode 100644 ShiftOS_TheReturn/Lib/email/mime/nonmultipart.py create mode 100644 ShiftOS_TheReturn/Lib/email/mime/text.py create mode 100644 ShiftOS_TheReturn/Lib/email/parser.py create mode 100644 ShiftOS_TheReturn/Lib/email/quoprimime.py create mode 100644 ShiftOS_TheReturn/Lib/email/utils.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/aliases.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/ascii.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/base64_codec.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/bz2_codec.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/charmap.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp037.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp1006.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp1026.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp1140.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp1250.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp1251.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp1252.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp1253.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp1254.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp1255.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp1256.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp1257.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp1258.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp424.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp437.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp500.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp720.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp737.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp775.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp850.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp852.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp855.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp856.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp857.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp858.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp860.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp861.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp862.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp863.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp864.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp865.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp866.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp869.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp874.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/cp875.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/hex_codec.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/hp_roman8.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/idna.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/iso8859_1.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/iso8859_10.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/iso8859_11.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/iso8859_13.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/iso8859_14.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/iso8859_15.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/iso8859_16.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/iso8859_2.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/iso8859_3.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/iso8859_4.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/iso8859_5.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/iso8859_6.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/iso8859_7.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/iso8859_8.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/iso8859_9.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/koi8_r.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/koi8_u.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/latin_1.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/mac_arabic.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/mac_centeuro.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/mac_croatian.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/mac_cyrillic.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/mac_farsi.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/mac_greek.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/mac_iceland.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/mac_latin2.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/mac_roman.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/mac_romanian.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/mac_turkish.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/mbcs.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/palmos.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/ptcp154.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/punycode.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/quopri_codec.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/raw_unicode_escape.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/rot_13.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/string_escape.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/tis_620.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/undefined.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/unicode_escape.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/unicode_internal.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/utf_16.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/utf_16_be.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/utf_16_le.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/utf_32.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/utf_32_be.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/utf_32_le.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/utf_7.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/utf_8.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/utf_8_sig.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/uu_codec.py create mode 100644 ShiftOS_TheReturn/Lib/encodings/zlib_codec.py create mode 100644 ShiftOS_TheReturn/Lib/ensurepip/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/ensurepip/__main__.py create mode 100644 ShiftOS_TheReturn/Lib/ensurepip/_bundled/pip-8.1.1-py2.py3-none-any.whl create mode 100644 ShiftOS_TheReturn/Lib/ensurepip/_bundled/setuptools-20.10.1-py2.py3-none-any.whl create mode 100644 ShiftOS_TheReturn/Lib/ensurepip/_uninstall.py create mode 100644 ShiftOS_TheReturn/Lib/filecmp.py create mode 100644 ShiftOS_TheReturn/Lib/fileinput.py create mode 100644 ShiftOS_TheReturn/Lib/fnmatch.py create mode 100644 ShiftOS_TheReturn/Lib/formatter.py create mode 100644 ShiftOS_TheReturn/Lib/fpformat.py create mode 100644 ShiftOS_TheReturn/Lib/fractions.py create mode 100644 ShiftOS_TheReturn/Lib/ftplib.py create mode 100644 ShiftOS_TheReturn/Lib/functools.py create mode 100644 ShiftOS_TheReturn/Lib/genericpath.py create mode 100644 ShiftOS_TheReturn/Lib/getopt.py create mode 100644 ShiftOS_TheReturn/Lib/getpass.py create mode 100644 ShiftOS_TheReturn/Lib/gettext.py create mode 100644 ShiftOS_TheReturn/Lib/glob.py create mode 100644 ShiftOS_TheReturn/Lib/gzip.py create mode 100644 ShiftOS_TheReturn/Lib/hashlib.py create mode 100644 ShiftOS_TheReturn/Lib/heapq.py create mode 100644 ShiftOS_TheReturn/Lib/hmac.py create mode 100644 ShiftOS_TheReturn/Lib/htmlentitydefs.py create mode 100644 ShiftOS_TheReturn/Lib/htmllib.py create mode 100644 ShiftOS_TheReturn/Lib/httplib.py create mode 100644 ShiftOS_TheReturn/Lib/ihooks.py create mode 100644 ShiftOS_TheReturn/Lib/imaplib.py create mode 100644 ShiftOS_TheReturn/Lib/imghdr.py create mode 100644 ShiftOS_TheReturn/Lib/importlib/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/imputil.py create mode 100644 ShiftOS_TheReturn/Lib/inspect.py create mode 100644 ShiftOS_TheReturn/Lib/io.py create mode 100644 ShiftOS_TheReturn/Lib/json/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/json/decoder.py create mode 100644 ShiftOS_TheReturn/Lib/json/encoder.py create mode 100644 ShiftOS_TheReturn/Lib/json/scanner.py create mode 100644 ShiftOS_TheReturn/Lib/json/tool.py create mode 100644 ShiftOS_TheReturn/Lib/keyword.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/__main__.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/btm_matcher.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/btm_utils.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixer_base.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixer_util.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_apply.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_asserts.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_basestring.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_buffer.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_callable.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_dict.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_except.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_exec.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_execfile.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_exitfunc.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_filter.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_funcattrs.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_future.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_getcwdu.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_has_key.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_idioms.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_import.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_imports.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_imports2.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_input.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_intern.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_isinstance.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_itertools.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_itertools_imports.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_long.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_map.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_metaclass.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_methodattrs.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_ne.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_next.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_nonzero.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_numliterals.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_operator.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_paren.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_print.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_raise.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_raw_input.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_reduce.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_renames.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_repr.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_set_literal.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_standarderror.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_sys_exc.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_throw.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_tuple_params.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_types.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_unicode.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_urllib.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_ws_comma.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_xrange.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_xreadlines.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/fixes/fix_zip.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/main.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/patcomp.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/pgen2/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/pgen2/conv.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/pgen2/driver.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/pgen2/grammar.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/pgen2/literals.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/pgen2/parse.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/pgen2/pgen.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/pgen2/token.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/pgen2/tokenize.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/pygram.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/pytree.py create mode 100644 ShiftOS_TheReturn/Lib/lib2to3/refactor.py create mode 100644 ShiftOS_TheReturn/Lib/linecache.py create mode 100644 ShiftOS_TheReturn/Lib/locale.py create mode 100644 ShiftOS_TheReturn/Lib/logging/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/logging/config.py create mode 100644 ShiftOS_TheReturn/Lib/logging/handlers.py create mode 100644 ShiftOS_TheReturn/Lib/macpath.py create mode 100644 ShiftOS_TheReturn/Lib/macurl2path.py create mode 100644 ShiftOS_TheReturn/Lib/mailbox.py create mode 100644 ShiftOS_TheReturn/Lib/mailcap.py create mode 100644 ShiftOS_TheReturn/Lib/markupbase.py create mode 100644 ShiftOS_TheReturn/Lib/md5.py create mode 100644 ShiftOS_TheReturn/Lib/mhlib.py create mode 100644 ShiftOS_TheReturn/Lib/mimetools.py create mode 100644 ShiftOS_TheReturn/Lib/mimetypes.py create mode 100644 ShiftOS_TheReturn/Lib/mimify.py create mode 100644 ShiftOS_TheReturn/Lib/modulefinder.py create mode 100644 ShiftOS_TheReturn/Lib/multifile.py create mode 100644 ShiftOS_TheReturn/Lib/multiprocessing/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/multiprocessing/connection.py create mode 100644 ShiftOS_TheReturn/Lib/multiprocessing/dummy/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/multiprocessing/dummy/connection.py create mode 100644 ShiftOS_TheReturn/Lib/multiprocessing/forking.py create mode 100644 ShiftOS_TheReturn/Lib/multiprocessing/heap.py create mode 100644 ShiftOS_TheReturn/Lib/multiprocessing/managers.py create mode 100644 ShiftOS_TheReturn/Lib/multiprocessing/pool.py create mode 100644 ShiftOS_TheReturn/Lib/multiprocessing/process.py create mode 100644 ShiftOS_TheReturn/Lib/multiprocessing/queues.py create mode 100644 ShiftOS_TheReturn/Lib/multiprocessing/reduction.py create mode 100644 ShiftOS_TheReturn/Lib/multiprocessing/sharedctypes.py create mode 100644 ShiftOS_TheReturn/Lib/multiprocessing/synchronize.py create mode 100644 ShiftOS_TheReturn/Lib/multiprocessing/util.py create mode 100644 ShiftOS_TheReturn/Lib/mutex.py create mode 100644 ShiftOS_TheReturn/Lib/netrc.py create mode 100644 ShiftOS_TheReturn/Lib/new.py create mode 100644 ShiftOS_TheReturn/Lib/nntplib.py create mode 100644 ShiftOS_TheReturn/Lib/ntpath.py create mode 100644 ShiftOS_TheReturn/Lib/nturl2path.py create mode 100644 ShiftOS_TheReturn/Lib/numbers.py create mode 100644 ShiftOS_TheReturn/Lib/opcode.py create mode 100644 ShiftOS_TheReturn/Lib/optparse.py create mode 100644 ShiftOS_TheReturn/Lib/os.py create mode 100644 ShiftOS_TheReturn/Lib/os2emxpath.py create mode 100644 ShiftOS_TheReturn/Lib/pdb.py create mode 100644 ShiftOS_TheReturn/Lib/pickle.py create mode 100644 ShiftOS_TheReturn/Lib/pickletools.py create mode 100644 ShiftOS_TheReturn/Lib/pipes.py create mode 100644 ShiftOS_TheReturn/Lib/pkgutil.py create mode 100644 ShiftOS_TheReturn/Lib/platform.py create mode 100644 ShiftOS_TheReturn/Lib/plistlib.py create mode 100644 ShiftOS_TheReturn/Lib/popen2.py create mode 100644 ShiftOS_TheReturn/Lib/poplib.py create mode 100644 ShiftOS_TheReturn/Lib/posixfile.py create mode 100644 ShiftOS_TheReturn/Lib/posixpath.py create mode 100644 ShiftOS_TheReturn/Lib/pprint.py create mode 100644 ShiftOS_TheReturn/Lib/profile.py create mode 100644 ShiftOS_TheReturn/Lib/pstats.py create mode 100644 ShiftOS_TheReturn/Lib/py_compile.py create mode 100644 ShiftOS_TheReturn/Lib/pyclbr.py create mode 100644 ShiftOS_TheReturn/Lib/pydoc.py create mode 100644 ShiftOS_TheReturn/Lib/pydoc_data/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/pydoc_data/topics.py create mode 100644 ShiftOS_TheReturn/Lib/quopri.py create mode 100644 ShiftOS_TheReturn/Lib/random.py create mode 100644 ShiftOS_TheReturn/Lib/repr.py create mode 100644 ShiftOS_TheReturn/Lib/rexec.py create mode 100644 ShiftOS_TheReturn/Lib/rfc822.py create mode 100644 ShiftOS_TheReturn/Lib/rlcompleter.py create mode 100644 ShiftOS_TheReturn/Lib/robotparser.py create mode 100644 ShiftOS_TheReturn/Lib/runpy.py create mode 100644 ShiftOS_TheReturn/Lib/sched.py create mode 100644 ShiftOS_TheReturn/Lib/sets.py create mode 100644 ShiftOS_TheReturn/Lib/sgmllib.py create mode 100644 ShiftOS_TheReturn/Lib/sha.py create mode 100644 ShiftOS_TheReturn/Lib/shelve.py create mode 100644 ShiftOS_TheReturn/Lib/shlex.py create mode 100644 ShiftOS_TheReturn/Lib/shutil.py create mode 100644 ShiftOS_TheReturn/Lib/site-packages/README.txt create mode 100644 ShiftOS_TheReturn/Lib/site.py create mode 100644 ShiftOS_TheReturn/Lib/smtpd.py create mode 100644 ShiftOS_TheReturn/Lib/smtplib.py create mode 100644 ShiftOS_TheReturn/Lib/sndhdr.py create mode 100644 ShiftOS_TheReturn/Lib/sqlite3/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/sqlite3/dbapi2.py create mode 100644 ShiftOS_TheReturn/Lib/sqlite3/dump.py create mode 100644 ShiftOS_TheReturn/Lib/sre_compile.py create mode 100644 ShiftOS_TheReturn/Lib/sre_constants.py create mode 100644 ShiftOS_TheReturn/Lib/sre_parse.py create mode 100644 ShiftOS_TheReturn/Lib/ssl.py create mode 100644 ShiftOS_TheReturn/Lib/stat.py create mode 100644 ShiftOS_TheReturn/Lib/statvfs.py create mode 100644 ShiftOS_TheReturn/Lib/string.py create mode 100644 ShiftOS_TheReturn/Lib/stringold.py create mode 100644 ShiftOS_TheReturn/Lib/stringprep.py create mode 100644 ShiftOS_TheReturn/Lib/struct.py create mode 100644 ShiftOS_TheReturn/Lib/subprocess.py create mode 100644 ShiftOS_TheReturn/Lib/sunau.py create mode 100644 ShiftOS_TheReturn/Lib/sunaudio.py create mode 100644 ShiftOS_TheReturn/Lib/symbol.py create mode 100644 ShiftOS_TheReturn/Lib/sysconfig.py create mode 100644 ShiftOS_TheReturn/Lib/tabnanny.py create mode 100644 ShiftOS_TheReturn/Lib/tarfile.py create mode 100644 ShiftOS_TheReturn/Lib/telnetlib.py create mode 100644 ShiftOS_TheReturn/Lib/tempfile.py create mode 100644 ShiftOS_TheReturn/Lib/textwrap.py create mode 100644 ShiftOS_TheReturn/Lib/this.py create mode 100644 ShiftOS_TheReturn/Lib/threading.py create mode 100644 ShiftOS_TheReturn/Lib/timeit.py create mode 100644 ShiftOS_TheReturn/Lib/toaiff.py create mode 100644 ShiftOS_TheReturn/Lib/token.py create mode 100644 ShiftOS_TheReturn/Lib/tokenize.py create mode 100644 ShiftOS_TheReturn/Lib/trace.py create mode 100644 ShiftOS_TheReturn/Lib/traceback.py create mode 100644 ShiftOS_TheReturn/Lib/types.py create mode 100644 ShiftOS_TheReturn/Lib/unittest/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/unittest/__main__.py create mode 100644 ShiftOS_TheReturn/Lib/unittest/case.py create mode 100644 ShiftOS_TheReturn/Lib/unittest/loader.py create mode 100644 ShiftOS_TheReturn/Lib/unittest/main.py create mode 100644 ShiftOS_TheReturn/Lib/unittest/result.py create mode 100644 ShiftOS_TheReturn/Lib/unittest/runner.py create mode 100644 ShiftOS_TheReturn/Lib/unittest/signals.py create mode 100644 ShiftOS_TheReturn/Lib/unittest/suite.py create mode 100644 ShiftOS_TheReturn/Lib/unittest/util.py create mode 100644 ShiftOS_TheReturn/Lib/urllib.py create mode 100644 ShiftOS_TheReturn/Lib/urllib2.py create mode 100644 ShiftOS_TheReturn/Lib/urlparse.py create mode 100644 ShiftOS_TheReturn/Lib/user.py create mode 100644 ShiftOS_TheReturn/Lib/uu.py create mode 100644 ShiftOS_TheReturn/Lib/uuid.py create mode 100644 ShiftOS_TheReturn/Lib/warnings.py create mode 100644 ShiftOS_TheReturn/Lib/wave.py create mode 100644 ShiftOS_TheReturn/Lib/weakref.py create mode 100644 ShiftOS_TheReturn/Lib/webbrowser.py create mode 100644 ShiftOS_TheReturn/Lib/whichdb.py create mode 100644 ShiftOS_TheReturn/Lib/wsgiref/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/wsgiref/handlers.py create mode 100644 ShiftOS_TheReturn/Lib/wsgiref/headers.py create mode 100644 ShiftOS_TheReturn/Lib/wsgiref/simple_server.py create mode 100644 ShiftOS_TheReturn/Lib/wsgiref/util.py create mode 100644 ShiftOS_TheReturn/Lib/wsgiref/validate.py create mode 100644 ShiftOS_TheReturn/Lib/xdrlib.py create mode 100644 ShiftOS_TheReturn/Lib/xml/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/xml/dom/NodeFilter.py create mode 100644 ShiftOS_TheReturn/Lib/xml/dom/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/xml/dom/domreg.py create mode 100644 ShiftOS_TheReturn/Lib/xml/dom/minicompat.py create mode 100644 ShiftOS_TheReturn/Lib/xml/dom/minidom.py create mode 100644 ShiftOS_TheReturn/Lib/xml/dom/pulldom.py create mode 100644 ShiftOS_TheReturn/Lib/xml/dom/xmlbuilder.py create mode 100644 ShiftOS_TheReturn/Lib/xml/etree/ElementInclude.py create mode 100644 ShiftOS_TheReturn/Lib/xml/etree/ElementPath.py create mode 100644 ShiftOS_TheReturn/Lib/xml/etree/ElementTree.py create mode 100644 ShiftOS_TheReturn/Lib/xml/etree/SimpleXMLTreeBuilder.py create mode 100644 ShiftOS_TheReturn/Lib/xml/etree/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/xml/parsers/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/xml/sax/__init__.py create mode 100644 ShiftOS_TheReturn/Lib/xml/sax/_exceptions.py create mode 100644 ShiftOS_TheReturn/Lib/xml/sax/handler.py create mode 100644 ShiftOS_TheReturn/Lib/xml/sax/saxutils.py create mode 100644 ShiftOS_TheReturn/Lib/xml/sax/xmlreader.py create mode 100644 ShiftOS_TheReturn/Lib/xmllib.py create mode 100644 ShiftOS_TheReturn/Lib/xmlrpclib.py create mode 100644 ShiftOS_TheReturn/Lib/zipfile.py create mode 100644 ShiftOS_TheReturn/PythonAPI.cs create mode 100644 ShiftOS_TheReturn/Resources/pywintemplate.txt (limited to 'ShiftOS.WinForms/ShiftOS.WinForms.csproj') diff --git a/ModLauncher/App.config b/ModLauncher/App.config index 757ddce..4e65683 100644 --- a/ModLauncher/App.config +++ b/ModLauncher/App.config @@ -13,6 +13,14 @@ + + + + + + + + \ No newline at end of file diff --git a/ShiftOS.MFSProfiler/App.config b/ShiftOS.MFSProfiler/App.config index a0a13df..b899c11 100644 --- a/ShiftOS.MFSProfiler/App.config +++ b/ShiftOS.MFSProfiler/App.config @@ -14,6 +14,14 @@ + + + + + + + + \ No newline at end of file diff --git a/ShiftOS.Modding.VB.LegacySkinConverter/App.config b/ShiftOS.Modding.VB.LegacySkinConverter/App.config index 757ddce..4e65683 100644 --- a/ShiftOS.Modding.VB.LegacySkinConverter/App.config +++ b/ShiftOS.Modding.VB.LegacySkinConverter/App.config @@ -13,6 +13,14 @@ + + + + + + + + \ No newline at end of file diff --git a/ShiftOS.Modding.VirtualMachine/App.config b/ShiftOS.Modding.VirtualMachine/App.config index 757ddce..4e65683 100644 --- a/ShiftOS.Modding.VirtualMachine/App.config +++ b/ShiftOS.Modding.VirtualMachine/App.config @@ -13,6 +13,14 @@ + + + + + + + + \ No newline at end of file diff --git a/ShiftOS.Updater/App.config b/ShiftOS.Updater/App.config index 757ddce..4e65683 100644 --- a/ShiftOS.Updater/App.config +++ b/ShiftOS.Updater/App.config @@ -13,6 +13,14 @@ + + + + + + + + \ No newline at end of file diff --git a/ShiftOS.WinForms/App.config b/ShiftOS.WinForms/App.config index a0a13df..b899c11 100644 --- a/ShiftOS.WinForms/App.config +++ b/ShiftOS.WinForms/App.config @@ -14,6 +14,14 @@ + + + + + + + + \ No newline at end of file diff --git a/ShiftOS.WinForms/MainMenu/Loading.Designer.cs b/ShiftOS.WinForms/MainMenu/Loading.Designer.cs new file mode 100644 index 0000000..95619d9 --- /dev/null +++ b/ShiftOS.WinForms/MainMenu/Loading.Designer.cs @@ -0,0 +1,66 @@ +namespace ShiftOS.WinForms.MainMenu +{ + partial class Loading + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // label + // + this.label.Dock = System.Windows.Forms.DockStyle.Fill; + this.label.Font = new System.Drawing.Font("Tahoma", 72F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label.ForeColor = System.Drawing.Color.White; + this.label.Location = new System.Drawing.Point(0, 0); + this.label.Name = "label"; + this.label.Size = new System.Drawing.Size(284, 262); + this.label.TabIndex = 0; + this.label.Text = "Loading..."; + this.label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // Loading + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Black; + this.ClientSize = new System.Drawing.Size(284, 262); + this.Controls.Add(this.label); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "Loading"; + this.Text = "Loading"; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.Shown += new System.EventHandler(this.Loading_FormShown); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label label; + } +} \ No newline at end of file diff --git a/ShiftOS.WinForms/MainMenu/Loading.cs b/ShiftOS.WinForms/MainMenu/Loading.cs new file mode 100644 index 0000000..555f1d4 --- /dev/null +++ b/ShiftOS.WinForms/MainMenu/Loading.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using ShiftOS.Engine; + +namespace ShiftOS.WinForms.MainMenu +{ + public partial class Loading : Form + { + public Loading() + { + InitializeComponent(); + } + + private void Loading_FormShown(object sender, EventArgs e) + { + // This hideous timer thing is the most reliable way to make the form update + // before it starts doing stuff. + var callback = new Timer(); + callback.Tick += (o, a) => { Desktop.CurrentDesktop.Show(); Hide(); callback.Stop(); }; + callback.Interval = 1; + callback.Start(); + } + } +} diff --git a/ShiftOS.WinForms/MainMenu/Loading.resx b/ShiftOS.WinForms/MainMenu/Loading.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.WinForms/MainMenu/Loading.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ShiftOS.WinForms/MainMenu/MainMenu.cs b/ShiftOS.WinForms/MainMenu/MainMenu.cs index e11edc2..1936fec 100644 --- a/ShiftOS.WinForms/MainMenu/MainMenu.cs +++ b/ShiftOS.WinForms/MainMenu/MainMenu.cs @@ -15,6 +15,11 @@ namespace ShiftOS.WinForms.MainMenu { public partial class MainMenu : Form { + private void StartGame() + { + new Loading().Show(); + } + public MainMenu(IDesktop desk) { InitializeComponent(); @@ -163,7 +168,7 @@ namespace ShiftOS.WinForms.MainMenu private void button2_Click(object sender, EventArgs e) { (Desktop.CurrentDesktop as WinformsDesktop).IsSandbox = true; - Desktop.CurrentDesktop.Show(); + StartGame(); } private void button3_Click(object sender, EventArgs e) @@ -239,7 +244,7 @@ namespace ShiftOS.WinForms.MainMenu private void btncontinue_Click(object sender, EventArgs e) { - Desktop.CurrentDesktop.Show(); + StartGame(); } @@ -253,13 +258,13 @@ namespace ShiftOS.WinForms.MainMenu if (result == true) { System.IO.File.Delete(path); - Desktop.CurrentDesktop.Show(); + StartGame(); } }); } else { - Desktop.CurrentDesktop.Show(); + StartGame(); } } } diff --git a/ShiftOS.WinForms/Properties/Resources.Designer.cs b/ShiftOS.WinForms/Properties/Resources.Designer.cs index 137db4b..2cba3c9 100644 --- a/ShiftOS.WinForms/Properties/Resources.Designer.cs +++ b/ShiftOS.WinForms/Properties/Resources.Designer.cs @@ -1094,7 +1094,7 @@ namespace ShiftOS.WinForms.Properties { /// Name: "NetXtreme Hyper Edition", /// CostPerMonth: 150, /// DownloadSpeed: 524288, //512 kb/s - /// Description: "It's time to supercharge your Shift [rest of string was truncated]";. + /// Description: "It's time to supercharge your Shiftnet experience. [rest of string was truncated]";. /// internal static string ShiftnetServices { get { @@ -1116,7 +1116,8 @@ namespace ShiftOS.WinForms.Properties { /// Name: "Icon Manager", /// Cost: 450, /// Description: "This tool allows you to add and edit application icons within ShiftOS for the small prive of 450 Codepoints!", - /// Dependencies: "skinning [rest of string was truncated]";. + /// Dependencies: "skinning", + /// Category [rest of string was truncated]";. /// internal static string Shiftorium { get { @@ -1126,7 +1127,7 @@ namespace ShiftOS.WinForms.Properties { /// /// Looks up a localized string similar to {\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} - ///{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;}{\fl [rest of string was truncated]";. + ///{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;}{\flo [rest of string was truncated]";. /// internal static string ShiftOS { get { @@ -1275,7 +1276,8 @@ namespace ShiftOS.WinForms.Properties { ///Eine kurze Erklärung wie du das Terminal benutzt lautet wiefolgt. Du kannst das command 'sos.help' benutzen um eine Liste aller commands aufzurufen. Schreib es ///einfach in das Terminal und drücke <enter> um alle commands anzuzeigen. /// - ///Commands können mit argumenten versehen werden, indem du ein key-value Paar in einem {} Block hinter dem command angibst. Zum Be [rest of string was truncated]";. + ///Commands können mit argumenten versehen werden, indem du ein key-value Paar in einem {} Block hinter dem command angibst. Zum Beispiel: + /// [rest of string was truncated]";. /// internal static string strings_de { get { @@ -1294,7 +1296,8 @@ namespace ShiftOS.WinForms.Properties { ///Commands can be sent arguments by specifying a key-value pair inside a {} block at the end of the command. For example: /// ///some.command{print:\"hello\"} - ///math.add{op1 [rest of string was truncated]";. + ///math.add{op1:1,op2:2} + /// [rest of string was truncated]";. /// internal static string strings_en { get { @@ -1482,7 +1485,7 @@ namespace ShiftOS.WinForms.Properties { /// "Before you can begin with ShiftOS, you'll need to know a few things about it.", /// "One: Terminal command syntax.", /// "Inside ShiftOS, the bulk of your time is going to be spent within the Terminal.", - /// "The Terminal is an application that starts up when you turn on your computer. It allows you to execute system commands, ope [rest of string was truncated]";. + /// "The Terminal is an application that starts up when you turn on your computer. It allows you to execute system commands, open program [rest of string was truncated]";. /// internal static string sys_shiftoriumstory { get { diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj index e0a53ea..31de44e 100644 --- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj +++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj @@ -37,6 +37,7 @@ ..\packages\CommonMark.NET.0.15.0\lib\net45\CommonMark.dll True + ..\packages\NAudio.1.8.0\lib\net35\NAudio.dll @@ -356,6 +357,12 @@ + + Form + + + Loading.cs + Form @@ -609,6 +616,9 @@ GUILogin.cs + + Loading.cs + MainMenu.cs @@ -875,6 +885,7 @@ + diff --git a/ShiftOS_TheReturn/App.config b/ShiftOS_TheReturn/App.config index a0a13df..b899c11 100644 --- a/ShiftOS_TheReturn/App.config +++ b/ShiftOS_TheReturn/App.config @@ -14,6 +14,14 @@ + + + + + + + + \ No newline at end of file diff --git a/ShiftOS_TheReturn/Commands.cs b/ShiftOS_TheReturn/Commands.cs index da4fb29..6f3ab15 100644 --- a/ShiftOS_TheReturn/Commands.cs +++ b/ShiftOS_TheReturn/Commands.cs @@ -804,8 +804,7 @@ shiftorium.buy{{upgrade:""{upg.ID}""}}"); foreach (var type in Array.FindAll(ReflectMan.Types, t => t.GetInterfaces().Contains(typeof(IShiftOSWindow)) && Shiftorium.UpgradeAttributesUnlocked(t))) foreach (var attr in Array.FindAll(type.GetCustomAttributes(false), a => a is WinOpenAttribute)) - if (Shiftorium.UpgradeAttributesUnlocked(type)) - Console.WriteLine("win.open{app:\"" + (attr as WinOpenAttribute).ID + "\"}"); + Console.WriteLine("win.open{app:\"" + (attr as WinOpenAttribute).ID + "\"}"); return true; diff --git a/ShiftOS_TheReturn/Lib/BaseHTTPServer.py b/ShiftOS_TheReturn/Lib/BaseHTTPServer.py new file mode 100644 index 0000000..3df3323 --- /dev/null +++ b/ShiftOS_TheReturn/Lib/BaseHTTPServer.py @@ -0,0 +1,614 @@ +"""HTTP server base class. + +Note: the class in this module doesn't implement any HTTP request; see +SimpleHTTPServer for simple implementations of GET, HEAD and POST +(including CGI scripts). It does, however, optionally implement HTTP/1.1 +persistent connections, as of version 0.3. + +Contents: + +- BaseHTTPRequestHandler: HTTP request handler base class +- test: test function + +XXX To do: + +- log requests even later (to capture byte count) +- log user-agent header and other interesting goodies +- send error log to separate file +""" + + +# See also: +# +# HTTP Working Group T. Berners-Lee +# INTERNET-DRAFT R. T. Fielding +# H. Frystyk Nielsen +# Expires September 8, 1995 March 8, 1995 +# +# URL: http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-00.txt +# +# and +# +# Network Working Group R. Fielding +# Request for Comments: 2616 et al +# Obsoletes: 2068 June 1999 +# Category: Standards Track +# +# URL: http://www.faqs.org/rfcs/rfc2616.html + +# Log files +# --------- +# +# Here's a quote from the NCSA httpd docs about log file format. +# +# | The logfile format is as follows. Each line consists of: +# | +# | host rfc931 authuser [DD/Mon/YYYY:hh:mm:ss] "request" ddd bbbb +# | +# | host: Either the DNS name or the IP number of the remote client +# | rfc931: Any information returned by identd for this person, +# | - otherwise. +# | authuser: If user sent a userid for authentication, the user name, +# | - otherwise. +# | DD: Day +# | Mon: Month (calendar name) +# | YYYY: Year +# | hh: hour (24-hour format, the machine's timezone) +# | mm: minutes +# | ss: seconds +# | request: The first line of the HTTP request as sent by the client. +# | ddd: the status code returned by the server, - if not available. +# | bbbb: the total number of bytes sent, +# | *not including the HTTP/1.0 header*, - if not available +# | +# | You can determine the name of the file accessed through request. +# +# (Actually, the latter is only true if you know the server configuration +# at the time the request was made!) + +__version__ = "0.3" + +__all__ = ["HTTPServer", "BaseHTTPRequestHandler"] + +import sys +import time +import socket # For gethostbyaddr() +from warnings import filterwarnings, catch_warnings +with catch_warnings(): + if sys.py3kwarning: + filterwarnings("ignore", ".*mimetools has been removed", + DeprecationWarning) + import mimetools +import SocketServer + +# Default error message template +DEFAULT_ERROR_MESSAGE = """\ + +Error response + + +

Error response

+

Error code %(code)d. +

Message: %(message)s. +

Error code explanation: %(code)s = %(explain)s. + +""" + +DEFAULT_ERROR_CONTENT_TYPE = "text/html" + +def _quote_html(html): + return html.replace("&", "&").replace("<", "<").replace(">", ">") + +class HTTPServer(SocketServer.TCPServer): + + allow_reuse_address = 1 # Seems to make sense in testing environment + + def server_bind(self): + """Override server_bind to store the server name.""" + SocketServer.TCPServer.server_bind(self) + host, port = self.socket.getsockname()[:2] + self.server_name = socket.getfqdn(host) + self.server_port = port + + +class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler): + + """HTTP request handler base class. + + The following explanation of HTTP serves to guide you through the + code as well as to expose any misunderstandings I may have about + HTTP (so you don't need to read the code to figure out I'm wrong + :-). + + HTTP (HyperText Transfer Protocol) is an extensible protocol on + top of a reliable stream transport (e.g. TCP/IP). The protocol + recognizes three parts to a request: + + 1. One line identifying the request type and path + 2. An optional set of RFC-822-style headers + 3. An optional data part + + The headers and data are separated by a blank line. + + The first line of the request has the form + + + + where is a (case-sensitive) keyword such as GET or POST, + is a string containing path information for the request, + and should be the string "HTTP/1.0" or "HTTP/1.1". + is encoded using the URL encoding scheme (using %xx to signify + the ASCII character with hex code xx). + + The specification specifies that lines are separated by CRLF but + for compatibility with the widest range of clients recommends + servers also handle LF. Similarly, whitespace in the request line + is treated sensibly (allowing multiple spaces between components + and allowing trailing whitespace). + + Similarly, for output, lines ought to be separated by CRLF pairs + but most clients grok LF characters just fine. + + If the first line of the request has the form + + + + (i.e. is left out) then this is assumed to be an HTTP + 0.9 request; this form has no optional headers and data part and + the reply consists of just the data. + + The reply form of the HTTP 1.x protocol again has three parts: + + 1. One line giving the response code + 2. An optional set of RFC-822-style headers + 3. The data + + Again, the headers and data are separated by a blank line. + + The response code line has the form + + + + where is the protocol version ("HTTP/1.0" or "HTTP/1.1"), + is a 3-digit response code indicating success or + failure of the request, and is an optional + human-readable string explaining what the response code means. + + This server parses the request and the headers, and then calls a + function specific to the request type (). Specifically, + a request SPAM will be handled by a method do_SPAM(). If no + such method exists the server sends an error response to the + client. If it exists, it is called with no arguments: + + do_SPAM() + + Note that the request name is case sensitive (i.e. SPAM and spam + are different requests). + + The various request details are stored in instance variables: + + - client_address is the client IP address in the form (host, + port); + + - command, path and version are the broken-down request line; + + - headers is an instance of mimetools.Message (or a derived + class) containing the header information; + + - rfile is a file object open for reading positioned at the + start of the optional input data part; + + - wfile is a file object open for writing. + + IT IS IMPORTANT TO ADHERE TO THE PROTOCOL FOR WRITING! + + The first thing to be written must be the response line. Then + follow 0 or more header lines, then a blank line, and then the + actual data (if any). The meaning of the header lines depends on + the command executed by the server; in most cases, when data is + returned, there should be at least one header line of the form + + Content-type: / + + where and should be registered MIME types, + e.g. "text/html" or "text/plain". + + """ + + # The Python system version, truncated to its first component. + sys_version = "Python/" + sys.version.split()[0] + + # The server software version. You may want to override this. + # The format is multiple whitespace-separated strings, + # where each string is of the form name[/version]. + server_version = "BaseHTTP/" + __version__ + + # The default request version. This only affects responses up until + # the point where the request line is parsed, so it mainly decides what + # the client gets back when sending a malformed request line. + # Most web servers default to HTTP 0.9, i.e. don't send a status line. + default_request_version = "HTTP/0.9" + + def parse_request(self): + """Parse a request (internal). + + The request should be stored in self.raw_requestline; the results + are in self.command, self.path, self.request_version and + self.headers. + + Return True for success, False for failure; on failure, an + error is sent back. + + """ + self.command = None # set in case of error on the first line + self.request_version = version = self.default_request_version + self.close_connection = 1 + requestline = self.raw_requestline + requestline = requestline.rstrip('\r\n') + self.requestline = requestline + words = requestline.split() + if len(words) == 3: + command, path, version = words + if version[:5] != 'HTTP/': + self.send_error(400, "Bad request version (%r)" % version) + return False + try: + base_version_number = version.split('/', 1)[1] + version_number = base_version_number.split(".") + # RFC 2145 section 3.1 says there can be only one "." and + # - major and minor numbers MUST be treated as + # separate integers; + # - HTTP/2.4 is a lower version than HTTP/2.13, which in + # turn is lower than HTTP/12.3; + # - Leading zeros MUST be ignored by recipients. + if len(version_number) != 2: + raise ValueError + version_number = int(version_number[0]), int(version_number[1]) + except (ValueError, IndexError): + self.send_error(400, "Bad request version (%r)" % version) + return False + if version_number >= (1, 1) and self.protocol_version >= "HTTP/1.1": + self.close_connection = 0 + if version_number >= (2, 0): + self.send_error(505, + "Invalid HTTP Version (%s)" % base_version_number) + return False + elif len(words) == 2: + command, path = words + self.close_connection = 1 + if command != 'GET': + self.send_error(400, + "Bad HTTP/0.9 request type (%r)" % command) + return False + elif not words: + return False + else: + self.send_error(400, "Bad request syntax (%r)" % requestline) + return False + self.command, self.path, self.request_version = command, path, version + + # Examine the headers and look for a Connection directive + self.headers = self.MessageClass(self.rfile, 0) + + conntype = self.headers.get('Connection', "") + if conntype.lower() == 'close': + self.close_connection = 1 + elif (conntype.lower() == 'keep-alive' and + self.protocol_version >= "HTTP/1.1"): + self.close_connection = 0 + return True + + def handle_one_request(self): + """Handle a single HTTP request. + + You normally don't need to override this method; see the class + __doc__ string for information on how to handle specific HTTP + commands such as GET and POST. + + """ + try: + self.raw_requestline = self.rfile.readline(65537) + if len(self.raw_requestline) > 65536: + self.requestline = '' + self.request_version = '' + self.command = '' + self.send_error(414) + return + if not self.raw_requestline: + self.close_connection = 1 + return + if not self.parse_request(): + # An error code has been sent, just exit + return + mname = 'do_' + self.command + if not hasattr(self, mname): + self.send_error(501, "Unsupported method (%r)" % self.command) + return + method = getattr(self, mname) + method() + self.wfile.flush() #actually send the response if not already done. + except socket.timeout, e: + #a read or a write timed out. Discard this connection + self.log_error("Request timed out: %r", e) + self.close_connection = 1 + return + + def handle(self): + """Handle multiple requests if necessary.""" + self.close_connection = 1 + + self.handle_one_request() + while not self.close_connection: + self.handle_one_request() + + def send_error(self, code, message=None): + """Send and log an error reply. + + Arguments are the error code, and a detailed message. + The detailed message defaults to the short entry matching the + response code. + + This sends an error response (so it must be called before any + output has been generated), logs the error, and finally sends + a piece of HTML explaining the error to the user. + + """ + + try: + short, long = self.responses[code] + except KeyError: + short, long = '???', '???' + if message is None: + message = short + explain = long + self.log_error("code %d, message %s", code, message) + self.send_response(code, message) + self.send_header('Connection', 'close') + + # Message body is omitted for cases described in: + # - RFC7230: 3.3. 1xx, 204(No Content), 304(Not Modified) + # - RFC7231: 6.3.6. 205(Reset Content) + content = None + if code >= 200 and code not in (204, 205, 304): + # HTML encode to prevent Cross Site Scripting attacks + # (see bug #1100201) + content = (self.error_message_format % { + 'code': code, + 'message': _quote_html(message), + 'explain': explain + }) + self.send_header("Content-Type", self.error_content_type) + self.end_headers() + + if self.command != 'HEAD' and content: + self.wfile.write(content) + + error_message_format = DEFAULT_ERROR_MESSAGE + error_content_type = DEFAULT_ERROR_CONTENT_TYPE + + def send_response(self, code, message=None): + """Send the response header and log the response code. + + Also send two standard headers with the server software + version and the current date. + + """ + self.log_request(code) + if message is None: + if code in self.responses: + message = self.responses[code][0] + else: + message = '' + if self.request_version != 'HTTP/0.9': + self.wfile.write("%s %d %s\r\n" % + (self.protocol_version, code, message)) + # print (self.protocol_version, code, message) + self.send_header('Server', self.version_string()) + self.send_header('Date', self.date_time_string()) + + def send_header(self, keyword, value): + """Send a MIME header.""" + if self.request_version != 'HTTP/0.9': + self.wfile.write("%s: %s\r\n" % (keyword, value)) + + if keyword.lower() == 'connection': + if value.lower() == 'close': + self.close_connection = 1 + elif value.lower() == 'keep-alive': + self.close_connection = 0 + + def end_headers(self): + """Send the blank line ending the MIME headers.""" + if self.request_version != 'HTTP/0.9': + self.wfile.write("\r\n") + + def log_request(self, code='-', size='-'): + """Log an accepted request. + + This is called by send_response(). + + """ + + self.log_message('"%s" %s %s', + self.requestline, str(code), str(size)) + + def log_error(self, format, *args): + """Log an error. + + This is called when a request cannot be fulfilled. By + default it passes the message on to log_message(). + + Arguments are the same as for log_message(). + + XXX This should go to the separate error log. + + """ + + self.log_message(format, *args) + + def log_message(self, format, *args): + """Log an arbitrary message. + + This is used by all other logging functions. Override + it if you have specific logging wishes. + + The first argument, FORMAT, is a format string for the + message to be logged. If the format string contains + any % escapes requiring parameters, they should be + specified as subsequent arguments (it's just like + printf!). + + The client ip address and current date/time are prefixed to every + message. + + """ + + sys.stderr.write("%s - - [%s] %s\n" % + (self.client_address[0], + self.log_date_time_string(), + format%args)) + + def version_string(self): + """Return the server software version string.""" + return self.server_version + ' ' + self.sys_version + + def date_time_string(self, timestamp=None): + """Return the current date and time formatted for a message header.""" + if timestamp is None: + timestamp = time.time() + year, month, day, hh, mm, ss, wd, y, z = time.gmtime(timestamp) + s = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % ( + self.weekdayname[wd], + day, self.monthname[month], year, + hh, mm, ss) + return s + + def log_date_time_string(self): + """Return the current time formatted for logging.""" + now = time.time() + year, month, day, hh, mm, ss, x, y, z = time.localtime(now) + s = "%02d/%3s/%04d %02d:%02d:%02d" % ( + day, self.monthname[month], year, hh, mm, ss) + return s + + weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] + + monthname = [None, + 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] + + def address_string(self): + """Return the client address formatted for logging. + + This version looks up the full hostname using gethostbyaddr(), + and tries to find a name that contains at least one dot. + + """ + + host, port = self.client_address[:2] + return socket.getfqdn(host) + + # Essentially static class variables + + # The version of the HTTP protocol we support. + # Set this to HTTP/1.1 to enable automatic keepalive + protocol_version = "HTTP/1.0" + + # The Message-like class used to parse headers + MessageClass = mimetools.Message + + # Table mapping response codes to messages; entries have the + # form {code: (shortmessage, longmessage)}. + # See RFC 2616. + responses = { + 100: ('Continue', 'Request received, please continue'), + 101: ('Switching Protocols', + 'Switching to new protocol; obey Upgrade header'), + + 200: ('OK', 'Request fulfilled, document follows'), + 201: ('Created', 'Document created, URL follows'), + 202: ('Accepted', + 'Request accepted, processing continues off-line'), + 203: ('Non-Authoritative Information', 'Request fulfilled from cache'), + 204: ('No Content', 'Request fulfilled, nothing follows'), + 205: ('Reset Content', 'Clear input form for further input.'), + 206: ('Partial Content', 'Partial content follows.'), + + 300: ('Multiple Choices', + 'Object has several resources -- see URI list'), + 301: ('Moved Permanently', 'Object moved permanently -- see URI list'), + 302: ('Found', 'Object moved temporarily -- see URI list'), + 303: ('See Other', 'Object moved -- see Method and URL list'), + 304: ('Not Modified', + 'Document has not changed since given time'), + 305: ('Use Proxy', + 'You must use proxy specified in Location to access this ' + 'resource.'), + 307: ('Temporary Redirect', + 'Object moved temporarily -- see URI list'), + + 400: ('Bad Request', + 'Bad request syntax or unsupported method'), + 401: ('Unauthorized', + 'No permission -- see authorization schemes'), + 402: ('Payment Required', + 'No payment -- see charging schemes'), + 403: ('Forbidden', + 'Request forbidden -- authorization will not help'), + 404: ('Not Found', 'Nothing matches the given URI'), + 405: ('Method Not Allowed', + 'Specified method is invalid for this resource.'), + 406: ('Not Acceptable', 'URI not available in preferred format.'), + 407: ('Proxy Authentication Required', 'You must authenticate with ' + 'this proxy before proceeding.'), + 408: ('Request Timeout', 'Request timed out; try again later.'), + 409: ('Conflict', 'Request conflict.'), + 410: ('Gone', + 'URI no longer exists and has been permanently removed.'), + 411: ('Length Required', 'Client must specify Content-Length.'), + 412: ('Precondition Failed', 'Precondition in headers is false.'), + 413: ('Request Entity Too Large', 'Entity is too large.'), + 414: ('Request-URI Too Long', 'URI is too long.'), + 415: ('Unsupported Media Type', 'Entity body in unsupported format.'), + 416: ('Requested Range Not Satisfiable', + 'Cannot satisfy request range.'), + 417: ('Expectation Failed', + 'Expect condition could not be satisfied.'), + + 500: ('Internal Server Error', 'Server got itself in trouble'), + 501: ('Not Implemented', + 'Server does not support this operation'), + 502: ('Bad Gateway', 'Invalid responses from another server/proxy.'), + 503: ('Service Unavailable', + 'The server cannot process the request due to a high load'), + 504: ('Gateway Timeout', + 'The gateway server did not receive a timely response'), + 505: ('HTTP Version Not Supported', 'Cannot fulfill request.'), + } + + +def test(HandlerClass = BaseHTTPRequestHandler, + ServerClass = HTTPServer, protocol="HTTP/1.0"): + """Test the HTTP request handler class. + + This runs an HTTP server on port 8000 (or the first command line + argument). + + """ + + if sys.argv[1:]: + port = int(sys.argv[1]) + else: + port = 8000 + server_address = ('', port) + + HandlerClass.protocol_version = protocol + httpd = ServerClass(server_address, HandlerClass) + + sa = httpd.socket.getsockname() + print "Serving HTTP on", sa[0], "port", sa[1], "..." + httpd.serve_forever() + + +if __name__ == '__main__': + test() diff --git a/ShiftOS_TheReturn/Lib/Bastion.py b/ShiftOS_TheReturn/Lib/Bastion.py new file mode 100644 index 0000000..d0dddbf --- /dev/null +++ b/ShiftOS_TheReturn/Lib/Bastion.py @@ -0,0 +1,180 @@ +"""Bastionification utility. + +A bastion (for another object -- the 'original') is an object that has +the same methods as the original but does not give access to its +instance variables. Bastions have a number of uses, but the most +obvious one is to provide code executing in restricted mode with a +safe interface to an object implemented in unrestricted mode. + +The bastionification routine has an optional second argument which is +a filter function. Only those methods for which the filter method +(called with the method name as argument) returns true are accessible. +The default filter method returns true unless the method name begins +with an underscore. + +There are a number of possible implementations of bastions. We use a +'lazy' approach where the bastion's __getattr__() discipline does all +the work for a particular method the first time it is used. This is +usually fastest, especially if the user doesn't call all available +methods. The retrieved methods are stored as instance variables of +the bastion, so the overhead is only occurred on the first use of each +method. + +Detail: the bastion class has a __repr__() discipline which includes +the repr() of the original object. This is precomputed when the +bastion is created. + +""" +from warnings import warnpy3k +warnpy3k("the Bastion module has been removed in Python 3.0", stacklevel=2) +del warnpy3k + +__all__ = ["BastionClass", "Bastion"] + +from types import MethodType + + +class BastionClass: + + """Helper class used by the Bastion() function. + + You could subclass this and pass the subclass as the bastionclass + argument to the Bastion() function, as long as the constructor has + the same signature (a get() function and a name for the object). + + """ + + def __init__(self, get, name): + """Constructor. + + Arguments: + + get - a function that gets the attribute value (by name) + name - a human-readable name for the original object + (suggestion: use repr(object)) + + """ + self._get_ = get + self._name_ = name + + def __repr__(self): + """Return a representation string. + + This includes the name passed in to the constructor, so that + if you print the bastion during debugging, at least you have + some idea of what it is. + + """ + return "" % self._name_ + + def __getattr__(self, name): + """Get an as-yet undefined attribute value. + + This calls the get() function that was passed to the + constructor. The result is stored as an instance variable so + that the next time the same attribute is requested, + __getattr__() won't be invoked. + + If the get() function raises an exception, this is simply + passed on -- exceptions are not cached. + + """ + attribute = self._get_(name) + self.__dict__[name] = attribute + return attribute + + +def Bastion(object, filter = lambda name: name[:1] != '_', + name=None, bastionclass=BastionClass): + """Create a bastion for an object, using an optional filter. + + See the Bastion module's documentation for background. + + Arguments: + + object - the original object + filter - a predicate that decides whether a function name is OK; + by default all names are OK that don't start with '_' + name - the name of the object; default repr(object) + bastionclass - class used to create the bastion; default BastionClass + + """ + + raise RuntimeError, "This code is not secure in Python 2.2 and later" + + # Note: we define *two* ad-hoc functions here, get1 and get2. + # Both are intended to be called in the same way: get(name). + # It is clear that the real work (getting the attribute + # from the object and calling the filter) is done in get1. + # Why can't we pass get1 to the bastion? Because the user + # would be able to override the filter argument! With get2, + # overriding the default argument is no security loophole: + # all it does is call it. + # Also notice that we can't place the object and filter as + # instance variables on the bastion object itself, since + # the user has full access to all instance variables! + + def get1(name, object=object, filter=filter): + """Internal function for Bastion(). See source comments.""" + if filter(name): + attribute = getattr(object, name) + if type(attribute) == MethodType: + return attribute + raise AttributeError, name + + def get2(name, get1=get1): + """Internal function for Bastion(). See source comments.""" + return get1(name) + + if name is None: + name = repr(object) + return bastionclass(get2, name) + + +def _test(): + """Test the Bastion() function.""" + class Original: + def __init__(self): + self.sum = 0 + def add(self, n): + self._add(n) + def _add(self, n): + self.sum = self.sum + n + def total(self): + return self.sum + o = Original() + b = Bastion(o) + testcode = """if 1: + b.add(81) + b.add(18) + print "b.total() =", b.total() + try: + print "b.sum =", b.sum, + except: + print "inaccessible" + else: + print "accessible" + try: + print "b._add =", b._add, + except: + print "inaccessible" + else: + print "accessible" + try: + print "b._get_.func_defaults =", map(type, b._get_.func_defaults), + except: + print "inaccessible" + else: + print "accessible" + \n""" + exec testcode + print '='*20, "Using rexec:", '='*20 + import rexec + r = rexec.RExec() + m = r.add_module('__main__') + m.b = b + r.r_exec(testcode) + + +if __name__ == '__main__': + _test() diff --git a/ShiftOS_TheReturn/Lib/CGIHTTPServer.py b/ShiftOS_TheReturn/Lib/CGIHTTPServer.py new file mode 100644 index 0000000..5620083 --- /dev/null +++ b/ShiftOS_TheReturn/Lib/CGIHTTPServer.py @@ -0,0 +1,378 @@ +"""CGI-savvy HTTP Server. + +This module builds on SimpleHTTPServer by implementing GET and POST +requests to cgi-bin scripts. + +If the os.fork() function is not present (e.g. on Windows), +os.popen2() is used as a fallback, with slightly altered semantics; if +that function is not present either (e.g. on Macintosh), only Python +scripts are supported, and they are executed by the current process. + +In all cases, the implementation is intentionally naive -- all +requests are executed sychronously. + +SECURITY WARNING: DON'T USE THIS CODE UNLESS YOU ARE INSIDE A FIREWALL +-- it may execute arbitrary Python code or external programs. + +Note that status code 200 is sent prior to execution of a CGI script, so +scripts cannot send other status codes such as 302 (redirect). +""" + + +__version__ = "0.4" + +__all__ = ["CGIHTTPRequestHandler"] + +import os +import sys +import urllib +import BaseHTTPServer +import SimpleHTTPServer +import select +import copy + + +class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): + + """Complete HTTP server with GET, HEAD and POST commands. + + GET and HEAD also support running CGI scripts. + + The POST command is *only* implemented for CGI scripts. + + """ + + # Determine platform specifics + have_fork = hasattr(os, 'fork') + have_popen2 = hasattr(os, 'popen2') + have_popen3 = hasattr(os, 'popen3') + + # Make rfile unbuffered -- we need to read one line and then pass + # the rest to a subprocess, so we can't use buffered input. + rbufsize = 0 + + def do_POST(self): + """Serve a POST request. + + This is only implemented for CGI scripts. + + """ + + if self.is_cgi(): + self.run_cgi() + else: + self.send_error(501, "Can only POST to CGI scripts") + + def send_head(self): + """Version of send_head that support CGI scripts""" + if self.is_cgi(): + return self.run_cgi() + else: + return SimpleHTTPServer.SimpleHTTPRequestHandler.send_head(self) + + def is_cgi(self): + """Test whether self.path corresponds to a CGI script. + + Returns True and updates the cgi_info attribute to the tuple + (dir, rest) if self.path requires running a CGI script. + Returns False otherwise. + + If any exception is raised, the caller should assume that + self.path was rejected as invalid and act accordingly. + + The default implementation tests whether the normalized url + path begins with one of the strings in self.cgi_directories + (and the next character is a '/' or the end of the string). + """ + collapsed_path = _url_collapse_path(self.path) + dir_sep = collapsed_path.find('/', 1) + head, tail = collapsed_path[:dir_sep], collapsed_path[dir_sep+1:] + if head in self.cgi_directories: + self.cgi_info = head, tail + return True + return False + + cgi_directories = ['/cgi-bin', '/htbin'] + + def is_executable(self, path): + """Test whether argument path is an executable file.""" + return executable(path) + + def is_python(self, path): + """Test whether argument path is a Python script.""" + head, tail = os.path.splitext(path) + return tail.lower() in (".py", ".pyw") + + def run_cgi(self): + """Execute a CGI script.""" + dir, rest = self.cgi_info + path = dir + '/' + rest + i = path.find('/', len(dir)+1) + while i >= 0: + nextdir = path[:i] + nextrest = path[i+1:] + + scriptdir = self.translate_path(nextdir) + if os.path.isdir(scriptdir): + dir, rest = nextdir, nextrest + i = path.find('/', len(dir)+1) + else: + break + + # find an explicit query string, if present. + rest, _, query = rest.partition('?') + + # dissect the part after the directory name into a script name & + # a possible additional path, to be stored in PATH_INFO. + i = rest.find('/') + if i >= 0: + script, rest = rest[:i], rest[i:] + else: + script, rest = rest, '' + + scriptname = dir + '/' + script + scriptfile = self.translate_path(scriptname) + if not os.path.exists(scriptfile): + self.send_error(404, "No such CGI script (%r)" % scriptname) + return + if not os.path.isfile(scriptfile): + self.send_error(403, "CGI script is not a plain file (%r)" % + scriptname) + return + ispy = self.is_python(scriptname) + if not ispy: + if not (self.have_fork or self.have_popen2 or self.have_popen3): + self.send_error(403, "CGI script is not a Python script (%r)" % + scriptname) + return + if not self.is_executable(scriptfile): + self.send_error(403, "CGI script is not executable (%r)" % + scriptname) + return + + # Reference: http://hoohoo.ncsa.uiuc.edu/cgi/env.html + # XXX Much of the following could be prepared ahead of time! + env = copy.deepcopy(os.environ) + env['SERVER_SOFTWARE'] = self.version_string() + env['SERVER_NAME'] = self.server.server_name + env['GATEWAY_INTERFACE'] = 'CGI/1.1' + env['SERVER_PROTOCOL'] = self.protocol_version + env['SERVER_PORT'] = str(self.server.server_port) + env['REQUEST_METHOD'] = self.command + uqrest = urllib.unquote(rest) + env['PATH_INFO'] = uqrest + env['PATH_TRANSLATED'] = self.translate_path(uqrest) + env['SCRIPT_NAME'] = scriptname + if query: + env['QUERY_STRING'] = query + host = self.address_string() + if host != self.client_address[0]: + env['REMOTE_HOST'] = host + env['REMOTE_ADDR'] = self.client_address[0] + authorization = self.headers.getheader("authorization") + if authorization: + authorization = authorization.split() + if len(authorization) == 2: + import base64, binascii + env['AUTH_TYPE'] = authorization[0] + if authorization[0].lower() == "basic": + try: + authorization = base64.decodestring(authorization[1]) + except binascii.Error: + pass + else: + authorization = authorization.split(':') + if len(authorization) == 2: + env['REMOTE_USER'] = authorization[0] + # XXX REMOTE_IDENT + if self.headers.typeheader is None: + env['CONTENT_TYPE'] = self.headers.type + else: + env['CONTENT_TYPE'] = self.headers.typeheader + length = self.headers.getheader('content-length') + if length: + env['CONTENT_LENGTH'] = length + referer = self.headers.getheader('referer') + if referer: + env['HTTP_REFERER'] = referer + accept = [] + for line in self.headers.getallmatchingheaders('accept'): + if line[:1] in "\t\n\r ": + accept.append(line.strip()) + else: + accept = accept + line[7:].split(',') + env['HTTP_ACCEPT'] = ','.join(accept) + ua = self.headers.getheader('user-agent') + if ua: + env['HTTP_USER_AGENT'] = ua + co = filter(None, self.headers.getheaders('cookie')) + if co: + env['HTTP_COOKIE'] = ', '.join(co) + # XXX Other HTTP_* headers + # Since we're setting the env in the parent, provide empty + # values to override previously set values + for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH', + 'HTTP_USER_AGENT', 'HTTP_COOKIE', 'HTTP_REFERER'): + env.setdefault(k, "") + + self.send_response(200, "Script output follows") + + decoded_query = query.replace('+', ' ') + + if self.have_fork: + # Unix -- fork as we should + args = [script] + if '=' not in decoded_query: + args.append(decoded_query) + nobody = nobody_uid() + self.wfile.flush() # Always flush before forking + pid = os.fork() + if pid != 0: + # Parent + pid, sts = os.waitpid(pid, 0) + # throw away additional data [see bug #427345] + while select.select([self.rfile], [], [], 0)[0]: + if not self.rfile.read(1): + break + if sts: + self.log_error("CGI script exit status %#x", sts) + return + # Child + try: + try: + os.setuid(nobody) + except os.error: + pass + os.dup2(self.rfile.fileno(), 0) + os.dup2(self.wfile.fileno(), 1) + os.execve(scriptfile, args, env) + except: + self.server.handle_error(self.request, self.client_address) + os._exit(127) + + else: + # Non Unix - use subprocess + import subprocess + cmdline = [scriptfile] + if self.is_python(scriptfile): + interp = sys.executable + if interp.lower().endswith("w.exe"): + # On Windows, use python.exe, not pythonw.exe + interp = interp[:-5] + interp[-4:] + cmdline = [interp, '-u'] + cmdline + if '=' not in query: + cmdline.append(query) + + self.log_message("command: %s", subprocess.list2cmdline(cmdline)) + try: + nbytes = int(length) + except (TypeError, ValueError): + nbytes = 0 + p = subprocess.Popen(cmdline, + stdin = subprocess.PIPE, + stdout = subprocess.PIPE, + stderr = subprocess.PIPE, + env = env + ) + if self.command.lower() == "post" and nbytes > 0: + data = self.rfile.read(nbytes) + else: + data = None + # throw away additional data [see bug #427345] + while select.select([self.rfile._sock], [], [], 0)[0]: + if not self.rfile._sock.recv(1): + break + stdout, stderr = p.communicate(data) + self.wfile.write(stdout) + if stderr: + self.log_error('%s', stderr) + p.stderr.close() + p.stdout.close() + status = p.returncode + if status: + self.log_error("CGI script exit status %#x", status) + else: + self.log_message("CGI script exited OK") + + +def _url_collapse_path(path): + """ + Given a URL path, remove extra '/'s and '.' path elements and collapse + any '..' references and returns a colllapsed path. + + Implements something akin to RFC-2396 5.2 step 6 to parse relative paths. + The utility of this function is limited to is_cgi method and helps + preventing some security attacks. + + Returns: The reconstituted URL, which will always start with a '/'. + + Raises: IndexError if too many '..' occur within the path. + + """ + # Query component should not be involved. + path, _, query = path.partition('?') + path = urllib.unquote(path) + + # Similar to os.path.split(os.path.normpath(path)) but specific to URL + # path semantics rather than local operating system semantics. + path_parts = path.split('/') + head_parts = [] + for part in path_parts[:-1]: + if part == '..': + head_parts.pop() # IndexError if more '..' than prior parts + elif part and part != '.': + head_parts.append( part ) + if path_parts: + tail_part = path_parts.pop() + if tail_part: + if tail_part == '..': + head_parts.pop() + tail_part = '' + elif tail_part == '.': + tail_part = '' + else: + tail_part = '' + + if query: + tail_part = '?'.join((tail_part, query)) + + splitpath = ('/' + '/'.join(head_parts), tail_part) + collapsed_path = "/".join(splitpath) + + return collapsed_path + + +nobody = None + +def nobody_uid(): + """Internal routine to get nobody's uid""" + global nobody + if nobody: + return nobody + try: + import pwd + except ImportError: + return -1 + try: + nobody = pwd.getpwnam('nobody')[2] + except KeyError: + nobody = 1 + max(map(lambda x: x[2], pwd.getpwall())) + return nobody + + +def executable(path): + """Test for executable file.""" + try: + st = os.stat(path) + except os.error: + return False + return st.st_mode & 0111 != 0 + + +def test(HandlerClass = CGIHTTPRequestHandler, + ServerClass = BaseHTTPServer.HTTPServer): + SimpleHTTPServer.test(HandlerClass, ServerClass) + + +if __name__ == '__main__': + test() diff --git a/ShiftOS_TheReturn/Lib/ConfigParser.py b/ShiftOS_TheReturn/Lib/ConfigParser.py new file mode 100644 index 0000000..7e6cdbc --- /dev/null +++ b/ShiftOS_TheReturn/Lib/ConfigParser.py @@ -0,0 +1,753 @@ +"""Configuration file parser. + +A setup file consists of sections, lead by a "[section]" header, +and followed by "name: value" entries, with continuations and such in +the style of RFC 822. + +The option values can contain format strings which refer to other values in +the same section, or values in a special [DEFAULT] section. + +For example: + + something: %(dir)s/whatever + +would resolve the "%(dir)s" to the value of dir. All reference +expansions are done late, on demand. + +Intrinsic defaults can be specified by passing them into the +ConfigParser constructor as a dictionary. + +class: + +ConfigParser -- responsible for parsing a list of + configuration files, and managing the parsed database. + + methods: + + __init__(defaults=None) + create the parser and specify a dictionary of intrinsic defaults. The + keys must be strings, the values must be appropriate for %()s string + interpolation. Note that `__name__' is always an intrinsic default; + its value is the section's name. + + sections() + return all the configuration section names, sans DEFAULT + + has_section(section) + return whether the given section exists + + has_option(section, option) + return whether the given option exists in the given section + + options(section) + return list of configuration options for the named section + + read(filenames) + read and parse the list of named configuration files, given by + name. A single filename is also allowed. Non-existing files + are ignored. Return list of successfully read files. + + readfp(fp, filename=None) + read and parse one configuration file, given as a file object. + The filename defaults to fp.name; it is only used in error + messages (if fp has no `name' attribute, the string `' is used). + + get(section, option, raw=False, vars=None) + return a string value for the named option. All % interpolations are + expanded in the return values, based on the defaults passed into the + constructor and the DEFAULT section. Additional substitutions may be + provided using the `vars' argument, which must be a dictionary whose + contents override any pre-existing defaults. + + getint(section, options) + like get(), but convert value to an integer + + getfloat(section, options) + like get(), but convert value to a float + + getboolean(section, options) + like get(), but convert value to a boolean (currently case + insensitively defined as 0, false, no, off for False, and 1, true, + yes, on for True). Returns False or True. + + items(section, raw=False, vars=None) + return a list of tuples with (name, value) for each option + in the section. + + remove_section(section) + remove the given file section and all its options + + remove_option(section, option) + remove the given option from the given section + + set(section, option, value) + set the given option + + write(fp) + write the configuration state in .ini format +""" + +try: + from collections import OrderedDict as _default_dict +except ImportError: + # fallback for setup.py which hasn't yet built _collections + _default_dict = dict + +import re + +__all__ = ["NoSectionError", "DuplicateSectionError", "NoOptionError", + "InterpolationError", "InterpolationDepthError", + "InterpolationSyntaxError", "ParsingError", + "MissingSectionHeaderError", + "ConfigParser", "SafeConfigParser", "RawConfigParser", + "DEFAULTSECT", "MAX_INTERPOLATION_DEPTH"] + +DEFAULTSECT = "DEFAULT" + +MAX_INTERPOLATION_DEPTH = 10 + + + +# exception classes +class Error(Exception): + """Base class for ConfigParser exceptions.""" + + def _get_message(self): + """Getter for 'message'; needed only to override deprecation in + BaseException.""" + return self.__message + + def _set_message(self, value): + """Setter for 'message'; needed only to override deprecation in + BaseException.""" + self.__message = value + + # BaseException.message has been deprecated since Python 2.6. To prevent + # DeprecationWarning from popping up over this pre-existing attribute, use + # a new property that takes lookup precedence. + message = property(_get_message, _set_message) + + def __init__(self, msg=''): + self.message = msg + Exception.__init__(self, msg) + + def __repr__(self): + return self.message + + __str__ = __repr__ + +class NoSectionError(Error): + """Raised when no section matches a requested option.""" + + def __init__(self, section): + Error.__init__(self, 'No section: %r' % (section,)) + self.section = section + self.args = (section, ) + +class DuplicateSectionError(Error): + """Raised when a section is multiply-created.""" + + def __init__(self, section): + Error.__init__(self, "Section %r already exists" % section) + self.section = section + self.args = (section, ) + +class NoOptionError(Error): + """A requested option was not found.""" + + def __init__(self, option, section): + Error.__init__(self, "No option %r in section: %r" % + (option, section)) + self.option = option + self.section = section + self.args = (option, section) + +class InterpolationError(Error): + """Base class for interpolation-related exceptions.""" + + def __init__(self, option, section, msg): + Error.__init__(self, msg) + self.option = option + self.section = section + self.args = (option, section, msg) + +class InterpolationMissingOptionError(InterpolationError): + """A string substitution required a setting which was not available.""" + + def __init__(self, option, section, rawval, reference): + msg = ("Bad value substitution:\n" + "\tsection: [%s]\n" + "\toption : %s\n" + "\tkey : %s\n" + "\trawval : %s\n" + % (section, option, reference, rawval)) + InterpolationError.__init__(self, option, section, msg) + self.reference = reference + self.args = (option, section, rawval, reference) + +class InterpolationSyntaxError(InterpolationError): + """Raised when the source text into which substitutions are made + does not conform to the required syntax.""" + +class InterpolationDepthError(InterpolationError): + """Raised when substitutions are nested too deeply.""" + + def __init__(self, option, section, rawval): + msg = ("Value interpolation too deeply recursive:\n" + "\tsection: [%s]\n" + "\toption : %s\n" + "\trawval : %s\n" + % (section, option, rawval)) + InterpolationError.__init__(self, option, section, msg) + self.args = (option, section, rawval) + +class ParsingError(Error): + """Raised when a configuration file does not follow legal syntax.""" + + def __init__(self, filename): + Error.__init__(self, 'File contains parsing errors: %s' % filename) + self.filename = filename + self.errors = [] + self.args = (filename, ) + + def append(self, lineno, line): + self.errors.append((lineno, line)) + self.message += '\n\t[line %2d]: %s' % (lineno, line) + +class MissingSectionHeaderError(ParsingError): + """Raised when a key-value pair is found before any section header.""" + + def __init__(self, filename, lineno, line): + Error.__init__( + self, + 'File contains no section headers.\nfile: %s, line: %d\n%r' % + (filename, lineno, line)) + self.filename = filename + self.lineno = lineno + self.line = line + self.args = (filename, lineno, line) + + +class RawConfigParser: + def __init__(self, defaults=None, dict_type=_default_dict, + allow_no_value=False): + self._dict = dict_type + self._sections = self._dict() + self._defaults = self._dict() + if allow_no_value: + self._optcre = self.OPTCRE_NV + else: + self._optcre = self.OPTCRE + if defaults: + for key, value in defaults.items(): + self._defaults[self.optionxform(key)] = value + + def defaults(self): + return self._defaults + + def sections(self): + """Return a list of section names, excluding [DEFAULT]""" + # self._sections will never have [DEFAULT] in it + return self._sections.keys() + + def add_section(self, section): + """Create a new section in the configuration. + + Raise DuplicateSectionError if a section by the specified name + already exists. Raise ValueError if name is DEFAULT or any of it's + case-insensitive variants. + """ + if section.lower() == "default": + raise ValueError, 'Invalid section name: %s' % section + + if section in self._sections: + raise DuplicateSectionError(section) + self._sections[section] = self._dict() + + def has_section(self, section): + """Indicate whether the named section is present in the configuration. + + The DEFAULT section is not acknowledged. + """ + return section in self._sections + + def options(self, section): + """Return a list of option names for the given section name.""" + try: + opts = self._sections[section].copy() + except KeyError: + raise NoSectionError(section) + opts.update(self._defaults) + if '__name__' in opts: + del opts['__name__'] + return opts.keys() + + def read(self, filenames): + """Read and parse a filename or a list of filenames. + + Files that cannot be opened are silently ignored; this is + designed so that you can specify a list of potential + configuration file locations (e.g. current directory, user's + home directory, systemwide directory), and all existing + configuration files in the list will be read. A single + filename may also be given. + + Return list of successfully read files. + """ + if isinstance(filenames, basestring): + filenames = [filenames] + read_ok = [] + for filename in filenames: + try: + fp = open(filename) + except IOError: + continue + self._read(fp, filename) + fp.close() + read_ok.append(filename) + return read_ok + + def readfp(self, fp, filename=None): + """Like read() but the argument must be a file-like object. + + The `fp' argument must have a `readline' method. Optional + second argument is the `filename', which if not given, is + taken from fp.name. If fp has no `name' attribute, `' is + used. + + """ + if filename is None: + try: + filename = fp.name + except AttributeError: + filename = '' + self._read(fp, filename) + + def get(self, section, option): + opt = self.optionxform(option) + if section not in self._sections: + if section != DEFAULTSECT: + raise NoSectionError(section) + if opt in self._defaults: + return self._defaults[opt] + else: + raise NoOptionError(option, section) + elif opt in self._sections[section]: + return self._sections[section][opt] + elif opt in self._defaults: + return self._defaults[opt] + else: + raise NoOptionError(option, section) + + def items(self, section): + try: + d2 = self._sections[section] + except KeyError: + if section != DEFAULTSECT: + raise NoSectionError(section) + d2 = self._dict() + d = self._defaults.copy() + d.update(d2) + if "__name__" in d: + del d["__name__"] + return d.items() + + def _get(self, section, conv, option): + return conv(self.get(section, option)) + + def getint(self, section, option): + return self._get(section, int, option) + + def getfloat(self, section, option): + return self._get(section, float, option) + + _boolean_states = {'1': True, 'yes': True, 'true': True, 'on': True, + '0': False, 'no': False, 'false': False, 'off': False} + + def getboolean(self, section, option): + v = self.get(section, option) + if v.lower() not in self._boolean_states: + raise ValueError, 'Not a boolean: %s' % v + return self._boolean_states[v.lower()] + + def optionxform(self, optionstr): + return optionstr.lower() + + def has_option(self, section, option): + """Check for the existence of a given option in a given section.""" + if not section or section == DEFAULTSECT: + option = self.optionxform(option) + return option in self._defaults + elif section not in self._sections: + return False + else: + option = self.optionxform(option) + return (option in self._sections[section] + or option in self._defaults) + + def set(self, section, option, value=None): + """Set an option.""" + if not section or section == DEFAULTSECT: + sectdict = self._defaults + else: + try: + sectdict = self._sections[section] + except KeyError: + raise NoSectionError(section) + sectdict[self.optionxform(option)] = value + + def write(self, fp): + """Write an .ini-format representation of the configuration state.""" + if self._defaults: + fp.write("[%s]\n" % DEFAULTSECT) + for (key, value) in self._defaults.items(): + fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t'))) + fp.write("\n") + for section in self._sections: + fp.write("[%s]\n" % section) + for (key, value) in self._sections[section].items(): + if key == "__name__": + continue + if (value is not None) or (self._optcre == self.OPTCRE): + key = " = ".join((key, str(value).replace('\n', '\n\t'))) + fp.write("%s\n" % (key)) + fp.write("\n") + + def remove_option(self, section, option): + """Remove an option.""" + if not section or section == DEFAULTSECT: + sectdict = self._defaults + else: + try: + sectdict = self._sections[section] + except KeyError: + raise NoSectionError(section) + option = self.optionxform(option) + existed = option in sectdict + if existed: + del sectdict[option] + return existed + + def remove_section(self, section): + """Remove a file section.""" + existed = section in self._sections + if existed: + del self._sections[section] + return existed + + # + # Regular expressions for parsing section headers and options. + # + SECTCRE = re.compile( + r'\[' # [ + r'(?P

[^]]+)' # very permissive! + r'\]' # ] + ) + OPTCRE = re.compile( + r'(?P