33import re
44import argparse
55import json
6+ from enum import Enum
67
78from PySide6 import __version__ as PySideVersion
89from PySide6 import QtCore
3435from meshroom .ui import commands
3536
3637
38+ class FileStatus (Enum ):
39+ MISSING = 0
40+ EXISTS = 1
41+ ERROR = 2 # If the file exists but have errors like missing nodes, file content corruption...
42+
43+
3744class MessageHandler :
3845 """
3946 MessageHandler that translates Qt logs to Python logging system.
@@ -422,7 +429,8 @@ def _getRecentProjectFilesFromSettings(self) -> list[dict[str, str]]:
422429 settings .setArrayIndex (i )
423430 path = settings .value ("filepath" )
424431 if path :
425- p = {"path" : path , "thumbnail" : self ._retrieveThumbnailPath (path )}
432+ fileStatus = FileStatus .EXISTS if os .path .isfile (path ) else FileStatus .MISSING
433+ p = {"path" : path , "thumbnail" : self ._retrieveThumbnailPath (path ), "status" : fileStatus .value }
426434 projects .append (p )
427435 settings .endArray ()
428436 settings .endGroup ()
@@ -443,6 +451,7 @@ def _updateRecentProjectFilesThumbnails(self) -> None:
443451 for project in self ._recentProjectFiles :
444452 path = project ["path" ]
445453 project ["thumbnail" ] = self ._retrieveThumbnailPath (path )
454+ project ["status" ] = os .path .isfile (path )
446455
447456 @Slot (str )
448457 @Slot (QUrl )
@@ -479,7 +488,7 @@ def addRecentProjectFile(self, projectFile) -> None:
479488 del projects [idx ] # If so, delete its entry
480489
481490 # Insert the newest entry at the top of the list
482- projects .insert (0 , {"path" : projectFileNorm , "thumbnail" : "" })
491+ projects .insert (0 , {"path" : projectFileNorm , "thumbnail" : "" , "status" : FileStatus . EXISTS })
483492
484493 # Only keep the first 40 projects
485494 maxNbProjects = 40
0 commit comments