DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
dbe
src
widgets
ObjectCreator.cpp
Go to the documentation of this file.
1
// DUNE DAQ modification notice:
2
// This file has been modified from the original ATLAS dbe source for the DUNE DAQ project.
3
// Fork baseline commit: dbe-02-12-17 (2022-05-12).
4
// Renamed since fork: no.
5
6
#include "
dbe/ObjectCreator.hpp
"
7
#include "
dbe/StyleUtility.hpp
"
8
#include "
dbe/Validator.hpp
"
9
#include "
dbe/confaccessor.hpp
"
10
#include "
dbe/config_api.hpp
"
11
#include "
dbe/config_api_commands.hpp
"
12
#include "
dbe/config_api_graph.hpp
"
13
#include "
dbe/config_api_set.hpp
"
14
#include "
dbe/messenger.hpp
"
15
#include "ui_ObjectCreator.h"
16
17
#include "
logging/Logging.hpp
"
18
19
#include <boost/scope_exit.hpp>
20
21
#include <QCloseEvent>
22
#include <QCompleter>
23
#include <QFileDialog>
24
#include <QFileInfo>
25
#include <QMenu>
26
#include <QMessageBox>
27
28
enum
EditStates
29
{
30
editorOk
= 0,
31
classNotSelected
= 1,
32
uidNotSet
= 2,
33
fileNotSet
= 4,
34
nullNotFilled
= 8
35
};
36
37
//------------------------------------------------------------------------------------------
38
dbe::ObjectCreator::~ObjectCreator
() =
default
;
39
//------------------------------------------------------------------------------------------
40
41
//------------------------------------------------------------------------------------------
42
/*
43
* Create an object in a class
44
*/
45
dbe::ObjectCreator::ObjectCreator
(
dunedaq::conffwk::class_t
const
& cinfo, QWidget* parent)
46
: QWidget(parent)
47
,
ui
(new
Ui
::
ObjectCreator
)
48
,
this_object_class
(cinfo)
49
,
this_target_object
(nullptr)
50
,
this_relation
(
dunedaq
::
conffwk
::relationship_t())
51
,
this_files
(nullptr)
52
,
this_status_bar
(nullptr)
53
,
this_state
(0)
54
,
UidSet
(false)
55
,
this_associated_editor
(nullptr)
56
,
ContextMenu
(nullptr)
57
,
this_is_temporary
(false)
58
,
this_object_changed
(false)
59
,
this_create_copy
(false)
60
,
uuid
(QUuid::createUuid())
61
{
62
ui
->setupUi(
this
);
63
this_status_bar
=
new
QStatusBar(
ui
->StatusFrame);
64
65
QString cname = QString::fromStdString(
this_object_class
.
p_name
);
66
setWindowTitle(QString(
"Create New Object of Class %1"
).arg(cname));
67
68
SetComboClass
();
69
ui
->LineEditUID->setToolTip(QString(
"Type Object unique ID and press ENTER"
));
70
71
ui
->ComboBoxForbiddenUid->hide();
72
ui
->SetFileButton->hide();
73
74
SetController
();
75
BuildFileModel
();
76
SetStatusBar
();
77
BuildContextMenu
();
78
79
int
index =
ui
->ComboBoxClass->findText(cname);
80
ui
->ComboBoxClass->setCurrentIndex(1);
// If index is 0 somehow this doesnt work
81
ui
->ComboBoxClass->setCurrentIndex(index);
// Now set it to the right value posssibly 0
82
setup_editor
();
83
ui
->ComboBoxClass->setEditText(cname);
84
85
ui
->SetUidButton->setVisible(
false
);
86
UpdateActions
();
87
88
QSize SplitterSize =
ui
->splitter->size();
89
int
Width = SplitterSize.width() / 2;
90
91
QList<int> List;
92
List.push_back(Width);
93
List.push_back(Width);
94
95
ui
->splitter->setSizes(List);
96
}
97
98
//------------------------------------------------------------------------------------------
99
100
//------------------------------------------------------------------------------------------
101
/*
102
* Clone an object in a class , uid will be required to be set explicitly
103
*/
104
dbe::ObjectCreator::ObjectCreator
(
tref
const
& clonefrom,
105
dunedaq::conffwk::relationship_t
const
& the_relation,
106
QWidget* parent)
107
:
ObjectCreator
(
config
::api::info::onclass::definition(clonefrom.class_name(), false), parent)
108
{
109
this_target_object
.reset(
new
tref
(clonefrom));
110
this_relation
= the_relation;
111
}
112
113
//------------------------------------------------------------------------------------------
114
115
//------------------------------------------------------------------------------------------
116
dbe::ObjectCreator::ObjectCreator
(
tref
const
& clonefrom, QWidget* parent)
117
: QWidget(parent)
118
,
ui
(new
Ui
::
ObjectCreator
)
119
,
this_object_class
(
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(QString(
"Create New Object of Class %1"
).arg(QString::fromStdString(
this_object_class
.
p_name
)));
135
136
SetComboClass
();
137
ui
->LineEditUID->setToolTip(QString(
"Type Object unique ID and press ENTER"
));
138
139
ui
->ComboBoxForbiddenUid->hide();
140
ui
->SetFileButton->hide();
141
142
SetController
();
143
BuildFileModel
();
144
SetStatusBar
();
145
BuildContextMenu
();
146
147
int
index =
ui
->ComboBoxClass->findText(QString::fromStdString(clonefrom.
class_name
()));
148
149
ui
->ComboBoxClass->setCurrentIndex(index);
150
setup_copy_editor
();
151
153
QString
const
& fn = QString::fromStdString(
this_src_object
->contained_in());
154
QFileInfo fileinfo(fn);
155
QModelIndexList ListOfMatch =
this_files
->match(
this_files
->index(0, 0),
156
Qt::DisplayRole,
157
fileinfo.fileName(),
158
1000,
159
Qt::MatchContains | Qt::MatchWrap | Qt::MatchRecursive);
160
161
ui
->FileView->selectRow(ListOfMatch.at(0).row());
162
163
ActiveFileChanged
(fn);
164
165
// Set uid to the that of the object being copied
166
ui
->LineEditUID->setText(QString::fromStdString(clonefrom.
UID
()));
167
ui
->ComboBoxClass->setEditText(QString::fromStdString(clonefrom.
class_name
()));
168
169
ui
->SetUidButton->setVisible(
false
);
170
UpdateActions
();
171
172
QSize spliter_size =
ui
->splitter->size();
173
int
w = spliter_size.width() / 2;
174
ui
->splitter->setSizes(QList<int>{ w, w });
175
}
176
177
//------------------------------------------------------------------------------------------
178
179
//------------------------------------------------------------------------------------------
180
void
181
dbe::ObjectCreator::SetComboClass
()
182
{
183
QStringList ListOfClasses(
dbe::config::api::info::onclass::allnames<QStringList>
());
184
ui
->ComboBoxClass->addItems(ListOfClasses);
185
186
QCompleter* completer =
new
QCompleter(
ui
->ComboBoxClass->model(),
ui
->ComboBoxClass);
187
completer->setCaseSensitivity(Qt::CaseInsensitive);
188
completer->setFilterMode(Qt::MatchContains);
189
ui
->ComboBoxClass->setCompleter(completer);
190
ui
->ComboBoxClass->setEditable(
true
);
191
192
QVariant VarFromList(ListOfClasses);
193
ValidatorAcceptMatch
* Validator =
new
ValidatorAcceptMatch
(VarFromList,
this
);
194
ui
->ComboBoxClass->setValidator(Validator);
195
}
196
197
void
198
dbe::ObjectCreator::SetController
()
199
{
200
connect(
ui
->FileView,
201
SIGNAL(
stateChanged
(
const
QString&)),
202
this
,
203
SLOT(
ActiveFileChanged
(
const
QString&)),
204
Qt::UniqueConnection);
205
206
connect(
ui
->CreateObjectButton, SIGNAL(clicked()),
this
, SLOT(
CreateObject
()), Qt::UniqueConnection);
207
208
connect(
ui
->CreateOpenObjectButton, SIGNAL(clicked()),
this
, SLOT(
CreateOpenObject
()), Qt::UniqueConnection);
209
210
connect(
ui
->ExitButton, SIGNAL(clicked()),
this
, SLOT(close()), Qt::UniqueConnection);
211
212
connect(
ui
->LineEditUID, SIGNAL(textChanged(QString)),
this
, SLOT(
UpdateActions
(QString)), Qt::UniqueConnection);
213
214
connect(
ui
->LineEditUID,
215
SIGNAL(textEdited(
const
QString&)),
216
this
,
217
SLOT(
MustPressReturn
(
const
QString&)),
218
Qt::UniqueConnection);
219
220
connect(
this
, SIGNAL(
stateChanged
()),
this
, SLOT(
UpdateActions
()), Qt::UniqueConnection);
221
222
connect(
this
, SIGNAL(
stateChanged
()),
this
, SLOT(
SetObjectChanged
()), Qt::UniqueConnection);
223
}
224
225
void
226
dbe::ObjectCreator::BuildFileModel
()
227
{
228
if
(not
confaccessor::db_implementation_name
().contains(
"roksconflibs"
)) {
229
if
(
this_files
!=
nullptr
) {
230
delete
this_files
;
231
this_files
=
nullptr
;
232
}
233
234
this_files
=
new
FileModel
(
confaccessor::ref
().GetIncludedFileCache());
235
236
this_sort
.setSourceModel(
this_files
);
237
ui
->FileView->setModel(&
this_sort
);
238
ui
->FileView->sortByColumn(2, Qt::DescendingOrder);
239
240
// ui->FileView->HideReadOnlyFilesSlot(true);
241
ui
->FileView->setColumnHidden(2,
true
);
242
ui
->FileView->setColumnHidden(3,
true
);
243
ui
->FileView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
244
}
245
}
246
247
void
248
dbe::ObjectCreator::SetStatusBar
()
249
{
250
this_status_bar
->setSizeGripEnabled(
false
);
251
this_status_bar
->setAutoFillBackground(
true
);
252
this_status_bar
->showMessage(QString(
"Select class, set new object UID, select file where to create object!"
));
253
ui
->StatusFrame->setFrameStyle(QFrame::NoFrame);
254
ui
->StatusLayout->addWidget(
this_status_bar
);
255
}
256
257
void
258
dbe::ObjectCreator::UpdateActions
()
259
{
260
bool
ReleaseEditor =
true
;
261
this_state
=
editorOk
;
262
263
if
(!
ui
->LineEditUID->IsValid() ||
ui
->LineEditUID->text().isEmpty()) {
264
this_state
|=
uidNotSet
;
265
ReleaseEditor =
false
;
266
this_newuid
= QString();
267
}
else
{
268
this_state
&=
~uidNotSet
;
269
this_newuid
=
ui
->LineEditUID->text();
270
}
271
272
if
(
this_file_for_new_object
.isEmpty()) {
273
this_state
|=
fileNotSet
;
274
ReleaseEditor =
false
;
275
}
else
{
276
this_state
&=
~fileNotSet
;
277
}
278
279
if
(ReleaseEditor) {
280
this_associated_editor
->setEnabled(
true
);
281
}
282
283
if
(
this_associated_editor
!=
nullptr
) {
284
if
(!
this_associated_editor
->IsEditorValid()) {
285
this_state
|=
nullNotFilled
;
286
}
else
{
287
this_state
&=
~nullNotFilled
;
288
}
289
}
290
291
if
(
this_state
==
editorOk
) {
292
ui
->CreateObjectButton->setEnabled(
true
);
293
ui
->CreateObjectButton->setPalette(
StyleUtility::PaleGreenPalleteButton
);
294
295
ui
->CreateOpenObjectButton->setEnabled(
true
);
296
ui
->CreateOpenObjectButton->setPalette(
StyleUtility::PaleGreenPalleteButton
);
297
298
this_status_bar
->setPalette(QApplication::palette(
this
));
299
this_status_bar
->showMessage(
GetMessage
());
300
}
else
{
301
ui
->CreateObjectButton->setEnabled(
false
);
302
ui
->CreateOpenObjectButton->setEnabled(
false
);
303
QPalette buttonAlert;
304
buttonAlert.setColor(QPalette::Disabled, QPalette::Button, QColor(
"grey"
));
305
ui
->CreateObjectButton->setPalette(buttonAlert);
306
ui
->CreateOpenObjectButton->setPalette(buttonAlert);
307
this_status_bar
->setPalette(
StyleUtility::WarningStatusBarPalleteWindow
);
308
this_status_bar
->showMessage(
GetMessage
());
309
}
310
}
311
312
void
313
dbe::ObjectCreator::UpdateActions
(QString Dummy)
314
{
315
Q_UNUSED(Dummy)
316
UpdateActions
();
317
}
318
319
QString
320
dbe::ObjectCreator::GetMessage
()
321
{
322
if
(
this_state
==
editorOk
)
323
return
QString(
"Now you can create object '%1' of class '%2'."
)
324
.arg(
this_newuid
)
325
.arg(QString((
this_object_class
.p_name).c_str()));
326
else
if
(
GetState
(
classNotSelected
|
uidNotSet
|
fileNotSet
))
327
return
QString(
"Select class, set unique ID, select file where to create object and set obligatory attributes and "
328
"relationships!"
);
329
else
if
(
GetState
(
classNotSelected
)) {
330
return
QString(
"First select class!"
);
331
}
else
if
(
GetState
(
fileNotSet
))
332
return
QString(
"Set active file where to create new object"
);
333
else
if
(
GetState
(
uidNotSet
)) {
334
return
QString(
"Set the object UID"
);
335
}
else
if
(
GetState
(
nullNotFilled
))
336
return
QString(
"All NOT NULL attributes or relationships must be set!"
);
337
338
return
QString(
"Problem to process Object Create operation!"
);
339
}
340
341
bool
342
dbe::ObjectCreator::GetState
(
int
Flags)
343
{
344
return
((
this_state
& Flags) == Flags);
345
}
346
347
void
348
dbe::ObjectCreator::BuildContextMenu
()
349
{
350
ContextMenu
=
new
QMenu(
this
);
351
ContextMenu
->addAction(tr(
"&Edit Include Files"
),
this
, SLOT(
AddInclude
()), QKeySequence(tr(
"Ctrl+Z"
)));
352
}
353
354
void
355
dbe::ObjectCreator::AddInclude
()
356
{
357
}
358
359
void
360
dbe::ObjectCreator::FillUidComboBox
()
361
{
362
ui
->ComboBoxForbiddenUid->clear();
363
364
QStringList listOfUID;
365
QString nameOfClass = QString(
this_object_class
.p_name.c_str());
366
367
std::vector<tref>
const
& vec =
dbe::config::api::info::onclass::objects
(nameOfClass.toStdString(),
false
);
368
369
for
(
size_t
i = 0; i < vec.size(); ++i) {
370
ui
->ComboBoxForbiddenUid->addItem(QString(vec.at(i).UID().c_str()));
371
listOfUID << QString(vec.at(i).UID().c_str());
372
}
373
374
if
(!listOfUID.isEmpty()) {
375
ui
->ComboBoxForbiddenUid->setToolTip(QString(
"Already used object unique ID of class %1 "
).arg(nameOfClass));
376
ui
->ComboBoxForbiddenUid->show();
377
}
378
379
QVariant varFromList(listOfUID);
380
ValidatorAcceptNoMatch
* myval =
new
ValidatorAcceptNoMatch
(varFromList,
this
);
381
ui
->LineEditUID->SetValidator(myval);
382
}
383
384
void
385
dbe::ObjectCreator::CreateOpenObject
()
386
{
387
CreateObject
(
true
);
388
}
389
390
void
391
dbe::ObjectCreator::CreateObject
(
bool
openEditor)
392
{
393
setCursor(Qt::WaitCursor);
394
395
BOOST_SCOPE_EXIT(this_)
396
{
397
this_->unsetCursor();
398
}
399
BOOST_SCOPE_EXIT_END
400
401
if
(
this_file_for_new_object
.isEmpty()) {
402
ERROR
(
"Object creation not feasible"
,
"Object file must be selected"
)
403
}
else
if
(
this_newuid
.isEmpty()) {
404
ERROR
(
"Object creation not feasible"
,
"Object name (uid) cannot be an empty string"
);
405
}
else
if
(
this_associated_editor
) {
406
this_associated_editor
->SetUsedForCopy(
true
);
407
408
bool
done =
409
this_associated_editor
->ParseToCreate(
this_newuid
.toStdString(),
this_file_for_new_object
.toStdString());
410
this_associated_editor
->SetUsedForCopy(
false
);
411
this_associated_editor
->ResetObjectChanged();
412
this_object_changed
=
false
;
413
414
if
(done) {
415
close();
416
417
if
(openEditor ==
true
) {
418
(
new
ObjectEditor
(
dbe::inner::dbcontroller::get
({
this_newuid
.toStdString(),
this_object_class
.p_name })))
419
->show();
420
}
421
}
422
}
423
}
424
425
void
426
dbe::ObjectCreator::SetObjectChanged
()
427
{
428
this_object_changed
=
true
;
429
}
430
431
void
432
dbe::ObjectCreator::ActiveFileChanged
(
const
QString& fname)
433
{
434
if
(fname.isEmpty() or not
confaccessor::check_file_rw
(fname)) {
435
this_file_for_new_object
= QString();
436
emit
stateChanged
();
437
return
;
438
}
439
440
this_file_for_new_object
= fname;
441
ui
->FileView->setToolTip(QString(
"Activate file which will store the new object: "
).append(
this_file_for_new_object
));
442
QString setFilesWithPath = QString(
"Selected File: %1"
).arg(
this_file_for_new_object
);
443
QString setOnlyFiles = QString(
"Selected File: %1"
).arg(QFileInfo(
this_file_for_new_object
).fileName());
444
ui
->FileLabel->setText(setOnlyFiles);
445
ui
->FileLabel->setToolTip(setFilesWithPath);
446
ui
->FileView->setStyleSheet(
"selection-background-color : rgb(190,238,158)"
);
447
emit
stateChanged
();
448
}
449
450
void
451
dbe::ObjectCreator::setup_editor
()
452
{
453
if
(
ui
->ComboBoxClass->IsValid()) {
454
455
this_newuid
= QString();
456
QString cname = QString::fromStdString(
this_object_class
.p_name);
457
458
// Create the editor for the new object to be able to modify attributes before creation
459
this_associated_editor
=
new
ObjectEditor
(cname.toStdString(),
this
);
460
this_associated_editor
->setWindowModality(Qt::NonModal);
461
this_associated_editor
->HideDetailWidget(
true
);
462
this_associated_editor
->setDisabled(
true
);
463
ui
->EditorLayout->addWidget(
this_associated_editor
);
464
465
{
466
// Set appropriately the stretch factor such that contents are resized
467
// favoring the object editor side
468
QSizePolicy pol =
ui
->splitter->widget(1)->sizePolicy();
469
pol.setHorizontalStretch(2);
470
// pol.setHorizontalPolicy(QSizePolicy::Maximum);
471
ui
->splitter->widget(1)->setSizePolicy(pol);
472
}
473
474
{
475
// Set horizontal size of the editor pane to the first widget size
476
this_associated_editor
->resize(
this_associated_editor
->sizeHint());
477
QList<QTableWidget*>
const
& editor_widgets{
this_associated_editor
->findChildren<QTableWidget*>() };
478
479
this_associated_editor
->setMinimumWidth(editor_widgets[0]->width() / 2);
480
481
QRect this_widget_geometry = this->geometry();
482
this_widget_geometry.setWidth(editor_widgets[0]->width() +
ui
->ObjectCreatorWidget->width());
483
this->setGeometry(this_widget_geometry);
484
}
485
486
// Set the labels to the class name
487
ui
->ClassLabel->setText(QString(
"Selected Class: %1"
).arg(cname));
488
setWindowTitle(QString(
"Create New Object of class %1"
).arg(cname));
489
490
connect(
this_associated_editor
, SIGNAL(WidgetUpdated()),
this
, SLOT(
UpdateActions
()), Qt::UniqueConnection);
491
492
FillUidComboBox
();
493
ui
->ComboBoxForbiddenUid
494
->hide();
496
497
QString
const
& linetext =
ui
->LineEditUID->text();
498
499
if
(!linetext.isEmpty()) {
500
ui
->LineEditUID->clear();
501
ui
->LineEditUID->setText(linetext);
502
SetUID
();
503
}
504
505
emit
stateChanged
();
506
this_object_changed
=
false
;
507
}
508
}
509
510
void
511
dbe::ObjectCreator::setup_copy_editor
()
512
{
513
if
(
ui
->ComboBoxClass->IsValid()) {
514
QString cname = QString::fromStdString(
this_object_class
.p_name);
515
516
ui
->ClassLabel->setText(QString(
"Selected Class: %1"
).arg(cname));
517
setWindowTitle(QString(
"Create New Object of Class %1"
).arg(cname));
518
519
this_associated_editor
=
new
ObjectEditor
(*
this_src_object
,
this
,
true
);
520
this_associated_editor
->setWindowModality(Qt::NonModal);
521
this_associated_editor
->SetUsedForCopy(
true
);
522
this_associated_editor
->HideDetailWidget(
true
);
523
this_associated_editor
->setDisabled(
true
);
524
525
ui
->EditorLayout->addWidget(
this_associated_editor
);
526
connect(
this_associated_editor
, SIGNAL(WidgetUpdated()),
this
, SLOT(
UpdateActions
()), Qt::UniqueConnection);
527
528
FillUidComboBox
();
529
ui
->ComboBoxForbiddenUid->hide();
530
531
QString tmpSt =
ui
->LineEditUID->text();
532
533
if
(!tmpSt.isEmpty()) {
534
ui
->LineEditUID->clear();
535
ui
->LineEditUID->setText(tmpSt);
536
SetUID
();
537
}
538
539
emit
stateChanged
();
540
this_object_changed
=
false
;
541
}
542
}
543
544
void
545
dbe::ObjectCreator::SetUID
()
546
{
547
if
(
this_file_for_new_object
.isEmpty()) {
548
ERROR
(
"Object creation is not feasible"
,
"Database file not selected"
);
549
return
;
550
}
551
552
if
(
ui
->LineEditUID->IsValid()) {
553
this_newuid
=
ui
->LineEditUID->text();
554
555
QString textForUser = QString(
"New Object ID: %1"
).arg(
this_newuid
);
556
ui
->UidLabel->setText(textForUser);
557
}
else
{
558
WARN
(
"Object creation is not feasible"
,
"Invalid UID provided"
);
559
return
;
560
}
561
562
if
(!
this_file_for_new_object
.isEmpty()) {
563
UidSet
=
true
;
564
this_associated_editor
->setDisabled(
false
);
565
emit
stateChanged
();
566
}
else
{
567
TLOG_DEBUG
(0) <<
"active file empty!! check!!"
;
568
}
569
}
570
571
void
572
dbe::ObjectCreator::MustPressReturn
(
const
QString&)
573
{
574
QPalette yellow;
575
yellow.setColor(QPalette::Active, QPalette::Window, QColor(
"yellow"
));
576
577
this_status_bar
->setPalette(yellow);
578
this_status_bar
->showMessage(QString(
"Press ENTER to set new UID!"
));
579
}
580
581
bool
582
dbe::ObjectCreator::CanClose
()
583
{
584
585
if
((
this_object_changed
and
ui
->CreateObjectButton->isEnabled()) or
586
(
this_associated_editor
and
this_associated_editor
->WasObjectChanged())) {
587
int
ret = QMessageBox::question(0,
588
tr(
"DBE - ObjectCreate"
),
589
QString(
"There are pending actions for this dialogue"
),
590
QMessageBox::Discard | QMessageBox::Cancel,
591
QMessageBox::Cancel);
592
593
if
(ret == QMessageBox::Discard) {
594
this_object_changed
=
false
;
595
this_associated_editor
->ResetObjectChanged();
596
597
try
{
598
config::api::commands::delobj
(
inner::dbcontroller::get
({
this_newuid
.toStdString(),
this_object_class
.p_name }),
599
uuid
);
600
}
catch
(daq::dbe::config_object_retrieval_result_is_null
const
& e) {
601
// nothing specific handle needed in this , it is possible that there is no resul
602
}
603
604
return
true
;
605
}
else
if
(ret == QMessageBox::Cancel) {
606
return
false
;
607
}
608
609
return
true
;
610
}
else
{
611
return
true
;
612
}
613
}
614
615
void
616
dbe::ObjectCreator::closeEvent
(QCloseEvent* event)
617
{
618
if
(
CanClose
()) {
619
if
(
this_associated_editor
) {
620
this_associated_editor
->close();
621
this_associated_editor
=
nullptr
;
622
}
623
624
event
->accept();
625
}
else
{
626
event
->ignore();
627
}
628
}
EditStates
EditStates
Definition
ObjectCreator.cpp:29
editorOk
@ editorOk
Definition
ObjectCreator.cpp:30
nullNotFilled
@ nullNotFilled
Definition
ObjectCreator.cpp:34
classNotSelected
@ classNotSelected
Definition
ObjectCreator.cpp:31
uidNotSet
@ uidNotSet
Definition
ObjectCreator.cpp:32
fileNotSet
@ fileNotSet
Definition
ObjectCreator.cpp:33
ObjectCreator.hpp
StyleUtility.hpp
Validator.hpp
dbe::FileModel::FileModel
FileModel(QObject *parent=nullptr)
Including QT Headers.
Definition
FileModel.cpp:18
dbe::ObjectCreator::BuildFileModel
void BuildFileModel()
Definition
ObjectCreator.cpp:226
dbe::ObjectCreator::UpdateActions
void UpdateActions()
Definition
ObjectCreator.cpp:258
dbe::ObjectCreator::this_associated_editor
ObjectEditor * this_associated_editor
Definition
ObjectCreator.hpp:111
dbe::ObjectCreator::uuid
QUuid const uuid
Definition
ObjectCreator.hpp:118
dbe::ObjectCreator::setup_editor
void setup_editor()
Definition
ObjectCreator.cpp:451
dbe::ObjectCreator::MustPressReturn
void MustPressReturn(QString const &)
Definition
ObjectCreator.cpp:572
dbe::ObjectCreator::this_files
FileModel * this_files
Definition
ObjectCreator.hpp:102
dbe::ObjectCreator::UidSet
bool UidSet
Definition
ObjectCreator.hpp:108
dbe::ObjectCreator::SetStatusBar
void SetStatusBar()
Definition
ObjectCreator.cpp:248
dbe::ObjectCreator::this_relation
dunedaq::conffwk::relationship_t this_relation
Definition
ObjectCreator.hpp:99
dbe::ObjectCreator::CreateOpenObject
void CreateOpenObject()
Definition
ObjectCreator.cpp:385
dbe::ObjectCreator::ActiveFileChanged
void ActiveFileChanged(QString const &)
Definition
ObjectCreator.cpp:432
dbe::ObjectCreator::SetController
void SetController()
Definition
ObjectCreator.cpp:198
dbe::ObjectCreator::this_is_temporary
bool this_is_temporary
Definition
ObjectCreator.hpp:114
dbe::ObjectCreator::ObjectCreator
ObjectCreator(dunedaq::conffwk::class_t const &classinfo, QWidget *parent=0)
Definition
ObjectCreator.cpp:45
dbe::ObjectCreator::setup_copy_editor
void setup_copy_editor()
Definition
ObjectCreator.cpp:511
dbe::ObjectCreator::closeEvent
void closeEvent(QCloseEvent *event)
Definition
ObjectCreator.cpp:616
dbe::ObjectCreator::ui
std::unique_ptr< dbe::Ui::ObjectCreator > ui
Definition
ObjectCreator.hpp:93
dbe::ObjectCreator::GetMessage
QString GetMessage()
Definition
ObjectCreator.cpp:320
dbe::ObjectCreator::stateChanged
void stateChanged()
dbe::ObjectCreator::~ObjectCreator
~ObjectCreator()
dbe::ObjectCreator::this_object_class
dunedaq::conffwk::class_t this_object_class
Definition
ObjectCreator.hpp:95
dbe::ObjectCreator::this_file_for_new_object
QString this_file_for_new_object
Definition
ObjectCreator.hpp:110
dbe::ObjectCreator::FillUidComboBox
void FillUidComboBox()
Definition
ObjectCreator.cpp:360
dbe::ObjectCreator::this_src_object
std::unique_ptr< tref > this_src_object
Definition
ObjectCreator.hpp:97
dbe::ObjectCreator::CreateObject
void CreateObject(bool openEditor=false)
Definition
ObjectCreator.cpp:391
dbe::ObjectCreator::BuildContextMenu
void BuildContextMenu()
Definition
ObjectCreator.cpp:348
dbe::ObjectCreator::ContextMenu
QMenu * ContextMenu
Definition
ObjectCreator.hpp:112
dbe::ObjectCreator::AddInclude
void AddInclude()
Definition
ObjectCreator.cpp:355
dbe::ObjectCreator::this_sort
QSortFilterProxyModel this_sort
Definition
ObjectCreator.hpp:101
dbe::ObjectCreator::this_newuid
QString this_newuid
Definition
ObjectCreator.hpp:109
dbe::ObjectCreator::this_object_changed
bool this_object_changed
Definition
ObjectCreator.hpp:115
dbe::ObjectCreator::CanClose
bool CanClose()
Definition
ObjectCreator.cpp:582
dbe::ObjectCreator::this_create_copy
bool this_create_copy
Definition
ObjectCreator.hpp:116
dbe::ObjectCreator::SetComboClass
void SetComboClass()
Definition
ObjectCreator.cpp:181
dbe::ObjectCreator::SetObjectChanged
void SetObjectChanged()
Definition
ObjectCreator.cpp:426
dbe::ObjectCreator::this_state
int this_state
Definition
ObjectCreator.hpp:106
dbe::ObjectCreator::SetUID
void SetUID()
Definition
ObjectCreator.cpp:545
dbe::ObjectCreator::this_target_object
std::unique_ptr< tref > this_target_object
Definition
ObjectCreator.hpp:98
dbe::ObjectCreator::this_status_bar
QStatusBar * this_status_bar
Definition
ObjectCreator.hpp:104
dbe::ObjectCreator::GetState
bool GetState(int Flags)
Definition
ObjectCreator.cpp:342
dbe::ObjectEditor::ObjectEditor
ObjectEditor(QWidget *parent=nullptr)
Definition
ObjectEditor.cpp:44
dbe::StyleUtility::PaleGreenPalleteButton
static QPalette PaleGreenPalleteButton
Definition
StyleUtility.hpp:39
dbe::StyleUtility::WarningStatusBarPalleteWindow
static QPalette WarningStatusBarPalleteWindow
Definition
StyleUtility.hpp:38
dbe::ValidatorAcceptMatch
Definition
Validator.hpp:14
dbe::ValidatorAcceptMatch::ValidatorAcceptMatch
ValidatorAcceptMatch(QVariant &Storage, QObject *parent=0)
Including DBE.
Definition
Validator.cpp:9
dbe::ValidatorAcceptNoMatch
Definition
Validator.hpp:25
dbe::ValidatorAcceptNoMatch::ValidatorAcceptNoMatch
ValidatorAcceptNoMatch(QVariant &Storage, QObject *parent=0)
Definition
Validator.cpp:29
dbe::confaccessor::check_file_rw
static bool check_file_rw(const QString &FileName)
Definition
confaccessor.cpp:268
dbe::confaccessor::ref
static confaccessor & ref()
Definition
confaccessor.cpp:37
dbe::confaccessor::db_implementation_name
static QString db_implementation_name()
Definition
confaccessor.cpp:141
dbe::config::api::info::onclass::objects
static std::vector< dbe::inner::configobject::tref > objects(std::string const &cname, bool const keep_inherited=true)
dbe::config::api::info::onclass::allnames
static T allnames()
Definition
config_api.hpp:35
dbe::inner::configobject::ref_interface::class_name
std::string class_name() const
Definition
config_reference.hpp:180
dbe::inner::configobject::ref_interface::UID
std::string UID() const
Definition
config_reference.hpp:178
dbe::inner::configobject::ref_interface< tref >::tref
friend class dbe::inner::configobject::tref
Definition
config_reference.hpp:316
dbe::inner::dbcontroller::get
static configobject::tref get(dbe::cokey const &desc)
Definition
dbcontroller.cpp:357
confaccessor.hpp
config_api.hpp
config_api_commands.hpp
config_api_graph.hpp
config_api_set.hpp
Logging.hpp
TLOG_DEBUG
#define TLOG_DEBUG(lvl,...)
Definition
Logging.hpp:116
messenger.hpp
ERROR
#define ERROR(...)
Definition
messenger.hpp:90
WARN
#define WARN(...)
Definition
messenger.hpp:82
Ui
Definition
SchemaSettings.hpp:9
conffwk
Definition
__init__.py:1
dbe::config::api::commands::delobj
bool delobj(inner::configobject::tref obj, QUuid const &src)
Definition
config_api_commands.cpp:75
dbe::config
Definition
config_api.hpp:29
dbe::tref
inner::configobject::tref tref
Definition
tref.hpp:36
dunedaq
The DUNE-DAQ namespace.
Definition
cib_utilities.cpp:5
dunedaq::conffwk::class_t
Definition
Schema.hpp:153
dunedaq::conffwk::class_t::p_name
std::string p_name
Definition
Schema.hpp:155
dunedaq::conffwk::relationship_t
Definition
Schema.hpp:117
Generated on
for DUNE-DAQ by
1.18.0