BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Responsible for handling new/save/save-as/close Project logic, where the Project represents a collection of serialized application models in the project directory. More...
Public Member Functions | |
ProjectManager (const ProjectContext &context) | |
Constructor for ProjectManager. More... | |
ProjectManager (const ProjectManager &other)=delete | |
~ProjectManager () override | |
bool | closeCurrentProject () const override |
Closes current project (without saving). More... | |
bool | createNewProject (const std::string &dirname) override |
Creates a new project, returns 'true' in the case of success. More... | |
std::string | currentProjectDir () const override |
Returns current project directory. More... | |
bool | isModified () const override |
Returns true if project was modified since last save. More... | |
bool | openExistingProject (const std::string &dirname) override |
Opens existing project, returns 'true' in the case of success. More... | |
ProjectManager & | operator= (const ProjectManager &other)=delete |
bool | saveCurrentProject () override |
Saves current project, returns 'true' in the case of success. More... | |
bool | saveProjectAs (const std::string &dirname) override |
Saves the project under a given directory, returns true in the case of success. More... | |
Private Attributes | |
std::unique_ptr< ProjectManagerImpl > | p_impl |
Responsible for handling new/save/save-as/close Project logic, where the Project represents a collection of serialized application models in the project directory.
This ProjectManager requires certain prerequisites to function properly: for example, the creation of a new project will be possible only if the old project is in a saved state. See description to the class methods.
Definition at line 32 of file projectmanager.h.
ProjectManager::ProjectManager | ( | const ProjectContext & | context | ) |
Constructor for ProjectManager.
Definition at line 63 of file projectmanager.cpp.
|
overridedefault |
|
delete |
|
overridevirtual |
Closes current project (without saving).
No checks whether it is modified or not being performed.
Implements ModelView::ProjectManagerInterface.
Definition at line 127 of file projectmanager.cpp.
References p_impl.
|
overridevirtual |
Creates a new project, returns 'true' in the case of success.
Current project has to be in a saved state, otherwise will return false.
Implements ModelView::ProjectManagerInterface.
Definition at line 73 of file projectmanager.cpp.
References p_impl.
Referenced by ProjectManager::ProjectManagerImpl::ProjectManagerImpl(), and TEST_F().
|
overridevirtual |
Returns current project directory.
Implements ModelView::ProjectManagerInterface.
Definition at line 112 of file projectmanager.cpp.
References p_impl.
Referenced by TEST_F().
|
overridevirtual |
Returns true if project was modified since last save.
Implements ModelView::ProjectManagerInterface.
Definition at line 119 of file projectmanager.cpp.
References p_impl.
Referenced by TEST_F().
|
overridevirtual |
Opens existing project, returns 'true' in the case of success.
Current project should be in a saved state, new project should exist.
Implements ModelView::ProjectManagerInterface.
Definition at line 102 of file projectmanager.cpp.
References p_impl.
|
delete |
|
overridevirtual |
Saves current project, returns 'true' in the case of success.
The project should have a project directory defined to succeed.
Implements ModelView::ProjectManagerInterface.
Definition at line 84 of file projectmanager.cpp.
References p_impl.
Referenced by TEST_F().
|
overridevirtual |
Saves the project under a given directory, returns true in the case of success.
The directory should exist already.
Implements ModelView::ProjectManagerInterface.
Definition at line 94 of file projectmanager.cpp.
References p_impl.
Referenced by TEST_F().
|
private |
Definition at line 56 of file projectmanager.h.
Referenced by closeCurrentProject(), createNewProject(), currentProjectDir(), isModified(), openExistingProject(), saveCurrentProject(), and saveProjectAs().