API Documentation
Loading...
Searching...
No Matches
ProjectFileManager.h
Go to the documentation of this file.
1#pragma once
2#include <NDEVR/QTModelManager.h>
3#include <QObject>
4namespace NDEVR
5{
6 class Log;
7 class BasicThread;
8 /**--------------------------------------------------------------------------------------------------
9 \brief Options for saving an NDEVR project
10 **/
12 {
14 {};
18 Log* log = nullptr;
21 bool is_blocking = false;
23 bool is_temp = false;
24 bool write_image = true;
25 std::function<void(bool, File)> finished_callback;
26 };
27 /**--------------------------------------------------------------------------------------------------
28 \brief Manages writing to the NDV file and any folder operations for projects. Also responsible for
29 creating auto-save backup files at given intervals.
30 **/
31 class NDEVR_API ProjectFileManager : public QObject
32 {
33 Q_OBJECT
34 public:
36 {
37 e_move
38 , e_copy
39 , e_new
40 };
43
44 virtual bool moveProject(const SaveOptions& options);
45 virtual bool copyProject(const SaveOptions& options);
46 virtual void userDiscardProject(QTModelManager* manager, bool is_blocking);
47 virtual bool userSaveProject(const SaveOptions& options = SaveOptions());
48 virtual bool saveProject(const SaveOptions& options = SaveOptions());
52 void update(Time current_time);
55 virtual INIFactory getINI();
56 Time lastSaveTime() const { return m_last_save_time; }
57 virtual void updateActiveProjectFolder(PathChangeMode mode, Log* log = nullptr);
58 void clearAll();
59#if NDEVR_SUPPORTS_THREADING
61#endif
62 virtual String projectName() const;
63 virtual File projectFile() const;
64 virtual File projectDirectory() const;
66 virtual File activeBackupFile() const;
67 virtual File activeLogFolder() const;
69 virtual File activeVideoFolder() const;
70 virtual File defaultBrowseDirectory(bool is_project) const;
71 signals:
73 void logPathAboutToChangeSignal(const File& new_path, PathChangeMode mode);
74 void logPathChangedSignal(const File& path);
75
77 void videoPathChangedSignal(const File& path);
78
80 void imagePathChangedSignal(const File& path);
81
83 void exportPathChangedSignal(const File& path);
84 protected:
95 };
96}
#define NDEVR_API
Definition DLLInfo.h:50
A class that allows user to use a function inline to execute something.
Definition BasicThread.h:45
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
Contains methods for easily reading and writing to an INI file including efficient casting,...
Definition INIReader.h:68
Serves as the primary program interface for processes to report issues and allows any number of LogSt...
Definition Log.h:48
Manages writing to the NDV file and any folder operations for projects. Also responsible for creating...
Definition ProjectFileManager.h:32
virtual void userDiscardProject(QTModelManager *manager, bool is_blocking)
virtual File projectParentDirectory() const
Time lastSaveTime() const
Definition ProjectFileManager.h:56
virtual File activeLogFolder() const
void exportPathAboutToChangeSignal(const File &new_path, PathChangeMode mode)
void exportPathChangedSignal(const File &path)
PathChangeMode
Definition ProjectFileManager.h:36
virtual File activeScreenshotFolder() const
virtual File defaultBrowseDirectory(bool is_project) const
File m_last_save_file
Definition ProjectFileManager.h:93
bool m_is_last_save_backup
Definition ProjectFileManager.h:94
virtual bool moveProject(const SaveOptions &options)
virtual bool saveProject(const SaveOptions &options=SaveOptions())
Time m_last_save_time
Definition ProjectFileManager.h:91
virtual File activeVideoFolder() const
File previousBackupFile() const
virtual File projectDirectory() const
virtual String projectName() const
virtual INIFactory getINI()
virtual bool copyProject(const SaveOptions &options)
virtual File projectFile() const
String m_project_name
Definition ProjectFileManager.h:88
Time m_last_project_file_check_time
Definition ProjectFileManager.h:92
void videoPathAboutToChangeSignal(const File &new_path, PathChangeMode mode)
virtual void updateActiveProjectFolder(PathChangeMode mode, Log *log=nullptr)
File m_project_parent_directory
Definition ProjectFileManager.h:87
void videoPathChangedSignal(const File &path)
virtual bool userSaveProject(const SaveOptions &options=SaveOptions())
void imagePathChangedSignal(const File &path)
void logPathAboutToChangeSignal(const File &new_path, PathChangeMode mode)
BasicThread * m_auto_save_thread
Definition ProjectFileManager.h:86
void update(Time current_time)
QTModelManager * m_manager
Definition ProjectFileManager.h:85
String m_runtime_log_folder
Definition ProjectFileManager.h:89
void logPathChangedSignal(const File &path)
virtual File activeBackupFile() const
ProjectFileManager(QTModelManager *manager)
void imagePathAboutToChangeSignal(const File &new_path, PathChangeMode mode)
Time m_last_backup_time
Definition ProjectFileManager.h:90
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
Definition QTModelManager.h:105
The core String class for the NDEVR API.
Definition String.h:69
A thread is a single sequence stream within the software.
Definition Thread.h:67
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
Definition ACIColor.h:37
Class which is used to pass arguments and requests for creating a popup dialog or widget....
Definition PopupInfo.h:15
Options for saving an NDEVR project.
Definition ProjectFileManager.h:12
PopupInfo origin
Definition ProjectFileManager.h:19
std::function< void(bool, File)> finished_callback
Definition ProjectFileManager.h:25
SaveOptions(const File &destination)
Definition ProjectFileManager.h:15
bool path_includes_new_project_name
Definition ProjectFileManager.h:22
SaveOptions()
Definition ProjectFileManager.h:13
bool is_temp
Definition ProjectFileManager.h:23
bool is_blocking
Definition ProjectFileManager.h:21
bool write_image
Definition ProjectFileManager.h:24
Log * log
Definition ProjectFileManager.h:18
File destination
Definition ProjectFileManager.h:20