16 #include "Base/Util/Assert.h"
22 #include <QApplication>
23 #include <QCoreApplication>
29 class AutoSetResetFlag {
31 AutoSetResetFlag(
bool* flag)
36 ~AutoSetResetFlag() { *m_flag =
false; }
39 bool* m_flag =
nullptr;
106 QApplication::setOverrideCursor(Qt::WaitCursor);
109 QTime dieTime = QTime::currentTime().addSecs(60);
110 while (QTime::currentTime() < dieTime) {
111 QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
116 throw Error(
"SaveService::stopService() -> Error. Can't stop service. ");
123 QApplication::restoreOverrideCursor();
158 saveThread->setSaveContext(
m_document, project_file_name);
161 connect(saveThread, &SaveThread::finished, saveThread, &QObject::deleteLater);
Defines class AutosaveController.
Defines class ProjectDocument.
Defines namespace GUI::Project::Utils.
Defines class SaveService.
Defines SaveThread classes.
Triggers autosave request after some accumulated ammount of document changes.
void setAutosaveTime(int timerInterval)
Sets autosave time (in msec)
void setDocument(ProjectDocument *document)
QString autosaveName() const
void removeAutosaveDir() const
remove auto save directory for given project and all its content
Project document class handles all data related to the opened project (sample, job,...
void saveProjectFile(const QString &project_file_name, bool autoSave=false)
void setAutosaveTime(int timerInterval)
Sets autosave time (in msec)
SaveService(QObject *parent=nullptr)
void setAutosaveEnabled(bool value)
ProjectDocument * m_document
void save(const QString &project_file_name)
bool isAutosaveEnabled() const
QQueue< QString > m_save_queue
void setDocument(ProjectDocument *document)
AutosaveController * m_autosave
Performs saving of heavy intensity data in a thread.
QString autosaveSubdir()
Returns fixed name for autosave sub-directory.