DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SchemaMainWindow.hpp
Go to the documentation of this file.
1// DUNE DAQ modification notice:
2// This file has been modified from the original ATLAS dbe source for the DUNE DAQ project.
3// Fork baseline commit: dbe-02-12-17 (2022-05-12).
4// Renamed since fork: yes (from dbe/SchemaMainWindow.h to include/dbe/SchemaMainWindow.hpp).
5
6#ifndef MAINWINDOW_H
7#define MAINWINDOW_H
8
9#include <memory>
10#include <QDir>
11#include <QMainWindow>
12#include <QModelIndex>
13#include <QMenu>
14#include <QPrinter>
15#include <QSortFilterProxyModel>
19
20class QGraphicsView;
21
22namespace dbse
23{
24 class SchemaTab;
25 class SchemaFileInfo;
26
27namespace Ui
28{
29class SchemaMainWindow;
30} // namespace Ui
31
32class SchemaMainWindow: public QMainWindow
33{
34 Q_OBJECT
35public:
37 explicit SchemaMainWindow ( QString SchemaFile, QWidget * parent = nullptr );
38
39private:
40 std::unique_ptr<dbse::Ui::SchemaMainWindow> ui;
41
44 QSortFilterProxyModel * m_proxyModel;
48 QString m_title{"DUNE DAQ Configuration Schema editor"};
49 QString m_view_dir{"."};
50 QString m_export_path{"."};
52 QList<QUrl> m_path_urls;
54 QByteArray m_default_state;
57 QPrinter* m_printer{};
58
59 void InitialSettings();
60 void InitialTab();
61 void InitialTabCorner();
62 void SetController();
63 void BuildFileModel();
64 void BuildTableModel();
65 void update_window_title(QString text);
66 void write_view_file(const QString& fn, SchemaTab* tab);
67 [[nodiscard]] int ShouldSaveChanges() const;
68 [[nodiscard]] int ShouldSaveViewChanges() const;
69 bool check_schema_file(QString file);
70 bool save_schema_file(QString file);
71protected:
72 void closeEvent ( QCloseEvent * event );
73 void OpenSchemaFile( QString SchemaFile);
74public slots:
75 void modifiedView (bool modified);
76 void update_models();
77private slots:
78 void OpenSchemaFile();
79 void CreateNewSchema();
81 void show_file_info(QModelIndex);
82 void show_file_info(QString);
83 void show_file_info();
85 void edit_settings();
86 // From main menu / shortcut
87 void SaveSchema();
88 // From FileView
89 void SaveSchemaFile();
90 bool SaveModifiedSchema();
91 void ChangeCursorRelationship ( bool State );
92 void ChangeCursorInheritance ( bool State );
93 void add_tab();
94 void SaveView();
95 void SaveViewAs();
96 void LoadView();
97 void NameView();
98 void LaunchClassEditor ( QModelIndex Index );
99 void RemoveTab ( int i );
100 void close_tab();
101 void CustomContextMenuFileView ( QPoint Pos );
102 void CustomContextMenuTableView ( QPoint Pos );
103 void AddNewClass();
104 void RemoveClass();
105 void editClass();
106 void SetSchemaFileActive();
107 void PrintCurrentView();
108 void export_current_view();
109 void toggle_case_sensitive ( int );
110 void update_view();
111 void save_layout();
112 void restore_layout();
113 void default_layout();
114};
115
116} // namespace dbse
117#endif // MAINWINDOW_H
SchemaMainWindow(QString SchemaFile, QWidget *parent=nullptr)
SchemaSettings * m_settings
void connect_file_info(SchemaFileInfo *win)
void LaunchClassEditor(QModelIndex Index)
void CustomContextMenuTableView(QPoint Pos)
void ChangeCursorInheritance(bool State)
void write_view_file(const QString &fn, SchemaTab *tab)
void modifiedView(bool modified)
void CustomContextMenuFileView(QPoint Pos)
bool save_schema_file(QString file)
void update_window_title(QString text)
CustomFileModel * FileModel
QSortFilterProxyModel * m_proxyModel
void ChangeCursorRelationship(bool State)
CustomTableModel * TableModel
std::unique_ptr< dbse::Ui::SchemaMainWindow > ui
void closeEvent(QCloseEvent *event)
bool check_schema_file(QString file)
Including QT Headers.