Require protocol version 5 to send rescan devices packet and to show rescan button in clients list
This commit is contained in:
parent
c750158286
commit
5aaadf4e5a
2 changed files with 20 additions and 13 deletions
|
|
@ -764,13 +764,16 @@ void NetworkClient::SendRequest_ProtocolVersion()
|
||||||
|
|
||||||
void NetworkClient::SendRequest_RescanDevices()
|
void NetworkClient::SendRequest_RescanDevices()
|
||||||
{
|
{
|
||||||
NetPacketHeader request_hdr;
|
if(GetProtocolVersion() >= 5)
|
||||||
|
{
|
||||||
|
NetPacketHeader request_hdr;
|
||||||
|
|
||||||
InitNetPacketHeader(&request_hdr, 0, NET_PACKET_ID_REQUEST_RESCAN_DEVICES, 0);
|
InitNetPacketHeader(&request_hdr, 0, NET_PACKET_ID_REQUEST_RESCAN_DEVICES, 0);
|
||||||
|
|
||||||
send_in_progress.lock();
|
send_in_progress.lock();
|
||||||
send(client_sock, (char *)&request_hdr, sizeof(NetPacketHeader), MSG_NOSIGNAL);
|
send(client_sock, (char *)&request_hdr, sizeof(NetPacketHeader), MSG_NOSIGNAL);
|
||||||
send_in_progress.unlock();
|
send_in_progress.unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkClient::SendRequest_RGBController_ClearSegments(unsigned int dev_idx, int zone)
|
void NetworkClient::SendRequest_RGBController_ClearSegments(unsigned int dev_idx, int zone)
|
||||||
|
|
|
||||||
|
|
@ -173,18 +173,22 @@ void OpenRGBClientInfoPage::UpdateInfo()
|
||||||
signalMapperSave->setMapping(checkbox_save, arg_save);
|
signalMapperSave->setMapping(checkbox_save, arg_save);
|
||||||
|
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Create the rescan button |
|
| Create the rescan button if protocol version is 5 or |
|
||||||
|
| greater |
|
||||||
\*-----------------------------------------------------*/
|
\*-----------------------------------------------------*/
|
||||||
QPushButton* button_rescan = new QPushButton(tr("Rescan Devices"));
|
if(ResourceManager::get()->GetClients()[client_idx]->GetProtocolVersion() >= 5)
|
||||||
ui->ClientTree->setItemWidget(new_top_item, 3, button_rescan);
|
{
|
||||||
|
QPushButton* button_rescan = new QPushButton(tr("Rescan Devices"));
|
||||||
|
ui->ClientTree->setItemWidget(new_top_item, 3, button_rescan);
|
||||||
|
|
||||||
connect(button_rescan, SIGNAL(clicked()), signalMapperRescan, SLOT(map()));
|
connect(button_rescan, SIGNAL(clicked()), signalMapperRescan, SLOT(map()));
|
||||||
|
|
||||||
NetworkClientPointer * arg_rescan = new NetworkClientPointer();
|
NetworkClientPointer * arg_rescan = new NetworkClientPointer();
|
||||||
arg_rescan->net_client = ResourceManager::get()->GetClients()[client_idx];
|
arg_rescan->net_client = ResourceManager::get()->GetClients()[client_idx];
|
||||||
arg_rescan->widget = button_rescan;
|
arg_rescan->widget = button_rescan;
|
||||||
|
|
||||||
signalMapperRescan->setMapping(button_rescan, arg_rescan);
|
signalMapperRescan->setMapping(button_rescan, arg_rescan);
|
||||||
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Create the disconnect button |
|
| Create the disconnect button |
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue