Merge remote-tracking branch 'sirherrbatka/less-signals'

actorid
Marc Zinnschlag 11 years ago
commit 65161c3e24

@ -193,11 +193,4 @@ std::string CSVFilter::EditWidget::generateFilter (std::pair< std::string, std::
} }
return ss.str(); return ss.str();
} }
void CSVFilter::EditWidget::useFilterRequest (const std::string& idOfFilter)
{
clear();
insert(QString::fromUtf8(idOfFilter.c_str()));
}

@ -30,6 +30,9 @@ namespace CSVFilter
EditWidget (CSMWorld::Data& data, QWidget *parent = 0); EditWidget (CSMWorld::Data& data, QWidget *parent = 0);
void createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >& filterSource,
Qt::DropAction action);
signals: signals:
void filterChanged (boost::shared_ptr<CSMFilter::Node> filter); void filterChanged (boost::shared_ptr<CSMFilter::Node> filter);
@ -47,10 +50,7 @@ namespace CSVFilter
void filterRowsInserted (const QModelIndex& parent, int start, int end); void filterRowsInserted (const QModelIndex& parent, int start, int end);
void createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >& filterSource,
Qt::DropAction action);
void useFilterRequest(const std::string& idOfFilter);
}; };
} }

@ -25,10 +25,6 @@ CSVFilter::FilterBox::FilterBox (CSMWorld::Data& data, QWidget *parent)
SIGNAL (filterChanged (boost::shared_ptr<CSMFilter::Node>)), SIGNAL (filterChanged (boost::shared_ptr<CSMFilter::Node>)),
this, SIGNAL (recordFilterChanged (boost::shared_ptr<CSMFilter::Node>))); this, SIGNAL (recordFilterChanged (boost::shared_ptr<CSMFilter::Node>)));
connect(this, SIGNAL(createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >&, Qt::DropAction)),
mRecordFilterBox, SIGNAL(createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >&, Qt::DropAction)));
connect(this, SIGNAL(useFilterRequest(const std::string&)), mRecordFilterBox, SIGNAL(useFilterRequest(const std::string&)));
setAcceptDrops(true); setAcceptDrops(true);
} }
@ -53,3 +49,9 @@ void CSVFilter::FilterBox::dragMoveEvent (QDragMoveEvent* event)
{ {
event->accept(); event->accept();
} }
void CSVFilter::FilterBox::createFilterRequest (std::vector< std::pair< std::string, std::vector< std::string > > >& filterSource,
Qt::DropAction action)
{
mRecordFilterBox->createFilterRequest(filterSource, action);
}

@ -24,25 +24,25 @@ namespace CSVFilter
RecordFilterBox *mRecordFilterBox; RecordFilterBox *mRecordFilterBox;
void dragEnterEvent (QDragEnterEvent* event); public:
FilterBox (CSMWorld::Data& data, QWidget *parent = 0);
void dropEvent (QDropEvent* event); void setRecordFilter (const std::string& filter);
void dragMoveEvent(QDragMoveEvent *event); void createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >& filterSource,
Qt::DropAction action);
public:
FilterBox (CSMWorld::Data& data, QWidget *parent = 0); private:
void dragEnterEvent (QDragEnterEvent* event);
void setRecordFilter (const std::string& filter); void dropEvent (QDropEvent* event);
signals: void dragMoveEvent(QDragMoveEvent *event);
signals:
void recordFilterChanged (boost::shared_ptr<CSMFilter::Node> filter); void recordFilterChanged (boost::shared_ptr<CSMFilter::Node> filter);
void recordDropped (std::vector<CSMWorld::UniversalId>& types, Qt::DropAction action); void recordDropped (std::vector<CSMWorld::UniversalId>& types, Qt::DropAction action);
void createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >& filterSource,
Qt::DropAction action);
void useFilterRequest(const std::string& idOfFilter);
}; };
} }

@ -24,14 +24,16 @@ CSVFilter::RecordFilterBox::RecordFilterBox (CSMWorld::Data& data, QWidget *pare
connect ( connect (
mEdit, SIGNAL (filterChanged (boost::shared_ptr<CSMFilter::Node>)), mEdit, SIGNAL (filterChanged (boost::shared_ptr<CSMFilter::Node>)),
this, SIGNAL (filterChanged (boost::shared_ptr<CSMFilter::Node>))); this, SIGNAL (filterChanged (boost::shared_ptr<CSMFilter::Node>)));
connect(this, SIGNAL(createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >&, Qt::DropAction)),
mEdit, SLOT(createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >&, Qt::DropAction)));
connect(this, SIGNAL(useFilterRequest(const std::string&)), mEdit, SLOT(useFilterRequest(const std::string&)));
} }
void CSVFilter::RecordFilterBox::setFilter (const std::string& filter) void CSVFilter::RecordFilterBox::setFilter (const std::string& filter)
{ {
mEdit->clear();
mEdit->setText (QString::fromUtf8 (filter.c_str())); mEdit->setText (QString::fromUtf8 (filter.c_str()));
} }
void CSVFilter::RecordFilterBox::createFilterRequest (std::vector< std::pair< std::string, std::vector< std::string > > >& filterSource,
Qt::DropAction action)
{
mEdit->createFilterRequest(filterSource, action);
}

@ -31,12 +31,14 @@ namespace CSVFilter
void setFilter (const std::string& filter); void setFilter (const std::string& filter);
signals: void useFilterRequest(const std::string& idOfFilter);
void filterChanged (boost::shared_ptr<CSMFilter::Node> filter);
void createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >& filterSource, void createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >& filterSource,
Qt::DropAction action); Qt::DropAction action);
void useFilterRequest(const std::string& idOfFilter);
signals:
void filterChanged (boost::shared_ptr<CSMFilter::Node> filter);
}; };
} }

@ -69,11 +69,6 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D
connect(mFilterBox, SIGNAL(recordDropped(std::vector<CSMWorld::UniversalId>&, Qt::DropAction)), connect(mFilterBox, SIGNAL(recordDropped(std::vector<CSMWorld::UniversalId>&, Qt::DropAction)),
this, SLOT(createFilterRequest(std::vector<CSMWorld::UniversalId>&, Qt::DropAction))); this, SLOT(createFilterRequest(std::vector<CSMWorld::UniversalId>&, Qt::DropAction)));
connect(this, SIGNAL(useFilterRequest(const std::string&)), mFilterBox, SIGNAL(useFilterRequest(const std::string&)));
connect(this, SIGNAL(createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >&, Qt::DropAction)),
mFilterBox, SIGNAL(createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >&, Qt::DropAction)));
} }
void CSVWorld::TableSubView::setEditLock (bool locked) void CSVWorld::TableSubView::setEditLock (bool locked)
@ -122,7 +117,7 @@ void CSVWorld::TableSubView::createFilterRequest (std::vector< CSMWorld::Univers
filterSource.push_back(pair); filterSource.push_back(pair);
} }
emit createFilterRequest(filterSource, action); mFilterBox->createFilterRequest(filterSource, action);
} }
bool CSVWorld::TableSubView::eventFilter (QObject* object, QEvent* event) bool CSVWorld::TableSubView::eventFilter (QObject* object, QEvent* event)
@ -134,7 +129,7 @@ bool CSVWorld::TableSubView::eventFilter (QObject* object, QEvent* event)
bool handled = data->holdsType(CSMWorld::UniversalId::Type_Filter); bool handled = data->holdsType(CSMWorld::UniversalId::Type_Filter);
if (handled) if (handled)
{ {
emit useFilterRequest(data->returnMatching(CSMWorld::UniversalId::Type_Filter).getId()); mFilterBox->setRecordFilter(data->returnMatching(CSMWorld::UniversalId::Type_Filter).getId());
} }
return handled; return handled;
} }

@ -55,9 +55,6 @@ namespace CSVWorld
signals: signals:
void cloneRequest(const std::string&, void cloneRequest(const std::string&,
const CSMWorld::UniversalId::Type); const CSMWorld::UniversalId::Type);
void createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >& filterSource,
Qt::DropAction action);
void useFilterRequest(const std::string& idOfFilter);
private slots: private slots:

Loading…
Cancel
Save