mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-01 19:15:33 +00:00
do not offer view action for cells flagged as deleted
This commit is contained in:
parent
4a119c8f46
commit
f04348fb8e
2 changed files with 12 additions and 2 deletions
|
@ -40,7 +40,16 @@ void CSVWorld::Table::contextMenuEvent (QContextMenuEvent *event)
|
||||||
menu.addAction(mCloneAction);
|
menu.addAction(mCloneAction);
|
||||||
|
|
||||||
if (mModel->getViewing()!=CSMWorld::IdTable::Viewing_None)
|
if (mModel->getViewing()!=CSMWorld::IdTable::Viewing_None)
|
||||||
menu.addAction (mViewAction);
|
{
|
||||||
|
int row = selectedRows.begin()->row();
|
||||||
|
|
||||||
|
row = mProxyModel->mapToSource (mProxyModel->index (row, 0)).row();
|
||||||
|
|
||||||
|
CSMWorld::UniversalId id = mModel->view (row).first;
|
||||||
|
|
||||||
|
if (!mData.getCells().getRecord (id.getId()).isDeleted())
|
||||||
|
menu.addAction (mViewAction);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCreateAction)
|
if (mCreateAction)
|
||||||
|
@ -168,7 +177,7 @@ std::vector<std::string> CSVWorld::Table::listDeletableSelectedIds() const
|
||||||
|
|
||||||
CSVWorld::Table::Table (const CSMWorld::UniversalId& id, CSMWorld::Data& data, QUndoStack& undoStack,
|
CSVWorld::Table::Table (const CSMWorld::UniversalId& id, CSMWorld::Data& data, QUndoStack& undoStack,
|
||||||
bool createAndDelete, bool sorting, const CSMDoc::Document& document)
|
bool createAndDelete, bool sorting, const CSMDoc::Document& document)
|
||||||
: mUndoStack (undoStack), mCreateAction (0), mCloneAction(0), mEditLock (false), mRecordStatusDisplay (0), mDocument(document)
|
: mUndoStack (undoStack), mCreateAction (0), mCloneAction(0), mEditLock (false), mRecordStatusDisplay (0), mDocument(document), mData (data)
|
||||||
{
|
{
|
||||||
mModel = &dynamic_cast<CSMWorld::IdTable&> (*data.getTableModel (id));
|
mModel = &dynamic_cast<CSMWorld::IdTable&> (*data.getTableModel (id));
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ namespace CSVWorld
|
||||||
CSMWorld::IdTable *mModel;
|
CSMWorld::IdTable *mModel;
|
||||||
bool mEditLock;
|
bool mEditLock;
|
||||||
int mRecordStatusDisplay;
|
int mRecordStatusDisplay;
|
||||||
|
CSMWorld::Data& mData;
|
||||||
|
|
||||||
/// \brief This variable is used exclusivly for checking if dropEvents came from the same document. Most likely you
|
/// \brief This variable is used exclusivly for checking if dropEvents came from the same document. Most likely you
|
||||||
/// should NOT use it for anything else.
|
/// should NOT use it for anything else.
|
||||||
|
|
Loading…
Reference in a new issue