Skip to content

Commit 5b518be

Browse files
committed
[Fix] Fixed #209
1 parent c1a7fec commit 5b518be

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

MainForm.vb

+11-1
Original file line numberDiff line numberDiff line change
@@ -9903,6 +9903,11 @@ Public Class MainForm
99039903
End Sub
99049904

99059905
Sub SaveDTProj()
9906+
DynaLog.LogMessage("Checking if project files exist...")
9907+
If Not File.Exists(projPath & "\settings\project.ini") Then
9908+
DynaLog.LogMessage("No project settings file exists. Exiting...")
9909+
Exit Sub
9910+
End If
99069911
If ProjectValueLoadForm.RichTextBox1.Text = "" Then ProjectValueLoadForm.RichTextBox1.Text = File.ReadAllText(projPath & "\settings\project.ini", UTF8)
99079912
' Clear Rich Text Boxes
99089913
'ProjectValueLoadForm.RichTextBox2.Text = ""
@@ -10033,6 +10038,9 @@ Public Class MainForm
1003310038
''' <remarks>The program, attending to the parameters shown above, will unload the project</remarks>
1003410039
Sub UnloadDTProj(IsBeingClosed As Boolean, SaveProject As Boolean, UnmountImg As Boolean)
1003510040
DynaLog.LogMessage("Preparing to unload project...")
10041+
DynaLog.LogMessage("- Is the program being closed? " & If(IsBeingClosed, "Yes", "No"))
10042+
DynaLog.LogMessage("- Will the project be saved? " & If(SaveProject, "Yes", "No"))
10043+
DynaLog.LogMessage("- Will the image be unmounted? " & If(UnmountImg, "Yes", "No"))
1003610044
If ImgBW.IsBusy Then
1003710045
DynaLog.LogMessage("Background processes are busy. Ask the user what they want to do")
1003810046
Dim msg As String = ""
@@ -10151,7 +10159,9 @@ Public Class MainForm
1015110159
End If
1015210160
If SaveProject And Not (OnlineManagement Or OfflineManagement) Then
1015310161
DynaLog.LogMessage("Saving project configuration...")
10154-
SaveDTProj()
10162+
If File.Exists(projPath & "\settings\project.ini") Then
10163+
SaveDTProj()
10164+
End If
1015510165
End If
1015610166
If UnmountImg Then
1015710167
DynaLog.LogMessage("The image will be unmounted...")

Panels/Prj_Ops/NewProj.vb

+7-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,13 @@ Public Class NewProj
8383
Me.DialogResult = System.Windows.Forms.DialogResult.OK
8484
If MainForm.isProjectLoaded Then
8585
DynaLog.LogMessage("Unloading any loaded projects...")
86-
If MainForm.OnlineManagement Then MainForm.EndOnlineManagement() Else MainForm.UnloadDTProj(False, True, False)
87-
If MainForm.OfflineManagement Then MainForm.EndOfflineManagement() Else MainForm.UnloadDTProj(False, True, False)
86+
If MainForm.OnlineManagement Then
87+
MainForm.EndOnlineManagement()
88+
ElseIf MainForm.OfflineManagement Then
89+
MainForm.EndOfflineManagement()
90+
Else
91+
MainForm.UnloadDTProj(False, True, False)
92+
End If
8893
If MainForm.ImgBW.IsBusy Then Exit Sub
8994
End If
9095
ProgressPanel.projName = TextBox1.Text

0 commit comments

Comments
 (0)