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_method->get_name() ;
78 setWindowTitle (QString::fromStdString(title));
79 std::string name = m_method->get_name();
80 setObjectName ( QString::fromStdString(name) );
90 std::string MethodLanguage = ui->MethodImplementationLanguage->text().toStdString();
91 std::string MethodPrototype = ui->MethodImplementationPrototype->text().toStdString();
92 std::string MethodDescription = ui->MethodImplementationDescription->toPlainText()
95 if ( MethodLanguage != m_implementation->get_language() )
104 if ( MethodPrototype != m_implementation->get_prototype() )
113 if ( MethodDescription != m_implementation->get_body() )
132 if ( ui->MethodImplementationLanguage->text().isEmpty()
133 && ui->MethodImplementationLanguage->text().isEmpty()
134 && ui->MethodImplementationDescription->toPlainText().isEmpty() ) {
140 if ( ui->MethodImplementationLanguage->text().isEmpty() )
142 QMessageBox::warning (
144 QString (
"Please Provide a Language for the method implementation !" ) );
148 if ( ui->MethodImplementationPrototype->text().isEmpty() )
150 QMessageBox::warning (
152 QString (
"Please Provide a prototype for the method implementation !" ) );
156 std::string MethodLanguage = ui->MethodImplementationLanguage->text().toStdString();
157 std::string MethodPrototype = ui->MethodImplementationPrototype->text().toStdString();
158 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.