1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00

Update SceneWidget when relevant user settings change.

This commit is contained in:
cc9cii 2014-09-28 14:08:14 +10:00
parent 9902e08773
commit 8a0ff17c22
4 changed files with 26 additions and 1 deletions

View File

@ -397,4 +397,10 @@ namespace CSVRender
else if (mode=="bright")
setLighting (&mLightingBright);
}
void SceneWidget::updateUserSetting (const QString &key, const QStringList &list)
{
if(key.contains(QRegExp("^\\b(Objects|Shader|Scene)", Qt::CaseInsensitive)))
flagAsModified();
}
}

View File

@ -110,6 +110,10 @@ namespace CSVRender
LightingNight mLightingNight;
LightingBright mLightingBright;
public slots:
void updateUserSetting (const QString &key, const QStringList &list);
private slots:
void update();

View File

@ -247,6 +247,8 @@ void CSVWorld::SceneSubView::replaceToolbarAndWorldspace (CSVRender::WorldspaceW
mToolbar = toolbar;
connect (mScene, SIGNAL (focusToolbarRequest()), mToolbar, SLOT (setFocus()));
connect (this, SIGNAL (updateSceneUserSetting(const QString &, const QStringList &)),
mScene, SLOT (updateUserSetting(const QString &, const QStringList &)));
connect (mToolbar, SIGNAL (focusSceneRequest()), mScene, SLOT (setFocus()));
mLayout->addWidget (mToolbar, 0);
@ -254,4 +256,9 @@ void CSVWorld::SceneSubView::replaceToolbarAndWorldspace (CSVRender::WorldspaceW
mScene->selectDefaultNavigationMode();
setFocusProxy (mScene);
}
}
void CSVWorld::SceneSubView::updateUserSetting (const QString &key, const QStringList &list)
{
emit updateSceneUserSetting(key, list);
}

View File

@ -82,6 +82,14 @@ namespace CSVWorld
void cellSelectionChanged (const CSMWorld::UniversalId& id);
void handleDrop(const std::vector<CSMWorld::UniversalId>& data);
public slots:
void updateUserSetting (const QString &, const QStringList &);
signals:
void updateSceneUserSetting (const QString &, const QStringList &);
};
}