15 #ifndef BORNAGAIN_GUI_VIEW_PROJECT_PROJECTMANAGER_H
16 #define BORNAGAIN_GUI_VIEW_PROJECT_PROJECTMANAGER_H
20 #include <QStringList>
Defines class ProjectDocument.
The service to collect messages from different senders.
Handles activity related to opening/save projects.
bool saveProject(QString projectFileName="")
Processes save project request.
void setRecentlyUsedImportFilter1D(const QString &filter)
void createNewProject()
Calls dialog window to define project path and name.
void deleteCurrentProject()
void recentListModified()
QString untitledProjectName()
Will return 'Untitled' if the directory with such name doesn't exist in project path....
ProjectDocument::ReadResult loadProject(const QString &projectFileName, MessageService &messageService)
Load project data from file name. If autosave info exists, opens dialog for project restore.
void aboutToCloseDocument()
ProjectManager(QObject *parent)
static ProjectManager * instance()
QString m_importFilter2D
Recently used import filter for 2D files.
void riseProjectLoadProblemDialog(const MessageService &messageService)
QStringList m_recentProjects
void clearRecentProjects()
Clears list of recent projects.
void setAutosaveEnabled(bool value)
QString acquireProjectFileName()
Returns project file name from dialog. Returns empty string if dialog was canceled.
void setImportDirFromFilePath(const QString &filePath)
Sets user import directory in system settings.
QString recentlyUsedImportFilter2D() const
SaveService * m_saveService
void addToRecentProjects()
Add name of the current project to the name of recent projects.
QString m_importDirectory
void setRecentlyUsedImportFilter2D(const QString &filter)
bool closeCurrentProject()
Processes close current project request. Call save/discard/cancel dialog, if necessary....
void readSettings()
Reads settings of ProjectManager from global settings.
QString m_workingDirectory
Name of directory from there user prefer to import files.
void openProject(QString fileName="")
Opens existing project. If fileName is empty, will popup file selection dialog.
void setImportDir(const QString &dirname)
Sets user import directory in system settings.
QString userImportDir() const
Returns directory name which was used by the user to import files.
~ProjectManager() override
bool isAutosaveEnabled() const
static ProjectManager * s_instance
void newProject()
Processes new project request (close old project, rise dialog for project name, create project).
bool saveProjectAs()
Processes 'save project as' request.
QStringList recentProjects()
Returns list of recent projects, validates if projects still exists on disk.
QString m_importFilter1D
Recently used import filter for 1D files.
QString projectDir() const
Returns name of the current project directory.
void documentOpenedOrClosed(bool opened)
QString workingDirectory()
Returns default project path.
QString recentlyUsedImportFilter1D() const
bool restoreProjectDialog(const QString &projectFileName, QString autosaveName)
Name of directory where project directory was created.
void writeSettings()
Saves settings of ProjectManager in global settings.
void riseProjectLoadFailedDialog(const MessageService &messageService)
Provides save/autosave of ProjectDocument in a thread.
QString autosaveName(const QString &projectFileName)
Returns name of project for autoSave from given project file name. E.g. from '/projects/Untitled2/Unt...