2021-09-20 20:37:57 +02:00
|
|
|
|
Option Strict On
|
2023-09-10 16:28:23 +02:00
|
|
|
|
Imports Crunchyroll_Downloader.CRD_Classes
|
2021-09-20 20:37:57 +02:00
|
|
|
|
Imports MetroFramework.Components
|
2019-11-10 00:16:12 +01:00
|
|
|
|
|
2020-12-10 19:18:20 +01:00
|
|
|
|
Public Class ErrorDialog
|
2019-11-10 00:16:12 +01:00
|
|
|
|
|
2020-12-10 19:18:20 +01:00
|
|
|
|
Dim Manager As MetroStyleManager = Main.Manager
|
2019-11-10 00:16:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Private Sub Reso_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
2023-05-04 18:48:37 +02:00
|
|
|
|
'Me.TopMost = True
|
2020-12-10 19:18:20 +01:00
|
|
|
|
Manager.Owner = Me
|
|
|
|
|
Me.StyleManager = Manager
|
2023-05-04 18:48:37 +02:00
|
|
|
|
|
2020-12-10 19:18:20 +01:00
|
|
|
|
pictureBox3.Image = Main.CloseImg
|
2021-08-07 23:49:09 +02:00
|
|
|
|
ComboBox1.Text = Nothing
|
2020-12-10 19:18:20 +01:00
|
|
|
|
|
2020-11-13 15:57:34 +01:00
|
|
|
|
Try
|
|
|
|
|
Me.Icon = My.Resources.icon
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
|
|
|
|
|
End Try
|
|
|
|
|
|
2021-09-20 20:37:57 +02:00
|
|
|
|
Me.Location = New Point(CInt(Main.Location.X + Main.Width / 2 - Me.Width / 2), CInt(Main.Location.Y + Main.Height / 2 - Me.Height / 2))
|
2019-11-10 00:16:12 +01:00
|
|
|
|
ComboBox1.Items.Clear()
|
|
|
|
|
If Main.DialogTaskString = "Language" Then
|
|
|
|
|
'CheckBox1.Visible = False
|
|
|
|
|
StatusLabel.Text = Main.LabelLangNotFoundText
|
|
|
|
|
Dim lang_avalibe As String() = Main.ResoNotFoundString.Split(New String() {Chr(34) + "hardsub_lang" + Chr(34) + ":"}, System.StringSplitOptions.RemoveEmptyEntries)
|
|
|
|
|
For i As Integer = 1 To lang_avalibe.Count - 1
|
2021-09-20 20:37:57 +02:00
|
|
|
|
Dim langsplit As String() = lang_avalibe(i).Split(New String() {","}, System.StringSplitOptions.RemoveEmptyEntries)
|
|
|
|
|
|
2019-11-10 00:16:12 +01:00
|
|
|
|
ComboBox1.Items.Add(langsplit(0))
|
|
|
|
|
Next
|
|
|
|
|
SurroundingSub()
|
2021-05-23 22:27:56 +02:00
|
|
|
|
ElseIf Main.DialogTaskString = "Language_CR_Beta" Then
|
|
|
|
|
'CheckBox1.Visible = False
|
|
|
|
|
StatusLabel.Text = Main.LabelLangNotFoundText
|
2022-12-18 20:28:02 +01:00
|
|
|
|
Debug.WriteLine("ResoNotFoundString")
|
|
|
|
|
Debug.WriteLine(Main.ResoNotFoundString)
|
|
|
|
|
Debug.WriteLine("ResoNotFoundString")
|
2021-05-23 22:27:56 +02:00
|
|
|
|
|
2024-05-04 13:24:54 +02:00
|
|
|
|
Dim lang_avalibe As String() = Main.ResoNotFoundString.Split(New String() {";"}, System.StringSplitOptions.RemoveEmptyEntries)
|
2021-05-23 22:27:56 +02:00
|
|
|
|
|
2024-05-04 13:24:54 +02:00
|
|
|
|
For i As Integer = 0 To lang_avalibe.Count - 1
|
|
|
|
|
ComboBox1.Items.Add(Main.ConvertSubValue(lang_avalibe(i), ConvertSubsEnum.DisplayText))
|
2021-05-23 22:27:56 +02:00
|
|
|
|
Next
|
2024-05-04 13:24:54 +02:00
|
|
|
|
|
2021-05-23 22:27:56 +02:00
|
|
|
|
SurroundingSub()
|
2024-05-04 13:24:54 +02:00
|
|
|
|
|
2019-11-10 00:16:12 +01:00
|
|
|
|
ElseIf Main.DialogTaskString = "Resolution" Then
|
|
|
|
|
StatusLabel.Text = Main.LabelResoNotFoundText
|
2019-12-04 21:00:26 +01:00
|
|
|
|
Dim Reso_avaible1 As String() = Main.ResoNotFoundString.Split(New String() {"RESOLUTION="}, System.StringSplitOptions.RemoveEmptyEntries)
|
|
|
|
|
For i As Integer = 1 To Reso_avaible1.Count - 1
|
|
|
|
|
Dim Reso_avaible2 As String() = Reso_avaible1(i).Split(New [Char]() {Chr(44)})
|
|
|
|
|
ComboBox1.Items.Add(Reso_avaible2(0))
|
2019-11-10 00:16:12 +01:00
|
|
|
|
Next
|
|
|
|
|
SurroundingSub()
|
2019-12-04 21:00:26 +01:00
|
|
|
|
Try
|
|
|
|
|
ComboBox1.SelectedIndex = 0
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
End Try
|
2023-08-30 18:40:53 +02:00
|
|
|
|
ElseIf Main.DialogTaskString = "AudioOnlyResolution" Then
|
|
|
|
|
StatusLabel.Text = "" 'Main.LabelResoNotFoundText
|
2024-04-13 11:37:48 +02:00
|
|
|
|
ComboBox1.Items.Add("x240,")
|
|
|
|
|
ComboBox1.Items.Add("x360,")
|
2023-08-30 18:40:53 +02:00
|
|
|
|
ComboBox1.Items.Add("x480,")
|
|
|
|
|
ComboBox1.Items.Add("x720,")
|
|
|
|
|
ComboBox1.Items.Add("x1080,")
|
2024-01-28 12:09:00 +01:00
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
'check for the first option and error if there are none
|
|
|
|
|
If ComboBox1.Items.Count > 0 Then
|
|
|
|
|
ComboBox1.SelectedIndex = 0
|
|
|
|
|
Else
|
|
|
|
|
MsgBox("Error, no available options found!", MsgBoxStyle.Information)
|
2019-11-10 00:16:12 +01:00
|
|
|
|
End If
|
2024-01-28 12:09:00 +01:00
|
|
|
|
|
2023-05-04 18:48:37 +02:00
|
|
|
|
Delay.Enabled = True
|
2019-11-10 00:16:12 +01:00
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub SurroundingSub()
|
|
|
|
|
Dim list As List(Of Object) = New List(Of Object)()
|
|
|
|
|
|
|
|
|
|
For Each o As Object In ComboBox1.Items
|
|
|
|
|
|
|
|
|
|
If Not list.Contains(o) Then
|
|
|
|
|
list.Add(o)
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
|
|
|
|
|
ComboBox1.Items.Clear()
|
|
|
|
|
ComboBox1.Items.AddRange(list.ToArray())
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Private Sub ComboBox1_DrawItem(sender As Object, e As DrawItemEventArgs) Handles ComboBox1.DrawItem
|
|
|
|
|
|
|
|
|
|
ComboBox1.BackColor = Color.White
|
|
|
|
|
If e.Index >= 0 Then
|
|
|
|
|
Using st As New StringFormat With {.Alignment = StringAlignment.Center}
|
|
|
|
|
' e.DrawBackground()
|
|
|
|
|
' e.DrawFocusRectangle()
|
|
|
|
|
e.Graphics.FillRectangle(SystemBrushes.ControlLightLight, e.Bounds)
|
2020-11-13 15:57:34 +01:00
|
|
|
|
e.Graphics.DrawString(ComboBox1.Items(e.Index).ToString, e.Font, Brushes.Black, e.Bounds, st)
|
2019-11-10 00:16:12 +01:00
|
|
|
|
|
|
|
|
|
End Using
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub PictureBox9_Click(sender As Object, e As EventArgs) Handles PictureBox9.Click
|
2019-12-04 21:00:26 +01:00
|
|
|
|
If ComboBox1.SelectedItem.ToString = Nothing Then
|
2019-11-10 00:16:12 +01:00
|
|
|
|
Else
|
2021-05-23 22:27:56 +02:00
|
|
|
|
If Main.DialogTaskString = "Language_CR_Beta" Then
|
|
|
|
|
Main.ResoBackString = DisplayToHardSubValues(ComboBox1.SelectedItem.ToString)
|
2024-01-28 12:09:00 +01:00
|
|
|
|
'MsgBox(Main.ResoBackString)
|
2021-05-23 22:27:56 +02:00
|
|
|
|
Main.UserCloseDialog = False
|
|
|
|
|
Me.Close()
|
|
|
|
|
Else
|
|
|
|
|
Main.ResoBackString = ComboBox1.SelectedItem.ToString
|
|
|
|
|
Main.UserCloseDialog = False
|
|
|
|
|
Me.Close()
|
|
|
|
|
End If
|
2019-11-10 00:16:12 +01:00
|
|
|
|
End If
|
|
|
|
|
End Sub
|
|
|
|
|
|
2021-05-23 22:27:56 +02:00
|
|
|
|
Public Function DisplayToHardSubValues(ByVal HardSub As String) As String
|
2024-01-28 12:09:00 +01:00
|
|
|
|
For i As Integer = 0 To Main.LangValueEnum.Count - 1
|
|
|
|
|
If Main.LangValueEnum.Item(i).DisplayText = HardSub Then ' does not find "No Hardsubs" but default is correct here anyway.
|
|
|
|
|
Return Main.LangValueEnum.Item(i).CR_Value
|
2021-05-23 22:27:56 +02:00
|
|
|
|
End If
|
2024-01-28 12:09:00 +01:00
|
|
|
|
Next
|
2021-05-23 22:27:56 +02:00
|
|
|
|
|
2024-01-28 12:09:00 +01:00
|
|
|
|
Return "null" ' null as text because CR does so...
|
2021-05-23 22:27:56 +02:00
|
|
|
|
|
|
|
|
|
End Function
|
|
|
|
|
|
2019-11-10 00:16:12 +01:00
|
|
|
|
Private Sub PictureBox9_MouseEnter(sender As Object, e As EventArgs) Handles PictureBox9.MouseEnter
|
|
|
|
|
PictureBox9.Image = My.Resources.DialogNotFound_Submit_hover
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub PictureBox9_MouseLeave(sender As Object, e As EventArgs) Handles PictureBox9.MouseLeave
|
|
|
|
|
PictureBox9.Image = My.Resources.DialogNotFound_Submit
|
|
|
|
|
End Sub
|
|
|
|
|
|
2020-12-02 21:01:30 +01:00
|
|
|
|
Private Sub PictureBox3_Click(sender As Object, e As EventArgs) Handles pictureBox3.Click
|
2019-11-10 00:16:12 +01:00
|
|
|
|
Main.UserCloseDialog = True
|
|
|
|
|
Me.Close()
|
|
|
|
|
End Sub
|
|
|
|
|
|
2020-12-10 19:18:20 +01:00
|
|
|
|
Private Sub Btn_Close_MouseEnter(sender As Object, e As EventArgs) Handles pictureBox3.MouseEnter
|
2021-09-20 20:37:57 +02:00
|
|
|
|
|
|
|
|
|
pictureBox3.Image = My.Resources.main_del
|
2019-11-10 00:16:12 +01:00
|
|
|
|
End Sub
|
|
|
|
|
|
2020-12-10 19:18:20 +01:00
|
|
|
|
Private Sub Btn_Close_MouseLeave(sender As Object, e As EventArgs) Handles pictureBox3.MouseLeave
|
2021-09-20 20:37:57 +02:00
|
|
|
|
|
2021-09-20 20:40:56 +02:00
|
|
|
|
pictureBox3.Image = Main.CloseImg
|
|
|
|
|
End Sub
|
2021-09-20 20:37:57 +02:00
|
|
|
|
|
2019-11-10 00:16:12 +01:00
|
|
|
|
|
2021-09-20 21:20:01 +02:00
|
|
|
|
|
2021-08-07 23:49:09 +02:00
|
|
|
|
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
|
|
|
|
|
PictureBox9.Enabled = True
|
|
|
|
|
PictureBox9.Cursor = Cursors.Hand
|
|
|
|
|
End Sub
|
2022-12-28 23:27:32 +01:00
|
|
|
|
|
2023-05-04 18:48:37 +02:00
|
|
|
|
Private Sub Delay_Tick(sender As Object, e As EventArgs) Handles Delay.Tick
|
|
|
|
|
|
|
|
|
|
Try
|
|
|
|
|
Dim hwnd As IntPtr = FindWindow(Nothing, Me.Text)
|
|
|
|
|
SetForegroundWindow(hwnd)
|
|
|
|
|
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
MsgBox(ex.ToString)
|
|
|
|
|
End Try
|
|
|
|
|
'MsgBox(Me.Text)
|
|
|
|
|
Delay.Enabled = False
|
|
|
|
|
End Sub
|
2019-11-10 00:16:12 +01:00
|
|
|
|
End Class
|