Skip to content

Commit

Permalink
DEVFIX: Show folders as dimmed when they have only dimmed files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeqMacaw committed Dec 2, 2020
1 parent 3f4b6a3 commit da09432
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
7 changes: 6 additions & 1 deletion Crowbar/Core/Unpacker/Unpacker.vb
Original file line number Diff line number Diff line change
Expand Up @@ -656,9 +656,14 @@ Public Class Unpacker
Me.theArchivePathFileNameToFileDataMap.Add(archivePathFileName, Me.thePackageFileData)
End If
Me.UpdateProgressInternal(2, archivePathFileName)
If File.Exists(archivePathFileName) Then
Me.UpdateProgressInternal(3, "True")
Else
Me.UpdateProgressInternal(3, "False")
End If

line = e.EntryDataOutputText
Me.UpdateProgressInternal(3, line)
Me.UpdateProgressInternal(4, line)

If Me.CancellationPending Then
Return
Expand Down
21 changes: 10 additions & 11 deletions Crowbar/Widgets/Main Tabs/UnpackUserControl.vb
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ Public Class UnpackUserControl
ElseIf e.ProgressPercentage = 2 Then
Me.theArchivePathFileName = line
ElseIf e.ProgressPercentage = 3 Then
Me.theArchivePathFileNameExists = (line = "True")
ElseIf e.ProgressPercentage = 4 Then
Me.theEntryIndex += 1

'Example output:
Expand Down Expand Up @@ -522,10 +524,10 @@ Public Class UnpackUserControl
If info.IsFolder AndAlso info.Name = name Then
info.Count += 1UL
info.Size += fileSize
If info.ArchivePathFileNameExists Then
If Me.theArchivePathFileNameExists Then
info.ArchivePathFileNameExists = Me.theArchivePathFileNameExists
Dim temp As New TreeNode
treeNode.ForeColor = temp.ForeColor
info.ArchivePathFileNameExists = True
End If
End If
Next
Expand All @@ -546,8 +548,10 @@ Public Class UnpackUserControl
'NOTE: Because same folder can be in multiple archives, don't bother showing which archive the folder is in. Crowbar only shows the first one added to the list.
resourceInfo.ArchivePathFileName = ""
' Using this field to determine when to dim the folder in the treeview and listview.
resourceInfo.ArchivePathFileNameExists = False
treeNode.ForeColor = SystemColors.GrayText
resourceInfo.ArchivePathFileNameExists = Me.theArchivePathFileNameExists
If Not resourceInfo.ArchivePathFileNameExists Then
treeNode.ForeColor = SystemColors.GrayText
End If

If parentTreeNode.Tag Is Nothing Then
list = New List(Of PackageResourceFileNameInfo)()
Expand Down Expand Up @@ -595,15 +599,9 @@ Public Class UnpackUserControl
resourceInfo.Extension = fileExtension
resourceInfo.IsFolder = False
resourceInfo.ArchivePathFileName = Me.theArchivePathFileName
resourceInfo.ArchivePathFileNameExists = File.Exists(Me.theArchivePathFileName)
resourceInfo.ArchivePathFileNameExists = Me.theArchivePathFileNameExists
resourceInfo.EntryIndex = Me.theEntryIndex

If resourceInfo.ArchivePathFileNameExists Then
Dim temp As New TreeNode
treeNode.ForeColor = temp.ForeColor
resourceInfo.ArchivePathFileNameExists = True
End If

If treeNode.Tag Is Nothing Then
list = New List(Of PackageResourceFileNameInfo)()
list.Add(resourceInfo)
Expand Down Expand Up @@ -1441,6 +1439,7 @@ Public Class UnpackUserControl

Private thePackageCount As Integer
Private theArchivePathFileName As String
Private theArchivePathFileNameExists As Boolean
Private theEntryIndex As Integer

Private theSearchBackgroundWorker As BackgroundWorker
Expand Down

0 comments on commit da09432

Please sign in to comment.