修改SplitView之前
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE QtCreatorProject>
|
<!DOCTYPE QtCreatorProject>
|
||||||
<!-- Written by QtCreator 4.15.0, 2023-09-08T22:11:48. -->
|
<!-- Written by QtCreator 4.15.0, 2023-12-22T22:09:13. -->
|
||||||
<qtcreator>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>EnvironmentId</variable>
|
<variable>EnvironmentId</variable>
|
||||||
|
|
@ -94,16 +94,16 @@
|
||||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||||
<valuemap type="QVariantMap">
|
<valuemap type="QVariantMap">
|
||||||
<value type="QString" key="DeviceType">Desktop</value>
|
<value type="QString" key="DeviceType">Desktop</value>
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.12.11 MSVC2017 64bit</value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.12.11 MinGW 64-bit</value>
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.12.11 MSVC2017 64bit</value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.12.11 MinGW 64-bit</value>
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.51211.win64_msvc2017_64_kit</value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.51211.win64_mingw73_kit</value>
|
||||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">1</value>
|
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">1</value>
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||||
<value type="int" key="EnableQmlDebugging">0</value>
|
<value type="int" key="EnableQmlDebugging">0</value>
|
||||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\Projects\Cpp\build-QtNovelDesc-Desktop_Qt_5_12_11_MSVC2017_64bit-Debug</value>
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\Projects\Cpp\build-QtNovelDesc-Desktop_Qt_5_12_11_MinGW_64_bit-Debug</value>
|
||||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/Projects/Cpp/build-QtNovelDesc-Desktop_Qt_5_12_11_MSVC2017_64bit-Debug</value>
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/Projects/Cpp/build-QtNovelDesc-Desktop_Qt_5_12_11_MinGW_64_bit-Debug</value>
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
|
@ -140,8 +140,8 @@
|
||||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
|
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
|
||||||
</valuemap>
|
</valuemap>
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\Projects\Cpp\build-QtNovelDesc-Desktop_Qt_5_12_11_MSVC2017_64bit-Release</value>
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\Projects\Cpp\build-QtNovelDesc-Desktop_Qt_5_12_11_MinGW_64_bit-Release</value>
|
||||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/Projects/Cpp/build-QtNovelDesc-Desktop_Qt_5_12_11_MSVC2017_64bit-Release</value>
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/Projects/Cpp/build-QtNovelDesc-Desktop_Qt_5_12_11_MinGW_64_bit-Release</value>
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
|
@ -180,8 +180,8 @@
|
||||||
</valuemap>
|
</valuemap>
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||||
<value type="int" key="EnableQmlDebugging">0</value>
|
<value type="int" key="EnableQmlDebugging">0</value>
|
||||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\Projects\Cpp\build-QtNovelDesc-Desktop_Qt_5_12_11_MSVC2017_64bit-Profile</value>
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\Projects\Cpp\build-QtNovelDesc-Desktop_Qt_5_12_11_MinGW_64_bit-Profile</value>
|
||||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/Projects/Cpp/build-QtNovelDesc-Desktop_Qt_5_12_11_MSVC2017_64bit-Profile</value>
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/Projects/Cpp/build-QtNovelDesc-Desktop_Qt_5_12_11_MinGW_64_bit-Profile</value>
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
|
@ -304,7 +304,7 @@
|
||||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">D:/Projects/Cpp/build-QtNovelDesc-Desktop_Qt_5_12_11_MSVC2017_64bit-Debug/u_test</value>
|
<value type="QString" key="RunConfiguration.WorkingDirectory.default">D:/Projects/Cpp/build-QtNovelDesc-Desktop_Qt_5_12_11_MinGW_64_bit-Debug/u_test</value>
|
||||||
</valuemap>
|
</valuemap>
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
|
||||||
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
|
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
|
||||||
|
|
@ -377,7 +377,7 @@
|
||||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">D:/Projects/Cpp/build-QtNovelDesc-Desktop_Qt_5_12_11_MSVC2017_64bit-Debug/WordsIDE</value>
|
<value type="QString" key="RunConfiguration.WorkingDirectory.default">D:/Projects/Cpp/build-QtNovelDesc-Desktop_Qt_5_12_11_MinGW_64_bit-Debug/WordsIDE</value>
|
||||||
</valuemap>
|
</valuemap>
|
||||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value>
|
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value>
|
||||||
</valuemap>
|
</valuemap>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
#ifndef DOCSMANAGER_H
|
#ifndef DOCSMANAGER_H
|
||||||
#define DOCSMANAGER_H
|
#define DOCSMANAGER_H
|
||||||
|
|
||||||
#include "appcore.h"
|
|
||||||
#include "route.h"
|
#include "route.h"
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ msvc {
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
DocsManager.cpp \
|
DocsManager.cpp \
|
||||||
appcore.cpp \
|
|
||||||
command_list.cpp \
|
command_list.cpp \
|
||||||
# contentpresenttest.cpp \
|
# contentpresenttest.cpp \
|
||||||
# keywordshighlighter.cpp \
|
# keywordshighlighter.cpp \
|
||||||
|
|
@ -33,7 +32,6 @@ SOURCES += \
|
||||||
route.cpp \
|
route.cpp \
|
||||||
srcedit_defaulttext.cpp \
|
srcedit_defaulttext.cpp \
|
||||||
srcedit_storyboard.cpp \
|
srcedit_storyboard.cpp \
|
||||||
tools.cpp \
|
|
||||||
viewsession.cpp \
|
viewsession.cpp \
|
||||||
viewstackedbar.cpp \
|
viewstackedbar.cpp \
|
||||||
welcomepanel.cpp \
|
welcomepanel.cpp \
|
||||||
|
|
@ -41,7 +39,6 @@ SOURCES += \
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
DocsManager.h \
|
DocsManager.h \
|
||||||
appcore.h \
|
|
||||||
command_list.h \
|
command_list.h \
|
||||||
# contentpresenttest.h \
|
# contentpresenttest.h \
|
||||||
# keywordshighlighter.h \
|
# keywordshighlighter.h \
|
||||||
|
|
@ -54,7 +51,6 @@ HEADERS += \
|
||||||
route.h \
|
route.h \
|
||||||
srcedit_defaulttext.h \
|
srcedit_defaulttext.h \
|
||||||
srcedit_storyboard.h \
|
srcedit_storyboard.h \
|
||||||
tools.h \
|
|
||||||
viewsession.h \
|
viewsession.h \
|
||||||
viewstackedbar.h \
|
viewstackedbar.h \
|
||||||
welcomepanel.h \
|
welcomepanel.h \
|
||||||
|
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
#include "appcore.h"
|
|
||||||
#include "DocsManager.h"
|
|
||||||
#include "mainwindow.h"
|
|
||||||
#include "manager_docs.h"
|
|
||||||
#include "srcedit_storyboard.h"
|
|
||||||
#include "xapp.h"
|
|
||||||
#include "xmlconfig.h"
|
|
||||||
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QTextStream>
|
|
||||||
|
|
||||||
using namespace Core;
|
|
||||||
using namespace Components;
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
#ifndef APPCORE_H
|
|
||||||
#define APPCORE_H
|
|
||||||
|
|
||||||
#include <QMenu>
|
|
||||||
#include <QObject>
|
|
||||||
#include <commandsdispatcher.h>
|
|
||||||
#include <libConfig.h>
|
|
||||||
#include <libProjectManager.h>
|
|
||||||
|
|
||||||
namespace Core {
|
|
||||||
|
|
||||||
enum class Scale
|
|
||||||
{
|
|
||||||
Global,
|
|
||||||
Project,
|
|
||||||
File,
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // APPCORE_H
|
|
||||||
|
|
@ -24,7 +24,6 @@
|
||||||
using namespace Project;
|
using namespace Project;
|
||||||
using namespace Components;
|
using namespace Components;
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace Tools;
|
|
||||||
using namespace CommandList;
|
using namespace CommandList;
|
||||||
using namespace bridge;
|
using namespace bridge;
|
||||||
|
|
||||||
|
|
@ -32,7 +31,6 @@ MainWindow::MainWindow(XApp *core, const QString &layout, QWidget *parent)
|
||||||
: QMainWindow(parent),
|
: QMainWindow(parent),
|
||||||
layout_name_store(layout),
|
layout_name_store(layout),
|
||||||
core_bind(core),
|
core_bind(core),
|
||||||
sync_kernel(new StatusSyncCore(this)),
|
|
||||||
present_host(new SplitFrame::ViewPresent(this)),
|
present_host(new SplitFrame::ViewPresent(this)),
|
||||||
session_service(new ViewSession(XApp::gconfig, this)),
|
session_service(new ViewSession(XApp::gconfig, this)),
|
||||||
actions_stack(new QToolBar(this)),
|
actions_stack(new QToolBar(this)),
|
||||||
|
|
@ -69,46 +67,48 @@ void MainWindow::resetLayoutName(const QString &name) { layout_name_store = name
|
||||||
void MainWindow::initial_menubar(QMenuBar *mbar) {
|
void MainWindow::initial_menubar(QMenuBar *mbar) {
|
||||||
|
|
||||||
// 项目菜单树
|
// 项目菜单树
|
||||||
auto project = mbar->addMenu("项目");
|
project = mbar->addMenu("项目");
|
||||||
this->build_project_menu(project);
|
this->build_project_menu(project);
|
||||||
|
|
||||||
// 编辑菜单
|
// 编辑菜单
|
||||||
auto edit = mbar->addMenu("编辑");
|
edit = mbar->addMenu("编辑");
|
||||||
this->build_edit_menu(edit);
|
this->build_edit_menu(edit);
|
||||||
|
|
||||||
// 视图菜单
|
// 视图菜单
|
||||||
auto view = mbar->addMenu("视图");
|
view = mbar->addMenu("视图");
|
||||||
build_view_menu(view);
|
build_view_menu(view);
|
||||||
|
|
||||||
// 版本管理
|
|
||||||
|
|
||||||
// 工具菜单
|
// 工具菜单
|
||||||
auto tool = mbar->addMenu("工具");
|
tool = mbar->addMenu("工具");
|
||||||
build_tools_menu(tool);
|
build_tools_menu(tool);
|
||||||
|
|
||||||
// 窗口菜单
|
// 窗口菜单
|
||||||
auto window = mbar->addMenu("窗口");
|
window = mbar->addMenu("窗口");
|
||||||
build_window_menu(window);
|
build_window_menu(window);
|
||||||
|
|
||||||
// 系统
|
// 系统
|
||||||
auto sys = mbar->addMenu("系统");
|
system = mbar->addMenu("系统");
|
||||||
sys->addAction("软件激活");
|
system_active = system->addAction("软件激活");
|
||||||
sys->addAction("系统信息");
|
system_info = system->addAction("系统信息");
|
||||||
sys->addSeparator();
|
system->addSeparator();
|
||||||
sys->addAction("关于……");
|
system_about = system->addAction("关于……");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto action_sync = [](bool enable, const QList<QAction*> &same_state){
|
||||||
|
for(auto &a : same_state)
|
||||||
|
a->setEnabled(enable);
|
||||||
|
};
|
||||||
|
|
||||||
void MainWindow::build_project_menu(QMenu *project) {
|
void MainWindow::build_project_menu(QMenu *project) {
|
||||||
auto opnp = project->addAction("打开项目", [this]() {
|
project_open = project->addAction("打开项目", [this]() {
|
||||||
auto file = QFileDialog::getOpenFileName(this, "打开项目", QString(), "小说项目(*.nsf)");
|
auto file = QFileDialog::getOpenFileName(this, "打开项目", QString(), "小说项目(*.nsf)");
|
||||||
if (file == "")
|
if (file == "")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
XApp::disp_core->postCommand(OpenProject(file));
|
XApp::disp_core->postCommand(OpenProject(file));
|
||||||
});
|
});
|
||||||
sync_kernel->actionEnableSync(opnp, [this]() -> bool { return !core_bind->pjtManager()->isOpenning(); });
|
|
||||||
|
|
||||||
auto newp = project->addAction("新建项目", [this]() {
|
project_new = project->addAction("新建项目", [this]() {
|
||||||
auto name = QInputDialog::getText(this, "输入项目名称", "项目名称");
|
auto name = QInputDialog::getText(this, "输入项目名称", "项目名称");
|
||||||
if (name == "")
|
if (name == "")
|
||||||
return;
|
return;
|
||||||
|
|
@ -118,25 +118,21 @@ void MainWindow::build_project_menu(QMenu *project) {
|
||||||
|
|
||||||
XApp::disp_core->postCommand(NewProject(QDir(dir_path), name));
|
XApp::disp_core->postCommand(NewProject(QDir(dir_path), name));
|
||||||
});
|
});
|
||||||
sync_kernel->actionEnableSync(newp, [this]() -> bool { return !core_bind->pjtManager()->isOpenning(); });
|
|
||||||
|
|
||||||
auto clsp = project->addAction("关闭项目", [this]() { XApp::disp_core->postCommand(CloseProject()); });
|
project_close = project->addAction("关闭项目", []() { XApp::disp_core->postCommand(CloseProject()); });
|
||||||
sync_kernel->actionEnableSync(clsp, [this]() -> bool { return core_bind->pjtManager()->isOpenning(); });
|
|
||||||
|
|
||||||
project->addSeparator();
|
project->addSeparator();
|
||||||
|
|
||||||
auto pnew = project->addAction("新建路径", [this]() {
|
project_newpath = project->addAction("新建路径", [this]() {
|
||||||
auto packages = QInputDialog::getText(this, "输入包路径名称/PackA/PackB/PackC", "包路径:");
|
auto packages = QInputDialog::getText(this, "输入包路径名称/PackA/PackB/PackC", "包路径:");
|
||||||
if (packages != "")
|
if (packages != "")
|
||||||
XApp::disp_core->postCommand(NewPackage(packages));
|
XApp::disp_core->postCommand(NewPackage(packages));
|
||||||
});
|
});
|
||||||
sync_kernel->actionEnableSync(pnew, [this]() -> bool { return core_bind->pjtManager()->isOpenning(); });
|
|
||||||
|
|
||||||
auto _xnew = project->addMenu("新建文件");
|
project_newfile = project->addMenu("新建文件");
|
||||||
_xnew->setEnabled(core_bind->pjtManager()->isOpenning());
|
|
||||||
auto types = core_bind->docsManager()->fileTypes();
|
auto types = core_bind->docsManager()->fileTypes();
|
||||||
for (auto &t : types) {
|
for (auto &t : types) {
|
||||||
_xnew->addAction(t, [this, &t]() {
|
project_newfile->addAction(t, [this, &t]() {
|
||||||
auto name = QInputDialog::getText(this, "输入名称", "名称:");
|
auto name = QInputDialog::getText(this, "输入名称", "名称:");
|
||||||
if (name == "")
|
if (name == "")
|
||||||
return;
|
return;
|
||||||
|
|
@ -149,55 +145,48 @@ void MainWindow::build_project_menu(QMenu *project) {
|
||||||
XApp::disp_core->postCommand(NewFile(group_path, name, t));
|
XApp::disp_core->postCommand(NewFile(group_path, name, t));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
sync_kernel->widgetEnableSync(_xnew, [this]() -> bool { return core_bind->pjtManager()->isOpenning(); });
|
|
||||||
project->addSeparator();
|
|
||||||
|
|
||||||
auto sav = project->addAction("保存全部", []() { XApp::disp_core->postCommand(SaveAll()); });
|
|
||||||
sav->setShortcut(QKeySequence::StandardKey::Save);
|
|
||||||
sync_kernel->actionEnableSync(sav, [this]() -> bool { return core_bind->pjtManager()->isOpenning(); });
|
|
||||||
|
|
||||||
project->addSeparator();
|
project->addSeparator();
|
||||||
|
|
||||||
project->addAction("退出", []() {
|
project_save = project->addAction("保存全部", []() { XApp::disp_core->postCommand(SaveAll()); });
|
||||||
|
project_save->setShortcut(QKeySequence::StandardKey::Save);
|
||||||
|
|
||||||
|
project->addSeparator();
|
||||||
|
|
||||||
|
software_exit = project->addAction("退出", []() {
|
||||||
XApp::disp_core->postCommand(SaveAll());
|
XApp::disp_core->postCommand(SaveAll());
|
||||||
QApplication::exit(0);
|
QApplication::exit(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this->hasBeenCLOSE();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::build_edit_menu(QMenu *edit) {
|
void MainWindow::build_edit_menu(QMenu *edit) {
|
||||||
|
edit_undo = edit->addAction("撤销一步");
|
||||||
edit->addAction("撤销一步");
|
edit_redo = edit->addAction("重做一步");
|
||||||
edit->addAction("重做一步");
|
|
||||||
edit->addSeparator();
|
edit->addSeparator();
|
||||||
edit->addAction("查找关键词");
|
edit_find = edit->addAction("查找关键词");
|
||||||
edit->addAction("替换关键词");
|
edit_replace = edit->addAction("替换关键词");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::build_view_menu(QMenu *view) {
|
void MainWindow::build_view_menu(QMenu *view) {
|
||||||
auto area = view->addMenu("区域管理");
|
view_area = view->addMenu("区域管理");
|
||||||
|
|
||||||
actions_stack->setMovable(false);
|
actions_stack->setMovable(false);
|
||||||
addToolBar(Qt::ToolBarArea::TopToolBarArea, actions_stack);
|
addToolBar(Qt::ToolBarArea::TopToolBarArea, actions_stack);
|
||||||
auto act_tool = area->addAction("工具栏");
|
|
||||||
sync_kernel->actionCheckSync(act_tool, [this]() -> bool { return actions_stack->isVisible(); });
|
view_area_toolbar = view_area->addAction("工具栏");
|
||||||
connect(act_tool, &QAction::triggered, [this](bool v) { actions_stack->setVisible(v); });
|
|
||||||
|
connect(view_area_toolbar, &QAction::triggered, [this](bool v) { actions_stack->setVisible(v); });
|
||||||
|
|
||||||
auto xstatus = statusBar();
|
auto xstatus = statusBar();
|
||||||
xstatus->setVisible(false);
|
xstatus->setVisible(false);
|
||||||
xstatus->addWidget(new QLabel("文本消息", this));
|
xstatus->addWidget(new QLabel("文本消息", this));
|
||||||
auto act_status = area->addAction("状态栏");
|
view_area_statusbar = view_area->addAction("状态栏");
|
||||||
sync_kernel->actionCheckSync(act_status, [xstatus]() -> bool { return xstatus->isVisible(); });
|
|
||||||
connect(act_status, &QAction::triggered, [xstatus](bool v) { xstatus->setVisible(v); });
|
|
||||||
|
|
||||||
view->addSeparator();
|
connect(view_area_statusbar, &QAction::triggered, [xstatus](bool v) { xstatus->setVisible(v); });
|
||||||
auto change = view->addMenu("内容切换");
|
|
||||||
change->addAction("序列视图");
|
|
||||||
change->addAction("编辑视图");
|
|
||||||
view->addSeparator();
|
|
||||||
auto func = view->addMenu("功能视图");
|
|
||||||
sync_kernel->widgetEnableSync(func, [this]() { return this->core_bind->pjtManager()->isOpenning(); });
|
|
||||||
|
|
||||||
auto fconfig = view->addAction("视图配置", [this]() {
|
view_config = view->addAction("视图配置", [this]() {
|
||||||
auto dialog = new QDialog();
|
auto dialog = new QDialog();
|
||||||
auto tabs = new QTabWidget(dialog);
|
auto tabs = new QTabWidget(dialog);
|
||||||
auto layout = new QVBoxLayout(dialog);
|
auto layout = new QVBoxLayout(dialog);
|
||||||
|
|
@ -205,54 +194,61 @@ void MainWindow::build_view_menu(QMenu *view) {
|
||||||
core_bind->docsManager()->loadViewConfigWidgets(tabs);
|
core_bind->docsManager()->loadViewConfigWidgets(tabs);
|
||||||
dialog->exec();
|
dialog->exec();
|
||||||
});
|
});
|
||||||
sync_kernel->actionEnableSync(fconfig, [this]() { return this->core_bind->pjtManager()->isOpenning(); });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::build_tools_menu(QMenu *tool) {
|
void MainWindow::build_tools_menu(QMenu *tool) {
|
||||||
auto word = tool->addMenu("敏感词检测");
|
tool_console = tool->addAction("控制台");
|
||||||
word->addAction("工具配置");
|
|
||||||
word->addAction("敏感词编辑");
|
tool->addSeparator();
|
||||||
auto vcs = tool->addMenu("版本管理");
|
|
||||||
vcs->addAction("工具配置");
|
tool_wcheck = tool->addMenu("敏感词检测");
|
||||||
vcs->addAction("启用");
|
tool_wcheck_setting = tool_wcheck->addAction("工具配置");
|
||||||
auto exp = tool->addMenu("导入导出");
|
tool_wcheck_wordslist = tool_wcheck->addAction("敏感词编辑");
|
||||||
exp->addAction("导入WsOutlines");
|
|
||||||
exp->addSeparator();
|
tool_version = tool->addMenu("版本管理");
|
||||||
exp->addAction("导出TXT大纲");
|
tool_version_setting = tool_version->addAction("工具配置");
|
||||||
exp->addAction("导出Web大纲");
|
tool_version_enable = tool_version->addAction("启用");
|
||||||
exp->addAction("导出WsOutlines");
|
tool_version_commit = tool_version->addAction("提交版本");
|
||||||
exp->addSeparator();
|
tool_version_rollback = tool_version->addAction("版本回滚");
|
||||||
exp->addAction("导出TXT内容");
|
|
||||||
|
tool_inout = tool->addMenu("导入导出");
|
||||||
|
tool_inout_outline_in = tool_inout->addAction("导入WsOutlines");
|
||||||
|
tool_inout->addSeparator();
|
||||||
|
tool_inout_outline_out = tool_inout->addAction("导出WsOutlines");
|
||||||
|
tool_inout_outline_webout = tool_inout->addAction("导出Web大纲");
|
||||||
|
tool_inout->addSeparator();
|
||||||
|
tool_inout_storytxt_out = tool_inout->addAction("导出TXT故事");
|
||||||
|
tool_inout_storyepub_out = tool_inout->addAction("导出EQUP故事");
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QString> layout_peak_path = {"sys-configs", "foreground", "view-layouts"};
|
QList<QString> layout_peak_path = {"sys-configs", "foreground", "view-layouts"};
|
||||||
void MainWindow::build_window_menu(QMenu *window) {
|
void MainWindow::build_window_menu(QMenu *window) {
|
||||||
auto new_window = window->addMenu("新建窗口");
|
window_winnew = window->addMenu("新建窗口");
|
||||||
connect(new_window, &QMenu::aboutToShow, [new_window]() {
|
connect(window_winnew, &QMenu::aboutToShow, [this]() {
|
||||||
auto names = XApp::gconfig->getList(layout_peak_path);
|
auto names = XApp::gconfig->getList(layout_peak_path);
|
||||||
if (!names.size()) {
|
if (!names.size()) {
|
||||||
names << "default";
|
names << "default";
|
||||||
XApp::gconfig->setList(layout_peak_path, names);
|
XApp::gconfig->setList(layout_peak_path, names);
|
||||||
}
|
}
|
||||||
|
|
||||||
new_window->clear();
|
window_winnew->clear();
|
||||||
|
|
||||||
for (auto &n : names)
|
for (auto &n : names)
|
||||||
new_window->addAction(n);
|
window_winnew->addAction(n);
|
||||||
});
|
});
|
||||||
connect(new_window, &QMenu::triggered, [this](QAction *s) {
|
connect(window_winnew, &QMenu::triggered, [this](QAction *s) {
|
||||||
auto layout = s->text();
|
auto layout = s->text();
|
||||||
auto newone = new MainWindow(this->core_bind, layout);
|
auto newone = new MainWindow(this->core_bind, layout);
|
||||||
newone->show();
|
newone->show();
|
||||||
});
|
});
|
||||||
|
|
||||||
window->addAction("关闭窗口", [this]() {
|
window_winclose = window->addAction("关闭窗口", [this]() {
|
||||||
XApp::disp_core->postCommand(SaveAll());
|
XApp::disp_core->postCommand(SaveAll());
|
||||||
this->close();
|
this->close();
|
||||||
});
|
});
|
||||||
|
|
||||||
window->addSeparator();
|
window->addSeparator();
|
||||||
window->addAction("保存当前布局", [this]() {
|
window_layout_store = window->addAction("保存当前布局", [this]() {
|
||||||
auto new_name = QInputDialog::getText(this, "输入新布局名称", "名称:");
|
auto new_name = QInputDialog::getText(this, "输入新布局名称", "名称:");
|
||||||
if (new_name.isEmpty())
|
if (new_name.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
@ -269,8 +265,8 @@ void MainWindow::build_window_menu(QMenu *window) {
|
||||||
session_service->viewStatesSave(this, this->present_host);
|
session_service->viewStatesSave(this, this->present_host);
|
||||||
});
|
});
|
||||||
|
|
||||||
window->addMenu("布局切换");
|
window_layout_load = window->addMenu("布局切换");
|
||||||
window->addMenu("布局删除");
|
window_layout_del = window->addMenu("布局删除");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::closeEvent(QCloseEvent *event) {
|
void MainWindow::closeEvent(QCloseEvent *event) {
|
||||||
|
|
@ -293,10 +289,43 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event) {
|
||||||
case QEvent::Type::MouseMove:
|
case QEvent::Type::MouseMove:
|
||||||
case QEvent::Type::KeyPress:
|
case QEvent::Type::KeyPress:
|
||||||
case QEvent::Type::KeyRelease:
|
case QEvent::Type::KeyRelease:
|
||||||
sync_kernel->sync();
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return QMainWindow::eventFilter(watched, event);
|
return QMainWindow::eventFilter(watched, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::ProjectNEW(const QString &) {}
|
||||||
|
|
||||||
|
void MainWindow::ProjectOPEN(const QString &project_file) {
|
||||||
|
action_sync(false, {project_new, project_open});
|
||||||
|
action_sync(true, {project_close, project_newpath, project_save});
|
||||||
|
project_newfile->setEnabled(true);
|
||||||
|
|
||||||
|
this->setWindowTitle(QString("WordIDE::%1 - %2").arg(this->core_bind->pjtManager()->name()).arg(project_file));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::hasBeenSAVE() {}
|
||||||
|
|
||||||
|
void MainWindow::hasBeenCLOSE() {
|
||||||
|
action_sync(true, {project_open, project_new});
|
||||||
|
action_sync(false, {project_close, project_newpath, project_save});
|
||||||
|
project_newfile->setEnabled(false);
|
||||||
|
|
||||||
|
this->setWindowTitle("WordIDE");
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::hasBeenRENAME(const QModelIndex &path, const QString &new_name) {}
|
||||||
|
|
||||||
|
void MainWindow::hasBeenAPPEND(const QModelIndex &new_path) {}
|
||||||
|
|
||||||
|
void MainWindow::hasBeenMOVE(const QModelIndex &new_path) {}
|
||||||
|
|
||||||
|
void MainWindow::aboutToBeSAVE() {}
|
||||||
|
|
||||||
|
void MainWindow::aboutToBeCLOSE() {}
|
||||||
|
|
||||||
|
void MainWindow::aboutToBeDELETE(const QModelIndex &path) {}
|
||||||
|
|
||||||
|
void MainWindow::aboutToBeMOVE(const QModelIndex &old_path) {}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
#include "parsebridge.h"
|
#include "parsebridge.h"
|
||||||
#include "presentcontainerview.h"
|
#include "presentcontainerview.h"
|
||||||
#include "projectview.h"
|
#include "projectview.h"
|
||||||
#include "tools.h"
|
|
||||||
#include "viewsession.h"
|
#include "viewsession.h"
|
||||||
#include "viewstackedbar.h"
|
#include "viewstackedbar.h"
|
||||||
#include "welcomepanel.h"
|
#include "welcomepanel.h"
|
||||||
|
|
@ -20,7 +19,7 @@
|
||||||
#include <libProjectManager.h>
|
#include <libProjectManager.h>
|
||||||
#include <splitpanel.h>
|
#include <splitpanel.h>
|
||||||
|
|
||||||
class MainWindow : public QMainWindow {
|
class MainWindow : public QMainWindow , public Project::ManagerListener{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -35,7 +34,6 @@ private:
|
||||||
QString layout_name_store;
|
QString layout_name_store;
|
||||||
// model ============================================
|
// model ============================================
|
||||||
XApp *const core_bind;
|
XApp *const core_bind;
|
||||||
Tools::StatusSyncCore *const sync_kernel;
|
|
||||||
SplitFrame::ViewPresent *const present_host;
|
SplitFrame::ViewPresent *const present_host;
|
||||||
Core::ViewSession *const session_service;
|
Core::ViewSession *const session_service;
|
||||||
|
|
||||||
|
|
@ -45,6 +43,57 @@ private:
|
||||||
Components::PresentContainerView *const center_frame;
|
Components::PresentContainerView *const center_frame;
|
||||||
Components::ProjectView *const project_present;
|
Components::ProjectView *const project_present;
|
||||||
|
|
||||||
|
// menu =============================================
|
||||||
|
QMenu *project;
|
||||||
|
QAction *project_open;
|
||||||
|
QAction *project_new;
|
||||||
|
QAction *project_close;
|
||||||
|
QAction *project_newpath;
|
||||||
|
QMenu *project_newfile;
|
||||||
|
QAction *project_save;
|
||||||
|
QAction *software_exit;
|
||||||
|
|
||||||
|
QMenu *edit;
|
||||||
|
QAction *edit_undo;
|
||||||
|
QAction *edit_redo;
|
||||||
|
QAction *edit_find;
|
||||||
|
QAction *edit_replace;
|
||||||
|
|
||||||
|
QMenu *view;
|
||||||
|
QMenu *view_area;
|
||||||
|
QAction *view_area_toolbar;
|
||||||
|
QAction *view_area_statusbar;
|
||||||
|
QAction *view_config;
|
||||||
|
|
||||||
|
QMenu *tool;
|
||||||
|
QAction *tool_console;
|
||||||
|
QMenu *tool_wcheck;
|
||||||
|
QAction *tool_wcheck_setting;
|
||||||
|
QAction *tool_wcheck_wordslist;
|
||||||
|
QMenu *tool_version;
|
||||||
|
QAction *tool_version_enable;
|
||||||
|
QAction *tool_version_setting;
|
||||||
|
QAction *tool_version_commit;
|
||||||
|
QAction *tool_version_rollback;
|
||||||
|
QMenu *tool_inout;
|
||||||
|
QAction *tool_inout_outline_in;
|
||||||
|
QAction *tool_inout_outline_out;
|
||||||
|
QAction *tool_inout_outline_webout;
|
||||||
|
QAction *tool_inout_storytxt_out;
|
||||||
|
QAction *tool_inout_storyepub_out;
|
||||||
|
|
||||||
|
QMenu *window;
|
||||||
|
QMenu *window_winnew;
|
||||||
|
QAction *window_winclose;
|
||||||
|
QAction *window_layout_store;
|
||||||
|
QMenu *window_layout_load;
|
||||||
|
QMenu *window_layout_del;
|
||||||
|
|
||||||
|
QMenu *system;
|
||||||
|
QAction *system_active;
|
||||||
|
QAction *system_info;
|
||||||
|
QAction *system_about;
|
||||||
|
|
||||||
// 内部逻辑 ===========================================
|
// 内部逻辑 ===========================================
|
||||||
|
|
||||||
void initial_menubar(QMenuBar *mbar);
|
void initial_menubar(QMenuBar *mbar);
|
||||||
|
|
@ -61,5 +110,19 @@ protected:
|
||||||
// QObject interface
|
// QObject interface
|
||||||
public:
|
public:
|
||||||
virtual bool eventFilter(QObject *watched, QEvent *event) override;
|
virtual bool eventFilter(QObject *watched, QEvent *event) override;
|
||||||
|
|
||||||
|
// Project::ManagerListener interface
|
||||||
|
public:
|
||||||
|
virtual void ProjectNEW(const QString &project_file) override;
|
||||||
|
virtual void ProjectOPEN(const QString &project_file) override;
|
||||||
|
virtual void hasBeenSAVE() override;
|
||||||
|
virtual void hasBeenCLOSE() override;
|
||||||
|
virtual void hasBeenRENAME(const QModelIndex &path, const QString &new_name) override;
|
||||||
|
virtual void hasBeenAPPEND(const QModelIndex &new_path) override;
|
||||||
|
virtual void hasBeenMOVE(const QModelIndex &new_path) override;
|
||||||
|
virtual void aboutToBeSAVE() override;
|
||||||
|
virtual void aboutToBeCLOSE() override;
|
||||||
|
virtual void aboutToBeDELETE(const QModelIndex &path) override;
|
||||||
|
virtual void aboutToBeMOVE(const QModelIndex &old_path) override;
|
||||||
};
|
};
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
#define PRESENTCONTAINERVIEW_H
|
#define PRESENTCONTAINERVIEW_H
|
||||||
|
|
||||||
#include "manager_docs.h"
|
#include "manager_docs.h"
|
||||||
|
#include <QComboBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QStackedLayout>
|
#include <QStackedLayout>
|
||||||
#include <QStackedWidget>
|
#include <QStackedWidget>
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,20 @@
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <libConfig.h>
|
#include <libConfig.h>
|
||||||
|
|
||||||
|
class GenException : public std::exception{
|
||||||
|
private:
|
||||||
|
QString exception_reason;
|
||||||
|
|
||||||
|
public:
|
||||||
|
GenException(const QString &msg):exception_reason(msg){}
|
||||||
|
|
||||||
|
// exception interface
|
||||||
|
public:
|
||||||
|
virtual const char *what() const noexcept override{
|
||||||
|
return exception_reason.toLocal8Bit();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
using namespace Presents;
|
using namespace Presents;
|
||||||
using namespace Enhancement;
|
using namespace Enhancement;
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
|
@ -62,7 +76,7 @@ void DefaultTextEdit::saveAs(const QString &path)
|
||||||
|
|
||||||
QFile bout(target_file_path);
|
QFile bout(target_file_path);
|
||||||
if(!bout.open(QIODevice::WriteOnly|QIODevice::Text))
|
if(!bout.open(QIODevice::WriteOnly|QIODevice::Text))
|
||||||
throw new std::exception(QString("指定文件无法打开:%1").arg(target_file_path).toLocal8Bit());
|
throw new GenException(QString("指定文件无法打开:%1").arg(target_file_path).toLocal8Bit());
|
||||||
|
|
||||||
QTextStream tout(&bout);
|
QTextStream tout(&bout);
|
||||||
tout.setCodec("UTF-8");
|
tout.setCodec("UTF-8");
|
||||||
|
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
#include "tools.h"
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QAction>
|
|
||||||
|
|
||||||
using namespace Tools;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Run::Run(bool manual_flag, std::function<bool ()> judge, std::function<void (bool)> execution)
|
|
||||||
: manual(manual_flag), judgement(judge), execution(execution){}
|
|
||||||
|
|
||||||
void Run::exec()
|
|
||||||
{
|
|
||||||
if(!manual)
|
|
||||||
execution(judgement());
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusSyncCore::StatusSyncCore(QObject *p)
|
|
||||||
: QObject(p){}
|
|
||||||
|
|
||||||
void StatusSyncCore::widgetEnableSync(QWidget *tar, std::function<bool()> proc) { widget_trigger_map[tar] = proc; }
|
|
||||||
|
|
||||||
void StatusSyncCore::actionEnableSync(QAction *tar, std::function<bool()> proc) { action_trigger_map[tar] = proc; }
|
|
||||||
|
|
||||||
void StatusSyncCore::actionCheckSync(QAction *tar, std::function<bool()> proc) {
|
|
||||||
tar->setCheckable(true);
|
|
||||||
registerTrigger(proc, [tar](bool state) {
|
|
||||||
if (tar->isChecked() != state)
|
|
||||||
tar->setChecked(state);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void StatusSyncCore::registerTrigger(std::function<bool()> judge, std::function<void(bool)> exec) {
|
|
||||||
auto run = new Run(false, judge, exec);
|
|
||||||
alltriggers << run;
|
|
||||||
}
|
|
||||||
|
|
||||||
Run *StatusSyncCore::registerManualRun(std::function<bool ()> judge, std::function<void (bool)> exec)
|
|
||||||
{
|
|
||||||
auto run = new Run(true, judge, exec);
|
|
||||||
alltriggers << run;
|
|
||||||
return run;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StatusSyncCore::sync()
|
|
||||||
{
|
|
||||||
for(auto &it : widget_trigger_map.keys()){
|
|
||||||
auto status = widget_trigger_map[it]();
|
|
||||||
if(it->isEnabled() != status)
|
|
||||||
it->setEnabled(status);
|
|
||||||
}
|
|
||||||
|
|
||||||
for(auto &it : action_trigger_map.keys()){
|
|
||||||
auto status = action_trigger_map[it]();
|
|
||||||
if(it->isEnabled() != status)
|
|
||||||
it->setEnabled(status);
|
|
||||||
}
|
|
||||||
|
|
||||||
for(auto &act : alltriggers){
|
|
||||||
act->exec();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
#ifndef COMNTOOLS_H
|
|
||||||
#define COMNTOOLS_H
|
|
||||||
|
|
||||||
#include <QAction>
|
|
||||||
#include <QStandardItemModel>
|
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
namespace Tools {
|
|
||||||
|
|
||||||
class Run {
|
|
||||||
public:
|
|
||||||
Run(bool manual_flag, std::function<bool()> judge,
|
|
||||||
std::function<void(bool)> execution);
|
|
||||||
|
|
||||||
void exec();
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool manual;
|
|
||||||
std::function<bool()> judgement;
|
|
||||||
std::function<void(bool)> execution;
|
|
||||||
};
|
|
||||||
|
|
||||||
class StatusSyncCore : public QObject {
|
|
||||||
public:
|
|
||||||
explicit StatusSyncCore(QObject *p = nullptr);
|
|
||||||
virtual ~StatusSyncCore() = default;
|
|
||||||
|
|
||||||
void widgetEnableSync(QWidget *tar, std::function<bool()> proc);
|
|
||||||
void actionEnableSync(QAction *tar, std::function<bool()> proc);
|
|
||||||
void actionCheckSync(QAction *tar, std::function<bool()> proc);
|
|
||||||
void registerTrigger(std::function<bool()> judge,
|
|
||||||
std::function<void(bool)> exec);
|
|
||||||
Run *registerManualRun(std::function<bool()> judge,
|
|
||||||
std::function<void(bool)> exec);
|
|
||||||
void sync();
|
|
||||||
|
|
||||||
private:
|
|
||||||
QHash<QWidget *, std::function<bool()>> widget_trigger_map;
|
|
||||||
QHash<QAction *, std::function<bool()>> action_trigger_map;
|
|
||||||
QList<Run *> alltriggers;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Tools
|
|
||||||
|
|
||||||
#endif // COMNTOOLS_H
|
|
||||||
|
|
@ -28,7 +28,7 @@ namespace Config {
|
||||||
|
|
||||||
// exception interface
|
// exception interface
|
||||||
public:
|
public:
|
||||||
virtual const char *what() const override { return this->buffer; }
|
virtual const char *what() const noexcept override { return this->buffer; }
|
||||||
|
|
||||||
// ParseException interface
|
// ParseException interface
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ public:
|
||||||
virtual ~Impl_ParseException() = default;
|
virtual ~Impl_ParseException() = default;
|
||||||
// exception interface
|
// exception interface
|
||||||
public:
|
public:
|
||||||
virtual const char *what() const override{
|
virtual const char *what() const noexcept override {
|
||||||
return temp_string.toLocal8Bit();
|
return temp_string.toLocal8Bit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ public:
|
||||||
|
|
||||||
// exception interface
|
// exception interface
|
||||||
public:
|
public:
|
||||||
virtual const char *what() const override;
|
virtual const char *what() const noexcept override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString ex_string;
|
QString ex_string;
|
||||||
|
|
@ -39,7 +39,7 @@ QString Impl_CmdException::reason() const
|
||||||
return ex_string.mid(title_length+1);
|
return ex_string.mid(title_length+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *Impl_CmdException::what() const
|
const char *Impl_CmdException::what() const noexcept
|
||||||
{
|
{
|
||||||
return ex_string.toLocal8Bit();
|
return ex_string.toLocal8Bit();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
|
@ -1,12 +1,8 @@
|
||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/icons">
|
<qresource prefix="/icons">
|
||||||
<file>集合.png</file>
|
<file>sets.png</file>
|
||||||
<file>脉络.png</file>
|
<file>file.png</file>
|
||||||
<file>文件.png</file>
|
<file>story.png</file>
|
||||||
<file>单元.png</file>
|
|
||||||
<file>故事.png</file>
|
|
||||||
<file>叙述.png</file>
|
|
||||||
<file>toplevel.png</file>
|
<file>toplevel.png</file>
|
||||||
<file>概念.png</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,64 @@ namespace Project {
|
||||||
virtual QStringList packagePath(const QModelIndex &path) const = 0;
|
virtual QStringList packagePath(const QModelIndex &path) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ManagerListener{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* @brief 新建项目文件
|
||||||
|
* @param project_file
|
||||||
|
*/
|
||||||
|
virtual void ProjectNEW(const QString &project_file) = 0;
|
||||||
|
/**
|
||||||
|
* @brief 打开项目文件
|
||||||
|
* @param project_file
|
||||||
|
*/
|
||||||
|
virtual void ProjectOPEN(const QString &project_file) = 0;
|
||||||
|
/**
|
||||||
|
* @brief 项目管理已经执行了保存操作
|
||||||
|
*/
|
||||||
|
virtual void hasBeenSAVE() = 0;
|
||||||
|
/**
|
||||||
|
* @brief 项目已经被关闭
|
||||||
|
*/
|
||||||
|
virtual void hasBeenCLOSE() = 0;
|
||||||
|
/**
|
||||||
|
* @brief 项目树节点重命名
|
||||||
|
* @param path
|
||||||
|
* @param new_name
|
||||||
|
*/
|
||||||
|
virtual void hasBeenRENAME(const QModelIndex &path, const QString &new_name) = 0;
|
||||||
|
/**
|
||||||
|
* @brief 项目树上新增节点
|
||||||
|
* @param new_path 新节点路径
|
||||||
|
*/
|
||||||
|
virtual void hasBeenAPPEND(const QModelIndex &new_path) = 0;
|
||||||
|
/**
|
||||||
|
* @brief 项目树上节点已被移动
|
||||||
|
* @param new_path 移动后新路径
|
||||||
|
*/
|
||||||
|
virtual void hasBeenMOVE(const QModelIndex &new_path) = 0;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 项目管理将要执行保存操作
|
||||||
|
*/
|
||||||
|
virtual void aboutToBeSAVE() = 0;
|
||||||
|
/**
|
||||||
|
* @brief 项目将要被关闭
|
||||||
|
*/
|
||||||
|
virtual void aboutToBeCLOSE() = 0;
|
||||||
|
/**
|
||||||
|
* @brief 项目树节点将要被删除
|
||||||
|
* @param path 节点路径
|
||||||
|
*/
|
||||||
|
virtual void aboutToBeDELETE(const QModelIndex &path) = 0;
|
||||||
|
/**
|
||||||
|
* @brief 项目树节点将要被移动
|
||||||
|
* @param old_path 节点旧路径
|
||||||
|
*/
|
||||||
|
virtual void aboutToBeMOVE(const QModelIndex &old_path) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 项目管理
|
* @brief 项目管理
|
||||||
* 项目名称
|
* 项目名称
|
||||||
|
|
@ -111,6 +169,13 @@ namespace Project {
|
||||||
public:
|
public:
|
||||||
virtual ~ProjectManager() = default;
|
virtual ~ProjectManager() = default;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 添加ManagerListener实例
|
||||||
|
* @param inst
|
||||||
|
*/
|
||||||
|
virtual void addListener(ManagerListener *inst) = 0;
|
||||||
|
virtual void removeListener(ManagerListener *inst) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 项目树结构模型
|
* @brief 项目树结构模型
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -183,11 +248,6 @@ namespace Project {
|
||||||
*/
|
*/
|
||||||
virtual bool isOpenning() const noexcept = 0;
|
virtual bool isOpenning() const noexcept = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 修改状态,需要被保存
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
virtual bool isModified() const noexcept = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Project
|
} // namespace Project
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
|
@ -26,7 +26,7 @@ private:
|
||||||
|
|
||||||
// exception interface
|
// exception interface
|
||||||
public:
|
public:
|
||||||
virtual const char *what() const override{
|
virtual const char *what() const noexcept override{
|
||||||
return temp_string.toLocal8Bit();
|
return temp_string.toLocal8Bit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,8 +62,6 @@ QString XMLProjectManager::suffix() const
|
||||||
|
|
||||||
bool XMLProjectManager::isOpenning() const noexcept { return open_status; }
|
bool XMLProjectManager::isOpenning() const noexcept { return open_status; }
|
||||||
|
|
||||||
bool XMLProjectManager::isModified() const noexcept { return unsaved_status; }
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* <?xml version='1.0'?>
|
* <?xml version='1.0'?>
|
||||||
* <project name="project-name" config="xml-path">
|
* <project name="project-name" config="xml-path">
|
||||||
|
|
@ -108,6 +106,8 @@ void XMLProjectManager::openProject(const QString &project_file)
|
||||||
open_status = true;
|
open_status = true;
|
||||||
unsaved_status = false;
|
unsaved_status = false;
|
||||||
pnode->setIcon(QIcon(":/icons/toplevel.png"));
|
pnode->setIcon(QIcon(":/icons/toplevel.png"));
|
||||||
|
|
||||||
|
notify_all([&](ManagerListener *it){it->ProjectOPEN(project_file);});
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMLProjectManager::newProject(const QDir &project_dir, const QString &name) {
|
void XMLProjectManager::newProject(const QDir &project_dir, const QString &name) {
|
||||||
|
|
@ -130,17 +130,25 @@ void XMLProjectManager::newProject(const QDir &project_dir, const QString &name)
|
||||||
save();
|
save();
|
||||||
open_status = true;
|
open_status = true;
|
||||||
project_node->setIcon(QIcon(":/icons/toplevel.png"));
|
project_node->setIcon(QIcon(":/icons/toplevel.png"));
|
||||||
|
|
||||||
|
notify_all([&](ManagerListener *it){it->ProjectNEW(filepath_store);});
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMLProjectManager::closeProject()
|
void XMLProjectManager::closeProject()
|
||||||
{
|
{
|
||||||
|
notify_all([&](ManagerListener *it){it->aboutToBeCLOSE();});
|
||||||
|
|
||||||
open_status = false;
|
open_status = false;
|
||||||
unsaved_status = false;
|
unsaved_status = false;
|
||||||
project_structure->clear();
|
project_structure->clear();
|
||||||
|
|
||||||
|
notify_all([&](ManagerListener *it){it->hasBeenCLOSE();});
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMLProjectManager::save()
|
void XMLProjectManager::save()
|
||||||
{
|
{
|
||||||
|
notify_all([&](ManagerListener *it){it->aboutToBeSAVE();});
|
||||||
|
|
||||||
project_config->save();
|
project_config->save();
|
||||||
|
|
||||||
QDomDocument doc;
|
QDomDocument doc;
|
||||||
|
|
@ -161,11 +169,17 @@ void XMLProjectManager::save()
|
||||||
QTextStream txout(&records);
|
QTextStream txout(&records);
|
||||||
doc.save(txout, 4);
|
doc.save(txout, 4);
|
||||||
txout.flush();
|
txout.flush();
|
||||||
|
|
||||||
|
notify_all([&](ManagerListener *it){it->hasBeenSAVE();});
|
||||||
}
|
}
|
||||||
|
|
||||||
QString XMLProjectManager::name() const { return project_structure->item(0)->text(); }
|
QString XMLProjectManager::name() const { return project_structure->item(0)->text(); }
|
||||||
|
|
||||||
void XMLProjectManager::resetName(const QString &name) { this->project_structure->item(0)->setText(name); }
|
void XMLProjectManager::resetName(const QString &name) {
|
||||||
|
this->project_structure->item(0)->setText(name);
|
||||||
|
|
||||||
|
notify_all([&](ManagerListener *it){it->hasBeenRENAME(this->project_structure->item(0)->index(), name);});
|
||||||
|
}
|
||||||
|
|
||||||
Configration *XMLProjectManager::configraions() const
|
Configration *XMLProjectManager::configraions() const
|
||||||
{
|
{
|
||||||
|
|
@ -236,6 +250,8 @@ void XMLProjectManager::rename(const QModelIndex &node, const QString &name)
|
||||||
|
|
||||||
unsaved_status = true;
|
unsaved_status = true;
|
||||||
item->setText(name);
|
item->setText(name);
|
||||||
|
|
||||||
|
notify_all([&](ManagerListener *it){it->hasBeenRENAME(node, name);});
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QModelIndex> XMLProjectManager::filesGather(const QModelIndex &node) const
|
QList<QModelIndex> XMLProjectManager::filesGather(const QModelIndex &node) const
|
||||||
|
|
@ -266,10 +282,23 @@ void XMLProjectManager::deleteT(const QModelIndex &node_path) {
|
||||||
if(xnode->nodeType() == NodeType::ROOT)
|
if(xnode->nodeType() == NodeType::ROOT)
|
||||||
throw new Impl_ProjectException("参数错误", "不允许删除项目节点");
|
throw new Impl_ProjectException("参数错误", "不允许删除项目节点");
|
||||||
|
|
||||||
|
notify_all([&](ManagerListener *it){it->aboutToBeDELETE(node_path);});
|
||||||
xnode->parent()->removeRow(xnode->row());
|
xnode->parent()->removeRow(xnode->row());
|
||||||
unsaved_status = true;
|
unsaved_status = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XMLProjectManager::addListener(ManagerListener *inst)
|
||||||
|
{
|
||||||
|
if(!this->listeners_list.contains(inst))
|
||||||
|
this->listeners_list.append(inst);
|
||||||
|
}
|
||||||
|
|
||||||
|
void XMLProjectManager::removeListener(ManagerListener *inst)
|
||||||
|
{
|
||||||
|
if(this->listeners_list.contains(inst))
|
||||||
|
this->listeners_list.removeAll(inst);
|
||||||
|
}
|
||||||
|
|
||||||
QList<std::tuple<QString, QFileInfo> > XMLProjectManager::filesWithEnds(const QString &suffix) const
|
QList<std::tuple<QString, QFileInfo> > XMLProjectManager::filesWithEnds(const QString &suffix) const
|
||||||
{
|
{
|
||||||
auto root_project = project_structure->item(0);
|
auto root_project = project_structure->item(0);
|
||||||
|
|
@ -280,7 +309,10 @@ QModelIndex XMLProjectManager::newPackage(const QList<QString> &path)
|
||||||
{
|
{
|
||||||
unsaved_status = true;
|
unsaved_status = true;
|
||||||
auto pnode = project_structure->item(0);
|
auto pnode = project_structure->item(0);
|
||||||
return groups_rebuild(static_cast<ProjectNode*>(pnode), path);
|
auto nidx = groups_rebuild(static_cast<ProjectNode*>(pnode), path);
|
||||||
|
notify_all([&](ManagerListener *it){it->hasBeenAPPEND(nidx);});
|
||||||
|
|
||||||
|
return nidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList XMLProjectManager::packagePath(const QModelIndex &path) const
|
QStringList XMLProjectManager::packagePath(const QModelIndex &path) const
|
||||||
|
|
@ -338,7 +370,10 @@ QModelIndex XMLProjectManager::newFile(const QModelIndex &package_path, const QS
|
||||||
node->appendRow(leaf);
|
node->appendRow(leaf);
|
||||||
|
|
||||||
unsaved_status = true;
|
unsaved_status = true;
|
||||||
return leaf->index();
|
auto nidx = leaf->index();
|
||||||
|
notify_all([&](ManagerListener *it){it->hasBeenAPPEND(nidx);});
|
||||||
|
|
||||||
|
return nidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
QFileInfo XMLProjectManager::queryInfo(const QModelIndex &path) {
|
QFileInfo XMLProjectManager::queryInfo(const QModelIndex &path) {
|
||||||
|
|
@ -449,6 +484,12 @@ QModelIndex XMLProjectManager::query_index(const QFileInfo &file, const QModelIn
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XMLProjectManager::notify_all(std::function<void (ManagerListener *)> proc)
|
||||||
|
{
|
||||||
|
for(auto l : listeners_list)
|
||||||
|
proc(l);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void XMLProjectManager::moveTo(const QModelIndex &item_path, const QModelIndex &target_group, int index)
|
void XMLProjectManager::moveTo(const QModelIndex &item_path, const QModelIndex &target_group, int index)
|
||||||
{
|
{
|
||||||
|
|
@ -458,6 +499,7 @@ void XMLProjectManager::moveTo(const QModelIndex &item_path, const QModelIndex &
|
||||||
if(!target_group.isValid())
|
if(!target_group.isValid())
|
||||||
throw new Impl_ProjectException("参数错误", "传入的目标包路径无效");
|
throw new Impl_ProjectException("参数错误", "传入的目标包路径无效");
|
||||||
|
|
||||||
|
notify_all([&](ManagerListener *it){it->aboutToBeMOVE(item_path);});
|
||||||
auto node = static_cast<ProjectNode *>(project_structure->itemFromIndex(item_path));
|
auto node = static_cast<ProjectNode *>(project_structure->itemFromIndex(item_path));
|
||||||
|
|
||||||
auto group = static_cast<ProjectNode*>(project_structure->itemFromIndex(target_group));
|
auto group = static_cast<ProjectNode*>(project_structure->itemFromIndex(target_group));
|
||||||
|
|
@ -477,6 +519,8 @@ void XMLProjectManager::moveTo(const QModelIndex &item_path, const QModelIndex &
|
||||||
group->appendRow(node);
|
group->appendRow(node);
|
||||||
|
|
||||||
unsaved_status = true;
|
unsaved_status = true;
|
||||||
|
|
||||||
|
notify_all([&](ManagerListener *it){it->hasBeenMOVE(node->index());});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -491,11 +535,11 @@ ProjectNode::ProjectNode(NodeType t, const QString &name)
|
||||||
{
|
{
|
||||||
if(t == NodeType::FILE)
|
if(t == NodeType::FILE)
|
||||||
{
|
{
|
||||||
setIcon(QIcon(":/icons/文件.png"));
|
setIcon(QIcon(":/icons/file.png"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setIcon(QIcon(":/icons/集合.png"));
|
setIcon(QIcon(":/icons/sets.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
setEditable(false);
|
setEditable(false);
|
||||||
|
|
@ -508,19 +552,10 @@ void ProjectNode::setFile(const QString &name)
|
||||||
{
|
{
|
||||||
this->filename = name;
|
this->filename = name;
|
||||||
|
|
||||||
// if(name.endsWith("storychain"))
|
|
||||||
// setIcon(QIcon(":/icons/脉络.png"));
|
|
||||||
// if(name.endsWith("storyunit"))
|
|
||||||
// setIcon(QIcon(":/icons/单元.png"));
|
|
||||||
// if(name.endsWith("storyvolume"))
|
|
||||||
// setIcon(QIcon(":/icons/叙述.png"));
|
|
||||||
// if(name.endsWith("storyconcept"))
|
|
||||||
// setIcon(QIcon(":/icons/概念.png"));
|
|
||||||
|
|
||||||
if(name.endsWith("storyboard"))
|
if(name.endsWith("storyboard"))
|
||||||
setIcon(QIcon(":/icons/故事.png"));
|
setIcon(QIcon(":/icons/story.png"));
|
||||||
if (name.endsWith("txt"))
|
if (name.endsWith("txt"))
|
||||||
setIcon(QIcon(":/icons/文件.png"));
|
setIcon(QIcon(":/icons/file.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ProjectNode::file() const
|
QString ProjectNode::file() const
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,8 @@ namespace Project {
|
||||||
|
|
||||||
// ProjectManager interface
|
// ProjectManager interface
|
||||||
public:
|
public:
|
||||||
|
virtual void addListener(ManagerListener *inst) override;
|
||||||
|
virtual void removeListener(ManagerListener *inst) override;
|
||||||
virtual QStandardItemModel *model() const override;
|
virtual QStandardItemModel *model() const override;
|
||||||
virtual Config::Configration *configraions() const override;
|
virtual Config::Configration *configraions() const override;
|
||||||
virtual FilesOperate *operateAccess() const override;
|
virtual FilesOperate *operateAccess() const override;
|
||||||
|
|
@ -69,9 +71,9 @@ namespace Project {
|
||||||
virtual void resetName(const QString &name) override;
|
virtual void resetName(const QString &name) override;
|
||||||
virtual QDir directory() const override;
|
virtual QDir directory() const override;
|
||||||
virtual bool isOpenning() const noexcept override;
|
virtual bool isOpenning() const noexcept override;
|
||||||
virtual bool isModified() const noexcept override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QList<ManagerListener*> listeners_list;
|
||||||
Config::Configration *const project_config;
|
Config::Configration *const project_config;
|
||||||
QStandardItemModel*const project_structure;
|
QStandardItemModel*const project_structure;
|
||||||
QString filepath_store;
|
QString filepath_store;
|
||||||
|
|
@ -86,6 +88,8 @@ namespace Project {
|
||||||
QModelIndex groups_rebuild(ProjectNode *pnode, const QList<QString> &path_remains);
|
QModelIndex groups_rebuild(ProjectNode *pnode, const QList<QString> &path_remains);
|
||||||
|
|
||||||
virtual QModelIndex query_index(const QFileInfo &file, const QModelIndex &base);
|
virtual QModelIndex query_index(const QFileInfo &file, const QModelIndex &base);
|
||||||
|
|
||||||
|
void notify_all(std::function<void(ManagerListener*inst)> proc);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif // XMLPROJECTMANAGER_H
|
#endif // XMLPROJECTMANAGER_H
|
||||||
|
|
|
||||||
|
|
@ -16,68 +16,10 @@
|
||||||
|
|
||||||
using namespace SplitFrame;
|
using namespace SplitFrame;
|
||||||
|
|
||||||
enum class XEnum { ONE, TWO };
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
|
||||||
// qDebug() << QString("%1").arg((int)XEnum::ONE);
|
|
||||||
|
|
||||||
auto win = new QMainWindow();
|
auto win = new QMainWindow();
|
||||||
// win->setMinimumSize(800, 600);
|
|
||||||
// win->menuBar()->addMenu("文件");
|
|
||||||
// auto tbar = new QToolBar();
|
|
||||||
// win->addToolBar(Qt::ToolBarArea::LeftToolBarArea, tbar);
|
|
||||||
|
|
||||||
// auto conv = new ViewPresent();
|
|
||||||
// auto aview = new XWidget(conv, Qt::black);
|
|
||||||
// auto bview = new XWidget(conv, Qt::green);
|
|
||||||
// auto cview = new XWidget(conv, Qt::yellow);
|
|
||||||
// auto dview = new YWidget(conv);
|
|
||||||
|
|
||||||
// auto rect0 = conv->appendView(aview, QIcon(), "hello0");
|
|
||||||
// auto rect1 = conv->appendView(bview, QIcon(), "hello1");
|
|
||||||
// auto rect2 = conv->appendView(cview, QIcon(), "hello2");
|
|
||||||
// auto rect3 = conv->appendView(dview, QIcon(), "hello3");
|
|
||||||
// conv->markFreedom(rect0);
|
|
||||||
// conv->markFreedom(rect1);
|
|
||||||
// conv->markFreedom(rect2);
|
|
||||||
// conv->markFreedom(rect3);
|
|
||||||
|
|
||||||
// conv->objsRelateRebuild();
|
|
||||||
// conv->resetEngross(static_cast<RectCom *>(rect3));
|
|
||||||
|
|
||||||
// win->setCentralWidget(conv->bind());
|
|
||||||
|
|
||||||
// auto b_left = tbar->addAction("左侧添加");
|
|
||||||
// win->connect(b_left, &QAction::triggered, [=](bool v) {
|
|
||||||
// auto items = conv->freedomViews();
|
|
||||||
// if (items.size()) {
|
|
||||||
// conv->temporaryVisible(SplitFrame::DockType::LEFT, items.last());
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// auto b_right = tbar->addAction(" 右侧添加");
|
|
||||||
// win->connect(b_right, &QAction::triggered, [=](bool v) {
|
|
||||||
// auto items = conv->freedomViews();
|
|
||||||
// if (items.size()) {
|
|
||||||
// conv->temporaryVisible(SplitFrame::DockType::RIGHT, items.last());
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// auto b_top = tbar->addAction("上侧添加");
|
|
||||||
// win->connect(b_top, &QAction::triggered, [=](bool v) {
|
|
||||||
// auto items = conv->freedomViews();
|
|
||||||
// if (items.size()) {
|
|
||||||
// conv->temporaryVisible(SplitFrame::DockType::TOP, items.last());
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// auto b_bottom = tbar->addAction("下侧添加");
|
|
||||||
// win->connect(b_bottom, &QAction::triggered, [=](bool v) {
|
|
||||||
// auto items = conv->freedomViews();
|
|
||||||
// if (items.size()) {
|
|
||||||
// conv->temporaryVisible(SplitFrame::DockType::BOTTOM, items.last());
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
win->show();
|
win->show();
|
||||||
|
|
||||||
QWidget *firstPageWidget = new XWidget(nullptr, Qt::GlobalColor::green);
|
QWidget *firstPageWidget = new XWidget(nullptr, Qt::GlobalColor::green);
|
||||||
|
|
|
||||||