| 1219 | } |
| 1220 | |
| 1221 | void BaseWorkspace::ProcessNetworkMessage(const std::shared_ptr<tc::Message>& msg) { |
| 1222 | if (msg->type() == MessageType::kDisconnectConnection) { |
| 1223 | const auto& sub = msg->disconnect_connection(); |
| 1224 | LOGI("DISCONNECT, device id: {}, stream id: {}", sub.device_id(), sub.stream_id()); |
| 1225 | remote_force_closed_ = true; |
| 1226 | context_->PostUITask([=, this]() { |
| 1227 | TcDialog dialog(tcTr("id_warning"), tcTr("id_remote_disconnected"), this); |
| 1228 | dialog.exec(); |
| 1229 | Exit(); |
| 1230 | }); |
| 1231 | context_->SendAppMessage(MsgStopTheWorld{}); |
| 1232 | ExitSdk(); |
| 1233 | } |
| 1234 | else if (msg->type() == MessageType::kHardwareInfo) { |
| 1235 | context_->PostTask([=, this]() { |
| 1236 | const auto& hw_info = msg->hw_info().hw_info(); |
| 1237 | const auto freq = msg->hw_info().current_cpu_freq(); |
| 1238 | auto sys_info = HWInfoParser::ParseHWInfo(msg->hw_info().hw_info(), freq); |
| 1239 | if (!sys_info) { |
| 1240 | return; |
| 1241 | } |
| 1242 | context_->SendAppMessage(MsgHWInfo { |
| 1243 | .info_ = sys_info, |
| 1244 | }); |
| 1245 | //LOGI("SysInfo: {}", to_string(*sys_info.get())); |
| 1246 | }); |
| 1247 | } |
| 1248 | } |
| 1249 | |
| 1250 | bool BaseWorkspace::nativeEvent(const QByteArray& eventType, void* message, qintptr* result) { |
| 1251 | #ifdef WIN32 |
no test coverage detected