Skip to content

Commit 64b2b7b

Browse files
committed
Remember last used import directory
1 parent 1b4edb7 commit 64b2b7b

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

b2sbackglassdesigner/b2sbackglassdesigner/Modules/moduleB2S.vb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Module moduleB2S
5353
Public Property DefaultOpacity() As Single = 1
5454
Public Property DefaultVPTablesFolder() As String = String.Empty
5555
Public Property LatestAuthor() As String = String.Empty
56+
Public Property LatestImportDirectory() As String = String.Empty
5657

5758
Public Property NoToolEvents() As Boolean = False
5859

b2sbackglassdesigner/b2sbackglassdesigner/classes/Base classes/formBase.vb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@
7272
If node.SelectSingleNode("LatestAuthor") IsNot Nothing Then
7373
LatestAuthor = node.SelectSingleNode("LatestAuthor").Attributes("Value").InnerText
7474
End If
75+
If node.SelectSingleNode("LatestImportDirectory") IsNot Nothing Then
76+
LatestImportDirectory = node.SelectSingleNode("LatestImportDirectory").Attributes("Value").InnerText
77+
End If
7578
Me.Location = New Point(x, y)
7679
Me.Size = New Size(width, height)
7780
Me.WindowState = If(maximized, FormWindowState.Maximized, FormWindowState.Normal)
@@ -151,6 +154,7 @@
151154
helper.AddXMLAttribute(XmlSettings, nodeForm, "Opacity", "Value", CInt(DefaultOpacity * 100).ToString())
152155
helper.AddXMLAttribute(XmlSettings, nodeForm, "VPTablesFolder", "Value", DefaultVPTablesFolder)
153156
helper.AddXMLAttribute(XmlSettings, nodeForm, "LatestAuthor", "Value", LatestAuthor)
157+
helper.AddXMLAttribute(XmlSettings, nodeForm, "LatestImportDirectory", "Value", LatestImportDirectory)
154158
End If
155159
' save
156160
Try

b2sbackglassdesigner/b2sbackglassdesigner/formDesigner.vb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,10 +522,12 @@ Public Class formDesigner
522522
With filedialog
523523
.Filter = "'directB2S' backglass file (*.directb2s)|*.directb2s|ALL (*.*)|*.*"
524524
.FileName = String.Empty
525-
.InitialDirectory = BackglassProjectsPath
525+
.InitialDirectory = If(LatestImportDirectory.Length, LatestImportDirectory, BackglassProjectsPath)
526526
If .ShowDialog(Me) = DialogResult.OK Then
527527
Dim backglassdata As Backglass.Data = Nothing
528528
Cursor.Current = Cursors.WaitCursor
529+
LatestImportDirectory = IO.Path.GetDirectoryName(.FileName)
530+
SaveSettings()
529531
Try
530532
coding.ImportDirectB2SFile(backglassdata, .FileName)
531533
If backglassdata IsNot Nothing Then

0 commit comments

Comments
 (0)