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

added Feature_Constant to IdTable

This commit is contained in:
Marc Zinnschlag 2014-07-05 12:44:11 +02:00
parent 1b1f1bade3
commit e171babd2f
2 changed files with 9 additions and 6 deletions

View File

@ -29,7 +29,10 @@ namespace CSMWorld
Feature_View = Feature_ViewId | Feature_ViewCell,
Feature_Preview = 8
Feature_Preview = 8,
/// Table can not be modified through ordinary means.
Feature_Constant = 16
};
private:

View File

@ -54,7 +54,7 @@ void CSVWorld::Table::contextMenuEvent (QContextMenuEvent *event)
/// \todo add menu items for select all and clear selection
if (!mEditLock)
if (!mEditLock && !(mModel->getFeatures() & CSMWorld::IdTableBase::Feature_Constant))
{
if (selectedRows.size()==1)
{
@ -276,7 +276,7 @@ CSMWorld::UniversalId CSVWorld::Table::getUniversalId (int row) const
void CSVWorld::Table::editRecord()
{
if (!mEditLock)
if (!mEditLock || (mModel->getFeatures() & CSMWorld::IdTableBase::Feature_Constant))
{
QModelIndexList selectedRows = selectionModel()->selectedRows();
@ -287,7 +287,7 @@ void CSVWorld::Table::editRecord()
void CSVWorld::Table::cloneRecord()
{
if (!mEditLock)
if (!mEditLock || (mModel->getFeatures() & CSMWorld::IdTableBase::Feature_Constant))
{
QModelIndexList selectedRows = selectionModel()->selectedRows();
const CSMWorld::UniversalId& toClone = getUniversalId(selectedRows.begin()->row());
@ -300,7 +300,7 @@ void CSVWorld::Table::cloneRecord()
void CSVWorld::Table::moveUpRecord()
{
if (mEditLock)
if (mEditLock || (mModel->getFeatures() & CSMWorld::IdTableBase::Feature_Constant))
return;
QModelIndexList selectedRows = selectionModel()->selectedRows();
@ -333,7 +333,7 @@ void CSVWorld::Table::moveUpRecord()
void CSVWorld::Table::moveDownRecord()
{
if (mEditLock)
if (mEditLock || (mModel->getFeatures() & CSMWorld::IdTableBase::Feature_Constant))
return;
QModelIndexList selectedRows = selectionModel()->selectedRows();