#include "mainwindow.h"

#include <QLabel>
#include <QMenuBar>
#include <QStatusBar>
#include <QDebug>
#include <QDateTime>
#include <QTextEdit>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    setMinimumSize(1000, 600);
    setWindowTitle("提线木偶文学项目集成开发工具");

    auto mbar = menuBar();
    // 项目菜单树
    auto project = mbar->addMenu("项目");
    auto _xnew = project->addMenu("新建文件");
    _xnew->addAction("文章脉络");
    _xnew->addAction("故事单元");
    project->addAction("保存");
    project->addSeparator();
    project->addAction("打开项目");
    project->addAction("新建项目");
    project->addAction("关闭项目");
    project->addSeparator();
    project->addAction("项目配置");
    project->addAction("软件配置");
    project->addSeparator();
    project->addAction("退出");

    // 编辑菜单
    auto edit = mbar->addMenu("编辑");
    edit->addAction("撤销一步");
    edit->addAction("重做一步");
    edit->addSeparator();
    edit->addAction("查找关键词");
    edit->addAction("替换关键词");

    // 视图菜单
    auto view = mbar->addMenu("视图");
    view->addAction("工具栏");
    view->addAction("状态栏");
    view->addSeparator();
    auto change = view->addMenu("内容视图");
    change->addAction("序列视图");
    change->addAction("编辑视图");
    auto func = view->addMenu("功能视图");
    func->addAction("项目结构");
    func->addAction("引用统计");
    func->addAction("脉络分蘖");
    func->addAction("终端输出");

    // 工具菜单
    auto tool = mbar->addMenu("工具");
    auto word = tool->addMenu("敏感词检测");
    word->addAction("工具配置");
    word->addAction("敏感词编辑");
    auto vcs = tool->addMenu("版本管理");
    vcs->addAction("工具配置");
    vcs->addAction("启用");
    auto exp = tool->addMenu("导入导出");
    exp->addAction("导入TXT");
    exp->addSeparator();
    exp->addAction("导出TXT");

    // 窗口菜单
    auto window = mbar->addMenu("窗口");
    window->addAction("新建窗口");
    window->addAction("关闭窗口");
    window->addSeparator();
    window->addAction("布局管理");
    window->addMenu("布局切换");
    window->addMenu("窗口切换");

    // 系统
    auto sys = mbar->addMenu("系统");
    sys->addAction("软件激活");
    sys->addAction("系统信息");
    sys->addSeparator();
    sys->addAction("关于……");



    setCentralWidget(new QTextEdit(this));




    auto xy = new QLabel("文本消息");
    statusBar()->addWidget(xy);

}

MainWindow::~MainWindow()
{
}
