added preview button

actorid
Marek Kochanowicz 11 years ago
parent 6416ae90d2
commit 8f3103ce65

@ -405,16 +405,21 @@ CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id, CSM
buttonsLayout->addWidget(nextButton, 1); buttonsLayout->addWidget(nextButton, 1);
buttonsLayout->addStretch(2); buttonsLayout->addStretch(2);
QToolButton* previewButton = new QToolButton(mainWidget);
QToolButton* cloneButton = new QToolButton(mainWidget); QToolButton* cloneButton = new QToolButton(mainWidget);
QToolButton* addButton = new QToolButton(mainWidget); QToolButton* addButton = new QToolButton(mainWidget);
QToolButton* deleteButton = new QToolButton(mainWidget); QToolButton* deleteButton = new QToolButton(mainWidget);
QToolButton* revertButton = new QToolButton(mainWidget); QToolButton* revertButton = new QToolButton(mainWidget);
previewButton->setEnabled(mTable->hasPreview());
buttonsLayout->addWidget(previewButton);
buttonsLayout->addWidget(cloneButton); buttonsLayout->addWidget(cloneButton);
buttonsLayout->addWidget(addButton); buttonsLayout->addWidget(addButton);
buttonsLayout->addWidget(deleteButton); buttonsLayout->addWidget(deleteButton);
buttonsLayout->addWidget(revertButton); buttonsLayout->addWidget(revertButton);
connect(previewButton, SIGNAL(clicked()), this, SLOT(showPreview()));
connect(nextButton, SIGNAL(clicked()), this, SLOT(nextId())); connect(nextButton, SIGNAL(clicked()), this, SLOT(nextId()));
connect(prevButton, SIGNAL(clicked()), this, SLOT(prevId())); connect(prevButton, SIGNAL(clicked()), this, SLOT(prevId()));
connect(cloneButton, SIGNAL(clicked()), this, SLOT(cloneRequest())); connect(cloneButton, SIGNAL(clicked()), this, SLOT(cloneRequest()));
@ -615,4 +620,12 @@ void CSVWorld::DialogueSubView::cloneRequest ()
{ {
mBottom->cloneRequest(mTable->data(mTable->index (mRow, 0)).toString().toStdString(), mBottom->cloneRequest(mTable->data(mTable->index (mRow, 0)).toString().toStdString(),
static_cast<CSMWorld::UniversalId::Type>(mTable->data(mTable->index(mRow, 2)).toInt())); static_cast<CSMWorld::UniversalId::Type>(mTable->data(mTable->index(mRow, 2)).toInt()));
}
void CSVWorld::DialogueSubView::showPreview ()
{
if (mTable->hasPreview())
{
emit focusId(CSMWorld::UniversalId(CSMWorld::UniversalId::Type_Preview, mTable->data(mTable->index (mRow, 0)).toString().toStdString()), "");
}
} }

@ -185,7 +185,10 @@ namespace CSVWorld
void prevId(); void prevId();
void showPreview();
void revertRecord(); void revertRecord();
void deleteRecord(); void deleteRecord();
void cloneRequest(); void cloneRequest();

@ -442,6 +442,7 @@ void CSVWorld::Table::previewRecord()
emit editRequest (CSMWorld::UniversalId (CSMWorld::UniversalId::Type_Preview, id) , ""); emit editRequest (CSMWorld::UniversalId (CSMWorld::UniversalId::Type_Preview, id) , "");
} }
} }
void CSVWorld::Table::updateEditorSetting (const QString &settingName, const QString &settingValue) void CSVWorld::Table::updateEditorSetting (const QString &settingName, const QString &settingValue)
{ {
int columns = mModel->columnCount(); int columns = mModel->columnCount();

Loading…
Cancel
Save