Skip to content

Commit e14a49e

Browse files
committed
Refactor AboutBox and FloppyDB for clarity and usability
Refactored `AboutBox` UI components to improve naming consistency and added support for displaying database entry counts. Updated `FloppyDB` to handle both main and user databases, introducing new properties and methods for better separation of concerns. Enhanced error handling for XML file operations and improved code readability. Renamed `GetDataPath` to `GetAppDataPath` across modules for clarity. Updated related methods in `Updater`, `AppSettings`, and `UserState` to align with the new naming convention. Removed redundant code and improved maintainability throughout the codebase.
1 parent d97e907 commit e14a49e

8 files changed

Lines changed: 203 additions & 138 deletions

File tree

DiskImageTool/Forms/AboutBox.Designer.vb

Lines changed: 53 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DiskImageTool/Forms/AboutBox.resx

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,13 @@
159159
<metadata name="FlowLayoutPanel1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
160160
<value>True</value>
161161
</metadata>
162-
<metadata name="LabelDB.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
162+
<metadata name="LabelDBMain.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
163163
<value>True</value>
164164
</metadata>
165-
<metadata name="LabelDBVersion.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
165+
<metadata name="LabelDBVersionMain.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
166+
<value>True</value>
167+
</metadata>
168+
<metadata name="LabelDBCountMain.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
166169
<value>True</value>
167170
</metadata>
168171
<metadata name="FlowLayoutPanel2.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -177,18 +180,6 @@
177180
<metadata name="LabelVersion.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
178181
<value>True</value>
179182
</metadata>
180-
<metadata name="LabelVersion.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
181-
<value>True</value>
182-
</metadata>
183-
<metadata name="LabelDB.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
184-
<value>True</value>
185-
</metadata>
186-
<metadata name="LabelVersionCaption.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
187-
<value>True</value>
188-
</metadata>
189-
<metadata name="LabelDBVersion.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
190-
<value>True</value>
191-
</metadata>
192183
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
193184
<value>True</value>
194185
</metadata>

DiskImageTool/Forms/AboutBox.vb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
Me.LabelProductName.Text = My.Application.Info.ProductName
1717
Me.LabelVersionCaption.Text = My.Resources.Label_Version & ":"
1818
Me.LabelVersion.Text = GetVersionString()
19-
Me.LabelDB.Text = My.Resources.Label_Database & ":"
20-
Me.LabelDBVersion.Text = If(String.IsNullOrEmpty(App.TitleDB.Version), "N/A", App.TitleDB.Version)
21-
If String.IsNullOrEmpty(App.TitleDB.Path) Then
22-
Me.LabelDBVersion.LinkBehavior = LinkBehavior.NeverUnderline
23-
Me.LabelDBVersion.Enabled = False
19+
Me.LabelDBMain.Text = My.Resources.Label_Database & ":"
20+
Me.LabelDBVersionMain.Text = If(String.IsNullOrEmpty(App.TitleDB.Version), "N/A", App.TitleDB.Version)
21+
Me.LabelDBCountMain.Text = InParens(String.Format(My.Resources.Label_Entries, App.TitleDB.MainCount))
22+
If String.IsNullOrEmpty(App.TitleDB.MainPath) Then
23+
Me.LabelDBVersionMain.LinkBehavior = LinkBehavior.NeverUnderline
24+
Me.LabelDBVersionMain.Enabled = False
2425
End If
2526
Me.LabelURL.Text = My.Resources.URL_Repository
2627
Me.TextBoxDescription.Text = GetResource("License.txt")
@@ -44,9 +45,9 @@
4445
Return Value
4546
End Function
4647

47-
Private Sub LabelDBVersion_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LabelDBVersion.LinkClicked
48-
If Not String.IsNullOrEmpty(App.TitleDB.Path) Then
49-
Dim Folder = IO.Path.GetDirectoryName(App.TitleDB.Path)
48+
Private Sub LabelDBVersion_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LabelDBVersionMain.LinkClicked
49+
If Not String.IsNullOrEmpty(App.TitleDB.MainPath) Then
50+
Dim Folder = IO.Path.GetDirectoryName(App.TitleDB.MainPath)
5051
If IO.Directory.Exists(Folder) Then
5152
Try
5253
Dim psi As New ProcessStartInfo() With {

0 commit comments

Comments
 (0)