diff --git a/flutter/lib/desktop/pages/desktop_home_page.dart b/flutter/lib/desktop/pages/desktop_home_page.dart index d458402d..e48dda51 100644 --- a/flutter/lib/desktop/pages/desktop_home_page.dart +++ b/flutter/lib/desktop/pages/desktop_home_page.dart @@ -48,6 +48,7 @@ class _DesktopHomePageState extends State var watchIsInputMonitoring = false; var watchIsCanRecordAudio = false; Timer? _updateTimer; + bool isCardClosed = false; @override Widget build(BuildContext context) { @@ -321,14 +322,15 @@ class _DesktopHomePageState extends State } Future buildHelpCards() async { - if (updateUrl.isNotEmpty) { + if (updateUrl.isNotEmpty && !isCardClosed) { return buildInstallCard( "Status", "There is a newer version of ${bind.mainGetAppNameSync()} ${bind.mainGetNewVersion()} available.", "Click to download", () async { final Uri url = Uri.parse('https://rustdesk.com/download'); await launchUrl(url); - }); + }, + closeButton: true); } if (systemError.isNotEmpty) { return buildInstallCard("", systemError, "", () {}); @@ -394,11 +396,20 @@ class _DesktopHomePageState extends State Widget buildInstallCard(String title, String content, String btnText, GestureTapCallback onPressed, - {String? help, String? link}) { - return Container( - margin: EdgeInsets.only(top: 20), - child: Container( - decoration: BoxDecoration( + {String? help, String? link, bool? closeButton}) { + + void closeCard() { + setState(() { + isCardClosed = true; + }); + } + + return Stack( + children: [ + Container( + margin: EdgeInsets.only(top: 20), + child: Container( + decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.centerLeft, end: Alignment.centerRight, @@ -467,6 +478,21 @@ class _DesktopHomePageState extends State )).marginOnly(top: 6)), ] : []))), + ), + if (closeButton != null && closeButton == true) + Positioned( + top: 18, + right: 0, + child: IconButton( + icon: Icon( + Icons.close, + color: Colors.white, + size: 20, + ), + onPressed: closeCard, + ), + ), + ], ); } diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index 2f5180bf..035a21f4 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -329,6 +329,10 @@ class _GeneralState extends State<_General> { message: translate('software_render_tip'), child: _OptionCheckBox(context, "Always use software rendering", 'allow-always-software-render'), + )); + children.add( + _OptionCheckBox(context, 'Check for software update on startup','enable-check-update', + isServer: false, )); if (bind.mainShowOption(key: 'allow-linux-headless')) { children.add(_OptionCheckBox( diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index 69f6f507..dbbe0d70 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -1,3 +1,5 @@ +use hbb_common::config::Config; + #[cfg(not(any(target_os = "android", target_os = "ios")))] use crate::common::get_default_sound_input; use crate::{ @@ -1074,6 +1076,9 @@ pub fn main_get_last_remote_id() -> String { } pub fn main_get_software_update_url() -> String { + if (get_local_option("enable-check-update".to_string()) != "N") { + crate::common::check_software_update(); + } crate::common::SOFTWARE_UPDATE_URL.lock().unwrap().clone() } diff --git a/src/lang/ar.rs b/src/lang/ar.rs index c65adef0..9b00da2a 100644 --- a/src/lang/ar.rs +++ b/src/lang/ar.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ca.rs b/src/lang/ca.rs index 1d01bea6..868440bf 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cn.rs b/src/lang/cn.rs index 1a10b8bd..0d9e5a29 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", "超时(分钟)"), ("auto_disconnect_option_tip", "自动关闭不活跃的会话"), ("Connection failed due to inactivity", "由于长时间无操作, 连接被自动断开"), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index 457dae51..857672ef 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index 6ea628ce..d7151ee2 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index d44a1e98..70a1e81e 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", "Zeitüberschreitung in Minuten"), ("auto_disconnect_option_tip", "Automatisches Schließen eingehender Sitzungen bei Inaktivität des Benutzers"), ("Connection failed due to inactivity", "Automatische Trennung der Verbindung aufgrund von Inaktivität"), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/el.rs b/src/lang/el.rs index 71075133..b098452f 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 7df5c3fa..ea1d597d 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index 1053dcf7..8299e609 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fa.rs b/src/lang/fa.rs index 1fd0be29..98d0c408 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index 565bd5d4..51d690bf 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index df19e7bb..5ee56c42 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index 1d4b3b4c..cd4d2dc7 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -544,15 +544,16 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Installation Successful!", "Instalasi berhasil!"), ("Installation failed!", "Instalasi gagal!"), ("Reverse mouse wheel", "Balikkan arah scroll mouse!"), - ("{} sessions", ""), - ("scam_title", ""), - ("scam_text1", ""), - ("scam_text2", ""), - ("Don't show again", ""), - ("I Agree", ""), - ("Decline", ""), - ("Timeout in minutes", ""), - ("auto_disconnect_option_tip", ""), - ("Connection failed due to inactivity", ""), + ("{} sessions", "sesi {}"), + ("scam_title", "Kemungkinan Anda Sedang DITIPU!"), + ("scam_text1", "Jika Anda sedang berbicara di telepon dengan seseorang yang TIDAK dikenal dan mereka meminta anda untuk menggunakan RustDesk, jangan lanjutkan dan segera tutup panggilan."), + ("scam_text2", "Kemungkinan besar mereka adalah komplotan penipu yang berusaha mencuri uang atau informasi pribadi anda."), + ("Don't show again", "Jangan tampilkan lagi"), + ("I Agree", "Saya setuju"), + ("Decline", "Tolak"), + ("Timeout in minutes", "Batasan Waktu dalam Menit"), + ("auto_disconnect_option_tip", "Secara otomatis akan menutup sesi ketika pengguna tidak beraktivitas"), + ("Connection failed due to inactivity", "Secara otomatis akan terputus ketik tidak ada aktivitas."), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index 54a96a18..4b22c87a 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", "Timeout in minuti"), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", "Connessione non riuscita a causa di inattività"), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 1ecb8d9e..017637e4 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index ad05b326..f1f6c731 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index e3fec6c5..53fa177d 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lt.rs b/src/lang/lt.rs index 4c9cae2b..46550800 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/nl.rs b/src/lang/nl.rs index 43f277a0..4ae99987 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index 71c21642..e9b03fae 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", "Czas bezczynności w minutach"), ("auto_disconnect_option_tip", "Automatycznie rozłącz sesje przychodzące przy braku aktywności użytkownika"), ("Connection failed due to inactivity", "Automatycznie rozłącz przy bezczynności"), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index 72a16d62..6a3f4380 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index f11435d6..7a58fc4b 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ro.rs b/src/lang/ro.rs index d4cccc79..9557a403 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index 3fa19af2..c7e28f27 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", "Время ожидания (минут)"), ("auto_disconnect_option_tip", "Автоматически закрывать входящие сеансы при неактивности пользователя"), ("Connection failed due to inactivity", "Подключение не выполнено из-за неактивности"), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index 0b58db74..c7d68b4f 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sl.rs b/src/lang/sl.rs index 2c82b35d..cf2e2942 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sq.rs b/src/lang/sq.rs index 32dc09f0..30cb24ab 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sr.rs b/src/lang/sr.rs index 43ead144..f193a720 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sv.rs b/src/lang/sv.rs index 867fa9fc..a0fb40ef 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index 397d6d38..03b69bcf 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/th.rs b/src/lang/th.rs index c5e4d5fb..dc430be2 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index 28b8d385..2bce33d4 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index 10437025..b13c024a 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ua.rs b/src/lang/ua.rs index 7147445e..4301b3b1 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); } diff --git a/src/lang/vn.rs b/src/lang/vn.rs index 9b910955..3d0f5c45 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Timeout in minutes", ""), ("auto_disconnect_option_tip", ""), ("Connection failed due to inactivity", ""), + ("Check for software update on startup", ""), ].iter().cloned().collect(); }