89 lines
2.5 KiB
C++
89 lines
2.5 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QMainWindow>
|
|
#include <QSplitter>
|
|
#include <QTableView>
|
|
#include <libProjectManager.h>
|
|
#include <StoryTool.h>
|
|
#include <QTreeView>
|
|
#include <QListView>
|
|
#include "DocsManager.h"
|
|
#include "messagepresent.h"
|
|
#include "storychainspresent.h"
|
|
#include "storyunitspresent.h"
|
|
#include "manager_docs.h"
|
|
#include "ContentPresent.h"
|
|
#include "storyboardspresent.h"
|
|
#include "storyconceptspresent.h"
|
|
#include "fragmentsorderview.h"
|
|
#include "tools.h"
|
|
#include "projectpresent.h"
|
|
|
|
class MainWindow : public QMainWindow, public Components::PresentContainer
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
MainWindow(QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
|
|
|
|
private:
|
|
Core::AppCore *const app_core;
|
|
Tools::StatusSyncCore *const sync_kernel;
|
|
QSplitter *const horizontal_split;
|
|
QSplitter *const vertical_split;
|
|
|
|
QTabWidget *const left_funcs;
|
|
QTabWidget *const right_funcs;
|
|
QTabWidget *const center_funcs;
|
|
QTabWidget *const bottom_funcs;
|
|
|
|
|
|
Project::ProjectManager *const project_manager;
|
|
|
|
QListView *const welcome_list;
|
|
Components::ProjectPresent *const project_present;
|
|
Components::DocumentsManager *const docs_container;
|
|
Components::StorychainsPresent *const chains_view;
|
|
Components::StoryunitsPresent *const units_view;
|
|
Components::MessagePresent *const errors_present;
|
|
Components::StoryBoardsPresent *const boards_view;
|
|
Components::StoryconceptsPresent *const concept_view;
|
|
Components::FragmentsOrderView *const fragments_order;
|
|
|
|
// 内部逻辑 ===========================================
|
|
void initial_menubar(QMenuBar *mbar);
|
|
|
|
void refresh_views();
|
|
|
|
void build_internal(bool all_from_disk = false);
|
|
void toggle_widget_visible(bool visible, QTabWidget *con, QWidget *target, const QString& title=QString());
|
|
|
|
void splitter_layout_save(const QList<QString> &path_type, const QList<int> &size);
|
|
|
|
void uilayout_save();
|
|
void uilayout_load();
|
|
|
|
// PresentContainer interface
|
|
public:
|
|
virtual void append(MakeTools::ContentPresent *ins) override;
|
|
virtual void active(MakeTools::ContentPresent *ins) override;
|
|
virtual void remove(MakeTools::ContentPresent *ins) override;
|
|
|
|
|
|
void contentViewAppend(QWidget *widget, const QString &name);
|
|
void contentViewClose(QWidget *widget);
|
|
|
|
// QWidget interface
|
|
protected:
|
|
virtual void closeEvent(QCloseEvent *event) override;
|
|
|
|
// QObject interface
|
|
public:
|
|
virtual bool eventFilter(QObject *watched, QEvent *event) override;
|
|
|
|
};
|
|
#endif // MAINWINDOW_H
|