Commit cad92f75 authored by Mike Kremer's avatar Mike Kremer

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 875f285b
......@@ -36,21 +36,14 @@
//***********************************************************************************
// ContextMenu Action triggered
void MovePlugin::moveContextMenu(QAction* _action) {
QVariant contextObject = _action->data();
int objectId = contextObject.toInt();
void MovePlugin::showProps(){
QVariant contextObject = lastAction_->data();
int objectId = contextObject.toInt();
if ( objectId == -1)
return;
if ( objectId == -1)
return;
if ( _action->text() == "Set properties")
showProps( objectId );
}
//***********************************************************************************
void MovePlugin::showProps( int objectId ){
// Get Node
ACG::SceneGraph::BaseNode* node = ACG::SceneGraph::find_node( PluginFunctions::getSceneGraphRootNode(), objectId );
......@@ -63,9 +56,15 @@ void MovePlugin::showProps( int objectId ){
}
int meshID = mNode->getIdentifier();
BaseObjectData* obj;
if ( ! PluginFunctions::getObject(meshID,obj) )
return;
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()));
connect(propsWindow_->posButton,SIGNAL(clicked() ),this,SLOT(slotSetPosition()));
......
......@@ -92,19 +92,15 @@ void MovePlugin::pluginsInitialized() {
// CONTEXT MENU
propsWindow_ = new movePropsWidget();
propsWindow_->hide();
contextMenu_ = new QMenu("Move");
QAction* lastAction;
lastAction = contextMenu_->addAction( "Set properties" );
lastAction->setToolTip("Set properties");
lastAction->setStatusTip( lastAction->toolTip() );
emit addContextMenuItem(contextMenu_->menuAction() , CONTEXTNODEMENU );
lastAction_ = new QAction("Set properties", this);
lastAction_->setToolTip("Set properties");
lastAction_->setStatusTip( lastAction_->toolTip() );
emit addContextMenuItem(lastAction_ , CONTEXTNODEMENU );
connect( contextMenu_ , SIGNAL( triggered(QAction*) ),
this, SLOT(moveContextMenu(QAction*)) );
connect( lastAction_ , SIGNAL( triggered() ),
this, SLOT(showProps()) );
//TOOLBAR
toolbar_ = new QToolBar("Transform and Move");
......
......@@ -296,16 +296,14 @@ class MovePlugin : public QObject, BaseInterface, MouseInterface, PickingInterfa
private slots:
/// called by the move context Menu
void moveContextMenu(QAction* _action);
/// Show properties of move manipulator in a dialog
void showProps( );
private:
/// Move context menu
QMenu* contextMenu_;
movePropsWidget* propsWindow_;
/// Show properties of move manipulator in a dialog
void showProps( int objectId );
QAction* lastAction_;
/** @} */
......
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