mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-18 13:12:50 +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
|
||||
#define CSV_WORLD_CREATOR_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace CSVWorld
|
||||
{
|
||||
/// \brief Record creator UI base class
|
||||
class Creator
|
||||
class Creator : public QWidget
|
||||
{
|
||||
public:
|
||||
|
||||
|
@ -148,7 +148,7 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id, CSMWorld::Data& data, Q
|
||||
if (createAndDelete)
|
||||
{
|
||||
mCreateAction = new QAction (tr ("Add Record"), this);
|
||||
connect (mCreateAction, SIGNAL (triggered()), this, SLOT (createRecord()));
|
||||
connect (mCreateAction, SIGNAL (triggered()), this, SIGNAL (createRequest()));
|
||||
addAction (mCreateAction);
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,8 @@ namespace CSVWorld
|
||||
/// \param deleted Number of deleted records
|
||||
/// \param modified Number of added and modified records
|
||||
|
||||
void createRequest();
|
||||
|
||||
private slots:
|
||||
|
||||
void createRecord();
|
||||
@ -82,6 +84,7 @@ namespace CSVWorld
|
||||
void tableSizeUpdate();
|
||||
|
||||
void selectionSizeUpdate();
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -60,6 +60,8 @@ CSVWorld::TableBottomBox::TableBottomBox (const CreatorFactoryBase& creatorFacto
|
||||
setLayout (layout);
|
||||
|
||||
mCreator = creatorFactory.makeCreator();
|
||||
|
||||
layout->addWidget (mCreator);
|
||||
}
|
||||
|
||||
CSVWorld::TableBottomBox::~TableBottomBox()
|
||||
@ -118,4 +120,10 @@ void CSVWorld::TableBottomBox::tableSizeChanged (int size, int deleted, int modi
|
||||
|
||||
if (changed)
|
||||
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 deleted Number of deleted 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->selectionSizeUpdate();
|
||||
|
||||
if (mBottom->canCreateAndDelete())
|
||||
connect (mTable, SIGNAL (createRequest()), mBottom, SLOT (createRequest()));
|
||||
}
|
||||
|
||||
void CSVWorld::TableSubView::setEditLock (bool locked)
|
||||
|
Loading…
x
Reference in New Issue
Block a user