moved notifyChatStatus to rsEvents

This commit is contained in:
csoler 2025-08-17 17:34:46 +02:00
parent e6bd8335dc
commit 798775e12b
11 changed files with 101 additions and 58 deletions

View file

@ -28,6 +28,7 @@
#include <algorithm>
#include "gui/elastic/elnode.h"
#include "util/qtthreadsutils.h"
/********
* #define DEBUG_NETWORKVIEW
@ -60,12 +61,32 @@ NetworkView::NetworkView(QWidget *parent)
connect( ui.nameBox, SIGNAL(textChanged(QString)), this, SLOT(setNameSearch(QString)));
_should_update = true ;
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> event)
{
RsQThreadUtils::postToObject([=](){
auto ev = dynamic_cast<const RsGossipDiscoveryEvent *>(event.get());
if(!ev) return;
switch(ev->mGossipDiscoveryEventType)
{
case RsGossipDiscoveryEventType::DISCOVERY_INFO_RECEIVED: update();
[[fallthrough]];
default:
break;
}
}, this );
}, mEventHandlerId, RsEventType::GOSSIP_DISCOVERY );
}
NetworkView::~NetworkView()
{
if(mScene != NULL)
delete mScene ;
rsEvents->unregisterEventsHandler(mEventHandlerId);
if(mScene != NULL)
delete mScene ;
}
void NetworkView::setEdgeLength(int l)