Skip to content

Commit

Permalink
Fixed 'thumbnail loading' issue #51, #52
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebullet70 committed Jul 30, 2023
1 parent ae4f938 commit 85a58ed
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
7 changes: 5 additions & 2 deletions src/pageViews/pageFiles.bas
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,11 @@ Private Sub clvFiles_ItemClick (Index As Int, Value As Object)
If File.Exists(xui.DefaultFolder,mCurrentFileInfo.myThumbnail_filename_disk) = False Then

SetThumbnail2Nothing
guiHelpers.Show_toast(gblConst.THUMBNAIL_LOADING,1000)
Log("clvFiles_ItemClick sub")
'--- sometimes happens on 1st startup on the main menu page, why? no idea
If mMainObj.oPageCurrent = mMainObj.oPageFiles Then
guiHelpers.Show_toast(gblConst.THUMBNAIL_LOADING,1000)
End If
'Log("clvFiles_ItemClick sub")

If config.logFILE_EVENTS Then logMe.LogIt("downloading missing thumbnail file; " & mCurrentFileInfo.myThumbnail_filename_disk,mModule)

Expand Down
23 changes: 17 additions & 6 deletions src/pageViews/pagePrinting.bas
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,14 @@ Public Sub LoadThumbNail
If oc.JobFileName = "" Then Return
#if klipper
If oc.isConnected = False Then Return

#End If

If mMainObj.oMasterController.gMapOctoFilesList.IsInitialized = False Then
'--- sometimes happens on 1st startup
guiHelpers.Show_toast(gblConst.THUMBNAIL_LOADING,1500)
'--- sometimes happens on 1st startup on the main menu page, why? no idea
If mMainObj.oPageCurrent = mMainObj.oPagePrinting Then
guiHelpers.Show_toast(gblConst.THUMBNAIL_LOADING,1500)
End If
Main.tmrTimerCallSub.CallSubDelayedPlus(Me,"LoadThumbNail",6200)
Return
End If
Expand All @@ -374,7 +377,12 @@ Public Sub LoadThumbNail
If currentFileInfo = Null Then
CallSubDelayed(mMainObj.oMasterController, "GetAllOctoFilesInfo")
Main.tmrTimerCallSub.CallSubDelayedPlus(Me,"LoadThumbNail",3000)
guiHelpers.Show_toast(gblConst.THUMBNAIL_LOADING,1500)

'--- sometimes happens on 1st startup on the main menu page, why? no idea
If mMainObj.oPageCurrent = mMainObj.oPagePrinting Then
guiHelpers.Show_toast(gblConst.THUMBNAIL_LOADING,1500)
End If

End If
ivPreviewLG.Load(File.DirAssets,gblConst.NO_THUMBNAIL)
Return
Expand All @@ -383,9 +391,12 @@ Public Sub LoadThumbNail
Try
'--- Same code as in pageFiles so... TODO, make method and share code
If File.Exists(xui.DefaultFolder,currentFileInfo.myThumbnail_filename_disk) = False Then

guiHelpers.Show_toast(gblConst.THUMBNAIL_LOADING,1000)
Log("LoadThumbNail sub")

If mMainObj.oPageCurrent = mMainObj.oPagePrinting Then
'--- sometimes happens on 1st startup on the main menu page, why? no idea
guiHelpers.Show_toast(gblConst.THUMBNAIL_LOADING,1000)
End If
'Log("LoadThumbNail sub")

If config.logFILE_EVENTS Then logMe.LogIt("downloading missing thumbnail file; " & currentFileInfo.myThumbnail_filename_disk,mModule)

Expand Down

0 comments on commit 85a58ed

Please sign in to comment.