Commit 83fd5d26 authored by Alexander Wiebel's avatar Alexander Wiebel

[CHANGE] added possibility to show only a subset of the available modules.

E.g. for hiding modules not yet ready for production use. Additionally
provided two sample walnut.cfg files for different audience.
parent cce9dd39
## This is a sample configuration file for OpenWalnut.
## Uncomment the options you are interested in.
[modules]
## use this to specify the default module to add during load.
## It is a comma seperated list. If this is not specified the default empty is assumed.
## An example could be
# default="HUD"
#whiteList ="Isosurface,Bounding Box, Direct Volume Rendering,Distance Map Isosurface,Gauss Filtering,HUD,Vector Plot,Write NIfTI" # A list of modules that will be provided through the GUI. If the list is empty all available modules are provided.
[qt4gui]
# hideAxial = yes # hide the axial view widget
# hideCoronal = yes # hide the coronal view widget
# hideSagittal = yes # hide the sagittal view widget
toolBarIconText = no # show text next to module's icon
# useToolBarBreak = no # put compatibles toolbar in separate row
useAutoDisplay = no # automatically add a standard module after loading a data module.
[ge] ## Settings for the graphics engine
# bgColor.r = .9 # background color (red part)
# bgColor.g = .9 # background color (green part)
# bgColor.b = .9 # background color (blue part)
zoomTrackballManipulator.allowThrow = yes # allow the auto-rotation thing when "throwing" an object with the mouse
# multiThreadedViewers = no # Use multiple threads for the multiple viewers. Causes hanging on some machines when opening a new view.
......@@ -6,12 +6,13 @@
## It is a comma seperated list. If this is not specified the default empty is assumed.
## An example could be
# default="HUD"
whiteList ="Isosurface,Bounding Box, Direct Volume Rendering,Distance Map Isosurface,Gauss Filtering,HUD,Vector Plot,Write NIfTI" # A list of modules that will be provided through the GUI. If the list is empty all available modules are provided.
[qt4gui]
# hideAxial = yes # hide the axial view widget
# hideCoronal = yes # hide the coronal view widget
# hideSagittal = yes # hide the sagittal view widget
# toolBarIconText = no # show text next to module's icon
toolBarIconText = no # show text next to module's icon
# useToolBarBreak = no # put compatibles toolbar in separate row
# useAutoDisplay = no # automatically add a standard module after loading a data module.
......
......@@ -111,6 +111,12 @@ WQtDatasetBrowser::WQtDatasetBrowser( WMainWindow* parent )
m_showToolBarText = true;
WPreferences::getPreference( "qt4gui.toolBarIconText", &m_showToolBarText );
// These modules will be allowed to be shown.
std::string moduleWhiteList;
WPreferences::getPreference( "modules.whiteList", &moduleWhiteList );
m_moduleWhiteList = string_utils::tokenize( moduleWhiteList, "," );
QShortcut* shortcut = new QShortcut( QKeySequence( Qt::Key_Delete ), m_roiTreeWidget );
connect( shortcut, SIGNAL( activated() ), this, SLOT( deleteTreeItem() ) );
}
......@@ -433,13 +439,21 @@ void WQtDatasetBrowser::buildPropTab( boost::shared_ptr< WProperties > props )
addTabWidgetContent( tab );
}
void WQtDatasetBrowser::createCompatibleButtons( boost::shared_ptr< WModule >module )
{
// every module may have compatibles: create ribbon menu entry
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 )
{
if( !m_moduleWhiteList.empty() )
{
const std::string tmpName = ( *iter )->getName();
if( std::find( m_moduleWhiteList.begin(), m_moduleWhiteList.end(), tmpName ) == m_moduleWhiteList.end() )
{
continue; //do nothing for modules that are not in white list
}
}
QString buttonText = "";
if( m_showToolBarText )
{
......
......@@ -187,6 +187,8 @@ private:
bool m_showToolBarText; //!< Show tool bar icons with text
std::vector< std::string > m_moduleWhiteList; //!< Stores a list of modules allowed to be shown.
private slots:
/**
* function that gets called when a tree item is selected, on a new select that tab widget
......
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