Commit 65c63b02 authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[CHANGE] The compatible modules are shown in a separate toolbar now. So they

are not hidden behind oher tabs.
parent 960162bd
......@@ -103,6 +103,8 @@ void WMainWindow::setupGUI( boost::program_options::variables_map guiConfigurati
setupRibbonMenu();
m_ribbonMenu->clearNonPersistentTabs();
setupCompatiblesToolBar();
m_datasetBrowser = new WQtDatasetBrowser( this );
addDockWidget( Qt::RightDockWidgetArea, m_datasetBrowser );
m_datasetBrowser->addSubject( "subject1" );
......@@ -167,6 +169,12 @@ void WMainWindow::setupRibbonMenu()
addToolBar( Qt::TopToolBarArea, m_ribbonMenu );
}
void WMainWindow::setupCompatiblesToolBar()
{
m_compatiblesToolBar = new WQtRibbonMenu( this );
addToolBar( Qt::TopToolBarArea, m_compatiblesToolBar );
}
WQtDatasetBrowser* WMainWindow::getDatasetBrowser()
{
......@@ -178,6 +186,11 @@ WQtRibbonMenu* WMainWindow::getRibbonMenu()
return m_ribbonMenu;
}
WQtRibbonMenu* WMainWindow::getCompatiblesToolBar()
{
return m_compatiblesToolBar;
}
void WMainWindow::openLoadDialog()
{
QFileDialog fd;
......
......@@ -85,6 +85,11 @@ public:
*/
WQtRibbonMenu* getRibbonMenu();
/**
* returns a pointer to the tool bar showing the compatible modules
*/
WQtRibbonMenu* getCompatiblesToolBar();
/**
* Return property manager
......@@ -150,8 +155,16 @@ public slots:
void slotActivateModule( QString module );
private:
/**
* Sets up the initial state of the ribbon menu
*/
void setupRibbonMenu();
/**
* Sets up the initial state of the tool bar showing the compatible modules
*/
void setupCompatiblesToolBar();
WIconManager m_iconManager;
WPropertyManager m_propertyManager;
......@@ -159,6 +172,8 @@ private:
QWidget* m_centralwidget; //!< the central widget of the docking facility. Thsi can not be moved.
WQtRibbonMenu* m_ribbonMenu; //!< The ribbon menu of the main window.
WQtRibbonMenu* m_compatiblesToolBar; //!< This toolbar shows the compatible modules if a module is selcted in the dataset browser
WQtDatasetBrowser* m_datasetBrowser;
boost::shared_ptr<WQtGLWidget> m_mainGLWidget; //!< the main GL widget of the GUI
......
......@@ -153,18 +153,20 @@ void WQtDatasetBrowser::selectTreeItem()
}
boost::shared_ptr< WModule >module;
m_mainWindow->getRibbonMenu()->clearNonPersistentTabs();
m_mainWindow->getCompatiblesToolBar()->clearNonPersistentTabs();
if ( m_treeWidget->selectedItems().at( 0 )->type() == 1 )
{
module = ( ( WQtDatasetTreeItem* ) m_treeWidget->selectedItems().at( 0 ) )->getModule();
// create ribbon menu entry
m_mainWindow->getRibbonMenu()->addTab( QString( "Compatibles" ), false );
m_mainWindow->getCompatiblesToolBar()->addTab( QString( "Compatible Modules" ), false );
std::set< boost::shared_ptr< WModule > > comps = WModuleFactory::getModuleFactory()->getCompatiblePrototypes( module );
for ( std::set< boost::shared_ptr< WModule > >::iterator iter = comps.begin(); iter != comps.end(); ++iter )
{
WQtPushButton* button = m_mainWindow->getRibbonMenu()->addPushButton( QString( ( *iter )->getName().c_str() ), QString( "Compatibles" ),
m_mainWindow->getIconManager()->getIcon( "load" ), QString( ( *iter )->getName().c_str() ) );
WQtPushButton* button = m_mainWindow->getCompatiblesToolBar()->addPushButton( QString( ( *iter )->getName().c_str() ),
QString( "Compatible Modules" ),
m_mainWindow->getIconManager()->getIcon( "load" ),
QString( ( *iter )->getName().c_str() ) );
connect( button, SIGNAL( pushButtonPressed( QString ) ), m_mainWindow, SLOT( slotActivateModule( QString ) ) );
}
......
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