forked from teamnwah/openmw-tes3coop
pass on user settings updates to potentially interested parties within a scene subview
This commit is contained in:
parent
39b7340580
commit
b2cb5f0374
8 changed files with 39 additions and 3 deletions
|
@ -16,3 +16,8 @@ void CSVRender::EditMode::activate (CSVWidget::SceneToolbar *toolbar)
|
||||||
{
|
{
|
||||||
mWorldspaceWidget->setInteractionMask (mMask);
|
mWorldspaceWidget->setInteractionMask (mMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSVRender::EditMode::updateUserSetting (const QString& name, const QStringList& value)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -22,6 +22,9 @@ namespace CSVRender
|
||||||
unsigned int getInteractionMask() const;
|
unsigned int getInteractionMask() const;
|
||||||
|
|
||||||
virtual void activate (CSVWidget::SceneToolbar *toolbar);
|
virtual void activate (CSVWidget::SceneToolbar *toolbar);
|
||||||
|
|
||||||
|
/// Default-implementation: Do nothing.
|
||||||
|
virtual void updateUserSetting (const QString& name, const QStringList& value);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -254,6 +254,11 @@ unsigned int CSVRender::WorldspaceWidget::getInteractionMask() const
|
||||||
return mInteractionMask & getVisibilityMask();
|
return mInteractionMask & getVisibilityMask();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSVRender::WorldspaceWidget::updateUserSetting (const QString& name, const QStringList& value)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void CSVRender::WorldspaceWidget::addVisibilitySelectorButtons (
|
void CSVRender::WorldspaceWidget::addVisibilitySelectorButtons (
|
||||||
CSVWidget::SceneToolToggle2 *tool)
|
CSVWidget::SceneToolToggle2 *tool)
|
||||||
{
|
{
|
||||||
|
|
|
@ -93,6 +93,8 @@ namespace CSVRender
|
||||||
/// marked for interaction.
|
/// marked for interaction.
|
||||||
unsigned int getInteractionMask() const;
|
unsigned int getInteractionMask() const;
|
||||||
|
|
||||||
|
virtual void updateUserSetting (const QString& name, const QStringList& value);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual void addVisibilitySelectorButtons (CSVWidget::SceneToolToggle2 *tool);
|
virtual void addVisibilitySelectorButtons (CSVWidget::SceneToolToggle2 *tool);
|
||||||
|
|
|
@ -71,6 +71,11 @@ void CSVWidget::SceneToolMode::addButton (ModeButton *button, const std::string&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CSVWidget::ModeButton *CSVWidget::SceneToolMode::getCurrent()
|
||||||
|
{
|
||||||
|
return mCurrent;
|
||||||
|
}
|
||||||
|
|
||||||
void CSVWidget::SceneToolMode::selected()
|
void CSVWidget::SceneToolMode::selected()
|
||||||
{
|
{
|
||||||
std::map<ModeButton *, std::string>::const_iterator iter =
|
std::map<ModeButton *, std::string>::const_iterator iter =
|
||||||
|
|
|
@ -41,6 +41,9 @@ namespace CSVWidget
|
||||||
/// The ownership of \a button is transferred to *this.
|
/// The ownership of \a button is transferred to *this.
|
||||||
void addButton (ModeButton *button, const std::string& id);
|
void addButton (ModeButton *button, const std::string& id);
|
||||||
|
|
||||||
|
/// Will return a 0-pointer only if the mode does not have any buttons yet.
|
||||||
|
ModeButton *getCurrent();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
void modeChanged (const std::string& id);
|
void modeChanged (const std::string& id);
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#include "../render/pagedworldspacewidget.hpp"
|
#include "../render/pagedworldspacewidget.hpp"
|
||||||
#include "../render/unpagedworldspacewidget.hpp"
|
#include "../render/unpagedworldspacewidget.hpp"
|
||||||
|
#include "../render/editmode.hpp"
|
||||||
|
|
||||||
#include "../widget/scenetoolbar.hpp"
|
#include "../widget/scenetoolbar.hpp"
|
||||||
#include "../widget/scenetoolmode.hpp"
|
#include "../widget/scenetoolmode.hpp"
|
||||||
|
@ -26,7 +27,8 @@
|
||||||
#include "creator.hpp"
|
#include "creator.hpp"
|
||||||
|
|
||||||
CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
|
CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
|
||||||
: SubView (id), mScene(NULL), mLayout(new QHBoxLayout), mDocument(document), mToolbar(NULL)
|
: SubView (id), mScene(NULL), mLayout(new QHBoxLayout), mDocument(document), mToolbar(NULL),
|
||||||
|
mEditMode (0)
|
||||||
{
|
{
|
||||||
QVBoxLayout *layout = new QVBoxLayout;
|
QVBoxLayout *layout = new QVBoxLayout;
|
||||||
|
|
||||||
|
@ -121,8 +123,8 @@ CSVWidget::SceneToolbar* CSVWorld::SceneSubView::makeToolbar (CSVRender::Worldsp
|
||||||
CSVWidget::SceneToolRun *runTool = widget->makeRunTool (toolbar);
|
CSVWidget::SceneToolRun *runTool = widget->makeRunTool (toolbar);
|
||||||
toolbar->addTool (runTool);
|
toolbar->addTool (runTool);
|
||||||
|
|
||||||
CSVWidget::SceneToolMode *editModeTool = widget->makeEditModeSelector (toolbar);
|
mEditMode = widget->makeEditModeSelector (toolbar);
|
||||||
toolbar->addTool (editModeTool);
|
toolbar->addTool (mEditMode);
|
||||||
|
|
||||||
return toolbar;
|
return toolbar;
|
||||||
}
|
}
|
||||||
|
@ -147,6 +149,13 @@ std::string CSVWorld::SceneSubView::getTitle() const
|
||||||
return mTitle;
|
return mTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSVWorld::SceneSubView::updateUserSetting (const QString& name, const QStringList& value)
|
||||||
|
{
|
||||||
|
mScene->updateUserSetting (name, value);
|
||||||
|
dynamic_cast<CSVRender::EditMode&> (*mEditMode->getCurrent()).updateUserSetting (name, value);
|
||||||
|
CSVDoc::SubView::updateUserSetting (name, value);
|
||||||
|
}
|
||||||
|
|
||||||
void CSVWorld::SceneSubView::cellSelectionChanged (const CSMWorld::UniversalId& id)
|
void CSVWorld::SceneSubView::cellSelectionChanged (const CSMWorld::UniversalId& id)
|
||||||
{
|
{
|
||||||
setUniversalId(id);
|
setUniversalId(id);
|
||||||
|
|
|
@ -27,6 +27,7 @@ namespace CSVRender
|
||||||
namespace CSVWidget
|
namespace CSVWidget
|
||||||
{
|
{
|
||||||
class SceneToolbar;
|
class SceneToolbar;
|
||||||
|
class SceneToolMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace CSVWorld
|
namespace CSVWorld
|
||||||
|
@ -45,6 +46,7 @@ namespace CSVWorld
|
||||||
CSMDoc::Document& mDocument;
|
CSMDoc::Document& mDocument;
|
||||||
CSVWidget::SceneToolbar* mToolbar;
|
CSVWidget::SceneToolbar* mToolbar;
|
||||||
std::string mTitle;
|
std::string mTitle;
|
||||||
|
CSVWidget::SceneToolMode *mEditMode;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -58,6 +60,8 @@ namespace CSVWorld
|
||||||
|
|
||||||
virtual std::string getTitle() const;
|
virtual std::string getTitle() const;
|
||||||
|
|
||||||
|
virtual void updateUserSetting (const QString& name, const QStringList& value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void makeConnections(CSVRender::PagedWorldspaceWidget* widget);
|
void makeConnections(CSVRender::PagedWorldspaceWidget* widget);
|
||||||
|
|
Loading…
Reference in a new issue