#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);
29}
static KernelWrapper & GetInstance()
bool IsFileWritable(const std::string &FileName) const
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 31 of file SchemaMethodEditor.cpp.
32 : QWidget ( parent ),
33 ui (
new Ui::SchemaMethodEditor ),
38{
39 QWidget::setAttribute(Qt::WA_DeleteOnClose);
44}
◆ AddNewMethodImplementation
| void dbse::SchemaMethodEditor::AddNewMethodImplementation |
( |
| ) |
|
|
privateslot |
Definition at line 196 of file SchemaMethodEditor.cpp.
197{
201 }
202 else {
203 QMessageBox::question (
204 0, tr ( "SchemaEditor" ),
205 tr ( "You must set the method name before you can set an implementation" ),
206 QMessageBox::Ok );
207 return;
208 }
209 }
210 SchemaMethodImplementationEditor * Editor = new SchemaMethodImplementationEditor (
214 Editor->show();
215}
void BuildModelImplementationSlot()
◆ BuildModelImplementationSlot
| void dbse::SchemaMethodEditor::BuildModelImplementationSlot |
( |
| ) |
|
|
privateslot |
◆ BuildModels()
| void dbse::SchemaMethodEditor::BuildModels |
( |
| ) |
|
Definition at line 147 of file SchemaMethodEditor.cpp.
148{
149 QStringList MethodHeaders { "Language", "Prototype" };
150
153 }
155
157 ui->ImplementationsView->horizontalHeader()->setSectionResizeMode ( QHeaderView::ResizeToContents );
158}
◆ ClassUpdated
| void dbse::SchemaMethodEditor::ClassUpdated |
( |
QString | ClassName | ) |
|
|
privateslot |
◆ create()
| bool dbse::SchemaMethodEditor::create |
( |
| ) |
|
|
private |
Definition at line 129 of file SchemaMethodEditor.cpp.
129 {
130 std::string method_name =
ui->MethodName->text().toStdString();
131 if (method_name.empty()) {
132 return false;
133 }
134 std::string method_description =
ui->DescriptionTextBox->toPlainText().toStdString();
136 method_description );
139 return true;
140}
void PushAddMethodCommand(dunedaq::oks::OksClass *Class, std::string name, std::string description)
◆ FillInfo()
| void dbse::SchemaMethodEditor::FillInfo |
( |
| ) |
|
|
protected |
Definition at line 70 of file SchemaMethodEditor.cpp.
71{
72 auto name = QString::fromStdString (
74 setObjectName ( name );
75 setWindowTitle ( QString ( "Method Editor : %1" ).arg ( name ) );
76 ui->MethodName->setText ( QString::fromStdString (
m_method->get_name() ) );
77 ui->DescriptionTextBox->setPlainText (
78 QString::fromStdString (
m_method->get_description() ) );
79}
◆ InitialSettings()
| void dbse::SchemaMethodEditor::InitialSettings |
( |
| ) |
|
Definition at line 81 of file SchemaMethodEditor.cpp.
82{
84 {
85 setWindowTitle ( "New Method" );
86 setObjectName ( "NEW" );
87 ui->AddButton->setEnabled (
true );
88 }
89 else
90 {
92 ui->MethodName->setEnabled (
false);
93 ui->DescriptionTextBox->setEnabled (
false);
94 ui->AddButton->setEnabled (
false);
95 ui->ImplementationsView->setEnabled (
false);
96 }
98 }
99}
◆ OpenMethodImplementationEditor
| void dbse::SchemaMethodEditor::OpenMethodImplementationEditor |
( |
QModelIndex | Index | ) |
|
|
privateslot |
Definition at line 217 of file SchemaMethodEditor.cpp.
218{
220 if ( !Row.isEmpty() ) {
221 QString name = QString::fromStdString(
224 SchemaMethodImplementationEditor * Editor = new SchemaMethodImplementationEditor (
226 Editor->show();
227 }
228 }
229}
bool ShouldOpenMethodImplementationEditor(QString Name)
◆ ParseToCreate()
| void dbse::SchemaMethodEditor::ParseToCreate |
( |
| ) |
|
◆ ParseToSave()
| void dbse::SchemaMethodEditor::ParseToSave |
( |
| ) |
|
Definition at line 101 of file SchemaMethodEditor.cpp.
102{
104 std::string method_name =
ui->MethodName->text().toStdString();
105 std::string method_description =
ui->DescriptionTextBox->toPlainText().toStdString();
106
107 if ( method_name !=
m_method->get_name() )
108 {
111 }
112
113 if ( method_description !=
m_method->get_description() )
114 {
117 method_description );
119 }
120
121 if ( changed )
122 {
124 }
125
126 close();
127}
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 46 of file SchemaMethodEditor.cpp.
47{
48 connect (
ui->buttonBox, SIGNAL ( accepted() ),
this, SLOT (
ProxySlot() ) );
49 connect (
ui->buttonBox, SIGNAL ( rejected() ),
this, SLOT ( close() ) );
50 connect (
ui->AddButton, SIGNAL ( clicked() ),
this,
52 connect (
ui->ImplementationsView, SIGNAL ( doubleClicked ( QModelIndex ) ),
this,
56}
void AddNewMethodImplementation()
void ClassUpdated(QString ClassName)
void OpenMethodImplementationEditor(QModelIndex Index)
◆ ShouldOpenMethodImplementationEditor()
| bool dbse::SchemaMethodEditor::ShouldOpenMethodImplementationEditor |
( |
QString | Name | ) |
|
|
private |
Definition at line 160 of file SchemaMethodEditor.cpp.
161{
162 bool WidgetFound = false;
163
164 for ( QWidget * Editor : QApplication::allWidgets() )
165 {
166 SchemaMethodImplementationEditor * Widget =
167 dynamic_cast<SchemaMethodImplementationEditor *> ( Editor );
168
169 if ( Widget != nullptr )
170 {
171 if ( ( Widget->objectName() ).compare ( Name ) == 0 )
172 {
173 Widget->raise();
174 Widget->setVisible ( true );
175 Widget->activateWindow();
176 WidgetFound = true;
177 }
178 }
179 }
180
181 return !WidgetFound;
182}
◆ ImplementationModel
◆ m_class
◆ m_method
◆ m_writable
| bool dbse::SchemaMethodEditor::m_writable |
|
private |
◆ 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: