update preview title on changed referenceableID (preview for references only)

actorid
Marc Zinnschlag 11 years ago
parent 58daf52a67
commit 698fe8cce3

@ -149,7 +149,7 @@ void CSVRender::PreviewWidget::ReferenceDataChanged (const QModelIndex& topLeft,
if (index.column()>=topLeft.column() && index.column()<=bottomRight.row())
{
mReferenceableId = references.data (index).toString().toUtf8().constData();
/// \todo update title
emit referenceableIdChanged (mReferenceableId);
setModel();
}

@ -46,6 +46,8 @@ namespace CSVRender
void closeRequest();
void referenceableIdChanged (const std::string& id);
private slots:
void ReferenceableDataChanged (const QModelIndex& topLeft,

@ -21,10 +21,7 @@ CSVWorld::PreviewSubView::PreviewSubView (const CSMWorld::UniversalId& id, CSMDo
std::string referenceableId =
document.getData().getReferences().getRecord (id.getId()).get().mRefID;
if (referenceableId.empty())
setWindowTitle ("Preview: Reference to <nothing>");
else
setWindowTitle (("Preview: Reference to " + referenceableId).c_str());
referenceableIdChanged (referenceableId);
mScene =
new CSVRender::PreviewWidget (document.getData(), referenceableId, id.getId(), this);
@ -45,6 +42,8 @@ CSVWorld::PreviewSubView::PreviewSubView (const CSMWorld::UniversalId& id, CSMDo
setWidget (widget);
connect (mScene, SIGNAL (closeRequest()), this, SLOT (closeRequest()));
connect (mScene, SIGNAL (referenceableIdChanged (const std::string&)),
this, SLOT (referenceableIdChanged (const std::string&)));
}
void CSVWorld::PreviewSubView::setEditLock (bool locked) {}
@ -52,4 +51,12 @@ void CSVWorld::PreviewSubView::setEditLock (bool locked) {}
void CSVWorld::PreviewSubView::closeRequest()
{
deleteLater();
}
void CSVWorld::PreviewSubView::referenceableIdChanged (const std::string& id)
{
if (id.empty())
setWindowTitle ("Preview: Reference to <nothing>");
else
setWindowTitle (("Preview: Reference to " + id).c_str());
}

@ -30,6 +30,8 @@ namespace CSVWorld
private slots:
void closeRequest();
void referenceableIdChanged (const std::string& id);
};
}

Loading…
Cancel
Save