Mantid
|
Implements a presenter for the project saving dialog. More...
#include <ProjectSavePresenter.h>
Public Types | |
enum class | Notification { UncheckWorkspace , CheckWorkspace , PrepareProjectFolder } |
Public Member Functions | |
bool | needsSizeWarning (const std::vector< std::string > &wsNames) |
Find out if a project needs a save warning. More... | |
void | notify (Notification notification) |
Notify the presenter to do something. More... | |
ProjectSavePresenter (IProjectSaveView *view) | |
Construct a new presenter with a view. More... | |
Private Member Functions | |
void | excludeWindowsForUncheckedWorkspace () |
Update the view to add excluded windows for a workspace. More... | |
void | includeWindowsForCheckedWorkspace () |
Update the view to add included windows for a workspace. More... | |
void | prepareProjectFolder () |
Prepare a project folder given the path. More... | |
Private Attributes | |
ProjectSaveModel | m_model |
Hold an instance of the model. More... | |
IProjectSaveView * | m_view |
Handle to the view for this presenter. More... | |
Implements a presenter for the project saving dialog.
Definition at line 25 of file ProjectSavePresenter.h.
|
strong |
Enumerator | |
---|---|
UncheckWorkspace | |
CheckWorkspace | |
PrepareProjectFolder |
Definition at line 27 of file ProjectSavePresenter.h.
ProjectSavePresenter::ProjectSavePresenter | ( | IProjectSaveView * | view | ) |
Construct a new presenter with a view.
Construct a new presenter with the given view.
view | :: a handle to a view for this presenter |
Definition at line 26 of file ProjectSavePresenter.cpp.
References MantidQt::MantidWidgets::ProjectSaveModel::getAllPythonInterfaces(), MantidQt::MantidWidgets::ProjectSaveModel::getWindowInformation(), MantidQt::MantidWidgets::ProjectSaveModel::getWorkspaceInformation(), MantidQt::MantidWidgets::ProjectSaveModel::getWorkspaceNames(), m_model, m_view, MantidQt::MantidWidgets::IProjectSaveView::updateIncludedWindowsList(), MantidQt::MantidWidgets::IProjectSaveView::updateInterfacesList(), and MantidQt::MantidWidgets::IProjectSaveView::updateWorkspacesList().
|
private |
Update the view to add excluded windows for a workspace.
Update the view with a new list of windows that are excluded from project saving based on the currently checked workspaces.
Definition at line 84 of file ProjectSavePresenter.cpp.
References MantidQt::MantidWidgets::IProjectSaveView::getUncheckedWorkspaceNames(), MantidQt::MantidWidgets::ProjectSaveModel::getWindowInformation(), MantidQt::MantidWidgets::ProjectSaveModel::getWindowNames(), m_model, m_view, MantidQt::MantidWidgets::IProjectSaveView::removeFromIncludedWindowsList(), and MantidQt::MantidWidgets::IProjectSaveView::updateExcludedWindowsList().
Referenced by notify().
|
private |
Update the view to add included windows for a workspace.
Update the view with a new list of windows that are included in project saving based on the currently checked workspaces.
Definition at line 71 of file ProjectSavePresenter.cpp.
References MantidQt::MantidWidgets::IProjectSaveView::getCheckedWorkspaceNames(), MantidQt::MantidWidgets::ProjectSaveModel::getWindowInformation(), MantidQt::MantidWidgets::ProjectSaveModel::getWindowNames(), m_model, m_view, MantidQt::MantidWidgets::IProjectSaveView::removeFromExcludedWindowsList(), and MantidQt::MantidWidgets::IProjectSaveView::updateIncludedWindowsList().
Referenced by notify().
bool ProjectSavePresenter::needsSizeWarning | ( | const std::vector< std::string > & | wsNames | ) |
Find out if a project needs a save warning.
Check if the user needs to be warned about saving a large project.
wsNames | Vector of workspace names to check. |
Definition at line 60 of file ProjectSavePresenter.cpp.
References m_model, and MantidQt::MantidWidgets::ProjectSaveModel::needsSizeWarning().
void ProjectSavePresenter::notify | ( | Notification | notification | ) |
Notify the presenter to do something.
Notify the presenter to perform an action.
notification | :: notification to choose the action to perform |
Definition at line 40 of file ProjectSavePresenter.cpp.
References CheckWorkspace, excludeWindowsForUncheckedWorkspace(), includeWindowsForCheckedWorkspace(), PrepareProjectFolder, prepareProjectFolder(), and UncheckWorkspace.
|
private |
Prepare a project folder given the path.
Prepare a project folder for serialistion.
This will check the file path and if necessary create a new project folder
Definition at line 97 of file ProjectSavePresenter.cpp.
References MantidQt::MantidWidgets::IProjectSaveView::getProjectPath(), m_view, and MantidQt::MantidWidgets::IProjectSaveView::setProjectPath().
Referenced by notify().
|
private |
Hold an instance of the model.
Definition at line 49 of file ProjectSavePresenter.h.
Referenced by excludeWindowsForUncheckedWorkspace(), includeWindowsForCheckedWorkspace(), needsSizeWarning(), and ProjectSavePresenter().
|
private |
Handle to the view for this presenter.
Definition at line 47 of file ProjectSavePresenter.h.
Referenced by excludeWindowsForUncheckedWorkspace(), includeWindowsForCheckedWorkspace(), prepareProjectFolder(), and ProjectSavePresenter().