diff --git a/src/gui/assets/localization/localization_data.h b/src/gui/assets/localization/localization_data.h index de88b94..f25c529 100644 --- a/src/gui/assets/localization/localization_data.h +++ b/src/gui/assets/localization/localization_data.h @@ -167,6 +167,8 @@ struct TranslationRow { u8"P2P отключено") \ X(p2p_connecting, u8"正在建立对等连接...", "P2P Connecting ...", \ u8"Подключение P2P...") \ + X(p2p_gathering, u8"正在收集候选地址...", "Gathering candidates ...", \ + u8"Сбор кандидатов...") \ X(receiving_screen, u8"画面接收中...", "Receiving screen...", \ u8"Получение изображения...") \ X(p2p_failed, u8"对等连接失败", "P2P Failed", u8"Сбой P2P") \ diff --git a/src/gui/windows/connection_status_window.cpp b/src/gui/windows/connection_status_window.cpp index bc42719..9edc442 100644 --- a/src/gui/windows/connection_status_window.cpp +++ b/src/gui/windows/connection_status_window.cpp @@ -48,6 +48,22 @@ bool Render::ConnectionStatusWindow( } ret_flag = true; } + } else if (ConnectionStatus::Gathering == props->connection_status_) { + text = localization::p2p_gathering[localization_language_index_]; + ImGui::SetCursorPosX(connection_status_window_width * 0.43f); + ImGui::SetCursorPosY(connection_status_window_height * 0.67f); + // cancel + if (ImGui::Button( + localization::cancel[localization_language_index_].c_str()) || + ImGui::IsKeyPressed(ImGuiKey_Escape)) { + show_connection_status_window_ = false; + re_enter_remote_id_ = true; + LOG_INFO("User cancelled connecting to [{}]", props->remote_id_); + if (props->peer_) { + LeaveConnection(props->peer_, props->remote_id_.c_str()); + } + ret_flag = true; + } } else if (ConnectionStatus::Connected == props->connection_status_) { text = localization::p2p_connected[localization_language_index_]; ImGui::SetCursorPosX(connection_status_window_width * 0.43f);