diff --git a/Changelog.md b/Changelog.md index 483d8e15..0e689257 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,13 +6,15 @@ - ec3 file extension support for eac3 files. - R210/V210 video output using ffmpeg. - Include beta versions for update checker and show changelog (Dendraspis) +- The final assistant tip supports SHIFT key to add the job at the top + of the job list and CTRL to prevent showing the jobs dialog. + It's documented via tooltip, right-click on Next button. (Dendraspis) 2.1.3.7 Beta ============ - AviSynth soft link fix. -- DGIndex re-enabled by default for VOB/MPG. 2.1.3.6 Beta diff --git a/Forms/MainForm.vb b/Forms/MainForm.vb index 93d5888d..295bbf3a 100644 --- a/Forms/MainForm.vb +++ b/Forms/MainForm.vb @@ -29,7 +29,7 @@ Public Class MainForm Public WithEvents tbAudioFile1 As StaxRip.UI.TextBoxEx Public WithEvents llEditAudio1 As ButtonLabel Public WithEvents llEditAudio0 As ButtonLabel - Public WithEvents bnNext As System.Windows.Forms.Button + Public WithEvents bnNext As ButtonEx Public WithEvents tbSourceFile As StaxRip.UI.TextBoxEx Public WithEvents tbTargetFile As StaxRip.UI.TextBoxEx Public WithEvents gbAssistant As System.Windows.Forms.GroupBox @@ -91,7 +91,7 @@ Public Class MainForm ' Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() - Me.bnNext = New System.Windows.Forms.Button() + Me.bnNext = New ButtonEx() Me.llEditAudio0 = New StaxRip.UI.ButtonLabel() Me.gbAssistant = New System.Windows.Forms.GroupBox() Me.tlpAssistant = New System.Windows.Forms.TableLayoutPanel() @@ -3121,7 +3121,7 @@ Public Class MainForm AudioTextChanged(tbAudioFile1, p.Audio1) End Sub - Sub bnSkip_Click() Handles bnNext.Click + Sub bnNext_Click() Handles bnNext.Click If Not CanIgnoreTip Then MsgWarn("The current assistant warning cannot be skipped.") Exit Sub @@ -3194,8 +3194,14 @@ Public Class MainForm End Select End If - AddJob(False, Nothing) - ShowJobsDialog() + Dim position = If(ModifierKeys.HasFlag(Keys.Shift), 0, -1) + AddJob(False, Nothing, position) + + If ModifierKeys.HasFlag(Keys.Control) Then + bnNext.ShowBold() + Else + ShowJobsDialog() + End If Else Assistant() End If @@ -3952,12 +3958,19 @@ Public Class MainForm showConfirmation As Boolean, - templateName As String) + templateName As String, + + Optional position As Integer = -1) - AddJob(showConfirmation, templateName, True) + AddJob(showConfirmation, templateName, True, position) End Sub - Sub AddJob(showConfirmation As Boolean, templateName As String, showAssistant As Boolean) + Sub AddJob( + showConfirmation As Boolean, + templateName As String, + showAssistant As Boolean, + Optional position As Integer = -1) + If Not g.VerifyRequirements() Then Exit Sub End If @@ -3969,7 +3982,7 @@ Public Class MainForm Dim jobPath = JobManager.GetJobPath() SaveProjectPath(jobPath) - JobManager.AddJob(jobPath, jobPath) + JobManager.AddJob(jobPath, jobPath, position) If showConfirmation Then MsgInfo("Job added") @@ -5705,6 +5718,10 @@ Public Class MainForm .SetTip("Shows a menu with Container/Muxer profiles", llMuxer) .SetTip("Shows a menu with video encoder profiles", lgbEncoder.Label) .SetTip("Shows a menu with AviSynth filter options", lgbFilters.Label) + .SetTip("Next assistant tip." + BR2 + + "The final tip to add a job supports modifier keys:" + BR2 + + "SHIFT adds a job on top of the job list." + BR2 + + "CTRL prevents showing the Jobs dialog.", bnNext) End With End Sub diff --git a/FrameServer/VapourSynthServer.cpp b/FrameServer/VapourSynthServer.cpp index be901020..8c0aa143 100644 --- a/FrameServer/VapourSynthServer.cpp +++ b/FrameServer/VapourSynthServer.cpp @@ -43,18 +43,18 @@ HRESULT __stdcall VapourSynthServer::OpenFile(WCHAR* file) { try { - HMODULE dll = LoadLibrary(L"VSScript.dll"); - - if (!dll) - { - std::string msg = GetWinErrorMessage(GetLastError()); - throw std::runtime_error("Failed to load VapourSynth:\r\n\r\n" + msg); - } - static bool wasResolved = false; if (!wasResolved) { + HMODULE dll = LoadLibrary(L"VSScript.dll"); + + if (!dll) + { + std::string msg = GetWinErrorMessage(GetLastError()); + throw std::runtime_error("Failed to load VapourSynth:\r\n\r\n" + msg); + } + bool x64 = sizeof(void*) == 8; std::array resolvePairs = { diff --git a/General/JobManager.vb b/General/JobManager.vb index d75d8db1..94d08d61 100644 --- a/General/JobManager.vb +++ b/General/JobManager.vb @@ -87,7 +87,7 @@ Public Class JobManager SaveJobs(jobs) End Sub - Shared Sub AddJob(name As String, path As String) + Shared Sub AddJob(name As String, path As String, Optional position As Integer = -1) Dim jobs = GetJobs() For Each job In jobs.ToArray @@ -96,7 +96,22 @@ Public Class JobManager End If Next - jobs.Add(New Job(name, path)) + If position = -1 Then + jobs.Add(New Job(name, path)) + ElseIf position >= 0 Then + If jobs.Count > position Then + jobs.Insert(position, New Job(name, path)) + Else + jobs.Add(New Job(name, path)) + End If + Else + If -jobs.Count - 1 <= position Then + jobs.Insert(jobs.Count + position + 1, New Job(name, path)) + Else + jobs.Add(New Job(name, path)) + End If + End If + SaveJobs(jobs) End Sub