2#include <NDEVR/QTModelManager.h>
126#if NDEVR_SUPPORTS_THREADING
A thread that executes a user-provided callback function concurrently.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
Contains methods for easily reading and writing to an INI file including efficient casting,...
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
Serves as the primary program interface for processes to report issues and allows any number of LogSt...
virtual File projectFile() const
Gets the project file path.
void videoPathChangedSignal(const File &path)
Emitted after the video folder path has changed.
String m_runtime_log_folder
The folder for runtime log files.
ProjectFileManager(QTModelManager *manager)
Constructs the project file manager for the given model manager.
void imagePathChangedSignal(const File &path)
Emitted after the image folder path has changed.
PathChangeMode
Describes how the project folder path is being changed.
@ e_move
The project is being moved to a new location.
@ e_new
A new project is being created at the location.
@ e_copy
The project is being copied to a new location.
virtual bool userSaveProject(const SaveOptions &options=SaveOptions())
Saves the project with user-facing dialogs and confirmation prompts.
void imagePathAboutToChangeSignal(const File &new_path, PathChangeMode mode)
Emitted before the image folder path changes.
virtual bool saveProject(const SaveOptions &options=SaveOptions())
Saves the project to disk without user interaction.
virtual INIFactory getINI()
Gets the INI factory for reading and writing project configuration.
void readINIOptions()
Reads project file manager options from the INI configuration.
virtual File projectDirectory() const
Gets the project directory path.
virtual void userDiscardProject(QTModelManager *manager, bool is_blocking)
Discards the current project without saving, optionally blocking until complete.
virtual File defaultBrowseDirectory(bool is_project) const
Gets the default browse directory for file dialogs.
BasicThread * m_auto_save_thread
The background thread for auto-save operations.
virtual void updateActiveProjectFolder(PathChangeMode mode, Log *log=nullptr)
Updates the active project folder paths and emits path change signals.
bool m_is_last_save_backup
Whether the last save was an auto-save backup.
File m_last_save_file
The file path of the last save operation.
Time lastSaveTime() const
Gets the time of the last successful save.
virtual File activeVideoFolder() const
Gets the folder path for storing project videos.
virtual File activeBackupFile() const
Gets the file path for the active backup file.
Time m_last_backup_time
The timestamp of the last backup operation.
Time m_last_save_time
The timestamp of the last save operation.
void update(Time current_time)
Called periodically to check if an auto-save should be performed.
File previousBackupFile() const
Gets the file path of the previous backup.
void exportPathChangedSignal(const File &path)
Emitted after the export folder path has changed.
Time m_last_project_file_check_time
The timestamp of the last project file integrity check.
void clearBackupInformation()
Clears all stored backup timestamps and file references.
void clearAll()
Clears all project data and resets to the default state.
void projectSavedSignal()
Emitted after the project is saved successfully.
void saveINIOptions()
Saves project file manager options to the INI configuration.
virtual bool moveProject(const SaveOptions &options)
Moves the current project to a new location.
QTModelManager * m_manager
The model manager owning the project data.
void exportPathAboutToChangeSignal(const File &new_path, PathChangeMode mode)
Emitted before the export folder path changes.
void writeIconFile(const String &id)
Writes a preview icon image file for the project.
Thread * autoSaveThread()
Gets the background thread used for auto-save operations.
virtual bool copyProject(const SaveOptions &options)
Copies the current project to a new location.
virtual File projectParentDirectory() const
Gets the parent directory of the project directory.
void updateLastBackupTime()
Updates the timestamp of the last backup operation.
virtual String projectName() const
Gets the name of the current project.
String m_project_name
The current project name.
void logPathChangedSignal(const File &path)
Emitted after the log folder path has changed.
virtual File activeScreenshotFolder() const
Gets the folder path for storing project screenshots.
virtual File activeLogFolder() const
Gets the folder path for storing project logs.
virtual bool optimizeUserSaveProject()
Performs an optimized save that only writes changed data.
void logPathAboutToChangeSignal(const File &new_path, PathChangeMode mode)
Emitted before the log folder path changes.
void videoPathAboutToChangeSignal(const File &new_path, PathChangeMode mode)
Emitted before the video folder path changes.
File m_project_parent_directory
The parent directory of the project folder.
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
The core String class for the NDEVR API.
The default thread class for executing concurrent sequences in the NDEVR API.
Represents a timestamp with utilities for manipulation and conversion.
The primary namespace for the NDEVR SDK.
Options for saving an NDEVR project.
bool is_blocking
Whether the save should block the calling thread until complete.
LogPtr log
The log to write save progress and errors to.
SaveOptions(const File &destination)
Constructs save options with a destination file.
PopupInfo origin
Popup info for positioning save-related dialogs.
bool write_image
Whether to write the project preview image.
bool is_temp
Whether this is a temporary save (e.g., auto-save).
std::function< void(bool, File)> finished_callback
Callback invoked when the save finishes, with success status and path.
bool path_includes_new_project_name
Whether the destination path already includes the new project name.
File destination
The destination file path for the save operation.