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

[ADD #89] added tab showing module meta info. This only adds the tab. Not yet filled with text.

parent fceacfdd
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#include "WQtModuleMetaInfo.h"
#include "WQtModuleMetaInfo.moc"
WQtModuleMetaInfo::WQtModuleMetaInfo( WModule::SPtr module, QWidget* parent ):
QTextEdit( parent ),
m_module( module )
{
// initialize members
setText( "Currently in development. Check back soon." );
}
WQtModuleMetaInfo::~WQtModuleMetaInfo()
{
// cleanup
}
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WQTMODULEMETAINFO_H
#define WQTMODULEMETAINFO_H
#include <QtGui/QTextEdit>
#include "core/kernel/WModule.h"
/**
* Text widget showing the module meta data.
*/
class WQtModuleMetaInfo: public QTextEdit
{
Q_OBJECT
public:
/**
* Default constructor.
*
* \param parent the parent widget
* \param module the module for which to show the meta info
*/
WQtModuleMetaInfo( WModule::SPtr module, QWidget* parent = 0 );
/**
* Destructor.
*/
virtual ~WQtModuleMetaInfo();
protected:
private:
/**
* The module.
*/
WModule::SPtr m_module;
};
#endif // WQTMODULEMETAINFO_H
......@@ -56,6 +56,7 @@
#include "../events/WRoiAssocEvent.h"
#include "../events/WRoiRemoveEvent.h"
#include "../WMainWindow.h"
#include "../WQtModuleMetaInfo.h"
#include "../networkEditor/WQtNetworkEditor.h"
#include "../WQt4Gui.h"
#include "../WQtCombinerActionList.h"
......@@ -863,6 +864,10 @@ void WQtControlPanel::setActiveModule( WModule::SPtr module, bool forceUpdate )
// remove property tabs
clearAndDeleteTabs();
// update module meta info tab also for crashed modules
WQtModuleMetaInfo* metaInfoWidget = new WQtModuleMetaInfo( module );
m_tabWidget->addTab( metaInfoWidget, "About && Help" );
// set new property tabs if module is not crashed
if( !module->isCrashed() )
{
......@@ -1237,7 +1242,7 @@ void WQtControlPanel::clearAndDeleteTabs()
{
m_tabWidget->setDisabled( true );
QWidget *widget;
while( ( widget = m_tabWidget->widget( 0 ) ))
while( ( widget = m_tabWidget->widget( 0 ) ))
{
m_tabWidget->removeTab( 0 );
delete 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