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
12#include "dbe/FileModel.hpp"
13
14#include <QWidget>
15#include <QStatusBar>
16#include <QSplitter>
17#include <QFormLayout>
18#include <QDialog>
19#include <QTableWidget>
20#include <QUuid>
21
22#include <memory>
23#include <map>
24
25namespace dbe
26{
27namespace Ui
28{
29class ObjectEditor;
30} // namespace Ui
31
33 public QWidget
34{
35 Q_OBJECT
36
37public:
38 explicit ObjectEditor(QWidget * parent = nullptr);
39 ObjectEditor ( std::string const & classname, QWidget * parent = nullptr );
40
41 ObjectEditor ( tref const & objref, QWidget * parent = nullptr, bool const iscopy = false );
42
44
45 void HideDetailWidget ( bool Hide );
46
47 bool CanCloseWindow();
48
49 bool IsEditorValid() const;
50
51 bool WasObjectChanged() const;
52
53 bool ParseToCreate ( std::string const & name, std::string const & filename );
54
55 void SetUsedForCopy ( bool Used );
56
57private:
58 void keyPressEvent(QKeyEvent* event) override;
59 void init();
60 void SetStatusBar();
61 void SetController();
62 void BuildWidgets();
63
66
68
69 void register_attribute_widget ( QString const & name, widgets::editors::base * widget );
70 void register_relation_widget ( QString const & name, widgets::editors::base * widget );
71
72 void BuildFileInfo();
73
74 // void closeEvent ( QCloseEvent * Event );
75
76 std::unique_ptr<dbe::Ui::ObjectEditor> ui;
77
78 std::string classname;
79 std::unique_ptr<dref> m_object_to_edit;
80
82 {
83 return m_object_to_edit->ref();
84 }
85
86 QStatusBar * StatusBar;
87
88 std::map<QString, widgets::editors::base *> this_widgets;
89
92
94
96
97 QHBoxLayout * MainLayout;
98 QTableWidget * WidgetTable;
99
101 QDialog * RenameWidget;
102 QLineEdit * LineEdit;
103 QPushButton * GoButton;
104
106 QDialog * MoveWidget;
109 QPushButton * MoveGoButton;
110
112 QStringList HorizontalHeaders;
113
114public slots:
115 void ResetObjectChanged();
116
117private slots:
118 void save_and_close();
119 void UpdateActions();
120 void ObjectChanged();
121 void ParseToSave();
122 void LaunchRenameObject();
123 void LaunchMoveObject();
124 void RenameObject();
125 void slot_external_rename_object ( QString const & src, dref const & obj );
126 void MoveObject();
127 void ActiveFileChanged ( const QString & File );
128 void UpdateObjectEditor ( QString const &, dref );
129 void UpdateObjectEditor (const QList<QPair<QString, QString>>&);
130 void UpdateObjectEditor ();
131 void ShouldCloseThisWindow ( QString src, dref key );
132
133signals:
136
137private:
138 QUuid const uuid;
139
140};
141} // namespace dbe
142#endif // OBJECTEDITOR_H
QTableWidget * WidgetTable
void set_attribute_widget(dunedaq::conffwk::attribute_t const &, widgets::editors::base *)
bool IsEditorValid() const
QPushButton * GoButton
std::map< QString, widgets::editors::base * > this_widgets
QDialog * MoveWidget
Move widget.
void slot_external_rename_object(QString const &src, dref const &obj)
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 *)
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.
Include QT Headers.
inner::configobject::tref tref
Definition tref.hpp:35
config_object_description dref