BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Provides save/autosave of ProjectDocument in a thread.
Definition at line 26 of file SaveService.h.
Public Slots | |
void | onAutosaveRequest () |
Signals | |
void | projectSaved () |
Public Member Functions | |
SaveService (QObject *parent=nullptr) | |
bool | isAutosaveEnabled () const |
bool | isSaving () const |
void | save (const QString &project_file_name) |
void | setAutosaveEnabled (bool value) |
void | setAutosaveTime (int timerInterval) |
Sets autosave time (in msec) More... | |
void | setDocument (ProjectDocument *document) |
void | stopService () |
Private Slots | |
void | onProjectSaved () |
Private Member Functions | |
void | process_queue () |
Private Attributes | |
AutosaveController * | m_autosave |
ProjectDocument * | m_document |
bool | m_is_saving |
QQueue< QString > | m_save_queue |
|
explicit |
Definition at line 44 of file SaveService.cpp.
bool SaveService::isAutosaveEnabled | ( | ) | const |
Definition at line 84 of file SaveService.cpp.
References m_autosave.
Referenced by ProjectManager::isAutosaveEnabled().
bool SaveService::isSaving | ( | ) | const |
|
slot |
Definition at line 126 of file SaveService.cpp.
References AutosaveController::autosaveName(), m_autosave, and save().
Referenced by setAutosaveEnabled().
|
privateslot |
Definition at line 131 of file SaveService.cpp.
References m_is_saving, process_queue(), and projectSaved().
Referenced by process_queue().
|
private |
Definition at line 140 of file SaveService.cpp.
References GUI::Project::Utils::autosaveSubdir(), ProjectDocument::hasData(), m_document, m_is_saving, m_save_queue, onProjectSaved(), ProjectDocument::saveProjectFile(), and SaveThread::saveReady().
Referenced by onProjectSaved(), and save().
|
signal |
Referenced by onProjectSaved().
void SaveService::save | ( | const QString & | project_file_name | ) |
Definition at line 62 of file SaveService.cpp.
References m_document, m_save_queue, and process_queue().
Referenced by onAutosaveRequest(), and ProjectManager::saveProject().
void SaveService::setAutosaveEnabled | ( | bool | value | ) |
Definition at line 70 of file SaveService.cpp.
References AutosaveController::autosaveRequest(), m_autosave, m_document, onAutosaveRequest(), and AutosaveController::setDocument().
Referenced by ProjectManager::setAutosaveEnabled(), and setAutosaveTime().
void SaveService::setAutosaveTime | ( | int | timerInterval | ) |
Sets autosave time (in msec)
Definition at line 89 of file SaveService.cpp.
References m_autosave, setAutosaveEnabled(), and AutosaveController::setAutosaveTime().
void SaveService::setDocument | ( | ProjectDocument * | document | ) |
Definition at line 52 of file SaveService.cpp.
References m_autosave, m_document, m_save_queue, and AutosaveController::setDocument().
Referenced by ProjectManager::createNewProject(), and stopService().
void SaveService::stopService | ( | ) |
Definition at line 104 of file SaveService.cpp.
References Error, isSaving(), m_autosave, AutosaveController::removeAutosaveDir(), and setDocument().
Referenced by ProjectManager::deleteCurrentProject().
|
private |
Definition at line 60 of file SaveService.h.
Referenced by isAutosaveEnabled(), onAutosaveRequest(), setAutosaveEnabled(), setAutosaveTime(), setDocument(), and stopService().
|
private |
Definition at line 61 of file SaveService.h.
Referenced by process_queue(), save(), setAutosaveEnabled(), and setDocument().
|
private |
Definition at line 59 of file SaveService.h.
Referenced by isSaving(), onProjectSaved(), and process_queue().
|
private |
Definition at line 58 of file SaveService.h.
Referenced by process_queue(), save(), and setDocument().