BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Project document class handles all data related to the opened project (sample, jobModel, project specific windows settings) More...
Public Slots | |
void | onModelChanged () |
Signals | |
void | modified () |
Public Member Functions | |
ProjectDocument (const QString &projectFileName="") | |
ProjectFlags::DocumentStatus | documentStatus () const |
QString | documentVersion () const |
bool | hasData () const |
bool | hasErrors () const |
bool | hasValidNameAndPath () |
bool | hasWarnings () const |
bool | isModified () |
bool | isReady () const |
void | load (const QString &project_file_name) |
QString | projectDir () const |
QString | projectFileName () const |
QString | projectName () const |
void | save (const QString &project_file_name, bool autoSave=false) |
void | save_project_data (const QString &project_file_name) |
void | save_project_file (const QString &project_file_name, bool autoSave=false) |
void | setApplicationModels (ApplicationModels *applicationModels) |
void | setLogger (MessageService *messageService) |
void | setModified (bool flag) |
void | setProjectDir (const QString &text) |
void | setProjectFileName (const QString &text) |
void | setProjectName (const QString &text) |
Static Public Member Functions | |
static QString | projectFileExtension () |
Private Member Functions | |
void | connectModels () |
void | disconnectModels () |
void | readFrom (QIODevice *device) |
void | writeTo (QIODevice *device) |
Private Attributes | |
ApplicationModels * | m_applicationModels |
QString | m_currentVersion |
OutputDataIOService * | m_dataService |
ProjectFlags::DocumentStatus | m_documentStatus |
MessageService * | m_messageService |
bool | m_modified |
QString | m_project_dir |
QString | m_project_name |
Project document class handles all data related to the opened project (sample, jobModel, project specific windows settings)
e.g. if project file is /home/users/development/Untitled/Untitled.pro projectName() - 'Untitled' projectDir() - '/home/users/development/Untitled projectFileName() - '/home/users/development/Untitled/Untitled.pro'
Definition at line 40 of file projectdocument.h.
ProjectDocument::ProjectDocument | ( | const QString & | projectFileName = "" | ) |
Definition at line 30 of file projectdocument.cpp.
References projectFileName(), and setProjectFileName().
|
private |
Definition at line 295 of file projectdocument.cpp.
References m_applicationModels, ApplicationModels::modelChanged(), and onModelChanged().
Referenced by load(), and setApplicationModels().
|
private |
Definition at line 288 of file projectdocument.cpp.
References m_applicationModels, ApplicationModels::modelChanged(), and onModelChanged().
Referenced by load(), and setApplicationModels().
ProjectFlags::DocumentStatus ProjectDocument::documentStatus | ( | ) | const |
Definition at line 186 of file projectdocument.cpp.
References m_documentStatus.
QString ProjectDocument::documentVersion | ( | ) | const |
Definition at line 211 of file projectdocument.cpp.
References GUIHelpers::getBornAgainVersionString(), and m_currentVersion.
Referenced by ProjectManager::riseProjectLoadWarningDialog().
bool ProjectDocument::hasData | ( | ) | const |
Definition at line 206 of file projectdocument.cpp.
References m_dataService, and OutputDataIOService::nonXMLItems().
Referenced by SaveService::process_queue().
bool ProjectDocument::hasErrors | ( | ) | const |
Definition at line 201 of file projectdocument.cpp.
References m_documentStatus, and ProjectFlags::STATUS_FAILED.
Referenced by ProjectManager::openProject().
bool ProjectDocument::hasValidNameAndPath | ( | ) |
Definition at line 164 of file projectdocument.cpp.
References m_project_dir, and m_project_name.
Referenced by AutosaveController::assureAutoSaveDirExists(), AutosaveController::autosaveDir(), AutosaveController::autosaveName(), AutosaveController::onDocumentModified(), ProjectManager::projectDir(), and ProjectManager::saveProject().
bool ProjectDocument::hasWarnings | ( | ) | const |
Definition at line 196 of file projectdocument.cpp.
References m_documentStatus, and ProjectFlags::STATUS_WARNING.
Referenced by ProjectManager::openProject().
bool ProjectDocument::isModified | ( | ) |
Definition at line 169 of file projectdocument.cpp.
References m_modified.
Referenced by ProjectManager::closeCurrentProject(), AutosaveController::onDocumentModified(), ProjectManager::onDocumentModified(), and AutosaveController::onTimerTimeout().
bool ProjectDocument::isReady | ( | ) | const |
Definition at line 191 of file projectdocument.cpp.
References m_documentStatus, and ProjectFlags::STATUS_OK.
Referenced by ProjectManager::openProject().
void ProjectDocument::load | ( | const QString & | project_file_name | ) |
Definition at line 129 of file projectdocument.cpp.
References connectModels(), disconnectModels(), OutputDataIOService::load(), m_dataService, m_documentStatus, m_messageService, projectDir(), projectFileName(), readFrom(), MessageService::send_error(), ProjectFlags::setFlag(), setProjectFileName(), ProjectFlags::STATUS_FAILED, ProjectFlags::STATUS_OK, ProjectFlags::STATUS_WARNING, and MessageService::warningCount().
Referenced by ProjectManager::loadProject().
|
signal |
|
slot |
Definition at line 219 of file projectdocument.cpp.
References m_modified, and modified().
Referenced by connectModels(), and disconnectModels().
QString ProjectDocument::projectDir | ( | ) | const |
Definition at line 55 of file projectdocument.cpp.
References m_project_dir.
Referenced by AutosaveController::assureAutoSaveDirExists(), load(), ProjectManager::projectDir(), and projectFileName().
|
static |
Definition at line 79 of file projectdocument.cpp.
Referenced by ProjectUtils::autosaveName(), NewProjectDialog::getProjectFileName(), and projectFileName().
QString ProjectDocument::projectFileName | ( | ) | const |
Definition at line 65 of file projectdocument.cpp.
References projectDir(), projectFileExtension(), and projectName().
Referenced by ProjectDocument(), ProjectManager::addToRecentProjects(), AutosaveController::autosaveDir(), AutosaveController::autosaveName(), load(), ProjectManager::riseProjectLoadFailedDialog(), ProjectManager::saveProject(), and setProjectFileName().
QString ProjectDocument::projectName | ( | ) | const |
Definition at line 42 of file projectdocument.cpp.
References m_project_name.
Referenced by ProjectManager::onDocumentModified(), projectFileName(), and writeTo().
|
private |
Definition at line 225 of file projectdocument.cpp.
References ASSERT, ProjectDocumentXML::BornAgainTag(), ProjectDocumentXML::BornAgainVersionAttribute(), ProjectDocumentXML::InfoTag(), GUIHelpers::isVersionMatchMinimal(), m_applicationModels, m_currentVersion, m_documentStatus, m_messageService, MessageService::messageCount(), ApplicationModels::readFrom(), MessageService::send_error(), ProjectFlags::setFlag(), ProjectFlags::STATUS_FAILED, and ProjectFlags::STATUS_WARNING.
Referenced by load().
void ProjectDocument::save | ( | const QString & | project_file_name, |
bool | autoSave = false |
||
) |
Definition at line 94 of file projectdocument.cpp.
References save_project_data(), and save_project_file().
void ProjectDocument::save_project_data | ( | const QString & | project_file_name | ) |
Definition at line 121 of file projectdocument.cpp.
References m_dataService, ProjectUtils::projectDir(), and OutputDataIOService::save().
Referenced by SaveThread::run(), and save().
void ProjectDocument::save_project_file | ( | const QString & | project_file_name, |
bool | autoSave = false |
||
) |
Definition at line 100 of file projectdocument.cpp.
References m_modified, modified(), setProjectFileName(), and writeTo().
Referenced by SaveService::process_queue(), and save().
void ProjectDocument::setApplicationModels | ( | ApplicationModels * | applicationModels | ) |
Definition at line 84 of file projectdocument.cpp.
References connectModels(), disconnectModels(), m_applicationModels, m_dataService, and OutputDataIOService::setApplicationModels().
Referenced by ProjectManager::createNewProject().
void ProjectDocument::setLogger | ( | MessageService * | messageService | ) |
Definition at line 181 of file projectdocument.cpp.
References m_messageService.
Referenced by ProjectManager::createNewProject().
void ProjectDocument::setModified | ( | bool | flag | ) |
Definition at line 174 of file projectdocument.cpp.
References m_modified, and modified().
Referenced by ProjectManager::loadProject().
void ProjectDocument::setProjectDir | ( | const QString & | text | ) |
Definition at line 60 of file projectdocument.cpp.
References m_project_dir.
Referenced by setProjectFileName().
void ProjectDocument::setProjectFileName | ( | const QString & | text | ) |
Definition at line 73 of file projectdocument.cpp.
References ProjectUtils::projectDir(), projectFileName(), ProjectUtils::projectName(), setProjectDir(), and setProjectName().
Referenced by ProjectDocument(), load(), ProjectManager::loadProject(), and save_project_file().
void ProjectDocument::setProjectName | ( | const QString & | text | ) |
Definition at line 47 of file projectdocument.cpp.
References m_project_name, and modified().
Referenced by ProjectManager::createNewProject(), and setProjectFileName().
|
private |
Definition at line 269 of file projectdocument.cpp.
References ProjectDocumentXML::BornAgainTag(), ProjectDocumentXML::BornAgainVersionAttribute(), GUIHelpers::getBornAgainVersionString(), ProjectDocumentXML::InfoNameAttribute(), ProjectDocumentXML::InfoTag(), m_applicationModels, projectName(), and ApplicationModels::writeTo().
Referenced by save_project_file().
|
private |
Definition at line 100 of file projectdocument.h.
Referenced by connectModels(), disconnectModels(), readFrom(), setApplicationModels(), and writeTo().
|
private |
Definition at line 104 of file projectdocument.h.
Referenced by documentVersion(), and readFrom().
|
private |
Definition at line 105 of file projectdocument.h.
Referenced by hasData(), load(), save_project_data(), and setApplicationModels().
|
private |
Definition at line 102 of file projectdocument.h.
Referenced by documentStatus(), hasErrors(), hasWarnings(), isReady(), load(), and readFrom().
|
private |
Definition at line 103 of file projectdocument.h.
Referenced by load(), readFrom(), and setLogger().
|
private |
Definition at line 101 of file projectdocument.h.
Referenced by isModified(), onModelChanged(), save_project_file(), and setModified().
|
private |
Definition at line 98 of file projectdocument.h.
Referenced by hasValidNameAndPath(), projectDir(), and setProjectDir().
|
private |
Definition at line 99 of file projectdocument.h.
Referenced by hasValidNameAndPath(), projectName(), and setProjectName().