BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Triggers autosave request after some accumulated ammount of document changes. More...
Signals | |
void | autosaveRequest () |
Public Member Functions | |
AutosaveController (QObject *parent=0) | |
QString | autosaveDir () const |
The complete path to the autosave dir (e.g. '/projects/Untitled2/autosave'). More... | |
QString | autosaveName () const |
void | removeAutosaveDir () |
remove auto save directory for given project and all its content More... | |
void | setAutosaveTime (int timerInterval) |
Sets autosave time (in msec) More... | |
void | setDocument (ProjectDocument *document) |
Private Slots | |
void | onDocumentDestroyed (QObject *object) |
void | onDocumentModified () |
void | onTimerTimeout () |
Private Member Functions | |
bool | assureAutoSaveDirExists () const |
Tries to make sure that the directory for auto saving exists. More... | |
void | autosave () |
void | setDocumentConnected (bool set_connected) |
Private Attributes | |
ProjectDocument * | m_document |
UpdateTimer * | m_timer |
Triggers autosave request after some accumulated ammount of document changes.
Definition at line 25 of file AutosaveController.h.
|
explicit |
Definition at line 25 of file AutosaveController.cpp.
References m_timer, onTimerTimeout(), and UpdateTimer::timeToUpdate().
|
private |
Tries to make sure that the directory for auto saving exists.
Tries to create it if not existing so far. No creation, if project directory itself doesn't exist at all. Returns true, if the directory finally exists.
Definition at line 104 of file AutosaveController.cpp.
References autosaveDir(), ProjectUtils::autosaveSubdir(), ProjectDocument::hasValidNameAndPath(), m_document, ProjectDocument::projectDir(), and ProjectUtils::projectDir().
Referenced by autosave().
|
private |
Definition at line 117 of file AutosaveController.cpp.
References assureAutoSaveDirExists(), autosaveName(), and autosaveRequest().
Referenced by onTimerTimeout().
QString AutosaveController::autosaveDir | ( | ) | const |
The complete path to the autosave dir (e.g. '/projects/Untitled2/autosave').
Returns the name of autosave directory.
Definition at line 57 of file AutosaveController.cpp.
References ProjectUtils::autosaveDir(), ProjectDocument::hasValidNameAndPath(), m_document, and ProjectDocument::projectFileName().
Referenced by assureAutoSaveDirExists(), and removeAutosaveDir().
QString AutosaveController::autosaveName | ( | ) | const |
Definition at line 65 of file AutosaveController.cpp.
References ProjectUtils::autosaveName(), ProjectDocument::hasValidNameAndPath(), m_document, and ProjectDocument::projectFileName().
Referenced by autosave(), and SaveService::onAutosaveRequest().
|
signal |
Referenced by autosave(), and SaveService::setAutosaveEnabled().
|
privateslot |
Definition at line 88 of file AutosaveController.cpp.
References m_document, m_timer, and UpdateTimer::reset().
Referenced by setDocumentConnected().
|
privateslot |
Definition at line 95 of file AutosaveController.cpp.
References ProjectDocument::hasValidNameAndPath(), ProjectDocument::isModified(), m_document, m_timer, and UpdateTimer::scheduleUpdate().
Referenced by setDocument(), and setDocumentConnected().
|
privateslot |
Definition at line 82 of file AutosaveController.cpp.
References autosave(), ProjectDocument::isModified(), and m_document.
Referenced by AutosaveController().
void AutosaveController::removeAutosaveDir | ( | ) |
remove auto save directory for given project and all its content
Definition at line 73 of file AutosaveController.cpp.
References autosaveDir().
Referenced by SaveService::stopService().
void AutosaveController::setAutosaveTime | ( | int | timerInterval | ) |
Sets autosave time (in msec)
Definition at line 49 of file AutosaveController.cpp.
References m_timer, UpdateTimer::reset(), and UpdateTimer::setWallclockTimer().
Referenced by SaveService::setAutosaveTime().
void AutosaveController::setDocument | ( | ProjectDocument * | document | ) |
Definition at line 31 of file AutosaveController.cpp.
References m_document, m_timer, onDocumentModified(), UpdateTimer::reset(), and setDocumentConnected().
Referenced by SaveService::setAutosaveEnabled(), and SaveService::setDocument().
|
private |
Definition at line 128 of file AutosaveController.cpp.
References m_document, ProjectDocument::modified(), onDocumentDestroyed(), and onDocumentModified().
Referenced by setDocument().
|
private |
Definition at line 59 of file AutosaveController.h.
Referenced by assureAutoSaveDirExists(), autosaveDir(), autosaveName(), onDocumentDestroyed(), onDocumentModified(), onTimerTimeout(), setDocument(), and setDocumentConnected().
|
private |
Definition at line 60 of file AutosaveController.h.
Referenced by AutosaveController(), onDocumentDestroyed(), onDocumentModified(), setAutosaveTime(), and setDocument().