diff --git a/flutter/lib/common/widgets/login.dart b/flutter/lib/common/widgets/login.dart index 7fefa49b4..17cc7090c 100644 --- a/flutter/lib/common/widgets/login.dart +++ b/flutter/lib/common/widgets/login.dart @@ -675,3 +675,22 @@ Future verificationCodeDialog(UserPayload? user) async { return res; } + +void logOutConfirmDialog() { + gFFI.dialogManager.show((setState, close, context) { + submit() { + close(); + gFFI.userModel.logOut(); + } + + return CustomAlertDialog( + content: Text(translate("logout_tip")), + actions: [ + dialogButton(translate("Cancel"), onPressed: close, isOutline: true), + dialogButton(translate("OK"), onPressed: submit), + ], + onSubmit: submit, + onCancel: close, + ); + }); +} diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index eb8a96e15..1ff8bc09e 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -1385,7 +1385,7 @@ class _AccountState extends State<_Account> { () => { gFFI.userModel.userName.value.isEmpty ? loginDialog() - : gFFI.userModel.logOut() + : logOutConfirmDialog() })); } @@ -1503,7 +1503,7 @@ class _PluginState extends State<_Plugin> { () => { gFFI.userModel.userName.value.isEmpty ? loginDialog() - : gFFI.userModel.logOut() + : logOutConfirmDialog() })); } } diff --git a/flutter/lib/mobile/pages/connection_page.dart b/flutter/lib/mobile/pages/connection_page.dart index f2680db39..48c56e6a5 100644 --- a/flutter/lib/mobile/pages/connection_page.dart +++ b/flutter/lib/mobile/pages/connection_page.dart @@ -275,7 +275,7 @@ class _WebMenuState extends State { if (gFFI.userModel.userName.value.isEmpty) { loginDialog(); } else { - gFFI.userModel.logOut(); + logOutConfirmDialog(); } } if (value == 'scan') { diff --git a/flutter/lib/mobile/pages/settings_page.dart b/flutter/lib/mobile/pages/settings_page.dart index bdaa42ef9..eea1498db 100644 --- a/flutter/lib/mobile/pages/settings_page.dart +++ b/flutter/lib/mobile/pages/settings_page.dart @@ -392,7 +392,7 @@ class _SettingsState extends State with WidgetsBindingObserver { if (gFFI.userModel.userName.value.isEmpty) { loginDialog(); } else { - gFFI.userModel.logOut(); + logOutConfirmDialog(); } }, ), diff --git a/src/lang/ca.rs b/src/lang/ca.rs index d6d4f0a31..71d80f02e 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cn.rs b/src/lang/cn.rs index e06a3341b..69b5e33bf 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", "发起的连接"), ("Exit", "退出"), ("Open", "打开"), + ("logout_tip", "确定要退出登录吗?"), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index 7f296bf95..07c9e2c09 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index fb4a42cdb..6d4ffa8c1 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index d0b17df60..965684d99 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", "Ausgehende Verbindung"), ("Exit", "Beenden"), ("Open", "Öffnen"), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/el.rs b/src/lang/el.rs index 9846b2185..78cc94a7b 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/en.rs b/src/lang/en.rs index fa9ed33ab..ecaffa0d0 100644 --- a/src/lang/en.rs +++ b/src/lang/en.rs @@ -71,5 +71,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("resolution_custom_tip", "Custom resolution"), ("accept_and_elevate_btn_tooltip", "Accept the connection and elevate UAC permissions."), ("clipboard_wait_response_timeout_tip", "Timed out waiting for copy response."), + ("logout_tip", "Are you sure you want to log out?") ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index ce40a2c8d..548377e2a 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index a293b2f83..0c1cf113f 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fa.rs b/src/lang/fa.rs index 28c6a24b7..f745cd486 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", "اتصال خروجی"), ("Exit", "خروج"), ("Open", "باز کردن"), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index c53c5f386..255e3d27e 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index ad609dd93..973a04a17 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index f6825d083..f8662bb0e 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index 866ddc20a..5f1a34a08 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", "Conenssioni in uscita"), ("Exit", "Esci da RustDesk"), ("Open", "Apri RustDesk"), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index d82953db0..f6aa3b881 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index 622e325c9..5c6eaf559 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index 8d9ee8b5c..792ffa157 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lt.rs b/src/lang/lt.rs index c95549b58..e7c0c79e1 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/nl.rs b/src/lang/nl.rs index 6411cafb7..cf8c2a25f 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", "Uitgaande verbinding"), ("Exit", "Verlaten"), ("Open", "Open"), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index 6a382c1ea..90c83ada2 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index e40a9b02f..dc91081b9 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index a099b29fb..fda7c867d 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ro.rs b/src/lang/ro.rs index e316be0ed..b3f75beff 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index 0015d13d2..86ec23dee 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", "Исходящее подключение"), ("Exit", "Выход"), ("Open", "Открыть"), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index 0e202faa1..3fad5e4f7 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sl.rs b/src/lang/sl.rs index 41c514c68..df0b94f8a 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sq.rs b/src/lang/sq.rs index 4a7d9bbe4..b62557e0b 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sr.rs b/src/lang/sr.rs index eab1c4fc1..cfce2aa9d 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sv.rs b/src/lang/sv.rs index 001ab1ddf..6c752ed3a 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index 8c41cf85c..9cbd25822 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/th.rs b/src/lang/th.rs index 4d8badbf7..edfdbb540 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index 43aedd099..d1a121f37 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index 3817d923f..5240b55f6 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", "發起的連接"), ("Exit", "退出"), ("Open", "開啟"), + ("logout_tip", "確定要退出登錄嗎?"), ].iter().cloned().collect(); } diff --git a/src/lang/ua.rs b/src/lang/ua.rs index b557f647d..3c362bf03 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/vn.rs b/src/lang/vn.rs index b060dcd19..0bdf2df29 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -517,5 +517,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Outgoing connection", ""), ("Exit", ""), ("Open", ""), + ("logout_tip", ""), ].iter().cloned().collect(); }