176 connect ( OpenDB, SIGNAL ( triggered() ),
this, SLOT ( slot_open_database_from_file() ) );
177 connect ( Commit, SIGNAL ( triggered() ),
this, SLOT ( slot_commit_database() ) );
178 connect ( Exit, SIGNAL ( triggered() ),
this, SLOT ( close() ) );
179 connect ( UndoAction, SIGNAL ( triggered() ), UndoView->stack(), SLOT ( undo() ) );
180 connect ( RedoAction, SIGNAL ( triggered() ), UndoView->stack(), SLOT ( redo() ) );
181 connect ( UndoAll, SIGNAL ( triggered() ),
this, SLOT ( slot_undo_allchanges() ) );
182 connect ( BatchChange, SIGNAL ( triggered() ),
this, SLOT ( slot_launch_batchchange() ) );
183 connect ( BatchChangeTable, SIGNAL ( triggered() ),
this,
184 SLOT ( slot_launch_batchchange_on_table() ) );
186 connect ( DisplayClassView, SIGNAL ( triggered (
bool ) ), TreeDockWidget,
187 SLOT ( setVisible (
bool ) ) );
188 connect ( DisplayTableView, SIGNAL ( triggered (
bool ) ), TableGroupBox,
189 SLOT ( setVisible (
bool ) ) );
190 connect ( DisplayMessages, SIGNAL ( triggered (
bool ) ), InfoDockWidget,
191 SLOT ( setVisible (
bool ) ) );
192 connect ( DisplayToolbar, SIGNAL ( triggered (
bool ) ), MainToolBar,
193 SLOT ( setVisible (
bool ) ) );
195 connect ( TreeDockWidget, SIGNAL ( visibilityChanged (
bool ) ), DisplayTableView,
196 SLOT ( setChecked (
bool ) ) );
197 connect ( InfoDockWidget , SIGNAL ( visibilityChanged (
bool ) ), DisplayMessages,
198 SLOT ( setChecked (
bool ) ) );
199 connect ( MainToolBar , SIGNAL ( visibilityChanged (
bool ) ), DisplayToolbar,
200 SLOT ( setChecked (
bool ) ) );
203 connect ( LoadDefaultSettings, SIGNAL ( triggered() ),
this,
204 SLOT ( LoadDefaultSetting() ) );
205 connect ( CreateDatabase, SIGNAL ( triggered() ),
this, SLOT ( slot_create_newdb() ) );
208 connect ( WhatThisAction, SIGNAL ( triggered() ),
this, SLOT ( slot_whatisthis() ) );
209 connect ( UserGuide, SIGNAL ( triggered() ),
this, SLOT ( slot_show_userguide() ) );
210 connect ( UserChanges, SIGNAL ( triggered() ),
this, SLOT ( slot_show_userchanges() ) );
212 connect ( TreeView, SIGNAL ( activated ( QModelIndex ) ),
this,
213 SLOT ( slot_edit_object_from_class_view ( QModelIndex ) ) );
215 connect( &
confaccessor::ref(), SIGNAL(db_committed(
const std::list<std::string>&,
const std::string&)),
this,
216 SLOT(slot_update_committed_files(
const std::list<std::string>&,
const std::string&)));
220 SLOT ( slot_fetch_data (
const treenode * ) ) );
223 SLOT(slot_toggle_commit_button()));
225 SLOT(slot_toggle_commit_button()));
227 SLOT(slot_toggle_commit_button()));
229 SLOT(slot_toggle_commit_button()));
230 connect( &
confaccessor::ref(), SIGNAL(db_committed(
const std::list<std::string>&,
const std::string&)),
this,
231 SLOT(slot_toggle_commit_button()));
233 SLOT(slot_toggle_commit_button()));
235 SLOT(slot_toggle_commit_button()));
237 SLOT(slot_toggle_commit_button()));
239 SLOT(slot_toggle_commit_button()));
240 connect(
this, SIGNAL(signal_batch_change_stopped(
const QList<QPair<QString, QString>>&)),
this,
241 SLOT(slot_toggle_commit_button()));
244 SLOT ( slot_model_rebuild() ) );
246 SLOT ( slot_model_rebuild() ) );
248 SLOT ( slot_process_externalchanges() ) );
251 connect ( SearchBox, SIGNAL ( currentIndexChanged(
int) ),
this,
252 SLOT ( slot_filter_query() ) );
253 connect ( SearchTreeLine, SIGNAL ( textChanged (
const QString & ) ),
this,
254 SLOT ( slot_filter_textchange (
const QString & ) ) );
255 connect ( SearchTreeLine, SIGNAL ( textEdited (
const QString & ) ),
this,
256 SLOT ( slot_filter_query() ) );
257 connect ( SearchTreeLine, SIGNAL ( returnPressed() ),
this, SLOT ( slot_filter_query() ) );
258 connect ( SearchLineTable, SIGNAL ( textChanged (
const QString & ) ),
this,
259 SLOT ( slot_filter_table_textchange (
const QString & ) ) );
260 connect ( CaseSensitiveCheckBoxTree, SIGNAL ( clicked (
bool ) ),
this,
261 SLOT ( slot_toggle_casesensitive_for_treeview (
bool ) ) );
265 connect ( information_about_dbe, SIGNAL ( triggered() ),
this,
266 SLOT ( slot_show_information_about_dbe() ) );
271 SIGNAL ( signal_debug ( QString
const, QString
const ) ),
this,
272 SLOT ( slot_debuginfo_message ( QString , QString ) ), Qt::QueuedConnection );
275 SIGNAL ( signal_info ( QString
const, QString
const ) ),
this,
276 SLOT ( slot_information_message ( QString , QString ) ), Qt::QueuedConnection );
279 SIGNAL ( signal_note ( QString
const, QString
const ) ),
this,
280 SLOT ( slot_notice_message ( QString , QString ) ), Qt::QueuedConnection );
283 SIGNAL ( signal_warn ( QString
const, QString
const ) ),
this,
284 SLOT ( slot_warning_message ( QString , QString ) ), Qt::QueuedConnection );
287 SIGNAL ( signal_error ( QString
const, QString
const ) ),
this,
288 SLOT ( slot_error_message ( QString, QString ) ), Qt::QueuedConnection );
291 SIGNAL ( signal_fail ( QString
const, QString
const ) ),
this,
292 SLOT ( slot_failure_message ( QString , QString ) ), Qt::QueuedConnection );
345 treenode * tree_node = this_classes->getnode ( Index );
352 if (
dynamic_cast<ObjectNode *
> ( tree_node ) )
356 slot_launch_object_editor ( ObjectToBeEdited );
361 QString
const cname = tree_node->
GetData ( 0 ).toString();
366 if ( not cinfo.
p_abstract or ShowDerivedObjects->isChecked() )
368 if (
TableTab * CurrentTab =
dynamic_cast<TableTab *
> ( tableholder->currentWidget() ) )
370 CurrentTab->CreateModels();
372 CustomDelegate * CurrentDelegate = CurrentTab->GetTableDelegate();
375 connect ( CurrentView, SIGNAL ( OpenEditor (
tref ) ),
this,
376 SLOT ( slot_launch_object_editor (
tref ) ), Qt::UniqueConnection );
377 connect ( CurrentDelegate, SIGNAL ( CreateObjectEditorSignal (
tref ) ),
this,
378 SLOT ( slot_launch_object_editor (
tref ) ), Qt::UniqueConnection );
380 if (
dynamic_cast<ClassNode *
> ( tree_node ) )
382 BOOST_SCOPE_EXIT(CurrentTabModel)
384 emit CurrentTabModel->layoutChanged();
388 emit CurrentTabModel->layoutAboutToBeChanged();
392 tableholder->setTabText ( tableholder->currentIndex(), cname );
393 CurrentTab->ResetTableView();
396 CurrentTab->ResizeHeaders();
1498 auto user_confirmation = [] ( QString
const & msg )
1500 QMessageBox ExternalMessageBox;
1501 ExternalMessageBox.setText ( msg );
1502 ExternalMessageBox.setStandardButtons ( QMessageBox::Yes | QMessageBox::No );
1503 ExternalMessageBox.setDefaultButton ( QMessageBox::Yes );
1504 return ExternalMessageBox.exec() == QMessageBox::Yes;
1509 auto rewind_stack = [&undo_stack] ()
1511 std::vector<bool > commands_original_undo_state;
1517 for (
int i = 0; i < undo_stack->count(); ++i )
1523 commands_original_undo_state.push_back ( Command->undoable() );
1524 Command->setundoable (
false );
1530 undo_stack->setIndex ( 0 );
1534 auto cmdstate = commands_original_undo_state.begin();
1536 for (
int i = 0; i != undo_stack->count(); ++i )
1542 Command->setundoable ( *cmdstate++ );
1549 for ( QWidget * widget : QApplication::allWidgets() )
1558 if ( undo_stack->count() != 0 )
1560 const QString msg = QString(
"External changes to the database have been applied. Do you want to replay your changes on top? ")
1561 + QString(
" Otherwise any local change will be lost.\n");
1562 if ( user_confirmation ( msg ) )
1570 while ( not internal_changes->empty() )
1572 internal_changes_reverse_copy.push ( internal_changes->top() );
1573 internal_changes->pop();
1577 for (
int i = 0; i < undo_stack->count(); ++i )
1580 internal_changes_reverse_copy.pop();
1581 internal_changes->push ( Change );
1627 catch ( dunedaq::conffwk::Exception
const & e )
1629 WARN (
"Object reference could not be changed",
1635 WARN (
"Unknown exception during object modification",
"s",
1636 "\n\nFor object with UID:", Change.
uid.c_str(),
"of class:",
1646 INFO (
"Database reloaded due external changes",
"Database consistency enforcement" );
1654 emit signal_externalchanges_processed();