DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dbe::ObjectCreator Class Reference

#include <ObjectCreator.hpp>

Inheritance diagram for dbe::ObjectCreator:
[legend]
Collaboration diagram for dbe::ObjectCreator:
[legend]

Signals

void stateChanged ()
 

Public Member Functions

 ~ObjectCreator ()
 
 ObjectCreator (dunedaq::conffwk::class_t const &classinfo, QWidget *parent=0)
 
 ObjectCreator (tref const &clonefrom, dunedaq::conffwk::relationship_t const &relation, QWidget *parent=0)
 
 ObjectCreator (tref const &clonefrom, QWidget *parent=0)
 
bool CanClose ()
 

Private Slots

void AddInclude ()
 
void UpdateActions ()
 
void UpdateActions (QString)
 
void CreateObject (bool openEditor=false)
 
void CreateOpenObject ()
 
void SetObjectChanged ()
 
void ActiveFileChanged (QString const &)
 
void MustPressReturn (QString const &)
 
void SetUID ()
 

Private Member Functions

void setup_editor ()
 
void setup_copy_editor ()
 
void SetComboClass ()
 
void SetController ()
 
void BuildFileModel ()
 
void SetStatusBar ()
 
QString GetMessage ()
 
bool GetState (int Flags)
 
void BuildContextMenu ()
 
void FillUidComboBox ()
 
void closeEvent (QCloseEvent *event)
 

Private Attributes

std::unique_ptr< dbe::Ui::ObjectCreator > ui
 
dunedaq::conffwk::class_t this_object_class
 
std::unique_ptr< trefthis_src_object
 
std::unique_ptr< trefthis_target_object
 
dunedaq::conffwk::relationship_t this_relation
 
QSortFilterProxyModel this_sort
 
FileModelthis_files
 
QStatusBar * this_status_bar
 
int this_state
 
bool UidSet
 
QString this_newuid
 
QString this_file_for_new_object
 
ObjectEditorthis_associated_editor
 
QMenu * ContextMenu
 
bool this_is_temporary
 
bool this_object_changed
 
bool this_create_copy
 
QUuid const uuid
 

Detailed Description

Definition at line 24 of file ObjectCreator.hpp.

Constructor & Destructor Documentation

◆ ~ObjectCreator()

dbe::ObjectCreator::~ObjectCreator ( )
default

◆ ObjectCreator() [1/3]

dbe::ObjectCreator::ObjectCreator ( dunedaq::conffwk::class_t const & classinfo,
QWidget * parent = 0 )

Create a new object of class

Parameters
classinfodescribes the class for which an object is to be created
parentof this widget

Definition at line 40 of file ObjectCreator.cpp.

41 :
42 QWidget ( parent ),
43 ui ( new Ui::ObjectCreator ),
44 this_object_class ( cinfo ),
45 this_target_object ( nullptr ),
47 this_files ( nullptr ),
48 this_status_bar ( nullptr ),
49 this_state ( 0 ),
50 UidSet ( false ),
51 this_associated_editor ( nullptr ),
52 ContextMenu ( nullptr ),
53 this_is_temporary ( false ),
54 this_object_changed ( false ),
55 this_create_copy ( false ),
56 uuid ( QUuid::createUuid() )
57{
58 ui->setupUi ( this );
59 this_status_bar = new QStatusBar ( ui->StatusFrame );
60
61 QString cname = QString::fromStdString ( this_object_class.p_name );
62 setWindowTitle ( QString ( "Create New Object of Class %1" ).arg ( cname ) );
63
65 ui->LineEditUID->setToolTip ( QString ( "Type Object unique ID and press ENTER" ) );
66
67 ui->ComboBoxForbiddenUid->hide();
68 ui->SetFileButton->hide();
69
74
75 int index = ui->ComboBoxClass->findText ( cname );
76 ui->ComboBoxClass->setCurrentIndex ( 1 ); // If index is 0 somehow this doesnt work
77 ui->ComboBoxClass->setCurrentIndex ( index ); // Now set it to the right value posssibly 0
79 ui->ComboBoxClass->setEditText ( cname );
80
81 ui->SetUidButton->setVisible ( false );
83
84 QSize SplitterSize = ui->splitter->size();
85 int Width = SplitterSize.width() / 2;
86
87 QList<int> List;
88 List.push_back ( Width );
89 List.push_back ( Width );
90
91 ui->splitter->setSizes ( List );
92}
ObjectEditor * this_associated_editor
dunedaq::conffwk::relationship_t this_relation
std::unique_ptr< dbe::Ui::ObjectCreator > ui
dunedaq::conffwk::class_t this_object_class
std::unique_ptr< tref > this_target_object
QStatusBar * this_status_bar

◆ ObjectCreator() [2/3]

dbe::ObjectCreator::ObjectCreator ( tref const & clonefrom,
dunedaq::conffwk::relationship_t const & relation,
QWidget * parent = 0 )

Clone an object of a given relation type

Parameters
anobjectis a reference to another object
relationis a relation to set
parentof this widget

Definition at line 100 of file ObjectCreator.cpp.

103 :
105 config::api::info::onclass::definition ( clonefrom.class_name(), false ), parent )
106{
107 this_target_object.reset ( new tref ( clonefrom ) );
108 this_relation = the_relation;
109}
ObjectCreator(dunedaq::conffwk::class_t const &classinfo, QWidget *parent=0)
static dunedaq::conffwk::class_t definition(std::string const &cn, bool direct_only)
inner::configobject::tref tref
Definition tref.hpp:30

◆ ObjectCreator() [3/3]

dbe::ObjectCreator::ObjectCreator ( tref const & clonefrom,
QWidget * parent = 0 )

Clone from a given object

Parameters
copyfromis the object to copy from
parent

Setting the same file as the object being copied

Definition at line 114 of file ObjectCreator.cpp.

115 :
116 QWidget ( parent ),
117 ui ( new Ui::ObjectCreator ),
119 config::api::info::onclass::definition ( clonefrom.class_name(), false ) ),
120 this_src_object ( new tref ( clonefrom ) ),
121 this_files ( nullptr ),
122 this_status_bar ( nullptr ),
123 UidSet ( false ),
124 this_associated_editor ( nullptr ),
125 ContextMenu ( nullptr ),
126 this_is_temporary ( false ),
127 this_object_changed ( false ),
128 this_create_copy ( true ),
129 uuid ( QUuid::createUuid() )
130{
131 ui->setupUi ( this );
132 this_status_bar = new QStatusBar ( ui->StatusFrame );
133
134 setWindowTitle (
135 QString ( "Create New Object of Class %1" ).arg (
136 QString::fromStdString ( this_object_class.p_name ) ) );
137
139 ui->LineEditUID->setToolTip ( QString ( "Type Object unique ID and press ENTER" ) );
140
141 ui->ComboBoxForbiddenUid->hide();
142 ui->SetFileButton->hide();
143
146 SetStatusBar();
148
149 int index = ui->ComboBoxClass->findText ( QString::fromStdString (
150 clonefrom.class_name() ) );
151
152 ui->ComboBoxClass->setCurrentIndex ( index );
154
156 QString const & fn = QString::fromStdString ( this_src_object->contained_in() );
157 QFileInfo fileinfo ( fn );
158 QModelIndexList ListOfMatch = this_files->match (
159 this_files->index ( 0, 0 ),
160 Qt::DisplayRole, fileinfo.fileName(), 1000,
161 Qt::MatchContains | Qt::MatchWrap | Qt::MatchRecursive );
162
163 ui->FileView->selectRow ( ListOfMatch.at ( 0 ).row() );
164
165 ActiveFileChanged ( fn );
166
167 // Set uid to the that of the object being copied
168 ui->LineEditUID->setText ( QString::fromStdString ( clonefrom.UID() ) );
169 ui->ComboBoxClass->setEditText ( QString::fromStdString ( clonefrom.class_name() ) );
170
171 ui->SetUidButton->setVisible ( false );
173
174 QSize spliter_size = ui->splitter->size();
175 int w = spliter_size.width() / 2;
176 ui->splitter->setSizes ( QList<int>
177 { w, w } );
178}
void ActiveFileChanged(QString const &)
std::unique_ptr< tref > this_src_object

Member Function Documentation

◆ ActiveFileChanged

void dbe::ObjectCreator::ActiveFileChanged ( QString const & fname)
privateslot

Definition at line 451 of file ObjectCreator.cpp.

452{
453 if ( fname.isEmpty() or not confaccessor::check_file_rw ( fname ) )
454 {
455 this_file_for_new_object = QString();
456 emit stateChanged();
457 return;
458 }
459
461 ui->FileView->setToolTip (
462 QString ( "Activate file which will store the new object: " ).append (
464 QString setFilesWithPath = QString ( "Selected File: %1" ).arg ( this_file_for_new_object );
465 QString setOnlyFiles = QString ( "Selected File: %1" ).arg (
466 QFileInfo ( this_file_for_new_object ).fileName() );
467 ui->FileLabel->setText ( setOnlyFiles );
468 ui->FileLabel->setToolTip ( setFilesWithPath );
469 ui->FileView->setStyleSheet ( "selection-background-color : rgb(190,238,158)" );
470 emit stateChanged();
471}
static bool check_file_rw(const QString &FileName)

◆ AddInclude

void dbe::ObjectCreator::AddInclude ( )
privateslot

Definition at line 371 of file ObjectCreator.cpp.

372{}

◆ BuildContextMenu()

void dbe::ObjectCreator::BuildContextMenu ( )
private

Definition at line 364 of file ObjectCreator.cpp.

365{
366 ContextMenu = new QMenu ( this );
367 ContextMenu->addAction ( tr ( "&Edit Include Files" ), this, SLOT ( AddInclude() ),
368 QKeySequence ( tr ( "Ctrl+Z" ) ) );
369}

◆ BuildFileModel()

void dbe::ObjectCreator::BuildFileModel ( )
private

Definition at line 230 of file ObjectCreator.cpp.

231{
232 if ( not confaccessor::db_implementation_name().contains ( "roksconflibs" ) )
233 {
234 if ( this_files != nullptr )
235 {
236 delete this_files;
237 this_files = nullptr;
238 }
239
240 this_files = new FileModel ( confaccessor::ref().GetIncludedFileCache() );
241
242 this_sort.setSourceModel ( this_files );
243 ui->FileView->setModel ( &this_sort );
244 ui->FileView->sortByColumn ( 2, Qt::DescendingOrder );
245 }
246}
QSortFilterProxyModel this_sort
static confaccessor & ref()
static QString db_implementation_name()

◆ CanClose()

bool dbe::ObjectCreator::CanClose ( )

Definition at line 618 of file ObjectCreator.cpp.

619{
620
621 if ( ( this_object_changed and ui->CreateObjectButton->isEnabled() ) or
623 {
624 int ret =
625 QMessageBox::question (
626 0,
627 tr ( "DBE - ObjectCreate" ),
628 QString ( "There are pending actions for this dialogue" ),
629 QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Cancel );
630
631 if ( ret == QMessageBox::Discard )
632 {
633 this_object_changed = false;
635
636 try
637 {
640 uuid );
641 }
642 catch ( daq::dbe::config_object_retrieval_result_is_null const & e )
643 {
644 // nothing specific handle needed in this , it is possible that there is no resul
645 }
646
647 return true;
648 }
649 else if ( ret == QMessageBox::Cancel )
650 {
651 return false;
652 }
653
654 return true;
655 }
656 else
657 {
658 return true;
659 }
660}
bool WasObjectChanged() const
static configobject::tref get(dbe::cokey const &desc)
bool delobj(inner::configobject::tref obj, QUuid const &src)

◆ closeEvent()

void dbe::ObjectCreator::closeEvent ( QCloseEvent * event)
private

Definition at line 662 of file ObjectCreator.cpp.

663{
664 if ( CanClose() )
665 {
667 {
668 this_associated_editor->close();
669 this_associated_editor = nullptr;
670 }
671
672 event->accept();
673 }
674 else
675 {
676 event->ignore();
677 }
678}

◆ CreateObject

void dbe::ObjectCreator::CreateObject ( bool openEditor = false)
privateslot

Called from ui when the create button has been pressed

Definition at line 407 of file ObjectCreator.cpp.

408{
409 setCursor ( Qt::WaitCursor );
410
411 BOOST_SCOPE_EXIT(this_)
412 {
413 this_->unsetCursor();
414 }
415 BOOST_SCOPE_EXIT_END
416
417 if ( this_file_for_new_object.isEmpty() )
418 {
419 ERROR ( "Object creation not feasible", "Object file must be selected" )
420 }
421 else if ( this_newuid.isEmpty() )
422 {
423 ERROR ( "Object creation not feasible", "Object name (uid) cannot be an empty string" );
424 }
425 else if ( this_associated_editor )
426 {
428
429 bool done = this_associated_editor->ParseToCreate ( this_newuid.toStdString(),
430 this_file_for_new_object.toStdString() );
433 this_object_changed = false;
434
435 if ( done )
436 {
437 close();
438
439 if ( openEditor == true ) {
440 ( new ObjectEditor ( dbe::inner::dbcontroller::get({this_newuid.toStdString(), this_object_class.p_name}) ) )->show();
441 }
442 }
443 }
444}
void SetUsedForCopy(bool Used)
bool ParseToCreate(std::string const &name, std::string const &filename)
#define ERROR(...)
Definition messenger.hpp:88

◆ CreateOpenObject

void dbe::ObjectCreator::CreateOpenObject ( )
privateslot

Definition at line 403 of file ObjectCreator.cpp.

403 {
404 CreateObject(true);
405}
void CreateObject(bool openEditor=false)

◆ FillUidComboBox()

void dbe::ObjectCreator::FillUidComboBox ( )
private

Definition at line 374 of file ObjectCreator.cpp.

375{
376 ui->ComboBoxForbiddenUid->clear();
377
378 QStringList listOfUID;
379 QString nameOfClass = QString ( this_object_class.p_name.c_str() );
380
381 std::vector<tref> const & vec = dbe::config::api::info::onclass::objects (
382 nameOfClass.toStdString(),
383 false );
384
385 for ( size_t i = 0; i < vec.size(); ++i )
386 {
387 ui->ComboBoxForbiddenUid->addItem ( QString ( vec.at ( i ).UID().c_str() ) );
388 listOfUID << QString ( vec.at ( i ).UID().c_str() );
389 }
390
391 if ( !listOfUID.isEmpty() )
392 {
393 ui->ComboBoxForbiddenUid->setToolTip (
394 QString ( "Already used object unique ID of class %1 " ).arg ( nameOfClass ) );
395 ui->ComboBoxForbiddenUid->show();
396 }
397
398 QVariant varFromList ( listOfUID );
399 ValidatorAcceptNoMatch * myval = new ValidatorAcceptNoMatch ( varFromList, this );
400 ui->LineEditUID->SetValidator ( myval );
401}
static std::vector< dbe::inner::configobject::tref > objects(std::string const &cname, bool const keep_inherited=true)

◆ GetMessage()

QString dbe::ObjectCreator::GetMessage ( )
private

Definition at line 332 of file ObjectCreator.cpp.

333{
334 if ( this_state == editorOk )
335 return QString (
336 "Now you can create object '%1' of class '%2'." ).arg ( this_newuid ).arg (
337 QString ( ( this_object_class.p_name ).c_str() ) );
339 return QString (
340 "Select class, set unique ID, select file where to create object and set obligatory attributes and relationships!" );
341 else if ( GetState ( classNotSelected ) )
342 {
343 return QString ( "First select class!" );
344 }
345 else if ( GetState ( fileNotSet ) )
346 return QString (
347 "Set active file where to create new object" );
348 else if ( GetState ( uidNotSet ) )
349 {
350 return QString ( "Set the object UID" );
351 }
352 else if ( GetState ( nullNotFilled ) )
353 return QString (
354 "All NOT NULL attributes or relationships must be set!" );
355
356 return QString ( "Problem to process Object Create operation!" );
357}
@ editorOk
@ nullNotFilled
@ classNotSelected
@ uidNotSet
@ fileNotSet
bool GetState(int Flags)

◆ GetState()

bool dbe::ObjectCreator::GetState ( int Flags)
private

Definition at line 359 of file ObjectCreator.cpp.

360{
361 return ( ( this_state & Flags ) == Flags );
362}

◆ MustPressReturn

void dbe::ObjectCreator::MustPressReturn ( QString const & )
privateslot

Definition at line 609 of file ObjectCreator.cpp.

610{
611 QPalette yellow;
612 yellow.setColor ( QPalette::Active, QPalette::Window, QColor ( "yellow" ) );
613
614 this_status_bar->setPalette ( yellow );
615 this_status_bar->showMessage ( QString ( "Press ENTER to set new UID!" ) );
616}

◆ SetComboClass()

void dbe::ObjectCreator::SetComboClass ( )
private

Definition at line 183 of file ObjectCreator.cpp.

184{
185 QStringList ListOfClasses ( dbe::config::api::info::onclass::allnames<QStringList>() );
186 ui->ComboBoxClass->addItems ( ListOfClasses );
187
188 QCompleter * completer = new QCompleter ( ui->ComboBoxClass->model(), ui->ComboBoxClass );
189 completer->setCaseSensitivity ( Qt::CaseInsensitive );
190 completer->setFilterMode(Qt::MatchContains);
191 ui->ComboBoxClass->setCompleter ( completer );
192 ui->ComboBoxClass->setEditable ( true );
193
194 QVariant VarFromList ( ListOfClasses );
195 ValidatorAcceptMatch * Validator = new ValidatorAcceptMatch ( VarFromList, this );
196 ui->ComboBoxClass->setValidator ( Validator );
197}

◆ SetController()

void dbe::ObjectCreator::SetController ( )
private

Definition at line 200 of file ObjectCreator.cpp.

201{
202 connect ( ui->FileView, SIGNAL ( stateChanged ( const QString & ) ),
203 this, SLOT ( ActiveFileChanged ( const QString & ) ),
204 Qt::UniqueConnection );
205
206 connect ( ui->CreateObjectButton, SIGNAL ( clicked() ), this, SLOT ( CreateObject() ),
207 Qt::UniqueConnection );
208
209 connect ( ui->CreateOpenObjectButton, SIGNAL ( clicked() ), this, SLOT ( CreateOpenObject() ),
210 Qt::UniqueConnection );
211
212 connect ( ui->ExitButton, SIGNAL ( clicked() ), this, SLOT ( close() ),
213 Qt::UniqueConnection );
214
215 connect ( ui->LineEditUID, SIGNAL ( textChanged ( QString ) ), this,
216 SLOT ( UpdateActions ( QString ) ),
217 Qt::UniqueConnection );
218
219 connect ( ui->LineEditUID, SIGNAL ( textEdited ( const QString & ) ),
220 this, SLOT ( MustPressReturn ( const QString & ) ),
221 Qt::UniqueConnection );
222
223 connect ( this, SIGNAL ( stateChanged() ), this, SLOT ( UpdateActions() ),
224 Qt::UniqueConnection );
225
226 connect ( this, SIGNAL ( stateChanged() ), this, SLOT ( SetObjectChanged() ),
227 Qt::UniqueConnection );
228}
void MustPressReturn(QString const &)

◆ SetObjectChanged

void dbe::ObjectCreator::SetObjectChanged ( )
privateslot

Definition at line 446 of file ObjectCreator.cpp.

447{
448 this_object_changed = true;
449}

◆ SetStatusBar()

void dbe::ObjectCreator::SetStatusBar ( )
private

Definition at line 248 of file ObjectCreator.cpp.

249{
250 this_status_bar->setSizeGripEnabled ( false );
251 this_status_bar->setAutoFillBackground ( true );
252 this_status_bar->showMessage (
253 QString ( "Select class, set new object UID, select file where to create object!" ) );
254 ui->StatusFrame->setFrameStyle ( QFrame::NoFrame );
255 ui->StatusLayout->addWidget ( this_status_bar );
256}

◆ SetUID

void dbe::ObjectCreator::SetUID ( )
privateslot

Definition at line 576 of file ObjectCreator.cpp.

577{
578 if ( this_file_for_new_object.isEmpty() )
579 {
580 ERROR ( "Object creation is not feasible", "Database file not selected" );
581 return;
582 }
583
584 if ( ui->LineEditUID->IsValid() )
585 {
586 this_newuid = ui->LineEditUID->text();
587
588 QString textForUser = QString ( "New Object ID: %1" ).arg ( this_newuid );
589 ui->UidLabel->setText ( textForUser );
590 }
591 else
592 {
593 WARN ( "Object creation is not feasible", "Invalid UID provided" );
594 return;
595 }
596
597 if ( !this_file_for_new_object.isEmpty() )
598 {
599 UidSet = true;
600 this_associated_editor->setDisabled ( false );
601 emit stateChanged();
602 }
603 else
604 {
605 TLOG_DEBUG(0) << "active file empty!! check!!" ;
606 }
607}
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
#define WARN(...)
Definition messenger.hpp:80

◆ setup_copy_editor()

void dbe::ObjectCreator::setup_copy_editor ( )
private

Definition at line 539 of file ObjectCreator.cpp.

540{
541 if ( ui->ComboBoxClass->IsValid() )
542 {
543 QString cname = QString::fromStdString ( this_object_class.p_name );
544
545 ui->ClassLabel->setText ( QString ( "Selected Class: %1" ).arg ( cname ) );
546 setWindowTitle ( QString ( "Create New Object of Class %1" ).arg ( cname ) );
547
548 this_associated_editor = new ObjectEditor ( *this_src_object, this, true );
549 this_associated_editor->setWindowModality ( Qt::NonModal );
552 this_associated_editor->setDisabled ( true );
553
554 ui->EditorLayout->addWidget ( this_associated_editor );
555 connect ( this_associated_editor, SIGNAL ( WidgetUpdated() ), this,
556 SLOT ( UpdateActions() ),
557 Qt::UniqueConnection );
558
560 ui->ComboBoxForbiddenUid->hide();
561
562 QString tmpSt = ui->LineEditUID->text();
563
564 if ( !tmpSt.isEmpty() )
565 {
566 ui->LineEditUID->clear();
567 ui->LineEditUID->setText ( tmpSt );
568 SetUID();
569 }
570
571 emit stateChanged();
572 this_object_changed = false;
573 }
574}
void HideDetailWidget(bool Hide)

◆ setup_editor()

void dbe::ObjectCreator::setup_editor ( )
private

To anyone wondering this is a list of all the uids that cannot be used(at some point i thought this could be useful to show to the user) // – that was a very stupid idea!

Definition at line 473 of file ObjectCreator.cpp.

474{
475 if ( ui->ComboBoxClass->IsValid() )
476 {
477
478 this_newuid = QString();
479 QString cname = QString::fromStdString ( this_object_class.p_name );
480
481 // Create the editor for the new object to be able to modify attributes before creation
482 this_associated_editor = new ObjectEditor ( cname.toStdString(), this );
483 this_associated_editor->setWindowModality ( Qt::NonModal );
485 this_associated_editor->setDisabled ( true );
486 ui->EditorLayout->addWidget ( this_associated_editor );
487
488 {
489 // Set appropriately the stretch factor such that contents are resized
490 // favoring the object editor side
491 QSizePolicy pol = ui->splitter->widget ( 1 )->sizePolicy();
492 pol.setHorizontalStretch ( 2 );
493// pol.setHorizontalPolicy(QSizePolicy::Maximum);
494 ui->splitter->widget ( 1 )->setSizePolicy ( pol );
495 }
496
497 {
498 // Set horizontal size of the editor pane to the first widget size
499 this_associated_editor->resize ( this_associated_editor->sizeHint() );
500 QList<QTableWidget *> const & editor_widgets
501 {
502 this_associated_editor->findChildren<QTableWidget *>()
503 };
504
505 this_associated_editor->setMinimumWidth ( editor_widgets[0]->width() / 2 );
506
507 QRect this_widget_geometry = this->geometry();
508 this_widget_geometry.setWidth ( editor_widgets[0]->width() +
509 ui->ObjectCreatorWidget->width() );
510 this->setGeometry ( this_widget_geometry );
511
512 }
513
514 // Set the labels to the class name
515 ui->ClassLabel->setText ( QString ( "Selected Class: %1" ).arg ( cname ) );
516 setWindowTitle ( QString ( "Create New Object of class %1" ).arg ( cname ) );
517
518 connect ( this_associated_editor, SIGNAL ( WidgetUpdated() ), this,
519 SLOT ( UpdateActions() ),
520 Qt::UniqueConnection );
521
523 ui->ComboBoxForbiddenUid->hide();
524
525 QString const & linetext = ui->LineEditUID->text();
526
527 if ( !linetext.isEmpty() )
528 {
529 ui->LineEditUID->clear();
530 ui->LineEditUID->setText ( linetext );
531 SetUID();
532 }
533
534 emit stateChanged();
535 this_object_changed = false;
536 }
537}

◆ stateChanged

void dbe::ObjectCreator::stateChanged ( )
signal

◆ UpdateActions [1/2]

void dbe::ObjectCreator::UpdateActions ( )
privateslot

Definition at line 258 of file ObjectCreator.cpp.

259{
260 bool ReleaseEditor = true;
262
263 if ( !ui->LineEditUID->IsValid() || ui->LineEditUID->text().isEmpty() )
264 {
266 ReleaseEditor = false;
267 this_newuid = QString();
268 }
269 else
270 {
271 this_state &= ~uidNotSet;
272 this_newuid = ui->LineEditUID->text();
273 }
274
275 if ( this_file_for_new_object.isEmpty() )
276 {
278 ReleaseEditor = false;
279 }
280 else
281 {
282 this_state &= ~fileNotSet;
283 }
284
285 if ( ReleaseEditor )
286 {
287 this_associated_editor->setEnabled ( true );
288 }
289
290 if ( this_associated_editor != nullptr )
291 {
293 {
295 }
296 else
297 {
298 this_state &= ~nullNotFilled;
299 }
300 }
301
302 if ( this_state == editorOk )
303 {
304 ui->CreateObjectButton->setEnabled ( true );
305 ui->CreateObjectButton->setPalette ( StyleUtility::PaleGreenPalleteButton );
306
307 ui->CreateOpenObjectButton->setEnabled ( true );
308 ui->CreateOpenObjectButton->setPalette ( StyleUtility::PaleGreenPalleteButton );
309
310 this_status_bar->setPalette ( QApplication::palette ( this ) );
311 this_status_bar->showMessage ( GetMessage() );
312 }
313 else
314 {
315 ui->CreateObjectButton->setEnabled ( false );
316 ui->CreateOpenObjectButton->setEnabled ( false );
317 QPalette buttonAlert;
318 buttonAlert.setColor ( QPalette::Disabled, QPalette::Button, QColor ( "grey" ) );
319 ui->CreateObjectButton->setPalette ( buttonAlert );
320 ui->CreateOpenObjectButton->setPalette ( buttonAlert );
322 this_status_bar->showMessage ( GetMessage() );
323 }
324}
bool IsEditorValid() const
static QPalette PaleGreenPalleteButton
static QPalette WarningStatusBarPalleteWindow

◆ UpdateActions [2/2]

void dbe::ObjectCreator::UpdateActions ( QString Dummy)
privateslot

Definition at line 326 of file ObjectCreator.cpp.

327{
328 Q_UNUSED ( Dummy )
330}

Member Data Documentation

◆ ContextMenu

QMenu* dbe::ObjectCreator::ContextMenu
private

Definition at line 110 of file ObjectCreator.hpp.

◆ this_associated_editor

ObjectEditor* dbe::ObjectCreator::this_associated_editor
private

Definition at line 109 of file ObjectCreator.hpp.

◆ this_create_copy

bool dbe::ObjectCreator::this_create_copy
private

Definition at line 114 of file ObjectCreator.hpp.

◆ this_file_for_new_object

QString dbe::ObjectCreator::this_file_for_new_object
private

Definition at line 108 of file ObjectCreator.hpp.

◆ this_files

FileModel* dbe::ObjectCreator::this_files
private

Definition at line 100 of file ObjectCreator.hpp.

◆ this_is_temporary

bool dbe::ObjectCreator::this_is_temporary
private

Definition at line 112 of file ObjectCreator.hpp.

◆ this_newuid

QString dbe::ObjectCreator::this_newuid
private

Definition at line 107 of file ObjectCreator.hpp.

◆ this_object_changed

bool dbe::ObjectCreator::this_object_changed
private

Definition at line 113 of file ObjectCreator.hpp.

◆ this_object_class

dunedaq::conffwk::class_t dbe::ObjectCreator::this_object_class
private

Definition at line 93 of file ObjectCreator.hpp.

◆ this_relation

dunedaq::conffwk::relationship_t dbe::ObjectCreator::this_relation
private

Definition at line 97 of file ObjectCreator.hpp.

◆ this_sort

QSortFilterProxyModel dbe::ObjectCreator::this_sort
private

Definition at line 99 of file ObjectCreator.hpp.

◆ this_src_object

std::unique_ptr<tref> dbe::ObjectCreator::this_src_object
private

Definition at line 95 of file ObjectCreator.hpp.

◆ this_state

int dbe::ObjectCreator::this_state
private

Definition at line 104 of file ObjectCreator.hpp.

◆ this_status_bar

QStatusBar* dbe::ObjectCreator::this_status_bar
private

Definition at line 102 of file ObjectCreator.hpp.

◆ this_target_object

std::unique_ptr<tref> dbe::ObjectCreator::this_target_object
private

Definition at line 96 of file ObjectCreator.hpp.

◆ ui

std::unique_ptr<dbe::Ui::ObjectCreator> dbe::ObjectCreator::ui
private

Definition at line 91 of file ObjectCreator.hpp.

◆ UidSet

bool dbe::ObjectCreator::UidSet
private

Definition at line 106 of file ObjectCreator.hpp.

◆ uuid

QUuid const dbe::ObjectCreator::uuid
private

Definition at line 116 of file ObjectCreator.hpp.


The documentation for this class was generated from the following files: