Commit ecc40edf authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - network editor is still optional but can now be en/disabled via view-menu in gui

parent 277743db
......@@ -54,12 +54,6 @@ ENDIF()
# GUI compilation options
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# compile network manager?
OPTION( OW_QT4GUI_NETWORKEDITOR "Enable this to get the experimental network manager compiled." OFF )
IF( OW_QT4GUI_NETWORKEDITOR )
ADD_DEFINITIONS( -DOW_QT4GUI_NETWORKEDITOR )
ENDIF()
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Add sources as target
# ---------------------------------------------------------------------------------------------------------------------------------------------------
......
......@@ -123,6 +123,12 @@ void WMainWindow::setupGUI()
true,
true // this requires a restart
);
WSettingAction* showNetworkEditor = new WSettingAction( this, "qt4gui/showNetworkEditor",
"Show Network Editor",
"Show the network editor allowing you to manipulate the module graph graphically?",
false,
true // this requires a restart
);
m_autoDisplaySetting = new WSettingAction( this, "qt4gui/useAutoDisplay",
"Auto-Display",
"If enabled, the best matching module is automatically added if some data was loaded.",
......@@ -188,11 +194,13 @@ void WMainWindow::setupGUI()
setDockOptions( QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks | QMainWindow::AllowTabbedDocks );
#ifdef OW_QT4GUI_NETWORKEDITOR
//network Editor
m_networkEditor = new WQtNetworkEditor( this );
m_networkEditor->setFeatures( QDockWidget::AllDockWidgetFeatures );
#endif
m_networkEditor = NULL;
if( showNetworkEditor->get() )
{
m_networkEditor = new WQtNetworkEditor( this );
m_networkEditor->setFeatures( QDockWidget::AllDockWidgetFeatures );
}
// the control panel instance is needed for the menu
m_controlPanel = new WQtControlPanel( this );
......@@ -201,17 +209,19 @@ void WMainWindow::setupGUI()
// add all docks
addDockWidget( Qt::RightDockWidgetArea, m_controlPanel->getModuleDock() );
#ifdef OW_QT4GUI_NETWORKEDITOR
addDockWidget( Qt::RightDockWidgetArea, m_networkEditor );
#endif
if( m_networkEditor )
{
addDockWidget( Qt::RightDockWidgetArea, m_networkEditor );
}
addDockWidget( Qt::RightDockWidgetArea, m_controlPanel->getColormapperDock() );
addDockWidget( Qt::RightDockWidgetArea, m_controlPanel->getRoiDock() );
// tabify those panels by default
#ifdef OW_QT4GUI_NETWORKEDITOR
tabifyDockWidget( m_networkEditor, m_controlPanel->getModuleDock() );
#endif
if( m_networkEditor )
{
tabifyDockWidget( m_networkEditor, m_controlPanel->getModuleDock() );
}
tabifyDockWidget( m_controlPanel->getModuleDock(), m_controlPanel->getColormapperDock() );
tabifyDockWidget( m_controlPanel->getColormapperDock(), m_controlPanel->getRoiDock() );
......@@ -305,6 +315,7 @@ void WMainWindow::setupGUI()
viewMenu->addAction( hideMenuAction );
viewMenu->addSeparator();
viewMenu->addAction( showNavWidgets );
viewMenu->addAction( showNetworkEditor );
viewMenu->addSeparator();
viewMenu->addMenu( m_permanentToolBar->getStyleMenu() );
......
......@@ -242,9 +242,10 @@ void WQt4Gui::slotAddDatasetOrModuleToTree( boost::shared_ptr< WModule > module
{
// create a new event for this and insert it into event queue
QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WModuleAssocEvent( module ) );
#ifdef OW_QT4GUI_NETWORKEDITOR
QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleAssocEvent( module ) );
#endif
if( m_mainWindow->getNetworkEditor() )
{
QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleAssocEvent( module ) );
}
}
void WQt4Gui::slotAddRoiToTree( osg::ref_ptr< WROI > roi )
......@@ -262,17 +263,19 @@ void WQt4Gui::slotActivateDatasetOrModuleInTree( boost::shared_ptr< WModule > mo
// create a new event for this and insert it into event queue
QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WModuleReadyEvent( module ) );
QCoreApplication::postEvent( m_mainWindow, new WModuleReadyEvent( module ) );
#ifdef OW_QT4GUI_NETWORKEDITOR
QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleReadyEvent( module ) );
#endif
if( m_mainWindow->getNetworkEditor() )
{
QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleReadyEvent( module ) );
}
}
void WQt4Gui::slotRemoveDatasetOrModuleInTree( boost::shared_ptr< WModule > module )
{
// create a new event for this and insert it into event queue
#ifdef OW_QT4GUI_NETWORKEDITOR
QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleRemovedEvent( module ) );
#endif
if( m_mainWindow->getNetworkEditor() )
{
QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleRemovedEvent( module ) );
}
QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WModuleRemovedEvent( module ) );
QCoreApplication::postEvent( m_mainWindow, new WModuleRemovedEvent( module ) );
}
......@@ -283,16 +286,18 @@ void WQt4Gui::slotConnectionEstablished( boost::shared_ptr<WModuleConnector> in,
if( in->isInputConnector() )
{
QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WModuleConnectEvent( in, out ) );
#ifdef OW_QT4GUI_NETWORKEDITOR
QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleConnectEvent( in, out ) );
#endif
if( m_mainWindow->getNetworkEditor() )
{
QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleConnectEvent( in, out ) );
}
}
else
{
QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WModuleConnectEvent( out, in ) );
#ifdef OW_QT4GUI_NETWORKEDITOR
QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleConnectEvent( out, in ) );
#endif
if( m_mainWindow->getNetworkEditor() )
{
QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleConnectEvent( out, in ) );
}
}
}
......@@ -301,16 +306,18 @@ void WQt4Gui::slotConnectionClosed( boost::shared_ptr<WModuleConnector> in, boos
// create a new event for this and insert it into event queue
if( in->isInputConnector() )
{
#ifdef OW_QT4GUI_NETWORKEDITOR
QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleDisconnectEvent( in, out ) );
#endif
if( m_mainWindow->getNetworkEditor() )
{
QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleDisconnectEvent( in, out ) );
}
QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WModuleDisconnectEvent( in, out ) );
}
else
{
#ifdef OW_QT4GUI_NETWORKEDITOR
QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleDisconnectEvent( out, in ) );
#endif
if( m_mainWindow->getNetworkEditor() )
{
QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleDisconnectEvent( out, in ) );
}
QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WModuleDisconnectEvent( out, in ) );
}
}
......
......@@ -125,14 +125,17 @@ WQtControlPanel::WQtControlPanel( WMainWindow* parent )
// Disabled Network Editor due to bug: #11
// // the network editor also needs the context menu
// // TODO(rfrohl): context menu gets not opened if a graphicitem is clicked. This should be fixed.
// m_mainWindow->getNetworkEditor()->setContextMenuPolicy( Qt::ActionsContextMenu );
// m_mainWindow->getNetworkEditor()->addAction( m_connectWithPrototypeAction );
// m_mainWindow->getNetworkEditor()->addAction( m_connectWithModuleAction );
// m_mainWindow->getNetworkEditor()->addAction( m_disconnectAction );
// m_mainWindow->getNetworkEditor()->addAction( separator );
// m_mainWindow->getNetworkEditor()->addAction( m_deleteModuleAction );
// m_mainWindow->getNetworkEditor()->addAction( separator );
// m_mainWindow->getNetworkEditor()->addAction( m_missingModuleAction );
// if( m_mainWindow->getNetworkEditor() )
// {
// m_mainWindow->getNetworkEditor()->setContextMenuPolicy( Qt::ActionsContextMenu );
// m_mainWindow->getNetworkEditor()->addAction( m_connectWithPrototypeAction );
// m_mainWindow->getNetworkEditor()->addAction( m_connectWithModuleAction );
// m_mainWindow->getNetworkEditor()->addAction( m_disconnectAction );
// m_mainWindow->getNetworkEditor()->addAction( separator );
// m_mainWindow->getNetworkEditor()->addAction( m_deleteModuleAction );
// m_mainWindow->getNetworkEditor()->addAction( separator );
// m_mainWindow->getNetworkEditor()->addAction( m_missingModuleAction );
// }
m_colormapper = new WQtColormapper( m_mainWindow );
m_colormapper->setToolTip( "Reorder the textures." );
......@@ -1132,11 +1135,6 @@ void WQtControlPanel::deleteModuleTreeItem()
}
}
}
// Disabled Network Editor due to bug: #11
// else if( m_mainWindow->getNetworkEditor()->isActiveWindow() )
// {
// m_mainWindow->getNetworkEditor()->deleteSelectedItems();
// }
}
void WQtControlPanel::deleteROITreeItem()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment