From 1d60bd56e2e709d28fd4e70562884b2bf3fb19c9 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Thu, 29 Jul 2021 14:35:56 +1000 Subject: [PATCH 1/2] [Windows] Further cleanups --- windows/QMK Toolbox.sln | 4 +- windows/QMK Toolbox/Flashing.cs | 4 +- windows/QMK Toolbox/MainWindow.Designer.cs | 224 ++++++++++----------- windows/QMK Toolbox/MainWindow.cs | 22 +- 4 files changed, 127 insertions(+), 127 deletions(-) diff --git a/windows/QMK Toolbox.sln b/windows/QMK Toolbox.sln index 4fe06fc727..95f7e2b73c 100644 --- a/windows/QMK Toolbox.sln +++ b/windows/QMK Toolbox.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31424.327 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QMK Toolbox", "QMK Toolbox\QMK Toolbox.csproj", "{1F8BE719-CB0D-4A67-8422-B0C3A1B823F7}" EndProject diff --git a/windows/QMK Toolbox/Flashing.cs b/windows/QMK Toolbox/Flashing.cs index a1d10a9147..6db83fb317 100644 --- a/windows/QMK Toolbox/Flashing.cs +++ b/windows/QMK Toolbox/Flashing.cs @@ -1,14 +1,14 @@ // Created by Jack Humbert on 9/1/17. // Copyright © 2017 Jack Humbert. This code is licensed under MIT license (see LICENSE.md for details). +using QMK_Toolbox.Helpers; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; -using System.Windows.Forms; using System.Threading; -using QMK_Toolbox.Helpers; +using System.Windows.Forms; namespace QMK_Toolbox { diff --git a/windows/QMK Toolbox/MainWindow.Designer.cs b/windows/QMK Toolbox/MainWindow.Designer.cs index 3b8e0a0e47..c83b5d4583 100644 --- a/windows/QMK Toolbox/MainWindow.Designer.cs +++ b/windows/QMK Toolbox/MainWindow.Designer.cs @@ -26,6 +26,7 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow)); this.flashButton = new System.Windows.Forms.Button(); + this.windowStateBindingSource = new System.Windows.Forms.BindingSource(this.components); this.autoflashCheckbox = new System.Windows.Forms.CheckBox(); this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); this.openFileButton = new System.Windows.Forms.Button(); @@ -34,8 +35,10 @@ private void InitializeComponent() { this.qmkfmGroupBox = new System.Windows.Forms.GroupBox(); this.keymapLabel = new System.Windows.Forms.Label(); this.keymapBox = new System.Windows.Forms.ComboBox(); + this.keyboardBox = new QMK_Toolbox.ComboBoxPlaceholder(); this.loadKeymapButton = new System.Windows.Forms.Button(); this.fileGroupBox = new System.Windows.Forms.GroupBox(); + this.filepathBox = new QMK_Toolbox.BetterComboBox(); this.mcuBox = new System.Windows.Forms.ComboBox(); this.clearEepromButton = new System.Windows.Forms.Button(); this.logTextBox = new System.Windows.Forms.RichTextBox(); @@ -54,8 +57,15 @@ private void InitializeComponent() { this.fileToolStripMenuSep = new System.Windows.Forms.ToolStripSeparator(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.flashToolStripMenuItem = new QMK_Toolbox.BindableToolStripMenuItem(); this.eepromToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.eepromClearToolStripMenuItem = new QMK_Toolbox.BindableToolStripMenuItem(); + this.eepromToolStripMenuSep = new System.Windows.Forms.ToolStripSeparator(); + this.eepromLeftToolStripMenuItem = new QMK_Toolbox.BindableToolStripMenuItem(); + this.eepromRightToolStripMenuItem = new QMK_Toolbox.BindableToolStripMenuItem(); + this.exitDFUToolStripMenuItem = new QMK_Toolbox.BindableToolStripMenuItem(); this.toolsToolStripMenuSep1 = new System.Windows.Forms.ToolStripSeparator(); + this.autoFlashToolStripMenuItem = new QMK_Toolbox.BindableToolStripMenuItem(); this.toolsToolStripMenuSep2 = new System.Windows.Forms.ToolStripSeparator(); this.installDriversToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -63,21 +73,11 @@ private void InitializeComponent() { this.checkForUpdatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuSep = new System.Windows.Forms.ToolStripSeparator(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.flashToolStripMenuItem = new QMK_Toolbox.BindableToolStripMenuItem(); - this.windowStateBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.eepromClearToolStripMenuItem = new QMK_Toolbox.BindableToolStripMenuItem(); - this.eepromLeftToolStripMenuItem = new QMK_Toolbox.BindableToolStripMenuItem(); - this.eepromRightToolStripMenuItem = new QMK_Toolbox.BindableToolStripMenuItem(); - this.exitDFUToolStripMenuItem = new QMK_Toolbox.BindableToolStripMenuItem(); - this.autoFlashToolStripMenuItem = new QMK_Toolbox.BindableToolStripMenuItem(); - this.filepathBox = new QMK_Toolbox.BetterComboBox(); - this.keyboardBox = new QMK_Toolbox.ComboBoxPlaceholder(); - this.eepromToolStripMenuSep = new System.Windows.Forms.ToolStripSeparator(); + ((System.ComponentModel.ISupportInitialize)(this.windowStateBindingSource)).BeginInit(); this.qmkfmGroupBox.SuspendLayout(); this.fileGroupBox.SuspendLayout(); this.logContextMenu.SuspendLayout(); this.mainMenu.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.windowStateBindingSource)).BeginInit(); this.SuspendLayout(); // // flashButton @@ -92,6 +92,10 @@ private void InitializeComponent() { this.flashButton.Text = "Flash"; this.flashButton.Click += new System.EventHandler(this.flashButton_Click); // + // windowStateBindingSource + // + this.windowStateBindingSource.DataSource = typeof(QMK_Toolbox.WindowState); + // // autoflashCheckbox // this.autoflashCheckbox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -182,6 +186,25 @@ private void InitializeComponent() { this.keymapBox.TabIndex = 2; this.keymapBox.Text = global::QMK_Toolbox.Properties.Settings.Default.keymap; // + // keyboardBox + // + this.keyboardBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.keyboardBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; + this.keyboardBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.keyboardBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::QMK_Toolbox.Properties.Settings.Default, "keyboard", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.keyboardBox.Enabled = false; + this.keyboardBox.FormattingEnabled = true; + this.keyboardBox.Items.AddRange(new object[] { + "this feature coming in"}); + this.keyboardBox.Location = new System.Drawing.Point(6, 19); + this.keyboardBox.Name = "keyboardBox"; + this.keyboardBox.PlaceholderText = "Select a keyboard to download"; + this.keyboardBox.Size = new System.Drawing.Size(438, 21); + this.keyboardBox.TabIndex = 0; + this.keyboardBox.Text = global::QMK_Toolbox.Properties.Settings.Default.keyboard; + this.keyboardBox.TextChanged += new System.EventHandler(this.keyboardBox_TextChanged); + // // loadKeymapButton // this.loadKeymapButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -209,6 +232,20 @@ private void InitializeComponent() { this.fileGroupBox.TabStop = false; this.fileGroupBox.Text = "Local file"; // + // filepathBox + // + this.filepathBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.filepathBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::QMK_Toolbox.Properties.Settings.Default, "hexFileSetting", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.filepathBox.FormattingEnabled = true; + this.filepathBox.Location = new System.Drawing.Point(6, 19); + this.filepathBox.Name = "filepathBox"; + this.filepathBox.PlaceholderText = "Click Open or drag to window to select file"; + this.filepathBox.Size = new System.Drawing.Size(558, 21); + this.filepathBox.TabIndex = 0; + this.filepathBox.Text = global::QMK_Toolbox.Properties.Settings.Default.hexFileSetting; + this.filepathBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.filepathBox_KeyDown); + // // mcuBox // this.mcuBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -392,72 +429,6 @@ private void InitializeComponent() { this.toolsToolStripMenuItem.Size = new System.Drawing.Size(46, 20); this.toolsToolStripMenuItem.Text = "&Tools"; // - // eepromToolStripMenuItem - // - this.eepromToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.eepromClearToolStripMenuItem, - this.eepromToolStripMenuSep, - this.eepromLeftToolStripMenuItem, - this.eepromRightToolStripMenuItem}); - this.eepromToolStripMenuItem.Name = "eepromToolStripMenuItem"; - this.eepromToolStripMenuItem.Size = new System.Drawing.Size(196, 22); - this.eepromToolStripMenuItem.Text = "EEPROM"; - // - // toolsToolStripMenuSep1 - // - this.toolsToolStripMenuSep1.Name = "toolsToolStripMenuSep1"; - this.toolsToolStripMenuSep1.Size = new System.Drawing.Size(193, 6); - // - // toolsToolStripMenuSep2 - // - this.toolsToolStripMenuSep2.Name = "toolsToolStripMenuSep2"; - this.toolsToolStripMenuSep2.Size = new System.Drawing.Size(193, 6); - // - // installDriversToolStripMenuItem - // - this.installDriversToolStripMenuItem.Name = "installDriversToolStripMenuItem"; - this.installDriversToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); - this.installDriversToolStripMenuItem.Size = new System.Drawing.Size(196, 22); - this.installDriversToolStripMenuItem.Text = "I&nstall Drivers..."; - this.installDriversToolStripMenuItem.Click += new System.EventHandler(this.installDriversMenuItem_Click); - // - // optionsToolStripMenuItem - // - this.optionsToolStripMenuItem.Enabled = false; - this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; - this.optionsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); - this.optionsToolStripMenuItem.Size = new System.Drawing.Size(196, 22); - this.optionsToolStripMenuItem.Text = "O&ptions..."; - // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.checkForUpdatesToolStripMenuItem, - this.helpToolStripMenuSep, - this.aboutToolStripMenuItem}); - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); - this.helpToolStripMenuItem.Text = "&Help"; - // - // checkForUpdatesToolStripMenuItem - // - this.checkForUpdatesToolStripMenuItem.Enabled = false; - this.checkForUpdatesToolStripMenuItem.Name = "checkForUpdatesToolStripMenuItem"; - this.checkForUpdatesToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.checkForUpdatesToolStripMenuItem.Text = "Check for Updates..."; - // - // helpToolStripMenuSep - // - this.helpToolStripMenuSep.Name = "helpToolStripMenuSep"; - this.helpToolStripMenuSep.Size = new System.Drawing.Size(177, 6); - // - // aboutToolStripMenuItem - // - this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.aboutToolStripMenuItem.Text = "&About"; - this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutMenuItem_Click); - // // flashToolStripMenuItem // this.flashToolStripMenuItem.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this.windowStateBindingSource, "CanFlash", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); @@ -468,9 +439,16 @@ private void InitializeComponent() { this.flashToolStripMenuItem.Text = "Flash"; this.flashToolStripMenuItem.Click += new System.EventHandler(this.flashButton_Click); // - // windowStateBindingSource + // eepromToolStripMenuItem // - this.windowStateBindingSource.DataSource = typeof(QMK_Toolbox.WindowState); + this.eepromToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.eepromClearToolStripMenuItem, + this.eepromToolStripMenuSep, + this.eepromLeftToolStripMenuItem, + this.eepromRightToolStripMenuItem}); + this.eepromToolStripMenuItem.Name = "eepromToolStripMenuItem"; + this.eepromToolStripMenuItem.Size = new System.Drawing.Size(196, 22); + this.eepromToolStripMenuItem.Text = "EEPROM"; // // eepromClearToolStripMenuItem // @@ -482,6 +460,11 @@ private void InitializeComponent() { this.eepromClearToolStripMenuItem.Text = "Clear"; this.eepromClearToolStripMenuItem.Click += new System.EventHandler(this.clearEepromButton_Click); // + // eepromToolStripMenuSep + // + this.eepromToolStripMenuSep.Name = "eepromToolStripMenuSep"; + this.eepromToolStripMenuSep.Size = new System.Drawing.Size(244, 6); + // // eepromLeftToolStripMenuItem // this.eepromLeftToolStripMenuItem.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this.windowStateBindingSource, "CanClearEeprom", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); @@ -514,6 +497,11 @@ private void InitializeComponent() { this.exitDFUToolStripMenuItem.Text = "Exit DFU"; this.exitDFUToolStripMenuItem.Click += new System.EventHandler(this.resetButton_Click); // + // toolsToolStripMenuSep1 + // + this.toolsToolStripMenuSep1.Name = "toolsToolStripMenuSep1"; + this.toolsToolStripMenuSep1.Size = new System.Drawing.Size(193, 6); + // // autoFlashToolStripMenuItem // this.autoFlashToolStripMenuItem.CheckOnClick = true; @@ -522,43 +510,55 @@ private void InitializeComponent() { this.autoFlashToolStripMenuItem.Size = new System.Drawing.Size(196, 22); this.autoFlashToolStripMenuItem.Text = "Auto-Flash"; // - // filepathBox + // toolsToolStripMenuSep2 // - this.filepathBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.filepathBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::QMK_Toolbox.Properties.Settings.Default, "hexFileSetting", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.filepathBox.FormattingEnabled = true; - this.filepathBox.Location = new System.Drawing.Point(6, 19); - this.filepathBox.Name = "filepathBox"; - this.filepathBox.PlaceholderText = "Click Open or drag to window to select file"; - this.filepathBox.Size = new System.Drawing.Size(558, 21); - this.filepathBox.TabIndex = 0; - this.filepathBox.Text = global::QMK_Toolbox.Properties.Settings.Default.hexFileSetting; - this.filepathBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.filepathBox_KeyDown); + this.toolsToolStripMenuSep2.Name = "toolsToolStripMenuSep2"; + this.toolsToolStripMenuSep2.Size = new System.Drawing.Size(193, 6); // - // keyboardBox + // installDriversToolStripMenuItem // - this.keyboardBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.keyboardBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; - this.keyboardBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.keyboardBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::QMK_Toolbox.Properties.Settings.Default, "keyboard", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.keyboardBox.Enabled = false; - this.keyboardBox.FormattingEnabled = true; - this.keyboardBox.Items.AddRange(new object[] { - "this feature coming in"}); - this.keyboardBox.Location = new System.Drawing.Point(6, 19); - this.keyboardBox.Name = "keyboardBox"; - this.keyboardBox.PlaceholderText = "Select a keyboard to download"; - this.keyboardBox.Size = new System.Drawing.Size(438, 21); - this.keyboardBox.TabIndex = 0; - this.keyboardBox.Text = global::QMK_Toolbox.Properties.Settings.Default.keyboard; - this.keyboardBox.TextChanged += new System.EventHandler(this.keyboardBox_TextChanged); + this.installDriversToolStripMenuItem.Name = "installDriversToolStripMenuItem"; + this.installDriversToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); + this.installDriversToolStripMenuItem.Size = new System.Drawing.Size(196, 22); + this.installDriversToolStripMenuItem.Text = "I&nstall Drivers..."; + this.installDriversToolStripMenuItem.Click += new System.EventHandler(this.installDriversMenuItem_Click); // - // eepromToolStripMenuSep + // optionsToolStripMenuItem // - this.eepromToolStripMenuSep.Name = "eepromToolStripMenuSep"; - this.eepromToolStripMenuSep.Size = new System.Drawing.Size(244, 6); + this.optionsToolStripMenuItem.Enabled = false; + this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; + this.optionsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); + this.optionsToolStripMenuItem.Size = new System.Drawing.Size(196, 22); + this.optionsToolStripMenuItem.Text = "O&ptions..."; + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.checkForUpdatesToolStripMenuItem, + this.helpToolStripMenuSep, + this.aboutToolStripMenuItem}); + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); + this.helpToolStripMenuItem.Text = "&Help"; + // + // checkForUpdatesToolStripMenuItem + // + this.checkForUpdatesToolStripMenuItem.Enabled = false; + this.checkForUpdatesToolStripMenuItem.Name = "checkForUpdatesToolStripMenuItem"; + this.checkForUpdatesToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.checkForUpdatesToolStripMenuItem.Text = "Check for Updates..."; + // + // helpToolStripMenuSep + // + this.helpToolStripMenuSep.Name = "helpToolStripMenuSep"; + this.helpToolStripMenuSep.Size = new System.Drawing.Size(177, 6); + // + // aboutToolStripMenuItem + // + this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.aboutToolStripMenuItem.Text = "&About"; + this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutMenuItem_Click); // // MainWindow // @@ -586,6 +586,7 @@ private void InitializeComponent() { this.Shown += new System.EventHandler(this.MainWindow_Shown); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.MainWindow_DragDrop); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.MainWindow_DragEnter); + ((System.ComponentModel.ISupportInitialize)(this.windowStateBindingSource)).EndInit(); this.qmkfmGroupBox.ResumeLayout(false); this.qmkfmGroupBox.PerformLayout(); this.fileGroupBox.ResumeLayout(false); @@ -593,7 +594,6 @@ private void InitializeComponent() { this.logContextMenu.ResumeLayout(false); this.mainMenu.ResumeLayout(false); this.mainMenu.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.windowStateBindingSource)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); diff --git a/windows/QMK Toolbox/MainWindow.cs b/windows/QMK Toolbox/MainWindow.cs index ce634a25be..4c5de96b35 100644 --- a/windows/QMK Toolbox/MainWindow.cs +++ b/windows/QMK Toolbox/MainWindow.cs @@ -1,6 +1,7 @@ // Created by Jack Humbert on 9/1/17. // Copyright © 2017 Jack Humbert. This code is licensed under MIT license (see LICENSE.md for details). +using QMK_Toolbox.Helpers; using QMK_Toolbox.Properties; using System; using System.ComponentModel; @@ -8,10 +9,9 @@ using System.IO; using System.IO.Compression; using System.Linq; -using System.Threading; using System.Security.Permissions; +using System.Threading; using System.Windows.Forms; -using QMK_Toolbox.Helpers; namespace QMK_Toolbox { @@ -271,7 +271,7 @@ private void flashButton_Click(object sender, EventArgs e) { if (!windowState.AutoFlashEnabled) { - this.Invoke(new Action(DisableUI)); + Invoke(new Action(DisableUI)); } _printer.Print("Attempting to flash, please don't remove device", MessageType.Bootloader); @@ -279,7 +279,7 @@ private void flashButton_Click(object sender, EventArgs e) if (!windowState.AutoFlashEnabled) { - this.Invoke(new Action(EnableUI)); + Invoke(new Action(EnableUI)); } } } @@ -311,14 +311,14 @@ private void resetButton_Click(object sender, EventArgs e) { if (!windowState.AutoFlashEnabled) { - this.Invoke(new Action(DisableUI)); + Invoke(new Action(DisableUI)); } _flasher.Reset(mcuBox.Text); if (!windowState.AutoFlashEnabled) { - this.Invoke(new Action(EnableUI)); + Invoke(new Action(EnableUI)); } } } @@ -349,14 +349,14 @@ private void clearEepromButton_Click(object sender, EventArgs e) { if (!windowState.AutoFlashEnabled) { - this.Invoke(new Action(DisableUI)); + Invoke(new Action(DisableUI)); } _flasher.ClearEeprom(mcuBox.Text); if (!windowState.AutoFlashEnabled) { - this.Invoke(new Action(EnableUI)); + Invoke(new Action(EnableUI)); } } } @@ -388,7 +388,7 @@ private void setHandednessButton_Click(object sender, EventArgs e) { if (!windowState.AutoFlashEnabled) { - this.Invoke(new Action(DisableUI)); + Invoke(new Action(DisableUI)); } ToolStripMenuItem item = sender as ToolStripMenuItem; @@ -396,7 +396,7 @@ private void setHandednessButton_Click(object sender, EventArgs e) if (!windowState.AutoFlashEnabled) { - this.Invoke(new Action(EnableUI)); + Invoke(new Action(EnableUI)); } } } @@ -624,7 +624,7 @@ private void DeviceEvent(object sender, EventArrivedEventArgs e) if (!windowState.AutoFlashEnabled) { - this.Invoke(new Action(EnableUI)); + Invoke(new Action(EnableUI)); } } From 3086bf13646605ea49d3f7a26ff1c8b2d9c120b3 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Thu, 29 Jul 2021 14:43:43 +1000 Subject: [PATCH 2/2] Fix IDE1006's --- windows/QMK Toolbox/AboutBox.Designer.cs | 2 +- windows/QMK Toolbox/AboutBox.cs | 2 +- windows/QMK Toolbox/MainWindow.Designer.cs | 40 +++++++++++----------- windows/QMK Toolbox/MainWindow.cs | 40 +++++++++++----------- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/windows/QMK Toolbox/AboutBox.Designer.cs b/windows/QMK Toolbox/AboutBox.Designer.cs index 79eae98170..29cf644c62 100644 --- a/windows/QMK Toolbox/AboutBox.Designer.cs +++ b/windows/QMK Toolbox/AboutBox.Designer.cs @@ -54,7 +54,7 @@ private void InitializeComponent() { this.linkLabel1.TabStop = true; this.linkLabel1.Text = "https://github.com/qmk/qmk_toolbox"; this.linkLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); + this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabel1_LinkClicked); // // pictureBox1 // diff --git a/windows/QMK Toolbox/AboutBox.cs b/windows/QMK Toolbox/AboutBox.cs index b17a3fa1fc..f7efb65087 100644 --- a/windows/QMK Toolbox/AboutBox.cs +++ b/windows/QMK Toolbox/AboutBox.cs @@ -89,7 +89,7 @@ public string AssemblyCompany #endregion Assembly Attribute Accessors - private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + private void LinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { System.Diagnostics.Process.Start(linkLabel1.Text); } diff --git a/windows/QMK Toolbox/MainWindow.Designer.cs b/windows/QMK Toolbox/MainWindow.Designer.cs index c83b5d4583..f2255adb78 100644 --- a/windows/QMK Toolbox/MainWindow.Designer.cs +++ b/windows/QMK Toolbox/MainWindow.Designer.cs @@ -90,7 +90,7 @@ private void InitializeComponent() { this.flashButton.Size = new System.Drawing.Size(62, 23); this.flashButton.TabIndex = 3; this.flashButton.Text = "Flash"; - this.flashButton.Click += new System.EventHandler(this.flashButton_Click); + this.flashButton.Click += new System.EventHandler(this.FlashButton_Click); // // windowStateBindingSource // @@ -123,7 +123,7 @@ private void InitializeComponent() { this.openFileButton.TabIndex = 1; this.openFileButton.Text = "Open"; this.openFileButton.UseVisualStyleBackColor = true; - this.openFileButton.Click += new System.EventHandler(this.openFileButton_Click); + this.openFileButton.Click += new System.EventHandler(this.OpenFileButton_Click); // // resetButton // @@ -135,7 +135,7 @@ private void InitializeComponent() { this.resetButton.Size = new System.Drawing.Size(67, 23); this.resetButton.TabIndex = 4; this.resetButton.Text = "Exit DFU"; - this.resetButton.Click += new System.EventHandler(this.resetButton_Click); + this.resetButton.Click += new System.EventHandler(this.ResetButton_Click); // // mcuLabel // @@ -203,7 +203,7 @@ private void InitializeComponent() { this.keyboardBox.Size = new System.Drawing.Size(438, 21); this.keyboardBox.TabIndex = 0; this.keyboardBox.Text = global::QMK_Toolbox.Properties.Settings.Default.keyboard; - this.keyboardBox.TextChanged += new System.EventHandler(this.keyboardBox_TextChanged); + this.keyboardBox.TextChanged += new System.EventHandler(this.KeyboardBox_TextChanged); // // loadKeymapButton // @@ -215,7 +215,7 @@ private void InitializeComponent() { this.loadKeymapButton.TabIndex = 3; this.loadKeymapButton.Text = "Load"; this.loadKeymapButton.UseVisualStyleBackColor = true; - this.loadKeymapButton.Click += new System.EventHandler(this.loadKeymapButton_Click); + this.loadKeymapButton.Click += new System.EventHandler(this.LoadKeymapButton_Click); // // fileGroupBox // @@ -244,7 +244,7 @@ private void InitializeComponent() { this.filepathBox.Size = new System.Drawing.Size(558, 21); this.filepathBox.TabIndex = 0; this.filepathBox.Text = global::QMK_Toolbox.Properties.Settings.Default.hexFileSetting; - this.filepathBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.filepathBox_KeyDown); + this.filepathBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FilepathBox_KeyDown); // // mcuBox // @@ -269,7 +269,7 @@ private void InitializeComponent() { this.clearEepromButton.TabIndex = 7; this.clearEepromButton.Text = "Clear EEPROM"; this.clearEepromButton.UseVisualStyleBackColor = true; - this.clearEepromButton.Click += new System.EventHandler(this.clearEepromButton_Click); + this.clearEepromButton.Click += new System.EventHandler(this.ClearEepromButton_Click); // // logTextBox // @@ -306,7 +306,7 @@ private void InitializeComponent() { this.logContextMenu.Name = "contextMenuStrip2"; this.logContextMenu.ShowImageMargin = false; this.logContextMenu.Size = new System.Drawing.Size(140, 126); - this.logContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.logContextMenuStrip_Opening); + this.logContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.LogContextMenuStrip_Opening); // // cutToolStripMenuItem // @@ -322,7 +322,7 @@ private void InitializeComponent() { this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); this.copyToolStripMenuItem.Size = new System.Drawing.Size(139, 22); this.copyToolStripMenuItem.Text = "&Copy"; - this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); + this.copyToolStripMenuItem.Click += new System.EventHandler(this.CopyToolStripMenuItem_Click); // // pasteToolStripMenuItem // @@ -344,7 +344,7 @@ private void InitializeComponent() { this.selectAllToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(139, 22); this.selectAllToolStripMenuItem.Text = "Select &All"; - this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click); + this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.SelectAllToolStripMenuItem_Click); // // logContextMenuSep2 // @@ -357,7 +357,7 @@ private void InitializeComponent() { this.clearToolStripMenuItem.Name = "clearToolStripMenuItem"; this.clearToolStripMenuItem.Size = new System.Drawing.Size(139, 22); this.clearToolStripMenuItem.Text = "Clea&r"; - this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click); + this.clearToolStripMenuItem.Click += new System.EventHandler(this.ClearToolStripMenuItem_Click); // // hidList // @@ -399,7 +399,7 @@ private void InitializeComponent() { this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); this.openToolStripMenuItem.Size = new System.Drawing.Size(155, 22); this.openToolStripMenuItem.Text = "&Open..."; - this.openToolStripMenuItem.Click += new System.EventHandler(this.openFileButton_Click); + this.openToolStripMenuItem.Click += new System.EventHandler(this.OpenFileButton_Click); // // fileToolStripMenuSep // @@ -412,7 +412,7 @@ private void InitializeComponent() { this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); this.exitToolStripMenuItem.Size = new System.Drawing.Size(155, 22); this.exitToolStripMenuItem.Text = "E&xit"; - this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitMenuItem_Click); + this.exitToolStripMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click); // // toolsToolStripMenuItem // @@ -437,7 +437,7 @@ private void InitializeComponent() { | System.Windows.Forms.Keys.F))); this.flashToolStripMenuItem.Size = new System.Drawing.Size(196, 22); this.flashToolStripMenuItem.Text = "Flash"; - this.flashToolStripMenuItem.Click += new System.EventHandler(this.flashButton_Click); + this.flashToolStripMenuItem.Click += new System.EventHandler(this.FlashButton_Click); // // eepromToolStripMenuItem // @@ -458,7 +458,7 @@ private void InitializeComponent() { | System.Windows.Forms.Keys.E))); this.eepromClearToolStripMenuItem.Size = new System.Drawing.Size(247, 22); this.eepromClearToolStripMenuItem.Text = "Clear"; - this.eepromClearToolStripMenuItem.Click += new System.EventHandler(this.clearEepromButton_Click); + this.eepromClearToolStripMenuItem.Click += new System.EventHandler(this.ClearEepromButton_Click); // // eepromToolStripMenuSep // @@ -474,7 +474,7 @@ private void InitializeComponent() { this.eepromLeftToolStripMenuItem.Size = new System.Drawing.Size(247, 22); this.eepromLeftToolStripMenuItem.Tag = "left"; this.eepromLeftToolStripMenuItem.Text = "Set Left Hand"; - this.eepromLeftToolStripMenuItem.Click += new System.EventHandler(this.setHandednessButton_Click); + this.eepromLeftToolStripMenuItem.Click += new System.EventHandler(this.SetHandednessButton_Click); // // eepromRightToolStripMenuItem // @@ -485,7 +485,7 @@ private void InitializeComponent() { this.eepromRightToolStripMenuItem.Size = new System.Drawing.Size(247, 22); this.eepromRightToolStripMenuItem.Tag = "right"; this.eepromRightToolStripMenuItem.Text = "Set Right Hand"; - this.eepromRightToolStripMenuItem.Click += new System.EventHandler(this.setHandednessButton_Click); + this.eepromRightToolStripMenuItem.Click += new System.EventHandler(this.SetHandednessButton_Click); // // exitDFUToolStripMenuItem // @@ -495,7 +495,7 @@ private void InitializeComponent() { | System.Windows.Forms.Keys.X))); this.exitDFUToolStripMenuItem.Size = new System.Drawing.Size(196, 22); this.exitDFUToolStripMenuItem.Text = "Exit DFU"; - this.exitDFUToolStripMenuItem.Click += new System.EventHandler(this.resetButton_Click); + this.exitDFUToolStripMenuItem.Click += new System.EventHandler(this.ResetButton_Click); // // toolsToolStripMenuSep1 // @@ -521,7 +521,7 @@ private void InitializeComponent() { this.installDriversToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); this.installDriversToolStripMenuItem.Size = new System.Drawing.Size(196, 22); this.installDriversToolStripMenuItem.Text = "I&nstall Drivers..."; - this.installDriversToolStripMenuItem.Click += new System.EventHandler(this.installDriversMenuItem_Click); + this.installDriversToolStripMenuItem.Click += new System.EventHandler(this.InstallDriversMenuItem_Click); // // optionsToolStripMenuItem // @@ -558,7 +558,7 @@ private void InitializeComponent() { this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; this.aboutToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.aboutToolStripMenuItem.Text = "&About"; - this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutMenuItem_Click); + this.aboutToolStripMenuItem.Click += new System.EventHandler(this.AboutMenuItem_Click); // // MainWindow // diff --git a/windows/QMK Toolbox/MainWindow.cs b/windows/QMK Toolbox/MainWindow.cs index 4c5de96b35..0c77a48656 100644 --- a/windows/QMK Toolbox/MainWindow.cs +++ b/windows/QMK Toolbox/MainWindow.cs @@ -236,7 +236,7 @@ private void LoadKeymapList() // keymapBox.Enabled = true; } - private void loadKeymapButton_Click(object sender, EventArgs e) + private void LoadKeymapButton_Click(object sender, EventArgs e) { if (keyboardBox.Items.Count > 0) { @@ -244,7 +244,7 @@ private void loadKeymapButton_Click(object sender, EventArgs e) } } - private void flashButton_Click(object sender, EventArgs e) + private void FlashButton_Click(object sender, EventArgs e) { if (!InvokeRequired) { @@ -291,11 +291,11 @@ private void flashButton_Click(object sender, EventArgs e) } else { - Invoke(new Action(flashButton_Click), sender, e); + Invoke(new Action(FlashButton_Click), sender, e); } } - private void resetButton_Click(object sender, EventArgs e) + private void ResetButton_Click(object sender, EventArgs e) { if (!InvokeRequired) { @@ -329,11 +329,11 @@ private void resetButton_Click(object sender, EventArgs e) } else { - Invoke(new Action(resetButton_Click), sender, e); + Invoke(new Action(ResetButton_Click), sender, e); } } - private void clearEepromButton_Click(object sender, EventArgs e) + private void ClearEepromButton_Click(object sender, EventArgs e) { if (!InvokeRequired) { @@ -367,11 +367,11 @@ private void clearEepromButton_Click(object sender, EventArgs e) } else { - Invoke(new Action(clearEepromButton_Click), sender, e); + Invoke(new Action(ClearEepromButton_Click), sender, e); } } - private void setHandednessButton_Click(object sender, EventArgs e) + private void SetHandednessButton_Click(object sender, EventArgs e) { if (!InvokeRequired) @@ -407,7 +407,7 @@ private void setHandednessButton_Click(object sender, EventArgs e) } else { - Invoke(new Action(setHandednessButton_Click), sender, e); + Invoke(new Action(SetHandednessButton_Click), sender, e); } } @@ -493,7 +493,7 @@ private void OnReport(HidReport report) } } - private void filepathBox_KeyDown(object sender, KeyEventArgs e) + private void FilepathBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { @@ -586,7 +586,7 @@ private void DownloadFirmwareFile(string url, string filepath) } } - private void openFileButton_Click(object sender, EventArgs e) + private void OpenFileButton_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog() == DialogResult.OK) { @@ -616,7 +616,7 @@ private void DeviceEvent(object sender, EventArrivedEventArgs e) } else if (_usb.DetectBootloader(instance) && windowState.AutoFlashEnabled) { - flashButton_Click(sender, e); + FlashButton_Click(sender, e); } UpdateHidDevices(deviceDisconnected); @@ -719,43 +719,43 @@ private void MainWindow_Shown(object sender, EventArgs e) } } - private void keyboardBox_TextChanged(object sender, EventArgs e) + private void KeyboardBox_TextChanged(object sender, EventArgs e) { loadKeymapButton.Enabled = keyboardBox.Items.Contains(keyboardBox.Text); } - private void copyToolStripMenuItem_Click(object sender, EventArgs e) + private void CopyToolStripMenuItem_Click(object sender, EventArgs e) { logTextBox.Copy(); } - private void selectAllToolStripMenuItem_Click(object sender, EventArgs e) + private void SelectAllToolStripMenuItem_Click(object sender, EventArgs e) { logTextBox.SelectAll(); } - private void clearToolStripMenuItem_Click(object sender, EventArgs e) + private void ClearToolStripMenuItem_Click(object sender, EventArgs e) { logTextBox.Clear(); } - private void logContextMenuStrip_Opening(object sender, CancelEventArgs e) + private void LogContextMenuStrip_Opening(object sender, CancelEventArgs e) { copyToolStripMenuItem.Enabled = (logTextBox.SelectedText.Length > 0); selectAllToolStripMenuItem.Enabled = (logTextBox.Text.Length > 0); clearToolStripMenuItem.Enabled = (logTextBox.Text.Length > 0); } - private void aboutMenuItem_Click(object sender, EventArgs e) + private void AboutMenuItem_Click(object sender, EventArgs e) { (new AboutBox()).ShowDialog(); } - private void exitMenuItem_Click(object sender, EventArgs e) + private void ExitMenuItem_Click(object sender, EventArgs e) { Application.Exit(); } - private void installDriversMenuItem_Click(object sender, EventArgs e) + private void InstallDriversMenuItem_Click(object sender, EventArgs e) { InstallDrivers(); }