basic filter table

pull/51/head
Marc Zinnschlag 12 years ago
parent 6f90e071f4
commit 7600d6c04b

@ -106,6 +106,10 @@ opencs_units_noqt (model/settings
settingsitem
)
opencs_hdrs_noqt (model/filter
filter
)
set (OPENCS_US
)

@ -0,0 +1,26 @@
#ifndef CSM_FILTER_FILTER_H
#define CSM_FILTER_FILTER_H
#include <vector>
#include <string>
#include <components/esm/filter.hpp>
namespace CSMFilter
{
/// \brief Wrapper for Filter record
struct Filter : public ESM::Filter
{
enum scope
{
Global = 0,
Local = 1,
Session = 2,
Content = 3
};
scope mScope;
};
}
#endif

@ -147,6 +147,9 @@ CSMWorld::Data::Data() : mRefs (mCells)
mRefs.addColumn (new KeyColumn<CellRef>);
mRefs.addColumn (new TrapColumn<CellRef>);
mFilters.addColumn (new StringIdColumn<CSMFilter::Filter>);
mFilters.addColumn (new RecordStateColumn<CSMFilter::Filter>);
addModel (new IdTable (&mGlobals), UniversalId::Type_Globals, UniversalId::Type_Global);
addModel (new IdTable (&mGmsts), UniversalId::Type_Gmsts, UniversalId::Type_Gmst);
addModel (new IdTable (&mSkills), UniversalId::Type_Skills, UniversalId::Type_Skill);
@ -162,6 +165,7 @@ CSMWorld::Data::Data() : mRefs (mCells)
addModel (new IdTable (&mReferenceables), UniversalId::Type_Referenceables,
UniversalId::Type_Referenceable);
addModel (new IdTable (&mRefs), UniversalId::Type_References, UniversalId::Type_Reference);
addModel (new IdTable (&mFilters), UniversalId::Type_Filters, UniversalId::Type_Filter);
}
CSMWorld::Data::~Data()

@ -18,6 +18,8 @@
#include <components/esm/loadbsgn.hpp>
#include <components/esm/loadspel.hpp>
#include "../filter/filter.hpp"
#include "idcollection.hpp"
#include "universalid.hpp"
#include "cell.hpp"
@ -44,6 +46,7 @@ namespace CSMWorld
IdCollection<Cell> mCells;
RefIdCollection mReferenceables;
RefCollection mRefs;
IdCollection<CSMFilter::Filter> mFilters;
std::vector<QAbstractItemModel *> mModels;
std::map<UniversalId::Type, QAbstractItemModel *> mModelIndex;

@ -35,6 +35,7 @@ namespace
"References" },
{ CSMWorld::UniversalId::Class_NonRecord, CSMWorld::UniversalId::Type_RegionMap,
"Region Map" },
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_Filters, "Filters" },
{ CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0 } // end marker
};
@ -78,6 +79,7 @@ namespace
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Static, "Static" },
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Weapon, "Weapon" },
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Reference, "Reference" },
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Filter, "Reference" },
{ CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0 } // end marker
};

@ -82,7 +82,9 @@ namespace CSMWorld
Type_Weapon,
Type_References,
Type_Reference,
Type_RegionMap
Type_RegionMap,
Type_Filter,
Type_Filters
};
private:

@ -78,6 +78,10 @@ void CSVDoc::View::setupViewMenu()
QAction *newWindow = new QAction (tr ("&New View"), this);
connect (newWindow, SIGNAL (triggered()), this, SLOT (newView()));
view->addAction (newWindow);
QAction *filters = new QAction (tr ("Filters"), this);
connect (filters, SIGNAL (triggered()), this, SLOT (addFiltersSubView()));
view->addAction (filters);
}
void CSVDoc::View::setupWorldMenu()
@ -382,6 +386,11 @@ void CSVDoc::View::addRegionMapSubView()
addSubView (CSMWorld::UniversalId::Type_RegionMap);
}
void CSVDoc::View::addFiltersSubView()
{
addSubView (CSMWorld::UniversalId::Type_Filters);
}
void CSVDoc::View::abortOperation (int type)
{
mDocument->abortOperation (type);

@ -157,6 +157,8 @@ namespace CSVDoc
void addRegionMapSubView();
void addFiltersSubView();
void showUserSettings();
};
}

@ -30,6 +30,7 @@ void CSVWorld::addSubViewFactories (CSVDoc::SubViewFactoryManager& manager)
CSMWorld::UniversalId::Type_Cells,
CSMWorld::UniversalId::Type_Referenceables,
CSMWorld::UniversalId::Type_References,
CSMWorld::UniversalId::Type_Filters,
CSMWorld::UniversalId::Type_None // end marker
};

Loading…
Cancel
Save