aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-02-02 13:51:29 -0500
committerMichael <[email protected]>2017-02-02 13:51:29 -0500
commit3a41ba45e7ac0df930066a79540f82544dbd8114 (patch)
tree341d707da673b0db997b5b4f93a4a3e42d047259
parente55e195d88ba4a3bfea47cb8784564a43f426e48 (diff)
downloadshiftos_thereturn-3a41ba45e7ac0df930066a79540f82544dbd8114.tar.gz
shiftos_thereturn-3a41ba45e7ac0df930066a79540f82544dbd8114.tar.bz2
shiftos_thereturn-3a41ba45e7ac0df930066a79540f82544dbd8114.zip
Redesign the Infobox, categorize AL items
-rw-r--r--ShiftOS.WinForms/Applications/Artpad.cs2
-rw-r--r--ShiftOS.WinForms/Applications/Chat.cs2
-rw-r--r--ShiftOS.WinForms/Applications/Dialog.Designer.cs132
-rw-r--r--ShiftOS.WinForms/Applications/Dialog.cs78
-rw-r--r--ShiftOS.WinForms/Applications/Dialog.resx120
-rw-r--r--ShiftOS.WinForms/Applications/FileSkimmer.cs2
-rw-r--r--ShiftOS.WinForms/Applications/MUDAuthenticator.cs2
-rw-r--r--ShiftOS.WinForms/Applications/MUDControlCentre.cs2
-rw-r--r--ShiftOS.WinForms/Applications/NameChanger.cs2
-rw-r--r--ShiftOS.WinForms/Applications/Pong.cs2
-rw-r--r--ShiftOS.WinForms/Applications/Shifter.cs2
-rw-r--r--ShiftOS.WinForms/Applications/Shiftnet.cs2
-rw-r--r--ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs2
-rw-r--r--ShiftOS.WinForms/Applications/Skin Loader.cs2
-rw-r--r--ShiftOS.WinForms/Applications/Terminal.cs2
-rw-r--r--ShiftOS.WinForms/Applications/TextPad.cs2
-rw-r--r--ShiftOS.WinForms/Applications/VirusScanner.cs2
-rw-r--r--ShiftOS.WinForms/Program.cs80
-rw-r--r--ShiftOS.WinForms/Resources/Shiftorium.txt8
-rw-r--r--ShiftOS.WinForms/ShiftOS.WinForms.csproj3
-rw-r--r--ShiftOS.WinForms/WinformsDesktop.cs47
-rw-r--r--ShiftOS_TheReturn/Desktop.cs5
-rw-r--r--ShiftOS_TheReturn/Infobox.cs6
23 files changed, 405 insertions, 102 deletions
diff --git a/ShiftOS.WinForms/Applications/Artpad.cs b/ShiftOS.WinForms/Applications/Artpad.cs
index 6f147ed..ec26cef 100644
--- a/ShiftOS.WinForms/Applications/Artpad.cs
+++ b/ShiftOS.WinForms/Applications/Artpad.cs
@@ -41,7 +41,7 @@ using ShiftOS.Engine;
namespace ShiftOS.WinForms.Applications
{
- [Launcher("Artpad", true, "al_artpad")]
+ [Launcher("Artpad", true, "al_artpad", "Graphics")]
[RequiresUpgrade("artpad")]
[WinOpen("artpad")]
public partial class Artpad : UserControl, IShiftOSWindow
diff --git a/ShiftOS.WinForms/Applications/Chat.cs b/ShiftOS.WinForms/Applications/Chat.cs
index 19fd223..6f37189 100644
--- a/ShiftOS.WinForms/Applications/Chat.cs
+++ b/ShiftOS.WinForms/Applications/Chat.cs
@@ -37,7 +37,7 @@ using ShiftOS.Engine;
namespace ShiftOS.WinForms.Applications
{
[MultiplayerOnly]
- [Launcher("MUD Chat", true, "al_mud_chat")]
+ [Launcher("MUD Chat", true, "al_mud_chat", "Networking")]
[RequiresUpgrade("mud_fundamentals")]
[WinOpen("chat")]
public partial class Chat : UserControl, IShiftOSWindow
diff --git a/ShiftOS.WinForms/Applications/Dialog.Designer.cs b/ShiftOS.WinForms/Applications/Dialog.Designer.cs
index 7f9a9b2..c75c0b3 100644
--- a/ShiftOS.WinForms/Applications/Dialog.Designer.cs
+++ b/ShiftOS.WinForms/Applications/Dialog.Designer.cs
@@ -52,11 +52,139 @@ namespace ShiftOS.WinForms.Applications
/// </summary>
private void InitializeComponent()
{
- this.components = new System.ComponentModel.Container();
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.pbicon = new System.Windows.Forms.PictureBox();
+ this.btnok = new System.Windows.Forms.Button();
+ this.flyesno = new System.Windows.Forms.FlowLayoutPanel();
+ this.btnno = new System.Windows.Forms.Button();
+ this.btnyes = new System.Windows.Forms.Button();
+ this.lbmessage = new System.Windows.Forms.Label();
+ this.txtinput = new System.Windows.Forms.TextBox();
+ this.panel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbicon)).BeginInit();
+ this.flyesno.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.txtinput);
+ this.panel1.Controls.Add(this.lbmessage);
+ this.panel1.Controls.Add(this.flyesno);
+ this.panel1.Controls.Add(this.btnok);
+ this.panel1.Controls.Add(this.pbicon);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(341, 177);
+ this.panel1.TabIndex = 0;
+ //
+ // pbicon
+ //
+ this.pbicon.Location = new System.Drawing.Point(14, 19);
+ this.pbicon.Name = "pbicon";
+ this.pbicon.Size = new System.Drawing.Size(64, 64);
+ this.pbicon.TabIndex = 0;
+ this.pbicon.TabStop = false;
+ //
+ // btnok
+ //
+ this.btnok.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnok.AutoSize = true;
+ this.btnok.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.btnok.Location = new System.Drawing.Point(149, 140);
+ this.btnok.Name = "btnok";
+ this.btnok.Size = new System.Drawing.Size(32, 23);
+ this.btnok.TabIndex = 1;
+ this.btnok.Text = "OK";
+ this.btnok.UseVisualStyleBackColor = true;
+ //
+ // flyesno
+ //
+ this.flyesno.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.flyesno.AutoSize = true;
+ this.flyesno.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.flyesno.Controls.Add(this.btnyes);
+ this.flyesno.Controls.Add(this.btnno);
+ this.flyesno.Location = new System.Drawing.Point(129, 134);
+ this.flyesno.Name = "flyesno";
+ this.flyesno.Size = new System.Drawing.Size(78, 29);
+ this.flyesno.TabIndex = 2;
+ this.flyesno.WrapContents = false;
+ //
+ // btnno
+ //
+ this.btnno.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnno.AutoSize = true;
+ this.btnno.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.btnno.Location = new System.Drawing.Point(44, 3);
+ this.btnno.Name = "btnno";
+ this.btnno.Size = new System.Drawing.Size(31, 23);
+ this.btnno.TabIndex = 3;
+ this.btnno.Text = "No";
+ this.btnno.UseVisualStyleBackColor = true;
+ //
+ // btnyes
+ //
+ this.btnyes.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnyes.AutoSize = true;
+ this.btnyes.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.btnyes.Location = new System.Drawing.Point(3, 3);
+ this.btnyes.Name = "btnyes";
+ this.btnyes.Size = new System.Drawing.Size(35, 23);
+ this.btnyes.TabIndex = 4;
+ this.btnyes.Text = "Yes";
+ this.btnyes.UseVisualStyleBackColor = true;
+ //
+ // lbmessage
+ //
+ this.lbmessage.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.lbmessage.Location = new System.Drawing.Point(85, 19);
+ this.lbmessage.Name = "lbmessage";
+ this.lbmessage.Size = new System.Drawing.Size(253, 94);
+ this.lbmessage.TabIndex = 3;
+ this.lbmessage.Text = "label1";
+ this.lbmessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // txtinput
+ //
+ this.txtinput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtinput.Location = new System.Drawing.Point(88, 116);
+ this.txtinput.Name = "txtinput";
+ this.txtinput.Size = new System.Drawing.Size(250, 20);
+ this.txtinput.TabIndex = 4;
+ //
+ // Dialog
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.Text = "{DIALOG_NAME}";
+ this.Controls.Add(this.panel1);
+ this.Name = "Dialog";
+ this.Size = new System.Drawing.Size(341, 177);
+ this.panel1.ResumeLayout(false);
+ this.panel1.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbicon)).EndInit();
+ this.flyesno.ResumeLayout(false);
+ this.flyesno.PerformLayout();
+ this.ResumeLayout(false);
+
}
#endregion
+
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.Label lbmessage;
+ private System.Windows.Forms.FlowLayoutPanel flyesno;
+ private System.Windows.Forms.Button btnyes;
+ private System.Windows.Forms.Button btnno;
+ private System.Windows.Forms.Button btnok;
+ private System.Windows.Forms.PictureBox pbicon;
+ private System.Windows.Forms.TextBox txtinput;
}
} \ No newline at end of file
diff --git a/ShiftOS.WinForms/Applications/Dialog.cs b/ShiftOS.WinForms/Applications/Dialog.cs
index c19595e..4d13e23 100644
--- a/ShiftOS.WinForms/Applications/Dialog.cs
+++ b/ShiftOS.WinForms/Applications/Dialog.cs
@@ -35,7 +35,7 @@ using ShiftOS.Engine;
namespace ShiftOS.WinForms.Applications
{
- public partial class Dialog : UserControl, IShiftOSWindow
+ public partial class Dialog : UserControl, IShiftOSWindow, IInfobox
{
public Dialog()
{
@@ -58,5 +58,81 @@ namespace ShiftOS.WinForms.Applications
public void OnUpgrade()
{
}
+
+ internal void OpenInternal(string title, string msg)
+ {
+ AppearanceManager.SetupWindow(this);
+ this.Parent.Text = title;
+ lbmessage.Text = msg;
+ txtinput.Hide();
+ flyesno.Hide();
+ btnok.Show();
+ btnok.Click += (o, a) =>
+ {
+ AppearanceManager.Close(this);
+ };
+
+ }
+
+ public void Open(string title, string msg)
+ {
+ new Dialog().OpenInternal(title, msg);
+ }
+
+ public void PromptTextInternal(string title, string message, Action<string> callback)
+ {
+ AppearanceManager.SetupWindow(this);
+ this.Parent.Text = title;
+ lbmessage.Text = message;
+ txtinput.Show();
+ flyesno.Hide();
+ btnok.Show();
+ btnok.Click += (o, a) =>
+ {
+ callback?.Invoke(txtinput.Text);
+ AppearanceManager.Close(this);
+ };
+ txtinput.KeyDown += (o, a) =>
+ {
+ if(a.KeyCode == Keys.Enter)
+ {
+ a.SuppressKeyPress = true;
+ callback?.Invoke(txtinput.Text);
+ AppearanceManager.Close(this);
+ }
+ };
+ }
+
+ public void PromptText(string title, string message, Action<string> callback)
+ {
+ new Dialog().PromptTextInternal(title, message, callback);
+ }
+
+ public void PromptYesNo(string title, string message, Action<bool> callback)
+ {
+ new Dialog().PromptYesNoInternal(title, message, callback);
+ }
+
+
+
+ public void PromptYesNoInternal(string title, string message, Action<bool> callback)
+ {
+ AppearanceManager.SetupWindow(this);
+ this.Parent.Text = title;
+ lbmessage.Text = message;
+ txtinput.Hide();
+ flyesno.Show();
+ btnok.Hide();
+ btnyes.Click += (o, a) =>
+ {
+ callback?.Invoke(true);
+ AppearanceManager.Close(this);
+ };
+ btnno.Click += (o, a) =>
+ {
+ callback?.Invoke(false);
+ AppearanceManager.Close(this);
+ };
+ }
}
}
diff --git a/ShiftOS.WinForms/Applications/Dialog.resx b/ShiftOS.WinForms/Applications/Dialog.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/ShiftOS.WinForms/Applications/Dialog.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root> \ No newline at end of file
diff --git a/ShiftOS.WinForms/Applications/FileSkimmer.cs b/ShiftOS.WinForms/Applications/FileSkimmer.cs
index 082352b..db86bbe 100644
--- a/ShiftOS.WinForms/Applications/FileSkimmer.cs
+++ b/ShiftOS.WinForms/Applications/FileSkimmer.cs
@@ -39,7 +39,7 @@ using ShiftOS.Engine;
namespace ShiftOS.WinForms.Applications
{
- [Launcher("File Skimmer", true, "al_file_skimmer")]
+ [Launcher("File Skimmer", true, "al_file_skimmer", "Utilities")]
[RequiresUpgrade("file_skimmer")]
[WinOpen("file_skimmer")]
public partial class FileSkimmer : UserControl, IShiftOSWindow
diff --git a/ShiftOS.WinForms/Applications/MUDAuthenticator.cs b/ShiftOS.WinForms/Applications/MUDAuthenticator.cs
index 1476037..32731ed 100644
--- a/ShiftOS.WinForms/Applications/MUDAuthenticator.cs
+++ b/ShiftOS.WinForms/Applications/MUDAuthenticator.cs
@@ -37,7 +37,7 @@ using ShiftOS.Engine;
namespace ShiftOS.WinForms.Applications
{
[MultiplayerOnly]
- [Launcher("MUD Administrator", true, "al_mud_cracker")]
+ [Launcher("MUD Administrator", true, "al_mud_cracker", "Administration")]
[RequiresUpgrade("mud_cracker")]
[WinOpen("mud_administrator")]
public partial class MUDAuthenticator : UserControl, IShiftOSWindow
diff --git a/ShiftOS.WinForms/Applications/MUDControlCentre.cs b/ShiftOS.WinForms/Applications/MUDControlCentre.cs
index ee5336e..1756e99 100644
--- a/ShiftOS.WinForms/Applications/MUDControlCentre.cs
+++ b/ShiftOS.WinForms/Applications/MUDControlCentre.cs
@@ -39,7 +39,7 @@ using ShiftOS.WinForms.Tools;
namespace ShiftOS.WinForms.Applications
{
[RequiresUpgrade("mud_fundamentals")]
- [Launcher("MUD Control Centre", true, "al_mud_control_centre")]
+ [Launcher("MUD Control Centre", true, "al_mud_control_centre", "Networking")]
[WinOpen("mud_control_centre")]
public partial class MUDControlCentre : UserControl, IShiftOSWindow
{
diff --git a/ShiftOS.WinForms/Applications/NameChanger.cs b/ShiftOS.WinForms/Applications/NameChanger.cs
index 814526c..8483c22 100644
--- a/ShiftOS.WinForms/Applications/NameChanger.cs
+++ b/ShiftOS.WinForms/Applications/NameChanger.cs
@@ -35,7 +35,7 @@ using ShiftOS.Engine;
namespace ShiftOS.WinForms.Applications {
- [Launcher("Name Changer", true, "al_name_changer")]
+ [Launcher("Name Changer", true, "al_name_changer", "Customization")]
[RequiresUpgrade("name_changer")]
[WinOpen("name_changer")]
public partial class NameChanger : UserControl, IShiftOSWindow {
diff --git a/ShiftOS.WinForms/Applications/Pong.cs b/ShiftOS.WinForms/Applications/Pong.cs
index f2afbab..82c86e5 100644
--- a/ShiftOS.WinForms/Applications/Pong.cs
+++ b/ShiftOS.WinForms/Applications/Pong.cs
@@ -37,7 +37,7 @@ using ShiftOS.Objects;
namespace ShiftOS.WinForms.Applications
{
- [Launcher("Pong", true, "al_pong")]
+ [Launcher("Pong", true, "al_pong", "Games")]
[WinOpen("pong")]
public partial class Pong : UserControl, IShiftOSWindow
{
diff --git a/ShiftOS.WinForms/Applications/Shifter.cs b/ShiftOS.WinForms/Applications/Shifter.cs
index d7dda28..5b9ea41 100644
--- a/ShiftOS.WinForms/Applications/Shifter.cs
+++ b/ShiftOS.WinForms/Applications/Shifter.cs
@@ -40,7 +40,7 @@ using ShiftOS.WinForms.Tools;
namespace ShiftOS.WinForms.Applications
{
- [Launcher("Shifter", true, "al_shifter")]
+ [Launcher("Shifter", true, "al_shifter", "Customization")]
[RequiresUpgrade("shifter")]
[WinOpen("shifter")]
public partial class Shifter : UserControl, IShiftOSWindow
diff --git a/ShiftOS.WinForms/Applications/Shiftnet.cs b/ShiftOS.WinForms/Applications/Shiftnet.cs
index e97a4cb..eebebd9 100644
--- a/ShiftOS.WinForms/Applications/Shiftnet.cs
+++ b/ShiftOS.WinForms/Applications/Shiftnet.cs
@@ -13,7 +13,7 @@ using static ShiftOS.Engine.SkinEngine;
namespace ShiftOS.WinForms.Applications
{
- [Launcher("Shiftnet", false)]
+ [Launcher("Shiftnet", false, null, "Networking")]
public partial class Shiftnet : UserControl, IShiftOSWindow
{
public Shiftnet()
diff --git a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs
index bb6d93e..49a7b7c 100644
--- a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs
+++ b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs
@@ -37,7 +37,7 @@ using static ShiftOS.Engine.SkinEngine;
using backend = ShiftOS.Engine.Shiftorium;
namespace ShiftOS.WinForms.Applications
{
- [Launcher("Shiftorium", true, "al_shiftorium")]
+ [Launcher("Shiftorium", true, "al_shiftorium", "Utilities")]
[RequiresUpgrade("shiftorium_gui")]
[WinOpen("shiftorium")]
public partial class ShiftoriumFrontend : UserControl, IShiftOSWindow
diff --git a/ShiftOS.WinForms/Applications/Skin Loader.cs b/ShiftOS.WinForms/Applications/Skin Loader.cs
index e40860f..42b103d 100644
--- a/ShiftOS.WinForms/Applications/Skin Loader.cs
+++ b/ShiftOS.WinForms/Applications/Skin Loader.cs
@@ -37,7 +37,7 @@ using ShiftOS.WinForms.Tools;
namespace ShiftOS.WinForms.Applications
{
- [Launcher("Skin Loader", true, "al_skin_loader")]
+ [Launcher("Skin Loader", true, "al_skin_loader", "Customization")]
[RequiresUpgrade("skinning")]
[WinOpen("skin_loader")]
public partial class Skin_Loader : UserControl, IShiftOSWindow
diff --git a/ShiftOS.WinForms/Applications/Terminal.cs b/ShiftOS.WinForms/Applications/Terminal.cs
index 0a123d6..7b55ec2 100644
--- a/ShiftOS.WinForms/Applications/Terminal.cs
+++ b/ShiftOS.WinForms/Applications/Terminal.cs
@@ -46,7 +46,7 @@ using ShiftOS.Objects;
namespace ShiftOS.WinForms.Applications
{
- [Launcher("Terminal", false)]
+ [Launcher("Terminal", false, null, "Utilities")]
[WinOpen("terminal")]
public partial class Terminal : UserControl, IShiftOSWindow
{
diff --git a/ShiftOS.WinForms/Applications/TextPad.cs b/ShiftOS.WinForms/Applications/TextPad.cs
index fbec440..bbf4846 100644
--- a/ShiftOS.WinForms/Applications/TextPad.cs
+++ b/ShiftOS.WinForms/Applications/TextPad.cs
@@ -36,7 +36,7 @@ using ShiftOS.Engine;
namespace ShiftOS.WinForms.Applications
{
- [Launcher("TextPad", true, "al_textpad")]
+ [Launcher("TextPad", true, "al_textpad", "Accessories")]
[RequiresUpgrade("textpad")]
[WinOpen("textpad")]
public partial class TextPad : UserControl, IShiftOSWindow
diff --git a/ShiftOS.WinForms/Applications/VirusScanner.cs b/ShiftOS.WinForms/Applications/VirusScanner.cs
index 1b3405a..3582bd6 100644
--- a/ShiftOS.WinForms/Applications/VirusScanner.cs
+++ b/ShiftOS.WinForms/Applications/VirusScanner.cs
@@ -39,7 +39,7 @@ using static ShiftOS.Objects.ShiftFS.Utils;
namespace ShiftOS.WinForms.Applications
{
- [Launcher("Virus Scanner", true, "al_virus_scanner")]
+ [Launcher("Virus Scanner", true, "al_virus_scanner", "Administration")]
[RequiresUpgrade("virus_scanner")]
[WinOpen("virus_scanner")]
public partial class VirusScanner : UserControl, IShiftOSWindow
diff --git a/ShiftOS.WinForms/Program.cs b/ShiftOS.WinForms/Program.cs
index 144dc56..ad6c772 100644
--- a/ShiftOS.WinForms/Program.cs
+++ b/ShiftOS.WinForms/Program.cs
@@ -63,7 +63,7 @@ namespace ShiftOS.WinForms
};
AppearanceManager.Initiate(new WinformsWindowManager());
OutOfBoxExperience.Init(new Oobe());
- Infobox.Init(new WinformsInfobox());
+ Infobox.Init(new Dialog());
FileSkimmerBackend.Init(new WinformsFSFrontend());
var desk = new WinformsDesktop();
Desktop.Init(desk);
@@ -79,84 +79,6 @@ namespace ShiftOS.WinForms
}
}
- internal class WinformsInfobox : IInfobox
- {
- public void Open(string title, string msg)
- {
- Dialog frm = new Dialog();
- frm.Text = title;
- var pnl = new Panel();
- var flow = new FlowLayoutPanel();
- var btnok = new Button();
- btnok.AutoSize = true;
- btnok.AutoSizeMode = AutoSizeMode.GrowAndShrink;
- flow.Height = btnok.Height + 4;
- btnok.Text = "ok";
- flow.Dock = DockStyle.Bottom;
- flow.Controls.Add(btnok);
- btnok.Show(); btnok.Click += (o, a) =>
- {
- frm.Close();
- };
- pnl.Controls.Add(flow);
- flow.Show();
- var lbl = new Label();
- lbl.Text = msg;
- lbl.TextAlign = ContentAlignment.MiddleCenter;
- lbl.Dock = DockStyle.Fill;
- lbl.AutoSize = false;
- pnl.Controls.Add(lbl); lbl.Show();
- frm.Controls.Add(pnl);
- pnl.Dock = DockStyle.Fill;
- frm.Size = new Size(320, 200);
- AppearanceManager.SetupDialog(frm);
-
- }
-
- public void PromptText(string title, string msg, Action<string> callback)
- {
- Dialog frm = new Dialog();
- frm.Text = title;
- var pnl = new Panel();
- var flow = new FlowLayoutPanel();
- var btnok = new Button();
- btnok.AutoSize = true;
- btnok.AutoSizeMode = AutoSizeMode.GrowAndShrink;
- flow.Height = btnok.Height + 4;
- btnok.Text = "ok";
- flow.Dock = DockStyle.Bottom;
- flow.Controls.Add(btnok);
- var txtinput = new TextBox();
- btnok.Show(); btnok.Click += (o, a) =>
- {
- callback?.Invoke(txtinput.Text);
- frm.Close();
- };
- txtinput.Dock = DockStyle.Bottom;
- txtinput.KeyDown += (o, a) =>
- {
- if(a.KeyCode == Keys.Enter)
- {
- a.SuppressKeyPress = true;
- callback?.Invoke(txtinput.Text);
- frm.Close();
- }
- };
- pnl.Controls.Add(flow);
- pnl.Controls.Add(txtinput);txtinput.Show();
- flow.Show();
- var lbl = new Label();
- lbl.Text = msg;
- lbl.TextAlign = ContentAlignment.MiddleCenter;
- lbl.Dock = DockStyle.Fill;
- lbl.AutoSize = false;
- pnl.Controls.Add(lbl); lbl.Show();
- frm.Controls.Add(pnl);
- pnl.Dock = DockStyle.Fill;
- frm.Size = new Size(320, 200);
- AppearanceManager.SetupDialog(frm);
- }
- }
public class WinformsFSFrontend : IFileSkimmer
{
diff --git a/ShiftOS.WinForms/Resources/Shiftorium.txt b/ShiftOS.WinForms/Resources/Shiftorium.txt
index 575cfaa..7d4d7b7 100644
--- a/ShiftOS.WinForms/Resources/Shiftorium.txt
+++ b/ShiftOS.WinForms/Resources/Shiftorium.txt
@@ -303,10 +303,10 @@
Dependencies: "mud_fundamentals;app_launcher"
},
{
- Name: "Another test upgrade",
- Cost: 1,
- Description: "Read the ID or Name",
- Dependencies: "test_upgrade"
+ Name: "App Launcher Categories",
+ Cost: 1000,
+ Dependencies: "app_launcher",
+ Description: "Is your App Launcher getting full of items? Perhaps a little too full? Are you having trouble finding things? This upgrade should help - it'll sort all App Launcher items into categories for you."
},
{
Name: "Draggable windows",
diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj
index 0b247f3..3012488 100644
--- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj
+++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj
@@ -244,6 +244,9 @@
<EmbeddedResource Include="Applications\ColorPicker.resx">
<DependentUpon>ColorPicker.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="Applications\Dialog.resx">
+ <DependentUpon>Dialog.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="Applications\FileDialog.resx">
<DependentUpon>FileDialog.cs</DependentUpon>
</EmbeddedResource>
diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs
index c9287ff..e2b89fb 100644
--- a/ShiftOS.WinForms/WinformsDesktop.cs
+++ b/ShiftOS.WinForms/WinformsDesktop.cs
@@ -230,6 +230,20 @@ namespace ShiftOS.WinForms
PopulatePanelButtons();
}
+ public ToolStripMenuItem GetALCategoryWithName(string text)
+ {
+ foreach(ToolStripMenuItem menuitem in apps.DropDownItems)
+ {
+ if (menuitem.Text == text)
+ return menuitem;
+ }
+
+ var itm = new ToolStripMenuItem();
+ itm.Text = text;
+ apps.DropDownItems.Add(itm);
+ return itm;
+ }
+
/// <summary>
/// Populates the app launcher.
/// </summary>
@@ -239,6 +253,10 @@ namespace ShiftOS.WinForms
{
apps.DropDownItems.Clear();
+ Dictionary<string, List<ToolStripMenuItem>> sortedItems = new Dictionary<string, List<ToolStripMenuItem>>();
+
+
+
foreach (var kv in items)
{
var item = new ToolStripMenuItem();
@@ -247,7 +265,34 @@ namespace ShiftOS.WinForms
{
Engine.AppearanceManager.SetupWindow(Activator.CreateInstance(kv.LaunchType) as IShiftOSWindow);
};
- apps.DropDownItems.Add(item);
+ if (sortedItems.ContainsKey(kv.DisplayData.Category))
+ {
+ sortedItems[kv.DisplayData.Category].Add(item);
+ }
+ else
+ {
+ sortedItems.Add(kv.DisplayData.Category, new List<ToolStripMenuItem>());
+ sortedItems[kv.DisplayData.Category].Add(item);
+ }
+ }
+
+ foreach(var kv in sortedItems)
+ {
+ if (Shiftorium.UpgradeInstalled("app_launcher_categories"))
+ {
+ var cat = GetALCategoryWithName(kv.Key);
+ foreach(var subItem in kv.Value)
+ {
+ cat.DropDownItems.Add(subItem);
+ }
+ }
+ else
+ {
+ foreach(var subItem in kv.Value)
+ {
+ apps.DropDownItems.Add(subItem);
+ }
+ }
}
if (Shiftorium.UpgradeInstalled("al_shutdown"))
diff --git a/ShiftOS_TheReturn/Desktop.cs b/ShiftOS_TheReturn/Desktop.cs
index cadfa6d..3f9a88c 100644
--- a/ShiftOS_TheReturn/Desktop.cs
+++ b/ShiftOS_TheReturn/Desktop.cs
@@ -44,8 +44,10 @@ namespace ShiftOS.Engine
/// <param name="name">The text displayed on the launcher item</param>
/// <param name="requiresUpgrade">Whether or not an upgrade must be installed to see the launcher</param>
/// <param name="upgradeID">The ID of the upgrade - leave blank if requiresUpgrade is false.</param>
- public LauncherAttribute(string name, bool requiresUpgrade, string upgradeID = "")
+ /// <param name="category">The category that the item will appear in.</param>
+ public LauncherAttribute(string name, bool requiresUpgrade, string upgradeID = "", string category = "Other")
{
+ Category = category;
Name = name;
RequiresUpgrade = requiresUpgrade;
ID = upgradeID;
@@ -54,6 +56,7 @@ namespace ShiftOS.Engine
public string Name { get; set; }
public bool RequiresUpgrade { get; set; }
public string ID { get; set; }
+ public string Category { get; private set; }
public bool UpgradeInstalled
{
get
diff --git a/ShiftOS_TheReturn/Infobox.cs b/ShiftOS_TheReturn/Infobox.cs
index dfc72c2..8854b88 100644
--- a/ShiftOS_TheReturn/Infobox.cs
+++ b/ShiftOS_TheReturn/Infobox.cs
@@ -65,6 +65,11 @@ namespace ShiftOS.Engine
_infobox.PromptText(title, message, callback);
}
+ public static void PromptYesNo(string title, string message, Action<bool> callback)
+ {
+ _infobox.PromptYesNo(title, message, callback);
+ }
+
/// <summary>
/// Inits an infobox
/// </summary>
@@ -80,5 +85,6 @@ namespace ShiftOS.Engine
{
void Open(string title, string msg);
void PromptText(string title, string message, Action<string> callback);
+ void PromptYesNo(string title, string message, Action<bool> callback);
}
}