Options dialog starts faster

This commit is contained in:
Frank Skare
2021-01-11 05:35:36 +01:00
parent ea5ac04e6a
commit 4f2a35aad4
3 changed files with 51 additions and 17 deletions
+2
View File
@@ -15,6 +15,8 @@
- nero aac encoder binaries removed. (stax76)
- On systems with UTF-8 code page invalid d2v and idx files were created. (stax76, [#435](/../../issues/435))
- Get-MediaInfo shows Range, Primaries, Transfer, Matrix. (stax76)
- Fix wrong aspect ratio calculation in batch mode. (stax76, [#428](/../../issues/428))
- Options dialog starts faster. (stax76)
2.1.7.0 Stable (2021-01-07)
+40 -8
View File
@@ -4224,13 +4224,29 @@ Public Class MainForm
If lng.IsCommon Then
prefAudio.AddMenu(lng.ToString + " (" + lng.TwoLetterCode + ", " + lng.ThreeLetterCode + ")",
Sub() prefAudio.Edit.Text += " " + lng.ThreeLetterCode)
Else
prefAudio.AddMenu("More | " + lng.ToString.Substring(0, 1).ToUpper + " | " + lng.ToString +
" (" + lng.TwoLetterCode + ", " + lng.ThreeLetterCode + ")",
Sub() prefAudio.Edit.Text += " " + lng.ThreeLetterCode)
End If
Next
Dim moreAudio = prefAudio.AddMenu("More", DirectCast(Nothing, Action))
Dim moreAudioFirst = prefAudio.AddMenu("More | temp", DirectCast(Nothing, Action))
Dim moreAudioAction = Sub()
For Each lng In Language.Languages
prefAudio.AddMenu("More | " + lng.ToString.Substring(0, 1).ToUpper + " | " + lng.ToString +
" (" + lng.TwoLetterCode + ", " + lng.ThreeLetterCode + ")",
Sub() prefAudio.Edit.Text += " " + lng.ThreeLetterCode)
Next
End Sub
AddHandler moreAudio.DropDownOpened, Sub()
If moreAudio.DropDownItems.Count > 1 Then
Exit Sub
End If
moreAudioFirst.Visible = False
moreAudioAction()
End Sub
Dim cut = ui.AddMenu(Of CuttingMode)
cut.Text = "Cutting Method"
cut.Help = "Defines which method to use for cutting."
@@ -4314,13 +4330,29 @@ Public Class MainForm
If lng.IsCommon Then
prefSub.AddMenu(lng.ToString + " (" + lng.TwoLetterCode + ", " + lng.ThreeLetterCode + ")",
Sub() prefSub.Edit.Text += " " + lng.ThreeLetterCode)
Else
prefSub.AddMenu("More | " + lng.ToString.Substring(0, 1).ToUpper + " | " + lng.ToString +
" (" + lng.TwoLetterCode + ", " + lng.ThreeLetterCode + ")",
Sub() prefSub.Edit.Text += " " + lng.ThreeLetterCode)
End If
Next
Dim moreSub = prefSub.AddMenu("More", DirectCast(Nothing, Action))
Dim moreSubFirst = prefSub.AddMenu("More | temp", DirectCast(Nothing, Action))
Dim moreSubAction = Sub()
For Each lng In Language.Languages
prefSub.AddMenu("More | " + lng.ToString.Substring(0, 1).ToUpper + " | " + lng.ToString +
" (" + lng.TwoLetterCode + ", " + lng.ThreeLetterCode + ")",
Sub() prefSub.Edit.Text += " " + lng.ThreeLetterCode)
Next
End Sub
AddHandler moreSub.DropDownOpened, Sub()
If moreSub.DropDownItems.Count > 1 Then
Exit Sub
End If
moreSubFirst.Visible = False
moreSubAction()
End Sub
Dim tbm = ui.AddTextMenu(subPage)
tbm.Text = "Track Name"
tbm.Help = "Track name used for muxing, may contain macros."
+9 -9
View File
@@ -1036,11 +1036,11 @@ Public Class SimpleUI
TextCustomMenu.GetMenu(menu, Button, Nothing, AddressOf MenuClick)
End Sub
Sub AddMenu(menuText As String, menuValue As String)
AddMenu(menuText, Function() menuValue)
End Sub
Function AddMenu(menuText As String, menuValue As String) As ActionMenuItem
Return AddMenu(menuText, Function() menuValue)
End Function
Sub AddMenu(menuText As String, menuFunc As Func(Of String))
Function AddMenu(menuText As String, menuFunc As Func(Of String)) As ActionMenuItem
Dim action = Sub()
Dim v = menuFunc.Invoke
@@ -1049,12 +1049,12 @@ Public Class SimpleUI
End If
End Sub
AddMenu(menuText, action)
End Sub
Return AddMenu(menuText, action)
End Function
Sub AddMenu(menuText As String, menuAction As Action)
ActionMenuItem.Add(Button.ContextMenuStrip.Items, menuText, menuAction)
End Sub
Function AddMenu(menuText As String, menuAction As Action) As ActionMenuItem
Return ActionMenuItem.Add(Button.ContextMenuStrip.Items, menuText, menuAction)
End Function
End Class
Public Class ColorPickerBlock