mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:53:50 +00:00
moved editlock to the dragrecordtable
This commit is contained in:
parent
d376efe30b
commit
eeb18b533e
6 changed files with 14 additions and 14 deletions
|
@ -18,5 +18,11 @@ void CSVWorld::DragRecordTable::startDrag (const CSVWorld::DragRecordTable& tabl
|
||||||
|
|
||||||
CSVWorld::DragRecordTable::DragRecordTable (CSMDoc::Document& document, QWidget* parent) :
|
CSVWorld::DragRecordTable::DragRecordTable (CSMDoc::Document& document, QWidget* parent) :
|
||||||
mDocument(document),
|
mDocument(document),
|
||||||
QTableView(parent)
|
QTableView(parent),
|
||||||
|
mEditLock(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
void CSVWorld::DragRecordTable::setEditLock (bool locked)
|
||||||
|
{
|
||||||
|
mEditLock = locked;
|
||||||
|
}
|
||||||
|
|
|
@ -22,12 +22,15 @@ namespace CSVWorld
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
CSMDoc::Document& mDocument;
|
CSMDoc::Document& mDocument;
|
||||||
|
bool mEditLock;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DragRecordTable(CSMDoc::Document& document, QWidget* parent = NULL);
|
DragRecordTable(CSMDoc::Document& document, QWidget* parent = NULL);
|
||||||
|
|
||||||
virtual std::vector<CSMWorld::UniversalId> getDragedRecords() const = 0;
|
virtual std::vector<CSMWorld::UniversalId> getDragedRecords() const = 0;
|
||||||
|
|
||||||
|
virtual void setEditLock(bool locked);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void startDrag(const DragRecordTable& table);
|
void startDrag(const DragRecordTable& table);
|
||||||
};
|
};
|
||||||
|
|
|
@ -181,7 +181,7 @@ void CSVWorld::RegionMap::setRegion (const std::string& regionId)
|
||||||
|
|
||||||
CSVWorld::RegionMap::RegionMap (const CSMWorld::UniversalId& universalId,
|
CSVWorld::RegionMap::RegionMap (const CSMWorld::UniversalId& universalId,
|
||||||
CSMDoc::Document& document, QWidget *parent)
|
CSMDoc::Document& document, QWidget *parent)
|
||||||
: mEditLock (false), DragRecordTable(document, parent)
|
: DragRecordTable(document, parent)
|
||||||
{
|
{
|
||||||
verticalHeader()->hide();
|
verticalHeader()->hide();
|
||||||
horizontalHeader()->hide();
|
horizontalHeader()->hide();
|
||||||
|
@ -226,11 +226,6 @@ CSVWorld::RegionMap::RegionMap (const CSMWorld::UniversalId& universalId,
|
||||||
addAction (mViewInTableAction);
|
addAction (mViewInTableAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVWorld::RegionMap::setEditLock (bool locked)
|
|
||||||
{
|
|
||||||
mEditLock = locked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CSVWorld::RegionMap::selectAll()
|
void CSVWorld::RegionMap::selectAll()
|
||||||
{
|
{
|
||||||
QModelIndexList unselected = getUnselectedCells();
|
QModelIndexList unselected = getUnselectedCells();
|
||||||
|
|
|
@ -35,7 +35,6 @@ namespace CSVWorld
|
||||||
QAction *mUnsetRegionAction;
|
QAction *mUnsetRegionAction;
|
||||||
QAction *mViewAction;
|
QAction *mViewAction;
|
||||||
QAction *mViewInTableAction;
|
QAction *mViewInTableAction;
|
||||||
bool mEditLock;
|
|
||||||
std::string mRegionId;
|
std::string mRegionId;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -62,8 +61,6 @@ namespace CSVWorld
|
||||||
RegionMap (const CSMWorld::UniversalId& universalId, CSMDoc::Document& document,
|
RegionMap (const CSMWorld::UniversalId& universalId, CSMDoc::Document& document,
|
||||||
QWidget *parent = 0);
|
QWidget *parent = 0);
|
||||||
|
|
||||||
void setEditLock (bool locked);
|
|
||||||
|
|
||||||
virtual std::vector<CSMWorld::UniversalId> getDragedRecords() const;
|
virtual std::vector<CSMWorld::UniversalId> getDragedRecords() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
|
@ -188,7 +188,7 @@ std::vector<std::string> CSVWorld::Table::listDeletableSelectedIds() const
|
||||||
|
|
||||||
CSVWorld::Table::Table (const CSMWorld::UniversalId& id,
|
CSVWorld::Table::Table (const CSMWorld::UniversalId& id,
|
||||||
bool createAndDelete, bool sorting, CSMDoc::Document& document)
|
bool createAndDelete, bool sorting, CSMDoc::Document& document)
|
||||||
: mCreateAction (0), mCloneAction(0), mEditLock (false), mRecordStatusDisplay (0),
|
: mCreateAction (0), mCloneAction(0), mRecordStatusDisplay (0),
|
||||||
DragRecordTable(document)
|
DragRecordTable(document)
|
||||||
{
|
{
|
||||||
mModel = &dynamic_cast<CSMWorld::IdTable&> (*mDocument.getData().getTableModel (id));
|
mModel = &dynamic_cast<CSMWorld::IdTable&> (*mDocument.getData().getTableModel (id));
|
||||||
|
@ -282,7 +282,7 @@ void CSVWorld::Table::setEditLock (bool locked)
|
||||||
for (std::vector<CommandDelegate *>::iterator iter (mDelegates.begin()); iter!=mDelegates.end(); ++iter)
|
for (std::vector<CommandDelegate *>::iterator iter (mDelegates.begin()); iter!=mDelegates.end(); ++iter)
|
||||||
(*iter)->setEditLock (locked);
|
(*iter)->setEditLock (locked);
|
||||||
|
|
||||||
mEditLock = locked;
|
DragRecordTable::setEditLock(locked);
|
||||||
}
|
}
|
||||||
|
|
||||||
CSMWorld::UniversalId CSVWorld::Table::getUniversalId (int row) const
|
CSMWorld::UniversalId CSVWorld::Table::getUniversalId (int row) const
|
||||||
|
|
|
@ -47,7 +47,6 @@ namespace CSVWorld
|
||||||
QAction *mPreviewAction;
|
QAction *mPreviewAction;
|
||||||
CSMWorld::IdTableProxyModel *mProxyModel;
|
CSMWorld::IdTableProxyModel *mProxyModel;
|
||||||
CSMWorld::IdTable *mModel;
|
CSMWorld::IdTable *mModel;
|
||||||
bool mEditLock;
|
|
||||||
int mRecordStatusDisplay;
|
int mRecordStatusDisplay;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -73,7 +72,7 @@ namespace CSVWorld
|
||||||
///< \param createAndDelete Allow creation and deletion of records.
|
///< \param createAndDelete Allow creation and deletion of records.
|
||||||
/// \param sorting Allow changing order of rows in the view via column headers.
|
/// \param sorting Allow changing order of rows in the view via column headers.
|
||||||
|
|
||||||
void setEditLock (bool locked);
|
virtual void setEditLock (bool locked);
|
||||||
|
|
||||||
CSMWorld::UniversalId getUniversalId (int row) const;
|
CSMWorld::UniversalId getUniversalId (int row) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue