diff --git a/ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs b/ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs index 53b17b6..ba4c4f1 100644 --- a/ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs +++ b/ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs @@ -69,6 +69,10 @@ namespace ShiftOS.WinForms.Applications this.chatToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.joinAChatToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer(); + this.you_systemstatus = new System.Windows.Forms.Panel(); + this.btndeletesave = new System.Windows.Forms.Button(); + this.lblsysstatus = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); this.shop_all = new System.Windows.Forms.Panel(); this.flshoplist = new System.Windows.Forms.FlowLayoutPanel(); this.lblistdesc = new System.Windows.Forms.Label(); @@ -140,14 +144,11 @@ namespace ShiftOS.WinForms.Applications this.you_memos = new System.Windows.Forms.Panel(); this.flmemos = new System.Windows.Forms.FlowLayoutPanel(); this.label3 = new System.Windows.Forms.Label(); - this.you_systemstatus = new System.Windows.Forms.Panel(); - this.lblsysstatus = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.btndeletesave = new System.Windows.Forms.Button(); this.menuStrip1.SuspendLayout(); this.toolStripContainer1.ContentPanel.SuspendLayout(); this.toolStripContainer1.TopToolStripPanel.SuspendLayout(); this.toolStripContainer1.SuspendLayout(); + this.you_systemstatus.SuspendLayout(); this.shop_all.SuspendLayout(); this.shop_view.SuspendLayout(); this.panel5.SuspendLayout(); @@ -171,7 +172,6 @@ namespace ShiftOS.WinForms.Applications this.panel3.SuspendLayout(); this.flowLayoutPanel2.SuspendLayout(); this.you_memos.SuspendLayout(); - this.you_systemstatus.SuspendLayout(); this.SuspendLayout(); // // menuStrip1 @@ -322,6 +322,56 @@ namespace ShiftOS.WinForms.Applications // this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.menuStrip1); // + // you_systemstatus + // + this.you_systemstatus.Controls.Add(this.btndeletesave); + this.you_systemstatus.Controls.Add(this.lblsysstatus); + this.you_systemstatus.Controls.Add(this.label1); + this.you_systemstatus.Dock = System.Windows.Forms.DockStyle.Fill; + this.you_systemstatus.Location = new System.Drawing.Point(0, 0); + this.you_systemstatus.Name = "you_systemstatus"; + this.you_systemstatus.Size = new System.Drawing.Size(756, 464); + this.you_systemstatus.TabIndex = 0; + // + // btndeletesave + // + this.btndeletesave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btndeletesave.AutoSize = true; + this.btndeletesave.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btndeletesave.Location = new System.Drawing.Point(613, 415); + this.btndeletesave.Name = "btndeletesave"; + this.btndeletesave.Size = new System.Drawing.Size(99, 23); + this.btndeletesave.TabIndex = 2; + this.btndeletesave.Tag = "header3"; + this.btndeletesave.Text = "Delete my system"; + this.btndeletesave.UseVisualStyleBackColor = true; + this.btndeletesave.Click += new System.EventHandler(this.btndeletesave_Click); + // + // lblsysstatus + // + this.lblsysstatus.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblsysstatus.Location = new System.Drawing.Point(0, 43); + this.lblsysstatus.Name = "lblsysstatus"; + this.lblsysstatus.Padding = new System.Windows.Forms.Padding(15); + this.lblsysstatus.Size = new System.Drawing.Size(756, 421); + this.lblsysstatus.TabIndex = 1; + this.lblsysstatus.Text = "Username: {username}\r\nSystem name: {sysname}\r\n\r\nCodepoints: {cp}\r\nUpgrades: {boug" + + "ht}/{available}\r\n\r\nSystem version: {sysver}\r\n\r\nShared scripts: {scripts}\r\n\r\nCurr" + + "ent legion: {legionname}\r\nRole: {role}"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Dock = System.Windows.Forms.DockStyle.Top; + this.label1.Location = new System.Drawing.Point(0, 0); + this.label1.Margin = new System.Windows.Forms.Padding(15); + this.label1.Name = "label1"; + this.label1.Padding = new System.Windows.Forms.Padding(15); + this.label1.Size = new System.Drawing.Size(56, 43); + this.label1.TabIndex = 0; + this.label1.Tag = "header1"; + this.label1.Text = "You"; + // // shop_all // this.shop_all.Controls.Add(this.flshoplist); @@ -1132,56 +1182,6 @@ namespace ShiftOS.WinForms.Applications this.label3.Tag = "header1"; this.label3.Text = "Memos"; // - // you_systemstatus - // - this.you_systemstatus.Controls.Add(this.btndeletesave); - this.you_systemstatus.Controls.Add(this.lblsysstatus); - this.you_systemstatus.Controls.Add(this.label1); - this.you_systemstatus.Dock = System.Windows.Forms.DockStyle.Fill; - this.you_systemstatus.Location = new System.Drawing.Point(0, 0); - this.you_systemstatus.Name = "you_systemstatus"; - this.you_systemstatus.Size = new System.Drawing.Size(756, 464); - this.you_systemstatus.TabIndex = 0; - // - // lblsysstatus - // - this.lblsysstatus.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblsysstatus.Location = new System.Drawing.Point(0, 43); - this.lblsysstatus.Name = "lblsysstatus"; - this.lblsysstatus.Padding = new System.Windows.Forms.Padding(15); - this.lblsysstatus.Size = new System.Drawing.Size(756, 421); - this.lblsysstatus.TabIndex = 1; - this.lblsysstatus.Text = "Username: {username}\r\nSystem name: {sysname}\r\n\r\nCodepoints: {cp}\r\nUpgrades: {boug" + - "ht}/{available}\r\n\r\nSystem version: {sysver}\r\n\r\nShared scripts: {scripts}\r\n\r\nCurr" + - "ent legion: {legionname}\r\nRole: {role}"; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Dock = System.Windows.Forms.DockStyle.Top; - this.label1.Location = new System.Drawing.Point(0, 0); - this.label1.Margin = new System.Windows.Forms.Padding(15); - this.label1.Name = "label1"; - this.label1.Padding = new System.Windows.Forms.Padding(15); - this.label1.Size = new System.Drawing.Size(56, 43); - this.label1.TabIndex = 0; - this.label1.Tag = "header1"; - this.label1.Text = "You"; - // - // btndeletesave - // - this.btndeletesave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btndeletesave.AutoSize = true; - this.btndeletesave.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.btndeletesave.Location = new System.Drawing.Point(613, 415); - this.btndeletesave.Name = "btndeletesave"; - this.btndeletesave.Size = new System.Drawing.Size(99, 23); - this.btndeletesave.TabIndex = 2; - this.btndeletesave.Tag = "header3"; - this.btndeletesave.Text = "Delete my system"; - this.btndeletesave.UseVisualStyleBackColor = true; - this.btndeletesave.Click += new System.EventHandler(this.btndeletesave_Click); - // // MUDControlCentre // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1198,6 +1198,8 @@ namespace ShiftOS.WinForms.Applications this.toolStripContainer1.TopToolStripPanel.PerformLayout(); this.toolStripContainer1.ResumeLayout(false); this.toolStripContainer1.PerformLayout(); + this.you_systemstatus.ResumeLayout(false); + this.you_systemstatus.PerformLayout(); this.shop_all.ResumeLayout(false); this.shop_all.PerformLayout(); this.shop_view.ResumeLayout(false); @@ -1240,8 +1242,6 @@ namespace ShiftOS.WinForms.Applications this.flowLayoutPanel2.PerformLayout(); this.you_memos.ResumeLayout(false); this.you_memos.PerformLayout(); - this.you_systemstatus.ResumeLayout(false); - this.you_systemstatus.PerformLayout(); this.ResumeLayout(false); } diff --git a/ShiftOS.WinForms/Applications/Notifications.Designer.cs b/ShiftOS.WinForms/Applications/Notifications.Designer.cs index 74fd5b7..d88c25b 100644 --- a/ShiftOS.WinForms/Applications/Notifications.Designer.cs +++ b/ShiftOS.WinForms/Applications/Notifications.Designer.cs @@ -30,6 +30,7 @@ { this.lblnotifications = new System.Windows.Forms.Label(); this.fllist = new System.Windows.Forms.FlowLayoutPanel(); + this.btnmarkallread = new System.Windows.Forms.Button(); this.SuspendLayout(); // // lblnotifications @@ -53,10 +54,24 @@ this.fllist.Size = new System.Drawing.Size(437, 487); this.fllist.TabIndex = 1; // + // btnmarkallread + // + this.btnmarkallread.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnmarkallread.AutoSize = true; + this.btnmarkallread.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnmarkallread.Location = new System.Drawing.Point(356, 4); + this.btnmarkallread.Name = "btnmarkallread"; + this.btnmarkallread.Size = new System.Drawing.Size(78, 23); + this.btnmarkallread.TabIndex = 2; + this.btnmarkallread.Text = "Mark all read"; + this.btnmarkallread.UseVisualStyleBackColor = true; + this.btnmarkallread.Click += new System.EventHandler(this.btnmarkallread_Click); + // // Notifications // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.btnmarkallread); this.Controls.Add(this.fllist); this.Controls.Add(this.lblnotifications); this.Name = "Notifications"; @@ -70,5 +85,6 @@ private System.Windows.Forms.Label lblnotifications; private System.Windows.Forms.FlowLayoutPanel fllist; + private System.Windows.Forms.Button btnmarkallread; } } diff --git a/ShiftOS.WinForms/Applications/Notifications.cs b/ShiftOS.WinForms/Applications/Notifications.cs index 540d2b5..3ce3e58 100644 --- a/ShiftOS.WinForms/Applications/Notifications.cs +++ b/ShiftOS.WinForms/Applications/Notifications.cs @@ -23,14 +23,9 @@ namespace ShiftOS.WinForms.Applications { SetupUI(); }; - onRead += () => - { - SetupUI(); - }; } Action onMade = null; - Action onRead = null; public void SetupUI() { @@ -232,7 +227,6 @@ namespace ShiftOS.WinForms.Applications { SetupUI(); NotificationDaemon.NotificationMade += onMade; - NotificationDaemon.NotificationRead += onRead; } public void OnSkinLoad() @@ -242,12 +236,16 @@ namespace ShiftOS.WinForms.Applications public bool OnUnload() { NotificationDaemon.NotificationMade -= onMade; - NotificationDaemon.NotificationRead -= onRead; return true; } public void OnUpgrade() { } + + private void btnmarkallread_Click(object sender, EventArgs e) + { + NotificationDaemon.MarkAllRead(); + } } } diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs index bcb853f..957c793 100644 --- a/ShiftOS.WinForms/WinformsDesktop.cs +++ b/ShiftOS.WinForms/WinformsDesktop.cs @@ -68,13 +68,6 @@ namespace ShiftOS.WinForms }; - NotificationDaemon.NotificationRead += () => - { - //Soon this will pop a balloon note. - btnnotifications.Text = "Notifications (" + NotificationDaemon.GetUnreadCount().ToString() + ")"; - - }; - this.LocationChanged += (o, a) => { if (this.Left != 0) diff --git a/ShiftOS_TheReturn/NotificationDaemon.cs b/ShiftOS_TheReturn/NotificationDaemon.cs index c6ba90a..5adc026 100644 --- a/ShiftOS_TheReturn/NotificationDaemon.cs +++ b/ShiftOS_TheReturn/NotificationDaemon.cs @@ -35,7 +35,13 @@ namespace ShiftOS.Engine NotificationMade?.Invoke(lst[lst.Count - 1]); } - public static event Action NotificationRead; + + public static void MarkAllRead() + { + var notes = GetAllFromFile(); + for (int i = 0; i < notes.Length; i++) + MarkRead(i); + } public static void MarkRead(int note) { @@ -45,7 +51,6 @@ namespace ShiftOS.Engine notes[note].Read = true; WriteNotes(notes); - NotificationRead?.Invoke(); } public static int GetUnreadCount()