1
0
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:
Marc Zinnschlag 2013-07-26 18:22:31 +02:00
parent d899cbb449
commit b8ac45defe
6 changed files with 20 additions and 2 deletions

View File

@ -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:

View File

@ -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);
} }

View File

@ -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();
}; };
} }

View File

@ -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;
} }

View File

@ -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();
}; };
} }

View File

@ -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)