Client clears list and reinitializes controller when the device list updates

This commit is contained in:
Adam Honse 2020-09-28 01:29:35 +00:00
parent 60fd721586
commit 8347644b07
3 changed files with 49 additions and 4 deletions

View file

@ -28,6 +28,14 @@ OpenRGBClientInfoPage::OpenRGBClientInfoPage(std::vector<RGBController *>& contr
ui->ClientIPValue->setText("127.0.0.1");
ui->ClientPortValue->setText(QString::number(OPENRGB_SDK_PORT));
/*-----------------------------------------------------*\
| Register callbacks for existing clients |
\*-----------------------------------------------------*/
for(unsigned int client_idx = 0; client_idx < ResourceManager::get()->GetClients().size(); client_idx++)
{
ResourceManager::get()->GetClients()[client_idx]->RegisterClientInfoChangeCallback(UpdateInfoCallback, this);
}
/*-----------------------------------------------------*\
| Update the information view |
\*-----------------------------------------------------*/