Merge branch 'master' into master

This commit is contained in:
RustDesk 2023-09-15 09:23:49 +08:00 committed by GitHub
commit b2ed8d8560
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 77 additions and 7 deletions

View File

@ -48,6 +48,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
var watchIsInputMonitoring = false;
var watchIsCanRecordAudio = false;
Timer? _updateTimer;
bool isCardClosed = false;
@override
Widget build(BuildContext context) {
@ -321,14 +322,15 @@ class _DesktopHomePageState extends State<DesktopHomePage>
}
Future<Widget> 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,8 +396,17 @@ class _DesktopHomePageState extends State<DesktopHomePage>
Widget buildInstallCard(String title, String content, String btnText,
GestureTapCallback onPressed,
{String? help, String? link}) {
return Container(
{String? help, String? link, bool? closeButton}) {
void closeCard() {
setState(() {
isCardClosed = true;
});
}
return Stack(
children: [
Container(
margin: EdgeInsets.only(top: 20),
child: Container(
decoration: BoxDecoration(
@ -467,6 +478,21 @@ class _DesktopHomePageState extends State<DesktopHomePage>
)).marginOnly(top: 6)),
]
: <Widget>[]))),
),
if (closeButton != null && closeButton == true)
Positioned(
top: 18,
right: 0,
child: IconButton(
icon: Icon(
Icons.close,
color: Colors.white,
size: 20,
),
onPressed: closeCard,
),
),
],
);
}

View File

@ -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(

View File

@ -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()
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -554,5 +554,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}