Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 21, 2024
2 parents faf0cb6 + a516f01 commit eb1252d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 29 deletions.
14 changes: 12 additions & 2 deletions libs/hbb_common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ pub struct PeerConfig {
pub keyboard_mode: String,
#[serde(flatten)]
pub view_only: ViewOnly,
#[serde(flatten)]
pub sync_init_clipboard: SyncInitClipboard,
// Mouse wheel or touchpad scroll mode
#[serde(
default = "PeerConfig::default_reverse_mouse_wheel",
Expand Down Expand Up @@ -373,6 +375,7 @@ impl Default for PeerConfig {
ui_flutter: Default::default(),
info: Default::default(),
transfer: Default::default(),
sync_init_clipboard: Default::default(),
}
}
}
Expand Down Expand Up @@ -1462,6 +1465,13 @@ serde_field_bool!(
"ViewOnly::default_view_only"
);

serde_field_bool!(
SyncInitClipboard,
"sync-init-clipboard",
default_sync_init_clipboard,
"SyncInitClipboard::default_sync_init_clipboard"
);

#[derive(Debug, Default, Serialize, Deserialize, Clone)]
pub struct LocalConfig {
#[serde(default, deserialize_with = "deserialize_string")]
Expand Down Expand Up @@ -2156,6 +2166,7 @@ pub mod keys {
pub const OPTION_CUSTOM_IMAGE_QUALITY: &str = "custom_image_quality";
pub const OPTION_CUSTOM_FPS: &str = "custom-fps";
pub const OPTION_CODEC_PREFERENCE: &str = "codec-preference";
pub const OPTION_SYNC_INIT_CLIPBOARD: &str = "sync-init-clipboard";
pub const OPTION_THEME: &str = "theme";
pub const OPTION_LANGUAGE: &str = "lang";
pub const OPTION_REMOTE_MENUBAR_DRAG_LEFT: &str = "remote-menubar-drag-left";
Expand Down Expand Up @@ -2219,7 +2230,6 @@ pub mod keys {
pub const OPTION_DEFAULT_CONNECT_PASSWORD: &str = "default-connect-password";
pub const OPTION_HIDE_TRAY: &str = "hide-tray";
pub const OPTION_ONE_WAY_CLIPBOARD_REDIRECTION: &str = "one-way-clipboard-redirection";
pub const OPTION_ENABLE_CLIPBOARD_INIT_SYNC: &str = "enable-clipboard-init-sync";
pub const OPTION_ALLOW_LOGON_SCREEN_PASSWORD: &str = "allow-logon-screen-password";
pub const OPTION_ONE_WAY_FILE_TRANSFER: &str = "one-way-file-transfer";

Expand Down Expand Up @@ -2280,6 +2290,7 @@ pub mod keys {
OPTION_CUSTOM_IMAGE_QUALITY,
OPTION_CUSTOM_FPS,
OPTION_CODEC_PREFERENCE,
OPTION_SYNC_INIT_CLIPBOARD,
];
// DEFAULT_LOCAL_SETTINGS, OVERWRITE_LOCAL_SETTINGS
pub const KEYS_LOCAL_SETTINGS: &[&str] = &[
Expand Down Expand Up @@ -2367,7 +2378,6 @@ pub mod keys {
OPTION_DEFAULT_CONNECT_PASSWORD,
OPTION_HIDE_TRAY,
OPTION_ONE_WAY_CLIPBOARD_REDIRECTION,
OPTION_ENABLE_CLIPBOARD_INIT_SYNC,
OPTION_ALLOW_LOGON_SCREEN_PASSWORD,
OPTION_ONE_WAY_FILE_TRANSFER,
];
Expand Down
15 changes: 6 additions & 9 deletions src/client/io_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1196,15 +1196,12 @@ impl<T: InvokeUiSession> Remote<T> {
}

#[cfg(not(any(target_os = "android", target_os = "ios")))]
if let Some(msg_out) = crate::clipboard::get_current_clipboard_msg(
&peer_version,
&peer_platform,
crate::clipboard::ClipboardSide::Client,
) {
if crate::get_builtin_option(
config::keys::OPTION_ENABLE_CLIPBOARD_INIT_SYNC,
) != "N"
{
if self.handler.lc.read().unwrap().sync_init_clipboard.v {
if let Some(msg_out) = crate::clipboard::get_current_clipboard_msg(
&peer_version,
&peer_platform,
crate::clipboard::ClipboardSide::Client,
) {
let sender = self.sender.clone();
let permission_config = self.handler.get_permission_config();
tokio::spawn(async move {
Expand Down
12 changes: 6 additions & 6 deletions src/lang/ko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,11 +641,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Platform", "플랫폼"),
("Days remaining", "일 남음"),
("enable-trusted-devices-tip", "신뢰할 수 있는 기기에서 2FA 검증 건너뛰기"),
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("Parent directory", "상위 디렉토리"),
("Resume", "재개"),
("Invalid file name", "잘못된 파일 이름"),
("one-way-file-transfer-tip", "단방향 파일 전송은 제어되는 쪽에서 활성화됩니다."),
("Authentication Required", "인증 필요함"),
("Authenticate", "인증"),
].iter().cloned().collect();
}
24 changes: 12 additions & 12 deletions src/lang/uk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Paste", "Вставити"),
("Paste here?", "Вставити сюди?"),
("Are you sure to close the connection?", "Ви впевнені, що хочете завершити підключення?"),
("Download new version", "Завантажити нову версію"),
("Download new version", "Завантажте нову версію"),
("Touch mode", "Сенсорний режим"),
("Mouse mode", "Режим миші"),
("One-Finger Tap", "Дотик одним пальцем"),
Expand Down Expand Up @@ -636,16 +636,16 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Requires at least {} characters", "Потрібно щонайменше {} символів"),
("Wrong PIN", "Неправильний PIN-код"),
("Set PIN", "Встановити PIN-код"),
("Enable trusted devices", ""),
("Manage trusted devices", ""),
("Platform", ""),
("Days remaining", ""),
("enable-trusted-devices-tip", ""),
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("Enable trusted devices", "Увімкнути довірені пристрої"),
("Manage trusted devices", "Керувати довіреними пристроями"),
("Platform", "Платформа"),
("Days remaining", "Залишилося днів"),
("enable-trusted-devices-tip", "Дозволити довіреним пристроям пропускати двофакторну автентифікацію?"),
("Parent directory", "Батьківський каталог"),
("Resume", "Продовжити"),
("Invalid file name", "Неправильне ім'я файлу"),
("one-way-file-transfer-tip", "На керованій стороні ввімкнено одностороннє передавання файлів."),
("Authentication Required", "Потрібна автентифікація"),
("Authenticate", "Автентифікувати"),
].iter().cloned().collect();
}

0 comments on commit eb1252d

Please sign in to comment.