|
|
@ -66,7 +66,7 @@ void CSVWorld::NotEditableSubDelegate::setEditorData (QWidget* editor, const QMo
|
|
|
|
|
|
|
|
|
|
|
|
CSMWorld::Columns::ColumnId columnId = static_cast<CSMWorld::Columns::ColumnId> (
|
|
|
|
CSMWorld::Columns::ColumnId columnId = static_cast<CSMWorld::Columns::ColumnId> (
|
|
|
|
mTable->getColumnId (index.column()));
|
|
|
|
mTable->getColumnId (index.column()));
|
|
|
|
|
|
|
|
|
|
|
|
if (QVariant::String == v.type())
|
|
|
|
if (QVariant::String == v.type())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label->setText(v.toString());
|
|
|
|
label->setText(v.toString());
|
|
|
@ -75,7 +75,7 @@ void CSVWorld::NotEditableSubDelegate::setEditorData (QWidget* editor, const QMo
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int data = v.toInt();
|
|
|
|
int data = v.toInt();
|
|
|
|
std::vector<std::string> enumNames (CSMWorld::Columns::getEnums (columnId));
|
|
|
|
std::vector<std::string> enumNames (CSMWorld::Columns::getEnums (columnId));
|
|
|
|
|
|
|
|
|
|
|
|
label->setText(QString::fromUtf8(enumNames.at(data).c_str()));
|
|
|
|
label->setText(QString::fromUtf8(enumNames.at(data).c_str()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -116,7 +116,7 @@ mIndex(index)
|
|
|
|
CSVWorld::DialogueDelegateDispatcherProxy::DialogueDelegateDispatcherProxy(QWidget* editor, CSMWorld::ColumnBase::Display display) :
|
|
|
|
CSVWorld::DialogueDelegateDispatcherProxy::DialogueDelegateDispatcherProxy(QWidget* editor, CSMWorld::ColumnBase::Display display) :
|
|
|
|
mEditor(editor),
|
|
|
|
mEditor(editor),
|
|
|
|
mDisplay(display),
|
|
|
|
mDisplay(display),
|
|
|
|
mIndexWrapper(NULL)
|
|
|
|
mIndexWrapper(nullptr)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -324,11 +324,11 @@ CSVWorld::IdContextMenu::IdContextMenu(QWidget *widget, CSMWorld::ColumnBase::Di
|
|
|
|
Q_ASSERT(mWidget != NULL);
|
|
|
|
Q_ASSERT(mWidget != NULL);
|
|
|
|
Q_ASSERT(CSMWorld::ColumnBase::isId(display));
|
|
|
|
Q_ASSERT(CSMWorld::ColumnBase::isId(display));
|
|
|
|
Q_ASSERT(mIdType != CSMWorld::UniversalId::Type_None);
|
|
|
|
Q_ASSERT(mIdType != CSMWorld::UniversalId::Type_None);
|
|
|
|
|
|
|
|
|
|
|
|
mWidget->setContextMenuPolicy(Qt::CustomContextMenu);
|
|
|
|
mWidget->setContextMenuPolicy(Qt::CustomContextMenu);
|
|
|
|
connect(mWidget,
|
|
|
|
connect(mWidget,
|
|
|
|
SIGNAL(customContextMenuRequested(const QPoint &)),
|
|
|
|
SIGNAL(customContextMenuRequested(const QPoint &)),
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
SLOT(showContextMenu(const QPoint &)));
|
|
|
|
SLOT(showContextMenu(const QPoint &)));
|
|
|
|
|
|
|
|
|
|
|
|
mEditIdAction = new QAction(this);
|
|
|
|
mEditIdAction = new QAction(this);
|
|
|
@ -352,7 +352,7 @@ void CSVWorld::IdContextMenu::excludeId(const std::string &id)
|
|
|
|
|
|
|
|
|
|
|
|
QString CSVWorld::IdContextMenu::getWidgetValue() const
|
|
|
|
QString CSVWorld::IdContextMenu::getWidgetValue() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QLineEdit *lineEdit = qobject_cast<QLineEdit *>(mWidget);
|
|
|
|
QLineEdit *lineEdit = qobject_cast<QLineEdit *>(mWidget);
|
|
|
|
QLabel *label = qobject_cast<QLabel *>(mWidget);
|
|
|
|
QLabel *label = qobject_cast<QLabel *>(mWidget);
|
|
|
|
|
|
|
|
|
|
|
|
QString value = "";
|
|
|
|
QString value = "";
|
|
|
@ -411,7 +411,7 @@ void CSVWorld::IdContextMenu::showContextMenu(const QPoint &pos)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
removeEditIdActionFromMenu();
|
|
|
|
removeEditIdActionFromMenu();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!mContextMenu->actions().isEmpty())
|
|
|
|
if (!mContextMenu->actions().isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mContextMenu->exec(mWidget->mapToGlobal(pos));
|
|
|
|
mContextMenu->exec(mWidget->mapToGlobal(pos));
|
|
|
@ -588,9 +588,9 @@ void CSVWorld::EditWidget::remake(int row)
|
|
|
|
tablesLayout->addWidget(label);
|
|
|
|
tablesLayout->addWidget(label);
|
|
|
|
tablesLayout->addWidget(table);
|
|
|
|
tablesLayout->addWidget(table);
|
|
|
|
|
|
|
|
|
|
|
|
connect(table,
|
|
|
|
connect(table,
|
|
|
|
SIGNAL(editRequest(const CSMWorld::UniversalId &, const std::string &)),
|
|
|
|
SIGNAL(editRequest(const CSMWorld::UniversalId &, const std::string &)),
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
SIGNAL(editIdRequest(const CSMWorld::UniversalId &, const std::string &)));
|
|
|
|
SIGNAL(editIdRequest(const CSMWorld::UniversalId &, const std::string &)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!(flags & CSMWorld::ColumnBase::Flag_Dialogue_List))
|
|
|
|
else if (!(flags & CSMWorld::ColumnBase::Flag_Dialogue_List))
|
|
|
@ -854,7 +854,7 @@ CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id,
|
|
|
|
connect (mButtons, SIGNAL (showPreview()), this, SLOT (showPreview()));
|
|
|
|
connect (mButtons, SIGNAL (showPreview()), this, SLOT (showPreview()));
|
|
|
|
connect (mButtons, SIGNAL (viewRecord()), this, SLOT (viewRecord()));
|
|
|
|
connect (mButtons, SIGNAL (viewRecord()), this, SLOT (viewRecord()));
|
|
|
|
connect (mButtons, SIGNAL (switchToRow (int)), this, SLOT (switchToRow (int)));
|
|
|
|
connect (mButtons, SIGNAL (switchToRow (int)), this, SLOT (switchToRow (int)));
|
|
|
|
|
|
|
|
|
|
|
|
connect (this, SIGNAL (universalIdChanged (const CSMWorld::UniversalId&)),
|
|
|
|
connect (this, SIGNAL (universalIdChanged (const CSMWorld::UniversalId&)),
|
|
|
|
mButtons, SLOT (universalIdChanged (const CSMWorld::UniversalId&)));
|
|
|
|
mButtons, SLOT (universalIdChanged (const CSMWorld::UniversalId&)));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -908,7 +908,7 @@ void CSVWorld::DialogueSubView::switchToRow (int row)
|
|
|
|
|
|
|
|
|
|
|
|
setUniversalId (CSMWorld::UniversalId (type, id));
|
|
|
|
setUniversalId (CSMWorld::UniversalId (type, id));
|
|
|
|
updateCurrentId();
|
|
|
|
updateCurrentId();
|
|
|
|
|
|
|
|
|
|
|
|
getEditWidget().remake (row);
|
|
|
|
getEditWidget().remake (row);
|
|
|
|
|
|
|
|
|
|
|
|
int stateColumn = getTable().findColumnIndex (CSMWorld::Columns::ColumnId_Modification);
|
|
|
|
int stateColumn = getTable().findColumnIndex (CSMWorld::Columns::ColumnId_Modification);
|
|
|
@ -923,5 +923,5 @@ void CSVWorld::DialogueSubView::requestFocus (const std::string& id)
|
|
|
|
QModelIndex index = getTable().getModelIndex (id, 0);
|
|
|
|
QModelIndex index = getTable().getModelIndex (id, 0);
|
|
|
|
|
|
|
|
|
|
|
|
if (index.isValid())
|
|
|
|
if (index.isValid())
|
|
|
|
switchToRow (index.row());
|
|
|
|
switchToRow (index.row());
|
|
|
|
}
|
|
|
|
}
|
|
|
|