From 033e8eeed56cb9bcbb772985bfd3bb970bf452ec Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Wed, 22 Jul 2020 16:45:31 +0200 Subject: [PATCH] show log form with F7 --- Forms/JobsForm.vb | 6 ++++++ Forms/MainForm.vb | 6 ++---- Forms/ProcessingForm.vb | 40 ++++++++++++++++++---------------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Forms/JobsForm.vb b/Forms/JobsForm.vb index b6344bd5..6efadf8d 100644 --- a/Forms/JobsForm.vb +++ b/Forms/JobsForm.vb @@ -400,4 +400,10 @@ Friend Class JobsForm Sub JobsForm_HelpRequested(sender As Object, hlpevent As HelpEventArgs) Handles Me.HelpRequested MsgInfo(Tip) End Sub + + Sub ShowForm() + Using form As New JobsForm() + form.ShowDialog() + End Using + End Sub End Class diff --git a/Forms/MainForm.vb b/Forms/MainForm.vb index 08d97323..7b6b446a 100644 --- a/Forms/MainForm.vb +++ b/Forms/MainForm.vb @@ -3902,9 +3902,7 @@ Public Class MainForm Sub ShowJobsDialog() - Using form As New JobsForm() - form.ShowDialog() - End Using + JobsForm.ShowForm() End Sub @@ -4562,7 +4560,7 @@ Public Class MainForm ret.Add("Options", NameOf(ShowOptionsDialog), Keys.F8) ret.Add("Tools|Jobs...", NameOf(ShowJobsDialog), Keys.F6, Symbol.MultiSelectLegacy) - ret.Add("Tools|Log File", NameOf(g.DefaultCommands.ShowLogFile), Symbol.Page) + ret.Add("Tools|Log File", NameOf(g.DefaultCommands.ShowLogFile), Keys.F7, Symbol.Page) ret.Add("Tools|Folders", Symbol.Folder) ret.Add("Tools|Folders|Log Files", NameOf(g.DefaultCommands.ExecuteCommandLine), {"""%settings_dir%Log Files"""}) ret.Add("Tools|Folders|Plugins", NameOf(g.DefaultCommands.ExecuteCommandLine), {"""%plugin_dir%"""}) diff --git a/Forms/ProcessingForm.vb b/Forms/ProcessingForm.vb index 0f9abdc8..3e46aa0c 100644 --- a/Forms/ProcessingForm.vb +++ b/Forms/ProcessingForm.vb @@ -39,11 +39,11 @@ Public Class ProcessingForm Me.flpButtons = New System.Windows.Forms.FlowLayoutPanel() Me.mbShutdown = New StaxRip.UI.MenuButton() Me.bnLog = New System.Windows.Forms.Button() + Me.bnMenu = New StaxRip.UI.ButtonEx() Me.tlpMain = New System.Windows.Forms.TableLayoutPanel() Me.pnLogHost = New System.Windows.Forms.Panel() Me.pnStatusHost = New System.Windows.Forms.Panel() Me.flpNav = New System.Windows.Forms.FlowLayoutPanel() - Me.bnMenu = New ButtonEx Me.flpButtons.SuspendLayout() Me.tlpMain.SuspendLayout() Me.SuspendLayout() @@ -115,9 +115,17 @@ Public Class ProcessingForm Me.bnLog.Name = "bnLog" Me.bnLog.Size = New System.Drawing.Size(260, 70) Me.bnLog.TabIndex = 13 - Me.bnLog.Text = "Log" + Me.bnLog.Text = "Log (F7)" Me.bnLog.UseVisualStyleBackColor = True ' + 'bnMenu + ' + Me.bnMenu.Anchor = System.Windows.Forms.AnchorStyles.None + Me.bnMenu.Location = New System.Drawing.Point(1421, 0) + Me.bnMenu.Margin = New System.Windows.Forms.Padding(0) + Me.bnMenu.ShowMenuSymbol = True + Me.bnMenu.Size = New System.Drawing.Size(100, 70) + ' 'tlpMain ' Me.tlpMain.ColumnCount = 1 @@ -170,15 +178,7 @@ Public Class ProcessingForm Me.flpNav.Size = New System.Drawing.Size(1736, 1) Me.flpNav.TabIndex = 19 ' - 'mbMenu - ' - Me.bnMenu.Anchor = System.Windows.Forms.AnchorStyles.None - Me.bnMenu.Location = New System.Drawing.Point(1421, 0) - Me.bnMenu.Margin = New System.Windows.Forms.Padding(0) - Me.bnMenu.ShowMenuSymbol = True - Me.bnMenu.Size = New System.Drawing.Size(100, 70) - ' - 'ProcForm + 'ProcessingForm ' Me.AutoScaleDimensions = New System.Drawing.SizeF(288.0!, 288.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi @@ -186,7 +186,7 @@ Public Class ProcessingForm Me.Controls.Add(Me.tlpMain) Me.KeyPreview = True Me.Margin = New System.Windows.Forms.Padding(9) - Me.Name = "ProcForm" + Me.Name = "ProcessingForm" Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show Me.Text = "StaxRip - Processing..." Me.flpButtons.ResumeLayout(False) @@ -315,22 +315,18 @@ Public Class ProcessingForm End Sub Sub bnJobs_Click(sender As Object, e As EventArgs) Handles bnJobs.Click - Using form As New JobsForm() - form.ShowDialog() - End Using + JobsForm.ShowForm() End Sub Sub bnLog_Click(sender As Object, e As EventArgs) Handles bnLog.Click g.DefaultCommands.ShowLogFile() End Sub - Sub ProcessingForm_KeyUp(sender As Object, e As KeyEventArgs) Handles MyBase.KeyUp - If Not (e.Alt OrElse e.Control OrElse e.Shift) Then - If e.KeyCode = Keys.F6 Then - Using form As New JobsForm() - form.ShowDialog() - End Using - End If + Protected Overrides Sub OnKeyUp(e As KeyEventArgs) + MyBase.OnKeyUp(e) + + If e.KeyData = Keys.F6 Then + JobsForm.ShowForm() End If End Sub End Class