2022-11-06 00:37:50 +00:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
2023-03-11 07:01:28 +00:00
|
|
|
#include "ContentPresent.h"
|
2022-12-31 13:05:58 +00:00
|
|
|
#include "DocsManager.h"
|
2023-03-11 07:01:28 +00:00
|
|
|
#include "fragmentsorderview.h"
|
2023-03-05 14:32:20 +00:00
|
|
|
#include "manager_docs.h"
|
2023-03-11 07:01:28 +00:00
|
|
|
#include "messagepresent.h"
|
|
|
|
#include "projectpresent.h"
|
2022-11-25 01:18:54 +00:00
|
|
|
#include "storyboardspresent.h"
|
2023-03-11 07:01:28 +00:00
|
|
|
#include "storychainspresent.h"
|
2022-11-29 03:47:12 +00:00
|
|
|
#include "storyconceptspresent.h"
|
2023-03-11 07:01:28 +00:00
|
|
|
#include "storyunitspresent.h"
|
2022-12-01 13:54:04 +00:00
|
|
|
#include "tools.h"
|
2023-03-11 07:01:28 +00:00
|
|
|
#include <QListView>
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QSplitter>
|
|
|
|
#include <QTableView>
|
|
|
|
#include <QTreeView>
|
|
|
|
#include <StoryTool.h>
|
|
|
|
#include <libProjectManager.h>
|
2022-11-18 23:47:32 +00:00
|
|
|
|
2023-03-11 07:01:28 +00:00
|
|
|
class MainWindow : public QMainWindow, public Components::PresentContainer {
|
2022-11-06 00:37:50 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2023-03-11 07:01:28 +00:00
|
|
|
public:
|
2022-11-06 00:37:50 +00:00
|
|
|
MainWindow(QWidget *parent = nullptr);
|
|
|
|
~MainWindow();
|
2022-11-11 14:38:52 +00:00
|
|
|
|
2023-03-11 07:01:28 +00:00
|
|
|
private:
|
2022-11-22 03:42:48 +00:00
|
|
|
Core::AppCore *const app_core;
|
2023-03-11 07:01:28 +00:00
|
|
|
Schedule::CommandsDispatcher *const disp_core;
|
|
|
|
|
2022-12-01 13:54:04 +00:00
|
|
|
Tools::StatusSyncCore *const sync_kernel;
|
2022-11-15 08:07:02 +00:00
|
|
|
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;
|
2022-11-17 08:16:54 +00:00
|
|
|
|
2023-03-10 13:01:19 +00:00
|
|
|
QListView *const welcome_list;
|
|
|
|
Components::ProjectPresent *const project_present;
|
|
|
|
Components::DocumentsManager *const docs_container;
|
|
|
|
Components::StorychainsPresent *const chains_view;
|
|
|
|
Components::StoryunitsPresent *const units_view;
|
2022-11-17 08:16:54 +00:00
|
|
|
Components::MessagePresent *const errors_present;
|
2023-03-11 07:01:28 +00:00
|
|
|
Components::StoryboardsPresent *const boards_view;
|
2023-03-11 04:51:30 +00:00
|
|
|
Components::StoryconceptsPresent *const concept_view;
|
2022-12-08 19:43:42 +00:00
|
|
|
Components::FragmentsOrderView *const fragments_order;
|
2022-11-17 08:16:54 +00:00
|
|
|
|
2022-11-15 12:58:12 +00:00
|
|
|
// 内部逻辑 ===========================================
|
2023-03-10 13:01:19 +00:00
|
|
|
void initial_menubar(QMenuBar *mbar);
|
|
|
|
|
2023-01-01 05:10:31 +00:00
|
|
|
void refresh_views();
|
|
|
|
|
2022-11-17 08:16:54 +00:00
|
|
|
void build_internal(bool all_from_disk = false);
|
2023-03-11 07:01:28 +00:00
|
|
|
void toggle_widget_visible(bool visible, QTabWidget *con, QWidget *target,
|
|
|
|
const QString &title = QString());
|
2022-11-18 23:47:32 +00:00
|
|
|
|
2023-03-11 07:01:28 +00:00
|
|
|
void splitter_layout_save(const QList<QString> &path_type,
|
|
|
|
const QList<int> &size);
|
2022-11-22 03:42:48 +00:00
|
|
|
|
|
|
|
void uilayout_save();
|
|
|
|
void uilayout_load();
|
|
|
|
|
2023-03-05 14:32:20 +00:00
|
|
|
// PresentContainer interface
|
2023-03-11 07:01:28 +00:00
|
|
|
public:
|
2023-03-05 14:32:20 +00:00
|
|
|
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);
|
|
|
|
|
2022-11-17 08:16:54 +00:00
|
|
|
// QWidget interface
|
2023-03-11 07:01:28 +00:00
|
|
|
protected:
|
2022-11-17 08:16:54 +00:00
|
|
|
virtual void closeEvent(QCloseEvent *event) override;
|
2022-11-18 23:47:32 +00:00
|
|
|
|
|
|
|
// QObject interface
|
2023-03-11 07:01:28 +00:00
|
|
|
public:
|
2022-11-18 23:47:32 +00:00
|
|
|
virtual bool eventFilter(QObject *watched, QEvent *event) override;
|
2022-11-06 00:37:50 +00:00
|
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|