![]() |
NDEVR
API Documentation
|
Manages writing to the NDV file and any folder operations for projects. More...
Public Types | |
| enum | PathChangeMode { e_move , e_copy , e_new } |
| Describes how the project folder path is being changed. More... | |
Public Member Functions | |
| ProjectFileManager (QTModelManager *manager) | |
| Constructs the project file manager for the given model manager. | |
| virtual File | activeBackupFile () const |
| Gets the file path for the active backup file. | |
| virtual File | activeLogFolder () const |
| Gets the folder path for storing project logs. | |
| virtual File | activeScreenshotFolder () const |
| Gets the folder path for storing project screenshots. | |
| virtual File | activeVideoFolder () const |
| Gets the folder path for storing project videos. | |
| Thread * | autoSaveThread () |
| Gets the background thread used for auto-save operations. | |
| void | clearAll () |
| Clears all project data and resets to the default state. | |
| void | clearBackupInformation () |
| Clears all stored backup timestamps and file references. | |
| virtual bool | copyProject (const SaveOptions &options) |
| Copies the current project to a new location. | |
| virtual File | defaultBrowseDirectory (bool is_project) const |
| Gets the default browse directory for file dialogs. | |
| void | exportPathAboutToChangeSignal (const File &new_path, PathChangeMode mode) |
| Emitted before the export folder path changes. | |
| void | exportPathChangedSignal (const File &path) |
| Emitted after the export folder path has changed. | |
| virtual INIFactory | getINI () |
| Gets the INI factory for reading and writing project configuration. | |
| void | imagePathAboutToChangeSignal (const File &new_path, PathChangeMode mode) |
| Emitted before the image folder path changes. | |
| void | imagePathChangedSignal (const File &path) |
| Emitted after the image folder path has changed. | |
| Time | lastSaveTime () const |
| Gets the time of the last successful save. | |
| void | logPathAboutToChangeSignal (const File &new_path, PathChangeMode mode) |
| Emitted before the log folder path changes. | |
| void | logPathChangedSignal (const File &path) |
| Emitted after the log folder path has changed. | |
| virtual bool | moveProject (const SaveOptions &options) |
| Moves the current project to a new location. | |
| virtual bool | optimizeUserSaveProject () |
| Performs an optimized save that only writes changed data. | |
| File | previousBackupFile () const |
| Gets the file path of the previous backup. | |
| virtual File | projectDirectory () const |
| Gets the project directory path. | |
| virtual File | projectFile () const |
| Gets the project file path. | |
| virtual String | projectName () const |
| Gets the name of the current project. | |
| virtual File | projectParentDirectory () const |
| Gets the parent directory of the project directory. | |
| void | projectSavedSignal () |
| Emitted after the project is saved successfully. | |
| void | readINIOptions () |
| Reads project file manager options from the INI configuration. | |
| void | saveINIOptions () |
| Saves project file manager options to the INI configuration. | |
| virtual bool | saveProject (const SaveOptions &options=SaveOptions()) |
| Saves the project to disk without user interaction. | |
| void | update (Time current_time) |
| Called periodically to check if an auto-save should be performed. | |
| virtual void | updateActiveProjectFolder (PathChangeMode mode, Log *log=nullptr) |
| Updates the active project folder paths and emits path change signals. | |
| void | updateLastBackupTime () |
| Updates the timestamp of the last backup operation. | |
| virtual void | userDiscardProject (QTModelManager *manager, bool is_blocking) |
| Discards the current project without saving, optionally blocking until complete. | |
| virtual bool | userSaveProject (const SaveOptions &options=SaveOptions()) |
| Saves the project with user-facing dialogs and confirmation prompts. | |
| void | videoPathAboutToChangeSignal (const File &new_path, PathChangeMode mode) |
| Emitted before the video folder path changes. | |
| void | videoPathChangedSignal (const File &path) |
| Emitted after the video folder path has changed. | |
| void | writeIconFile (const String &id) |
| Writes a preview icon image file for the project. | |
Protected Attributes | |
| BasicThread * | m_auto_save_thread |
| The background thread for auto-save operations. | |
| bool | m_is_last_save_backup |
| Whether the last save was an auto-save backup. | |
| Time | m_last_backup_time |
| The timestamp of the last backup operation. | |
| Time | m_last_project_file_check_time |
| The timestamp of the last project file integrity check. | |
| File | m_last_save_file |
| The file path of the last save operation. | |
| Time | m_last_save_time |
| The timestamp of the last save operation. | |
| QTModelManager * | m_manager |
| The model manager owning the project data. | |
| String | m_project_name |
| The current project name. | |
| File | m_project_parent_directory |
| The parent directory of the project folder. | |
| String | m_runtime_log_folder |
| The folder for runtime log files. | |
Manages writing to the NDV file and any folder operations for projects.
Also responsible for creating auto-save backup files at given intervals.
Definition at line 35 of file ProjectFileManager.h.
Describes how the project folder path is being changed.
| Enumerator | |
|---|---|
| e_move | The project is being moved to a new location. |
| e_copy | The project is being copied to a new location. |
| e_new | A new project is being created at the location. |
Definition at line 42 of file ProjectFileManager.h.
| ProjectFileManager::ProjectFileManager | ( | QTModelManager * | manager | ) |
Constructs the project file manager for the given model manager.
| [in] | manager | The model manager that owns the project data. |
References ProjectFileManager().
Referenced by ProjectFileManager().
|
virtual |
Gets the file path for the active backup file.
|
virtual |
Gets the folder path for storing project logs.
|
virtual |
Gets the folder path for storing project screenshots.
|
virtual |
Gets the folder path for storing project videos.
| Thread * ProjectFileManager::autoSaveThread | ( | ) |
Gets the background thread used for auto-save operations.
|
virtual |
Copies the current project to a new location.
| [in] | options | The save options specifying the destination. |
|
virtual |
Gets the default browse directory for file dialogs.
| [in] | is_project | Whether browsing for a project file versus a general file. |
|
virtual |
Gets the INI factory for reading and writing project configuration.
|
inline |
Gets the time of the last successful save.
Definition at line 117 of file ProjectFileManager.h.
References m_last_save_time.
|
virtual |
Moves the current project to a new location.
| [in] | options | The save options specifying the destination. |
|
virtual |
Performs an optimized save that only writes changed data.
| File ProjectFileManager::previousBackupFile | ( | ) | const |
Gets the file path of the previous backup.
|
virtual |
Gets the project directory path.
|
virtual |
Gets the project file path.
|
virtual |
Gets the name of the current project.
|
virtual |
Gets the parent directory of the project directory.
|
virtual |
Saves the project to disk without user interaction.
| [in] | options | The save options. |
| void ProjectFileManager::update | ( | Time | current_time | ) |
Called periodically to check if an auto-save should be performed.
| [in] | current_time | The current time for scheduling decisions. |
|
virtual |
Updates the active project folder paths and emits path change signals.
| [in] | mode | How the path is being changed. |
| [in] | log | Optional log for recording the operation. |
|
virtual |
Discards the current project without saving, optionally blocking until complete.
| [in] | manager | The model manager owning the project. |
| [in] | is_blocking | Whether to block until the discard is complete. |
|
virtual |
Saves the project with user-facing dialogs and confirmation prompts.
| [in] | options | The save options. |
| void ProjectFileManager::writeIconFile | ( | const String & | id | ) |
Writes a preview icon image file for the project.
| [in] | id | The identifier for the icon to write. |