23 QVBoxLayout *descLO =
new QVBoxLayout;
26 QGroupBox *descGB =
new QGroupBox(tr(
"Processor Description "),
this);
27 descGB->setLayout( descLO );
28 descGB->setMinimumHeight( 80 );
38 cb->addItem((*p).first.c_str());
41 connect(
cb, SIGNAL(highlighted(
const QString&)),
this, SLOT(
changeLabel(
const QString&)));
43 QVBoxLayout *typeLO =
new QVBoxLayout;
44 typeLO->addWidget( descGB );
45 typeLO->addWidget(
cb );
47 QGroupBox *typeGB =
new QGroupBox(tr(
"Processor Type "),
this);
48 typeGB->setLayout( typeLO );
54 QVBoxLayout *nameLO =
new QVBoxLayout;
55 nameLO->addWidget(
le );
57 QGroupBox *nameGB =
new QGroupBox(tr(
"Processor Name "),
this);
58 nameGB->setLayout( nameLO );
61 QPushButton *okButton =
new QPushButton(tr(
"OK"));
62 QPushButton *cancelButton =
new QPushButton(tr(
"&Cancel"));
64 okButton->setAutoDefault(
true);
66 connect(okButton, SIGNAL(clicked()),
this, SLOT(
addProcessor()));
67 connect(
this, SIGNAL(
apply()),
this, SLOT(accept()));
68 connect(cancelButton, SIGNAL(clicked()),
this, SLOT(reject()));
70 QHBoxLayout *buttonsLO =
new QHBoxLayout;
71 buttonsLO->addWidget( okButton );
72 buttonsLO->addWidget( cancelButton );
75 buttonsWG->setLayout( buttonsLO );
86 setWindowTitle(tr(
"Add New Processor"));
102 if(
le->displayText().isEmpty() ){
103 QMessageBox::warning(
this, tr(
"Add New Processor"),
104 tr(
"You cannot add a processor without name!!\nType a name in the appropriate edit box...") );
122 if( existsProc == 1 ){
126 error+=
"An inactive";
128 error+=
" processor with the same name & type already exists...\nPlease choose another name";
130 QMessageBox::warning(
this, tr(
"Add New Processor"), error );
APDialog(const APDialog &)=default
this class is a Marlin Steering File consistency check Tool.
ssMap getProcDesc()
returns a map with the processor descriptions
bool isInstalled(const std::string &type)
returns true if the processor with the given type is installed
void addProcessor(bool status, const std::string &name, const std::string &type, std::shared_ptr< StringParameters > p)
Add a new processor.
void changeLabel(const QString &text)
CMProcessor * getMProcs()
Returns the Marlin Processors.
ProcVec & getAProcs()
Returns the Active Processors.
int existsProcessor(const std::string &type, const std::string &name="")
Check if a processor of the given type with the given name already exists Returns 0 if the processor ...