DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ObjectEditor.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/ObjectEditor.h to include/dbe/ObjectEditor.hpp).
5
6#ifndef OBJECTEDITOR_H
7#define OBJECTEDITOR_H
8
11#include "dbe/FileModel.hpp"
12#include "dbe/confaccessor.hpp"
13
14#include <QDialog>
15#include <QFormLayout>
16#include <QSplitter>
17#include <QStatusBar>
18#include <QTableWidget>
19#include <QUuid>
20#include <QWidget>
21
22#include <map>
23#include <memory>
24
25namespace dbe {
26namespace Ui {
27class ObjectEditor;
28} // namespace Ui
29
30class ObjectEditor : public QWidget
31{
32 Q_OBJECT
33
34public:
35 explicit ObjectEditor(QWidget* parent = nullptr);
36 ObjectEditor(std::string const& classname, QWidget* parent = nullptr);
37
38 ObjectEditor(tref const& objref, QWidget* parent = nullptr, bool const iscopy = false);
39
41
42 void HideDetailWidget(bool Hide);
43
44 bool CanCloseWindow();
45
46 bool IsEditorValid() const;
47
48 bool WasObjectChanged() const;
49
50 bool ParseToCreate(std::string const& name, std::string const& filename);
51
52 void SetUsedForCopy(bool Used);
53
54private:
55 void keyPressEvent(QKeyEvent* event) override;
56 void init();
57 void SetStatusBar();
58 void SetController();
59 void BuildWidgets();
60
63
65
66 void register_attribute_widget(QString const& name, widgets::editors::base* widget);
67 void register_relation_widget(QString const& name, widgets::editors::base* widget);
68
69 void BuildFileInfo();
70
71 // void closeEvent ( QCloseEvent * Event );
72
73 std::unique_ptr<dbe::Ui::ObjectEditor> ui;
74
75 std::string classname;
76 std::unique_ptr<dref> m_object_to_edit;
77 bool m_readonly{ false };
78
80
81 QStatusBar* StatusBar;
82
83 std::map<QString, widgets::editors::base*> this_widgets;
84
86
88
90
91 QHBoxLayout* MainLayout;
92 QTableWidget* WidgetTable;
93
95 QDialog* RenameWidget;
96 QLineEdit* LineEdit;
97 QPushButton* GoButton;
98
100 QDialog* MoveWidget;
103 QPushButton* MoveGoButton;
104
106 QStringList HorizontalHeaders;
107
108public slots:
109 void ResetObjectChanged();
110
111private slots:
112 void save_and_close();
113 void UpdateActions();
114 void ObjectChanged();
115 void ParseToSave();
116 void LaunchRenameObject();
117 void LaunchMoveObject();
118 void RenameObject();
119 void slot_external_rename_object(QString const& src, dref const& obj);
120 void MoveObject();
121 void ActiveFileChanged(const QString& File);
122 void UpdateObjectEditor(QString const&, dref);
123 void UpdateObjectEditor(const QList<QPair<QString, QString>>&);
124 void UpdateObjectEditor();
125 void ShouldCloseThisWindow(QString src, dref key);
126
127signals:
130
131private:
132 QUuid const uuid;
133};
134} // namespace dbe
135#endif // OBJECTEDITOR_H
QTableWidget * WidgetTable
void set_attribute_widget(dunedaq::conffwk::attribute_t const &, widgets::editors::base *)
bool IsEditorValid() const
QPushButton * GoButton
QDialog * MoveWidget
Move widget.
QLineEdit * LineEdit
void slot_external_rename_object(QString const &src, dref const &obj)
std::map< QString, widgets::editors::base * > this_widgets
bool WasObjectChanged() const
void SetUsedForCopy(bool Used)
std::unique_ptr< dbe::Ui::ObjectEditor > ui
bool ParseToCreate(std::string const &name, std::string const &filename)
void set_tooltip(dunedaq::conffwk::attribute_t const &, widgets::editors::base *)
void UpdateObjectEditor(QString const &, dref)
QStringList HorizontalHeaders
QPushButton * MoveGoButton
QStatusBar * StatusBar
std::unique_ptr< dref > m_object_to_edit
void register_attribute_widget(QString const &name, widgets::editors::base *widget)
CustomFileView * FileView
void HideDetailWidget(bool Hide)
QHBoxLayout * MainLayout
void register_relation_widget(QString const &name, widgets::editors::base *widget)
ObjectEditor(QWidget *parent=nullptr)
void ActiveFileChanged(const QString &File)
void keyPressEvent(QKeyEvent *event) override
void ShouldCloseThisWindow(QString src, dref key)
FileModel * IncludedFileModel
std::string classname
QDialog * RenameWidget
Rename widget.
dunedaq::conffwk::ConfigObject & ref(bool check_null=true) const
Include QT Headers.
inner::configobject::tref tref
Definition tref.hpp:36
config_object_description dref