From 85a58ed4a01a4530d09a9a2f0b57440026c1b139 Mon Sep 17 00:00:00 2001 From: Steven De George SR Date: Sun, 30 Jul 2023 12:11:39 +0300 Subject: [PATCH] Fixed 'thumbnail loading' issue #51, #52 --- src/pageViews/pageFiles.bas | 7 +++++-- src/pageViews/pagePrinting.bas | 23 +++++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/pageViews/pageFiles.bas b/src/pageViews/pageFiles.bas index fe5525b..45fe497 100644 --- a/src/pageViews/pageFiles.bas +++ b/src/pageViews/pageFiles.bas @@ -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) diff --git a/src/pageViews/pagePrinting.bas b/src/pageViews/pagePrinting.bas index cafa362..17ba695 100644 --- a/src/pageViews/pagePrinting.bas +++ b/src/pageViews/pagePrinting.bas @@ -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 @@ -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 @@ -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)