From 8427b03a394ff5f9f372ee224b10d697052c6737 Mon Sep 17 00:00:00 2001 From: Sahil Yeole Date: Wed, 23 Aug 2023 00:13:23 +0530 Subject: [PATCH 1/3] Using github latest release url to check for software update Signed-off-by: Sahil Yeole --- src/common.rs | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/src/common.rs b/src/common.rs index 011ca0524..5ad92d914 100644 --- a/src/common.rs +++ b/src/common.rs @@ -831,30 +831,19 @@ pub fn check_software_update() { #[tokio::main(flavor = "current_thread")] async fn check_software_update_() -> hbb_common::ResultType<()> { - sleep(3.).await; + let url = "https://github.com/rustdesk/rustdesk/releases/latest"; + let latest_release_response = reqwest::get(url).await?; + let latest_release_version = latest_release_response + .url() + .path() + .rsplit('/') + .next() + .unwrap(); - let rendezvous_server = format!("rs-sg.rustdesk.com:{}", config::RENDEZVOUS_PORT); - let (mut socket, rendezvous_server) = - socket_client::new_udp_for(&rendezvous_server, CONNECT_TIMEOUT).await?; + let response_url = latest_release_response.url().to_string(); - let mut msg_out = RendezvousMessage::new(); - msg_out.set_software_update(SoftwareUpdate { - url: crate::VERSION.to_owned(), - ..Default::default() - }); - socket.send(&msg_out, rendezvous_server).await?; - use hbb_common::protobuf::Message; - for _ in 0..2 { - if let Some(Ok((bytes, _))) = socket.next_timeout(READ_TIMEOUT).await { - if let Ok(msg_in) = RendezvousMessage::parse_from_bytes(&bytes) { - if let Some(rendezvous_message::Union::SoftwareUpdate(su)) = msg_in.union { - let version = hbb_common::get_version_from_url(&su.url); - if get_version_number(&version) > get_version_number(crate::VERSION) { - *SOFTWARE_UPDATE_URL.lock().unwrap() = su.url; - } - } - } - } + if get_version_number(&latest_release_version) > get_version_number(crate::VERSION) { + *SOFTWARE_UPDATE_URL.lock().unwrap() = response_url; } Ok(()) } From f41cb0d81c67844786892dd32a28c029a4b0e990 Mon Sep 17 00:00:00 2001 From: Sahil Yeole Date: Wed, 23 Aug 2023 00:14:32 +0530 Subject: [PATCH 2/3] updated get_new_version for ui Signed-off-by: Sahil Yeole --- src/ui_interface.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui_interface.rs b/src/ui_interface.rs index 7e1b3a9bb..6c0d38354 100644 --- a/src/ui_interface.rs +++ b/src/ui_interface.rs @@ -594,7 +594,8 @@ pub fn current_is_wayland() -> bool { #[inline] pub fn get_new_version() -> String { - hbb_common::get_version_from_url(&*SOFTWARE_UPDATE_URL.lock().unwrap()) + // hbb_common::get_version_from_url(&*SOFTWARE_UPDATE_URL.lock().unwrap()) + (*SOFTWARE_UPDATE_URL.lock().unwrap().rsplit('/').next().unwrap_or("")).to_string() } #[inline] From d87ea854bc380b6307a9cc2572026ec5024d755b Mon Sep 17 00:00:00 2001 From: 21pages Date: Wed, 23 Aug 2023 08:15:56 +0800 Subject: [PATCH 3/3] add ColorPicker translations Signed-off-by: 21pages --- flutter/lib/common/widgets/address_book.dart | 7 +++++++ flutter/lib/common/widgets/peer_card.dart | 5 +++-- src/lang/ca.rs | 2 ++ src/lang/cn.rs | 2 ++ src/lang/cs.rs | 2 ++ src/lang/da.rs | 2 ++ src/lang/de.rs | 2 ++ src/lang/el.rs | 2 ++ src/lang/eo.rs | 2 ++ src/lang/es.rs | 2 ++ src/lang/fa.rs | 2 ++ src/lang/fr.rs | 2 ++ src/lang/hu.rs | 2 ++ src/lang/id.rs | 2 ++ src/lang/it.rs | 2 ++ src/lang/ja.rs | 2 ++ src/lang/ko.rs | 2 ++ src/lang/kz.rs | 2 ++ src/lang/lt.rs | 2 ++ src/lang/nl.rs | 2 ++ src/lang/pl.rs | 2 ++ src/lang/pt_PT.rs | 2 ++ src/lang/ptbr.rs | 2 ++ src/lang/ro.rs | 2 ++ src/lang/ru.rs | 2 ++ src/lang/sk.rs | 2 ++ src/lang/sl.rs | 2 ++ src/lang/sq.rs | 2 ++ src/lang/sr.rs | 2 ++ src/lang/sv.rs | 2 ++ src/lang/template.rs | 2 ++ src/lang/th.rs | 2 ++ src/lang/tr.rs | 2 ++ src/lang/tw.rs | 2 ++ src/lang/ua.rs | 2 ++ src/lang/vn.rs | 2 ++ 36 files changed, 78 insertions(+), 2 deletions(-) diff --git a/flutter/lib/common/widgets/address_book.dart b/flutter/lib/common/widgets/address_book.dart index 292266ae7..4af74e319 100644 --- a/flutter/lib/common/widgets/address_book.dart +++ b/flutter/lib/common/widgets/address_book.dart @@ -579,6 +579,13 @@ class AddressBookTag extends StatelessWidget { ColorPickerType.accent: false, ColorPickerType.wheel: true, }, + pickerTypeLabels: { + ColorPickerType.primary: translate("Primary Color"), + ColorPickerType.wheel: translate("HSV Color"), + }, + actionButtons: ColorPickerActionButtons( + dialogOkButtonLabel: translate("OK"), + dialogCancelButtonLabel: translate("Cancel")), showColorCode: true, ); if (oldColor != newColor) { diff --git a/flutter/lib/common/widgets/peer_card.dart b/flutter/lib/common/widgets/peer_card.dart index 74f0dcb31..a9d18b42c 100644 --- a/flutter/lib/common/widgets/peer_card.dart +++ b/flutter/lib/common/widgets/peer_card.dart @@ -735,11 +735,12 @@ abstract class BasePeerCard extends StatelessWidget { proc: () async { bool result = gFFI.abModel.changePassword(id, ''); await bind.mainForgetPassword(id: id); + bool toast = false; if (result) { - bool toast = tab == PeerTabIndex.ab; + toast = tab == PeerTabIndex.ab; gFFI.abModel.pushAb(toastIfFail: toast, toastIfSucc: toast); } - showToast(translate('Successful')); + if (!toast) showToast(translate('Successful')); }, padding: menuPadding, dismissOnClicked: true, diff --git a/src/lang/ca.rs b/src/lang/ca.rs index 4801abcae..baf6992b9 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cn.rs b/src/lang/cn.rs index 3313537d1..8c20966c0 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", "未成功上传地址簿"), ("synced_peer_readded_tip", "最近会话中存在的设备将会被重新同步到地址簿。"), ("Change Color", "更改颜色"), + ("Primary Color", "基本色"), + ("HSV Color", "HSV 色"), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index 3d913b0d6..0e4d4db65 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", "Nepodařilo se synchronizovat adresář se serverem"), ("synced_peer_readded_tip", "Zařízení, která byla přítomna v posledních relacích, budou synchronizována zpět do adresáře."), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index afaf98386..c5540e75e 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index 8eb066f30..c528acceb 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", "Synchronisierung des Adressbuchs mit dem Server fehlgeschlagen"), ("synced_peer_readded_tip", "Die Geräte, die in den letzten Sitzungen vorhanden waren, werden erneut zum Adressbuch hinzugefügt."), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/el.rs b/src/lang/el.rs index 56805e574..4e065c803 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index bcb467839..c77126729 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index 5384dfead..7bb24ac53 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", "No se ha podido sincronizar el directorio con el servidor"), ("synced_peer_readded_tip", "Los dispositivos presentes en sesiones recientes se sincronizarán con el directorio."), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fa.rs b/src/lang/fa.rs index fab82f661..35207642a 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index 24cc268ee..f9263d572 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", "Échec de la synchronisation du carnet d'adresses"), ("synced_peer_readded_tip", "Les appareils qui étaient présents dans les sessions récentes seront synchronisés avec le carnet d'adresses."), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index aaf888d23..722011788 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index a7b12f2ed..c8c343c5b 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", "Gagal menyinkronkan buku alamat ke server"), ("synced_peer_readded_tip", "Perangkat yang terdaftar dalam sesi-sesi terbaru akan di-sinkronkan kembali ke buku alamat."), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index 3b8bd8416..22088a061 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", "Impossibile sincronizzare la rubrica con il server"), ("synced_peer_readded_tip", "I dispositivi presenti nelle sessioni recenti saranno sincronizzati di nuovo nella rubrica."), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 1a9e8da4f..b1da5d94c 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index 28c34f7e2..a69b38e26 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index 2fb2b8b92..ccca49561 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lt.rs b/src/lang/lt.rs index 6a8c7e9f5..873f5909a 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/nl.rs b/src/lang/nl.rs index 3b08427df..2be2d5da2 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index 67b9d188a..0391dd2f3 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index 416600eeb..becb4c8ee 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index 98e469f7e..704b56d1e 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ro.rs b/src/lang/ro.rs index f4d44b3ae..2f248262b 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index 37fdb2060..1c43912c6 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", "Невозможно синхронизировать адресную книгу с сервером"), ("synced_peer_readded_tip", "Устройства, присутствовавшие в последних сеансах, будут синхронизированы с адресной книгой."), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index 8421bd2b0..9711586d3 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sl.rs b/src/lang/sl.rs index f4c5ff385..f5f4f95f2 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sq.rs b/src/lang/sq.rs index 11e3e1ccb..e5d310ebb 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sr.rs b/src/lang/sr.rs index 494999475..480964e6e 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sv.rs b/src/lang/sv.rs index 4c0f73f5a..cf94e7064 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index ee7fb0d46..c71a30342 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/th.rs b/src/lang/th.rs index e6f12d85e..1ec47d26c 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index bb3ab5de6..3c3a10da2 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index 8f28395d3..8ef8ca895 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", "未成功上傳地址簿"), ("synced_peer_readded_tip", "最近會話中存在的設備將會被重新同步到地址簿。"), ("Change Color", "更改顏色"), + ("Primary Color", "基本色"), + ("HSV Color", "HSV 色"), ].iter().cloned().collect(); } diff --git a/src/lang/ua.rs b/src/lang/ua.rs index 69ca7c2da..6be8c93b2 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); } diff --git a/src/lang/vn.rs b/src/lang/vn.rs index 7a0cce355..d83d9ef42 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("push_ab_failed_tip", ""), ("synced_peer_readded_tip", ""), ("Change Color", ""), + ("Primary Color", ""), + ("HSV Color", ""), ].iter().cloned().collect(); }