do not start move drags while the document is locked for editing

move
Marc Zinnschlag 9 years ago
parent 1726393963
commit dd564daba0

@ -27,7 +27,8 @@ int CSVRender::InstanceMode::getSubModeFromId (const std::string& id) const
CSVRender::InstanceMode::InstanceMode (WorldspaceWidget *worldspaceWidget, QWidget *parent) CSVRender::InstanceMode::InstanceMode (WorldspaceWidget *worldspaceWidget, QWidget *parent)
: EditMode (worldspaceWidget, QIcon (":placeholder"), Mask_Reference, "Instance editing", : EditMode (worldspaceWidget, QIcon (":placeholder"), Mask_Reference, "Instance editing",
parent), mSubMode (0), mSelectionMode (0), mDragMode (DragMode_None), mDragAxis (-1) parent), mSubMode (0), mSelectionMode (0), mDragMode (DragMode_None), mDragAxis (-1),
mLocked (false)
{ {
} }
@ -90,6 +91,12 @@ void CSVRender::InstanceMode::deactivate (CSVWidget::SceneToolbar *toolbar)
EditMode::deactivate (toolbar); EditMode::deactivate (toolbar);
} }
void CSVRender::InstanceMode::setEditLock (bool locked)
{
mLocked = locked;
}
void CSVRender::InstanceMode::primaryEditPressed (osg::ref_ptr<TagBase> tag) void CSVRender::InstanceMode::primaryEditPressed (osg::ref_ptr<TagBase> tag)
{ {
if (CSMPrefs::get()["3D Scene Input"]["context-select"].isTrue()) if (CSMPrefs::get()["3D Scene Input"]["context-select"].isTrue())
@ -134,7 +141,7 @@ void CSVRender::InstanceMode::secondarySelectPressed (osg::ref_ptr<TagBase> tag)
bool CSVRender::InstanceMode::primaryEditStartDrag (osg::ref_ptr<TagBase> tag) bool CSVRender::InstanceMode::primaryEditStartDrag (osg::ref_ptr<TagBase> tag)
{ {
if (mDragMode!=DragMode_None) if (mDragMode!=DragMode_None || mLocked)
return false; return false;
if (tag && CSMPrefs::get()["3D Scene Input"]["context-select"].isTrue()) if (tag && CSMPrefs::get()["3D Scene Input"]["context-select"].isTrue())
@ -178,6 +185,8 @@ bool CSVRender::InstanceMode::primaryEditStartDrag (osg::ref_ptr<TagBase> tag)
bool CSVRender::InstanceMode::secondaryEditStartDrag (osg::ref_ptr<TagBase> tag) bool CSVRender::InstanceMode::secondaryEditStartDrag (osg::ref_ptr<TagBase> tag)
{ {
if (mLocked)
return false;
return false; return false;
} }

@ -26,6 +26,7 @@ namespace CSVRender
InstanceSelectionMode *mSelectionMode; InstanceSelectionMode *mSelectionMode;
DragMode mDragMode; DragMode mDragMode;
int mDragAxis; int mDragAxis;
bool mLocked;
int getSubModeFromId (const std::string& id) const; int getSubModeFromId (const std::string& id) const;
@ -37,6 +38,8 @@ namespace CSVRender
virtual void deactivate (CSVWidget::SceneToolbar *toolbar); virtual void deactivate (CSVWidget::SceneToolbar *toolbar);
virtual void setEditLock (bool locked);
virtual void primaryEditPressed (osg::ref_ptr<TagBase> tag); virtual void primaryEditPressed (osg::ref_ptr<TagBase> tag);
virtual void secondaryEditPressed (osg::ref_ptr<TagBase> tag); virtual void secondaryEditPressed (osg::ref_ptr<TagBase> tag);

Loading…
Cancel
Save