Mantid
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
MantidQt::MantidWidgets::ProjectSavePresenter Class Reference

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...
 
IProjectSaveViewm_view
 Handle to the view for this presenter. More...
 

Detailed Description

Implements a presenter for the project saving dialog.

Definition at line 25 of file ProjectSavePresenter.h.

Member Enumeration Documentation

◆ Notification

Enumerator
UncheckWorkspace 
CheckWorkspace 
PrepareProjectFolder 

Definition at line 27 of file ProjectSavePresenter.h.

Constructor & Destructor Documentation

◆ ProjectSavePresenter()

ProjectSavePresenter::ProjectSavePresenter ( IProjectSaveView view)

Member Function Documentation

◆ excludeWindowsForUncheckedWorkspace()

void ProjectSavePresenter::excludeWindowsForUncheckedWorkspace ( )
private

◆ includeWindowsForCheckedWorkspace()

void ProjectSavePresenter::includeWindowsForCheckedWorkspace ( )
private

◆ needsSizeWarning()

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.

Parameters
wsNamesVector of workspace names to check.
Returns
true If a warning is required.
false If a warning is not neccessary.

Definition at line 60 of file ProjectSavePresenter.cpp.

References m_model, and MantidQt::MantidWidgets::ProjectSaveModel::needsSizeWarning().

◆ notify()

void ProjectSavePresenter::notify ( Notification  notification)

Notify the presenter to do something.

Notify the presenter to perform an action.

Parameters
notification:: notification to choose the action to perform

Definition at line 40 of file ProjectSavePresenter.cpp.

References CheckWorkspace, excludeWindowsForUncheckedWorkspace(), includeWindowsForCheckedWorkspace(), PrepareProjectFolder, prepareProjectFolder(), and UncheckWorkspace.

◆ prepareProjectFolder()

void ProjectSavePresenter::prepareProjectFolder ( )
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().

Member Data Documentation

◆ m_model

ProjectSaveModel MantidQt::MantidWidgets::ProjectSavePresenter::m_model
private

◆ m_view

IProjectSaveView* MantidQt::MantidWidgets::ProjectSavePresenter::m_view
private

Handle to the view for this presenter.

Definition at line 47 of file ProjectSavePresenter.h.

Referenced by excludeWindowsForUncheckedWorkspace(), includeWindowsForCheckedWorkspace(), prepareProjectFolder(), and ProjectSavePresenter().


The documentation for this class was generated from the following files: