Commit 3c579438 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 1cbf67cb
...@@ -175,15 +175,11 @@ void MovePlugin::showProps(){ ...@@ -175,15 +175,11 @@ void MovePlugin::showProps(){
pW->dirzy->setText(num); pW->dirzy->setText(num);
num = QString::number(direction[2]); num = QString::number(direction[2]);
pW->dirzz->setText(num); pW->dirzz->setText(num);
if (PluginFunctions::pickMode() == "Move")
pW->objectRadioButton->setChecked(true);
else
pW->selectionRadioButton->setChecked(true);
} }
} }
setPickModeProps(pW,PluginFunctions::pickMode());
pW->show(); pW->show();
propsWindows_.append(pW); propsWindows_.append(pW);
} }
...@@ -420,7 +420,7 @@ void MovePlugin::slotKeyEvent (QKeyEvent* _event) ...@@ -420,7 +420,7 @@ void MovePlugin::slotKeyEvent (QKeyEvent* _event)
void MovePlugin::slotEnableSelectionMode() void MovePlugin::slotEnableSelectionMode()
{ {
PluginFunctions::pickMode("MoveSelecion"); PluginFunctions::pickMode("MoveSelection");
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -437,6 +437,29 @@ void MovePlugin::slotKeyReleaseEvent (QKeyEvent* _event) ...@@ -437,6 +437,29 @@ void MovePlugin::slotKeyReleaseEvent (QKeyEvent* _event)
setManipMode (QtTranslationManipulatorNode::TranslationRotation); 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 PickingInterface implementation
*******************************************************************************/ *******************************************************************************/
...@@ -477,6 +500,11 @@ void MovePlugin::slotPickModeChanged( const std::string& _mode) ...@@ -477,6 +500,11 @@ void MovePlugin::slotPickModeChanged( const std::string& _mode)
} }
else else
PluginFunctions::setViewObjectMarker (PluginFunctions::defaultViewObjectMarker ()); 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: ...@@ -435,6 +435,9 @@ public:
void slotUpdateContextMenuNode( int _nodeId ); void slotUpdateContextMenuNode( int _nodeId );
private: private:
void setPickModeProps(movePropsWidget* _pW, const std::string &_pickmode);
/// List of properties dialogs (each corresponding to one manipulator) /// List of properties dialogs (each corresponding to one manipulator)
QList<movePropsWidget*> propsWindows_; 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