diff --git a/i18n_ts/bo.ts b/i18n_ts/bo.ts index 49c98e2..a7049f6 100644 --- a/i18n_ts/bo.ts +++ b/i18n_ts/bo.ts @@ -12,163 +12,169 @@ AuthDialog - - + + Authentication failure, Please try again - - + + Password cannot be empty - - + + Verify face recognition or enter password to unlock - + Press fingerprint or enter password to unlock - + Verify voiceprint or enter password to unlock - + Verify finger vein or enter password to unlock - + Verify iris or enter password to unlock - + Use the bound wechat scanning code or enter the password to unlock - + Password - + Input Password - + Username - + User name input error! - + login - + + Login - + + Guest + + + + Retry - + Please try again in %1 minutes. - + Please try again in %1 seconds. - + Account locked permanently. - - - - + + + + Failed to verify %1, please enter password to unlock - - - - - + + + + + Unable to verify %1, please enter password to unlock - - + + Failed to verify %1, you still have %2 verification opportunities - + Abnormal network - + Face recognition waiting time out, please click refresh or enter the password to unlock. - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey - + QRCode @@ -200,31 +206,35 @@ BlockWidget + + Cancel + + Confrim - + The following program is running to prevent the system from reboot! - + The following program is running to prevent the system from shutting down! - + The following program is running to prevent the system from suspend! - + The following program is running to prevent the system from hibernate! @@ -240,17 +250,18 @@ CharsWidget - + + More - + ABC - + 123 @@ -389,17 +400,17 @@ LightDMHelper - + failed to start session. - + Login - + Guest @@ -407,7 +418,7 @@ LockWidget - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -474,12 +485,12 @@ MyNetworkWidget - + LAN - + WLAN @@ -487,12 +498,13 @@ NumbersWidget - + &&?! - + + Return @@ -614,6 +626,21 @@ + + UserListWidget + + + + Login + + + + + + Guest + + + Widget @@ -729,12 +756,12 @@ - + Backend for the ukui ScreenSaver. - + lock the screen by startup diff --git a/i18n_ts/bo_CN.ts b/i18n_ts/bo_CN.ts index 264f78d..729ab90 100644 --- a/i18n_ts/bo_CN.ts +++ b/i18n_ts/bo_CN.ts @@ -24,7 +24,7 @@ 使用密码认证 - + Retry བསྐྱར་དུ་ཞིབ་བཤེར་བྱ་དགོས། @@ -53,125 +53,130 @@ 账户锁定%1分钟由于%2次错误尝试 - + Please try again in %1 minutes. ཁྱོད་ཀྱིས་ཡང་བསྐྱར་ཐེངས་གཅིག་ལ་ཚོད་ལྟ་ཞིག་བྱེད་རོགས། - + Please try again in %1 seconds. ཁྱོད་ཀྱིས་དུས་ཚོད་སྐར་ཆ་གཅིག་གི་ནང་དུ་ཡང་བསྐྱར་ཚོད་ལྟ་ཞིག་བྱེད་རོགས། - + Account locked permanently. དུས་གཏན་དུ་ཟྭ་བརྒྱབ་པའི་རྩིས་ཐོ། - - + + Verify face recognition or enter password to unlock ངོ་གདོང་ངོས་འཛིན་ལ་ཞིབ་བཤེར་བྱེད་པའམ་ཡང་ན་གསང་གྲངས་ནང་ - + + Guest + 游客 + + + Press fingerprint or enter password to unlock མཛུབ་རིས་མནན་པའམ་ཡང་ན་གསང་གྲངས་ནང་འཇུག་བྱས་ནས་ - + Verify voiceprint or enter password to unlock སྒྲ་པར་ཞིབ་བཤེར་བྱེད་པའམ་ཡང་ན་གསང་གྲངས་ནང་འཇུག་བྱས་ནས་ཟྭ་རྒྱག - + Verify finger vein or enter password to unlock མཛུབ་མོའི་ནང་དུ་ཞིབ་བཤེར་བྱེད་པའམ་ཡང་ན་གསང་གྲངས་ནང་འཇུག་བྱས་ - + Verify iris or enter password to unlock iris ཞིབ་བཤེར་བྱེད་པའམ་ཡང་ན་གསང་གྲངས་ནང་འཇུག་བྱས་ནས་ཟྭ་ - + Input Password ནང་འཇུག་གི་གསང་གྲངས། - + Username སྤྱོད་མཁན་གྱི་མིང་། - + User name input error! - + login - - - - + + + + Failed to verify %1, please enter password to unlock %1ལ་ཞིབ་བཤེར་བྱེད་མ་ཐུབ་ན། གསང་གྲངས་ནང་འཇུག་བྱས་ནས་ཟྭ་རྒྱག་རོགས། - - - - - + + + + + Unable to verify %1, please enter password to unlock %1ལ་ཞིབ་བཤེར་བྱེད་ཐབས་བྲལ་བ་དང་། གསང་གྲངས་ནང་འཇུག་བྱས་ནས་ཟྭ་རྒྱག་རོགས། - + Abnormal network རྒྱུན་ལྡན་མིན་པའི་དྲ་ - + Face recognition waiting time out, please click refresh or enter the password to unlock. མིའི་གདོང་ལ་དབྱེ་འབྱེད་བྱེད་པར་རེ་སྒུག་བྱེད་དུས་གསང་གྲངས་ཀྱི་སྒོ་ལྕགས་རྒྱག་རོགས། - + FingerPrint - + FingerVein - + Iris - + Face མིའི་གདོང་། - + VoicePrint སྒྲ་རིས། - + Ukey བདེ་འཇགས་གསང་ལྡེ་ - + QRCode དོན་ཚན་གཉིས་པ། @@ -180,8 +185,8 @@ 使用绑定的微信扫码或输入密码登录 - - + + Password cannot be empty གསང་གྲངས་སྟོང་པ་ཡིན་མི་སྲིད། @@ -194,8 +199,8 @@ 无法验证%1,请输入密码. - - + + Failed to verify %1, you still have %2 verification opportunities %1ལ་ཞིབ་བཤེར་བྱེད་མ་ཐུབ་ན། ཁྱེད་ཚོར་ད་དུང་%2ལ་ཞིབ་བཤེར་བྱེད་པའི་གོ་སྐབས་ཡོད། @@ -224,13 +229,13 @@ 请输入密码或者录入指纹 - - + + Authentication failure, Please try again བདེན་དཔང་ར་སྤྲོད་བྱེད་མ་ཐུབ་ན། ཡང་བསྐྱར་ཚོད་ལྟ་ཞིག - + Use the bound wechat scanning code or enter the password to unlock འབྲེལ་མཐུད་ཀྱི་འཕྲིན་ཕྲན་ཞིབ་བཤེར་ཨང་གྲངས་སམ་ཡང་ན་གསང་གྲངས་ནང་འཇུག་བྱས་ནས་ཟྭ་རྒྱག་པ། @@ -243,12 +248,13 @@ བདེ་འཇགས་ཀྱི་གསང་བའི་ལྡེ་མིག་དེ་USBཡི་སྣེ་འདྲེན་དུ་འཇུག་རོགས། - + Password གསང་གྲངས། - + + Login ཐོ་འགོད་བྱེད་པ། @@ -368,31 +374,35 @@ BlockWidget + + Cancel ཕྱིར་འཐེན། + + Confrim - + The following program is running to prevent the system from reboot! གཤམ་གྱི་གོ་རིམ་ནི་མ་ལག་བསྐྱར་དུ་འབྱུང་བར་སྔོན་འགོག་བྱེད་ཆེད་ཡིན། - + The following program is running to prevent the system from shutting down! གཤམ་གྱི་གོ་རིམ་ནི་མ་ལག་གི་སྒོ་རྒྱག་པར་བཀག་འགོག་བྱེད་པའི་ཆེད་དུ་ཡིན། - + The following program is running to prevent the system from suspend! གཤམ་གྱི་གོ་རིམ་ནི་མ་ལག་གནས་སྐབས་མཚམས་འཇོག་པར་བཀག་འགོག་བྱེད་པའི་ཆེད་དུ་ཡིན། - + The following program is running to prevent the system from hibernate! གཤམ་གྱི་གོ་རིམ་ནི་མ་ལག་ལ་བཀག་འགོག་བྱེད་པའི་ཆེད་དུ་ཡིན། @@ -413,17 +423,18 @@ དེ་བས་ཀྱང་མང་ - + + More དེ་བས་ཀྱང་མང་ - + ABC - + 123 @@ -1887,17 +1898,17 @@ LightDMHelper - + failed to start session. - + Login ཐོ་འགོད་བྱེད་པ། - + Guest 游客 @@ -1941,7 +1952,7 @@ སྐུད་མེད་ཅུས་ཁོངས་ཀྱི་དྲ་བ། - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -2019,12 +2030,12 @@ MyNetworkWidget - + LAN - + WLAN སྐུད་མེད་ཅུས་ཁོངས་ཀྱི་དྲ་བ། @@ -2032,12 +2043,13 @@ NumbersWidget - + &&?! - + + Return ཕྱིར་ལོག་པ། @@ -2511,6 +2523,21 @@ བྲོས་བྱོལ་དུ་སོང་བ། + + UserListWidget + + + + Login + ཐོ་འགོད་བྱེད་པ། + + + + + Guest + 游客 + + Utils @@ -2682,12 +2709,12 @@ སྒེའུ་ཁུང་གི་ཐོབ་ཐང་ - + Backend for the ukui ScreenSaver. - + lock the screen by startup diff --git a/i18n_ts/de.ts b/i18n_ts/de.ts index e0ff65d..89efd18 100644 --- a/i18n_ts/de.ts +++ b/i18n_ts/de.ts @@ -24,7 +24,7 @@ 使用密码认证 - + Retry Wiederholen @@ -53,125 +53,130 @@ 账户锁定%1分钟由于%2次错误尝试 - + Please try again in %1 minutes. Versuchen Sie es in %1 Minuten erneut. - + Please try again in %1 seconds. Bitte versuchen Sie es in %1 Sekunden erneut. - + Account locked permanently. Das Konto wurde dauerhaft gesperrt. - - + + Verify face recognition or enter password to unlock Überprüfen Sie die Gesichtserkennung oder geben Sie das Passwort ein, um zu entsperren - + + Guest + 游客 + + + Press fingerprint or enter password to unlock Drücken Sie den Fingerabdruck oder geben Sie das Passwort ein, um zu entsperren - + Verify voiceprint or enter password to unlock Überprüfen Sie den Stimmabdruck oder geben Sie das Passwort ein, um zu entsperren - + Verify finger vein or enter password to unlock Überprüfen Sie die Fingervene oder geben Sie das Passwort ein, um zu entsperren - + Verify iris or enter password to unlock Überprüfen Sie die Iris oder geben Sie das Passwort ein, um zu entsperren - + Input Password Passwort eingeben - + Username Nutzername - + User name input error! - + login - - - - + + + + Failed to verify %1, please enter password to unlock %1 konnte nicht verifiziert werden, bitte geben Sie das Kennwort zum Entsperren ein - - - - - + + + + + Unable to verify %1, please enter password to unlock %1 kann nicht verifiziert werden, bitte geben Sie das Kennwort zum Entsperren ein - + Abnormal network Ungewöhnliches Netzwerk - + Face recognition waiting time out, please click refresh or enter the password to unlock. - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey Ukey - + QRCode QRCode @@ -180,8 +185,8 @@ 使用绑定的微信扫码或输入密码登录 - - + + Password cannot be empty Das Kennwort darf nicht leer sein. @@ -194,8 +199,8 @@ 无法验证%1,请输入密码. - - + + Failed to verify %1, you still have %2 verification opportunities %1 konnte nicht verifiziert werden, Sie haben immer noch %2 Überprüfungsmöglichkeiten @@ -224,13 +229,13 @@ 请输入密码或者录入指纹 - - + + Authentication failure, Please try again Authentifizierungsfehler, Bitte versuchen Sie es erneut - + Use the bound wechat scanning code or enter the password to unlock Verwenden Sie den gebundenen Wechat-Scan-Code oder geben Sie das Passwort zum Entsperren ein @@ -243,12 +248,13 @@ Stecken Sie den Ukey in den USB-Anschluss - + Password Passwort - + + Login Einloggen @@ -368,31 +374,35 @@ BlockWidget + + Cancel Abbrechen + + Confrim - + The following program is running to prevent the system from reboot! Das folgende Programm wird ausgeführt, um einen Neustart des Systems zu verhindern! - + The following program is running to prevent the system from shutting down! Das folgende Programm wird ausgeführt, um das Herunterfahren des Systems zu verhindern! - + The following program is running to prevent the system from suspend! Das folgende Programm wird ausgeführt, um zu verhindern, dass das System angehalten wird! - + The following program is running to prevent the system from hibernate! Das folgende Programm wird ausgeführt, um zu verhindern, dass das System in den Ruhezustand versetzt wird! @@ -408,17 +418,18 @@ CharsWidget - + + More Mehr - + ABC ABC - + 123 123 @@ -1883,17 +1894,17 @@ LightDMHelper - + failed to start session. - + Login Einloggen - + Guest 游客 @@ -1937,7 +1948,7 @@ WLAN - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -2015,12 +2026,12 @@ MyNetworkWidget - + LAN LAN - + WLAN WLAN @@ -2028,12 +2039,13 @@ NumbersWidget - + &&?! &&?! - + + Return Rückgabe @@ -2358,72 +2370,6 @@ - this is only shown for laptops with multiple batteries - - - - - - this is only shown for laptops with multiple batteries - - - - - - laptop primary battery - - - - - - battery-backed AC power source - - - - - - a monitor is a device to measure voltage and current - - - - - - wireless mice with internal batteries - - - - - - wireless keyboard with internal battery - - - - - - portable device - - - - - - cell phone (mobile...) - - - - - - media player, mp3 etc - - - - - - tablet device - - - - - tablet device @@ -2573,6 +2519,21 @@ Hüpfen + + UserListWidget + + + + Login + Einloggen + + + + + Guest + 游客 + + Utils @@ -2744,12 +2705,12 @@ Fenster-ID - + Backend for the ukui ScreenSaver. - + lock the screen by startup diff --git a/i18n_ts/es.ts b/i18n_ts/es.ts index 0f7028a..d7141cf 100644 --- a/i18n_ts/es.ts +++ b/i18n_ts/es.ts @@ -24,7 +24,7 @@ 使用密码认证 - + Retry Reintentar @@ -53,125 +53,130 @@ 账户锁定%1分钟由于%2次错误尝试 - + Please try again in %1 minutes. Inténtelo de nuevo en %1 minutos. - + Please try again in %1 seconds. Inténtelo de nuevo en %1 segundos. - + Account locked permanently. Cuenta bloqueada permanentemente. - - + + Verify face recognition or enter password to unlock Verifique el reconocimiento facial o ingrese la contraseña para desbloquear - + + Guest + 游客 + + + Press fingerprint or enter password to unlock Presione la huella dactilar o ingrese la contraseña para desbloquear - + Verify voiceprint or enter password to unlock Verifica la huella de voz o ingresa la contraseña para desbloquear - + Verify finger vein or enter password to unlock Verifique la vena del dedo o ingrese la contraseña para desbloquear - + Verify iris or enter password to unlock Verifique el iris o ingrese la contraseña para desbloquear - + Input Password Contraseña de entrada - + Username Nombre de usuario - + User name input error! - + login - - - - + + + + Failed to verify %1, please enter password to unlock No se pudo verificar %1, ingrese la contraseña para desbloquear - - - - - + + + + + Unable to verify %1, please enter password to unlock No se puede verificar %1, ingrese la contraseña para desbloquear - + Abnormal network Red anormal - + Face recognition waiting time out, please click refresh or enter the password to unlock. - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey Ukey - + QRCode QRCode @@ -180,8 +185,8 @@ 使用绑定的微信扫码或输入密码登录 - - + + Password cannot be empty La contraseña no puede estar vacía @@ -194,8 +199,8 @@ 无法验证%1,请输入密码. - - + + Failed to verify %1, you still have %2 verification opportunities No se pudo verificar %1, todavía tiene %2 oportunidades de verificación @@ -224,13 +229,13 @@ 请输入密码或者录入指纹 - - + + Authentication failure, Please try again Error de autenticación, inténtelo de nuevo - + Use the bound wechat scanning code or enter the password to unlock Use el código de escaneo de wechat vinculado o ingrese la contraseña para desbloquear @@ -243,12 +248,13 @@ Inserte la ukey en el puerto USB - + Password Contraseña - + + Login Iniciar sesión @@ -368,31 +374,35 @@ BlockWidget + + Cancel Cancelar + + Confrim - + The following program is running to prevent the system from reboot! ¡El siguiente programa se está ejecutando para evitar que el sistema se reinicie! - + The following program is running to prevent the system from shutting down! ¡El siguiente programa se está ejecutando para evitar que el sistema se apague! - + The following program is running to prevent the system from suspend! ¡El siguiente programa se está ejecutando para evitar que el sistema se suspenda! - + The following program is running to prevent the system from hibernate! ¡El siguiente programa se está ejecutando para evitar que el sistema hiberne! @@ -408,17 +418,18 @@ CharsWidget - + + More Más - + ABC ABECEDARIO - + 123 123 @@ -1883,17 +1894,17 @@ LightDMHelper - + failed to start session. - + Login Iniciar sesión - + Guest 游客 @@ -1941,7 +1952,7 @@ WLAN - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -2019,12 +2030,12 @@ MyNetworkWidget - + LAN LAN - + WLAN WLAN @@ -2032,12 +2043,13 @@ NumbersWidget - + &&?! &&?! - + + Return Devolución @@ -2362,72 +2374,6 @@ - this is only shown for laptops with multiple batteries - - - - - - this is only shown for laptops with multiple batteries - - - - - - laptop primary battery - - - - - - battery-backed AC power source - - - - - - a monitor is a device to measure voltage and current - - - - - - wireless mice with internal batteries - - - - - - wireless keyboard with internal battery - - - - - - portable device - - - - - - cell phone (mobile...) - - - - - - media player, mp3 etc - - - - - - tablet device - - - - - tablet device @@ -2577,6 +2523,21 @@ Saltarse + + UserListWidget + + + + Login + Iniciar sesión + + + + + Guest + 游客 + + Utils @@ -2748,12 +2709,12 @@ ID de ventana - + Backend for the ukui ScreenSaver. - + lock the screen by startup diff --git a/i18n_ts/fr.ts b/i18n_ts/fr.ts index 3a38e63..63b9f5c 100644 --- a/i18n_ts/fr.ts +++ b/i18n_ts/fr.ts @@ -24,7 +24,7 @@ 使用密码认证 - + Retry Réessayer @@ -53,125 +53,130 @@ 账户锁定%1分钟由于%2次错误尝试 - + Please try again in %1 minutes. Veuillez réessayer dans %1 minutes. - + Please try again in %1 seconds. Veuillez réessayer dans %1 secondes. - + Account locked permanently. Compte verrouillé définitivement. - - + + Verify face recognition or enter password to unlock Vérifier la reconnaissance faciale ou saisir le mot de passe pour déverrouiller - + + Guest + 游客 + + + Press fingerprint or enter password to unlock Appuyez sur l’empreinte digitale ou entrez le mot de passe pour déverrouiller - + Verify voiceprint or enter password to unlock Vérifier l’empreinte vocale ou saisir le mot de passe pour déverrouiller - + Verify finger vein or enter password to unlock Vérifiez la veine du doigt ou entrez le mot de passe pour déverrouiller - + Verify iris or enter password to unlock Vérifiez l’iris ou entrez le mot de passe pour déverrouiller - + Input Password Mot de passe d’entrée - + Username Nom d’utilisateur - + User name input error! - + login - - - - + + + + Failed to verify %1, please enter password to unlock Impossible de vérifier %1, veuillez entrer le mot de passe pour déverrouiller - - - - - + + + + + Unable to verify %1, please enter password to unlock Impossible de vérifier %1, veuillez entrer le mot de passe pour déverrouiller - + Abnormal network Réseau anormal - + Face recognition waiting time out, please click refresh or enter the password to unlock. - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey Ukey (en anglais seulement) - + QRCode QRCode @@ -180,8 +185,8 @@ 使用绑定的微信扫码或输入密码登录 - - + + Password cannot be empty Le mot de passe ne peut pas être vide @@ -194,8 +199,8 @@ 无法验证%1,请输入密码. - - + + Failed to verify %1, you still have %2 verification opportunities Échec de la vérification %1, vous avez encore %2 possibilités de vérification @@ -224,13 +229,13 @@ 请输入密码或者录入指纹 - - + + Authentication failure, Please try again Échec de l’authentification, veuillez réessayer - + Use the bound wechat scanning code or enter the password to unlock Utilisez le code d’analyse wechat lié ou entrez le mot de passe pour déverrouiller @@ -243,12 +248,13 @@ Insérez l’ukey dans le port USB - + Password Mot de passe - + + Login Connectez-vous @@ -368,31 +374,35 @@ BlockWidget + + Cancel Annuler + + Confrim - + The following program is running to prevent the system from reboot! Le programme suivant est en cours d’exécution pour empêcher le système de redémarrer ! - + The following program is running to prevent the system from shutting down! Le programme suivant est en cours d’exécution pour empêcher le système de s’arrêter ! - + The following program is running to prevent the system from suspend! Le programme suivant est en cours d’exécution pour empêcher le système de se suspendre ! - + The following program is running to prevent the system from hibernate! Le programme suivant est en cours d’exécution pour empêcher le système de hiberner ! @@ -408,17 +418,18 @@ CharsWidget - + + More Plus - + ABC ABC - + 123 123 @@ -1883,17 +1894,17 @@ LightDMHelper - + failed to start session. - + Login Connectez-vous - + Guest 游客 @@ -1937,7 +1948,7 @@ Réseau local sans fil (WLAN) - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -2015,12 +2026,12 @@ MyNetworkWidget - + LAN LAN - + WLAN Réseau local sans fil (WLAN) @@ -2028,12 +2039,13 @@ NumbersWidget - + &&?! &&?! - + + Return Rendre @@ -2358,72 +2370,6 @@ - this is only shown for laptops with multiple batteries - - - - - - this is only shown for laptops with multiple batteries - - - - - - laptop primary battery - - - - - - battery-backed AC power source - - - - - - a monitor is a device to measure voltage and current - - - - - - wireless mice with internal batteries - - - - - - wireless keyboard with internal battery - - - - - - portable device - - - - - - cell phone (mobile...) - - - - - - media player, mp3 etc - - - - - - tablet device - - - - - tablet device @@ -2573,6 +2519,21 @@ Sautiller + + UserListWidget + + + + Login + Connectez-vous + + + + + Guest + 游客 + + Utils @@ -2744,12 +2705,12 @@ ID de la fenêtre - + Backend for the ukui ScreenSaver. - + lock the screen by startup diff --git a/i18n_ts/kk.ts b/i18n_ts/kk.ts index 0eb6362..738b367 100644 --- a/i18n_ts/kk.ts +++ b/i18n_ts/kk.ts @@ -24,7 +24,7 @@ 使用密码认证 - + Retry Ретри @@ -53,125 +53,130 @@ 账户锁定%1分钟由于%2次错误尝试 - + Please try again in %1 minutes. % 1 минутта қайталап көріңіз. - + Please try again in %1 seconds. % 1 секундта қайталап көріңіз. - + Account locked permanently. Тіркелгі біржолата құлыпталады. - - + + Verify face recognition or enter password to unlock Бет тануды тексеру немесе құлыптан босату үшін құпия сөзді енгізу - + + Guest + 游客 + + + Press fingerprint or enter password to unlock Құлыптан босату үшін дактилоскопияны басу немесе құпия сөзді енгізу - + Verify voiceprint or enter password to unlock Құлыптан босату үшін дауыстық ізді тексеру немесе құпия сөзді енгізу - + Verify finger vein or enter password to unlock Құлыптан босату үшін саусақ көктамырын тексеру немесе құпия сөзді енгізу - + Verify iris or enter password to unlock Құлыптан босату үшін IRIS тексеру немесе құпиясөзді енгізу - + Input Password Құпиясөзді енгізу - + Username Пайдаланушы аты - + User name input error! - + login - - - - + + + + Failed to verify %1, please enter password to unlock % 1 дегенді тексеру мүмкін болмады, құлыптан босату үшін құпия сөзді енгізіңіз - - - - - + + + + + Unable to verify %1, please enter password to unlock % 1 дегенді тексеру мүмкін болмады, құлыптан босату үшін құпия сөзді енгізіңіз - + Abnormal network Аномальды желі - + Face recognition waiting time out, please click refresh or enter the password to unlock. - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey - + QRCode QRCode @@ -180,8 +185,8 @@ 使用绑定的微信扫码或输入密码登录 - - + + Password cannot be empty Құпия сөз бос болмады @@ -194,8 +199,8 @@ 无法验证%1,请输入密码. - - + + Failed to verify %1, you still have %2 verification opportunities % 1 дегенді тексеру мүмкін болмады, сізде әлі де% 2 тексеру мүмкіндіктері бар @@ -224,23 +229,24 @@ 请输入密码或者录入指纹 - - + + Authentication failure, Please try again Аутентификация сәтсіздігі, қайталап көріңіз - + Use the bound wechat scanning code or enter the password to unlock Байланыстыратын wechat сканерлеу кодын пайдаланыңыз немесе құлыптан босату үшін құпия сөзді енгізіңіз - + Password Пароль - + + Login Кіру @@ -360,31 +366,35 @@ BlockWidget + + Cancel Болдырмау + + Confrim - + The following program is running to prevent the system from reboot! Жүйені қайта жүктеуге жол бермеу үшін келесі бағдарлама іске асырылуда! - + The following program is running to prevent the system from shutting down! Жүйенің тоқтап қалуына жол бермеу үшін келесі бағдарлама іске асырылуда! - + The following program is running to prevent the system from suspend! Жүйенің тоқтатылуына жол бермеу үшін келесі бағдарлама іске асырылуда! - + The following program is running to prevent the system from hibernate! Жүйенің жорыққа шығуына жол бермеу үшін келесі бағдарлама іске асырылуда! @@ -400,17 +410,18 @@ CharsWidget - + + More - + ABC - + 123 @@ -1863,17 +1874,17 @@ LightDMHelper - + failed to start session. - + Login Кіру - + Guest 游客 @@ -1901,7 +1912,7 @@ Бірнеше пайдаланушы бір уақытта кіргізіледі. Бұл жүйені қайта жүктеу керек пе? - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -1979,12 +1990,12 @@ MyNetworkWidget - + LAN ЛАН - + WLAN WLAN @@ -1992,12 +2003,13 @@ NumbersWidget - + &&?! - + + Return @@ -2306,72 +2318,6 @@ - this is only shown for laptops with multiple batteries - - - - - - this is only shown for laptops with multiple batteries - - - - - - laptop primary battery - - - - - - battery-backed AC power source - - - - - - a monitor is a device to measure voltage and current - - - - - - wireless mice with internal batteries - - - - - - wireless keyboard with internal battery - - - - - - portable device - - - - - - cell phone (mobile...) - - - - - - media player, mp3 etc - - - - - - tablet device - - - - - tablet device @@ -2521,6 +2467,21 @@ Өткізіп жіберу + + UserListWidget + + + + Login + Кіру + + + + + Guest + 游客 + + Utils @@ -2692,12 +2653,12 @@ терезе идентифика- ты - + Backend for the ukui ScreenSaver. - + lock the screen by startup diff --git a/i18n_ts/ky.ts b/i18n_ts/ky.ts index 8970c57..2c6c34c 100644 --- a/i18n_ts/ky.ts +++ b/i18n_ts/ky.ts @@ -24,7 +24,7 @@ 使用密码认证 - + Retry Ретри @@ -53,125 +53,130 @@ 账户锁定%1分钟由于%2次错误尝试 - + Please try again in %1 minutes. %1 мүнөттө кайра аракет кылыңыз. - + Please try again in %1 seconds. %1 секунданын ичинде кайра аракет кылыңыз. - + Account locked permanently. Эсеп биротоло кулпуланган. - - + + Verify face recognition or enter password to unlock Беттин таанылышын текшерүү же кулпуну ачуу үчүн сырсөз киргизүү - + + Guest + 游客 + + + Press fingerprint or enter password to unlock Манжа изин басуу же кулпуну ачуу үчүн сырсөз киргизүү - + Verify voiceprint or enter password to unlock Үн изин текшерүү же сырсөз киргизүү - + Verify finger vein or enter password to unlock Манжа тамырын текшерүү же кулпуну ачуу үчүн сырсөз киргизүү - + Verify iris or enter password to unlock Ирис текшерүү же кулпусун ачуу үчүн сырсөз киргизүү - + Input Password Сырсөз киргизүү - + Username Колдонуучунун аты - + User name input error! - + login - - - - + + + + Failed to verify %1, please enter password to unlock %1 текшерүүгө болбоду, кулпусун ачуу үчүн сырсөздү киргизиңиз - - - - - + + + + + Unable to verify %1, please enter password to unlock %1 текшерүүгө болбоду, кулпусун ачуу үчүн сырсөздү киргизиңиз - + Abnormal network Аномалдуу тармак - + Face recognition waiting time out, please click refresh or enter the password to unlock. - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey - + QRCode QRCode @@ -180,8 +185,8 @@ 使用绑定的微信扫码或输入密码登录 - - + + Password cannot be empty Сырсөз бош болушу мүмкүн эмес @@ -194,8 +199,8 @@ 无法验证%1,请输入密码. - - + + Failed to verify %1, you still have %2 verification opportunities %1 текшерүүгө болбоду, сизде дагы эле %2 текшерүү мүмкүнчүлүктөрү бар @@ -224,23 +229,24 @@ 请输入密码或者录入指纹 - - + + Authentication failure, Please try again Аутентификациянын жетишсиздиги, сураныч, кайрадан аракет кылыңыз - + Use the bound wechat scanning code or enter the password to unlock Чектелген вечат сканерлеу кодын колдонуңуз же сырсөздү ачуу үчүн киргизиңиз - + Password Сырсөз - + + Login Кирүү @@ -360,31 +366,35 @@ BlockWidget + + Cancel Жокко чыгаруу + + Confrim - + The following program is running to prevent the system from reboot! Системаны кайра жүктөөдөн алдын алуу үчүн төмөнкү программа иштеп жатат! - + The following program is running to prevent the system from shutting down! Системанын жабылышына жол бербөө үчүн төмөнкү программа иштеп жатат! - + The following program is running to prevent the system from suspend! Системанын токтотулушуна жол бербөө үчүн төмөнкү программа иштеп жатат! - + The following program is running to prevent the system from hibernate! Системанын уктап кетишине жол бербөө үчүн төмөнкү программа иштеп жатат! @@ -400,17 +410,18 @@ CharsWidget - + + More - + ABC - + 123 @@ -1863,17 +1874,17 @@ LightDMHelper - + failed to start session. - + Login Кирүү - + Guest 游客 @@ -1901,7 +1912,7 @@ Бир эле учурда бир нече колдонуучулар катталган. Сиз бул системаны кайра жүктөп келет деп ишенесизби? - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -1979,12 +1990,12 @@ MyNetworkWidget - + LAN ЛАН - + WLAN ВЛАН @@ -1992,12 +2003,13 @@ NumbersWidget - + &&?! - + + Return @@ -2306,72 +2318,6 @@ - this is only shown for laptops with multiple batteries - - - - - - this is only shown for laptops with multiple batteries - - - - - - laptop primary battery - - - - - - battery-backed AC power source - - - - - - a monitor is a device to measure voltage and current - - - - - - wireless mice with internal batteries - - - - - - wireless keyboard with internal battery - - - - - - portable device - - - - - - cell phone (mobile...) - - - - - - media player, mp3 etc - - - - - - tablet device - - - - - tablet device @@ -2521,6 +2467,21 @@ Өтүү + + UserListWidget + + + + Login + Кирүү + + + + + Guest + 游客 + + Utils @@ -2692,12 +2653,12 @@ терезе идентификату - + Backend for the ukui ScreenSaver. - + lock the screen by startup diff --git a/i18n_ts/mn.ts b/i18n_ts/mn.ts index 88df517..6db645f 100644 --- a/i18n_ts/mn.ts +++ b/i18n_ts/mn.ts @@ -24,7 +24,7 @@ 使用密码认证 - + Retry ᠳᠠᠬᠢᠵᠤ ᠳᠤᠷᠱᠢᠬᠤ @@ -53,125 +53,130 @@ 账户锁定%1分钟由于%2次错误尝试 - + Please try again in %1 minutes. %1 ᠮᠢᠨᠦ᠋ᠲ᠎ᠦᠨ ᠳᠠᠷᠠᠭ᠎ᠠ ᠳᠠᠬᠢᠵᠤ ᠳᠤᠷᠠᠱᠢᠭᠠᠷᠠᠢ - + Please try again in %1 seconds. %1 ᠮᠢᠨᠦ᠋ᠲ᠎ᠦᠨ ᠳᠠᠷᠠᠭ᠎ᠠ ᠳᠠᠬᠢᠵᠤ ᠳᠤᠷᠠᠱᠢᠭᠠᠷᠠᠢ - + Account locked permanently. ᠳᠠᠩᠰᠠ ᠨᠢᠭᠡᠨᠳᠡ ᠦᠨᠢᠳᠡ ᠤᠨᠢᠰᠤᠯᠠᠭᠳᠠᠪᠠ᠃ - - + + Verify face recognition or enter password to unlock ᠨᠢᠭᠤᠷ ᠱᠢᠷᠪᠢᠵᠤ ᠪᠠᠳᠤᠯᠭᠠᠵᠢᠭᠤᠯᠬᠤ ᠪᠤᠶᠤ ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ ᠤᠷᠤᠭᠤᠯᠵᠤ ᠤᠨᠢᠰᠤ᠎ᠶᠢ ᠳᠠᠢᠯᠤᠭᠠᠷᠠᠢ - + + Guest + 游客 + + + Press fingerprint or enter password to unlock ᠬᠤᠷᠤᠭᠤᠨ᠎ᠤ ᠤᠷᠤᠮ ᠳᠠᠷᠤᠬᠤ ᠪᠤᠶᠤ ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ ᠤᠷᠤᠭᠤᠯᠵᠤ ᠤᠨᠢᠰᠤ᠎ᠶᠢ ᠳᠠᠢᠯᠤᠭᠠᠷᠠᠢ - + Verify voiceprint or enter password to unlock ᠳᠠᠭᠤ᠎ᠪᠠᠷ ᠪᠠᠳᠤᠯᠭᠠᠵᠢᠭᠤᠯᠬᠤ ᠪᠤᠶᠤ ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ ᠤᠷᠤᠭᠤᠯᠵᠤ ᠤᠨᠢᠰᠤ᠎ᠶᠢ ᠳᠠᠢᠯᠤᠭᠠᠷᠠᠢ - + Verify finger vein or enter password to unlock ᠬᠤᠷᠤᠭᠤᠨ᠎ᠤ ᠨᠠᠮᠵᠢᠭᠤᠨ ᠰᠤᠳᠠᠯ᠎ᠢᠶᠠᠷ ᠪᠠᠳᠤᠯᠭᠠᠵᠢᠭᠤᠯᠬᠤ ᠪᠤᠶᠤ ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ ᠤᠷᠤᠭᠤᠯᠵᠤ ᠤᠨᠢᠰᠤ᠎ᠶᠢ ᠳᠠᠢᠯᠤᠭᠠᠷᠠᠢ - + Verify iris or enter password to unlock ᠰᠤᠯᠤᠩᠭ᠎ᠠ ᠪᠦᠷᠬᠦᠪᠴᠢ᠎ᠶᠢ ᠪᠠᠳᠤᠯᠭᠠᠵᠢᠭᠤᠯᠬᠤ ᠪᠤᠶᠤ ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ ᠤᠷᠤᠭᠤᠯᠵᠤ ᠤᠨᠢᠰᠤ᠎ᠶᠢ ᠳᠠᠢᠯᠤᠭᠠᠷᠠᠢ - + Input Password ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ ᠤᠷᠤᠭᠤᠯᠬᠤ - + Username - + User name input error! - + login - - - - + + + + Failed to verify %1, please enter password to unlock %1᠎ᠤ ᠪᠠᠳᠤᠯᠭᠠᠵᠢᠭᠤᠯᠤᠯᠳᠠ ᠢᠯᠠᠭᠳᠠᠪᠠ ᠂ ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ ᠤᠷᠤᠭᠤᠯᠵᠤ ᠤᠨᠢᠰᠤ᠎ᠶᠢ ᠳᠠᠢᠯᠤᠭᠠᠷᠠᠢ - - - - - + + + + + Unable to verify %1, please enter password to unlock %1᠎ᠶᠢ/᠎ᠢ ᠪᠠᠳᠤᠯᠭᠠᠵᠢᠭᠤᠯᠬᠤ ᠠᠷᠭ᠎ᠠ ᠦᠬᠡᠢ ᠂ ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ ᠤᠷᠤᠭᠤᠯᠵᠤ ᠤᠨᠢᠰᠤ᠎ᠶᠢ ᠳᠠᠢᠯᠤᠭᠠᠷᠠᠢ - + Abnormal network ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠬᠡᠪ᠎ᠦᠨ ᠪᠤᠰᠤ - + Face recognition waiting time out, please click refresh or enter the password to unlock. - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey - + QRCode ᠬᠤᠶᠠᠷ ᠬᠡᠮᠵᠢᠯᠳᠡᠳᠦ ᠺᠤᠳ᠋ @@ -180,8 +185,8 @@ 使用绑定的微信扫码或输入密码登录 - - + + Password cannot be empty ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ ᠬᠤᠭᠤᠰᠤᠨ ᠪᠠᠢᠵᠤ ᠪᠤᠯᠬᠤ ᠦᠬᠡᠢ @@ -194,8 +199,8 @@ 无法验证%1,请输入密码. - - + + Failed to verify %1, you still have %2 verification opportunities %1᠎ᠶᠢᠨ/᠎ᠦᠨ ᠪᠠᠳᠤᠯᠭᠠᠵᠢᠭᠤᠯᠤᠯᠳᠠ ᠢᠯᠠᠭᠳᠠᠪᠠ ᠂ ᠲᠠ ᠪᠠᠰᠠ%2 ᠤᠳᠠᠭᠠᠨ᠎ᠤ ᠳᠤᠷᠱᠢᠬᠤ ᠵᠠᠪᠱᠢᠶᠠᠨ ᠲᠠᠢ @@ -224,13 +229,13 @@ 请输入密码或者录入指纹 - - + + Authentication failure, Please try again ᠪᠠᠳᠤᠯᠭᠠᠵᠢᠭᠤᠯᠤᠯᠳᠠ ᠢᠯᠠᠭᠳᠠᠪᠠ ᠂ ᠳᠠᠬᠢᠵᠤ ᠳᠤᠷᠱᠢᠭᠠᠷᠠᠢ - + Use the bound wechat scanning code or enter the password to unlock ᠤᠶᠠᠭᠰᠠᠨ ᠸᠢᠴᠠᠲ᠎ᠢᠶᠠᠷ ᠺᠤᠳ᠋ ᠱᠢᠷᠪᠢᠬᠦ᠌ ᠪᠤᠶᠤ ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ ᠤᠷᠤᠭᠤᠯᠵᠤ ᠤᠨᠢᠰᠤ᠎ᠶᠢ ᠳᠠᠢᠯᠤᠭᠠᠷᠠᠢ @@ -243,12 +248,13 @@ ᠠᠮᠤᠷ ᠲᠦᠪᠰᠢᠨ ᠦ ᠨᠢᠭᠤᠴᠠ ᠶᠢ USB ᠦᠵᠦᠭᠦᠷ ᠲᠦ ᠬᠠᠳᠬᠤᠵᠤ ᠣᠷᠣᠭᠠᠷᠠᠢ ᠃ - + Password ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ - + + Login ᠳᠠᠩᠰᠠᠯᠠᠨ ᠤᠷᠤᠬᠤ @@ -368,31 +374,35 @@ BlockWidget + + Cancel + + Confrim - + The following program is running to prevent the system from reboot! ᠳᠠᠷᠠᠭᠠᠬᠢ ᠫᠠᠷᠦᠭᠷᠡᠮ ᠶᠠᠭ ᠠᠵᠢᠯᠯᠠᠵᠤ ᠪᠠᠢᠨ᠎ᠠ ᠂ ᠱᠢᠰᠲ᠋ᠧᠮ᠎ᠦᠨ ᠳᠠᠬᠢᠵᠤ ᠡᠬᠢᠯᠡᠬᠦ᠌᠎ᠶᠢ ᠬᠤᠷᠢᠭᠯᠠᠨ᠎ᠠ! - + The following program is running to prevent the system from shutting down! ᠳᠠᠷᠠᠭᠠᠬᠢ ᠫᠠᠷᠦᠭᠷᠡᠮ ᠶᠠᠭ ᠠᠵᠢᠯᠯᠠᠵᠤ ᠪᠠᠢᠨ᠎ᠠ ᠂ ᠱᠢᠰᠲ᠋ᠧᠮ᠎ᠦᠨ ᠬᠠᠭᠠᠬᠤ᠎ᠶᠢ ᠬᠤᠷᠢᠭᠯᠠᠨ᠎ᠠ! - + The following program is running to prevent the system from suspend! ᠳᠠᠷᠠᠭᠠᠬᠢ ᠫᠠᠷᠦᠭᠷᠡᠮ ᠶᠠᠭ ᠠᠵᠢᠯᠯᠠᠵᠤ ᠪᠠᠢᠨ᠎ᠠ ᠂ ᠱᠢᠰᠲ᠋ᠧᠮ᠎ᠦᠨ ᠤᠨᠳᠠᠬᠤ᠎ᠶᠢ ᠬᠤᠷᠢᠭᠯᠠᠨ᠎ᠠ! - + The following program is running to prevent the system from hibernate! ᠳᠠᠷᠠᠭᠠᠬᠢ ᠫᠠᠷᠦᠭᠷᠡᠮ ᠶᠠᠭ ᠠᠵᠢᠯᠯᠠᠵᠤ ᠪᠠᠢᠨ᠎ᠠ ᠂ ᠱᠢᠰᠲ᠋ᠧᠮ᠎ᠦᠨ ᠢᠴᠡᠬᠡᠯᠡᠬᠦ᠌᠎ᠶᠢ ᠬᠤᠷᠢᠭᠯᠠᠨ᠎ᠠ! @@ -408,17 +418,18 @@ CharsWidget - + + More ᠨᠡᠩ ᠠᠷᠪᠢᠨ ᠃ - + ABC ABC - + 123 123 @@ -1890,17 +1901,17 @@ LightDMHelper - + failed to start session. - + Login ᠳᠠᠩᠰᠠᠯᠠᠨ ᠤᠷᠤᠬᠤ - + Guest 游客 @@ -1944,7 +1955,7 @@ ᠤᠳᠠᠰᠤ ᠦᠬᠡᠢ ᠬᠡᠰᠡᠭ ᠬᠡᠪᠴᠢᠶᠡᠨ᠎ᠦ ᠰᠦᠯᠵᠢᠶ᠎ᠡ - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -2022,12 +2033,12 @@ MyNetworkWidget - + LAN ᠤᠳᠠᠰᠤᠳᠤ ᠰᠦᠯᠵᠢᠶ᠎ᠡ - + WLAN ᠤᠳᠠᠰᠤ ᠦᠬᠡᠢ ᠬᠡᠰᠡᠭ ᠬᠡᠪᠴᠢᠶᠡᠨ᠎ᠦ ᠰᠦᠯᠵᠢᠶ᠎ᠡ @@ -2035,12 +2046,13 @@ NumbersWidget - + &&?! &&?! - + + Return ᠪᠤᠴᠠᠵᠤ ᠢᠷᠡᠨ᠎ᠡ ᠃ @@ -2514,6 +2526,21 @@ ᠦᠰᠦᠷᠴᠤ᠌ ᠭᠠᠷᠬᠤ + + UserListWidget + + + + Login + ᠳᠠᠩᠰᠠᠯᠠᠨ ᠤᠷᠤᠬᠤ + + + + + Guest + 游客 + + Utils @@ -2685,12 +2712,12 @@ ᠴᠣᠩᠬᠣᠨ᠎ᠤ᠋ id - + Backend for the ukui ScreenSaver. - + lock the screen by startup diff --git a/i18n_ts/pt.ts b/i18n_ts/pt.ts index 1525f0f..37d4686 100644 --- a/i18n_ts/pt.ts +++ b/i18n_ts/pt.ts @@ -158,6 +158,10 @@ QRCode + + Guest + Convidado + BatteryWidget @@ -723,6 +727,17 @@ TextLabel + + UserListWidget + + Login + + + + Guest + Convidado + + Widget diff --git a/i18n_ts/ru.ts b/i18n_ts/ru.ts index be49d2b..ad5ee8b 100644 --- a/i18n_ts/ru.ts +++ b/i18n_ts/ru.ts @@ -158,6 +158,10 @@ QRCode + + Guest + гость + BatteryWidget @@ -723,6 +727,17 @@ TextLabel + + UserListWidget + + Login + + + + Guest + гость + + Widget diff --git a/i18n_ts/tr.ts b/i18n_ts/tr.ts index 8d8d4a7..eaed354 100644 --- a/i18n_ts/tr.ts +++ b/i18n_ts/tr.ts @@ -24,7 +24,7 @@ Parola - + Retry Yeniden Dene @@ -49,158 +49,164 @@ Kimlik doğrulama hatası, hala %1 kalan denemen var - - + + Authentication failure, Please try again - + Please try again in %1 minutes. - + Please try again in %1 seconds. - + Account locked permanently. - - + + Verify face recognition or enter password to unlock - + Press fingerprint or enter password to unlock - + Verify voiceprint or enter password to unlock - + Verify finger vein or enter password to unlock - + Verify iris or enter password to unlock - + Use the bound wechat scanning code or enter the password to unlock - - + + Password cannot be empty - + Password - + Input Password - + Username - + User name input error! - + login - + + Login - - - - + + Guest + Misafir + + + + + + Failed to verify %1, please enter password to unlock - - - - - + + + + + Unable to verify %1, please enter password to unlock - - + + Failed to verify %1, you still have %2 verification opportunities - + Abnormal network - + Face recognition waiting time out, please click refresh or enter the password to unlock. - + FingerPrint Parmak İzi - + FingerVein - + Iris Göz - + Face Yüz - + VoicePrint Ses İzi - + Ukey - + QRCode @@ -312,31 +318,35 @@ BlockWidget + + Cancel + + Confrim - + The following program is running to prevent the system from reboot! - + The following program is running to prevent the system from shutting down! - + The following program is running to prevent the system from suspend! - + The following program is running to prevent the system from hibernate! @@ -352,17 +362,18 @@ CharsWidget - + + More - + ABC - + 123 @@ -587,17 +598,17 @@ LightDMHelper - + failed to start session. - + Login - + Guest Misafir @@ -621,7 +632,7 @@ Kullanıcı Değiştir - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -688,12 +699,12 @@ MyNetworkWidget - + LAN - + WLAN @@ -701,12 +712,13 @@ NumbersWidget - + &&?! - + + Return @@ -887,6 +899,21 @@ + + UserListWidget + + + + Login + + + + + + Guest + Misafir + + Widget @@ -1002,12 +1029,12 @@ - + Backend for the ukui ScreenSaver. - + lock the screen by startup diff --git a/i18n_ts/ug.ts b/i18n_ts/ug.ts index 34c49ad..79732f2 100644 --- a/i18n_ts/ug.ts +++ b/i18n_ts/ug.ts @@ -24,7 +24,7 @@ 使用密码认证 - + Retry قايتا قايتا تىرشىش @@ -53,125 +53,130 @@ 账户锁定%1分钟由于%2次错误尝试 - + Please try again in %1 minutes. ٪1 مىنۇت ئىچىدە قايتا سىناپ بېقىڭ. - + Please try again in %1 seconds. ٪1 سېكۇنت ئىچىدە قايتا سىناپ بېقىڭ. - + Account locked permanently. ھېسابات مەڭگۈلۈك قۇلۇپلىنىدۇ. - - + + Verify face recognition or enter password to unlock چىراي تونۇشنى دەلىللەش ياكى مەخپىي نومۇر كىرگۈزۈش ئارقىلىق قۇلۇپ ئېچىش - + + Guest + 游客 + + + Press fingerprint or enter password to unlock بارماق ئىزىنى بېسىش ياكى مەخپىي نومۇر كىرگۈزۈش ئارقىلىق قۇلۇپ ئېچىش - + Verify voiceprint or enter password to unlock ئاۋاز ئىزىنى دەلىللەش ياكى مەخپىي نومۇر كىرگۈزۈش ئارقىلىق قۇلۇپ ئېچىش - + Verify finger vein or enter password to unlock بارماق تومۇرىنى ئېنىقلاش ياكى مەخپىي نومۇر كىرگۈزۈش ئارقىلىق قۇلۇپ ئېچىش - + Verify iris or enter password to unlock Iris نى ئېنىقلاش ياكى مەخپىي نومۇر كىرگۈزۈش ئارقىلىق قۇلۇپ ئېچىش - + Input Password ئىم كىرگۈزۈش - + Username ئىشلەتكۈچى نامى - + User name input error! - + login - - - - + + + + Failed to verify %1, please enter password to unlock ٪1 نى دەلىللەش مەغلۇپ بولدى، مەخپى نۇمۇر كىرگۈزۈڭ - - - - - + + + + + Unable to verify %1, please enter password to unlock ٪1 نى دەلىللەشكە ئامالسىز، مەخپىي نومۇرنى كىرگۈزۈپ قۇلۇپنى ئاچ - + Abnormal network بىنورمال تور - + Face recognition waiting time out, please click refresh or enter the password to unlock. - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey - + QRCode QRCode @@ -180,8 +185,8 @@ 使用绑定的微信扫码或输入密码登录 - - + + Password cannot be empty مەخپىي نومۇرنى بوش قويۇشقا بولمايدۇ @@ -194,8 +199,8 @@ 无法验证%1,请输入密码. - - + + Failed to verify %1, you still have %2 verification opportunities ٪1 نى دەلىللەش مەغلۇپ بولدى، سىزدە يەنىلا ٪2 دەلىللەش پۇرسىتى بار @@ -224,23 +229,24 @@ 请输入密码或者录入指纹 - - + + Authentication failure, Please try again دەلىللەش مەغلۇپ بولدى، قايتا سىناپ بېقىڭ - + Use the bound wechat scanning code or enter the password to unlock باغلانغان ئۈندىدارنى سىكاننېرلاش كودى ياكى مەخپىي نومۇرىنى كىرگۈزۈپ قۇلۇپ ئېچىش - + Password ئىم - + + Login كىرىش @@ -360,31 +366,35 @@ BlockWidget + + Cancel ئەمەلدىن قالدۇرۇش + + Confrim - + The following program is running to prevent the system from reboot! سېستىمىنىڭ قايتا قوزغىلىشىنىڭ ئالدىنى ئېلىش ئۈچۈن تۆۋەندىكى پروگرامما ئىجرا بولىۋاتىدۇ! - + The following program is running to prevent the system from shutting down! تۆۋەندىكى پروگرامما سىستېمىنىڭ تاقىلىپ قېلىشىنىڭ ئالدىنى ئېلىش ئۈچۈن يۈگۈرۈۋاتىدۇ! - + The following program is running to prevent the system from suspend! سېستىمىنىڭ توختىشىنىڭ ئالدىنى ئېلىش ئۈچۈن تۆۋەندىكى پروگرامما ئىجرا قىلىنىۋاتىدۇ! - + The following program is running to prevent the system from hibernate! سېستىمىنىڭ تىزگىنلەپ قېلىشىنىڭ ئالدىنى ئېلىش ئۈچۈن تۆۋەندىكى پروگرامما ئىجرا بولىۋاتىدۇ! @@ -400,17 +410,18 @@ CharsWidget - + + More - + ABC - + 123 @@ -1863,17 +1874,17 @@ LightDMHelper - + failed to start session. - + Login كىرىش - + Guest 游客 @@ -1901,7 +1912,7 @@ بىرلا ۋاقىتتا كۆپ ئابونت تىزىملىتىپ كىرىدۇ. سىز بۇ سىستېمىنى قايتىدىن قوزغىماقچى ئىكەنلىكىڭىزنى جەزىملەشتۈرەلەمسىز؟ - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -1979,12 +1990,12 @@ MyNetworkWidget - + LAN LAN - + WLAN WLAN @@ -1992,12 +2003,13 @@ NumbersWidget - + &&?! - + + Return @@ -2306,72 +2318,6 @@ - this is only shown for laptops with multiple batteries - - - - - - this is only shown for laptops with multiple batteries - - - - - - laptop primary battery - - - - - - battery-backed AC power source - - - - - - a monitor is a device to measure voltage and current - - - - - - wireless mice with internal batteries - - - - - - wireless keyboard with internal battery - - - - - - portable device - - - - - - cell phone (mobile...) - - - - - - media player, mp3 etc - - - - - - tablet device - - - - - tablet device @@ -2521,6 +2467,21 @@ ئاتلاندۇق + + UserListWidget + + + + Login + كىرىش + + + + + Guest + 游客 + + Utils @@ -2692,12 +2653,12 @@ كۆزنەك id - + Backend for the ukui ScreenSaver. - + lock the screen by startup diff --git a/i18n_ts/zh_CN.ts b/i18n_ts/zh_CN.ts index f4c87a6..888064f 100644 --- a/i18n_ts/zh_CN.ts +++ b/i18n_ts/zh_CN.ts @@ -24,7 +24,7 @@ 使用密码认证 - + Retry 重试 @@ -46,132 +46,137 @@ Password: - 密码: + 密码: Account locked %1 minutes due to %2 fail attempts 账户锁定%1分钟由于%2次错误尝试 - + Please try again in %1 minutes. 请%1分钟后再试 - + Please try again in %1 seconds. 请%1秒后再试 - + Account locked permanently. 账号已被永久锁定 - - + + Verify face recognition or enter password to unlock 验证人脸识别或输入密码解锁 - + + Guest + 游客 + + + Press fingerprint or enter password to unlock 按压指纹或输入密码解锁 - + Verify voiceprint or enter password to unlock 验证声纹或输入密码解锁 - + Verify finger vein or enter password to unlock 验证指静脉或输入密码解锁 - + Verify iris or enter password to unlock 验证虹膜或输入密码解锁 - + Input Password 输入密码 - + Username 用户名: - + User name input error! 用户名输入错误 - + login 登录 - - - - + + + + Failed to verify %1, please enter password to unlock 验证%1失败,请输入密码解锁 - - - - - + + + + + Unable to verify %1, please enter password to unlock 无法验证%1,请输入密码解锁 - + Abnormal network 网络异常 - + Face recognition waiting time out, please click refresh or enter the password to unlock. 人脸识别等待超时,请点击刷新或输入密码解锁 - + FingerPrint 指纹 - + FingerVein 指静脉 - + Iris 虹膜 - + Face 人脸识别 - + VoicePrint 声纹 - + Ukey 安全密钥 - + QRCode 二维码 @@ -180,8 +185,8 @@ 使用绑定的微信扫码或输入密码登录 - - + + Password cannot be empty 密码不能为空 @@ -194,8 +199,8 @@ 无法验证%1,请输入密码. - - + + Failed to verify %1, you still have %2 verification opportunities 验证%1失败,您还有%2次尝试机会 @@ -224,13 +229,13 @@ 请输入密码或者录入指纹 - - + + Authentication failure, Please try again 认证失败,请重试 - + Use the bound wechat scanning code or enter the password to unlock 使用绑定的微信扫码或输入密码解锁 @@ -243,12 +248,13 @@ 请将安全密钥插入USB端口 - + Password 密码 - + + Login 登录 @@ -368,31 +374,35 @@ BlockWidget + + Cancel 取消 + + Confrim 确认 - + The following program is running to prevent the system from reboot! 以下程序正在运行,阻止系统重启! - + The following program is running to prevent the system from shutting down! 以下程序正在运行,阻止系统关机! - + The following program is running to prevent the system from suspend! 以下程序正在运行,阻止系统进入睡眠! - + The following program is running to prevent the system from hibernate! 以下程序正在运行,阻止系统进入休眠! @@ -408,17 +418,18 @@ CharsWidget - + + More 更多 - + ABC - + 123 @@ -1867,19 +1878,19 @@ LightDMHelper - + failed to start session. - + 启动会话失败。 - + Login - 登录 + 登录 - + Guest - 游客 + 游客 @@ -1910,7 +1921,7 @@ Multiple users are logged in at the same time.Are you sure you want to reboot this system? - 同时有多个用户登录系统,您确定要退出系统吗? + 同时有多个用户登录系统,您确定要退出系统吗? LAN @@ -1921,9 +1932,9 @@ 无线局域网 - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? - + 同时有多个用户处于登录状态,你确定要%1吗? @@ -1947,37 +1958,37 @@ FingerPrint - 指纹 + 指纹 FingerVein - 指静脉 + 指静脉 Iris - 虹膜 + 虹膜 Face - + 人脸识别 VoicePrint - 声纹 + 声纹 Ukey - 安全密钥 + 安全密钥 QRCode - 二维码 + 二维码 Wechat @@ -1999,25 +2010,26 @@ MyNetworkWidget - + LAN - 有线网络 + 有线网络 - + WLAN - 无线局域网 + 无线局域网 NumbersWidget - + &&?! - + + Return 返回 @@ -2176,7 +2188,7 @@ Hibernate - 休眠 + 休眠 @@ -2186,7 +2198,7 @@ Suspend - 睡眠 + 睡眠 @@ -2197,12 +2209,12 @@ Restart - 重启 + 重启 Power Off - 关机 + 关机 @@ -2315,7 +2327,7 @@ Face - + 人脸识别 @@ -2483,6 +2495,21 @@ 跳过 + + UserListWidget + + + + Login + 登录 + + + + + Guest + 游客 + + Utils @@ -2557,7 +2584,7 @@ how long to show lock - + 多久显示锁屏 @@ -2565,7 +2592,7 @@ if show lock - + 是否锁屏 @@ -2654,12 +2681,12 @@ - + Backend for the ukui ScreenSaver. - + lock the screen by startup diff --git a/i18n_ts/zh_HK.ts b/i18n_ts/zh_HK.ts index 494e927..1303bac 100644 --- a/i18n_ts/zh_HK.ts +++ b/i18n_ts/zh_HK.ts @@ -24,7 +24,7 @@ 使用密码认证 - + Retry 重試 @@ -53,125 +53,130 @@ 账户锁定%1分钟由于%2次错误尝试 - + Please try again in %1 minutes. 請在 %1 分鐘後重試。 - + Please try again in %1 seconds. 請在 %1 秒後重試。 - + Account locked permanently. 帳戶永久鎖定。 - - + + Verify face recognition or enter password to unlock 驗證人臉識別或輸入密碼解鎖 - + + Guest + 游客 + + + Press fingerprint or enter password to unlock 按指紋或輸入密碼解鎖 - + Verify voiceprint or enter password to unlock 驗證聲紋或輸入密碼以解鎖 - + Verify finger vein or enter password to unlock 驗證指靜脈或輸入密碼解鎖 - + Verify iris or enter password to unlock 驗證虹膜或輸入密碼解鎖 - + Input Password 輸入密碼 - + Username 使用者名 - + User name input error! - + login - - - - + + + + Failed to verify %1, please enter password to unlock 驗證 %1 失敗,請輸入密碼進行解鎖 - - - - - + + + + + Unable to verify %1, please enter password to unlock 無法驗證 %1,請輸入密碼進行解鎖 - + Abnormal network 網路異常 - + Face recognition waiting time out, please click refresh or enter the password to unlock. - + FingerPrint - + FingerVein - + Iris 虹膜 - + Face - + VoicePrint - + Ukey - + QRCode 微信掃碼 @@ -180,8 +185,8 @@ 使用绑定的微信扫码或输入密码登录 - - + + Password cannot be empty 密碼不能為空 @@ -194,8 +199,8 @@ 无法验证%1,请输入密码. - - + + Failed to verify %1, you still have %2 verification opportunities 驗證 %1 失敗,您仍有 %2 次驗證機會 @@ -224,13 +229,13 @@ 请输入密码或者录入指纹 - - + + Authentication failure, Please try again 身份驗證失敗,請重試 - + Use the bound wechat scanning code or enter the password to unlock 使用綁定的微信掃碼或輸入密碼解鎖 @@ -243,12 +248,13 @@ 將 Ukey 插入 USB 埠 - + Password 密碼 - + + Login 登錄 @@ -368,31 +374,35 @@ BlockWidget + + Cancel 取消 + + Confrim - + The following program is running to prevent the system from reboot! 以下程式正在運行以防止系統重新啟動! - + The following program is running to prevent the system from shutting down! 以下程式正在運行以防止系統關閉! - + The following program is running to prevent the system from suspend! 以下程式正在運行以防止系統掛起! - + The following program is running to prevent the system from hibernate! 以下程式正在運行以防止系統休眠! @@ -408,17 +418,18 @@ CharsWidget - + + More 更多 - + ABC 美國廣播公司 - + 123 123 @@ -1883,17 +1894,17 @@ LightDMHelper - + failed to start session. - + Login 登錄 - + Guest 游客 @@ -1937,7 +1948,7 @@ 無線局域網 - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -2015,12 +2026,12 @@ MyNetworkWidget - + LAN 局域網 - + WLAN 無線局域網 @@ -2028,12 +2039,13 @@ NumbersWidget - + &&?! &&?! - + + Return 返回 @@ -2507,6 +2519,21 @@ + + UserListWidget + + + + Login + 登錄 + + + + + Guest + 游客 + + Utils @@ -2678,12 +2705,12 @@ 窗口標識 - + Backend for the ukui ScreenSaver. - + lock the screen by startup diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2c6f650..268446d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -153,7 +153,7 @@ set(backend_SRC dbusifs/upowerhelper.cpp dbusifs/enginedevice.cpp dbusifs/device.cpp - dbusifs/accountservicehelper.cpp + dbusifs/accountshelper.cpp dbusifs/sessionhelper.cpp dbusifs/uniauthservice.cpp dbusifs/biometrichelper.cpp diff --git a/src/VirtualKeyboard/src/charswidget.cpp b/src/VirtualKeyboard/src/charswidget.cpp index c66597f..2e3fe6d 100644 --- a/src/VirtualKeyboard/src/charswidget.cpp +++ b/src/VirtualKeyboard/src/charswidget.cpp @@ -18,6 +18,7 @@ #include "charswidget.h" #include "commondef.h" +#include #include CharsWidget::CharsWidget(QWidget *parent/* = nullptr*/) @@ -253,3 +254,25 @@ void CharsWidget::onBtnClicked(QChar charId) Q_EMIT specialBtnClicked(keyName); } } + + +void CharsWidget::changeEvent(QEvent *event) +{ + if(event->type() == QEvent::LanguageChange){ + refreshTranslate(); + } +} + +void CharsWidget::refreshTranslate() +{ + QMap::iterator itGeometry = m_mapBtnGeometrys.begin(); + for (; itGeometry != m_mapBtnGeometrys.end(); itGeometry ++) { + KBButton *button = itGeometry.key(); + if (button) { + if (button->objectName() == "btn_more") { + button->setText(tr("More")); + } + } + } +} + diff --git a/src/VirtualKeyboard/src/charswidget.h b/src/VirtualKeyboard/src/charswidget.h index 1076201..b7fd805 100644 --- a/src/VirtualKeyboard/src/charswidget.h +++ b/src/VirtualKeyboard/src/charswidget.h @@ -39,8 +39,12 @@ Q_SIGNALS: void specialBtnClicked(QString keyName); void normalBtnClicked(QChar c); +protected: + void changeEvent(QEvent *event); + private: void initUI(); + void refreshTranslate(); private: QMap m_mapBtnGeometrys; diff --git a/src/VirtualKeyboard/src/numberswidget.cpp b/src/VirtualKeyboard/src/numberswidget.cpp index a09de13..5d776d5 100644 --- a/src/VirtualKeyboard/src/numberswidget.cpp +++ b/src/VirtualKeyboard/src/numberswidget.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include NumbersWidget::NumbersWidget(QWidget *parent) @@ -291,3 +292,23 @@ void NumbersWidget::onBtnClicked(QChar charId) Q_EMIT specialBtnClicked(keyName); } } + +void NumbersWidget::changeEvent(QEvent *event) +{ + if(event->type() == QEvent::LanguageChange){ + refreshTranslate(); + } +} + +void NumbersWidget::refreshTranslate() +{ + QMap::iterator itGeometry = m_mapBtnGeometrys.begin(); + for (; itGeometry != m_mapBtnGeometrys.end(); itGeometry ++) { + KBButton *button = qobject_cast(itGeometry.key()); + if (button) { + if (button->objectName() == "btn_return") { + button->setText(tr("Return")); + } + } + } +} diff --git a/src/VirtualKeyboard/src/numberswidget.h b/src/VirtualKeyboard/src/numberswidget.h index bea0f28..0e359ab 100644 --- a/src/VirtualKeyboard/src/numberswidget.h +++ b/src/VirtualKeyboard/src/numberswidget.h @@ -42,8 +42,12 @@ Q_SIGNALS: void specialBtnClicked(QString keyName); void narmalBtnClicked(QChar charId); +protected: + void changeEvent(QEvent *event); + private: void initUI(); + void refreshTranslate(); private: QMap m_mapBtnGeometrys; diff --git a/src/VirtualKeyboard/src/virtualkeyboardwidget.cpp b/src/VirtualKeyboard/src/virtualkeyboardwidget.cpp index f96c688..66f108a 100644 --- a/src/VirtualKeyboard/src/virtualkeyboardwidget.cpp +++ b/src/VirtualKeyboard/src/virtualkeyboardwidget.cpp @@ -41,7 +41,7 @@ VirtualKeyboardWidget::VirtualKeyboardWidget(QWidget *parent) , m_isVertical(false) { Q_INIT_RESOURCE(keyboard); - setAttribute(Qt::WA_TranslucentBackground);//背景透明 + //setAttribute(Qt::WA_TranslucentBackground);//背景透明 //setAutoFillBackground(true); setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | diff --git a/src/common/configuration.h b/src/common/configuration.h index 4c9f991..4d109b9 100644 --- a/src/common/configuration.h +++ b/src/common/configuration.h @@ -21,7 +21,6 @@ #include #include -#include #include #include diff --git a/src/common/definetypes.h b/src/common/definetypes.h index a04bf8e..cc08b1f 100644 --- a/src/common/definetypes.h +++ b/src/common/definetypes.h @@ -203,6 +203,7 @@ enum SessionStatus #define DM_DBUS_PATH "/org/freedesktop/DisplayManager" #define DM_DBUS_INTERFACE "org.freedesktop.DisplayManager" #define DM_SEAT_INTERFACE "org.freedesktop.DisplayManager.Seat" +#define DM_SESSION_INTERFACE "org.freedesktop.DisplayManager.Session" #define SSWND_DBUS_SERVICE "org.ukui.ScreenSaverWnd" #define SSWND_DBUS_PATH "/" @@ -310,5 +311,13 @@ typedef enum { #define FD_DBUS_SERVICE "org.freedesktop.DBus" #define FD_DBUS_PATH "/org/freedesktop/DBus" #define FD_DBUS_INTERFACE "org.freedesktop.DBus" +#define FD_PROPERTIES_INTERFACE "org.freedesktop.DBus.Properties" + +#define ACCOUNTS_DBUS_SERVICE "org.freedesktop.Accounts" +#define ACCOUNTS_DBUS_PATH "/org/freedesktop/Accounts" +#define ACCOUNTS_DBUS_INTERFACE "org.freedesktop.Accounts" + +#define ACCOUNTS_USER_DBUS_INTERFACE "org.freedesktop.Accounts.User" +#define ACCOUNTS_USER_LDM_SERVICE_INTERFACE "org.freedesktop.DisplayManager.AccountsService" #endif // DEFINETYPES_H diff --git a/src/dbusifs/accountservicehelper.cpp b/src/dbusifs/accountshelper.cpp similarity index 56% rename from src/dbusifs/accountservicehelper.cpp rename to src/dbusifs/accountshelper.cpp index a7c426d..f6462e4 100644 --- a/src/dbusifs/accountservicehelper.cpp +++ b/src/dbusifs/accountshelper.cpp @@ -15,34 +15,27 @@ * along with this program; if not, see . * **/ -#include "accountservicehelper.h" +#include "accountshelper.h" +#include "definetypes.h" #include #include #include #include +#include "userinfo.h" -const static QString accountsService = QStringLiteral("org.freedesktop.Accounts"); -const static QString accountsPath = QStringLiteral("/org/freedesktop/Accounts"); -const static QString accountsInterface = QStringLiteral("org.freedesktop.Accounts"); -const static QString propertiesInterface = QStringLiteral("org.freedesktop.DBus.Properties"); -const static QString accountsUserInterface = QStringLiteral("org.freedesktop.Accounts.User"); - -AccountServiceHelper::AccountServiceHelper(QObject *parent) +AccountsHelper::AccountsHelper(QObject *parent) : QObject(parent) { - m_accountsInterface = new QDBusInterface(accountsService, - accountsPath, - accountsInterface, - QDBusConnection::systemBus(), - this); + initData(); + initConnections(); } -AccountServiceHelper::~AccountServiceHelper() +AccountsHelper::~AccountsHelper() { } -QString AccountServiceHelper::getUserLanguageByName(QString strUserName) +QString AccountsHelper::getUserLanguageByName(QString strUserName) { QString strLanguage = ""; if(!m_accountsInterface) @@ -51,9 +44,9 @@ QString AccountServiceHelper::getUserLanguageByName(QString strUserName) if(!userPath.isValid()) qWarning() << "Get UserPath error:" << userPath.error(); else { - QDBusInterface userIface(accountsService, userPath.value().path(), - propertiesInterface, QDBusConnection::systemBus()); - QDBusReply languageReply = userIface.call("Get", accountsUserInterface, "Language"); + QDBusInterface userIface(ACCOUNTS_DBUS_SERVICE, userPath.value().path(), + FD_PROPERTIES_INTERFACE, QDBusConnection::systemBus()); + QDBusReply languageReply = userIface.call("Get", ACCOUNTS_USER_DBUS_INTERFACE, "Language"); if(!languageReply.isValid()) qWarning() << "Get User's language error" << languageReply.error(); else { @@ -63,7 +56,7 @@ QString AccountServiceHelper::getUserLanguageByName(QString strUserName) return strLanguage; } -QString AccountServiceHelper::getUserBackgroundByName(QString strUserName) +QString AccountsHelper::getUserBackgroundByName(QString strUserName) { QString strBackground = ""; if(!m_accountsInterface) @@ -72,9 +65,9 @@ QString AccountServiceHelper::getUserBackgroundByName(QString strUserName) if(!userPath.isValid()) qWarning() << "Get UserPath error:" << userPath.error(); else { - QDBusInterface userIface(accountsService, userPath.value().path(), - propertiesInterface, QDBusConnection::systemBus()); - QDBusReply backgroundReply = userIface.call("Get", accountsUserInterface, "BackgroundFile"); + QDBusInterface userIface(ACCOUNTS_DBUS_SERVICE, userPath.value().path(), + FD_PROPERTIES_INTERFACE, QDBusConnection::systemBus()); + QDBusReply backgroundReply = userIface.call("Get", ACCOUNTS_USER_DBUS_INTERFACE, "BackgroundFile"); if(!backgroundReply.isValid()) qWarning() << "Get User's background error" << backgroundReply.error(); else { @@ -84,7 +77,7 @@ QString AccountServiceHelper::getUserBackgroundByName(QString strUserName) return strBackground; } -QString AccountServiceHelper::getUserSessionByName(QString strUserName) +QString AccountsHelper::getUserSessionByName(QString strUserName) { QString strSession = ""; if(!m_accountsInterface) @@ -93,9 +86,9 @@ QString AccountServiceHelper::getUserSessionByName(QString strUserName) if(!userPath.isValid()) qWarning() << "Get UserPath error:" << userPath.error(); else { - QDBusInterface userIface(accountsService, userPath.value().path(), - propertiesInterface, QDBusConnection::systemBus()); - QDBusReply sessionReply = userIface.call("Get", accountsUserInterface, "XSession"); + QDBusInterface userIface(ACCOUNTS_DBUS_SERVICE, userPath.value().path(), + FD_PROPERTIES_INTERFACE, QDBusConnection::systemBus()); + QDBusReply sessionReply = userIface.call("Get", ACCOUNTS_USER_DBUS_INTERFACE, "XSession"); if(!sessionReply.isValid()) qWarning() << "Get User's xsession error" << sessionReply.error(); else { @@ -105,7 +98,7 @@ QString AccountServiceHelper::getUserSessionByName(QString strUserName) return strSession; } -QString AccountServiceHelper::getAccountBackground(uid_t uid) +QString AccountsHelper::getAccountBackground(uid_t uid) { QString strBackground = ""; if(!m_accountsInterface) @@ -114,9 +107,9 @@ QString AccountServiceHelper::getAccountBackground(uid_t uid) if(!userPath.isValid()) qWarning() << "Get UserPath error:" << userPath.error(); else { - QDBusInterface userIface(accountsService, userPath.value().path(), - propertiesInterface, QDBusConnection::systemBus()); - QDBusReply backgroundReply = userIface.call("Get", accountsUserInterface, "BackgroundFile"); + QDBusInterface userIface(ACCOUNTS_DBUS_SERVICE, userPath.value().path(), + FD_PROPERTIES_INTERFACE, QDBusConnection::systemBus()); + QDBusReply backgroundReply = userIface.call("Get", ACCOUNTS_USER_DBUS_INTERFACE, "BackgroundFile"); if(!backgroundReply.isValid()) qWarning() << "Get User's BackgroundFile error" << backgroundReply.error(); else { @@ -125,3 +118,39 @@ QString AccountServiceHelper::getAccountBackground(uid_t uid) } return strBackground; } + +void AccountsHelper::initData() +{ + if (!m_accountsInterface) { + m_accountsInterface = new QDBusInterface(ACCOUNTS_DBUS_SERVICE, + ACCOUNTS_DBUS_PATH, + ACCOUNTS_DBUS_INTERFACE, + QDBusConnection::systemBus(), + this); + } +} + +void AccountsHelper::initConnections() +{ + connect(m_accountsInterface, SIGNAL(UserAdded(QDBusObjectPath)), this, SIGNAL(UserAdded(QDBusObjectPath))); + connect(m_accountsInterface, SIGNAL(UserDeleted(QDBusObjectPath)), this, SIGNAL(UserRemoved(QDBusObjectPath))); +} + +QStringList AccountsHelper::getUserList() +{ + QStringList listUsers; + if (!m_accountsInterface) + return listUsers; + QDBusMessage ret = m_accountsInterface->call("ListCachedUsers"); + QList outArgs = ret.arguments(); + QVariant first = outArgs.at(0); + const QDBusArgument &dbusArgs = first.value(); + QDBusObjectPath path; + dbusArgs.beginArray(); + while (!dbusArgs.atEnd()) { + dbusArgs >> path; + listUsers << path.path(); + } + dbusArgs.endArray(); + return listUsers; +} diff --git a/src/dbusifs/accountservicehelper.h b/src/dbusifs/accountshelper.h similarity index 75% rename from src/dbusifs/accountservicehelper.h rename to src/dbusifs/accountshelper.h index 74fb23b..daae4e0 100644 --- a/src/dbusifs/accountservicehelper.h +++ b/src/dbusifs/accountshelper.h @@ -20,14 +20,16 @@ #include #include +#include +#include -class AccountServiceHelper : public QObject +class AccountsHelper : public QObject { Q_OBJECT public: - explicit AccountServiceHelper(QObject *parent = nullptr); + explicit AccountsHelper(QObject *parent = nullptr); - virtual ~AccountServiceHelper(); + virtual ~AccountsHelper(); QString getUserLanguageByName(QString strUserName); @@ -37,6 +39,16 @@ public: QString getAccountBackground(uid_t uid); + QStringList getUserList(); + +Q_SIGNALS: + void UserAdded(const QDBusObjectPath &path); + void UserRemoved(const QDBusObjectPath &path); + +private: + void initData(); + void initConnections(); + private: QDBusInterface *m_accountsInterface = nullptr; }; diff --git a/src/lock-backend/dbusupperinterface.cpp b/src/lock-backend/dbusupperinterface.cpp index f081ea9..6443d72 100644 --- a/src/lock-backend/dbusupperinterface.cpp +++ b/src/lock-backend/dbusupperinterface.cpp @@ -33,7 +33,7 @@ #include "switchuserutils.h" #include "pamauthenticate.h" #include "upowerhelper.h" -#include "accountservicehelper.h" +#include "accountshelper.h" #include "sessionhelper.h" #include "sessionwatcher.h" #include "freedesktophelper.h" @@ -56,7 +56,7 @@ void DbusUpperInterface::initData() { m_bLockState = false; m_bSlpState = false; - m_accountsHelper = new AccountServiceHelper(this); + m_accountsHelper = new AccountsHelper(this); m_lightDmHelper = new LightDMHelper(m_accountsHelper, this); m_login1Helper = new Login1Helper(this); m_config = new Configuration(this); diff --git a/src/lock-backend/dbusupperinterface.h b/src/lock-backend/dbusupperinterface.h index 892f9db..42c046b 100644 --- a/src/lock-backend/dbusupperinterface.h +++ b/src/lock-backend/dbusupperinterface.h @@ -37,7 +37,7 @@ class QJsonObject; class PamAuthenticate; class UsdHelper; class UpowerHelper; -class AccountServiceHelper; +class AccountsHelper; class SessionHelper; class SessionWatcher; class BioAuthenticate; @@ -381,7 +381,7 @@ private: PamAuthenticate *m_pamAuth = nullptr; UsdHelper *m_usdHelper = nullptr; UpowerHelper *m_upowerHelper = nullptr; - AccountServiceHelper *m_accountsHelper = nullptr; + AccountsHelper *m_accountsHelper = nullptr; bool lockState = false; SessionHelper *m_sessionHelper = nullptr; SessionWatcher *m_sessionWatcher = nullptr; diff --git a/src/lock-backend/lightdmhelper.cpp b/src/lock-backend/lightdmhelper.cpp index 6c50c53..5c1012a 100644 --- a/src/lock-backend/lightdmhelper.cpp +++ b/src/lock-backend/lightdmhelper.cpp @@ -22,14 +22,21 @@ #include "securityuser.h" #include #include "proxymodel.h" -#include "accountservicehelper.h" +#include "accountshelper.h" +#include "definetypes.h" +#include +#include +#include -LightDMHelper::LightDMHelper(AccountServiceHelper *accountHelper, QObject *parent) +LightDMHelper::LightDMHelper(AccountsHelper *accountHelper, QObject *parent) : QLightDM::Greeter(parent) , m_sessionsModel(nullptr) , m_secUser(SecurityUser::instance()) , m_strCurUserName("") , m_accountServiceHelper(accountHelper) + , m_ldmSessions(new QMap>()) + , m_mapUsers(new QMap()) + , m_dbusIfsLDM(nullptr) { //连接到lightdm if(!connectToDaemonSync()){ @@ -46,11 +53,10 @@ void LightDMHelper::initData() updateSessionsInfo(); setSession(defaultSessionHint()); // 获取用户信息 + initLDMSessionsInfo(); m_isShowManualLogin = showManualLoginHint(); if(!hideUsersHint()){ - m_modelUsers = new UsersModel(this); - m_modelUsers->setSourceModel(new QLightDM::UsersModel(this)); - connect(m_modelUsers, &UsersModel::userInfoChanged, this, &LightDMHelper::onUsersChanged); + initAccountsUsersInfo(); if(hasValidUsers() == 0) { m_isShowManualLogin = true; } @@ -127,7 +133,7 @@ bool LightDMHelper::setCurrentUser(QString strUserName) UserInfoPtr LightDMHelper::findUserByUid(uid_t id) { - for (auto userInfoPtr : m_listUsers) { + for (auto userInfoPtr : m_mapUsers->values()) { if (userInfoPtr->uid() == id) { return userInfoPtr; } @@ -137,7 +143,7 @@ UserInfoPtr LightDMHelper::findUserByUid(uid_t id) UserInfoPtr LightDMHelper::findUserByName(QString strName) { - for (auto userInfoPtr : m_listUsers) { + for (auto userInfoPtr : m_mapUsers->values()) { if (userInfoPtr->name() == strName) { return userInfoPtr; } @@ -147,7 +153,7 @@ UserInfoPtr LightDMHelper::findUserByName(QString strName) bool LightDMHelper::hasSameUser(const UserInfoPtr userInfoPtr) { - for (auto user : m_listUsers) { + for (auto user : m_mapUsers->values()) { if (user->uid() == userInfoPtr->uid() && user->name() == userInfoPtr->name()) { return true; @@ -158,12 +164,9 @@ bool LightDMHelper::hasSameUser(const UserInfoPtr userInfoPtr) bool LightDMHelper::hasValidUsers() { - if (!m_modelUsers) - return false; int count = 0; - for(int i = 0; i < m_modelUsers->rowCount(QModelIndex()); i++){ - QString name = m_modelUsers->index(i).data(QLightDM::UsersModel::NameRole).toString(); - if(m_secUser->isSecrityUser(name)) + for (auto user : m_mapUsers->values()) { + if(m_secUser->isSecrityUser(user->name())) count++; } return (bool)(count>0); @@ -182,51 +185,18 @@ bool LightDMHelper::isSameUser(UserInfoPtr userA, UserInfoPtr userB) void LightDMHelper::onUsersChanged() { - if (!m_modelUsers) - return ; updateUsersInfo(); Q_EMIT usersInfoChanged(); } void LightDMHelper::updateUsersInfo() { - m_listUsers.clear(); - if (m_modelUsers) { - for(int i = 0; i < m_modelUsers->rowCount(QModelIndex()); i++){ - QString name = m_modelUsers->index(i).data(QLightDM::UsersModel::NameRole).toString(); - if(m_secUser->isSecrityUser(name)) { - std::shared_ptr userInfoPtr = std::make_shared(); - userInfoPtr->updateName(name); - uid_t uid = m_modelUsers->index(i).data(QLightDM::UsersModel::UidRole).toUInt(); - userInfoPtr->updateUid(uid); - QString strRealName = m_modelUsers->index(i).data(QLightDM::UsersModel::RealNameRole).toString(); - if (strRealName.isEmpty()) { - strRealName = name; - } - userInfoPtr->updateFullName(strRealName); - QString strBackGround = m_modelUsers->index(i).data(QLightDM::UsersModel::BackgroundPathRole).toString(); - if (!strBackGround.isEmpty() && QFileInfo(strBackGround).exists()){ - userInfoPtr->updateBackground(strBackGround); - } else { - if (m_accountServiceHelper) { - strBackGround = m_accountServiceHelper->getAccountBackground(uid); - if (!strBackGround.isEmpty() && QFileInfo(strBackGround).exists()){ - userInfoPtr->updateBackground(strBackGround); - } - } - } - QString strImgHead = m_modelUsers->index(i).data(QLightDM::UsersModel::ImagePathRole).toString(); - if (!strImgHead.isEmpty() && QFileInfo(strImgHead).exists()){ - userInfoPtr->updateHeadImage(strImgHead); - } - - bool isLoggedIn = m_modelUsers->index(i).data(QLightDM::UsersModel::LoggedInRole).toBool(); - userInfoPtr->updateLoggedIn(isLoggedIn); - - if (!hasSameUser(userInfoPtr)) { - m_listUsers.append(userInfoPtr); - } - } + QList userInfos = m_mapUsers->values(); + for (auto user : userInfos) { + if (isUserLoggined(user->name())) { + user->updateLoggedIn(true); + } else { + user->updateLoggedIn(false); } } if (m_isShowManualLogin) { @@ -234,7 +204,8 @@ void LightDMHelper::updateUsersInfo() userInfoPtr->updateFullName(tr("Login")); userInfoPtr->updateName("*login"); if (!hasSameUser(userInfoPtr)) { - m_listUsers.append(userInfoPtr); + const QString path = userInfoPtr->path().isEmpty() ? userInfoPtr->name() : userInfoPtr->path(); + m_mapUsers->insert(path, userInfoPtr); } } if (hasGuestAccountHint()) { @@ -242,7 +213,8 @@ void LightDMHelper::updateUsersInfo() userInfoPtr->updateFullName(tr("Guest")); userInfoPtr->updateName("*guest"); if (!hasSameUser(userInfoPtr)) { - m_listUsers.append(userInfoPtr); + const QString path = userInfoPtr->path().isEmpty() ? userInfoPtr->name() : userInfoPtr->path(); + m_mapUsers->insert(path, userInfoPtr); } } } @@ -261,5 +233,201 @@ void LightDMHelper::updateSessionsInfo() QList LightDMHelper::getUsersInfo() { - return m_listUsers; + return m_mapUsers->values(); +} + +bool LightDMHelper::isUserLoggined(const QString &strUserName) +{ + QList> sessionList = m_ldmSessions->values(); + auto it = std::find_if(sessionList.begin(), sessionList.end(), [strUserName](std::shared_ptr &session) { + return session->userName() == strUserName; + }); + if (it != sessionList.end()) { + return true; + } + return false; +} + +void LightDMHelper::initLDMSessionsInfo() +{ + if (!m_dbusIfsLDM) { + m_dbusIfsLDM = new QDBusInterface(DM_DBUS_SERVICE, DM_DBUS_PATH, DM_DBUS_INTERFACE, QDBusConnection::systemBus(), this); + connect(m_dbusIfsLDM, SIGNAL(SessionAdded(QDBusObjectPath)), this, SLOT(onLDMSessionAdded(QDBusObjectPath))); + connect(m_dbusIfsLDM, SIGNAL(SessionRemoved(QDBusObjectPath)), this, SLOT(onLDMSessionRemoved(QDBusObjectPath))); + + QStringList listSessions; + QDBusInterface ifLDMProp(DM_DBUS_SERVICE, DM_DBUS_PATH, FD_PROPERTIES_INTERFACE, QDBusConnection::systemBus()); + QDBusMessage ret = ifLDMProp.call("GetAll", DM_DBUS_INTERFACE); + QList outArgs = ret.arguments(); + QVariant first = outArgs.at(0); + const QDBusArgument &dbusArgs = first.value(); + dbusArgs.beginMap(); + while(!dbusArgs.atEnd()) { + QString key; + QVariant value; + dbusArgs.beginMapEntry(); + dbusArgs >> key >> value; + if (key == "Sessions") { + const QDBusArgument &dbusObjPaths = value.value(); + QDBusObjectPath path; + dbusObjPaths.beginArray(); + while (!dbusObjPaths.atEnd()) { + dbusObjPaths >> path; + listSessions << path.path(); + } + dbusObjPaths.endArray(); + } + dbusArgs.endMapEntry(); + } + dbusArgs.endMap(); + for (auto session : listSessions) { + std::shared_ptr ldmSessionInfo(new LightDMSessionInfo(session, this)); + m_ldmSessions->insert(session, ldmSessionInfo); + } + } +} + +void LightDMHelper::onLDMSessionAdded(QDBusObjectPath objPath) +{ + qDebug()<< "Add LDM Session, path:"<contains(objPath.path())) { + return; + } + std::shared_ptr ldmSessionInfo(new LightDMSessionInfo(objPath.path(), this)); + m_ldmSessions->insert(objPath.path(), ldmSessionInfo); + onUsersChanged(); +} + +void LightDMHelper::onLDMSessionRemoved(QDBusObjectPath objPath) +{ + if (!m_ldmSessions->contains(objPath.path())) { + return; + } + const std::shared_ptr session = m_ldmSessions->value(objPath.path()); + m_ldmSessions->remove(objPath.path()); + onUsersChanged(); +} + +void LightDMHelper::initAccountsUsersInfo() +{ + if (m_accountServiceHelper) { + QStringList listUsers = m_accountServiceHelper->getUserList(); + for (auto user : listUsers) { + LocalUserInfoPtr userInfo(new LocalUserInfo(user, this)); + connect(userInfo.get(), &UserInfo::userPropChanged, this, &LightDMHelper::onUsersChanged); + m_mapUsers->insert(user, userInfo); + } + connect(m_accountServiceHelper, SIGNAL(UserAdded(QDBusObjectPath)), this, SLOT(onUserAdded(QDBusObjectPath))); + connect(m_accountServiceHelper, SIGNAL(UserRemoved(QDBusObjectPath)), this, SLOT(onUserRemoved(QDBusObjectPath))); + } +} + +void LightDMHelper::onUserAdded(QDBusObjectPath objPath) +{ + qDebug()<< "Add Accounts User, path:"<contains(objPath.path())) { + return; + } + LocalUserInfoPtr userInfo(new LocalUserInfo(objPath.path(), this)); + connect(userInfo.get(), &UserInfo::userPropChanged, this, &LightDMHelper::onUsersChanged); + m_mapUsers->insert(objPath.path(), userInfo); + onUsersChanged(); +} + +void LightDMHelper::onUserRemoved(QDBusObjectPath objPath) +{ + if (!m_mapUsers->contains(objPath.path())) { + return; + } + const UserInfoPtr userInfo = m_mapUsers->value(objPath.path()); + qDebug()<< "Remove Accounts User, name:"<name(); + m_mapUsers->remove(objPath.path()); + onUsersChanged(); +} + +LightDMSessionInfo::LightDMSessionInfo(const QString &strPath, QObject* parent) + : QObject(parent) + , m_strPath(strPath) +{ + initData(); + initConnections(); +} + +LightDMSessionInfo::~LightDMSessionInfo() +{ + if (m_propertiesChangedConnected) { + QDBusConnection::systemBus().disconnect(DM_DBUS_SERVICE, + m_strPath, + FD_PROPERTIES_INTERFACE, + "PropertiesChanged", + this, + SLOT(onPropertiesChanged(QString, QVariantMap, QStringList))); + m_propertiesChangedConnected = false; + } +} + +void LightDMSessionInfo::initData() +{ + QDBusInterface ifaceExtra(DM_DBUS_SERVICE, m_strPath, FD_PROPERTIES_INTERFACE, QDBusConnection::systemBus()); + QDBusMessage ret = ifaceExtra.call("GetAll", DM_SESSION_INTERFACE); + QList outArgs = ret.arguments(); + QVariant first = outArgs.at(0); + const QDBusArgument &dbusArgs = first.value(); + dbusArgs.beginMap(); + while(!dbusArgs.atEnd()) { + QString key; + QVariant value; + dbusArgs.beginMapEntry(); + dbusArgs >> key >> value; + if (key == "Seat") { + m_strSeatPath = value.toString(); + } else if (key == "UserName") { + m_strUserName = value.toString(); + } + dbusArgs.endMapEntry(); + } + dbusArgs.endMap(); +} + +void LightDMSessionInfo::initConnections() +{ + if (!m_propertiesChangedConnected) { + QDBusConnection::systemBus().connect(DM_DBUS_SERVICE, + m_strPath, + FD_PROPERTIES_INTERFACE, + "PropertiesChanged", + this, + SLOT(onPropertiesChanged(QString, QVariantMap, QStringList))); + m_propertiesChangedConnected = true; + } +} + +void LightDMSessionInfo::onPropertiesChanged(const QString& interfaceName, + const QVariantMap& changedProperties, + const QStringList& invalidatedProperties) +{ + Q_UNUSED(invalidatedProperties); + if (interfaceName == DM_SESSION_INTERFACE) { + QVariantMap::const_iterator itVar = changedProperties.constBegin(); + for ( ; itVar != changedProperties.constEnd(); itVar++) { + QVariant varValue = itVar.value(); + if(itVar.key() == "Seat") { + m_strSeatPath = varValue.toString(); + } else if(itVar.key() == "UserName") { + m_strUserName = varValue.toString(); + } + } + } +} + +QDebug operator <<(QDebug stream, const LightDMSessionInfo &sessionInfo) +{ + stream << "[" + << sessionInfo.path() + << sessionInfo.userName() + << sessionInfo.seatPath() + << "]"; + return stream; } diff --git a/src/lock-backend/lightdmhelper.h b/src/lock-backend/lightdmhelper.h index 54829fd..8fc5053 100644 --- a/src/lock-backend/lightdmhelper.h +++ b/src/lock-backend/lightdmhelper.h @@ -24,11 +24,13 @@ #include #include #include +#include #include "userinfo.h" class SecurityUser; class UsersModel; -class AccountServiceHelper; +class AccountsHelper; +class LightDMSessionInfo; /** * @brief lightdm工具类 * @@ -42,7 +44,7 @@ public: * * @param parent 父指针 */ - explicit LightDMHelper(AccountServiceHelper *accountHelper, QObject *parent = nullptr); + explicit LightDMHelper(AccountsHelper *accountHelper, QObject *parent = nullptr); public: /** @@ -103,6 +105,14 @@ public Q_SLOTS: */ void onUsersChanged(); + void onLDMSessionAdded(QDBusObjectPath objPath); + + void onLDMSessionRemoved(QDBusObjectPath objPath); + + void onUserAdded(QDBusObjectPath objPath); + + void onUserRemoved(QDBusObjectPath objPath); + Q_SIGNALS: /** * @brief 认证成功 @@ -153,16 +163,51 @@ private: void updateSessionsInfo(); + void initLDMSessionsInfo(); + + bool isUserLoggined(const QString &strUserName); + + void initAccountsUsersInfo(); + private: bool m_isShowManualLogin; /**< 是否显示手动登录 */ QString m_strSession; /**< 当前会话 */ QString m_strCurUserName; /**< 当前选择用户 */ - QList m_listUsers; /**< 用户信息列表 */ SecurityUser *m_secUser = nullptr; /**< 安全用户信息指针 */ QLightDM::SessionsModel *m_sessionsModel; /**< lightdm 会话数据指针 */ QList m_listSessions; /**< 会话列表 */ - UsersModel *m_modelUsers = nullptr; /**< lightdm 用户数据指针 */ - AccountServiceHelper *m_accountServiceHelper = nullptr; + QMap *m_mapUsers; /**< accounts 用户信息列表指针 */ + AccountsHelper *m_accountServiceHelper = nullptr; + QMap> *m_ldmSessions; + QDBusInterface *m_dbusIfsLDM; }; +class LightDMSessionInfo : public QObject +{ + Q_OBJECT +public: + explicit LightDMSessionInfo(const QString &strPath, QObject* parent = nullptr); + + virtual ~LightDMSessionInfo(); + + inline QString path() const { return m_strPath; } + inline QString userName() const { return m_strUserName; } + inline QString seatPath() const { return m_strSeatPath; } + +private: + void initData(); + void initConnections(); + +private Q_SLOTS: + void onPropertiesChanged(const QString&, const QVariantMap&, const QStringList&); + +private: + QString m_strPath; + bool m_propertiesChangedConnected = false; + QString m_strSeatPath; + QString m_strUserName; +}; + +QDebug operator <<(QDebug stream, const LightDMSessionInfo &userInfo); + #endif // LIGHTDMHELPER_H diff --git a/src/lock-dialog/languagesetting.cpp b/src/lock-dialog/languagesetting.cpp new file mode 100644 index 0000000..44b552d --- /dev/null +++ b/src/lock-dialog/languagesetting.cpp @@ -0,0 +1,71 @@ +#include "languagesetting.h" +#include +#include "definetypes.h" +#include + +LanguageSetting* LanguageSetting::m_singleInstance = nullptr; + +LanguageSetting::LanguageSetting(QObject *parent) + : QObject(parent) +{ + +} + +LanguageSetting::~LanguageSetting() +{ + +} + +LanguageSetting* LanguageSetting::instance(QObject *parent) +{ + if(m_singleInstance == nullptr) + m_singleInstance = new LanguageSetting(parent); + return m_singleInstance; +} + +void LanguageSetting::onLanguageChanged(QString languageCode) +{ + if(languageCode == "") + return ; + + if(m_strLanguageCode == languageCode) { + return; + } + + qDebug()<<"onLanguageChanged "<removeTranslator(m_translator); + delete m_translator; + m_translator = nullptr; + } + m_translator = new QTranslator(this); + QString qmFile; + + if (languageCode.startsWith("zh_CN")) { /*这里写的有问题,忘记之前为什么写了,会导致繁体也会加载zh_CN*/ + qmFile = QString(WORKING_DIRECTORY"/i18n_qm/%1.qm").arg("zh_CN"); + setenv("LANGUAGE","zh_CN",1); + setenv("LANG","zh_CN",1); + setlocale(LC_ALL,"zh_CN.utf8"); + QLocale lang("zh_CN"); + /*这里设置一个QLocale的默认值,用来影响插件的语言。插件加载翻译文件时,不使用QLocale::system().name()来获取语言, + * 应该使用QLocale local; local.name() 来获取语言,这样可以识别到登录界面设置的的语言环境*/ + QLocale::setDefault(lang); + } else { + qmFile = QString(WORKING_DIRECTORY"/i18n_qm/%1.qm").arg(languageCode); + setenv("LANGUAGE",languageCode.toLatin1().data(),1); + setenv("LANG",languageCode.toLatin1().data(),1); + setlocale(LC_ALL,""); + QLocale lang(languageCode); + /*这里设置一个QLocale的默认值,用来影响插件的语言。插件加载翻译文件时,不使用QLocale::system().name()来获取语言, + * 应该使用QLocale local; local.name() 来获取语言,这样可以识别到登录界面设置的的语言环境*/ + QLocale::setDefault(languageCode); + } + + m_translator->load(qmFile); + qApp->installTranslator(m_translator); + qDebug() << "load translation file " << qmFile; + + m_strLanguageCode = languageCode; + Q_EMIT languageChanged(true); +} diff --git a/src/lock-dialog/languagesetting.h b/src/lock-dialog/languagesetting.h new file mode 100644 index 0000000..0119516 --- /dev/null +++ b/src/lock-dialog/languagesetting.h @@ -0,0 +1,29 @@ +#ifndef LANGUAGESETTING_H +#define LANGUAGESETTING_H + +#include +#include + +class LanguageSetting : public QObject +{ + Q_OBJECT + +public: + static LanguageSetting *instance(QObject *parent = nullptr); + + void onLanguageChanged(QString languageCode); + +Q_SIGNALS: + void languageChanged(bool isCompleted); + +private: + LanguageSetting(QObject *parent = nullptr); + virtual ~LanguageSetting(); + +private: + static LanguageSetting *m_singleInstance; + QTranslator *m_translator = nullptr; + QString m_strLanguageCode; +}; + +#endif // LANGUAGESETTING_H diff --git a/src/lock-dialog/lockdialogmodel.cpp b/src/lock-dialog/lockdialogmodel.cpp index d8b06a3..4f684d1 100644 --- a/src/lock-dialog/lockdialogmodel.cpp +++ b/src/lock-dialog/lockdialogmodel.cpp @@ -178,7 +178,26 @@ void LockDialogModel::updateSessionsInfo(QStringList list) void LockDialogModel::updateUsersInfo(QList list) { - m_listUsersInfo = list; + for (auto userinfo : list) { + if (m_listUsersInfo.contains(userinfo)) { + UserInfoPtr changedUserInfo = findUserByName(userinfo->name()); + if (changedUserInfo) { + changedUserInfo->updateUid(userinfo->uid()); + changedUserInfo->updateFullName(userinfo->fullName()); + changedUserInfo->updateHeadImage(userinfo->headImage()); + changedUserInfo->updateLang(userinfo->lang()); + changedUserInfo->updateLoggedIn(userinfo->isLoggedIn()); + changedUserInfo->updateBackground(userinfo->backGround()); + } + } else { + m_listUsersInfo.append(userinfo); + } + } + foreach (auto userinfo, m_listUsersInfo) { + if (!list.contains(userinfo)) { + m_listUsersInfo.removeOne(userinfo); + } + } Q_EMIT usersInfoChanged(); } @@ -190,7 +209,26 @@ void LockDialogModel::updateAgreementInfo(AgreementInfoPtr agreementInfo) void LockDialogModel::onUsersInfoChanged(QList list) { - m_listUsersInfo = list; + for (auto userinfo : list) { + if (m_listUsersInfo.contains(userinfo)) { + UserInfoPtr changedUserInfo = findUserByName(userinfo->name()); + if (changedUserInfo) { + changedUserInfo->updateUid(userinfo->uid()); + changedUserInfo->updateFullName(userinfo->fullName()); + changedUserInfo->updateHeadImage(userinfo->headImage()); + changedUserInfo->updateLang(userinfo->lang()); + changedUserInfo->updateLoggedIn(userinfo->isLoggedIn()); + changedUserInfo->updateBackground(userinfo->backGround()); + } + } else { + m_listUsersInfo.append(userinfo); + } + } + foreach (auto userinfo, m_listUsersInfo) { + if (!list.contains(userinfo)) { + m_listUsersInfo.removeOne(userinfo); + } + } Q_EMIT usersInfoChanged(); } diff --git a/src/lock-dialog/main.cpp b/src/lock-dialog/main.cpp index a55d8bc..492f2f4 100644 --- a/src/lock-dialog/main.cpp +++ b/src/lock-dialog/main.cpp @@ -42,6 +42,7 @@ #include "screensaverwndadaptor.h" #include "pluginsloader.h" #include "msysdbus.h" +#include "languagesetting.h" FullBackgroundWidget *window = nullptr; @@ -122,12 +123,7 @@ int main(int argc, char *argv[]) qInfo()<<"Start "<onLanguageChanged(QLocale::system().name()); window = new FullBackgroundWidget(lockDialogModel); diff --git a/src/userinfo.cpp b/src/userinfo.cpp index be2e55f..2e38e3f 100644 --- a/src/userinfo.cpp +++ b/src/userinfo.cpp @@ -17,9 +17,16 @@ **/ #include "userinfo.h" #include "global_utils.h" +#include "definetypes.h" +#include +#include +#include +#include +#include -UserInfo::UserInfo() - : m_isLoggedIn(false) +UserInfo::UserInfo(QObject *parent) + : QObject(parent) + , m_isLoggedIn(false) , m_uId(-1) , m_strBackground(DEFAULT_BACKGROUND_PATH) , m_strLang(qgetenv("LANG")) @@ -29,7 +36,8 @@ UserInfo::UserInfo() } UserInfo::UserInfo(const UserInfo &userInfo) - : m_isLoggedIn(userInfo.m_isLoggedIn) + : QObject(userInfo.parent()) + , m_isLoggedIn(userInfo.m_isLoggedIn) , m_uId(userInfo.m_uId) , m_strHeadImage(userInfo.m_strHeadImage) , m_strFullName(userInfo.m_strFullName) @@ -50,22 +58,11 @@ bool UserInfo::operator==(const UserInfo &userInfo) const return userInfo.uid() == m_uId && userInfo.name() == m_strName; } -UserInfo& UserInfo::operator=(const UserInfo &userInfo) -{ - if (this == &userInfo) return *this; - - updateLoggedIn(userInfo.isLoggedIn()); - updateUid(userInfo.uid()); - updateHeadImage(userInfo.headImage()); - updateFullName(userInfo.fullName()); - updateBackground(userInfo.backGround()); - updateLang(userInfo.lang()); - updateName(userInfo.name()); - return *this; -} - void UserInfo::updateLoggedIn(const bool &isLoggedIn) { + if (isLoggedIn == m_isLoggedIn) { + return ; + } m_isLoggedIn = isLoggedIn; } @@ -112,3 +109,182 @@ QDebug operator <<(QDebug stream, const UserInfo &userInfo) << "]"; return stream; } + + +LocalUserInfo::LocalUserInfo(const uid_t &uId, QObject* parent) + : UserInfo(parent) + , m_strPath("/org/freedesktop/Accounts/User" + QString::number(uId)) +{ + initData(); + initConnections(); +} + +LocalUserInfo::LocalUserInfo(const QString &strPath, QObject* parent) + : UserInfo(parent) + , m_strPath(strPath) +{ + initData(); + initConnections(); +} + +LocalUserInfo::LocalUserInfo(const LocalUserInfo &localUser) + : UserInfo(localUser) + , m_strPath(localUser.path()) +{ + if (m_strPath.isEmpty()) { + m_strPath = QString("/org/freedesktop/Accounts/User" + QString::number(localUser.uid())); + } + initConnections(); +} + +LocalUserInfo::~LocalUserInfo() +{ + if (m_propertiesChangedConnected) { + QDBusConnection::systemBus().disconnect(ACCOUNTS_DBUS_SERVICE, + m_strPath, + FD_PROPERTIES_INTERFACE, + "PropertiesChanged", + this, + SLOT(onPropertiesChanged(QString, QVariantMap, QStringList))); + m_propertiesChangedConnected = false; + } +} + +void LocalUserInfo::initData() +{ + QDBusInterface ifaceExtra(ACCOUNTS_DBUS_SERVICE, m_strPath, FD_PROPERTIES_INTERFACE, QDBusConnection::systemBus()); + QDBusMessage ret = ifaceExtra.call("GetAll", ACCOUNTS_USER_LDM_SERVICE_INTERFACE); + QList outArgs = ret.arguments(); + QVariant first = outArgs.at(0); + const QDBusArgument &dbusArgsExtra = first.value(); + dbusArgsExtra.beginMap(); + while(!dbusArgsExtra.atEnd()) { + QString key; + QVariant value; + dbusArgsExtra.beginMapEntry(); + dbusArgsExtra >> key >> value; + if(key == "BackgroundFile") { + QString strBackground = value.toString(); + if(strBackground.isEmpty() || !QFile(strBackground).exists() || !QFile(strBackground).size()) { + m_strBackground = DEFAULT_BACKGROUND_PATH; + } else { + m_strBackground = strBackground; + } + } + dbusArgsExtra.endMapEntry(); + } + dbusArgsExtra.endMap(); + + QDBusInterface iface(ACCOUNTS_DBUS_SERVICE, m_strPath, FD_PROPERTIES_INTERFACE, QDBusConnection::systemBus()); + ret = iface.call("GetAll", ACCOUNTS_USER_DBUS_INTERFACE); + outArgs = ret.arguments(); + first = outArgs.at(0); + const QDBusArgument &dbusArgs = first.value(); + dbusArgs.beginMap(); + while(!dbusArgs.atEnd()) { + QString key; + QVariant value; + dbusArgs.beginMapEntry(); + dbusArgs >> key >> value; + if(key == "UserName") { + m_strName = value.toString(); + } else if(key == "RealName") { + m_strFullName = value.toString(); + } else if(key == "IconFile") { + QString strHeadImage = value.toString(); + if(strHeadImage.isEmpty() || !QFile(strHeadImage).exists() || !QFile(strHeadImage).size()) { + m_strHeadImage = getDefaultFace(); + } else { + m_strHeadImage = strHeadImage; + } + } else if(key == "Uid") { + m_uId = value.toUInt(); + } else if(key == "Language") { + m_strLang = value.toString(); + } else if (key == "BackgroundFile") { + QString strBackground = value.toString(); + if(!strBackground.isEmpty() && QFile(strBackground).exists() && QFile(strBackground).size()) { + m_strBackground = strBackground; + } + } + dbusArgs.endMapEntry(); + } + dbusArgs.endMap(); + if(m_strFullName.isEmpty()) { + m_strFullName = m_strName; + } +} + +void LocalUserInfo::initConnections() +{ + if (!m_propertiesChangedConnected) { + QDBusConnection::systemBus().connect(ACCOUNTS_DBUS_SERVICE, + m_strPath, + FD_PROPERTIES_INTERFACE, + "PropertiesChanged", + this, + SLOT(onPropertiesChanged(QString, QVariantMap, QStringList))); + m_propertiesChangedConnected = true; + } +} + +void LocalUserInfo::onPropertiesChanged(const QString& interfaceName, + const QVariantMap& changedProperties, + const QStringList& invalidatedProperties) +{ + Q_UNUSED(invalidatedProperties); + if (interfaceName == ACCOUNTS_USER_DBUS_INTERFACE) { + QVariantMap::const_iterator itVar = changedProperties.constBegin(); + bool isChanged = false; + for ( ; itVar != changedProperties.constEnd(); itVar++) { + QVariant varValue = itVar.value(); + if(itVar.key() == "UserName") { + m_strName = varValue.toString(); + isChanged = true; + } else if(itVar.key() == "RealName") { + m_strFullName = varValue.toString(); + isChanged = true; + } else if(itVar.key() == "IconFile") { + QString strHeadImage = varValue.toString(); + if(strHeadImage.isEmpty() || !QFile(strHeadImage).exists() || !QFile(strHeadImage).size()) { + m_strHeadImage = getDefaultFace(); + } else { + m_strHeadImage = strHeadImage; + } + isChanged = true; + } else if(itVar.key() == "Uid") { + m_uId = varValue.toUInt(); + isChanged = true; + } else if(itVar.key() == "Language") { + m_strLang = varValue.toString(); + isChanged = true; + } else if (itVar.key() == "BackgroundFile") { + QString strBackground = varValue.toString(); + if(!strBackground.isEmpty() && QFile(strBackground).exists() && QFile(strBackground).size()) { + m_strBackground = strBackground; + isChanged = true; + } + } + } + if(m_strFullName.isEmpty()) { + m_strFullName = m_strName; + } + if (isChanged) + Q_EMIT userPropChanged(m_strName); + } +} + +QDebug operator <<(QDebug stream, const LocalUserInfo &userInfo) +{ + stream << "[" + << userInfo.path() + << userInfo.uid() + << userInfo.name() + << userInfo.fullName() + << userInfo.headImage() + << userInfo.backGround() + << userInfo.isLoggedIn() + << userInfo.lang() + << "]"; + return stream; +} diff --git a/src/userinfo.h b/src/userinfo.h index 593858b..f4ec45c 100644 --- a/src/userinfo.h +++ b/src/userinfo.h @@ -22,15 +22,15 @@ #include #include -class UserInfo +class UserInfo : public QObject { + Q_OBJECT public: - UserInfo(); - UserInfo(const UserInfo &userInfo); + explicit UserInfo(QObject *parent = nullptr); + explicit UserInfo(const UserInfo &userInfo); virtual ~UserInfo(); bool operator==(const UserInfo &userInfo) const; - UserInfo& operator=(const UserInfo &userInfo); public: inline bool isLoggedIn() const { return m_isLoggedIn; } @@ -41,6 +41,9 @@ public: inline QString lang() const { return m_strLang; } inline QString name() const { return m_strName; } + virtual inline QString path() const { return QString(); } + +public: void updateLoggedIn(const bool &isLoggedIn); void updateUid(const uid_t &id); void updateHeadImage(const QString &path); @@ -49,6 +52,9 @@ public: void updateLang(const QString &lang); void updateName(const QString &name); +Q_SIGNALS: + void userPropChanged(const QString &userName); + protected: bool m_isLoggedIn; // 是否已登录 uid_t m_uId; // 用户 uid @@ -63,4 +69,32 @@ typedef std::shared_ptr UserInfoPtr; QDebug operator <<(QDebug stream, const UserInfo &userInfo); +class LocalUserInfo : public UserInfo +{ + Q_OBJECT +public: + explicit LocalUserInfo(const uid_t &uId, QObject* parent = nullptr); + explicit LocalUserInfo(const QString &strPath, QObject* parent = nullptr); + explicit LocalUserInfo(const LocalUserInfo &localUser); + + virtual ~LocalUserInfo(); + + inline QString path() const override { return m_strPath; } + +private: + void initData(); + void initConnections(); + +private Q_SLOTS: + void onPropertiesChanged(const QString&, const QVariantMap&, const QStringList&); + +private: + QString m_strPath; + bool m_propertiesChangedConnected = false; +}; + +typedef std::shared_ptr LocalUserInfoPtr; + +QDebug operator <<(QDebug stream, const LocalUserInfo &userInfo); + #endif // USERINFO_H diff --git a/src/widgets/authdialog.cpp b/src/widgets/authdialog.cpp index ef4c014..108b49f 100644 --- a/src/widgets/authdialog.cpp +++ b/src/widgets/authdialog.cpp @@ -17,8 +17,17 @@ #include #include #include "../lock-dialog/pam-tally.h" +#include "global_utils.h" -AuthDialog::AuthDialog(LockDialogModel *model, UserInfo userInfo, QWidget *parent) +#define WIDGET_HEIGHT_HEADTIP (40*scale) +#define WIDGET_HEIGHT_HEADIMAGE (154*scale) +#define WIDGET_HEIGHT_USERNAME (40*scale) +#define WIDGET_HEIGHT_PASSWDEDIT (80*scale) +#define WIDGET_HEIGHT_SPACING (16*scale) +#define WIDGET_HEIGHT_CUSTOM (WIDGET_HEIGHT_HEADIMAGE+WIDGET_HEIGHT_USERNAME+WIDGET_HEIGHT_PASSWDEDIT+WIDGET_HEIGHT_SPACING*2) +#define WIDGET_HEIGHT_LOGINOPTS (104*scale) + +AuthDialog::AuthDialog(LockDialogModel *model, UserInfoPtr userInfo, QWidget *parent) : QWidget(parent) , m_modelLockDialog(model) , m_isLockingFlg(false) @@ -33,7 +42,7 @@ void AuthDialog::initUI() { QVBoxLayout *mainLayout = new QVBoxLayout(this); mainLayout->setAlignment(Qt::AlignCenter); - mainLayout->setSpacing(16); + mainLayout->setSpacing(WIDGET_HEIGHT_SPACING); mainLayout->setContentsMargins(0, 0, 0, 0); m_curFontSize = m_modelLockDialog->getCurFontSize(); m_ptToPx = m_modelLockDialog->getPtToPx(); @@ -50,12 +59,12 @@ void AuthDialog::initUI() // 密码输入框 m_editWidget = new QWidget(this); - //错误信息提示 - m_messageWidget = new QWidget(this); - // ukey m_ukeyPasswdWidget = new QWidget(this); + // custom widget + m_customWidget = new QWidget(this); + // login option m_widgetLoginOpts = new QWidget(this); @@ -65,6 +74,7 @@ void AuthDialog::initUI() mainLayout->addWidget(m_nameWidget); mainLayout->addWidget(m_editWidget); mainLayout->addWidget(m_ukeyPasswdWidget); + mainLayout->addWidget(m_customWidget); mainLayout->addWidget(m_widgetLoginOpts); mainLayout->addStretch(); @@ -73,6 +83,7 @@ void AuthDialog::initUI() initNameWidget(); initEditWidget(); initUkeyPasswordWidget(); + initCustomAuthWidget(); initLoginoptionWidget(); initConnections(); @@ -116,31 +127,29 @@ void AuthDialog::resizeEvent(QResizeEvent *event) void AuthDialog::updateAuthSize() { - this->layout()->setSpacing(16*scale); + this->layout()->setSpacing(WIDGET_HEIGHT_SPACING); if (m_tipWidget) - m_tipWidget->setFixedSize(this->width(), 40*scale); + m_tipWidget->setFixedSize(this->width(), WIDGET_HEIGHT_HEADTIP); if (m_headerWidget) - m_headerWidget->setFixedSize(this->width(), 154*scale); + m_headerWidget->setFixedSize(this->width(), WIDGET_HEIGHT_HEADIMAGE); if (m_nameWidget) - m_nameWidget->setFixedSize(this->width(), 40*scale); + m_nameWidget->setFixedSize(this->width(), WIDGET_HEIGHT_USERNAME); if (m_editWidget) - m_editWidget->setFixedSize(this->width(), 80*scale); - if (m_messageWidget) - m_messageWidget->setFixedSize(this->width(), 40*scale); + m_editWidget->setFixedSize(this->width(), WIDGET_HEIGHT_PASSWDEDIT); if (m_ukeyPasswdWidget) - m_ukeyPasswdWidget->setFixedSize(this->width(), 80*scale); + m_ukeyPasswdWidget->setFixedSize(this->width(), WIDGET_HEIGHT_PASSWDEDIT); if (m_widgetLoginOpts) - m_widgetLoginOpts->setFixedSize(this->width(), 104*scale); + m_widgetLoginOpts->setFixedSize(this->width(), WIDGET_HEIGHT_LOGINOPTS); if (m_labelLoginTypeTip) { m_labelLoginTypeTip->setFixedSize(m_tipWidget->size()); m_labelLoginTypeTip->setFontSize((14 + m_curFontSize)*m_ptToPx); } if (m_labelHeadImg) - m_labelHeadImg->setFixedSize(154*scale, 154*scale); + m_labelHeadImg->setFixedSize(WIDGET_HEIGHT_HEADIMAGE, WIDGET_HEIGHT_HEADIMAGE); if (m_labelFace) - m_labelFace->setFixedSize(154*scale, 154*scale); + m_labelFace->setFixedSize(WIDGET_HEIGHT_HEADIMAGE, WIDGET_HEIGHT_HEADIMAGE); if (m_labelQRCode) - m_labelQRCode->setFixedSize(154*scale, 154*scale); + m_labelQRCode->setFixedSize(WIDGET_HEIGHT_HEADIMAGE, WIDGET_HEIGHT_HEADIMAGE); if (m_labelQRCodeTip) m_labelQRCodeTip->setFixedSize(22*scale, 22*scale); if (m_labelQRCodeMsg) { @@ -148,7 +157,7 @@ void AuthDialog::updateAuthSize() m_labelQRCodeMsg->setFontSize((14 + m_curFontSize)*m_ptToPx); } if (m_nameLabel) { - m_nameLabel->setFixedSize(this->width(), 40*scale); + m_nameLabel->setFixedSize(this->width(), WIDGET_HEIGHT_USERNAME); m_nameLabel->setFontSize((24 + m_curFontSize)*m_ptToPx); } if (m_passwordEdit) { @@ -179,8 +188,9 @@ void AuthDialog::updateAuthSize() } if (m_tipWidget && bottomListWidget) m_optionTip->setFixedSize(bottomListWidget->width(), 32*scale); + if (m_customWidget) + m_customWidget->setFixedSize(width(), WIDGET_HEIGHT_CUSTOM); updateUI(); - } void AuthDialog::initTipWidget() @@ -324,30 +334,60 @@ void AuthDialog::initLoginoptionWidget() // btnsLayout->addWidget(bottomListWidget); // loginoptionLayout->addLayout(btnsLayout); - m_customWidget = new QWidget(this); - m_layoutCustom = new QHBoxLayout(); - m_layoutCustom->setSpacing(0); - m_layoutCustom->setContentsMargins(0,0,0,0); - m_customWidget->setLayout(m_layoutCustom); - m_customWidget->hide(); - m_customWidget->setFixedSize(width(), 376+100); +} + +void AuthDialog::initCustomAuthWidget() +{ + if (m_customWidget) { + m_layoutCustom = new QHBoxLayout(m_customWidget); + m_layoutCustom->setSpacing(0); + m_layoutCustom->setContentsMargins(0,0,0,0); + m_layoutCustom->setAlignment(Qt::AlignVCenter); + m_customWidget->hide(); + } } void AuthDialog::updateUI() { - QPixmap p(m_curUserInfo.headImage()); + QPixmap p(m_curUserInfo->headImage()); QPixmap userIcon = scaledPixmap(p); userIcon = userIcon.scaled(154*scale, 154*scale, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); userIcon = PixmapToRound(userIcon, 77*scale); m_labelHeadImg->setPixmap(userIcon); - m_nameLabel->setText(m_curUserInfo.fullName()); + if (m_curUserInfo->name() == "*login") { + m_nameLabel->setText(tr("Login")); + } else if (m_curUserInfo->name() == "*guest") { + m_nameLabel->setText(tr("Guest")); + } else { + m_nameLabel->setText(m_curUserInfo->fullName()); + } m_fRetryButton->setStyleSheet(QString("QPushButton{border-radius: %1px; border:0px solid white;background-color: rgba(255,255,255,10%);}" "QPushButton::hover{background-color: rgb(255,255,255,30%);}" "QPushButton::pressed {background-color: rgba(255,255,255,40%);}").arg((int)(77*scale))); m_fRetryButton->setFixedSize(154*scale, 154*scale); m_fRetryButton->setIconSize(QSize(48*scale, 48*scale)); + qDebug()<<"AuthDialog updateUI:"<isLoggedIn(); + if (!isGreeterMode() && m_curUserInfo->isLoggedIn()) { + QPixmap iconLogin = QIcon::fromTheme("system-lock-screen-symbolic").pixmap(12,12); + iconLogin = drawSymbolicColoredPixmap(iconLogin, "white"); + if (m_passwordEdit) { + m_passwordEdit->setIcon(iconLogin, iconLogin.size()); + } + if (m_ukeyPasswordEdit) { + m_ukeyPasswordEdit->setIcon(iconLogin, iconLogin.size()); + } + } else { + QPixmap iconLogin = QIcon::fromTheme("go-next-symbolic").pixmap(20,20); + iconLogin = drawSymbolicColoredPixmap(iconLogin, "white"); + if (m_passwordEdit) { + m_passwordEdit->setIcon(iconLogin, iconLogin.size()); + } + if (m_ukeyPasswordEdit) { + m_ukeyPasswordEdit->setIcon(iconLogin, iconLogin.size()); + } + } } void AuthDialog::startLoadingUkey() @@ -397,11 +437,12 @@ void AuthDialog::switchLoginOptType(unsigned uLoginOptType, bool faceBtnClicked) case LOGINOPT_TYPE_PASSWORD: { m_editWidget->show(); + m_headerWidget->show(); + m_nameWidget->show(); m_labelHeadImg->show(); m_labelQRCode->hide(); m_labelFace->hide(); m_fRetryButton->hide(); - m_nameWidget->show(); m_ukeyPasswdWidget->hide(); m_ukeyPasswordEdit->clearFocus(); m_customWidget->hide(); @@ -411,11 +452,12 @@ void AuthDialog::switchLoginOptType(unsigned uLoginOptType, bool faceBtnClicked) case LOGINOPT_TYPE_FACE: { m_editWidget->show(); + m_headerWidget->show(); + m_nameWidget->show(); m_labelHeadImg->hide(); m_labelQRCode->hide(); m_labelFace->show(); m_fRetryButton->hide(); - m_nameWidget->show(); m_ukeyPasswdWidget->hide(); m_ukeyPasswordEdit->clearFocus(); m_customWidget->hide(); @@ -431,8 +473,9 @@ void AuthDialog::switchLoginOptType(unsigned uLoginOptType, bool faceBtnClicked) case LOGINOPT_TYPE_IRIS: { m_editWidget->show(); - m_labelHeadImg->show(); + m_headerWidget->show(); m_nameWidget->show(); + m_labelHeadImg->show(); m_labelQRCode->hide(); m_labelFace->hide(); m_fRetryButton->hide(); @@ -445,11 +488,12 @@ void AuthDialog::switchLoginOptType(unsigned uLoginOptType, bool faceBtnClicked) case LOGINOPT_TYPE_QRCODE: { m_editWidget->show(); + m_headerWidget->show(); + m_nameWidget->show(); m_labelHeadImg->hide(); setQRCodeMsg(""); m_labelQRCode->show(); m_labelFace->hide(); - m_nameWidget->show(); m_fRetryButton->hide(); m_ukeyPasswdWidget->hide(); m_ukeyPasswordEdit->clearFocus(); @@ -460,8 +504,9 @@ void AuthDialog::switchLoginOptType(unsigned uLoginOptType, bool faceBtnClicked) case LOGINOPT_TYPE_GENERAL_UKEY: { m_editWidget->show(); - m_labelHeadImg->show(); + m_headerWidget->show(); m_nameWidget->show(); + m_labelHeadImg->show(); m_labelQRCode->hide(); m_labelFace->hide(); m_fRetryButton->hide(); @@ -476,12 +521,9 @@ void AuthDialog::switchLoginOptType(unsigned uLoginOptType, bool faceBtnClicked) case LOGINOPT_TYPE_CUSTOM: { m_editWidget->hide(); - m_labelHeadImg->hide(); - setQRCodeMsg(""); - m_labelQRCode->hide(); + m_headerWidget->hide(); m_nameWidget->hide(); - m_labelFace->hide(); - m_fRetryButton->hide(); + setQRCodeMsg(""); m_ukeyPasswdWidget->hide(); m_ukeyPasswordEdit->clearFocus(); LoginAuthInterface* plugin = m_loginOpts->getCustomLoginAuth(); @@ -509,7 +551,7 @@ void AuthDialog::switchLoginOptType(unsigned uLoginOptType, bool faceBtnClicked) return; } - if (uLoginOptType != m_uCurLoginOptType || (m_deviceInfo && m_deviceInfo->id != m_nLastDeviceId) || m_curUserInfo.name() != m_lastUserName) { + if (uLoginOptType != m_uCurLoginOptType || (m_deviceInfo && m_deviceInfo->id != m_nLastDeviceId) || m_curUserInfo->name() != m_lastUserName) { clearMessage(); switch(uLoginOptType) { case LOGINOPT_TYPE_PASSWORD: @@ -570,37 +612,10 @@ void AuthDialog::switchLoginOptType(unsigned uLoginOptType, bool faceBtnClicked) m_nLastDeviceId = -1; } - m_lastUserName = m_curUserInfo.name(); + m_lastUserName = m_curUserInfo->name(); m_uCurLoginOptType = uLoginOptType; } -/** - * @brief LoginWindow::setFace - * @param faceFile 用户头像文件 - * - * 设置用户头像 - */ -void AuthDialog::setFace(const QString& facePath) -{ - QFile faceFile(facePath); - QPixmap faceImage; - m_labelHeadImg->setFixedSize(154,154); - //如果头像文件不存在,则使用默认头像 - if(faceFile.exists()){ - faceImage.load(facePath); - } - else{ - faceImage.load(m_strDefaultFace); - } - //faceImage = cutPixmap(faceImage); - faceImage = faceImage.scaled(154,154, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - faceImage = PixmapToRound(faceImage,77); - m_labelHeadImg->setAlignment(Qt::AlignCenter); - m_labelHeadImg->setPixmap(faceImage); - - m_face = facePath; -} - void AuthDialog::setQRCode(QImage& imgQRCode) { if (imgQRCode.isNull()) { @@ -674,7 +689,7 @@ void AuthDialog::onRespondUkey(const QString &text) { if (m_loginOpts && m_deviceInfo){ m_loginOpts->SetExtraInfo(text,"pincode"); - m_loginOpts->startAuth(m_deviceInfo, m_curUserInfo.uid()); + m_loginOpts->startAuth(m_deviceInfo, m_curUserInfo->uid()); } } @@ -892,11 +907,11 @@ void AuthDialog::onPamShowPrompt(QString strPrompt, int nType) void AuthDialog::onPamAuthCompleted() { - if (m_curUserInfo.name().isEmpty()) + if (m_curUserInfo->name().isEmpty()) return ; m_passwordEdit->stopWaiting(); bool isAuthenticated = (Q_EMIT m_modelLockDialog->pamIsAuthenticated()); - qDebug()<<"onPamAuthCompleted:"<name(); if(isAuthenticated) { if((m_bRecvPrompt && !m_bHasUnacknowledgedMsg ) || m_bDirectLogin) { m_bDirectLogin = false; @@ -905,12 +920,12 @@ void AuthDialog::onPamAuthCompleted() m_passwordEdit->readOnly(false); m_passwordEdit->clear(); clearMessage(); - m_failMap.remove(m_curUserInfo.uid()); + m_failMap.remove(m_curUserInfo->uid()); setLoginTypeTip(""); setUkeyTypeTip(""); authMode = UNKNOWN; m_uCurLoginOptType = LOGINOPT_TYPE_PASSWORD; - Q_EMIT authSucceed(m_curUserInfo.name()); + Q_EMIT authSucceed(m_curUserInfo->name()); } else { qDebug()<<"m_bRecvPrompt = "<name().isEmpty()) { qInfo()<<"No user be selected!!"; return ; } m_bHasUnacknowledgedMsg = false; clearMessage(); - qDebug()<<"onRespond:"<pamAuthenticate(m_curUserInfo.name()); - } else if(m_curUserInfo.name() == "*login") { //用户输入用户名 + qDebug()<<"onRespond:"<name(); + if(m_curUserInfo->name() == "*guest"){ + Q_EMIT m_modelLockDialog->pamAuthenticate(m_curUserInfo->name()); + } else if(m_curUserInfo->name() == "*login") { //用户输入用户名 m_isManual = true; m_isNameLogin = true; @@ -1000,19 +1015,19 @@ void AuthDialog::onRespond(const QString &strRes) void AuthDialog::startAuth() { - if (!m_curUserInfo.name().isEmpty()) { + if (!m_curUserInfo->name().isEmpty()) { m_bRecvPrompt = false; m_bHasUnacknowledgedMsg = false; //用户认证 - if(m_curUserInfo.name() == "*guest") { //游客登录 + if(m_curUserInfo->name() == "*guest") { //游客登录 qDebug() << "guest login"; m_passwordEdit->show(); m_passwordEdit->setPrompt(tr("login")); - } else if(m_curUserInfo.name() == "*login") { //手动输入用户名 + } else if(m_curUserInfo->name() == "*login") { //手动输入用户名 Q_EMIT m_modelLockDialog->pamAuthenticate(""); } else { - qDebug() << "login: " << m_curUserInfo.name(); - Q_EMIT m_modelLockDialog->pamAuthenticate(m_curUserInfo.name()); + qDebug() << "login: " << m_curUserInfo->name(); + Q_EMIT m_modelLockDialog->pamAuthenticate(m_curUserInfo->name()); m_passwordEdit->clear(); m_passwordEdit->readOnly(true); } @@ -1032,15 +1047,15 @@ void AuthDialog::stopAuth() clearMessage(); } -void AuthDialog::onCurUserInfoChanged(const UserInfo &userInfo) +void AuthDialog::onCurUserInfoChanged(UserInfoPtr userInfo) { - if (m_curUserInfo.uid() > -1 && userInfo.uid() == m_curUserInfo.uid()) { + if (m_curUserInfo->uid() > -1 && userInfo->uid() == m_curUserInfo->uid()) { m_curUserInfo = userInfo; updateUI(); } } -void AuthDialog::onCurUserChanged(const UserInfo &userInfo) +void AuthDialog::onCurUserChanged(UserInfoPtr userInfo) { if(m_loginOpts){ m_loginOpts->stopAuth(); @@ -1100,13 +1115,13 @@ void AuthDialog::onMessageButtonClicked() m_passwordEdit->clear(); clearMessage(); - m_failMap.remove(m_curUserInfo.uid()); + m_failMap.remove(m_curUserInfo->uid()); setLoginTypeTip(""); setUkeyTypeTip(""); authMode = UNKNOWN; m_uCurLoginOptType = LOGINOPT_TYPE_PASSWORD; - Q_EMIT authSucceed(m_curUserInfo.name()); + Q_EMIT authSucceed(m_curUserInfo->name()); } else { m_messageButton->hide(); m_messageLabel->setText(""); @@ -1124,14 +1139,14 @@ void AuthDialog::clearMessage() bool AuthDialog::unlockUserTimer() { - if (m_curUserInfo.name().isEmpty()) + if (m_curUserInfo->name().isEmpty()) return false; int failed_count = 0; int time_left = 0; int deny = 0; int fail_time =0; int unlock_time = 0; - QString curUserName = m_curUserInfo.name(); + QString curUserName = m_curUserInfo->name(); if (NULL == curUserName.toLatin1().data()) { qDebug() << "get user info failed." ; @@ -1236,7 +1251,7 @@ void AuthDialog::pamBioSuccess() if(m_deviceInfo && m_deviceInfo->deviceType == LOGINOPT_TYPE_GENERAL_UKEY){ //ukey时不调用ukey认证 }else{ - m_loginOpts->startAuth(m_deviceInfo, m_curUserInfo.uid()); + m_loginOpts->startAuth(m_deviceInfo, m_curUserInfo->uid()); } if (m_deviceInfo) { @@ -1349,10 +1364,10 @@ void AuthDialog::performBiometricAuth() //获取默认设备 if (m_loginOpts) { - if(m_curUserInfo.name() == "*login") + if(m_curUserInfo->name() == "*login") m_deviceName = m_loginOpts->getDefaultDevice(m_strManualLoginName); else - m_deviceName = m_loginOpts->getDefaultDevice(m_curUserInfo.name()); + m_deviceName = m_loginOpts->getDefaultDevice(m_curUserInfo->name()); if (m_isCustomDefault) { // 认证插件配置默认插件认证 if (m_loginOpts) { @@ -1387,7 +1402,7 @@ void AuthDialog::performBiometricAuth() } //已经错误超过3次 - if(m_failMap.contains(m_curUserInfo.uid()) && m_failMap[m_curUserInfo.uid()][m_deviceInfo->id] >= maxFailedTimes) + if(m_failMap.contains(m_curUserInfo->uid()) && m_failMap[m_curUserInfo->uid()][m_deviceInfo->id] >= maxFailedTimes) { if (m_deviceInfo->deviceType == UniT_Remote) { setLoginTypeTip(tr("Failed to verify %1, please enter password to unlock").arg(getDeviceType_tr(m_deviceInfo->deviceType))); @@ -1424,11 +1439,11 @@ void AuthDialog::skipBiometricAuth() void AuthDialog::initBiometricWidget() { if(m_loginOpts) { - m_loginOpts->setUser(m_curUserInfo.uid()); + m_loginOpts->setUser(m_curUserInfo->uid()); } else { QHBoxLayout *optsLayout = new QHBoxLayout(m_widgetLoginOpts); optsLayout->setContentsMargins(0,0,0,0); - m_loginOpts = new LoginOptionsWidget(m_biometricProxy, m_curUserInfo.uid(), m_uniauthService, m_widgetLoginOpts); + m_loginOpts = new LoginOptionsWidget(m_biometricProxy, m_curUserInfo->uid(), m_uniauthService, m_widgetLoginOpts); optsLayout->addWidget(m_loginOpts); connect(m_loginOpts, &LoginOptionsWidget::authComplete, this, &AuthDialog::onBiometricAuthComplete); @@ -1442,7 +1457,7 @@ void AuthDialog::initBiometricWidget() this, &AuthDialog::onLoginOptsCount); connect(m_loginOpts, &LoginOptionsWidget::updateAuthMsg, this, &AuthDialog::setLoginMsg); - m_loginOpts->setUser(m_curUserInfo.uid()); + m_loginOpts->setUser(m_curUserInfo->uid()); } qDebug()<<"OptsCount:"<getLoginOptCount(); @@ -1503,7 +1518,7 @@ void AuthDialog::onLoginOptsCount(unsigned uCount) } //获取默认设备 - if(m_curUserInfo.name() == "*login"){ + if(m_curUserInfo->name() == "*login"){ if(isLoadingUkey){ m_deviceName = m_loginOpts->getDefaultDevice(m_strManualLoginName,UniT_General_Ukey); }else{ @@ -1511,9 +1526,9 @@ void AuthDialog::onLoginOptsCount(unsigned uCount) } } else{ if(isLoadingUkey){ - m_deviceName = m_loginOpts->getDefaultDevice(m_curUserInfo.name(),UniT_General_Ukey); + m_deviceName = m_loginOpts->getDefaultDevice(m_curUserInfo->name(),UniT_General_Ukey); }else{ - m_deviceName = m_loginOpts->getDefaultDevice(m_curUserInfo.name()); + m_deviceName = m_loginOpts->getDefaultDevice(m_curUserInfo->name()); } } @@ -1539,7 +1554,7 @@ void AuthDialog::onLoginOptsCount(unsigned uCount) } //已经错误超过3次 - if(m_failMap.contains(m_curUserInfo.uid()) && m_failMap[m_curUserInfo.uid()][m_deviceInfo->id] >= maxFailedTimes) + if(m_failMap.contains(m_curUserInfo->uid()) && m_failMap[m_curUserInfo->uid()][m_deviceInfo->id] >= maxFailedTimes) { if (m_deviceInfo->deviceType == UniT_Remote) { setLoginTypeTip(tr("Failed to verify %1, please enter password to unlock").arg(getDeviceType_tr(m_deviceInfo->deviceType))); @@ -1620,7 +1635,7 @@ void AuthDialog::onDeviceChanged(unsigned uCurLoginOptType, const DeviceInfoPtr if(deviceInfo) qDebug() << "device changed: " << *deviceInfo; - if(deviceInfo && m_failMap[m_curUserInfo.uid()][deviceInfo->id] >= maxFailedTimes){ + if(deviceInfo && m_failMap[m_curUserInfo->uid()][deviceInfo->id] >= maxFailedTimes){ qDebug() << "Failed MAX!!"; return ; } @@ -1670,18 +1685,18 @@ void AuthDialog::onBiometricAuthComplete(bool result, int nStatus) return; } else if (nStatus >= 2 && nStatus != 5){ if (m_deviceInfo) { - if(m_failMap.contains(m_curUserInfo.uid()) && m_failMap[m_curUserInfo.uid()].contains(m_deviceInfo->id)){ - m_failMap[m_curUserInfo.uid()][m_deviceInfo->id] = m_failMap[m_curUserInfo.uid()][m_deviceInfo->id] + 1; + if(m_failMap.contains(m_curUserInfo->uid()) && m_failMap[m_curUserInfo->uid()].contains(m_deviceInfo->id)){ + m_failMap[m_curUserInfo->uid()][m_deviceInfo->id] = m_failMap[m_curUserInfo->uid()][m_deviceInfo->id] + 1; }else{ - m_failMap[m_curUserInfo.uid()][m_deviceInfo->id] = 1; + m_failMap[m_curUserInfo->uid()][m_deviceInfo->id] = 1; } - qDebug()<<"Failed count:"<id]<<",Max:"<uid()][m_deviceInfo->id]<<",Max:"<deviceType == BioT_Face) { QImage imgFailed; setFaceImg(imgFailed, 1); m_fTimeoutTimes = 0; } - if(m_failMap[m_curUserInfo.uid()][m_deviceInfo->id] >= maxFailedTimes){ + if(m_failMap[m_curUserInfo->uid()][m_deviceInfo->id] >= maxFailedTimes){ if (m_deviceInfo->deviceType == UniT_Remote) { setLoginTypeTip(tr("Failed to verify %1, please enter password to unlock").arg(getDeviceType_tr(m_deviceInfo->deviceType))); QImage nullImage; @@ -1704,11 +1719,11 @@ void AuthDialog::onBiometricAuthComplete(bool result, int nStatus) if(m_deviceInfo->deviceType == LOGINOPT_TYPE_GENERAL_UKEY){ setUkeyTypeTip(tr("Failed to verify %1, you still have %2 verification opportunities") .arg(getDeviceType_tr(m_deviceInfo->deviceType)) - .arg(maxFailedTimes-m_failMap[m_curUserInfo.uid()][m_deviceInfo->id])); + .arg(maxFailedTimes-m_failMap[m_curUserInfo->uid()][m_deviceInfo->id])); }else { setLoginTypeTip(tr("Failed to verify %1, you still have %2 verification opportunities") .arg(getDeviceType_tr(m_deviceInfo->deviceType)) - .arg(maxFailedTimes-m_failMap[m_curUserInfo.uid()][m_deviceInfo->id])); + .arg(maxFailedTimes-m_failMap[m_curUserInfo->uid()][m_deviceInfo->id])); } } } @@ -1831,10 +1846,10 @@ void AuthDialog::onBiometricDbusChanged(bool bActive) //获取默认设备 if (m_loginOpts) { - if(m_curUserInfo.name() == "*login") + if(m_curUserInfo->name() == "*login") m_deviceName = m_loginOpts->getDefaultDevice(m_strManualLoginName); else - m_deviceName = m_loginOpts->getDefaultDevice(m_curUserInfo.name()); + m_deviceName = m_loginOpts->getDefaultDevice(m_curUserInfo->name()); } qDebug() << m_deviceName; if (m_deviceInfo) { @@ -1858,7 +1873,7 @@ void AuthDialog::onBiometricDbusChanged(bool bActive) } //已经错误超过3次 - if(m_failMap.contains(m_curUserInfo.uid()) && m_failMap[m_curUserInfo.uid()][m_deviceInfo->id] >= maxFailedTimes) { + if(m_failMap.contains(m_curUserInfo->uid()) && m_failMap[m_curUserInfo->uid()][m_deviceInfo->id] >= maxFailedTimes) { if (m_deviceInfo->deviceType == UniT_Remote) { setLoginTypeTip(tr("Failed to verify %1, please enter password to unlock").arg(getDeviceType_tr(m_deviceInfo->deviceType))); } else { @@ -1951,17 +1966,12 @@ QString AuthDialog::onCustomRequest(QString strReqJson) if (reqType == "GetInformations") { // 请求信息 QString strType = rootObj.value("Type").toString(); if (strType.contains("CurrentUser")) { // 当前用户信息 - if (m_curUserInfo.uid() >= 0 && !m_curUserInfo.name().isEmpty() && !m_curUserInfo.name().startsWith("*")) { + if (m_curUserInfo->uid() >= 0 && !m_curUserInfo->name().isEmpty() && !m_curUserInfo->name().startsWith("*")) { QJsonObject user; - user["Name"] = m_curUserInfo.name(); - user["Id"] = (double)(m_curUserInfo.uid()); - QFile faceFile(m_face); - if (!faceFile.exists()) { - user["HeadImg"] = m_strDefaultFace; - } else { - user["HeadImg"] = m_face; - } - user["RealName"] = m_curUserInfo.fullName(); + user["Name"] = m_curUserInfo->name(); + user["Id"] = (double)(m_curUserInfo->uid()); + user["HeadImg"] = m_curUserInfo->headImage(); + user["RealName"] = m_curUserInfo->fullName(); contentObj["CurrentUser"] = user; } else { retObj["Ret"] = -1; diff --git a/src/widgets/authdialog.h b/src/widgets/authdialog.h index 9d52775..f8cde66 100644 --- a/src/widgets/authdialog.h +++ b/src/widgets/authdialog.h @@ -25,7 +25,7 @@ class AuthDialog : public QWidget Q_OBJECT public: - explicit AuthDialog(LockDialogModel *model, UserInfo userInfo, QWidget *parent = nullptr); + explicit AuthDialog(LockDialogModel *model, UserInfoPtr userInfo, QWidget *parent = nullptr); void initUI(); void switchLoginOptType(unsigned uLoginOptType,bool faceBtnClicked = false); @@ -33,8 +33,8 @@ public: public: void startAuth(); void stopAuth(); - void onCurUserChanged(const UserInfo &userInfo); - void onCurUserInfoChanged(const UserInfo &userInfo); + void onCurUserChanged(UserInfoPtr userInfo); + void onCurUserInfoChanged(UserInfoPtr userInfo); void updateUI(); void updateAuthSize(); @@ -125,6 +125,7 @@ private: void initMessagerWidget(); void initUkeyPasswordWidget(); void initLoginoptionWidget(); + void initCustomAuthWidget(); void showAuthenticated(bool successful = true); void initConnections(); @@ -140,7 +141,6 @@ private: void restartBioAuth(); void waitBiometricServiceStatus(); QString getDeviceType_tr(int deviceType); - void setFace(const QString& facePath); void updatePixmap(); @@ -157,7 +157,6 @@ private: KLabel *m_nameLabel = nullptr; //用户名 QWidget *m_editWidget = nullptr; - QWidget *m_messageWidget = nullptr; IconEdit *m_passwordEdit = nullptr; //密码输入框 KLabel *m_messageLabel = nullptr; //PAM消息显示 QPushButton *m_messageButton = nullptr; //免密登录按钮 @@ -184,7 +183,7 @@ private: BioButtonListWidget *bottomListWidget = nullptr; - UserInfo m_curUserInfo; + UserInfoPtr m_curUserInfo; bool m_bRecvPrompt = false; bool m_bHasUnacknowledgedMsg = false; bool m_bDirectLogin = false; diff --git a/src/widgets/batterywidget.cpp b/src/widgets/batterywidget.cpp index 65db55f..2e838ae 100644 --- a/src/widgets/batterywidget.cpp +++ b/src/widgets/batterywidget.cpp @@ -21,6 +21,7 @@ #include #include #include +#include BatteryWidget::BatteryWidget(LockDialogModel *model, QWidget *parent) : QWidget(parent), @@ -107,14 +108,14 @@ void BatteryWidget::paintEvent(QPaintEvent *event) void BatteryWidget::onBatteryChanged(QStringList args) { - int battery = args.at(0).toInt(); - int batteryState = args.at(1).toInt(); - if (batteryState == 1 || batteryState == 5) { + m_nCurBatteryValue = args.at(0).toInt(); + m_nCurBatteryState = args.at(1).toInt(); + if (m_nCurBatteryState == 1 || m_nCurBatteryState == 5) { mStatusLabel->setText(tr("Charging...")); - } else if (batteryState == 4) { + } else if (m_nCurBatteryState == 4) { mStatusLabel->setText(tr("fully charged")); } - if (batteryState == 4 || batteryState == 1 || batteryState == 5) { + if (m_nCurBatteryState == 4 || m_nCurBatteryState == 1 || m_nCurBatteryState == 5) { mStatusLabel->setVisible(true); mModeLabel->setText(tr("PowerMode")); } else { @@ -122,10 +123,35 @@ void BatteryWidget::onBatteryChanged(QStringList args) mModeLabel->setText(tr("BatteryMode")); } - mValueLabel->setText(QString("%1%").arg(battery)); + mValueLabel->setText(QString("%1%").arg(m_nCurBatteryValue)); } void BatteryWidget::onBatteryStatusChanged(QString iconName) { mIconBtn->setIcon(QIcon::fromTheme(iconName)); } + +void BatteryWidget::changeEvent(QEvent *event) +{ + if(event->type() == QEvent::LanguageChange){ + refreshTranslate(); + } +} + +void BatteryWidget::refreshTranslate() +{ + if (m_nCurBatteryState == 1 || m_nCurBatteryState == 5) { + mStatusLabel->setText(tr("Charging...")); + } else if (m_nCurBatteryState == 4) { + mStatusLabel->setText(tr("fully charged")); + } + if (m_nCurBatteryState == 4 || m_nCurBatteryState == 1 || m_nCurBatteryState == 5) { + mStatusLabel->setVisible(true); + mModeLabel->setText(tr("PowerMode")); + } else { + mStatusLabel->setVisible(false); + mModeLabel->setText(tr("BatteryMode")); + } + + mValueLabel->setText(QString("%1%").arg(m_nCurBatteryValue)); +} diff --git a/src/widgets/batterywidget.h b/src/widgets/batterywidget.h index e1ba432..7d0cc93 100644 --- a/src/widgets/batterywidget.h +++ b/src/widgets/batterywidget.h @@ -38,6 +38,7 @@ public: protected: void paintEvent(QPaintEvent *event); + void changeEvent(QEvent *event); private: LockDialogModel *m_modelLockDialog = nullptr; @@ -46,11 +47,13 @@ private: QLabel *mValueLabel; QLabel *mStatusLabel; QPoint mPoint; + int m_nCurBatteryValue; + int m_nCurBatteryState; private Q_SLOTS: void onBatteryChanged(QStringList args); void onBatteryStatusChanged(QString iconName); - + void refreshTranslate(); }; #endif // BATTERYWIDGET_H diff --git a/src/widgets/blockwidget.cpp b/src/widgets/blockwidget.cpp index 48f3418..581e484 100644 --- a/src/widgets/blockwidget.cpp +++ b/src/widgets/blockwidget.cpp @@ -79,6 +79,8 @@ void BlockWidget::setTips(const QString tips) m_tipLabel->show(); m_listView->hide(); m_tipLabel->setText(tips); + m_cancelButton->setText(tr("Cancel")); + m_confirmButton->setText(tr("Confrim")); } void BlockWidget::setWarning(QStringList list, int type) @@ -130,5 +132,7 @@ void BlockWidget::setWarning(QStringList list, int type) "QPushButton:pressed {background: rgba(255, 255, 255, 0.3);border-radius: 8px;}"); sysFont.setPointSize((16 + m_curFontSize) *m_ptToPx); m_cancelButton->setFont(sysFont); + m_cancelButton->setText(tr("Cancel")); + m_confirmButton->setText(tr("Confrim")); } diff --git a/src/widgets/fullbackgroundwidget.cpp b/src/widgets/fullbackgroundwidget.cpp index f7c9a8d..9a05e41 100644 --- a/src/widgets/fullbackgroundwidget.cpp +++ b/src/widgets/fullbackgroundwidget.cpp @@ -545,6 +545,7 @@ void FullBackgroundWidget::showEvent(QShowEvent *event) { if(QX11Info::isPlatformX11()) tryGrabKeyboard(); + KWindowSystem::setType(this->winId(), NET::ScreenLock); } void FullBackgroundWidget::tryGrabKeyboard() diff --git a/src/widgets/iconedit.cpp b/src/widgets/iconedit.cpp index d2c4d70..9453bda 100644 --- a/src/widgets/iconedit.cpp +++ b/src/widgets/iconedit.cpp @@ -63,12 +63,9 @@ IconEdit::IconEdit(LockDialogModel *model, QWidget *parent) m_iconButton = new QPushButton(this); m_iconButton->installEventFilter(this); - m_iconButton->setFixedSize(24, 24); - m_iconButton->setIconSize(QSize(24, 24)); + m_iconButton->setFixedSize(24*scale, 24*scale); m_iconButton->setProperty("isRoundButton", true); m_iconButton->setProperty("isImportant", true); - setIcon(QIcon::fromTheme("go-next-symbolic")); - QHBoxLayout *layout = new QHBoxLayout(this); layout->setContentsMargins(1, 1, 8, 1); @@ -141,11 +138,12 @@ bool IconEdit::eventFilter(QObject *obj, QEvent *event) return false; } -void IconEdit::setIcon(const QIcon &icon) +void IconEdit::setIcon(const QIcon &icon, const QSize &size) { m_iconButton->setIcon(icon); m_iconButton->setText(""); - m_iconButton->setIconSize(QSize(24, 24)); + m_sizeIconBtn = size; + m_iconButton->setIconSize(QSize(m_sizeIconBtn.width()*scale, m_sizeIconBtn.height()*scale)); m_icon = icon; m_iconText = ""; } @@ -230,7 +228,7 @@ void IconEdit::stopWaiting() m_edit->setReadOnly(false); if (!m_icon.isNull()) { m_iconButton->setIcon(m_icon); - m_iconButton->setIconSize(QSize(24*scale, 24*scale)); + m_iconButton->setIconSize(QSize(m_sizeIconBtn.width()*scale, m_sizeIconBtn.height()*scale)); } else { m_iconButton->setText(m_iconText); } diff --git a/src/widgets/iconedit.h b/src/widgets/iconedit.h index 40be273..4b9cf9d 100644 --- a/src/widgets/iconedit.h +++ b/src/widgets/iconedit.h @@ -38,7 +38,7 @@ class IconEdit : public QWidget public: IconEdit(LockDialogModel *model,QWidget *parent = 0); - void setIcon(const QIcon &icon); + void setIcon(const QIcon &icon, const QSize &size); void clear(); void clearText(); void setPrompt(const QString &); @@ -79,6 +79,7 @@ private: QTimer *m_timer = nullptr; QPixmap m_waitingPixmap; bool m_capsState = false; + QSize m_sizeIconBtn; }; #endif // ICONEDIT_H diff --git a/src/widgets/lockwidget.cpp b/src/widgets/lockwidget.cpp index 07ebc6d..1a12a9b 100644 --- a/src/widgets/lockwidget.cpp +++ b/src/widgets/lockwidget.cpp @@ -32,6 +32,7 @@ #include "blockwidget.h" #include "pluginsloader.h" #include "global_utils.h" +#include "../lock-dialog/languagesetting.h" #define BLUR_RADIUS 300 #define RIGHT_MARGIN 24 @@ -45,10 +46,7 @@ LockWidget::LockWidget(LockDialogModel *model, QWidget *parent) , m_modelLockDialog(model) { scale = 1.0; - UserInfoPtr ptrUser = m_modelLockDialog->findUserByName(m_modelLockDialog->defaultUserName()); - if (ptrUser) { - m_curUserInfo = *ptrUser; - } + m_curUserInfo = m_modelLockDialog->findUserByName(m_modelLockDialog->defaultUserName()); initUI(); initConnections(); initUsdMediaKeys(); @@ -193,7 +191,7 @@ void LockWidget::resizeEvent(QResizeEvent *event) m_powerListWidget->move((width() - m_powerListWidget->width())/2, (height() - m_powerListWidget->height())/2 - BOTTOM_MARGIN*scale); updateBottomButton(); - if (m_curUserInfo.isLoggedIn() && m_sessionButton) { + if (m_curUserInfo->isLoggedIn() && m_sessionButton) { buttonListWidget->setFixedSize(QSize(48*(buttonListWidget->count() - 1) + buttonListWidget->spacing()*2*(buttonListWidget->count() - 1), 64)); } else { buttonListWidget->setFixedSize(QSize(48*buttonListWidget->count() + buttonListWidget->spacing()*2*buttonListWidget->count(), 64)); @@ -311,6 +309,7 @@ void LockWidget::initConnections() connect(authDialog, &AuthDialog::customRequestAccount, this, &LockWidget::onCustomRequestAccount); } + connect(LanguageSetting::instance(this), &LanguageSetting::languageChanged, this, &LockWidget::onLanguageChanged); } void LockWidget::initTimeWidget() { @@ -329,6 +328,10 @@ void LockWidget::initUserWidget() connect(m_userListWidget, &UserListWidget::userSelected, m_modelLockDialog, [=](QString strUserName){ SwitchToUser(strUserName); }); + connect(m_userListWidget, &UserListWidget::widgetSizeChanged, m_modelLockDialog, [=](){ + m_userListWidget->move(width() - m_userListWidget->width() - RIGHT_MARGIN, + height()- BOTTOM_MARGIN*scale - buttonListWidget->height() - buttonListWidget->spacing()*scale - m_userListWidget->height()); + }); m_userListWidget->clearFocus(); m_userListWidget->move(width() - m_userListWidget->width() - RIGHT_MARGIN, height()- BOTTOM_MARGIN*scale - buttonListWidget->height() - buttonListWidget->spacing()*scale - m_userListWidget->height()); @@ -385,7 +388,7 @@ void LockWidget::initButtonWidget() buttonListWidget->setItemWidget(m_btnItemSession, m_sessionButton); buttonListWidget->addItem(m_btnItemSession); m_sessionButton->setObjectName("BtnSession"); - if (m_curUserInfo.isLoggedIn()) { + if (m_curUserInfo->isLoggedIn()) { buttonListWidget->setItemHidden(m_btnItemSession, true); } else { buttonListWidget->setItemHidden(m_btnItemSession, false); @@ -494,7 +497,7 @@ void LockWidget::initButtonWidget() }); } - if (m_curUserInfo.isLoggedIn() && m_sessionButton) { + if (m_curUserInfo->isLoggedIn() && m_sessionButton) { buttonListWidget->setFixedSize(QSize(48*(buttonListWidget->count() - 1) + buttonListWidget->spacing()*2*(buttonListWidget->count() - 1), 64)); } else { buttonListWidget->setFixedSize(QSize(48*buttonListWidget->count() + buttonListWidget->spacing()*2*buttonListWidget->count(), 64)); @@ -642,9 +645,9 @@ void LockWidget::onUsersInfoChanged() height()- BOTTOM_MARGIN*scale - buttonListWidget->height() - buttonListWidget->spacing()*scale - m_userListWidget->height()); } } - UserInfoPtr ptrUser = m_modelLockDialog->findUserByName(m_curUserInfo.name()); + UserInfoPtr ptrUser = m_modelLockDialog->findUserByName(m_curUserInfo->name()); if (ptrUser) { - m_curUserInfo = *ptrUser; + m_curUserInfo = ptrUser; if (authDialog) { authDialog->onCurUserInfoChanged(m_curUserInfo); } @@ -654,11 +657,16 @@ void LockWidget::onUsersInfoChanged() void LockWidget::onCurUserChanged(const QString &strUserName) { UserInfoPtr ptrUser = m_modelLockDialog->findUserByName(strUserName); - if (ptrUser && authDialog) { - m_curUserInfo = *ptrUser; - authDialog->onCurUserChanged(m_curUserInfo); + if (ptrUser) { + m_curUserInfo = ptrUser; + qDebug()<<"CurUserInfo:"<<*m_curUserInfo; + if (m_curUserInfo->name() != "*login" && m_curUserInfo->name() != "*guest") { + LanguageSetting::instance()->onLanguageChanged(m_curUserInfo->lang()); + } + if (authDialog) + authDialog->onCurUserChanged(m_curUserInfo); } - if (m_btnItemSession && m_curUserInfo.isLoggedIn()) { + if (m_btnItemSession && m_curUserInfo->isLoggedIn()) { buttonListWidget->setItemHidden(m_btnItemSession, true); } else { buttonListWidget->setItemHidden(m_btnItemSession, false); @@ -795,6 +803,7 @@ void LockWidget::onShowNetworkWidget() m_networkWidget = new MyNetworkWidget(this); m_networkWidget->installEventFilter(this); } + m_networkWidget->loadNetPlugin(); m_networkWidget->setGeometry(this->width() - m_networkWidget->width() - RIGHT_MARGIN*scale, this->height() - m_networkWidget->height() - BOTTOM_MARGIN*scale - buttonListWidget->spacing()*scale - buttonListWidget->height(), m_networkWidget->width(), @@ -1053,3 +1062,12 @@ void LockWidget::SwitchToUser(QString strUserName) } } } + +void LockWidget::onLanguageChanged(bool isCompleted) +{ + if (isCompleted) { + if (m_networkWidget) { + m_networkWidget->unloadNetPlugin(); + } + } +} diff --git a/src/widgets/lockwidget.h b/src/widgets/lockwidget.h index 3fedf26..e7f1db0 100644 --- a/src/widgets/lockwidget.h +++ b/src/widgets/lockwidget.h @@ -119,6 +119,8 @@ private Q_SLOTS: void onSessionActiveChanged(bool isActive); + void onLanguageChanged(bool isCompleted); + Q_SIGNALS: void authSucceed(QString strUserName); @@ -138,7 +140,7 @@ private: LockDialogModel *m_modelLockDialog = nullptr; - UserInfo m_curUserInfo; + UserInfoPtr m_curUserInfo; AuthDialog *authDialog = nullptr; QTimer *m_timerChkActive = nullptr; diff --git a/src/widgets/mynetworkwidget.cpp b/src/widgets/mynetworkwidget.cpp index bc1b9fa..ccc447e 100644 --- a/src/widgets/mynetworkwidget.cpp +++ b/src/widgets/mynetworkwidget.cpp @@ -16,7 +16,6 @@ MyNetworkWidget::MyNetworkWidget(QWidget *parent) : QWidget(parent) { setObjectName("m_networkWidget"); setStyleSheet("#m_networkWidget{background-color: white; border-radius:12px;}"); - loadNetPlugin(); } void MyNetworkWidget::loadNetPlugin() diff --git a/src/widgets/mynetworkwidget.h b/src/widgets/mynetworkwidget.h index 542746f..b9c1b33 100644 --- a/src/widgets/mynetworkwidget.h +++ b/src/widgets/mynetworkwidget.h @@ -12,6 +12,9 @@ class MyNetworkWidget : public QWidget public: explicit MyNetworkWidget(QWidget *parent = nullptr); + void loadNetPlugin(); + void unloadNetPlugin(); + private Q_SLOTS: /** * @brief 网络窗口有线和无线弹窗切换事件,用于通知网络插件窗口切换 @@ -25,8 +28,6 @@ private Q_SLOTS: void paintEvent(QPaintEvent *p1); private: - void loadNetPlugin(); - void unloadNetPlugin(); void sendNetPluginVisible(bool visible); QPluginLoader netloader; diff --git a/src/widgets/powerlistwidget.cpp b/src/widgets/powerlistwidget.cpp index 7428c33..56fe5e0 100644 --- a/src/widgets/powerlistwidget.cpp +++ b/src/widgets/powerlistwidget.cpp @@ -143,3 +143,32 @@ void PowerListWidget::setSystemPowerStatus(QString statusName) qWarning() << __LINE__ << __FUNCTION__ << statusName; } + +void PowerListWidget::changeEvent(QEvent *event) +{ + if(event->type() == QEvent::LanguageChange){ + refreshTranslate(); + } +} + +void PowerListWidget::refreshTranslate() +{ + for (int i = 0; i < sizeof(powerBtnList)/sizeof(powerBtnList[0]) ; i++) + { + if (powerBtnList[i].setFuncName == "Hibernate") { + powerBtnList[i].m_strName = tr("Hibernate"); + powerBtnList[i].m_strToolTip = tr("Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left"); + } else if (powerBtnList[i].setFuncName == "Suspend") { + powerBtnList[i].m_strName = tr("Suspend"); + powerBtnList[i].m_strToolTip = tr("The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off"); + } else if (powerBtnList[i].setFuncName == "Reboot") { + powerBtnList[i].m_strName = tr("Restart"); + powerBtnList[i].m_strToolTip = tr("The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off"); + } else if (powerBtnList[i].setFuncName == "PowerOff") { + powerBtnList[i].m_strName = tr("Power Off"); + powerBtnList[i].m_strToolTip = tr("Close all apps, and then shut down your computer"); + } + } + onUpdateListInfo(); +} + diff --git a/src/widgets/powerlistwidget.h b/src/widgets/powerlistwidget.h index 7083b74..f8b3f0d 100644 --- a/src/widgets/powerlistwidget.h +++ b/src/widgets/powerlistwidget.h @@ -121,6 +121,7 @@ public: protected: bool eventFilter(QObject *obj, QEvent *event); + void changeEvent(QEvent *event); Q_SIGNALS: void mulUsersLogined(QString inhibitType); @@ -143,6 +144,7 @@ private: void initUI(); void initBtnShowFlag(); void initConnections(); + void refreshTranslate(); // void initDBusInterface(); }; diff --git a/src/widgets/sessionlistwidget.cpp b/src/widgets/sessionlistwidget.cpp index ed3f882..44a8cfe 100644 --- a/src/widgets/sessionlistwidget.cpp +++ b/src/widgets/sessionlistwidget.cpp @@ -44,8 +44,6 @@ void SessionListWidget::initConnections() { // 响应点击事件 connect(this, &SessionListWidget::itemClicked, this, &SessionListWidget::onListItemClicked); - - connect(m_modelLockDialog, &LockDialogModel::usersInfoChanged, this, &SessionListWidget::onUpdateListInfo); } void SessionListWidget::onUpdateListInfo() @@ -66,6 +64,7 @@ void SessionListWidget::onListItemClicked(QListWidgetItem *item) QWidget *widget = itemWidget(item); SessionItemWidget *currentItem = qobject_cast(widget); if (currentItem) { + this->hide(); Q_EMIT sessionSelected(currentItem->sessionName()); } } diff --git a/src/widgets/userlistwidget.cpp b/src/widgets/userlistwidget.cpp index e4c6c37..7ffa91b 100644 --- a/src/widgets/userlistwidget.cpp +++ b/src/widgets/userlistwidget.cpp @@ -42,7 +42,13 @@ void UserListWidget::onUpdateListInfo() UserItemWidget *itemWidget = new UserItemWidget(this); QPixmap p(user->headImage()); itemWidget->setUserPixmap(p); - itemWidget->setUserNickName(user->fullName()); + if (user->name() == "*login") { + itemWidget->setUserNickName(tr("Login")); + } else if (user->name() == "*guest") { + itemWidget->setUserNickName(tr("Guest")); + } else { + itemWidget->setUserNickName(user->fullName()); + } itemWidget->setUserStatus(user->isLoggedIn()); if (user->fullName() == m_modelLockDialog->currentUserName()) { setCurrentItem(userItem, QItemSelectionModel::SelectionFlag::SelectCurrent); @@ -71,4 +77,30 @@ void UserListWidget::updateWidgetSize() setFixedHeight(count() * 40 + 10); } adjustSize(); + Q_EMIT widgetSizeChanged(); +} + +void UserListWidget::changeEvent(QEvent *event) +{ + if(event->type() == QEvent::LanguageChange){ + refreshTranslate(); + } +} + +void UserListWidget::refreshTranslate() +{ + for (int n = 0; n < count(); n++) { + QListWidgetItem *widgetItem = item(n); + if (widgetItem) { + QWidget *widget = itemWidget(widgetItem); + UserItemWidget *item = qobject_cast(widget); + if (item) { + if (item->getUserName() == "*login") { + item->setUserNickName(tr("Login")); + } else if (item->getUserName() == "*guest") { + item->setUserNickName(tr("Guest")); + } + } + } + } } diff --git a/src/widgets/userlistwidget.h b/src/widgets/userlistwidget.h index 596bed6..e8a4254 100644 --- a/src/widgets/userlistwidget.h +++ b/src/widgets/userlistwidget.h @@ -22,10 +22,15 @@ public Q_SLOTS: Q_SIGNALS: void userSelected(QString strUserName); + void widgetSizeChanged(); + +protected: + void changeEvent(QEvent *event); private: void initUI(); void initConnections(); + void refreshTranslate(); private: LockDialogModel *m_modelLockDialog = nullptr;