store lock state and pass it on to edit mode

sceneinput
Marc Zinnschlag 9 years ago
parent b2cb5f0374
commit 3ada08af90

@ -21,3 +21,8 @@ void CSVRender::EditMode::updateUserSetting (const QString& name, const QStringL
{
}
void CSVRender::EditMode::setEditLock (bool locked)
{
}

@ -25,6 +25,9 @@ namespace CSVRender
/// Default-implementation: Do nothing.
virtual void updateUserSetting (const QString& name, const QStringList& value);
/// Default-implementation: Ignored.
virtual void setEditLock (bool locked);
};
}

@ -28,7 +28,7 @@
CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
: SubView (id), mScene(NULL), mLayout(new QHBoxLayout), mDocument(document), mToolbar(NULL),
mEditMode (0)
mEditMode (0), mLocked (false)
{
QVBoxLayout *layout = new QVBoxLayout;
@ -131,7 +131,8 @@ CSVWidget::SceneToolbar* CSVWorld::SceneSubView::makeToolbar (CSVRender::Worldsp
void CSVWorld::SceneSubView::setEditLock (bool locked)
{
mLocked = locked;
dynamic_cast<CSVRender::EditMode&> (*mEditMode->getCurrent()).setEditLock (locked);
}
void CSVWorld::SceneSubView::setStatusBar (bool show)
@ -258,4 +259,12 @@ void CSVWorld::SceneSubView::replaceToolbarAndWorldspace (CSVRender::WorldspaceW
mScene->selectDefaultNavigationMode();
setFocusProxy (mScene);
connect (mEditMode, SIGNAL (modeChanged (const std::string&)),
this, SLOT (editModeChanged (const std::string&)));
}
void CSVWorld::SceneSubView::editModeChanged (const std::string& id)
{
dynamic_cast<CSVRender::EditMode&> (*mEditMode->getCurrent()).setEditLock (mLocked);
}

@ -47,6 +47,7 @@ namespace CSVWorld
CSVWidget::SceneToolbar* mToolbar;
std::string mTitle;
CSVWidget::SceneToolMode *mEditMode;
bool mLocked;
public:
@ -85,6 +86,8 @@ namespace CSVWorld
void cellSelectionChanged (const CSMWorld::UniversalId& id);
void handleDrop(const std::vector<CSMWorld::UniversalId>& data);
void editModeChanged (const std::string& id);
};
}

Loading…
Cancel
Save