summaryrefslogtreecommitdiffstats
path: root/win/Handbrake/frmOptions.vb
blob: a3158e8b66778e45a76f094568be3f3c63ddd0c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Imports System.IO

Public Class frmOptions

    Private Sub btn_close_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_close.Click
        My.Settings.Save()
        Me.Close()
    End Sub


    ' Set the check boxes to the correct state. Checked or unchecked
    Private Sub frmOptions_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            If My.Settings.StartupUpdate = 1 Then
                check_updateCheck.CheckState = CheckState.Checked
            Else
                check_updateCheck.CheckState = CheckState.Unchecked
            End If

            If My.Settings.UseUsersDefaultSettings = 1 Then
                check_userDefaultSettings.CheckState = CheckState.Checked
            Else
                check_userDefaultSettings.CheckState = CheckState.Unchecked
            End If

            If My.Settings.ReadDVDatStartup = 1 Then
                check_readDVDWindow.CheckState = CheckState.Checked
            Else
                check_readDVDWindow.CheckState = CheckState.Unchecked
            End If

            If My.Settings.verbose = 1 Then
                check_verbose.CheckState = CheckState.Checked
            Else
                check_verbose.CheckState = CheckState.Unchecked
            End If

            drp_processors.Text = My.Settings.Processors

        Catch ex As Exception
            MessageBox.Show("ERROR:  " & ex.ToString)
        End Try
    End Sub

    ' Handle the event when a user clicks on the check box. Save the new setting.

    Private Sub check_updateCheck_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles check_updateCheck.CheckedChanged

        If check_updateCheck.CheckState = 1 Then
            Try
                My.Settings.StartupUpdate = 1
            Catch Ex As Exception
                MessageBox.Show("ERROR:  " & Ex.ToString)
            End Try
        Else
            Try
                My.Settings.StartupUpdate = 0
            Catch Ex As Exception
                MessageBox.Show("ERROR:  " & Ex.ToString)
            End Try
        End If


    End Sub

    Private Sub check_userDefaultSettings_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles check_userDefaultSettings.CheckedChanged
        If check_userDefaultSettings.CheckState = 1 Then
            Try
                My.Settings.UseUsersDefaultSettings = 1
            Catch Ex As Exception
                MessageBox.Show("ERROR:  " & Ex.ToString)
            End Try
        Else
            Try
                My.Settings.UseUsersDefaultSettings = 0
            Catch Ex As Exception
                MessageBox.Show("ERROR:  " & Ex.ToString)
            End Try
        End If
    End Sub

    Private Sub check_readDVDWindow_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles check_readDVDWindow.CheckedChanged
        If check_readDVDWindow.CheckState = 1 Then
            Try
                My.Settings.ReadDVDatStartup = 1
            Catch Ex As Exception
                MessageBox.Show("ERROR:  " & Ex.ToString)
            End Try
        Else
            Try
                My.Settings.ReadDVDatStartup = 0
            Catch Ex As Exception
                MessageBox.Show("ERROR:  " & Ex.ToString)
            End Try
        End If
    End Sub

    Private Sub check_verbose_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles check_verbose.CheckedChanged
        If check_verbose.CheckState = 1 Then
            Try
                My.Settings.verbose = 1
            Catch Ex As Exception
                MessageBox.Show("ERROR:  " & Ex.ToString)
            End Try
        Else
            Try
                My.Settings.verbose = 0
            Catch Ex As Exception
                MessageBox.Show("ERROR:  " & Ex.ToString)
            End Try
        End If
    End Sub


    Private Sub drp_processors_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles drp_processors.SelectedIndexChanged
        My.Settings.Processors = drp_processors.Text
    End Sub
End Class