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;
9 {
11 {};
15 Log* log = nullptr;
18 bool is_blocking = false;
20 bool is_temp = false;
21 bool write_image = true;
22 std::function<void(bool, File)> finished_callback;
23 };
24 class NDEVR_API ProjectFileManager : public QObject
25 {
26 Q_OBJECT
27 public:
29 {
30 e_move
31 , e_copy
32 , e_new
33 };
36
37 virtual bool moveProject(const SaveOptions& options);
38 virtual bool copyProject(const SaveOptions& options);
39 virtual void userDiscardProject(QTModelManager* manager, bool is_blocking);
40 virtual bool userSaveProject(const SaveOptions& options = SaveOptions());
41 virtual bool saveProject(const SaveOptions& options = SaveOptions());
42 void updateLastBackupTime();
43 File previousBackupFile() const;
44 void clearBackupInformation();
45 void update(Time current_time);
46 void readINIOptions();
47 void saveINIOptions();
48 virtual INIFactory getINI();
49 Time lastSaveTime() const { return m_last_save_time; }
50 virtual void updateActiveProjectFolder(PathChangeMode mode, Log* log = nullptr);
51 void clearAll();
52#if NDEVR_SUPPORTS_THREADING
53 Thread* autoSaveThread();
54#endif
55 virtual String projectName() const;
56 virtual File projectFile() const;
57 virtual File projectDirectory() const;
58 virtual File projectParentDirectory() const;
59 virtual File activeBackupFile() const;
60 virtual File activeLogFolder() const;
61 virtual File activeScreenshotFolder() const;
62 virtual File activeVideoFolder() const;
63 virtual File defaultBrowseDirectory(bool is_project) const;
64 signals:
66 void logPathAboutToChangeSignal(const File& new_path, PathChangeMode mode);
67 void logPathChangedSignal(const File& path);
68
70 void videoPathChangedSignal(const File& path);
71
73 void imagePathChangedSignal(const File& path);
74
76 void exportPathChangedSignal(const File& path);
77 protected:
79 BasicThread* m_auto_save_thread;
88 };
89}
#define NDEVR_API
Definition DLLInfo.h:67
Definition File.h:47
Definition INIReader.h:57
Definition Log.h:43
Definition ProjectFileManager.h:25
Time lastSaveTime() const
Definition ProjectFileManager.h:49
void exportPathAboutToChangeSignal(const File &new_path, PathChangeMode mode)
void exportPathChangedSignal(const File &path)
PathChangeMode
Definition ProjectFileManager.h:29
File m_last_save_file
Definition ProjectFileManager.h:86
bool m_is_last_save_backup
Definition ProjectFileManager.h:87
Time m_last_save_time
Definition ProjectFileManager.h:84
String m_project_name
Definition ProjectFileManager.h:81
Time m_last_project_file_check_time
Definition ProjectFileManager.h:85
void videoPathAboutToChangeSignal(const File &new_path, PathChangeMode mode)
File m_project_parent_directory
Definition ProjectFileManager.h:80
void videoPathChangedSignal(const File &path)
void imagePathChangedSignal(const File &path)
void logPathAboutToChangeSignal(const File &new_path, PathChangeMode mode)
BasicThread * m_auto_save_thread
Definition ProjectFileManager.h:79
QTModelManager * m_manager
Definition ProjectFileManager.h:78
String m_runtime_log_folder
Definition ProjectFileManager.h:82
void logPathChangedSignal(const File &path)
void imagePathAboutToChangeSignal(const File &new_path, PathChangeMode mode)
Time m_last_backup_time
Definition ProjectFileManager.h:83
Definition QTModelManager.h:94
Definition String.h:40
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
Definition ACIColor.h:37
Definition PopupInfo.h:10
Definition ProjectFileManager.h:9
PopupInfo origin
Definition ProjectFileManager.h:16
std::function< void(bool, File)> finished_callback
Definition ProjectFileManager.h:22
SaveOptions(const File &destination)
Definition ProjectFileManager.h:12
bool path_includes_new_project_name
Definition ProjectFileManager.h:19
SaveOptions()
Definition ProjectFileManager.h:10
bool is_temp
Definition ProjectFileManager.h:20
bool is_blocking
Definition ProjectFileManager.h:18
bool write_image
Definition ProjectFileManager.h:21
Log * log
Definition ProjectFileManager.h:15
File destination
Definition ProjectFileManager.h:17