#include <SchemaMethodEditor.hpp>
Definition at line 20 of file SchemaMethodEditor.hpp.
◆ ~SchemaMethodEditor()
dbse::SchemaMethodEditor::~SchemaMethodEditor |
( |
| ) |
|
|
default |
◆ SchemaMethodEditor() [1/2]
Definition at line 14 of file SchemaMethodEditor.cpp.
16 : QWidget ( parent ),
17 ui (
new Ui::SchemaMethodEditor ),
22{
23 QWidget::setAttribute(Qt::WA_DeleteOnClose);
28}
CustomMethodImplementationModel * ImplementationModel
dunedaq::oks::OksClass * m_class
dunedaq::oks::OksMethod * m_method
std::unique_ptr< dbse::Ui::SchemaMethodEditor > ui
◆ SchemaMethodEditor() [2/2]
dbse::SchemaMethodEditor::SchemaMethodEditor |
( |
dunedaq::oks::OksClass * | ClassInfo, |
|
|
QWidget * | parent = nullptr ) |
|
explicit |
Definition at line 30 of file SchemaMethodEditor.cpp.
31 : QWidget ( parent ),
32 ui (
new Ui::SchemaMethodEditor ),
37{
38 QWidget::setAttribute(Qt::WA_DeleteOnClose);
42}
◆ AddNewMethodImplementation
void dbse::SchemaMethodEditor::AddNewMethodImplementation |
( |
| ) |
|
|
privateslot |
Definition at line 188 of file SchemaMethodEditor.cpp.
189{
193 }
194 else {
195 QMessageBox::question (
196 0, tr ( "SchemaEditor" ),
197 tr ( "You must set the method name before you can set an implementation" ),
198 QMessageBox::Ok );
199 return;
200 }
201 }
202 SchemaMethodImplementationEditor * Editor = new SchemaMethodImplementationEditor (
206 Editor->show();
207}
void BuildModelImplementationSlot()
OksMethod * find_method(const std::string &name) const noexcept
Find method (search in this and base classes).
◆ BuildModelImplementationSlot
void dbse::SchemaMethodEditor::BuildModelImplementationSlot |
( |
| ) |
|
|
privateslot |
◆ BuildModels()
void dbse::SchemaMethodEditor::BuildModels |
( |
| ) |
|
Definition at line 139 of file SchemaMethodEditor.cpp.
140{
141 QStringList MethodHeaders { "Language", "Prototype" };
142
145 }
147
149 ui->ImplementationsView->horizontalHeader()->setSectionResizeMode ( QHeaderView::ResizeToContents );
150}
◆ ClassUpdated
void dbse::SchemaMethodEditor::ClassUpdated |
( |
QString | ClassName | ) |
|
|
privateslot |
Definition at line 56 of file SchemaMethodEditor.cpp.
57{
62 } else {
63 QWidget::close();
64 }
65 }
66}
const std::string & get_name() const noexcept
OksMethod * find_direct_method(const std::string &name) const noexcept
Find direct method.
const std::string & get_name() const noexcept
◆ create()
bool dbse::SchemaMethodEditor::create |
( |
| ) |
|
|
private |
Definition at line 121 of file SchemaMethodEditor.cpp.
121 {
122 std::string method_name =
ui->MethodName->text().toStdString();
123 if (method_name.empty()) {
124 return false;
125 }
126 std::string method_description =
ui->DescriptionTextBox->toPlainText().toStdString();
128 method_description );
131 return true;
132}
static KernelWrapper & GetInstance()
void PushAddMethodCommand(dunedaq::oks::OksClass *Class, std::string name, std::string description)
◆ FillInfo()
void dbse::SchemaMethodEditor::FillInfo |
( |
| ) |
|
|
protected |
Definition at line 68 of file SchemaMethodEditor.cpp.
69{
70 auto name = QString::fromStdString (
72 setObjectName ( name );
73 setWindowTitle ( QString ( "Method Editor : %1" ).arg ( name ) );
75 ui->DescriptionTextBox->setPlainText (
77}
const std::string & get_description() const noexcept
◆ InitialSettings()
void dbse::SchemaMethodEditor::InitialSettings |
( |
| ) |
|
Definition at line 79 of file SchemaMethodEditor.cpp.
80{
82 {
83 setWindowTitle ( "New Method" );
84 setObjectName ( "NEW" );
85 ui->AddButton->setEnabled (
true );
86 }
87 else
88 {
90 }
91}
◆ OpenMethodImplementationEditor
void dbse::SchemaMethodEditor::OpenMethodImplementationEditor |
( |
QModelIndex | Index | ) |
|
|
privateslot |
Definition at line 209 of file SchemaMethodEditor.cpp.
210{
212 if ( !Row.isEmpty() ) {
213 QString name = QString::fromStdString(
m_method->
get_name()).append(Row.at ( 0 ));
215 SchemaMethodImplementationEditor * Editor = new SchemaMethodImplementationEditor (
217 Editor->show();
218 }
219 }
220}
QStringList getRowFromIndex(QModelIndex &index)
bool ShouldOpenMethodImplementationEditor(QString Name)
OksMethodImplementation * find_implementation(const std::string &language) const
Find method implementation.
◆ ParseToCreate()
void dbse::SchemaMethodEditor::ParseToCreate |
( |
| ) |
|
◆ ParseToSave()
void dbse::SchemaMethodEditor::ParseToSave |
( |
| ) |
|
Definition at line 93 of file SchemaMethodEditor.cpp.
94{
96 std::string method_name =
ui->MethodName->text().toStdString();
97 std::string method_description =
ui->DescriptionTextBox->toPlainText().toStdString();
98
100 {
103 }
104
106 {
109 method_description );
111 }
112
113 if ( changed )
114 {
116 }
117
118 close();
119}
void PushSetDescriptionMethodCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string description)
void PushSetNameMethodCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string name)
Method commands.
Only Configuration DB opened by rdbconfig or oksconflibs plug in can be changed
◆ ProxySlot
void dbse::SchemaMethodEditor::ProxySlot |
( |
| ) |
|
|
privateslot |
◆ RebuildModel
void dbse::SchemaMethodEditor::RebuildModel |
( |
| ) |
|
|
signal |
◆ SetController()
void dbse::SchemaMethodEditor::SetController |
( |
| ) |
|
Definition at line 44 of file SchemaMethodEditor.cpp.
45{
46 connect (
ui->buttonBox, SIGNAL ( accepted() ),
this, SLOT (
ProxySlot() ) );
47 connect (
ui->buttonBox, SIGNAL ( rejected() ),
this, SLOT ( close() ) );
48 connect (
ui->AddButton, SIGNAL ( clicked() ),
this,
50 connect (
ui->ImplementationsView, SIGNAL ( doubleClicked ( QModelIndex ) ),
this,
54}
void AddNewMethodImplementation()
void ClassUpdated(QString ClassName)
void OpenMethodImplementationEditor(QModelIndex Index)
◆ ShouldOpenMethodImplementationEditor()
bool dbse::SchemaMethodEditor::ShouldOpenMethodImplementationEditor |
( |
QString | Name | ) |
|
|
private |
Definition at line 152 of file SchemaMethodEditor.cpp.
153{
154 bool WidgetFound = false;
155
156 for ( QWidget * Editor : QApplication::allWidgets() )
157 {
158 SchemaMethodImplementationEditor * Widget =
159 dynamic_cast<SchemaMethodImplementationEditor *> ( Editor );
160
161 if ( Widget != nullptr )
162 {
163 if ( ( Widget->objectName() ).compare ( Name ) == 0 )
164 {
165 Widget->raise();
166 Widget->setVisible ( true );
167 Widget->activateWindow();
168 WidgetFound = true;
169 }
170 }
171 }
172
173 return !WidgetFound;
174}
◆ ImplementationModel
◆ m_class
◆ m_method
◆ ui
std::unique_ptr<dbse::Ui::SchemaMethodEditor> dbse::SchemaMethodEditor::ui |
|
private |
◆ UsedNew
bool dbse::SchemaMethodEditor::UsedNew |
|
private |
The documentation for this class was generated from the following files: