Do not enable privacy mode if current display is not the primary one

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-03-06 16:41:26 +08:00
parent 507472e87e
commit 8032659841
34 changed files with 45 additions and 2 deletions

View File

@ -509,7 +509,8 @@ class _MonitorMenu extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (PrivacyModeState.find(id).isTrue || stateGlobal.displaysCount.value < 2) {
if (PrivacyModeState.find(id).isTrue ||
stateGlobal.displaysCount.value < 2) {
return Offstage();
}
return _IconSubmenuButton(
@ -1548,6 +1549,16 @@ class _DisplayMenuState extends State<_DisplayMenu> {
value: rxValue.value,
onChanged: (value) {
if (value == null) return;
if (widget.ffi.ffiModel.pi.currentDisplay != 0) {
msgBox(
widget.id,
'custom-nook-nocancel-hasclose',
'info',
'Please switch to Display 1 first',
'',
widget.ffi.dialogManager);
return;
}
bind.sessionToggleOption(id: widget.id, value: option);
},
ffi: widget.ffi,

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Aconseguit"),
("Someone turns on privacy mode, exit", "Algú ha activat el mode de privacitat, surti"),
("Unsupported", "No suportat"),
("Please switch to Display 1 first", "")
("Peer denied", "Peer denegat"),
("Please install plugins", "Instal·li complements"),
("Peer exit", "El peer ha sortit"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "成功"),
("Someone turns on privacy mode, exit", "其他用户使用隐私模式,退出"),
("Unsupported", "不支持"),
("Please switch to Display 1 first", "请先切换到第一个屏幕")
("Peer denied", "被控端拒绝"),
("Please install plugins", "请安装插件"),
("Peer exit", "被控端退出"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Uspěl"),
("Someone turns on privacy mode, exit", "Někdo zapne režim soukromí, ukončete ho"),
("Unsupported", "Nepodporováno"),
("Please switch to Display 1 first", "")
("Peer denied", "Peer popřel"),
("Please install plugins", "Nainstalujte si prosím pluginy"),
("Peer exit", "Peer exit"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Vellykket"),
("Someone turns on privacy mode, exit", "Nogen aktiverede databeskyttelsestilstand, slut"),
("Unsupported", "Ikke understøttet"),
("Please switch to Display 1 first", "")
("Peer denied", "Peer nægtet"),
("Please install plugins", "Venligst Installer plugins"),
("Peer exit", "Peer-Afslut"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Erfolgreich"),
("Someone turns on privacy mode, exit", "Jemand hat den Datenschutzmodus aktiviert, beende …"),
("Unsupported", "Nicht unterstützt"),
("Please switch to Display 1 first", "")
("Peer denied", "Die Gegenstelle hat die Verbindung abgelehnt."),
("Please install plugins", "Bitte installieren Sie Plugins"),
("Peer exit", "Die Gegenstelle hat die Verbindung getrennt."),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", ""),
("Someone turns on privacy mode, exit", ""),
("Unsupported", ""),
("Please switch to Display 1 first", "")
("Peer denied", ""),
("Please install plugins", ""),
("Peer exit", ""),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Logrado"),
("Someone turns on privacy mode, exit", "Alguien active el modo privacidad, salga"),
("Unsupported", "No soportado"),
("Please switch to Display 1 first", "")
("Peer denied", "Par denegado"),
("Please install plugins", "Instale complementos"),
("Peer exit", "Par salio"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "موفقیت آمیز"),
("Someone turns on privacy mode, exit", "اگر شخصی حالت حریم خصوصی را روشن کرد، خارج شوید"),
("Unsupported", "پشتیبانی نشده"),
("Please switch to Display 1 first", "")
("Peer denied", "توسط میزبان راه دور رد شد"),
("Please install plugins", "لطفا افزونه ها را نصب کنید"),
("Peer exit", "میزبان خارج شد"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Succès"),
("Someone turns on privacy mode, exit", "Quelqu'un active le mode de confidentialité, quittez"),
("Unsupported", "Non pris en charge"),
("Please switch to Display 1 first", "")
("Peer denied", "Pair refusé"),
("Please install plugins", "Veuillez installer les plugins"),
("Peer exit", "Sortie des pairs"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Επιτυχής"),
("Someone turns on privacy mode, exit", "Κάποιος ενεργοποιεί τη λειτουργία απορρήτου, έξοδος"),
("Unsupported", "Δεν υποστηρίζεται"),
("Please switch to Display 1 first", "")
("Peer denied", "Ο απομακρυσμένος σταθμός απέρριψε τη σύνδεση"),
("Please install plugins", "Παρακαλώ εγκαταστήστε τα πρόσθετα"),
("Peer exit", "Ο απομακρυσμένος σταθμός έχει αποσυνδεθεί"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Sikeres"),
("Someone turns on privacy mode, exit", "Valaki bekacsolta az inkognitó módot, lépjen ki"),
("Unsupported", "Nem támogatott"),
("Please switch to Display 1 first", "")
("Peer denied", "Elutasítva a távoli fél álltal"),
("Please install plugins", "Kérem telepítse a bővítményeket"),
("Peer exit", "A távoli fél kilépett"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Berhasil"),
("Someone turns on privacy mode, exit", "Seseorang mengaktifkan mode privasi, keluar"),
("Unsupported", "Tidak didukung"),
("Please switch to Display 1 first", "")
("Peer denied", "Rekan ditolak"),
("Please install plugins", "Silakan instal plugin"),
("Peer exit", "keluar rekan"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Successo"),
("Someone turns on privacy mode, exit", "Qualcuno attiva la modalità privacy, esci"),
("Unsupported", "Non supportato"),
("Please switch to Display 1 first", "")
("Peer denied", "Peer negato"),
("Please install plugins", "Si prega di installare i plugin"),
("Peer exit", "Uscita tra pari"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "成功"),
("Someone turns on privacy mode, exit", "プライバシーモードがオンになりました。終了します。"),
("Unsupported", "サポートされていません"),
("Please switch to Display 1 first", "")
("Peer denied", "相手が拒否しました"),
("Please install plugins", "プラグインをインストールしてください"),
("Peer exit", "相手が終了しました"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "성공"),
("Someone turns on privacy mode, exit", "누군가가 개인정보 보호 모드를 활성화하여 종료됩니다"),
("Unsupported", "지원되지 않음"),
("Please switch to Display 1 first", "")
("Peer denied", "다른 사용자에 의해 거부됨"),
("Please install plugins", "플러그인을 설치해주세요"),
("Peer exit", "다른 사용자가 나감"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Сәтті"),
("Someone turns on privacy mode, exit", "Біреу құпиялылық модасын қосты, шығу"),
("Unsupported", "Қолдаусыз"),
("Please switch to Display 1 first", "")
("Peer denied", "Пир қабылдамады"),
("Please install plugins", "Плагиндерді орнатуды өтінеміз"),
("Peer exit", "Пирдің шығуы"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Geslaagd"),
("Someone turns on privacy mode, exit", "Iemand schakelt privacymodus in, afsluiten"),
("Unsupported", "Niet Ondersteund"),
("Please switch to Display 1 first", "")
("Peer denied", "Peer geweigerd"),
("Please install plugins", "Installeer plugins"),
("Peer exit", "Peer afgesloten"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Udało się"),
("Someone turns on privacy mode, exit", "Ktoś włącza tryb prywatności, wyjdź"),
("Unsupported", "Niewspierane"),
("Please switch to Display 1 first", "")
("Peer denied", "Odmowa dostępu"),
("Please install plugins", "Zainstaluj wtyczkę"),
("Peer exit", "Wyjście peer"),
@ -459,7 +460,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Reconnect", "Połącz ponownie"),
("Codec", "Kodek"),
("Resolution", "Rozdzielczość"),
("Key", "Klucz"),
("No transfers in progress", "Brak transferów w toku"),
].iter().cloned().collect();
}

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Conseguiu"),
("Someone turns on privacy mode, exit", "Alguém activou o modo de privacidade, desligue"),
("Unsupported", "Sem suporte"),
("Please switch to Display 1 first", "")
("Peer denied", "Remoto negado"),
("Please install plugins", "Por favor instale plugins"),
("Peer exit", "Saída do Remoto"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Sucesso"),
("Someone turns on privacy mode, exit", "Alguém habilitou o modo de privacidade, sair"),
("Unsupported", "Não suportado"),
("Please switch to Display 1 first", "")
("Peer denied", "Parceiro negou"),
("Please install plugins", "Por favor instale plugins"),
("Peer exit", "Parceiro saiu"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Reușit"),
("Someone turns on privacy mode, exit", "Cineva activează modul privat, ieși din"),
("Unsupported", "Neacceptat"),
("Please switch to Display 1 first", "")
("Peer denied", "Dispozitiv pereche refuzat"),
("Please install plugins", "Instalează pluginuri"),
("Peer exit", "Ieșire dispozitiv pereche"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Выполнено"),
("Someone turns on privacy mode, exit", "Кто-то включает режим конфиденциальности, выход"),
("Unsupported", "Не поддерживается"),
("Please switch to Display 1 first", "")
("Peer denied", "Отклонено удалённым узлом"),
("Please install plugins", "Установите плагины"),
("Peer exit", "Удалённый узел отключён"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Podarilo sa"),
("Someone turns on privacy mode, exit", "Niekto zapne režim súkromia, ukončite ho"),
("Unsupported", "Nepodporované"),
("Please switch to Display 1 first", "")
("Peer denied", "Peer poprel"),
("Please install plugins", "Nainštalujte si prosím pluginy"),
("Peer exit", "Peer exit"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Uspelo"),
("Someone turns on privacy mode, exit", "Vklopljen je zasebni način, izhod"),
("Unsupported", "Ni podprto"),
("Please switch to Display 1 first", "")
("Peer denied", "Odjemalec zavrnil"),
("Please install plugins", "Namestite vključke"),
("Peer exit", "Odjemalec se je zaprl"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Sukses"),
("Someone turns on privacy mode, exit", "Dikush ka ndezur menyrën e privatësisë , largohu"),
("Unsupported", "Nuk mbështetet"),
("Please switch to Display 1 first", "")
("Peer denied", "Peer mohohet"),
("Please install plugins", "Ju lutemi instaloni shtojcat"),
("Peer exit", "Dalje peer"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Uspešno"),
("Someone turns on privacy mode, exit", "Neko je uključio mod privatnosti, izlaz."),
("Unsupported", "Nepodržano"),
("Please switch to Display 1 first", "")
("Peer denied", "Klijent zabranjen"),
("Please install plugins", "Molimo instalirajte dodatke"),
("Peer exit", "Klijent izašao"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Lyckades"),
("Someone turns on privacy mode, exit", "Någon sätter på säkerhetesläge, avsluta"),
("Unsupported", "Stöds inte"),
("Please switch to Display 1 first", "")
("Peer denied", "Klienten nekade"),
("Please install plugins", "Var god installera plugins"),
("Peer exit", "Avsluta klient"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", ""),
("Someone turns on privacy mode, exit", ""),
("Unsupported", ""),
("Please switch to Display 1 first", "")
("Peer denied", ""),
("Please install plugins", ""),
("Peer exit", ""),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "สำเร็จ"),
("Someone turns on privacy mode, exit", "มีใครบางคนเปิดใช้งานโหมดความเป็นส่วนตัว กำลังออก"),
("Unsupported", "ไม่รองรับ"),
("Please switch to Display 1 first", "")
("Peer denied", "ถูกปฏิเสธโดยอีกฝั่ง"),
("Please install plugins", "กรุณาติดตั้งปลั๊กอิน"),
("Peer exit", "อีกฝั่งออก"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "başarılı"),
("Someone turns on privacy mode, exit", "Birisi gizlilik modunu açarsa, çık"),
("Unsupported", "desteklenmiyor"),
("Please switch to Display 1 first", "")
("Peer denied", "eş reddedildi"),
("Please install plugins", "Lütfen eklentileri yükleyin"),
("Peer exit", "eş çıkışı"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "成功"),
("Someone turns on privacy mode, exit", "其他用戶開啟隱私模式,退出"),
("Unsupported", "不支持"),
("Please switch to Display 1 first", "")
("Peer denied", "被控端拒絕"),
("Please install plugins", "請安裝插件"),
("Peer exit", "被控端退出"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Успішно"),
("Someone turns on privacy mode, exit", "Хтось вмикає режим конфіденційності, вихід"),
("Unsupported", "Не підтримується"),
("Please switch to Display 1 first", "")
("Peer denied", "Відхилено віддаленим комп'ютером"),
("Please install plugins", "Будь ласка, встановіть плагіни"),
("Peer exit", "Відключено віддаленим комп'ютером"),

View File

@ -301,6 +301,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Succeeded", "Thành công"),
("Someone turns on privacy mode, exit", "Ai đó đã bật chế độ riêng tư, thoát"),
("Unsupported", "Không hỗ trợ"),
("Please switch to Display 1 first", "")
("Peer denied", "Peer đã từ chối"),
("Please install plugins", "Hãy cài plugins"),
("Peer exit", "Peer đã thoát"),