From aa46105f155d310ad854ba726656275ce439e0ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= <moebius@cs.rwth-aachen.de> Date: Wed, 30 Sep 2009 15:50:41 +0000 Subject: [PATCH] New Toolbox Interface ... This will break all Toolbox Plugins!!! git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7240 383ad7c9-94d9-4d36-a494-682f7c89f535 --- DataControlPlugin.cc | 10 ++-------- DataControlPlugin.hh | 9 ++++++--- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/DataControlPlugin.cc b/DataControlPlugin.cc index 0490ead..8046d6a 100644 --- a/DataControlPlugin.cc +++ b/DataControlPlugin.cc @@ -117,18 +117,12 @@ void DataControlPlugin::pluginsInitialized() { //****************************************************************************** -/** \brief initialize the toolBox - * - * @param _widget a reference to the toolBox - * @return returns if the toolbox was created successfully - */ -bool DataControlPlugin::initializeToolbox(QWidget*& _widget) +void DataControlPlugin::initializePlugin() { locked = false; tool_ = new DatacontrolToolboxWidget(); connect( tool_ , SIGNAL( keyEvent( QKeyEvent* ) ), this , SLOT(slotKeyEvent ( QKeyEvent* ) )); - _widget = tool_; QSize size(300, 300); tool_->resize(size); @@ -167,7 +161,7 @@ bool DataControlPlugin::initializeToolbox(QWidget*& _widget) connect( viewHeader_, SIGNAL(customContextMenuRequested ( const QPoint & ) ), this, SLOT(slotHeaderCustomContextMenuRequested ( const QPoint & ) )); - return true; + emit addToolbox("Data Control", tool_); } diff --git a/DataControlPlugin.hh b/DataControlPlugin.hh index a53094a..6db3a9f 100644 --- a/DataControlPlugin.hh +++ b/DataControlPlugin.hh @@ -90,16 +90,22 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn // LoggingInterface void log(Logtype _type, QString _message); void log(QString _message); + // ContextMenuInterface void addContextMenuItem(QAction* _action , ContextMenuType _type); void addContextMenuItem(QAction* _action , DataType _objectType , ContextMenuType _type ); + // LoadSaveInterface void deleteObject( int _id ); void emptyObjectAdded( int _id ); void copyObject( int _oldId, int& _newId); + + // ToolboxInterface + void addToolbox( QString _name , QWidget* _widget ); private slots : // BaseInterface + void initializePlugin(); void pluginsInitialized(); void slotObjectUpdated ( int _identifier ); void slotVisibilityChanged ( int _identifier ); @@ -123,9 +129,6 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn /// Destructor ~DataControlPlugin() {}; - /// Initialize the ToolBox - bool initializeToolbox(QWidget*& _widget); - /// Name of the Plugin QString name(){ return (QString("DataControl")); }; -- GitLab