mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
[feat] add self-hosted server config item in settings windows
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -95,6 +95,10 @@ static std::vector<std::string> enable_turn = {
|
|||||||
static std::vector<std::string> enable_srtp = {
|
static std::vector<std::string> enable_srtp = {
|
||||||
reinterpret_cast<const char*>(u8"启用SRTP:"), "Enable SRTP:"};
|
reinterpret_cast<const char*>(u8"启用SRTP:"), "Enable SRTP:"};
|
||||||
|
|
||||||
|
static std::vector<std::string> self_hosted_server_config = {
|
||||||
|
reinterpret_cast<const char*>(u8"自托管服务器配置"),
|
||||||
|
"Self-Hosted Server Config"};
|
||||||
|
|
||||||
static std::vector<std::string> ok = {reinterpret_cast<const char*>(u8"确认"),
|
static std::vector<std::string> ok = {reinterpret_cast<const char*>(u8"确认"),
|
||||||
"OK"};
|
"OK"};
|
||||||
static std::vector<std::string> cancel = {
|
static std::vector<std::string> cancel = {
|
||||||
|
|||||||
@@ -20,8 +20,8 @@
|
|||||||
#define INPUT_WINDOW_PADDING_EN 96
|
#define INPUT_WINDOW_PADDING_EN 96
|
||||||
#define SETTINGS_WINDOW_WIDTH_CN 182
|
#define SETTINGS_WINDOW_WIDTH_CN 182
|
||||||
#define SETTINGS_WINDOW_WIDTH_EN 248
|
#define SETTINGS_WINDOW_WIDTH_EN 248
|
||||||
#define SETTINGS_WINDOW_HEIGHT_CN 275
|
#define SETTINGS_WINDOW_HEIGHT_CN 300
|
||||||
#define SETTINGS_WINDOW_HEIGHT_EN 275
|
#define SETTINGS_WINDOW_HEIGHT_EN 300
|
||||||
#define LANGUAGE_SELECT_WINDOW_PADDING_CN 100
|
#define LANGUAGE_SELECT_WINDOW_PADDING_CN 100
|
||||||
#define LANGUAGE_SELECT_WINDOW_PADDING_EN 167
|
#define LANGUAGE_SELECT_WINDOW_PADDING_EN 167
|
||||||
#define VIDEO_QUALITY_SELECT_WINDOW_PADDING_CN 100
|
#define VIDEO_QUALITY_SELECT_WINDOW_PADDING_CN 100
|
||||||
@@ -36,6 +36,8 @@
|
|||||||
#define ENABLE_TURN_CHECKBOX_PADDING_EN 218
|
#define ENABLE_TURN_CHECKBOX_PADDING_EN 218
|
||||||
#define ENABLE_SRTP_CHECKBOX_PADDING_CN 151
|
#define ENABLE_SRTP_CHECKBOX_PADDING_CN 151
|
||||||
#define ENABLE_SRTP_CHECKBOX_PADDING_EN 218
|
#define ENABLE_SRTP_CHECKBOX_PADDING_EN 218
|
||||||
|
#define ENABLE_SELF_HOSTED_SERVER_CHECKBOX_PADDING_CN 151
|
||||||
|
#define ENABLE_SELF_HOSTED_SERVER_CHECKBOX_PADDING_EN 218
|
||||||
#define SETTINGS_SELECT_WINDOW_WIDTH 73
|
#define SETTINGS_SELECT_WINDOW_WIDTH 73
|
||||||
#define SETTINGS_OK_BUTTON_PADDING_CN 55
|
#define SETTINGS_OK_BUTTON_PADDING_CN 55
|
||||||
#define SETTINGS_OK_BUTTON_PADDING_EN 78
|
#define SETTINGS_OK_BUTTON_PADDING_EN 78
|
||||||
|
|||||||
@@ -431,6 +431,7 @@ class Render {
|
|||||||
bool enable_hardware_video_codec_ = false;
|
bool enable_hardware_video_codec_ = false;
|
||||||
bool enable_turn_ = false;
|
bool enable_turn_ = false;
|
||||||
bool enable_srtp_ = true;
|
bool enable_srtp_ = true;
|
||||||
|
bool enable_self_hosted_server_ = false;
|
||||||
int language_button_value_last_ = 0;
|
int language_button_value_last_ = 0;
|
||||||
int video_quality_button_value_last_ = 0;
|
int video_quality_button_value_last_ = 0;
|
||||||
int video_encode_format_button_value_last_ = 0;
|
int video_encode_format_button_value_last_ = 0;
|
||||||
|
|||||||
@@ -211,6 +211,28 @@ int Render::SettingWindow() {
|
|||||||
ImGui::Checkbox("##enable_srtp", &enable_srtp_);
|
ImGui::Checkbox("##enable_srtp", &enable_srtp_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::Separator();
|
||||||
|
|
||||||
|
{
|
||||||
|
settings_items_offset += settings_items_padding;
|
||||||
|
ImGui::SetCursorPosY(settings_items_offset + 2);
|
||||||
|
|
||||||
|
if (ImGui::Button(localization::self_hosted_server_config
|
||||||
|
[localization_language_index_]
|
||||||
|
.c_str())) {
|
||||||
|
LOG_ERROR("Self Built Server");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ConfigCenter::LANGUAGE::CHINESE == localization_language_) {
|
||||||
|
ImGui::SetCursorPosX(ENABLE_SELF_HOSTED_SERVER_CHECKBOX_PADDING_CN);
|
||||||
|
} else {
|
||||||
|
ImGui::SetCursorPosX(ENABLE_SELF_HOSTED_SERVER_CHECKBOX_PADDING_EN);
|
||||||
|
}
|
||||||
|
ImGui::SetCursorPosY(settings_items_offset);
|
||||||
|
ImGui::Checkbox("##enable_self_hosted_server",
|
||||||
|
&enable_self_hosted_server_);
|
||||||
|
}
|
||||||
|
|
||||||
if (stream_window_inited_) {
|
if (stream_window_inited_) {
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user