Commit beb69aad authored by Matthias Möller's avatar Matthias Möller

- sync selection mode and radio buttons in prop window

- deselect all radio buttons if selection mode is not supported

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14388 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 42bb2d30
......@@ -175,15 +175,11 @@ void MovePlugin::showProps(){
pW->dirzy->setText(num);
num = QString::number(direction[2]);
pW->dirzz->setText(num);
if (PluginFunctions::pickMode() == "Move")
pW->objectRadioButton->setChecked(true);
else
pW->selectionRadioButton->setChecked(true);
}
}
setPickModeProps(pW,PluginFunctions::pickMode());
pW->show();
propsWindows_.append(pW);
}
......@@ -420,7 +420,7 @@ void MovePlugin::slotKeyEvent (QKeyEvent* _event)
void MovePlugin::slotEnableSelectionMode()
{
PluginFunctions::pickMode("MoveSelecion");
PluginFunctions::pickMode("MoveSelection");
}
//------------------------------------------------------------------------------
......@@ -437,6 +437,29 @@ void MovePlugin::slotKeyReleaseEvent (QKeyEvent* _event)
setManipMode (QtTranslationManipulatorNode::TranslationRotation);
}
void MovePlugin::setPickModeProps(movePropsWidget* _pW, const std::string &_pickmode)
{
std::cout << "changed mode to: " <<_pickmode << std::endl;
if (_pickmode == "Move")
{
_pW->objectRadioButton->setChecked(true);
}
else if (_pickmode == "MoveSelection")
{
_pW->selectionRadioButton->setChecked(true);
}
else
{
//not supported, so deselect all radio buttons
_pW->objectRadioButton->setAutoExclusive(false);
_pW->selectionRadioButton->setAutoExclusive(false);
_pW->objectRadioButton->setChecked(false);
_pW->selectionRadioButton->setChecked(false);
_pW->objectRadioButton->setAutoExclusive(true);
_pW->selectionRadioButton->setAutoExclusive(true);
}
}
/*******************************************************************************
PickingInterface implementation
*******************************************************************************/
......@@ -477,6 +500,11 @@ void MovePlugin::slotPickModeChanged( const std::string& _mode)
}
else
PluginFunctions::setViewObjectMarker (PluginFunctions::defaultViewObjectMarker ());
//change the selection mode in propety widget
for (std::size_t i = 0; i < propsWindows_.size(); ++i)
setPickModeProps(propsWindows_[i], _mode);
}
......
......@@ -435,6 +435,9 @@ public:
void slotUpdateContextMenuNode( int _nodeId );
private:
void setPickModeProps(movePropsWidget* _pW, const std::string &_pickmode);
/// List of properties dialogs (each corresponding to one manipulator)
QList<movePropsWidget*> propsWindows_;
......
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