From 73b789392440f9bd60476a8cf4e13e6d0ca3b876 Mon Sep 17 00:00:00 2001 From: gary Date: Thu, 9 Nov 2023 18:16:35 -0800 Subject: [PATCH] Add Settings Menu --- MossCast/MossCast.csproj | 9 + MossCast/StreamerGroupBox.cs | 2 +- MossCast/frmEditSettings.Designer.cs | 423 +++++++++++++++++++++++++++ MossCast/frmEditSettings.cs | 144 +++++++++ MossCast/frmEditSettings.resx | 197 +++++++++++++ MossCast/frmMain.Designer.cs | 60 +--- MossCast/frmMain.cs | 53 +--- 7 files changed, 798 insertions(+), 90 deletions(-) create mode 100644 MossCast/frmEditSettings.Designer.cs create mode 100644 MossCast/frmEditSettings.cs create mode 100644 MossCast/frmEditSettings.resx diff --git a/MossCast/MossCast.csproj b/MossCast/MossCast.csproj index 9a3929a..f9ae3a6 100644 --- a/MossCast/MossCast.csproj +++ b/MossCast/MossCast.csproj @@ -137,6 +137,12 @@ + + Form + + + frmEditSettings.cs + @@ -179,6 +185,9 @@ + + frmEditSettings.cs + frmMain.cs diff --git a/MossCast/StreamerGroupBox.cs b/MossCast/StreamerGroupBox.cs index 6bd6728..1129281 100644 --- a/MossCast/StreamerGroupBox.cs +++ b/MossCast/StreamerGroupBox.cs @@ -46,7 +46,7 @@ public void UpdateDataSource(List streamers) { cbStreamer.SelectedItem = selectedItem; } - else + else if (IsActive()) { Deactivate(); } diff --git a/MossCast/frmEditSettings.Designer.cs b/MossCast/frmEditSettings.Designer.cs new file mode 100644 index 0000000..c4ded9d --- /dev/null +++ b/MossCast/frmEditSettings.Designer.cs @@ -0,0 +1,423 @@ + +namespace MossCast +{ + partial class frmEditSettings + { + /// + /// 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmEditSettings)); + this.groupBoxStreamlink = new System.Windows.Forms.GroupBox(); + this.buttonClearStreamlink = new System.Windows.Forms.Button(); + this.buttonBrowseStreamlink = new System.Windows.Forms.Button(); + this.textBoxStreamlink = new System.Windows.Forms.TextBox(); + this.groupBoxStreamerFile = new System.Windows.Forms.GroupBox(); + this.buttonClearStreamerFile = new System.Windows.Forms.Button(); + this.buttonBrowseStreamerFile = new System.Windows.Forms.Button(); + this.textBoxStreamerFile = new System.Windows.Forms.TextBox(); + this.groupBoxWinDimensions = new System.Windows.Forms.GroupBox(); + this.updWindowHeight = new System.Windows.Forms.NumericUpDown(); + this.label2 = new System.Windows.Forms.Label(); + this.updWindowWidth = new System.Windows.Forms.NumericUpDown(); + this.label1 = new System.Windows.Forms.Label(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.updWindowStartY = new System.Windows.Forms.NumericUpDown(); + this.label3 = new System.Windows.Forms.Label(); + this.updWindowStartX = new System.Windows.Forms.NumericUpDown(); + this.label4 = new System.Windows.Forms.Label(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.updWindowMaxRows = new System.Windows.Forms.NumericUpDown(); + this.label6 = new System.Windows.Forms.Label(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.checkBoxCombineNameAndPronouns = new System.Windows.Forms.CheckBox(); + this.buttonResetAll = new System.Windows.Forms.Button(); + this.groupBoxStreamlink.SuspendLayout(); + this.groupBoxStreamerFile.SuspendLayout(); + this.groupBoxWinDimensions.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.updWindowHeight)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.updWindowWidth)).BeginInit(); + this.groupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.updWindowStartY)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.updWindowStartX)).BeginInit(); + this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.updWindowMaxRows)).BeginInit(); + this.groupBox3.SuspendLayout(); + this.SuspendLayout(); + // + // groupBoxStreamlink + // + this.groupBoxStreamlink.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxStreamlink.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.groupBoxStreamlink.Controls.Add(this.buttonClearStreamlink); + this.groupBoxStreamlink.Controls.Add(this.buttonBrowseStreamlink); + this.groupBoxStreamlink.Controls.Add(this.textBoxStreamlink); + this.groupBoxStreamlink.Location = new System.Drawing.Point(12, 12); + this.groupBoxStreamlink.Name = "groupBoxStreamlink"; + this.groupBoxStreamlink.Size = new System.Drawing.Size(660, 75); + this.groupBoxStreamlink.TabIndex = 0; + this.groupBoxStreamlink.TabStop = false; + this.groupBoxStreamlink.Text = "Path to Streamlink"; + // + // buttonClearStreamlink + // + this.buttonClearStreamlink.Location = new System.Drawing.Point(87, 45); + this.buttonClearStreamlink.Name = "buttonClearStreamlink"; + this.buttonClearStreamlink.Size = new System.Drawing.Size(75, 23); + this.buttonClearStreamlink.TabIndex = 2; + this.buttonClearStreamlink.Text = "Reset"; + this.buttonClearStreamlink.UseVisualStyleBackColor = true; + this.buttonClearStreamlink.Click += new System.EventHandler(this.buttonClearStreamlink_Click); + // + // buttonBrowseStreamlink + // + this.buttonBrowseStreamlink.Location = new System.Drawing.Point(6, 45); + this.buttonBrowseStreamlink.Name = "buttonBrowseStreamlink"; + this.buttonBrowseStreamlink.Size = new System.Drawing.Size(75, 23); + this.buttonBrowseStreamlink.TabIndex = 1; + this.buttonBrowseStreamlink.Text = "Browse"; + this.buttonBrowseStreamlink.UseVisualStyleBackColor = true; + this.buttonBrowseStreamlink.Click += new System.EventHandler(this.buttonBrowseStreamlink_Click); + // + // textBoxStreamlink + // + this.textBoxStreamlink.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxStreamlink.Enabled = false; + this.textBoxStreamlink.Location = new System.Drawing.Point(6, 19); + this.textBoxStreamlink.Name = "textBoxStreamlink"; + this.textBoxStreamlink.ReadOnly = true; + this.textBoxStreamlink.Size = new System.Drawing.Size(648, 20); + this.textBoxStreamlink.TabIndex = 0; + // + // groupBoxStreamerFile + // + this.groupBoxStreamerFile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxStreamerFile.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.groupBoxStreamerFile.Controls.Add(this.buttonClearStreamerFile); + this.groupBoxStreamerFile.Controls.Add(this.buttonBrowseStreamerFile); + this.groupBoxStreamerFile.Controls.Add(this.textBoxStreamerFile); + this.groupBoxStreamerFile.Location = new System.Drawing.Point(12, 93); + this.groupBoxStreamerFile.Name = "groupBoxStreamerFile"; + this.groupBoxStreamerFile.Size = new System.Drawing.Size(660, 75); + this.groupBoxStreamerFile.TabIndex = 3; + this.groupBoxStreamerFile.TabStop = false; + this.groupBoxStreamerFile.Text = "Path to Streamer File"; + // + // buttonClearStreamerFile + // + this.buttonClearStreamerFile.Location = new System.Drawing.Point(87, 45); + this.buttonClearStreamerFile.Name = "buttonClearStreamerFile"; + this.buttonClearStreamerFile.Size = new System.Drawing.Size(75, 23); + this.buttonClearStreamerFile.TabIndex = 2; + this.buttonClearStreamerFile.Text = "Reset"; + this.buttonClearStreamerFile.UseVisualStyleBackColor = true; + this.buttonClearStreamerFile.Click += new System.EventHandler(this.buttonClearStreamerFile_Click); + // + // buttonBrowseStreamerFile + // + this.buttonBrowseStreamerFile.Location = new System.Drawing.Point(6, 45); + this.buttonBrowseStreamerFile.Name = "buttonBrowseStreamerFile"; + this.buttonBrowseStreamerFile.Size = new System.Drawing.Size(75, 23); + this.buttonBrowseStreamerFile.TabIndex = 1; + this.buttonBrowseStreamerFile.Text = "Browse"; + this.buttonBrowseStreamerFile.UseVisualStyleBackColor = true; + this.buttonBrowseStreamerFile.Click += new System.EventHandler(this.buttonBrowseStreamerFile_Click); + // + // textBoxStreamerFile + // + this.textBoxStreamerFile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxStreamerFile.Enabled = false; + this.textBoxStreamerFile.Location = new System.Drawing.Point(6, 19); + this.textBoxStreamerFile.Name = "textBoxStreamerFile"; + this.textBoxStreamerFile.ReadOnly = true; + this.textBoxStreamerFile.Size = new System.Drawing.Size(648, 20); + this.textBoxStreamerFile.TabIndex = 0; + // + // groupBoxWinDimensions + // + this.groupBoxWinDimensions.Controls.Add(this.updWindowHeight); + this.groupBoxWinDimensions.Controls.Add(this.label2); + this.groupBoxWinDimensions.Controls.Add(this.updWindowWidth); + this.groupBoxWinDimensions.Controls.Add(this.label1); + this.groupBoxWinDimensions.Location = new System.Drawing.Point(12, 174); + this.groupBoxWinDimensions.Name = "groupBoxWinDimensions"; + this.groupBoxWinDimensions.Size = new System.Drawing.Size(180, 79); + this.groupBoxWinDimensions.TabIndex = 4; + this.groupBoxWinDimensions.TabStop = false; + this.groupBoxWinDimensions.Text = "Stream Window Dimensions"; + // + // updWindowHeight + // + this.updWindowHeight.Location = new System.Drawing.Point(47, 49); + this.updWindowHeight.Maximum = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.updWindowHeight.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.updWindowHeight.Name = "updWindowHeight"; + this.updWindowHeight.Size = new System.Drawing.Size(120, 20); + this.updWindowHeight.TabIndex = 4; + this.updWindowHeight.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.updWindowHeight.ValueChanged += new System.EventHandler(this.updWindowHeight_ValueChanged); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(6, 51); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(38, 13); + this.label2.TabIndex = 3; + this.label2.Text = "Height"; + // + // updWindowWidth + // + this.updWindowWidth.Location = new System.Drawing.Point(47, 23); + this.updWindowWidth.Maximum = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.updWindowWidth.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.updWindowWidth.Name = "updWindowWidth"; + this.updWindowWidth.Size = new System.Drawing.Size(120, 20); + this.updWindowWidth.TabIndex = 2; + this.updWindowWidth.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.updWindowWidth.ValueChanged += new System.EventHandler(this.updWindowWidth_ValueChanged); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(6, 25); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(35, 13); + this.label1.TabIndex = 1; + this.label1.Text = "Width"; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.updWindowStartY); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.updWindowStartX); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Location = new System.Drawing.Point(198, 174); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(164, 79); + this.groupBox1.TabIndex = 5; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Stream Window Start Position"; + // + // updWindowStartY + // + this.updWindowStartY.Location = new System.Drawing.Point(31, 49); + this.updWindowStartY.Maximum = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.updWindowStartY.Name = "updWindowStartY"; + this.updWindowStartY.Size = new System.Drawing.Size(120, 20); + this.updWindowStartY.TabIndex = 4; + this.updWindowStartY.ValueChanged += new System.EventHandler(this.updWindowStartY_ValueChanged); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(6, 51); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(14, 13); + this.label3.TabIndex = 3; + this.label3.Text = "Y"; + // + // updWindowStartX + // + this.updWindowStartX.Location = new System.Drawing.Point(31, 23); + this.updWindowStartX.Maximum = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.updWindowStartX.Name = "updWindowStartX"; + this.updWindowStartX.Size = new System.Drawing.Size(120, 20); + this.updWindowStartX.TabIndex = 2; + this.updWindowStartX.ValueChanged += new System.EventHandler(this.updWindowStartX_ValueChanged); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(6, 25); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(14, 13); + this.label4.TabIndex = 1; + this.label4.Text = "X"; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.updWindowMaxRows); + this.groupBox2.Controls.Add(this.label6); + this.groupBox2.Location = new System.Drawing.Point(368, 174); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(200, 53); + this.groupBox2.TabIndex = 6; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Stream Window Layout"; + // + // updWindowMaxRows + // + this.updWindowMaxRows.Location = new System.Drawing.Point(69, 23); + this.updWindowMaxRows.Name = "updWindowMaxRows"; + this.updWindowMaxRows.Size = new System.Drawing.Size(120, 20); + this.updWindowMaxRows.TabIndex = 2; + this.updWindowMaxRows.ValueChanged += new System.EventHandler(this.updWindowMaxRows_ValueChanged); + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(6, 25); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(57, 13); + this.label6.TabIndex = 1; + this.label6.Text = "Max Rows"; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.checkBoxCombineNameAndPronouns); + this.groupBox3.Location = new System.Drawing.Point(12, 259); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(180, 47); + this.groupBox3.TabIndex = 7; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Output File Settings"; + // + // checkBoxCombineNameAndPronouns + // + this.checkBoxCombineNameAndPronouns.AutoSize = true; + this.checkBoxCombineNameAndPronouns.Location = new System.Drawing.Point(6, 19); + this.checkBoxCombineNameAndPronouns.Name = "checkBoxCombineNameAndPronouns"; + this.checkBoxCombineNameAndPronouns.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.checkBoxCombineNameAndPronouns.Size = new System.Drawing.Size(148, 17); + this.checkBoxCombineNameAndPronouns.TabIndex = 1; + this.checkBoxCombineNameAndPronouns.Text = "Combine Name/Pronouns"; + this.checkBoxCombineNameAndPronouns.UseVisualStyleBackColor = true; + this.checkBoxCombineNameAndPronouns.CheckedChanged += new System.EventHandler(this.checkBoxCombineNameAndPronouns_CheckedChanged); + // + // buttonResetAll + // + this.buttonResetAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonResetAll.Location = new System.Drawing.Point(568, 326); + this.buttonResetAll.Name = "buttonResetAll"; + this.buttonResetAll.Size = new System.Drawing.Size(104, 23); + this.buttonResetAll.TabIndex = 8; + this.buttonResetAll.Text = "Reset All Settings"; + this.buttonResetAll.UseVisualStyleBackColor = true; + this.buttonResetAll.Click += new System.EventHandler(this.buttonResetAll_Click); + // + // frmEditSettings + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(684, 361); + this.Controls.Add(this.buttonResetAll); + this.Controls.Add(this.groupBox3); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.groupBoxWinDimensions); + this.Controls.Add(this.groupBoxStreamerFile); + this.Controls.Add(this.groupBoxStreamlink); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximumSize = new System.Drawing.Size(1200, 400); + this.MinimumSize = new System.Drawing.Size(700, 400); + this.Name = "frmEditSettings"; + this.Text = "Settings"; + this.Load += new System.EventHandler(this.frmEditSettings_Load); + this.groupBoxStreamlink.ResumeLayout(false); + this.groupBoxStreamlink.PerformLayout(); + this.groupBoxStreamerFile.ResumeLayout(false); + this.groupBoxStreamerFile.PerformLayout(); + this.groupBoxWinDimensions.ResumeLayout(false); + this.groupBoxWinDimensions.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.updWindowHeight)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.updWindowWidth)).EndInit(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.updWindowStartY)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.updWindowStartX)).EndInit(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.updWindowMaxRows)).EndInit(); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBoxStreamlink; + private System.Windows.Forms.Button buttonClearStreamlink; + private System.Windows.Forms.Button buttonBrowseStreamlink; + private System.Windows.Forms.TextBox textBoxStreamlink; + private System.Windows.Forms.GroupBox groupBoxStreamerFile; + private System.Windows.Forms.Button buttonClearStreamerFile; + private System.Windows.Forms.Button buttonBrowseStreamerFile; + private System.Windows.Forms.TextBox textBoxStreamerFile; + private System.Windows.Forms.GroupBox groupBoxWinDimensions; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.NumericUpDown updWindowHeight; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.NumericUpDown updWindowWidth; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.NumericUpDown updWindowStartY; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.NumericUpDown updWindowStartX; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.NumericUpDown updWindowMaxRows; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.CheckBox checkBoxCombineNameAndPronouns; + private System.Windows.Forms.Button buttonResetAll; + } +} \ No newline at end of file diff --git a/MossCast/frmEditSettings.cs b/MossCast/frmEditSettings.cs new file mode 100644 index 0000000..86867c2 --- /dev/null +++ b/MossCast/frmEditSettings.cs @@ -0,0 +1,144 @@ +#pragma warning disable 1591 + +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; + +namespace MossCast +{ + public partial class frmEditSettings : Form + { + public frmEditSettings() + { + InitializeComponent(); + } + + private void frmEditSettings_Load(object sender, EventArgs e) + { + textBoxStreamerFile.Text = Settings.Default.strPathToStreamerFile; + textBoxStreamlink.Text = Settings.Default.streamlinkDir; + + updWindowHeight.Value = Settings.Default.streamerWindowHeight; + updWindowWidth.Value = Settings.Default.streamerWindowWidth; + + updWindowStartX.Value = Settings.Default.streamerWindowStartX; + updWindowStartY.Value = Settings.Default.streamerWindowStartY; + + updWindowMaxRows.Value = Settings.Default.streamerWindowMaxPerRow; + + checkBoxCombineNameAndPronouns.Checked = Settings.Default.boolCombinedStreamerPronounFile; + } + + private void buttonClearStreamlink_Click(object sender, EventArgs e) + { + Settings.Default.streamlinkDir = ""; + My.MyProject.Forms.frmMain.setupStreamLinkCheck(); + Settings.Default.Save(); + } + + private void buttonClearStreamerFile_Click(object sender, EventArgs e) + { + Settings.Default.strPathToStreamerFile = My.MyProject.Forms.frmMain.appdataFolder + @"\streamerlist.conf"; + My.MyProject.Forms.frmMain.setupStreamerSources(); + Settings.Default.Save(); + } + + private void buttonBrowseStreamerFile_Click(object sender, EventArgs e) + { + var fd = new OpenFileDialog(); + + fd.Title = "Select a file..."; + fd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\MossCast"; + fd.Filter = "Config files (*.conf)|*.conf"; + fd.RestoreDirectory = true; + fd.ShowHelp = true; + + if (fd.ShowDialog() == DialogResult.OK && fd.FileName != Settings.Default.strPathToStreamerFile) + { + Settings.Default.strPathToStreamerFile = fd.FileName; + My.MyProject.Forms.frmMain.setupStreamerSources(); + Settings.Default.Save(); + } + } + + private void buttonBrowseStreamlink_Click(object sender, EventArgs e) + { + var fd = new OpenFileDialog(); + + fd.Title = "Select a file..."; + fd.Filter = "Streamlink (*.exe)|*.exe"; + fd.RestoreDirectory = true; + fd.ShowHelp = true; + + if (fd.ShowDialog() == DialogResult.OK && fd.FileName != Settings.Default.streamlinkDir) + { + Settings.Default.streamlinkDir = fd.FileName; + My.MyProject.Forms.frmMain.setupStreamLinkCheck(); + Settings.Default.Save(); + } + } + + private void updWindowWidth_ValueChanged(object sender, EventArgs e) + { + Settings.Default.streamerWindowWidth = (int)((NumericUpDown)sender).Value; + Settings.Default.Save(); + } + + private void updWindowHeight_ValueChanged(object sender, EventArgs e) + { + Settings.Default.streamerWindowHeight = (int)((NumericUpDown)sender).Value; + Settings.Default.Save(); + } + + private void updWindowStartX_ValueChanged(object sender, EventArgs e) + { + Settings.Default.streamerWindowStartX = (int)((NumericUpDown)sender).Value; + Settings.Default.Save(); + } + + private void updWindowStartY_ValueChanged(object sender, EventArgs e) + { + Settings.Default.streamerWindowStartY = (int)((NumericUpDown)sender).Value; + Settings.Default.Save(); + } + + private void updWindowMaxRows_ValueChanged(object sender, EventArgs e) + { + Settings.Default.streamerWindowMaxPerRow = (int)((NumericUpDown)sender).Value; + Settings.Default.Save(); + } + + private void checkBoxCombineNameAndPronouns_CheckedChanged(object sender, EventArgs e) + { + Settings.Default.boolCombinedStreamerPronounFile = ((CheckBox)sender).Checked; + Settings.Default.Save(); + } + + private void buttonResetAll_Click(object sender, EventArgs e) + { + var previousStreamerFile = Settings.Default.strPathToStreamerFile; + var previousStreamlinkFile = Settings.Default.streamlinkDir; + Settings.Default.Reset(); + + if (Settings.Default.strPathToStreamerFile != previousStreamerFile) + { + Settings.Default.strPathToStreamerFile = My.MyProject.Forms.frmMain.appdataFolder + @"\streamerlist.conf"; + My.MyProject.Forms.frmMain.setupStreamerSources(); + } + + if (Settings.Default.streamlinkDir != previousStreamlinkFile) + { + My.MyProject.Forms.frmMain.setupStreamLinkCheck(); + } + + Settings.Default.Save(); + frmEditSettings_Load(sender, e); + } + } +} diff --git a/MossCast/frmEditSettings.resx b/MossCast/frmEditSettings.resx new file mode 100644 index 0000000..b5820a6 --- /dev/null +++ b/MossCast/frmEditSettings.resx @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAACMuAAAjLgAAAAAAAAAA + AAAAAAAAAAAAAAAAADgAAACkAAAAsRESFqMMDRClAQEBpg8RFaEFBgijBAQFpAUGCKMAAACkAAAAoQAA + AKMBAQKkAQEApAAAAKQAAACkAAAApAEAAKQAAACkAAAAvQAAAM4AAADJAAAAuwAAAHwAAAAjAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAA3BAQD+RAQEv8MEyD/R3vO/0l8y/8tUIf/R33S/kh6zP8vWpr/Iz9q/yMh + Hf8lJST/Gh0n/yVTmv8rToj/HTVc/ydNhv8eNlv/MDdI/6emof/Ly8T/29nR/9vYz//NzMT/urmy/3Bv + av0KCgm9AAAAFAAAAAAAAAAAAAAAAgQFBtsfN1z/KFSQ/xgjOP9TjOb/UIrl/zhnrv9Lfs//RXnP/zts + u/8rM0X/Mj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AAA//wAAf/8AAH//gAB//8AA///h//8= + + + \ No newline at end of file diff --git a/MossCast/frmMain.Designer.cs b/MossCast/frmMain.Designer.cs index 9a4d3b7..8fd1b04 100644 --- a/MossCast/frmMain.Designer.cs +++ b/MossCast/frmMain.Designer.cs @@ -41,12 +41,8 @@ private void InitializeComponent() this.btnMoveResize = new System.Windows.Forms.Button(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.tsmiSelectAutocompleteFile = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiEditAutocompleteFile = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiOpenAppData = new System.Windows.Forms.ToolStripMenuItem(); - this.tsmiCombineNamesPronouns = new System.Windows.Forms.ToolStripMenuItem(); - this.StreamlinkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.tsmiResetStreamlinkPath = new System.Windows.Forms.ToolStripMenuItem(); this.ProgressBar1 = new System.Windows.Forms.ProgressBar(); this.statusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.ToolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); @@ -67,6 +63,7 @@ private void InitializeComponent() this.streamerGroupBox3 = new MossCast.StreamerGroupBox(); this.streamerGroupBox2 = new MossCast.StreamerGroupBox(); this.streamerGroupBox1 = new MossCast.StreamerGroupBox(); + this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.StatusStrip1.SuspendLayout(); this.groupBoxControls.SuspendLayout(); @@ -106,8 +103,7 @@ private void InitializeComponent() // this.menuStrip1.BackColor = System.Drawing.SystemColors.Control; this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem1, - this.StreamlinkToolStripMenuItem}); + this.fileToolStripMenuItem1}); this.menuStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow; this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.MaximumSize = new System.Drawing.Size(470, 24); @@ -120,59 +116,27 @@ private void InitializeComponent() // fileToolStripMenuItem1 // this.fileToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.tsmiSelectAutocompleteFile, this.tsmiEditAutocompleteFile, this.tsmiOpenAppData, - this.tsmiCombineNamesPronouns}); + this.settingsToolStripMenuItem}); this.fileToolStripMenuItem1.Name = "fileToolStripMenuItem1"; this.fileToolStripMenuItem1.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem1.Text = "File"; // - // tsmiSelectAutocompleteFile - // - this.tsmiSelectAutocompleteFile.Name = "tsmiSelectAutocompleteFile"; - this.tsmiSelectAutocompleteFile.Size = new System.Drawing.Size(240, 22); - this.tsmiSelectAutocompleteFile.Text = "Select Streamerlist File"; - this.tsmiSelectAutocompleteFile.Click += new System.EventHandler(this.selectAutocompleteFile_Click); - // // tsmiEditAutocompleteFile // this.tsmiEditAutocompleteFile.Name = "tsmiEditAutocompleteFile"; - this.tsmiEditAutocompleteFile.Size = new System.Drawing.Size(240, 22); + this.tsmiEditAutocompleteFile.Size = new System.Drawing.Size(188, 22); this.tsmiEditAutocompleteFile.Text = "Edit Streamerlist File"; this.tsmiEditAutocompleteFile.Click += new System.EventHandler(this.tsmiEditAutocompleteFile_Click); // // tsmiOpenAppData // this.tsmiOpenAppData.Name = "tsmiOpenAppData"; - this.tsmiOpenAppData.Size = new System.Drawing.Size(240, 22); - this.tsmiOpenAppData.Text = "Open AppData folder..."; + this.tsmiOpenAppData.Size = new System.Drawing.Size(188, 22); + this.tsmiOpenAppData.Text = "Open AppData Folder"; this.tsmiOpenAppData.Click += new System.EventHandler(this.tsmiOpenAppData_Click); // - // tsmiCombineNamesPronouns - // - this.tsmiCombineNamesPronouns.CheckOnClick = true; - this.tsmiCombineNamesPronouns.Name = "tsmiCombineNamesPronouns"; - this.tsmiCombineNamesPronouns.Size = new System.Drawing.Size(240, 22); - this.tsmiCombineNamesPronouns.Text = "Combine Names and Pronouns"; - this.tsmiCombineNamesPronouns.Click += new System.EventHandler(this.tsmiFileConfigure_Click); - // - // StreamlinkToolStripMenuItem - // - this.StreamlinkToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.tsmiResetStreamlinkPath}); - this.StreamlinkToolStripMenuItem.Name = "StreamlinkToolStripMenuItem"; - this.StreamlinkToolStripMenuItem.Size = new System.Drawing.Size(75, 20); - this.StreamlinkToolStripMenuItem.Text = "Streamlink"; - // - // tsmiResetStreamlinkPath - // - this.tsmiResetStreamlinkPath.BackColor = System.Drawing.SystemColors.Control; - this.tsmiResetStreamlinkPath.Name = "tsmiResetStreamlinkPath"; - this.tsmiResetStreamlinkPath.Size = new System.Drawing.Size(129, 22); - this.tsmiResetStreamlinkPath.Text = "Reset path"; - this.tsmiResetStreamlinkPath.Click += new System.EventHandler(this.ResetStreamlinkPathToolStripMenuItem_Click); - // // ProgressBar1 // this.ProgressBar1.Location = new System.Drawing.Point(14, 22); @@ -358,6 +322,13 @@ private void InitializeComponent() this.streamerGroupBox1.Size = new System.Drawing.Size(251, 142); this.streamerGroupBox1.TabIndex = 22; // + // settingsToolStripMenuItem + // + this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem"; + this.settingsToolStripMenuItem.Size = new System.Drawing.Size(188, 22); + this.settingsToolStripMenuItem.Text = "Settings"; + this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click); + // // frmMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -401,12 +372,8 @@ private void InitializeComponent() private Button btnMoveResize; private MenuStrip menuStrip1; private ToolStripMenuItem fileToolStripMenuItem1; - private ToolStripMenuItem tsmiSelectAutocompleteFile; internal ToolStripMenuItem tsmiEditAutocompleteFile; internal ToolStripMenuItem tsmiOpenAppData; - internal ToolStripMenuItem StreamlinkToolStripMenuItem; - internal ToolStripMenuItem tsmiResetStreamlinkPath; - internal ToolStripMenuItem tsmiCombineNamesPronouns; internal ProgressBar ProgressBar1; private StreamerGroupBox streamerGroupBox1; private StreamerGroupBox streamerGroupBox2; @@ -427,5 +394,6 @@ private void InitializeComponent() private Button btnClearAll; private Button btnQuickLoad; private Button btnResetScore; + private ToolStripMenuItem settingsToolStripMenuItem; } } \ No newline at end of file diff --git a/MossCast/frmMain.cs b/MossCast/frmMain.cs index 4af203d..cdaeb5e 100644 --- a/MossCast/frmMain.cs +++ b/MossCast/frmMain.cs @@ -24,7 +24,7 @@ public partial class frmMain public List streamerInfos; public List streamers; - private string appdataFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\MossCast"; + public string appdataFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\MossCast"; public delegate void StartupNextInstanceEventHandler(object sender, StartupNextInstanceEventArgs e); @@ -53,6 +53,7 @@ public void frmMain_Load(object sender, EventArgs e) if (Settings.Default.strPathToStreamerFile != "*.conf") { Settings.Default.strPathToStreamerFile = appdataFolder + @"\streamerlist.conf"; + Settings.Default.Save(); } int x = Screen.PrimaryScreen.WorkingArea.Width - Width; @@ -88,7 +89,6 @@ public void frmMain_Load(object sender, EventArgs e) setupStreamerSources(); ToolStripStatusLabel1.Text = "Version " + GetType().Assembly.GetName().Version.ToString(); - tsmiCombineNamesPronouns.Checked = Settings.Default.boolCombinedStreamerPronounFile; } @@ -114,6 +114,7 @@ public void setupStreamLinkCheck() if (File.Exists(location)) { Settings.Default.streamlinkDir = location; + Settings.Default.Save(); return; } } @@ -143,6 +144,7 @@ public void setupStreamLinkCheck() if (fd.ShowDialog() == DialogResult.OK) { Settings.Default.streamlinkDir = fd.FileName.ToString(); + Settings.Default.Save(); } else { @@ -261,25 +263,6 @@ private void btnGenAll_Click(object sender, EventArgs e) } - // Select file to use as autocomplete source - private void selectAutocompleteFile_Click(object sender, EventArgs e) - { - - var fd = new OpenFileDialog(); - - fd.Title = "Select a file..."; - fd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\MossCast"; - fd.Filter = "Config files (*.conf)|*.conf"; - fd.RestoreDirectory = true; - - if (fd.ShowDialog() == DialogResult.OK) - { - Settings.Default.strPathToStreamerFile = fd.FileName; - setupStreamerSources(); - } - } - - // Edit autcomplete file public void tsmiEditAutocompleteFile_Click(object sender, EventArgs e) { @@ -288,33 +271,11 @@ public void tsmiEditAutocompleteFile_Click(object sender, EventArgs e) } - // Combined streamer name and pronouns file - public void tsmiFileConfigure_Click(object sender, EventArgs e) - { - Settings.Default.boolCombinedStreamerPronounFile = tsmiCombineNamesPronouns.Checked; - } - private void tsmiOpenAppData_Click(object sender, EventArgs e) { Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\MossCast"); } - private void tsmiEditStreamlinkConfig_Click(object sender, EventArgs e) - { - Process.Start("notepad.exe", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\streamlink\streamlinkrc"); - } - - private void ResetStreamlinkPathToolStripMenuItem_Click(object sender, EventArgs e) - { - int boolResetStreamlinkPath = (int)MessageBox.Show("Reset the path to Streamlink? Current path: " + Constants.vbNewLine + Settings.Default.streamlinkDir, "Reset Streamlink path", MessageBoxButtons.YesNo); - - if (boolResetStreamlinkPath == (int)DialogResult.Yes) - { - Settings.Default.streamlinkDir = "Not set"; - setupStreamLinkCheck(); - } - } - private void btnClearAll_Click(object sender, EventArgs e) { @@ -370,5 +331,11 @@ private void btnResetScore_Click(object sender, EventArgs e) } } + + private void settingsToolStripMenuItem_Click(object sender, EventArgs e) + { + var form = new frmEditSettings(); + form.Show(); + } } } \ No newline at end of file