Commit 573a1dfc authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[ADD] - added entry to compatibles toolbar and context menu named 'Missing...

[ADD] - added entry to compatibles toolbar and context menu named 'Missing Module?' allowing the user to open the config dialog.
parent 1308fad4
......@@ -126,7 +126,7 @@ public:
static boost::filesystem::path getModulePath();
/**
* This returns a list of search paths for modules. This list is defined by the "modules.path" - option in walnut.cfg. All of these
* This returns a list of search paths for modules. This list is defined by the environment variable "OW_MODULE_PATH". All of these
* directories CAN contain modules. On startup, they get searched in the specified order.
*
* \return list of search paths for modules
......
/* XPM */
const char * QuestionMarks_xpm[] = {
"32 32 3 1",
" c None",
". c #000000",
"+ c #7C0000",
" ",
" .... ",
" ...... ",
" ...... . ... ",
" ......... .. ",
" ........... .. ",
" ... ..... .. ",
" . .... .. ",
" ... .. ",
" ... .. ",
" ... .. ",
" .... +++++ ",
" .... +++++++ .. ",
" ... ++ +++ .. ",
" ... + ++ ",
" ... ++ ",
" ... ++ ",
" ... ++ ",
" ... +++ ",
" +++ ",
" +++ ",
" ... ++ ",
" ... ++ ",
" ... ++ ",
" ... ",
" ",
" ++ ",
" ++ ",
" ++ ",
" ",
" ",
" "};
......@@ -50,4 +50,5 @@
#include "tango/preferences-system.xpm"
#include "QuestionMarks.xpm"
#endif // WICONS_H
......@@ -161,6 +161,7 @@ void WMainWindow::setupGUI()
m_iconManager.addIcon( std::string( "remove" ), remove_xpm );
m_iconManager.addIcon( std::string( "config" ), preferences_system_xpm );
m_iconManager.addIcon( std::string( "view" ), camera_xpm );
m_iconManager.addIcon( std::string( "missingModule" ), QuestionMarks_xpm );
if( objectName().isEmpty() )
{
......
......@@ -34,6 +34,7 @@
#include "WMainWindow.h"
#include "WQtToolBar.h"
#include "controlPanel/WQtControlPanel.h"
#include "WQtCombinerToolbar.h"
#include "WQtCombinerToolbar.moc"
......@@ -42,6 +43,9 @@ WQtCombinerToolbar::WQtCombinerToolbar( WMainWindow* parent, const WQtCombinerAc
: WQtToolBarBase( "Compatible Modules", parent ),
m_parent( parent )
{
QAction* m = parent->getControlPanel()->getMissingModuleAction();
addAction( m );
// create the list of actions possible
addActions( compatibles );
}
......@@ -64,6 +68,11 @@ void WQtCombinerToolbar::makeEmpty()
void WQtCombinerToolbar::updateButtons( const WQtCombinerActionList& compatibles )
{
clear();
// help action
QAction* m = m_parent->getControlPanel()->getMissingModuleAction();
addAction( m );
addActions( compatibles );
}
......@@ -138,7 +138,8 @@ WQtModuleExcluder::WQtModuleExcluder( QWidget* parent, Qt::WindowFlags f ):
// initialize members
QVBoxLayout* layout = new QVBoxLayout;
QString helpText = "This dialog allows you to modify the list of modules used everywhere in OpenWalnut. Select the modules you want "
QString helpText = "This dialog allows you to modify the list of modules used everywhere in OpenWalnut. The list contains all loaded modules."
" Select the modules you want "
"to use and disable those you won't use. This way, the module toolbar and the context menu stays clean. The "
"OpenWalnut-Team provides a list of recommended modules. This list is always active, unless you turn it off. Recommended "
"modules are visually marked by being partially checked.";
......
......@@ -103,17 +103,32 @@ WQtControlPanel::WQtControlPanel( WMainWindow* parent )
// Set the key for removing modules
m_deleteModuleAction->setShortcutContext( Qt::WidgetShortcut );
m_deleteModuleAction->setShortcut( QKeySequence( "Delete" ) );
m_deleteModuleAction->setIconVisibleInMenu( true );
}
connect( m_deleteModuleAction, SIGNAL( triggered() ), this, SLOT( deleteModuleTreeItem() ) );
m_moduleTreeWidget->addAction( m_deleteModuleAction );
// a separator to clean up the tree widget's context menu
m_moduleTreeWidget->addAction( separator );
// add an entry for those who search their module without luck
m_missingModuleAction = new QAction( WQt4Gui::getMainWindow()->getIconManager()->getIcon( "missingModule" ), "Missing Module?",
m_moduleTreeWidget );
m_missingModuleAction->setToolTip( "Having trouble finding your module? This opens the module configuration, which allows you to define the "
"modules that should be shown or hidden." );
m_missingModuleAction->setIconVisibleInMenu( true );
m_moduleTreeWidget->addAction( m_missingModuleAction );
// 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 );
m_colormapper = new WQtColormapper( m_mainWindow );
m_colormapper->setToolTip( "Reorder the textures." );
......@@ -129,7 +144,7 @@ WQtControlPanel::WQtControlPanel( WMainWindow* parent )
m_roiDock->setObjectName( "ROI Dock" );
m_roiTreeWidget = new WQtTreeWidget();
m_roiTreeWidget->setToolTip( "Regions of intrest (ROIs) for selecting fiber clusters. Branches are combined using logic <b>or</b>, "
"inside the branches the ROIs are combined using logic <b>and</b>." );
"inside the branches the ROIs are combined using logic <b>and</b>." );
m_roiTreeWidget->setHeaderLabel( QString( "ROIs" ) );
m_roiTreeWidget->setHeaderHidden( true );
m_roiTreeWidget->setDragEnabled( true );
......@@ -139,6 +154,7 @@ WQtControlPanel::WQtControlPanel( WMainWindow* parent )
m_roiDock->setWidget( m_roiTreeWidget );
m_moduleExcluder = new WQtModuleExcluder( parent );
connect( m_missingModuleAction, SIGNAL( triggered( bool ) ), m_moduleExcluder, SLOT( configure() ) );
m_layout = new QVBoxLayout();
m_layout->addWidget( m_tabWidget );
......@@ -163,6 +179,7 @@ WQtControlPanel::WQtControlPanel( WMainWindow* parent )
// Set the key for removing modules
m_deleteRoiAction->setShortcutContext( Qt::WidgetShortcut );
m_deleteRoiAction->setShortcut( QKeySequence( "Delete" ) );
m_deleteRoiAction->setIconVisibleInMenu( true );
}
connect( m_deleteRoiAction, SIGNAL( triggered() ), this, SLOT( deleteROITreeItem() ) );
m_roiTreeWidget->addAction( m_deleteModuleAction );
......@@ -1143,3 +1160,7 @@ WQtModuleExcluder& WQtControlPanel::getModuleExcluder() const
return *m_moduleExcluder;
}
QAction* WQtControlPanel::getMissingModuleAction() const
{
return m_missingModuleAction;
}
......@@ -205,6 +205,13 @@ public:
*/
WQtModuleExcluder& getModuleExcluder() const;
/**
* Returns an action which can be triggered by the user if some module are missing.
*
* \return the action.
*/
QAction* getMissingModuleAction() const;
protected:
/**
......@@ -342,6 +349,11 @@ private:
*/
WQtModuleExcluder* m_moduleExcluder;
/**
* Action giving the user fast access to the module config dialog.
*/
QAction* m_missingModuleAction;
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