mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
added creator to bottom box layout and re-routed add record event to bottom box
This commit is contained in:
parent
d899cbb449
commit
b8ac45defe
@ -1,10 +1,12 @@
|
|||||||
#ifndef CSV_WORLD_CREATOR_H
|
#ifndef CSV_WORLD_CREATOR_H
|
||||||
#define CSV_WORLD_CREATOR_H
|
#define CSV_WORLD_CREATOR_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
namespace CSVWorld
|
namespace CSVWorld
|
||||||
{
|
{
|
||||||
/// \brief Record creator UI base class
|
/// \brief Record creator UI base class
|
||||||
class Creator
|
class Creator : public QWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id, CSMWorld::Data& data, Q
|
|||||||
if (createAndDelete)
|
if (createAndDelete)
|
||||||
{
|
{
|
||||||
mCreateAction = new QAction (tr ("Add Record"), this);
|
mCreateAction = new QAction (tr ("Add Record"), this);
|
||||||
connect (mCreateAction, SIGNAL (triggered()), this, SLOT (createRecord()));
|
connect (mCreateAction, SIGNAL (triggered()), this, SIGNAL (createRequest()));
|
||||||
addAction (mCreateAction);
|
addAction (mCreateAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,6 +67,8 @@ namespace CSVWorld
|
|||||||
/// \param deleted Number of deleted records
|
/// \param deleted Number of deleted records
|
||||||
/// \param modified Number of added and modified records
|
/// \param modified Number of added and modified records
|
||||||
|
|
||||||
|
void createRequest();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void createRecord();
|
void createRecord();
|
||||||
@ -82,6 +84,7 @@ namespace CSVWorld
|
|||||||
void tableSizeUpdate();
|
void tableSizeUpdate();
|
||||||
|
|
||||||
void selectionSizeUpdate();
|
void selectionSizeUpdate();
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +60,8 @@ CSVWorld::TableBottomBox::TableBottomBox (const CreatorFactoryBase& creatorFacto
|
|||||||
setLayout (layout);
|
setLayout (layout);
|
||||||
|
|
||||||
mCreator = creatorFactory.makeCreator();
|
mCreator = creatorFactory.makeCreator();
|
||||||
|
|
||||||
|
layout->addWidget (mCreator);
|
||||||
}
|
}
|
||||||
|
|
||||||
CSVWorld::TableBottomBox::~TableBottomBox()
|
CSVWorld::TableBottomBox::~TableBottomBox()
|
||||||
@ -118,4 +120,10 @@ void CSVWorld::TableBottomBox::tableSizeChanged (int size, int deleted, int modi
|
|||||||
|
|
||||||
if (changed)
|
if (changed)
|
||||||
updateStatus();
|
updateStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
void CSVWorld::TableBottomBox::createRequest()
|
||||||
|
{
|
||||||
|
std::cout<<"create"<<std::endl;
|
||||||
}
|
}
|
@ -48,6 +48,8 @@ namespace CSVWorld
|
|||||||
///< \param size Number of not deleted records
|
///< \param size Number of not deleted records
|
||||||
/// \param deleted Number of deleted records
|
/// \param deleted Number of deleted records
|
||||||
/// \param modified Number of added and modified records
|
/// \param modified Number of added and modified records
|
||||||
|
|
||||||
|
void createRequest();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,6 +38,9 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D
|
|||||||
|
|
||||||
mTable->tableSizeUpdate();
|
mTable->tableSizeUpdate();
|
||||||
mTable->selectionSizeUpdate();
|
mTable->selectionSizeUpdate();
|
||||||
|
|
||||||
|
if (mBottom->canCreateAndDelete())
|
||||||
|
connect (mTable, SIGNAL (createRequest()), mBottom, SLOT (createRequest()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVWorld::TableSubView::setEditLock (bool locked)
|
void CSVWorld::TableSubView::setEditLock (bool locked)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user