重新整理了类型的命名空间排布
This commit is contained in:
parent
748dbd2f0a
commit
7c631975b2
|
@ -8,5 +8,6 @@
|
||||||
|
|
||||||
using namespace Components;
|
using namespace Components;
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
using namespace Presents;
|
||||||
|
|
||||||
FilePresent::FilePresent(QObject *parent) : QObject(parent) {}
|
FilePresent::FilePresent(QObject *parent) : QObject(parent) {}
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace Core {
|
||||||
class DocumentsManager;
|
class DocumentsManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Components {
|
namespace Presents {
|
||||||
/**
|
/**
|
||||||
* @brief 内容编辑和呈现接口
|
* @brief 内容编辑和呈现接口
|
||||||
*/
|
*/
|
||||||
|
@ -121,8 +121,8 @@ namespace Components {
|
||||||
#define DECL_PRESENT(type) \
|
#define DECL_PRESENT(type) \
|
||||||
private: \
|
private: \
|
||||||
static QString file_suffix; \
|
static QString file_suffix; \
|
||||||
friend class Components::TypedPresentFactory<type>;
|
friend class Presents::TypedPresentFactory<type>;
|
||||||
|
|
||||||
} // namespace Components
|
} // namespace Presents
|
||||||
|
|
||||||
#endif // DOCSMANAGER_H
|
#endif // DOCSMANAGER_H
|
||||||
|
|
|
@ -26,10 +26,10 @@ SOURCES += \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
mainwindow.cpp \
|
mainwindow.cpp \
|
||||||
manager_docs.cpp \
|
manager_docs.cpp \
|
||||||
messagespresent.cpp \
|
messageview.cpp \
|
||||||
parsebridge.cpp \
|
parsebridge.cpp \
|
||||||
presentcontainer.cpp \
|
presentcontainer.cpp \
|
||||||
projectpresent.cpp \
|
projectview.cpp \
|
||||||
route.cpp \
|
route.cpp \
|
||||||
srcedit_defaulttext.cpp \
|
srcedit_defaulttext.cpp \
|
||||||
srcedit_storyboard.cpp \
|
srcedit_storyboard.cpp \
|
||||||
|
@ -47,11 +47,11 @@ HEADERS += \
|
||||||
# keywordshighlighter.h \
|
# keywordshighlighter.h \
|
||||||
mainwindow.h \
|
mainwindow.h \
|
||||||
manager_docs.h \
|
manager_docs.h \
|
||||||
messagespresent.h \
|
messageview.h \
|
||||||
opstream.h \
|
opstream.h \
|
||||||
parsebridge.h \
|
parsebridge.h \
|
||||||
presentcontainer.h \
|
presentcontainer.h \
|
||||||
projectpresent.h \
|
projectview.h \
|
||||||
route.h \
|
route.h \
|
||||||
srcedit_defaulttext.h \
|
srcedit_defaulttext.h \
|
||||||
srcedit_storyboard.h \
|
srcedit_storyboard.h \
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
using namespace CommandList;
|
using namespace CommandList;
|
||||||
using namespace Components;
|
using namespace Components;
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
using namespace Presents;
|
||||||
|
|
||||||
NewProject::NewProject(const QDir &dir, const QString &name) : dir_symbo(dir), name_val(name) {}
|
NewProject::NewProject(const QDir &dir, const QString &name) : dir_symbo(dir), name_val(name) {}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
namespace Components {
|
namespace Components {
|
||||||
class PresentHost;
|
class PresentHost;
|
||||||
|
}
|
||||||
|
namespace Presents {
|
||||||
class FilePresent;
|
class FilePresent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +117,7 @@ namespace CommandList {
|
||||||
// 切换视图组件 ================================================================
|
// 切换视图组件 ================================================================
|
||||||
class CompVisible : public Schedule::GeCommand {
|
class CompVisible : public Schedule::GeCommand {
|
||||||
public:
|
public:
|
||||||
CompVisible(Components::PresentHost *host, Components::FilePresent *target, bool state);
|
CompVisible(Components::PresentHost *host, Presents::FilePresent *target, bool state);
|
||||||
|
|
||||||
// GeCommand interface
|
// GeCommand interface
|
||||||
public:
|
public:
|
||||||
|
@ -126,7 +128,7 @@ namespace CommandList {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Components::PresentHost *host_ins;
|
Components::PresentHost *host_ins;
|
||||||
Components::FilePresent *target_ins;
|
Presents::FilePresent *target_ins;
|
||||||
Core::Route path;
|
Core::Route path;
|
||||||
bool state_val;
|
bool state_val;
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,10 +9,10 @@ namespace TestCase {
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
ContentPresentTest(Components::FilePresent *view);
|
ContentPresentTest(Presents::FilePresent *view);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Components::FilePresent *inst;
|
Presents::FilePresent *inst;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void test_Suffixes();
|
void test_Suffixes();
|
||||||
|
|
|
@ -39,7 +39,7 @@ MainWindow::MainWindow(const QString &layout, QWidget *parent)
|
||||||
session_service(new ViewSession(XApp::global_configration, this)),
|
session_service(new ViewSession(XApp::global_configration, this)),
|
||||||
views_bar(new ViewStackedBar(present_host, this)),
|
views_bar(new ViewStackedBar(present_host, this)),
|
||||||
center_frame(new PresentContainer(present_host, this)),
|
center_frame(new PresentContainer(present_host, this)),
|
||||||
project_present(new ProjectPresent(present_host, XApp::disp_core, active_docscollect, this)) {
|
project_present(new ProjectView(present_host, XApp::disp_core, active_docscollect, this)) {
|
||||||
|
|
||||||
QApplication::instance()->installEventFilter(this);
|
QApplication::instance()->installEventFilter(this);
|
||||||
initial_commandlist(XApp::disp_core);
|
initial_commandlist(XApp::disp_core);
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
|
|
||||||
#include "DocsManager.h"
|
#include "DocsManager.h"
|
||||||
#include "manager_docs.h"
|
#include "manager_docs.h"
|
||||||
#include "messagespresent.h"
|
#include "messageview.h"
|
||||||
#include "parsebridge.h"
|
#include "parsebridge.h"
|
||||||
#include "presentcontainer.h"
|
#include "presentcontainer.h"
|
||||||
#include "projectpresent.h"
|
#include "projectview.h"
|
||||||
#include "tools.h"
|
#include "tools.h"
|
||||||
#include "viewstackedbar.h"
|
|
||||||
#include "viewsession.h"
|
#include "viewsession.h"
|
||||||
|
#include "viewstackedbar.h"
|
||||||
#include "welcomepanel.h"
|
#include "welcomepanel.h"
|
||||||
#include <QListView>
|
#include <QListView>
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
@ -42,7 +42,7 @@ private:
|
||||||
// view =============================================
|
// view =============================================
|
||||||
Components::ViewStackedBar *const views_bar;
|
Components::ViewStackedBar *const views_bar;
|
||||||
Components::PresentContainer *const center_frame;
|
Components::PresentContainer *const center_frame;
|
||||||
Components::ProjectPresent *const project_present;
|
Components::ProjectView *const project_present;
|
||||||
|
|
||||||
// 内部逻辑 ===========================================
|
// 内部逻辑 ===========================================
|
||||||
void initial_menubar(QMenuBar *mbar);
|
void initial_menubar(QMenuBar *mbar);
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
using namespace Components;
|
using namespace Components;
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace Config;
|
using namespace Config;
|
||||||
|
using namespace Presents;
|
||||||
|
|
||||||
DocumentsManager::DocumentsManager(Project::ProjectManager *project) : pjtins(project) { initContentViewPlugins(); }
|
DocumentsManager::DocumentsManager(Project::ProjectManager *project) : pjtins(project) { initContentViewPlugins(); }
|
||||||
|
|
||||||
|
|
|
@ -27,29 +27,29 @@ namespace Components {
|
||||||
* @param vins
|
* @param vins
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
virtual bool avaliable(FilePresent *vins) = 0;
|
virtual bool avaliable(Presents::FilePresent *vins) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 添加内容展示实例
|
* @brief 添加内容展示实例
|
||||||
* @param ins
|
* @param ins
|
||||||
*/
|
*/
|
||||||
virtual void append(FilePresent *ins) = 0;
|
virtual void append(Presents::FilePresent *ins) = 0;
|
||||||
/**
|
/**
|
||||||
* @brief 激活内容展示实例
|
* @brief 激活内容展示实例
|
||||||
* @param ins
|
* @param ins
|
||||||
*/
|
*/
|
||||||
virtual bool active(const FilePresent *ins) = 0;
|
virtual bool active(const Presents::FilePresent *ins) = 0;
|
||||||
/**
|
/**
|
||||||
* @brief 移除内容展示实例
|
* @brief 移除内容展示实例
|
||||||
* @param ins
|
* @param ins
|
||||||
*/
|
*/
|
||||||
virtual void remove(const FilePresent *ins) = 0;
|
virtual void remove(const Presents::FilePresent *ins) = 0;
|
||||||
/**
|
/**
|
||||||
* @brief 是否包含指定
|
* @brief 是否包含指定
|
||||||
* @param ins
|
* @param ins
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
virtual bool contains(const FilePresent *ins) const = 0;
|
virtual bool contains(const Presents::FilePresent *ins) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Components
|
} // namespace Components
|
||||||
|
@ -87,8 +87,8 @@ namespace Core {
|
||||||
* @brief 注册插件类型
|
* @brief 注册插件类型
|
||||||
* @param ins 插件工厂实例
|
* @param ins 插件工厂实例
|
||||||
*/
|
*/
|
||||||
template <class PresentType> void registPresentType(Components::TypedPresentFactory<PresentType> *ins) {
|
template <class PresentType> void registPresentType(Presents::TypedPresentFactory<PresentType> *ins) {
|
||||||
auto suffix = Components::TypedPresentFactory<PresentType>::suffix();
|
auto suffix = Presents::TypedPresentFactory<PresentType>::suffix();
|
||||||
factory_map[suffix] = ins;
|
factory_map[suffix] = ins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,13 +161,13 @@ namespace Core {
|
||||||
* @param ins 打开的实例
|
* @param ins 打开的实例
|
||||||
* @return 实例路径
|
* @return 实例路径
|
||||||
*/
|
*/
|
||||||
Core::Route convertPresent(Components::FilePresent *ins) const;
|
Core::Route convertPresent(Presents::FilePresent *ins) const;
|
||||||
/**
|
/**
|
||||||
* @brief 获取打开的内容展示实例,如果指向未打开的节点或无效文件节点,返回null
|
* @brief 获取打开的内容展示实例,如果指向未打开的节点或无效文件节点,返回null
|
||||||
* @param node_path 节点路径
|
* @param node_path 节点路径
|
||||||
* @return null或打开的展示实例
|
* @return null或打开的展示实例
|
||||||
*/
|
*/
|
||||||
Components::FilePresent *convertPresent(const Core::Route &node_path);
|
Presents::FilePresent *convertPresent(const Core::Route &node_path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 获取打开的活跃文档
|
* @brief 获取打开的活跃文档
|
||||||
|
@ -191,8 +191,8 @@ namespace Core {
|
||||||
Project::ProjectManager *pjtins;
|
Project::ProjectManager *pjtins;
|
||||||
QList<Components::PresentHost *> present_ui;
|
QList<Components::PresentHost *> present_ui;
|
||||||
|
|
||||||
QHash<QString, Components::PresentFactory *> factory_map;
|
QHash<QString, Presents::PresentFactory *> factory_map;
|
||||||
QHash<Core::Route, Components::FilePresent *> doc_openning;
|
QHash<Core::Route, Presents::FilePresent *> doc_openning;
|
||||||
};
|
};
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
#include "messagespresent.h"
|
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
|
|
||||||
using namespace Components;
|
|
||||||
using namespace SplitFrame;
|
|
||||||
|
|
||||||
QHash<SplitFrame::ViewPresent *, MessagesPresent *> MessagesPresent::panel_map;
|
|
||||||
|
|
||||||
MessagesPresent::MessagesPresent(SplitFrame::ViewPresent *ins, QStandardItemModel *base, QWidget *parent)
|
|
||||||
: FnWrap<MessagesPresent, false>(ins, parent), ui_present(new QTableView(this)), items_present(base) {
|
|
||||||
auto layout = new QVBoxLayout(this);
|
|
||||||
layout->setMargin(0);
|
|
||||||
layout->setSpacing(0);
|
|
||||||
|
|
||||||
layout->addWidget(ui_present);
|
|
||||||
ui_present->setModel(items_present);
|
|
||||||
}
|
|
||||||
|
|
||||||
MessagesPresent *MessagesPresent::gen(SplitFrame::ViewPresent *host, QStandardItemModel *base, QWidget *parent) {
|
|
||||||
if (panel_map.contains(host))
|
|
||||||
return panel_map[host];
|
|
||||||
|
|
||||||
auto vins = new MessagesPresent(host, base, parent);
|
|
||||||
panel_map[host] = vins;
|
|
||||||
return vins;
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
#ifndef MESSAGEPRESENT_H
|
|
||||||
#define MESSAGEPRESENT_H
|
|
||||||
|
|
||||||
#include "DocsManager.h"
|
|
||||||
#include <QHash>
|
|
||||||
#include <QStandardItemModel>
|
|
||||||
#include <QTableView>
|
|
||||||
#include <splitpanel.h>
|
|
||||||
|
|
||||||
namespace Components {
|
|
||||||
/**
|
|
||||||
* @brief 显示各种提示信息
|
|
||||||
*/
|
|
||||||
class MessagesPresent : public SplitFrame::FnWrap<MessagesPresent, false> {
|
|
||||||
public:
|
|
||||||
virtual ~MessagesPresent() = default;
|
|
||||||
|
|
||||||
static MessagesPresent *gen(SplitFrame::ViewPresent *host, QStandardItemModel *base, QWidget *parent = nullptr);
|
|
||||||
|
|
||||||
private:
|
|
||||||
MessagesPresent(SplitFrame::ViewPresent *ins, QStandardItemModel *base, QWidget *parent = nullptr);
|
|
||||||
|
|
||||||
QTableView *const ui_present;
|
|
||||||
QStandardItemModel *const items_present;
|
|
||||||
static QHash<SplitFrame::ViewPresent *, MessagesPresent *> panel_map;
|
|
||||||
};
|
|
||||||
} // namespace Components
|
|
||||||
|
|
||||||
#endif // MESSAGEPRESENT_H
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
#include "messageview.h"
|
||||||
|
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
using namespace Components;
|
||||||
|
using namespace SplitFrame;
|
||||||
|
|
||||||
|
QHash<SplitFrame::ViewPresent *, MessageView *> MessageView::panel_map;
|
||||||
|
|
||||||
|
MessageView::MessageView(SplitFrame::ViewPresent *ins, QStandardItemModel *base, QWidget *parent)
|
||||||
|
: FnWrap<MessageView, false>(ins, parent), ui_present(new QTableView(this)), items_present(base) {
|
||||||
|
auto layout = new QVBoxLayout(this);
|
||||||
|
layout->setMargin(0);
|
||||||
|
layout->setSpacing(0);
|
||||||
|
|
||||||
|
layout->addWidget(ui_present);
|
||||||
|
ui_present->setModel(items_present);
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageView *MessageView::gen(SplitFrame::ViewPresent *host, QStandardItemModel *base, QWidget *parent) {
|
||||||
|
if (panel_map.contains(host))
|
||||||
|
return panel_map[host];
|
||||||
|
|
||||||
|
auto vins = new MessageView(host, base, parent);
|
||||||
|
panel_map[host] = vins;
|
||||||
|
return vins;
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
#ifndef MESSAGEVIEW_H
|
||||||
|
#define MESSAGEVIEW_H
|
||||||
|
|
||||||
|
#include "DocsManager.h"
|
||||||
|
#include <QHash>
|
||||||
|
#include <QStandardItemModel>
|
||||||
|
#include <QTableView>
|
||||||
|
#include <splitpanel.h>
|
||||||
|
|
||||||
|
namespace Components {
|
||||||
|
/**
|
||||||
|
* @brief 显示各种提示信息
|
||||||
|
*/
|
||||||
|
class MessageView : public SplitFrame::FnWrap<MessageView, false> {
|
||||||
|
public:
|
||||||
|
virtual ~MessageView() = default;
|
||||||
|
|
||||||
|
static MessageView *gen(SplitFrame::ViewPresent *host, QStandardItemModel *base, QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
private:
|
||||||
|
MessageView(SplitFrame::ViewPresent *ins, QStandardItemModel *base, QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
QTableView *const ui_present;
|
||||||
|
QStandardItemModel *const items_present;
|
||||||
|
static QHash<SplitFrame::ViewPresent *, MessageView *> panel_map;
|
||||||
|
};
|
||||||
|
} // namespace Components
|
||||||
|
|
||||||
|
#endif // MESSAGEVIEW_H
|
|
@ -11,6 +11,7 @@
|
||||||
using namespace Components;
|
using namespace Components;
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace SplitFrame;
|
using namespace SplitFrame;
|
||||||
|
using namespace Presents;
|
||||||
|
|
||||||
PresentContainer::PresentContainer(ViewPresent *host, QWidget *parent)
|
PresentContainer::PresentContainer(ViewPresent *host, QWidget *parent)
|
||||||
: FnWrap<PresentContainer, true>(host, parent),
|
: FnWrap<PresentContainer, true>(host, parent),
|
||||||
|
|
|
@ -21,14 +21,14 @@ namespace Components {
|
||||||
public:
|
public:
|
||||||
virtual QWidget *hostWidget() const override;
|
virtual QWidget *hostWidget() const override;
|
||||||
|
|
||||||
virtual void append(FilePresent *ins) override;
|
virtual void append(Presents::FilePresent *ins) override;
|
||||||
virtual bool active(const FilePresent *ins) override;
|
virtual bool active(const Presents::FilePresent *ins) override;
|
||||||
virtual void remove(const FilePresent *ins) override;
|
virtual void remove(const Presents::FilePresent *ins) override;
|
||||||
virtual bool contains(const FilePresent *ins) const override;
|
virtual bool contains(const Presents::FilePresent *ins) const override;
|
||||||
virtual bool avaliable(FilePresent *vins) override;
|
virtual bool avaliable(Presents::FilePresent *vins) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<const FilePresent *> items_store;
|
QList<const Presents::FilePresent *> items_store;
|
||||||
QComboBox *const title_store;
|
QComboBox *const title_store;
|
||||||
QStackedWidget *const stack_container;
|
QStackedWidget *const stack_container;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "projectpresent.h"
|
#include "projectview.h"
|
||||||
#include "command_list.h"
|
#include "command_list.h"
|
||||||
|
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
|
@ -11,8 +11,8 @@ using namespace Schedule;
|
||||||
using namespace SplitFrame;
|
using namespace SplitFrame;
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
|
||||||
ProjectPresent::ProjectPresent(ViewPresent *host, CommandsDispatcher *core, Core::DocumentsManager *mgr, QWidget *parent)
|
ProjectView::ProjectView(ViewPresent *host, CommandsDispatcher *core, Core::DocumentsManager *mgr, QWidget *parent)
|
||||||
: FnWrap<ProjectPresent, false>(host, parent), project_manager(mgr), source(core), view_present(new QTreeView(this)) {
|
: FnWrap<ProjectView, false>(host, parent), project_manager(mgr), source(core), view_present(new QTreeView(this)) {
|
||||||
auto layout = new QVBoxLayout(this);
|
auto layout = new QVBoxLayout(this);
|
||||||
layout->addWidget(view_present);
|
layout->addWidget(view_present);
|
||||||
layout->setMargin(1);
|
layout->setMargin(1);
|
||||||
|
@ -22,14 +22,14 @@ ProjectPresent::ProjectPresent(ViewPresent *host, CommandsDispatcher *core, Core
|
||||||
|
|
||||||
view_present->setContextMenuPolicy(Qt::CustomContextMenu);
|
view_present->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(view_present, &QTreeView::customContextMenuRequested,
|
connect(view_present, &QTreeView::customContextMenuRequested,
|
||||||
this, &ProjectPresent::menu_popup);
|
this, &ProjectView::menu_popup);
|
||||||
connect(view_present, &QTreeView::doubleClicked,
|
connect(view_present, &QTreeView::doubleClicked,
|
||||||
this, &ProjectPresent::open_target);
|
this, &ProjectView::open_target);
|
||||||
}
|
}
|
||||||
|
|
||||||
QModelIndex ProjectPresent::currentIndex() const { return view_present->currentIndex(); }
|
QModelIndex ProjectView::currentIndex() const { return view_present->currentIndex(); }
|
||||||
|
|
||||||
void ProjectPresent::menu_popup(const QPoint &p)
|
void ProjectView::menu_popup(const QPoint &p)
|
||||||
{
|
{
|
||||||
QMenu m;
|
QMenu m;
|
||||||
m.addAction("新建路径", [this](){
|
m.addAction("新建路径", [this](){
|
||||||
|
@ -61,11 +61,11 @@ void ProjectPresent::menu_popup(const QPoint &p)
|
||||||
m.exec(mapToGlobal(p));
|
m.exec(mapToGlobal(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectPresent::open_target(const QModelIndex &t)
|
void ProjectView::open_target(const QModelIndex &t)
|
||||||
{
|
{
|
||||||
auto mgr = source->get<DocumentsManager>(NAME(DocumentsManager));
|
auto mgr = source->get<DocumentsManager>(NAME(DocumentsManager));
|
||||||
auto path = mgr->convertPath(t);
|
auto path = mgr->convertPath(t);
|
||||||
source->postCommand(OpenFile(path));
|
source->postCommand(OpenFile(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectPresent::closeProcess() { project_manager->save(); }
|
void ProjectView::closeProcess() { project_manager->save(); }
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef PROJECTPRESENT_H
|
#ifndef PROJECTVIEW_H
|
||||||
#define PROJECTPRESENT_H
|
#define PROJECTVIEW_H
|
||||||
|
|
||||||
#include "DocsManager.h"
|
#include "DocsManager.h"
|
||||||
#include "manager_docs.h"
|
#include "manager_docs.h"
|
||||||
|
@ -14,11 +14,11 @@ namespace Components {
|
||||||
/**
|
/**
|
||||||
* @brief 项目视图
|
* @brief 项目视图
|
||||||
*/
|
*/
|
||||||
class ProjectPresent : public SplitFrame::FnWrap<ProjectPresent, false> {
|
class ProjectView : public SplitFrame::FnWrap<ProjectView, false> {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit ProjectPresent(SplitFrame::ViewPresent *host, Schedule::CommandsDispatcher *core, Core::DocumentsManager *mgr,
|
explicit ProjectView(SplitFrame::ViewPresent *host, Schedule::CommandsDispatcher *core, Core::DocumentsManager *mgr,
|
||||||
QWidget *parent = nullptr);
|
QWidget *parent = nullptr);
|
||||||
|
|
||||||
QModelIndex currentIndex() const;
|
QModelIndex currentIndex() const;
|
||||||
|
|
||||||
|
@ -36,5 +36,4 @@ namespace Components {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // PROJECTVIEW_H
|
||||||
#endif // PROJECTPRESENT_H
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <libConfig.h>
|
#include <libConfig.h>
|
||||||
|
|
||||||
using namespace Components;
|
using namespace Presents;
|
||||||
using namespace Enhancement;
|
using namespace Enhancement;
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace Config;
|
using namespace Config;
|
||||||
|
|
|
@ -7,12 +7,12 @@
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
|
|
||||||
namespace Components {
|
namespace Presents {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Text默认文本编辑视图
|
* @brief Text默认文本编辑视图
|
||||||
*/
|
*/
|
||||||
class DefaultTextEdit : public Components::FilePresent {
|
class DefaultTextEdit : public Presents::FilePresent {
|
||||||
DECL_PRESENT(DefaultTextEdit);
|
DECL_PRESENT(DefaultTextEdit);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -46,7 +46,7 @@ namespace Components {
|
||||||
virtual Core::DocumentsManager *docsManager() const override;
|
virtual Core::DocumentsManager *docsManager() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DefaultTextEditFactory : public Components::TypedPresentFactory<DefaultTextEdit> {
|
class DefaultTextEditFactory : public Presents::TypedPresentFactory<DefaultTextEdit> {
|
||||||
public:
|
public:
|
||||||
virtual ~DefaultTextEditFactory() = default;
|
virtual ~DefaultTextEditFactory() = default;
|
||||||
|
|
||||||
|
@ -54,6 +54,6 @@ namespace Components {
|
||||||
public:
|
public:
|
||||||
virtual void create(const QFileInfo &target) override;
|
virtual void create(const QFileInfo &target) override;
|
||||||
};
|
};
|
||||||
} // namespace Components
|
} // namespace Presents
|
||||||
|
|
||||||
#endif // SRCEDIT_DEFAULTTEXT_H
|
#endif // SRCEDIT_DEFAULTTEXT_H
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
using namespace Components;
|
|
||||||
using namespace Enhancement;
|
using namespace Enhancement;
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace Config;
|
using namespace Config;
|
||||||
|
using namespace Presents;
|
||||||
|
|
||||||
QString StorySourceEdit::file_suffix = "storyboard";
|
QString StorySourceEdit::file_suffix = "storyboard";
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,8 @@
|
||||||
#include "keywordshighlighter.h"
|
#include "keywordshighlighter.h"
|
||||||
|
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <docsManager.h>
|
|
||||||
|
|
||||||
namespace Components {
|
namespace Presents {
|
||||||
|
|
||||||
class StorySourceEdit : public FilePresent, public Enhancement::HighlightFeature {
|
class StorySourceEdit : public FilePresent, public Enhancement::HighlightFeature {
|
||||||
DECL_PRESENT(StorySourceEdit);
|
DECL_PRESENT(StorySourceEdit);
|
||||||
|
@ -45,13 +44,13 @@ namespace Components {
|
||||||
virtual Core::Route accessPath() const override;
|
virtual Core::Route accessPath() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class StorySourceEditFactory : public TypedPresentFactory<StorySourceEdit> {
|
class StorySourceEditFactory : public Presents::TypedPresentFactory<StorySourceEdit> {
|
||||||
|
|
||||||
// PresentFactory interface
|
// PresentFactory interface
|
||||||
public:
|
public:
|
||||||
virtual void create(const QFileInfo &target) override;
|
virtual void create(const QFileInfo &target) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Components
|
} // namespace Presents
|
||||||
|
|
||||||
#endif // SRCEDIT_STORYBOARD_H
|
#endif // SRCEDIT_STORYBOARD_H
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#include "viewsession.h"
|
#include "viewsession.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "messagespresent.h"
|
#include "messageview.h"
|
||||||
#include "presentcontainer.h"
|
#include "presentcontainer.h"
|
||||||
#include "projectpresent.h"
|
#include "projectview.h"
|
||||||
|
|
||||||
using namespace Config;
|
using namespace Config;
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
@ -13,7 +13,7 @@ ViewSession::ViewSession(Config::Configration *port, MainWindow *host) : host(ho
|
||||||
base_path = {"sys-config", "front-end", host->layoutName(), "view-state"};
|
base_path = {"sys-config", "front-end", host->layoutName(), "view-state"};
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewSession::initPresentView(PresentContainer *center_frame, ProjectPresent *project_present, QStandardItemModel *error_model) {
|
void ViewSession::initPresentView(PresentContainer *center_frame, ProjectView *project_present, QStandardItemModel *error_model) {
|
||||||
split_infos.clear();
|
split_infos.clear();
|
||||||
|
|
||||||
auto project_panel = host->appendView(project_present, QIcon(":/ui/icons/dir_icon.jpg"), tr("项目管理"));
|
auto project_panel = host->appendView(project_present, QIcon(":/ui/icons/dir_icon.jpg"), tr("项目管理"));
|
||||||
|
@ -23,7 +23,7 @@ void ViewSession::initPresentView(PresentContainer *center_frame, ProjectPresent
|
||||||
edit_panel = host->appendView(center_frame, QIcon(":/ui/icons/file_icon.jpg"), tr("编辑窗口"));
|
edit_panel = host->appendView(center_frame, QIcon(":/ui/icons/file_icon.jpg"), tr("编辑窗口"));
|
||||||
view_store[edit_panel->title()] = edit_panel;
|
view_store[edit_panel->title()] = edit_panel;
|
||||||
|
|
||||||
auto msg_view = MessagesPresent::gen(host, error_model, host->bind());
|
auto msg_view = MessageView::gen(host, error_model, host->bind());
|
||||||
auto msg_panel = host->appendView(msg_view, QIcon(":/ui/icons/file_icon.jpg"), "信息提示");
|
auto msg_panel = host->appendView(msg_view, QIcon(":/ui/icons/file_icon.jpg"), "信息提示");
|
||||||
host->markFreedom(msg_panel);
|
host->markFreedom(msg_panel);
|
||||||
view_store[msg_panel->title()] = msg_panel;
|
view_store[msg_panel->title()] = msg_panel;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef VIEWSESSION_H
|
#ifndef VIEWSESSION_H
|
||||||
#define VIEWSESSION_H
|
#define VIEWSESSION_H
|
||||||
|
|
||||||
#include "projectpresent.h"
|
#include "projectview.h"
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
@ -18,7 +18,7 @@ namespace Core {
|
||||||
public:
|
public:
|
||||||
ViewSession(Config::Configration *port, MainWindow *host);
|
ViewSession(Config::Configration *port, MainWindow *host);
|
||||||
|
|
||||||
void initPresentView(Components::PresentContainer *center_frame, Components::ProjectPresent *project_present, QStandardItemModel *model);
|
void initPresentView(Components::PresentContainer *center_frame, Components::ProjectView *project_present, QStandardItemModel *model);
|
||||||
|
|
||||||
void viewStatesSave(QMainWindow *win, SplitFrame::ViewPresent *root);
|
void viewStatesSave(QMainWindow *win, SplitFrame::ViewPresent *root);
|
||||||
void viewStatesRestore(QMainWindow *win, SplitFrame::ViewPresent *root);
|
void viewStatesRestore(QMainWindow *win, SplitFrame::ViewPresent *root);
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
using namespace Components;
|
using namespace Components;
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
using namespace Presents;
|
||||||
|
|
||||||
WelcomePanel::WelcomePanel(QWidget *parent) : QWidget(parent) {}
|
WelcomePanel::WelcomePanel(QWidget *parent) : QWidget(parent) {}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
namespace Components {
|
namespace Components {
|
||||||
|
|
||||||
class WelcomePanel : public QWidget, public Components::FilePresent {
|
class WelcomePanel : public QWidget, public Presents::FilePresent {
|
||||||
public:
|
public:
|
||||||
WelcomePanel(QWidget *parent = nullptr);
|
WelcomePanel(QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue