175 connect ( OpenDB, SIGNAL ( triggered() ),
this, SLOT ( slot_open_database_from_file() ) );
176 connect ( Commit, SIGNAL ( triggered() ),
this, SLOT ( slot_commit_database() ) );
177 connect ( Exit, SIGNAL ( triggered() ),
this, SLOT ( close() ) );
178 connect ( UndoAction, SIGNAL ( triggered() ), UndoView->stack(), SLOT ( undo() ) );
179 connect ( RedoAction, SIGNAL ( triggered() ), UndoView->stack(), SLOT ( redo() ) );
180 connect ( UndoAll, SIGNAL ( triggered() ),
this, SLOT ( slot_undo_allchanges() ) );
181 connect ( BatchChange, SIGNAL ( triggered() ),
this, SLOT ( slot_launch_batchchange() ) );
182 connect ( BatchChangeTable, SIGNAL ( triggered() ),
this,
183 SLOT ( slot_launch_batchchange_on_table() ) );
185 connect ( DisplayClassView, SIGNAL ( triggered (
bool ) ), TreeDockWidget,
186 SLOT ( setVisible (
bool ) ) );
187 connect ( DisplayTableView, SIGNAL ( triggered (
bool ) ), TableGroupBox,
188 SLOT ( setVisible (
bool ) ) );
189 connect ( DisplayMessages, SIGNAL ( triggered (
bool ) ), InfoDockWidget,
190 SLOT ( setVisible (
bool ) ) );
191 connect ( DisplayToolbar, SIGNAL ( triggered (
bool ) ), MainToolBar,
192 SLOT ( setVisible (
bool ) ) );
194 connect ( TreeDockWidget, SIGNAL ( visibilityChanged (
bool ) ), DisplayTableView,
195 SLOT ( setChecked (
bool ) ) );
196 connect ( InfoDockWidget , SIGNAL ( visibilityChanged (
bool ) ), DisplayMessages,
197 SLOT ( setChecked (
bool ) ) );
198 connect ( MainToolBar , SIGNAL ( visibilityChanged (
bool ) ), DisplayToolbar,
199 SLOT ( setChecked (
bool ) ) );
202 connect ( LoadDefaultSettings, SIGNAL ( triggered() ),
this,
203 SLOT ( LoadDefaultSetting() ) );
204 connect ( CreateDatabase, SIGNAL ( triggered() ),
this, SLOT ( slot_create_newdb() ) );
207 connect ( WhatThisAction, SIGNAL ( triggered() ),
this, SLOT ( slot_whatisthis() ) );
208 connect ( UserGuide, SIGNAL ( triggered() ),
this, SLOT ( slot_show_userguide() ) );
209 connect ( UserChanges, SIGNAL ( triggered() ),
this, SLOT ( slot_show_userchanges() ) );
211 connect ( TreeView, SIGNAL ( activated ( QModelIndex ) ),
this,
212 SLOT ( slot_edit_object_from_class_view ( QModelIndex ) ) );
214 connect( &
confaccessor::ref(), SIGNAL(db_committed(
const std::list<std::string>&,
const std::string&)),
this,
215 SLOT(slot_update_committed_files(
const std::list<std::string>&,
const std::string&)));
219 SLOT ( slot_fetch_data (
const treenode * ) ) );
222 SLOT(slot_toggle_commit_button()));
224 SLOT(slot_toggle_commit_button()));
226 SLOT(slot_toggle_commit_button()));
228 SLOT(slot_toggle_commit_button()));
229 connect( &
confaccessor::ref(), SIGNAL(db_committed(
const std::list<std::string>&,
const std::string&)),
this,
230 SLOT(slot_toggle_commit_button()));
232 SLOT(slot_toggle_commit_button()));
234 SLOT(slot_toggle_commit_button()));
236 SLOT(slot_toggle_commit_button()));
238 SLOT(slot_toggle_commit_button()));
239 connect(
this, SIGNAL(signal_batch_change_stopped(
const QList<QPair<QString, QString>>&)),
this,
240 SLOT(slot_toggle_commit_button()));
243 SLOT ( slot_model_rebuild() ) );
245 SLOT ( slot_model_rebuild() ) );
247 SLOT ( slot_process_externalchanges() ) );
250 connect ( SearchBox, SIGNAL ( currentIndexChanged(
int) ),
this,
251 SLOT ( slot_filter_query() ) );
252 connect ( SearchTreeLine, SIGNAL ( textChanged (
const QString & ) ),
this,
253 SLOT ( slot_filter_textchange (
const QString & ) ) );
254 connect ( SearchTreeLine, SIGNAL ( textEdited (
const QString & ) ),
this,
255 SLOT ( slot_filter_query() ) );
256 connect ( SearchTreeLine, SIGNAL ( returnPressed() ),
this, SLOT ( slot_filter_query() ) );
257 connect ( SearchLineTable, SIGNAL ( textChanged (
const QString & ) ),
this,
258 SLOT ( slot_filter_table_textchange (
const QString & ) ) );
259 connect ( CaseSensitiveCheckBoxTree, SIGNAL ( clicked (
bool ) ),
this,
260 SLOT ( slot_toggle_casesensitive_for_treeview (
bool ) ) );
264 connect ( information_about_dbe, SIGNAL ( triggered() ),
this,
265 SLOT ( slot_show_information_about_dbe() ) );
270 SIGNAL ( signal_debug ( QString
const, QString
const ) ),
this,
271 SLOT ( slot_debuginfo_message ( QString , QString ) ), Qt::QueuedConnection );
274 SIGNAL ( signal_info ( QString
const, QString
const ) ),
this,
275 SLOT ( slot_information_message ( QString , QString ) ), Qt::QueuedConnection );
278 SIGNAL ( signal_note ( QString
const, QString
const ) ),
this,
279 SLOT ( slot_notice_message ( QString , QString ) ), Qt::QueuedConnection );
282 SIGNAL ( signal_warn ( QString
const, QString
const ) ),
this,
283 SLOT ( slot_warning_message ( QString , QString ) ), Qt::QueuedConnection );
286 SIGNAL ( signal_error ( QString
const, QString
const ) ),
this,
287 SLOT ( slot_error_message ( QString, QString ) ), Qt::QueuedConnection );
290 SIGNAL ( signal_fail ( QString
const, QString
const ) ),
this,
291 SLOT ( slot_failure_message ( QString , QString ) ), Qt::QueuedConnection );
344 treenode * tree_node = this_classes->getnode ( Index );
351 if (
dynamic_cast<ObjectNode *
> ( tree_node ) )
355 slot_launch_object_editor ( ObjectToBeEdited );
360 QString
const cname = tree_node->
GetData ( 0 ).toString();
365 if ( not cinfo.
p_abstract or ShowDerivedObjects->isChecked() )
367 if (
TableTab * CurrentTab =
dynamic_cast<TableTab *
> ( tableholder->currentWidget() ) )
369 CurrentTab->CreateModels();
371 CustomDelegate * CurrentDelegate = CurrentTab->GetTableDelegate();
374 connect ( CurrentView, SIGNAL ( OpenEditor (
tref ) ),
this,
375 SLOT ( slot_launch_object_editor (
tref ) ), Qt::UniqueConnection );
376 connect ( CurrentDelegate, SIGNAL ( CreateObjectEditorSignal (
tref ) ),
this,
377 SLOT ( slot_launch_object_editor (
tref ) ), Qt::UniqueConnection );
379 if (
dynamic_cast<ClassNode *
> ( tree_node ) )
381 BOOST_SCOPE_EXIT(CurrentTabModel)
383 emit CurrentTabModel->layoutChanged();
387 emit CurrentTabModel->layoutAboutToBeChanged();
391 tableholder->setTabText ( tableholder->currentIndex(), cname );
392 CurrentTab->ResetTableView();
395 CurrentTab->ResizeHeaders();
1467 auto user_confirmation = [] ( QString
const & msg )
1469 QMessageBox ExternalMessageBox;
1470 ExternalMessageBox.setText ( msg );
1471 ExternalMessageBox.setStandardButtons ( QMessageBox::Yes | QMessageBox::No );
1472 ExternalMessageBox.setDefaultButton ( QMessageBox::Yes );
1473 return ExternalMessageBox.exec() == QMessageBox::Yes;
1478 auto rewind_stack = [&undo_stack] ()
1480 std::vector<bool > commands_original_undo_state;
1486 for (
int i = 0; i < undo_stack->count(); ++i )
1492 commands_original_undo_state.push_back ( Command->undoable() );
1493 Command->setundoable (
false );
1499 undo_stack->setIndex ( 0 );
1503 auto cmdstate = commands_original_undo_state.begin();
1505 for (
int i = 0; i != undo_stack->count(); ++i )
1511 Command->setundoable ( *cmdstate++ );
1518 for ( QWidget * widget : QApplication::allWidgets() )
1527 if ( undo_stack->count() != 0 )
1529 const QString msg = QString(
"External changes to the database have been applied. Do you want to replay your changes on top? ")
1530 + QString(
" Otherwise any local change will be lost.\n");
1531 if ( user_confirmation ( msg ) )
1539 while ( not internal_changes->empty() )
1541 internal_changes_reverse_copy.push ( internal_changes->top() );
1542 internal_changes->pop();
1546 for (
int i = 0; i < undo_stack->count(); ++i )
1549 internal_changes_reverse_copy.pop();
1550 internal_changes->push ( Change );
1596 catch ( dunedaq::conffwk::Exception
const & e )
1598 WARN (
"Object reference could not be changed",
1604 WARN (
"Unknown exception during object modification",
"s",
1605 "\n\nFor object with UID:", Change.
uid.c_str(),
"of class:",
1615 INFO (
"Database reloaded due external changes",
"Database consistency enforcement" );
1623 emit signal_externalchanges_processed();