23 #include <QMainWindow>
32 , m_userInteractor(
std::make_unique<
UserInteractor>(m_recentProjectSettings.get(), parent))
91 ProjectContext project_context{modified_callback, models_callback};
93 auto select_dir_callback = [
this]() {
return m_userInteractor->onSelectDirRequest(); };
94 auto create_dir_callback = [
this]() {
return m_userInteractor->onCreateDirRequest(); };
95 auto answer_callback = [
this]() {
return m_userInteractor->onSaveChangesRequest(); };
105 const auto current_project_dir = QString::fromStdString(
m_projectManager->currentProjectDir());
111 main_window->setWindowTitle(title);
Main class to holds all models of GUI session.
std::vector< ModelView::SessionModel * > persistent_models() const override
Returns vector of models intended for saving on disk.
ApplicationModels * m_models
std::unique_ptr< ModelView::ProjectManagerInterface > m_projectManager
void recentProjectsListModified(const QStringList &projects)
void initProjectManager()
void onSaveCurrentProject()
void onCreateNewProject()
void updateCurrentProjectName()
Updates the name of the current project on main window, notifies the world.
void onOpenExistingProject(const QString &dirname={})
std::unique_ptr< RecentProjectSettings > m_recentProjectSettings
void updateRecentProjectNames()
Update recent project list in settings, notifies the world.
~ProjectHandler() override
bool canCloseProject() const
Returns 'true' if current project can be closed.
void clearRecentProjectsList()
std::unique_ptr< UserInteractor > m_userInteractor
void currentProjectModified(const QString &project_dir, bool is_modified)
void updateNames()
Update names (name of the current project, recent project name list, notifies the world).
Collection of settings for RecentProjectWidget.
Provide save/discard/cancel and similar dialogs on user request.
MVVM_VIEW_EXPORT QMainWindow * FindMainWindow()
Finds main window.
MVVM_VIEW_EXPORT QString ProjectWindowTitle(const QString &project_dir, bool is_modified)
Returns a title composed from last part of project path, and is_modified flag.
materialitems.h Collection of materials to populate MaterialModel.
std::unique_ptr< ProjectManagerInterface > CreateProjectManager(const ProjectContext &project_context, const UserInteractionContext &user_context)
Creates default ProjectManager to save and load models.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Provides necessary information for Project construction.
Defines the context to interact with the user regarding save/save-as/create-new project scenarious.