Skip to content

Commit

Permalink
Changed IconPath to relative to show icon even if folder is moved els…
Browse files Browse the repository at this point in the history
…ewhere

Fixed issue where searching for collection caused date error
Add double click on Movie name to open folder
Reset posterProgressBar when selecting a Different folder
  • Loading branch information
DineshSolanki committed Jul 10, 2019
1 parent 38ebaf4 commit efc0407
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Folicon_Native/Classes/FolderIcon.vb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ Public Class FolderIcon
Me.IniPath = Me.FolderPath & "desktop.ini"

' Write .ini settings to the desktop.ini file
IniWriter.WriteValue(".ShellClassInfo", "IconResource", iconFilePath & ",0", Me.IniPath)
'IniWriter.WriteValue(".ShellClassInfo", "IconResource", iconFilePath & ",0", Me.IniPath)
IniWriter.WriteValue(".ShellClassInfo", "IconResource", infoTip & ".ico" & ",0", Me.IniPath)
'IniWriter.WriteValue(".ShellClassInfo", "IconIndex", iconIndex.ToString(), Me.IniPath)
'IniWriter.WriteValue(".ShellClassInfo", "InfoTip", infoTip, Me.IniPath)

Expand Down
20 changes: 16 additions & 4 deletions Folicon_Native/MainWindow.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Class MainWindow
SelectedFolderPath = folderbrowse.SelectedPath
SelectedFolderlbl.Content = SelectedFolderPath
Searchbtn.IsEnabled = True
PosterProgressBar.Value = 0
GetFileNames()
End If
End Sub
Expand Down Expand Up @@ -117,16 +118,20 @@ Class MainWindow
If ValidFolder(SelectedFolderPath) Then
If PosterProgressBar.Value.ToString = "100" Then
BusyIndicator1.IsBusy = True
MakeIco("visible")
Dim ts As New System.Threading.ThreadStart(Sub() MakeIco("visible"))
Dim t As New System.Threading.Thread(ts)
t.Start()
IconsProcessedValue.Content = IconProcessedCount.ToString()

MessageBox.Show("Done!", "Icon(s) Created")
BusyIndicator1.IsBusy = False
MessageBox.Show("Done!", "Icon(s) Created")

Else
Dim result = MessageBox.Show("Please wait for the posters to Download..." & vbCrLf & "Have you already downloaded Images ?", "Please wait...", MessageBoxButton.YesNo)
If result = MessageBoxResult.Yes Then
BusyIndicator1.IsBusy = True
MakeIco()
Dim ts As New System.Threading.ThreadStart(AddressOf MakeIco)
Dim t As New System.Threading.Thread(ts)
t.Start()
BusyIndicator1.IsBusy = False
IconsProcessedValue.Content = IconProcessedCount.ToString()
MessageBox.Show("Done!", "Icon(s) Created")
Expand All @@ -136,4 +141,11 @@ Class MainWindow
MessageBox.Show("Sorry, Folder is Empty or not selected.", "Empty Folder")
End If
End Sub

Private Sub FinalistView_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs) Handles FinalistView.MouseDoubleClick
Dim item = FinalistView.SelectedItem
If item IsNot Nothing Then
Process.Start(FinalistView.SelectedItem.Folder)
End If
End Sub
End Class
2 changes: 1 addition & 1 deletion Folicon_Native/Modules/PublicFunctions.vb
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Module PublicFunctions
PickedListDataTable.Columns.Add(column5)
PickedListDataTable.Columns.Add(column6)
End Sub
Public Sub AddToPickedListDataTable(poster As String, title As String, year As String, rating As String, folder As String, folderName As String)
Public Sub AddToPickedListDataTable(poster As String, title As String, rating As String, folder As String, folderName As String, Optional year As String = "")
Dim nRow As DataRow
nRow = PickedListDataTable.NewRow()
nRow.Item("Poster") = poster
Expand Down
9 changes: 6 additions & 3 deletions Folicon_Native/SearchResult.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,12 @@ Public Class SearchResult
PickedMovieIndex = ListView1.SelectedIndex
If Searchresultob.item("results")(PickedMovieIndex).item("poster_path").ToString IsNot "null" Then

Dim releaseDate As DateTime = CDate(Searchresultob.item("results")(PickedMovieIndex).item(DateProperty).ToString)

AddToPickedListDataTable(SelectedFolderPath & "\" & Fnames(i) & "\" & Fnames(i) & ".png", Searchresultob.item("results")(PickedMovieIndex).item(INameProperty), releaseDate.Year.ToString, Searchresultob.item("results")(PickedMovieIndex).item("vote_average"), SelectedFolderPath & "\" & Fnames(i), Fnames(i))
If Not Fnames(i).ToLower.Contains("collection") Then
Dim releaseDate As DateTime = CDate(Searchresultob.item("results")(PickedMovieIndex).item(DateProperty).ToString)
AddToPickedListDataTable(SelectedFolderPath & "\" & Fnames(i) & "\" & Fnames(i) & ".png", Searchresultob.item("results")(PickedMovieIndex).item(INameProperty), Searchresultob.item("results")(PickedMovieIndex).item("vote_average"), SelectedFolderPath & "\" & Fnames(i), Fnames(i), releaseDate.Year.ToString)
Else
AddToPickedListDataTable(SelectedFolderPath & "\" & Fnames(i) & "\" & Fnames(i) & ".png", Searchresultob.item("results")(PickedMovieIndex).item(INameProperty), Searchresultob.item("results")(PickedMovieIndex).item("vote_average"), SelectedFolderPath & "\" & Fnames(i), Fnames(i))
End If
FolderProcessedCount += 1

Dim image1 As New ImageToDownload()
Expand Down

0 comments on commit efc0407

Please sign in to comment.