mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 14:32:15 -07:00
Signal view removal, addition.
Took 5 minutes
This commit is contained in:
parent
aaf3c1e3b2
commit
d4a5bb3a79
4 changed files with 19 additions and 5 deletions
|
|
@ -149,11 +149,11 @@ void ZoneViewZoneLogic::removeCard(int position, bool toNewZone)
|
||||||
|
|
||||||
void ZoneViewZoneLogic::setWriteableRevealZone(bool _writeableRevealZone)
|
void ZoneViewZoneLogic::setWriteableRevealZone(bool _writeableRevealZone)
|
||||||
{
|
{
|
||||||
// TODO: Deal with this
|
|
||||||
/*if (writeableRevealZone && !_writeableRevealZone) {
|
if (writeableRevealZone && !_writeableRevealZone) {
|
||||||
origZone->getViews().append(this);
|
emit addToViews();
|
||||||
} else if (!writeableRevealZone && _writeableRevealZone) {
|
} else if (!writeableRevealZone && _writeableRevealZone) {
|
||||||
origZone->getViews().removeOne(this);
|
emit removeFromViews();
|
||||||
}*/
|
}
|
||||||
writeableRevealZone = _writeableRevealZone;
|
writeableRevealZone = _writeableRevealZone;
|
||||||
}
|
}
|
||||||
|
|
@ -6,6 +6,8 @@ class ZoneViewZoneLogic : public CardZoneLogic
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
signals:
|
signals:
|
||||||
|
void addToViews();
|
||||||
|
void removeFromViews();
|
||||||
void closeView();
|
void closeView();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,16 @@ ZoneViewZone::ZoneViewZone(ZoneViewZoneLogic *_logic, QGraphicsItem *parent)
|
||||||
connect(_logic, &ZoneViewZoneLogic::closeView, this, &ZoneViewZone::close);
|
connect(_logic, &ZoneViewZoneLogic::closeView, this, &ZoneViewZone::close);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ZoneViewZone::addToViews()
|
||||||
|
{
|
||||||
|
qobject_cast<ZoneViewZoneLogic *>(getLogic())->getOriginalZone()->getViews().append(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ZoneViewZone::removeFromViews()
|
||||||
|
{
|
||||||
|
qobject_cast<ZoneViewZoneLogic *>(getLogic())->getOriginalZone()->getViews().removeOne(this);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes this ZoneView and removes it from the origZone's views.
|
* Deletes this ZoneView and removes it from the origZone's views.
|
||||||
* You should normally call this method instead of deleteLater()
|
* You should normally call this method instead of deleteLater()
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,8 @@ public:
|
||||||
return optimumRect;
|
return optimumRect;
|
||||||
}
|
}
|
||||||
public slots:
|
public slots:
|
||||||
|
void addToViews();
|
||||||
|
void removeFromViews();
|
||||||
void close();
|
void close();
|
||||||
void setFilterString(const QString &_filterString);
|
void setFilterString(const QString &_filterString);
|
||||||
void setGroupBy(CardList::SortOption _groupBy);
|
void setGroupBy(CardList::SortOption _groupBy);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue