|
|
@ -464,8 +464,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance();
|
|
|
|
CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance();
|
|
|
|
|
|
|
|
|
|
|
|
const std::vector<CSMWorld::UniversalId::Type> referenceables(CSMWorld::UniversalId::listReferenceableTypes());
|
|
|
|
bool isReferenceable = id.getClass() == CSMWorld::UniversalId::Class_RefRecord;
|
|
|
|
bool isReferenceable = std::find(referenceables.begin(), referenceables.end(), id.getType()) != referenceables.end();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// User setting to reuse sub views (on a per top level view basis)
|
|
|
|
// User setting to reuse sub views (on a per top level view basis)
|
|
|
|
bool reuse =
|
|
|
|
bool reuse =
|
|
|
@ -474,10 +473,14 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach(SubView *sb, mSubViews)
|
|
|
|
foreach(SubView *sb, mSubViews)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if((isReferenceable && (CSMWorld::UniversalId(CSMWorld::UniversalId::Type_Referenceable, id.getId()) == CSMWorld::UniversalId(CSMWorld::UniversalId::Type_Referenceable, sb->getUniversalId().getId())))
|
|
|
|
bool isSubViewReferenceable =
|
|
|
|
|| (!isReferenceable && (id == sb->getUniversalId())))
|
|
|
|
sb->getUniversalId().getType() == CSMWorld::UniversalId::Type_Referenceable;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if((isReferenceable && isSubViewReferenceable && id.getId() == sb->getUniversalId().getId())
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
(!isReferenceable && id == sb->getUniversalId()))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sb->setFocus(Qt::OtherFocusReason); // FIXME: focus not quite working
|
|
|
|
sb->setFocus();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -497,7 +500,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SubView *view = NULL;
|
|
|
|
SubView *view = NULL;
|
|
|
|
if(std::find(referenceables.begin(), referenceables.end(), id.getType()) != referenceables.end())
|
|
|
|
if(isReferenceable)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
view = mSubViewFactory.makeSubView (CSMWorld::UniversalId(CSMWorld::UniversalId::Type_Referenceable, id.getId()), *mDocument);
|
|
|
|
view = mSubViewFactory.makeSubView (CSMWorld::UniversalId(CSMWorld::UniversalId::Type_Referenceable, id.getId()), *mDocument);
|
|
|
|
}
|
|
|
|
}
|
|
|
|