various things from last night

This commit is contained in:
Michael 2017-05-29 11:38:11 -04:00
parent f5a8a0a8c7
commit 58c9152351
8 changed files with 407 additions and 91 deletions

View file

@ -54,6 +54,13 @@ namespace ShiftOS.WinForms.Applications
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Chat));
this.panel1 = new System.Windows.Forms.Panel();
this.pnlstart = new System.Windows.Forms.Panel();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.txtchatid = new System.Windows.Forms.TextBox();
this.btnjoin = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.rtbchat = new System.Windows.Forms.RichTextBox();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.tschatid = new System.Windows.Forms.ToolStripLabel();
@ -61,18 +68,11 @@ namespace ShiftOS.WinForms.Applications
this.tsbottombar = new System.Windows.Forms.ToolStrip();
this.txtuserinput = new System.Windows.Forms.ToolStripTextBox();
this.btnsend = new System.Windows.Forms.ToolStripButton();
this.pnlstart = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.txtchatid = new System.Windows.Forms.TextBox();
this.btnjoin = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.tsbottombar.SuspendLayout();
this.pnlstart.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.tsbottombar.SuspendLayout();
this.SuspendLayout();
//
// panel1
@ -87,6 +87,82 @@ namespace ShiftOS.WinForms.Applications
this.panel1.Size = new System.Drawing.Size(633, 318);
this.panel1.TabIndex = 0;
//
// pnlstart
//
this.pnlstart.Controls.Add(this.flowLayoutPanel1);
this.pnlstart.Controls.Add(this.label3);
this.pnlstart.Controls.Add(this.label2);
this.pnlstart.Controls.Add(this.label1);
this.pnlstart.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlstart.Location = new System.Drawing.Point(0, 25);
this.pnlstart.Name = "pnlstart";
this.pnlstart.Size = new System.Drawing.Size(633, 268);
this.pnlstart.TabIndex = 4;
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.AutoSize = true;
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flowLayoutPanel1.Controls.Add(this.txtchatid);
this.flowLayoutPanel1.Controls.Add(this.btnjoin);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 118);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(633, 29);
this.flowLayoutPanel1.TabIndex = 3;
//
// txtchatid
//
this.txtchatid.Location = new System.Drawing.Point(3, 3);
this.txtchatid.Name = "txtchatid";
this.txtchatid.Size = new System.Drawing.Size(192, 20);
this.txtchatid.TabIndex = 0;
//
// btnjoin
//
this.btnjoin.Location = new System.Drawing.Point(201, 3);
this.btnjoin.Name = "btnjoin";
this.btnjoin.Size = new System.Drawing.Size(75, 23);
this.btnjoin.TabIndex = 1;
this.btnjoin.Text = "Join";
this.btnjoin.UseVisualStyleBackColor = true;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Dock = System.Windows.Forms.DockStyle.Top;
this.label3.Location = new System.Drawing.Point(0, 85);
this.label3.Name = "label3";
this.label3.Padding = new System.Windows.Forms.Padding(10);
this.label3.Size = new System.Drawing.Size(79, 33);
this.label3.TabIndex = 2;
this.label3.Tag = "header3";
this.label3.Text = "Join a chat";
//
// label2
//
this.label2.Dock = System.Windows.Forms.DockStyle.Top;
this.label2.Location = new System.Drawing.Point(0, 33);
this.label2.Name = "label2";
this.label2.Padding = new System.Windows.Forms.Padding(10);
this.label2.Size = new System.Drawing.Size(633, 52);
this.label2.TabIndex = 1;
this.label2.Text = "SimpleSRC is a simple chat program that utilises the ShiftOS Relay Chat protocol." +
" All you have to do is enter a chat code or system name, and SimpleSRC will try " +
"to initiate a chat for you.";
//
// 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(10);
this.label1.Size = new System.Drawing.Size(143, 33);
this.label1.TabIndex = 0;
this.label1.Tag = "header1";
this.label1.Text = "Welcome to SimpleSRC!";
//
// rtbchat
//
this.rtbchat.Dock = System.Windows.Forms.DockStyle.Fill;
@ -151,82 +227,6 @@ namespace ShiftOS.WinForms.Applications
this.btnsend.Text = "Send";
this.btnsend.Click += new System.EventHandler(this.btnsend_Click);
//
// pnlstart
//
this.pnlstart.Controls.Add(this.flowLayoutPanel1);
this.pnlstart.Controls.Add(this.label3);
this.pnlstart.Controls.Add(this.label2);
this.pnlstart.Controls.Add(this.label1);
this.pnlstart.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlstart.Location = new System.Drawing.Point(0, 25);
this.pnlstart.Name = "pnlstart";
this.pnlstart.Size = new System.Drawing.Size(633, 268);
this.pnlstart.TabIndex = 4;
//
// 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(10);
this.label1.Size = new System.Drawing.Size(143, 33);
this.label1.TabIndex = 0;
this.label1.Tag = "header1";
this.label1.Text = "Welcome to SimpleSRC!";
//
// label2
//
this.label2.Dock = System.Windows.Forms.DockStyle.Top;
this.label2.Location = new System.Drawing.Point(0, 33);
this.label2.Name = "label2";
this.label2.Padding = new System.Windows.Forms.Padding(10);
this.label2.Size = new System.Drawing.Size(633, 52);
this.label2.TabIndex = 1;
this.label2.Text = "SimpleSRC is a simple chat program that utilises the ShiftOS Relay Chat protocol." +
" All you have to do is enter a chat code or system name, and SimpleSRC will try " +
"to initiate a chat for you.";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Dock = System.Windows.Forms.DockStyle.Top;
this.label3.Location = new System.Drawing.Point(0, 85);
this.label3.Name = "label3";
this.label3.Padding = new System.Windows.Forms.Padding(10);
this.label3.Size = new System.Drawing.Size(79, 33);
this.label3.TabIndex = 2;
this.label3.Tag = "header3";
this.label3.Text = "Join a chat";
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.AutoSize = true;
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flowLayoutPanel1.Controls.Add(this.txtchatid);
this.flowLayoutPanel1.Controls.Add(this.btnjoin);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 118);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(633, 29);
this.flowLayoutPanel1.TabIndex = 3;
//
// txtchatid
//
this.txtchatid.Location = new System.Drawing.Point(3, 3);
this.txtchatid.Name = "txtchatid";
this.txtchatid.Size = new System.Drawing.Size(192, 20);
this.txtchatid.TabIndex = 0;
//
// btnjoin
//
this.btnjoin.Location = new System.Drawing.Point(201, 3);
this.btnjoin.Name = "btnjoin";
this.btnjoin.Size = new System.Drawing.Size(75, 23);
this.btnjoin.TabIndex = 1;
this.btnjoin.Text = "Join";
this.btnjoin.UseVisualStyleBackColor = true;
//
// Chat
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -236,14 +236,14 @@ namespace ShiftOS.WinForms.Applications
this.Size = new System.Drawing.Size(633, 318);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.tsbottombar.ResumeLayout(false);
this.tsbottombar.PerformLayout();
this.pnlstart.ResumeLayout(false);
this.pnlstart.PerformLayout();
this.flowLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.PerformLayout();
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.tsbottombar.ResumeLayout(false);
this.tsbottombar.PerformLayout();
this.ResumeLayout(false);
}

View file

@ -232,7 +232,7 @@ namespace ShiftOS.WinForms.Applications
var text = txt.Lines.ToArray();
var text2 = text[text.Length - 1];
var text3 = "";
Console.WriteLine();
txt.AppendText(Environment.NewLine);
var text4 = Regex.Replace(text2, @"\t|\n|\r", "");
if (IsInRemoteSystem == true)

View file

@ -302,7 +302,7 @@ namespace ShiftOS.WinForms
var client = new UniteClient("http://getshiftos.ml", token);
var sve = new Save();
SaveSystem.CurrentUser.Username = client.GetEmail();
sve.Username = client.GetEmail();
sve.Password = Guid.NewGuid().ToString();
sve.SystemName = client.GetSysName();
sve.UniteAuthToken = token;

View file

@ -388,6 +388,12 @@
<Compile Include="ShiftnetSites\ShiftGames.Designer.cs">
<DependentUpon>ShiftGames.cs</DependentUpon>
</Compile>
<Compile Include="ShiftnetSites\ShiftSoft_Ping.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="ShiftnetSites\ShiftSoft_Ping.Designer.cs">
<DependentUpon>ShiftSoft_Ping.cs</DependentUpon>
</Compile>
<Compile Include="ShiftOSAudioProvider.cs" />
<Compile Include="ShiftOSConfigFile.cs" />
<Compile Include="SkinCommands.cs" />
@ -583,6 +589,9 @@
<EmbeddedResource Include="ShiftnetSites\ShiftGames.resx">
<DependentUpon>ShiftGames.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ShiftnetSites\ShiftSoft_Ping.resx">
<DependentUpon>ShiftSoft_Ping.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UniteLoginDialog.resx">
<DependentUpon>UniteLoginDialog.cs</DependentUpon>
</EmbeddedResource>

View file

@ -0,0 +1,89 @@
namespace ShiftOS.WinForms.ShiftnetSites
{
partial class ShiftSoft_Ping
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.fllist = new System.Windows.Forms.FlowLayoutPanel();
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(10);
this.label1.Size = new System.Drawing.Size(48, 33);
this.label1.TabIndex = 0;
this.label1.Tag = "header2";
this.label1.Text = "Ping";
//
// label2
//
this.label2.Dock = System.Windows.Forms.DockStyle.Top;
this.label2.Location = new System.Drawing.Point(0, 33);
this.label2.Name = "label2";
this.label2.Padding = new System.Windows.Forms.Padding(10);
this.label2.Size = new System.Drawing.Size(734, 56);
this.label2.TabIndex = 1;
this.label2.Text = "Ping is a simple service that lets you see all the sites on the shiftnet/ cluster" +
". These sites are safe for you to use and do not contain malware or other threat" +
"s.";
//
// fllist
//
this.fllist.Dock = System.Windows.Forms.DockStyle.Fill;
this.fllist.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.fllist.Location = new System.Drawing.Point(0, 89);
this.fllist.Name = "fllist";
this.fllist.Size = new System.Drawing.Size(734, 389);
this.fllist.TabIndex = 2;
//
// ShiftSoft_Ping
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.fllist);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "ShiftSoft_Ping";
this.Size = new System.Drawing.Size(734, 478);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.FlowLayoutPanel fllist;
}
}

View file

@ -0,0 +1,92 @@
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 System.Reflection;
using System.IO;
using ShiftOS.Engine;
using ShiftOS.WinForms.Tools;
namespace ShiftOS.WinForms.ShiftnetSites
{
[ShiftnetSite("shiftnet/shiftsoft/ping", "Ping", "A site listing hosted by ShiftSoft.")]
public partial class ShiftSoft_Ping : UserControl, IShiftnetSite
{
public ShiftSoft_Ping()
{
InitializeComponent();
}
public event Action GoBack;
public event Action<string> GoToUrl;
public void OnLoad()
{
SetupListing();
}
public void OnSkinLoad()
{
ControlManager.SetupControls(this);
SetupListing();
}
public void SetupListing()
{
foreach(var exec in Directory.GetFiles(Environment.CurrentDirectory))
{
if(exec.ToLower().EndsWith(".exe") || exec.ToLower().EndsWith(".dll"))
{
try
{
var asm = Assembly.LoadFile(exec);
var types = asm.GetTypes();
foreach (var type in types)
{
if (type.GetInterfaces().Contains(typeof(IShiftnetSite)))
{
var attr = type.GetCustomAttributes(false).Where(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) =>
{
GoToUrl?.Invoke(attr.Url);
};
fllist.Controls.Add(lnk);
fllist.Controls.Add(desc);
ControlManager.SetupControls(lnk);
lnk.Show();
desc.Show();
}
}
}
}
catch { }
}
}
}
public void OnUpgrade()
{
}
public void Setup()
{
SetupListing();
}
}
}

View file

@ -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>

View file

@ -51,6 +51,8 @@ namespace ShiftOS.WinForms.Stories
Desktop.InvokeOnWorkerThread(() =>
{
Story.Start("installer");
while (!Shiftorium.UpgradeInstalled("installer"))
Thread.Sleep(20);
AppearanceManager.SetupWindow(installer);
installer.InitiateInstall(new ShiftnetInstallation());
});
@ -64,6 +66,10 @@ namespace ShiftOS.WinForms.Stories
WriteLine("There are also lots of companies offering many services.");
WriteLine("I'd stay on the shiftnet/ cluster though, others may be dangerous.");
WriteLine("I'd also stick to the sites listed on shiftnet/shiftsoft/ping - that site is regularly updated with the most safe Shiftnet sites.");
WriteLine("Oh, that reminds me. I have set you up with ShiftSoft's service provider, Freebie Solutions.");
WriteLine("It's a free provider, but it offers only 256 bytes per second download and upload speeds.");
WriteLine("You may want to go look for another provider when you can afford it.");
WriteLine("Trust me - with this provider, things get slow.");
WriteLine("Anyways, it was nice meeting you, hopefully someday you'll give theShell a try.");
TerminalBackend.PrefixEnabled = true;