MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / UpdateInfo

Method UpdateInfo

qt/OpenRGBServerInfoPage/OpenRGBServerInfoPage.cpp:39–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39void OpenRGBServerInfoPage::UpdateInfo()
40{
41 ui->ServerHostValue->setText(network_server->GetHost().c_str());
42 ui->ServerPortValue->setText(std::to_string(network_server->GetPort()).c_str());
43
44 if(network_server->GetListening() && !network_server->GetOnline())
45 {
46 ui->ServerStatusValue->setText(tr("Stopping..."));
47 ui->ServerStartButton->setEnabled(false);
48 ui->ServerStopButton->setEnabled(false);
49 ui->ServerHostValue->setEnabled(false);
50 ui->ServerPortValue->setEnabled(false);
51 }
52 else if(network_server->GetListening())
53 {
54 ui->ServerStatusValue->setText(tr("Online"));
55 ui->ServerStartButton->setEnabled(false);
56 ui->ServerStopButton->setEnabled(true);
57 ui->ServerHostValue->setEnabled(false);
58 ui->ServerPortValue->setEnabled(false);
59 }
60 else
61 {
62 ui->ServerStatusValue->setText(tr("Offline"));
63 ui->ServerStartButton->setEnabled(true);
64 ui->ServerStopButton->setEnabled(false);
65 ui->ServerHostValue->setEnabled(true);
66 ui->ServerPortValue->setEnabled(true);
67 }
68
69 ui->ServerClientTree->clear();
70 for(unsigned int client_idx = 0; client_idx < network_server->GetNumClients(); client_idx++)
71 {
72 QTreeWidgetItem * new_item = new QTreeWidgetItem();
73
74 new_item->setText(0, network_server->GetClientIP(client_idx));
75 new_item->setText(1, QString::number(network_server->GetClientProtocolVersion(client_idx)));
76 new_item->setText(2, network_server->GetClientString(client_idx));
77
78 ui->ServerClientTree->addTopLevelItem(new_item);
79 }
80}
81
82void Ui::OpenRGBServerInfoPage::on_ServerStartButton_clicked()
83{

Callers

nothing calls this directly

Calls 10

to_stringFunction · 0.85
GetHostMethod · 0.80
GetListeningMethod · 0.80
GetNumClientsMethod · 0.80
GetClientIPMethod · 0.80
GetClientStringMethod · 0.80
GetPortMethod · 0.45
GetOnlineMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected