i am my own handicap (took me quite literally >10 hours to just default add a blank line to the listbox (didn't even think of it))

This commit is contained in:
random() 2025-04-29 22:45:29 -06:00
parent 5f22d25559
commit 55e3babc5b
11 changed files with 65 additions and 43 deletions

View file

@ -2,3 +2,6 @@
# CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
dotnet_diagnostic.CS8632.severity = suggestion
# CS4014: Because this call is not awaited, execution of the current method continues before the call is completed
dotnet_diagnostic.CS4014.severity = suggestion

View file

@ -45,15 +45,16 @@
this.debugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.testConsoleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.writeLabelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.listBox1 = new System.Windows.Forms.ListBox();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.showToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.quitToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.listBox1 = new System.Windows.Forms.ListBox();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.menuStrip1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
// menuStrip1
@ -155,7 +156,7 @@
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(107, 22);
this.aboutToolStripMenuItem.Text = "About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
//
@ -182,14 +183,6 @@
this.writeLabelToolStripMenuItem.Text = "Write Status";
this.writeLabelToolStripMenuItem.Click += new System.EventHandler(this.writeLabelToolStripMenuItem_Click);
//
// listBox1
//
this.listBox1.Location = new System.Drawing.Point(14, 27);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(475, 199);
this.listBox1.TabIndex = 1;
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
//
// notifyIcon1
//
this.notifyIcon1.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;
@ -225,36 +218,40 @@
this.quitToolStripMenuItem1.Text = "Quit";
this.quitToolStripMenuItem1.Click += new System.EventHandler(this.quitToolStripMenuItem1_Click);
//
// checkBox1
// listBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(397, 238);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(94, 17);
this.checkBox1.TabIndex = 4;
this.checkBox1.Text = "Show Console";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.Click += new System.EventHandler(this.checkBox1_Click);
this.listBox1.FormattingEnabled = true;
this.listBox1.Items.AddRange(new object[] {
" "});
this.listBox1.Location = new System.Drawing.Point(12, 27);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(479, 199);
this.listBox1.TabIndex = 5;
//
// label1
// statusStrip1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 242);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 3;
this.label1.Text = "label1";
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatusLabel1});
this.statusStrip1.Location = new System.Drawing.Point(0, 242);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(503, 22);
this.statusStrip1.TabIndex = 6;
this.statusStrip1.Text = "statusStrip1";
//
// toolStripStatusLabel1
//
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(103, 17);
this.toolStripStatusLabel1.Text = "Status Unavailable";
this.toolStripStatusLabel1.Click += new System.EventHandler(this.toolStripStatusLabel1_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.ClientSize = new System.Drawing.Size(503, 264);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.label1);
this.Controls.Add(this.checkBox1);
this.Controls.Add(this.menuStrip1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MainMenuStrip = this.menuStrip1;
@ -268,6 +265,8 @@
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@ -291,12 +290,12 @@
private System.Windows.Forms.ToolStripMenuItem quitToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem openToTrayToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem rPCSettingsToolStripMenuItem;
public System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.ToolStripMenuItem debugToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem testConsoleToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem writeLabelToolStripMenuItem;
public System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.ListBox listBox1;
public System.Windows.Forms.StatusStrip statusStrip1;
public System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
}
}

View file

@ -7,6 +7,7 @@ using System.Linq;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Collections;
namespace JellyfinRPC
{
@ -81,17 +82,32 @@ namespace JellyfinRPC
{
try
{
if (!listBox1.Items.Contains((object)ConsoleManager.lineToWrite))
string last = listBox1.Items[listBox1.Items.Count - 1].ToString();
if (last == ConsoleManager.lineToWrite)
{
return;
}
else
{
listBox1.BeginInvoke((MethodInvoker)delegate
{
listBox1.Items.Add(ConsoleManager.lineToWrite);
if (ConsoleManager.lineToWrite != null)
{
listBox1.Items.Add(ConsoleManager.lineToWrite);
}
});
}
}
catch (ArgumentNullException)
catch (NullReferenceException)
{
return;
}
@ -182,9 +198,10 @@ namespace JellyfinRPC
StatusManager.WriteStatusLine("Testing Status...");
}
private void checkBox1_Click(object sender, EventArgs e)
private void toolStripStatusLabel1_Click(object sender, EventArgs e)
{
listBox1.Enabled = checkBox1.Checked;
}
}
}

View file

@ -245,6 +245,9 @@
AAAIEAAAAAAAAIABAACAAQAAwAMAAMADAADgBwAA4AcAAPAPAAD4HwAA+B8AAPw/AAA=
</value>
</data>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>410, 27</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>62</value>
</metadata>

View file

@ -11,7 +11,7 @@ namespace JellyfinRPC
public static void WriteStatusLine(string Status)
{
MainForm = new Form1();
MainForm.label1.Text = $"Current Status - {Status}";
MainForm.toolStripStatusLabel1.Text = $"Current Status - {Status}";
}
}
}