Commit 582973e4 authored by Mike Kremer's avatar Mike Kremer
Browse files

Replaced context submenu with direct entry. Some minor changes.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5261 383ad7c9-94d9-4d36-a494-682f7c89f535
parent ce040476
...@@ -36,21 +36,14 @@ ...@@ -36,21 +36,14 @@
//*********************************************************************************** //***********************************************************************************
// ContextMenu Action triggered void MovePlugin::showProps(){
void MovePlugin::moveContextMenu(QAction* _action) {
QVariant contextObject = _action->data(); QVariant contextObject = lastAction_->data();
int objectId = contextObject.toInt(); int objectId = contextObject.toInt();
if ( objectId == -1) if ( objectId == -1)
return; return;
if ( _action->text() == "Set properties")
showProps( objectId );
}
//***********************************************************************************
void MovePlugin::showProps( int objectId ){
// Get Node // Get Node
ACG::SceneGraph::BaseNode* node = ACG::SceneGraph::find_node( PluginFunctions::getSceneGraphRootNode(), objectId ); ACG::SceneGraph::BaseNode* node = ACG::SceneGraph::find_node( PluginFunctions::getSceneGraphRootNode(), objectId );
...@@ -63,9 +56,15 @@ void MovePlugin::showProps( int objectId ){ ...@@ -63,9 +56,15 @@ void MovePlugin::showProps( int objectId ){
} }
int meshID = mNode->getIdentifier(); int meshID = mNode->getIdentifier();
BaseObjectData* obj;
if ( ! PluginFunctions::getObject(meshID,obj) )
return;
ACG::SceneGraph::BaseNode* mesh = ACG::SceneGraph::find_node( PluginFunctions::getSceneGraphRootNode(), meshID ); ACG::SceneGraph::BaseNode* mesh = ACG::SceneGraph::find_node( PluginFunctions::getSceneGraphRootNode(), meshID );
// TODO: Fenster an obj attachen und Daten per Signale austauschen
propsWindow_->setWindowTitle(QString((mesh->name()).c_str())); propsWindow_->setWindowTitle(QString((mesh->name()).c_str()));
connect(propsWindow_->posButton,SIGNAL(clicked() ),this,SLOT(slotSetPosition())); connect(propsWindow_->posButton,SIGNAL(clicked() ),this,SLOT(slotSetPosition()));
......
...@@ -92,19 +92,15 @@ void MovePlugin::pluginsInitialized() { ...@@ -92,19 +92,15 @@ void MovePlugin::pluginsInitialized() {
// CONTEXT MENU // CONTEXT MENU
propsWindow_ = new movePropsWidget(); propsWindow_ = new movePropsWidget();
propsWindow_->hide(); propsWindow_->hide();
contextMenu_ = new QMenu("Move");
QAction* lastAction;
lastAction = contextMenu_->addAction( "Set properties" ); lastAction_ = new QAction("Set properties", this);
lastAction->setToolTip("Set properties"); lastAction_->setToolTip("Set properties");
lastAction->setStatusTip( lastAction->toolTip() ); lastAction_->setStatusTip( lastAction_->toolTip() );
emit addContextMenuItem(contextMenu_->menuAction() , CONTEXTNODEMENU ); emit addContextMenuItem(lastAction_ , CONTEXTNODEMENU );
connect( contextMenu_ , SIGNAL( triggered(QAction*) ), connect( lastAction_ , SIGNAL( triggered() ),
this, SLOT(moveContextMenu(QAction*)) ); this, SLOT(showProps()) );
//TOOLBAR //TOOLBAR
toolbar_ = new QToolBar("Transform and Move"); toolbar_ = new QToolBar("Transform and Move");
......
...@@ -296,16 +296,14 @@ class MovePlugin : public QObject, BaseInterface, MouseInterface, PickingInterfa ...@@ -296,16 +296,14 @@ class MovePlugin : public QObject, BaseInterface, MouseInterface, PickingInterfa
private slots: private slots:
/// called by the move context Menu /// Show properties of move manipulator in a dialog
void moveContextMenu(QAction* _action); void showProps( );
private: private:
/// Move context menu /// Move context menu
QMenu* contextMenu_; QMenu* contextMenu_;
movePropsWidget* propsWindow_; movePropsWidget* propsWindow_;
QAction* lastAction_;
/// Show properties of move manipulator in a dialog
void showProps( int objectId );
/** @} */ /** @} */
......
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