5#include "ui_SchemaMethodImplementationEditor.h"
17 m_implementation ( Implementation ),
20 QWidget::setAttribute(Qt::WA_DeleteOnClose);
34 m_implementation ( nullptr ),
37 QWidget::setAttribute(Qt::WA_DeleteOnClose);
45 connect ( ui->SaveButton, SIGNAL ( clicked() ),
this, SLOT ( ProxySlot() ) );
47 SLOT ( ClassUpdated ( QString ) ) );
52 if(!UsedNew && class_name.toStdString() == m_class->get_name()) {
53 if(m_method->find_implementation(m_implementation->get_language()) !=
nullptr) {
63 ui->MethodImplementationLanguage->setText (
64 QString::fromStdString ( m_implementation->get_language() ) );
65 ui->MethodImplementationPrototype->setText (
66 QString::fromStdString ( m_implementation->get_prototype() ) );
67 ui->MethodImplementationDescription->setPlainText (
68 QString::fromStdString ( m_implementation->get_body() ) );
70 std::string name = m_class->get_name() + m_method->get_name()
71 + m_implementation->get_language();
72 setObjectName ( QString::fromStdString(name) );
77 std::string title =
"Method Implementation for " + m_class->get_name() +
"::" + m_method->get_name();
78 setWindowTitle (QString::fromStdString(title));
81 std::string name = m_class->get_name() + m_method->get_name();
82 setObjectName ( QString::fromStdString(name) );
92 std::string MethodLanguage = ui->MethodImplementationLanguage->text().toStdString();
93 std::string MethodPrototype = ui->MethodImplementationPrototype->text().toStdString();
95 std::string MethodDescription = ui->MethodImplementationDescription->toPlainText()
98 if ( MethodLanguage != m_implementation->get_language() )
107 if ( MethodPrototype != m_implementation->get_prototype() )
116 if ( MethodDescription != m_implementation->get_body() )
135 if ( ui->MethodImplementationLanguage->text().isEmpty()
136 && ui->MethodImplementationLanguage->text().isEmpty()
137 && ui->MethodImplementationDescription->toPlainText().isEmpty() ) {
143 if ( ui->MethodImplementationLanguage->text().isEmpty() )
145 QMessageBox::warning (
147 QString (
"Please Provide a Language for the method implementation !" ) );
151 if ( ui->MethodImplementationPrototype->text().isEmpty() )
153 QMessageBox::warning (
155 QString (
"Please Provide a prototype for the method implementation !" ) );
159 std::string MethodLanguage = ui->MethodImplementationLanguage->text().toStdString();
160 std::string MethodPrototype = ui->MethodImplementationPrototype->text().toStdString();
161 std::string MethodDescription = ui->MethodImplementationDescription->toPlainText()
static KernelWrapper & GetInstance()
void PushSetMethodImplementationLanguage(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, std::string Language)
Method implementation commands.
void PushSetMethodImplementationPrototype(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, std::string Prototype)
void PushAddMethodImplementationComand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string Language, std::string Prototype, std::string Body)
void PushSetMethodImplementationBody(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, std::string Body)
std::unique_ptr< dbse::Ui::SchemaMethodImplementationEditor > ui
void ClassUpdated(QString ClassName)
SchemaMethodImplementationEditor(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, QWidget *parent=nullptr)
~SchemaMethodImplementationEditor()
OKS method implementation class.