2022-11-06 00:37:50 +00:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
2022-12-31 13:05:58 +00:00
|
|
|
#include "DocsManager.h"
|
2023-03-05 14:32:20 +00:00
|
|
|
#include "manager_docs.h"
|
2023-03-17 13:58:38 +00:00
|
|
|
#include "messagespresent.h"
|
|
|
|
#include "presentcontainer.h"
|
2023-03-11 07:01:28 +00:00
|
|
|
#include "projectpresent.h"
|
2022-12-01 13:54:04 +00:00
|
|
|
#include "tools.h"
|
2023-03-17 13:58:38 +00:00
|
|
|
#include "welcomepanel.h"
|
2023-03-11 07:01:28 +00:00
|
|
|
#include <QListView>
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QSplitter>
|
|
|
|
#include <QTableView>
|
|
|
|
#include <QTreeView>
|
|
|
|
#include <libProjectManager.h>
|
2022-11-18 23:47:32 +00:00
|
|
|
|
2023-08-15 14:40:40 +00:00
|
|
|
class MainWindow : public QMainWindow, public Components::PresentHost {
|
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-08-15 14:40:40 +00:00
|
|
|
private:
|
2022-12-01 13:54:04 +00:00
|
|
|
Tools::StatusSyncCore *const sync_kernel;
|
2023-03-17 13:58:38 +00:00
|
|
|
QSplitter *const split_first;
|
|
|
|
QSplitter *const split_second;
|
|
|
|
QSplitter *const split_third;
|
2022-11-15 08:07:02 +00:00
|
|
|
|
|
|
|
Project::ProjectManager *const project_manager;
|
2022-11-17 08:16:54 +00:00
|
|
|
|
2023-03-17 13:58:38 +00:00
|
|
|
// containers =======================================
|
|
|
|
Components::PresentHost *const left_funcs;
|
|
|
|
Components::PresentHost *const right_funcs;
|
|
|
|
Components::PresentHost *const center_funcs;
|
|
|
|
Components::PresentHost *const bottom_funcs;
|
|
|
|
|
|
|
|
// model ============================================
|
|
|
|
DataModel::DocumentsManager *const docs_container;
|
|
|
|
|
|
|
|
// view =============================================
|
|
|
|
Components::WelcomePanel *const welcome_list;
|
|
|
|
Components::MessagesPresent *const errors_present;
|
2023-03-10 13:01:19 +00:00
|
|
|
Components::ProjectPresent *const project_present;
|
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-03-17 13:58:38 +00:00
|
|
|
void initial_commandlist(Schedule::CommandsDispatcher *host);
|
|
|
|
|
|
|
|
void accept_view_transport(const Core::Route &key, Components::GroupType type);
|
2023-03-10 13:01:19 +00:00
|
|
|
|
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);
|
2022-11-22 03:42:48 +00:00
|
|
|
|
2023-03-17 13:58:38 +00:00
|
|
|
void splitter_layout_save(const QList<QString> &path_type, const QList<int> &size);
|
2022-11-22 03:42:48 +00:00
|
|
|
|
2023-03-05 14:32:20 +00:00
|
|
|
// PresentContainer interface
|
2023-08-15 14:40:40 +00:00
|
|
|
public:
|
2023-03-17 13:58:38 +00:00
|
|
|
virtual QWidget *hostWidget() const override;
|
2023-03-05 14:32:20 +00:00
|
|
|
|
2023-08-15 14:40:40 +00:00
|
|
|
virtual void append(MakeTools::PresentBase *ins) override;
|
|
|
|
virtual bool active(const MakeTools::PresentBase *ins) override;
|
|
|
|
virtual void remove(const MakeTools::PresentBase *ins) override;
|
|
|
|
virtual bool contains(const MakeTools::PresentBase *ins) const override;
|
2023-03-05 14:32:20 +00:00
|
|
|
|
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
|