53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "SettingsDialog.h"
|
|
|
|
#include <QMainWindow>
|
|
#include <QUndoStack>
|
|
|
|
namespace diag {
|
|
|
|
class DiagramScene;
|
|
class GridView;
|
|
class NetworkModel;
|
|
class NodePalette;
|
|
class PropertyPanel;
|
|
|
|
class MainWindow : public QMainWindow {
|
|
Q_OBJECT
|
|
public:
|
|
explicit MainWindow(QWidget* parent = nullptr);
|
|
|
|
DiagramScene* scene() const { return m_scene; }
|
|
NetworkModel* model() const { return m_model; }
|
|
|
|
void loadSample();
|
|
void setSimulationRunning(bool running);
|
|
|
|
protected:
|
|
void closeEvent(QCloseEvent* event) override;
|
|
|
|
private:
|
|
void buildActions();
|
|
void applySettings(const EditorSettings& settings);
|
|
void newDocument();
|
|
void openDocument();
|
|
void saveDocument();
|
|
void saveDocumentAs();
|
|
bool maybeSave();
|
|
void runSimulation(bool enabled);
|
|
void showSettings();
|
|
|
|
NetworkModel* m_model;
|
|
QUndoStack* m_undoStack;
|
|
DiagramScene* m_scene;
|
|
GridView* m_view;
|
|
NodePalette* m_palette;
|
|
PropertyPanel* m_properties;
|
|
EditorSettings m_settings;
|
|
QString m_currentFile;
|
|
QAction* m_simulateAction = nullptr;
|
|
};
|
|
|
|
} // namespace diag
|