-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfrmSetup.vb
More file actions
95 lines (78 loc) · 3.54 KB
/
Copy pathfrmSetup.vb
File metadata and controls
95 lines (78 loc) · 3.54 KB
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
Imports System.IO
Public Class frmSetup
Private m_SaveFolder, m_CadFolder, m_SlicerEXE As String
Private m_debug As Boolean
Private Sub frmSetup_Load(sender As Object, e As EventArgs) Handles Me.Load
txtSaveFolder.Text = My.Settings.savefolder
txtCadFolder.Text = My.Settings.scadfolder
txtSlicerEXE.Text = My.Settings.slicerEXE
chkDebug.Checked = My.Settings.debug
m_CadFolder = txtCadFolder.Text
m_SaveFolder = txtSaveFolder.Text
m_SlicerEXE = txtSlicerEXE.Text
m_debug = chkDebug.Checked
End Sub
Private Sub btnPath2_Click(sender As Object, e As EventArgs) Handles btnPath2.Click
Dim dialog = New FolderBrowserDialog()
dialog.SelectedPath = My.Settings.savefolder
If Directory.Exists(dialog.SelectedPath) = False Then
dialog.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)
End If
If DialogResult.OK = dialog.ShowDialog() Then
txtSaveFolder.Text = dialog.SelectedPath
m_SaveFolder = txtSaveFolder.Text
End If
End Sub
Private Sub btnPathSCad_Click(sender As Object, e As EventArgs) Handles btnPathSCad.Click
Dim dialog = New FolderBrowserDialog()
dialog.SelectedPath = My.Settings.scadfolder
'If Directory.Exists(dialog.SelectedPath) = False Then
' dialog.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)
'End If
If DialogResult.OK = dialog.ShowDialog() Then
If Not File.Exists(dialog.SelectedPath & "\openscad.exe") Then
MsgBox("Problem. Cannot find OpenSCAD EXE.")
Exit Sub
End If
txtCadFolder.Text = dialog.SelectedPath
m_CadFolder = txtCadFolder.Text
End If
End Sub
Private Sub btnPathSlicer_Click(sender As Object, e As EventArgs) Handles btnPathSlicer.Click
Using fold As New OpenFileDialog
fold.Filter = "exe files (*.exe)|*.exe"
fold.Title = "Select Slicer exe file"
If fold.ShowDialog() = Windows.Forms.DialogResult.OK Then
fold.RestoreDirectory = True
txtSlicerEXE.Text = fold.FileName
m_SlicerEXE = txtSlicerEXE.Text
End If
End Using
End Sub
Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
Me.Close()
End Sub
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
My.Settings.savefolder = m_SaveFolder
My.Settings.slicerEXE = m_SlicerEXE
My.Settings.scadfolder = m_CadFolder
My.Settings.debug = m_debug
My.Settings.Save()
Me.Close()
End Sub
Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
misc.OpenUrlLink("https://openscad.org/downloads.html")
End Sub
Private Sub txtCadFolder_Leave(sender As Object, e As EventArgs) Handles txtCadFolder.Leave
m_CadFolder = txtCadFolder.Text
End Sub
Private Sub chkDebug_CheckedChanged(sender As Object, e As EventArgs) Handles chkDebug.CheckedChanged
m_debug = chkDebug.Checked
End Sub
Private Sub txtSaveFolder_Leave(sender As Object, e As EventArgs) Handles txtSaveFolder.Leave
m_SaveFolder = txtSaveFolder.Text
End Sub
Private Sub txtSlicerEXE_Leave(sender As Object, e As EventArgs) Handles txtSlicerEXE.Leave
m_SlicerEXE = txtSlicerEXE.Text
End Sub
End Class