diff --git a/debian/changelog b/debian/changelog index 3403aef..b3a1c29 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,34 @@ +ukui-screensaver (4.10.0.0-ok17~0223) nile; urgency=medium + + * BUG号:I8WNHS 藏文下,锁屏、登录界面电源电池界面未翻译 + I8W27Y 英文系统下,登录界面电源下的关机名称显示“Power Off”,桌面电源下的关机名称显示“Shut Down”,两处显示不一致 + I8WNIU 藏文下,锁屏、登录界面有线网络标签未翻译 + * 需求号:无 + * 其他改动说明:无 + * 其他改动影响域:无 + + -- Yang Min Fri, 23 Feb 2024 16:55:47 +0800 + +ukui-screensaver (4.10.0.0-ok16~0221) nile; urgency=medium + + * BUG号:I8WLT6 通过触摸屏长按虚拟键盘的按键,虚拟键盘会消失 + I8WLO6 点击虚拟键盘区域内部非按键区域,虚拟键盘也会消失 + I8WLLZ 平板模式下,锁屏、登录界面虚拟键盘未自动唤起 + * 需求号:无 + * 其他改动说明:无 + * 其他改动影响域:无 + + -- Yang Min Wed, 21 Feb 2024 14:57:45 +0800 + +ukui-screensaver (4.10.0.0-ok15~021917) nile; urgency=medium + + * BUG号:I8YHES 多显示器无法正常扩展或复制 + * 需求号:无 + * 其他改动说明:无 + * 其他改动影响域:无 + + -- Yang Min Mon, 19 Feb 2024 17:54:38 +0800 + ukui-screensaver (4.10.0.0-ok14~0202) nile; urgency=medium * BUG:无 diff --git a/debian/control b/debian/control index c6f18fe..8acf245 100644 --- a/debian/control +++ b/debian/control @@ -37,7 +37,8 @@ Build-Depends: debhelper-compat (= 12), libkysdk-systime-dev, liblightdm-qt5-3-dev, libsystemd-dev, - libssl-dev + libssl-dev, + libxrandr-dev Standards-Version: 4.5.0 Rules-Requires-Root: no Homepage: https://www.github.com/ukui/ukui-screensaver diff --git a/i18n_ts/bo.ts b/i18n_ts/bo.ts index a7049f6..e0cfd57 100644 --- a/i18n_ts/bo.ts +++ b/i18n_ts/bo.ts @@ -4,7 +4,7 @@ AgreementWindow - + I know @@ -12,169 +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 - + + + 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! + + + + + + Authentication failure, Please try again + + + + + login + + + + 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 @@ -182,22 +182,26 @@ BatteryWidget - + + Charging... - + + fully charged - + + PowerMode - + + BatteryMode @@ -205,36 +209,36 @@ 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! @@ -384,6 +388,25 @@ + + KBTitle + + + + Suspended state + + + + + Close + + + + + Welt status + + + LettersWidget @@ -400,17 +423,17 @@ LightDMHelper - + failed to start session. - + Login - + Guest @@ -418,7 +441,7 @@ LockWidget - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -426,58 +449,58 @@ LoginOptionsWidget - - + + Login Options - + Password - + Other - + Identify device removed! - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey - + QRCode @@ -485,12 +508,12 @@ MyNetworkWidget - + LAN - + WLAN @@ -512,44 +535,91 @@ PowerListWidget - + + Hibernate - + + Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left - + + Suspend - - + + + The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off - + + Restart - - Power Off + + + Shut Down - + + Close all apps, and then shut down your computer + + + Close all apps, turn off your computer, and then turn your computer back on + + QObject + + + FingerPrint + + + + + FingerVein + + + + + Iris + + + + + Face + + + + + VoicePrint + + + + + Ukey + + + + + QRCode + + The screensaver is active. @@ -560,41 +630,6 @@ The screensaver is inactive. - - - FingerPrint - - - - - FingerVein - - - - - Iris - - - - - Face - - - - - VoicePrint - - - - - Ukey - - - - - QRCode - - S: @@ -613,7 +648,7 @@ - + View @@ -629,14 +664,14 @@ UserListWidget - - + + Login - - + + Guest @@ -673,23 +708,13 @@ main - - Screensaver for ukui-screensaver + + Backend for the ukui ScreenSaver. - - show on root window - - - - - show on window. - - - - - window id + + lock the screen by startup @@ -756,13 +781,23 @@ - - Backend for the ukui ScreenSaver. + + Screensaver for ukui-screensaver - - lock the screen by startup + + show on root window + + + + + show on window. + + + + + window id diff --git a/i18n_ts/bo_CN.ts b/i18n_ts/bo_CN.ts index 41d53e8..b6a3cbc 100644 --- a/i18n_ts/bo_CN.ts +++ b/i18n_ts/bo_CN.ts @@ -2307,6 +2307,11 @@ Close all apps, and then shut down your computer བཀོལ་སྤྱོད་ཡོད་ཚད་སྒོ་བརྒྱབ་ནས་གློག་ཀླད་སྒོ་རྒྱག་དགོས། + + + Close all apps, turn off your computer, and then turn your computer back on + སྤྱོད་སྒོ་ཡོད་ཚད་སྒོ་བརྒྱབ་ནས་གློག་ཀླད་སྒོ་རྒྱག་པ་དང་། དེ་ནས་ཡང་བསྐྱར་གློག་ཀླད་ཀྱི་ཁ་ཕྱེ་བ་རེད། + PowerManager diff --git a/i18n_ts/de.ts b/i18n_ts/de.ts index 89efd18..ae45fdd 100644 --- a/i18n_ts/de.ts +++ b/i18n_ts/de.ts @@ -4,7 +4,7 @@ AgreementWindow - + I know Ich weiß @@ -24,7 +24,7 @@ 使用密码认证 - + Retry Wiederholen @@ -53,130 +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 @@ -185,8 +185,8 @@ 使用绑定的微信扫码或输入密码登录 - - + + Password cannot be empty Das Kennwort darf nicht leer sein. @@ -199,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 @@ -229,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 @@ -248,13 +248,13 @@ Stecken Sie den Ukey in den USB-Anschluss - + Password Passwort - - + + Login Einloggen @@ -282,22 +282,26 @@ BatteryWidget - + + Charging... - + + fully charged - + + PowerMode - + + BatteryMode @@ -373,36 +377,36 @@ 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! @@ -1664,6 +1668,25 @@ Code abrufen + + KBTitle + + + + Suspended state + + + + + Close + + + + + Welt status + + + KylinDBus @@ -1894,17 +1917,17 @@ LightDMHelper - + failed to start session. - + Login Einloggen - + Guest 游客 @@ -1948,7 +1971,7 @@ WLAN - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -1956,53 +1979,53 @@ LoginOptionsWidget - - + + Login Options Login-Optionen - + Password Passwort - + Other Andere - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey Ukey - + QRCode QRCode @@ -2011,7 +2034,7 @@ 微信 - + Identify device removed! Gerät identifizieren entfernt! @@ -2026,12 +2049,12 @@ MyNetworkWidget - + LAN LAN - + WLAN WLAN @@ -2206,41 +2229,57 @@ PowerListWidget - + + Hibernate Überwintern - + + Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left Schalten Sie Ihren Computer aus, aber die App bleibt geöffnet. Wenn der Computer eingeschaltet ist, kann er in den Zustand zurückversetzt werden, den Sie verlassen haben - + + Suspend Aufhängen - - + + + The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off Der Computer bleibt eingeschaltet, verbraucht aber weniger Strom. Die App bleibt geöffnet und kann schnell wieder aufwachen und dort weitermachen, wo Sie aufgehört haben - + + Restart Neustarten - - Power Off - Ausschalten + + + Shut Down + Herunterfahren - + Power Off + Ausschalten + + + + Close all apps, and then shut down your computer Schließen Sie alle Apps, und fahren Sie dann den Computer herunter + + + Close all apps, turn off your computer, and then turn your computer back on + Schließen Sie alle Apps, schalten Sie den Computer aus und wieder ein + PowerManager @@ -2330,37 +2369,37 @@ Der Bildschirmschoner ist inaktiv. - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey Ukey - + QRCode QRCode @@ -2406,7 +2445,7 @@ Sie haben eine neue Benachrichtigung - + View Ansehen @@ -2522,14 +2561,14 @@ UserListWidget - - + + Login Einloggen - - + + Guest 游客 @@ -2705,12 +2744,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 d7141cf..b5ef5cc 100644 --- a/i18n_ts/es.ts +++ b/i18n_ts/es.ts @@ -4,7 +4,7 @@ AgreementWindow - + I know Lo sé @@ -24,7 +24,7 @@ 使用密码认证 - + Retry Reintentar @@ -53,130 +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 @@ -185,8 +185,8 @@ 使用绑定的微信扫码或输入密码登录 - - + + Password cannot be empty La contraseña no puede estar vacía @@ -199,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 @@ -229,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 @@ -248,13 +248,13 @@ Inserte la ukey en el puerto USB - + Password Contraseña - - + + Login Iniciar sesión @@ -282,22 +282,26 @@ BatteryWidget - + + Charging... - + + fully charged - + + PowerMode - + + BatteryMode @@ -373,36 +377,36 @@ 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! @@ -1664,6 +1668,25 @@ Obtener código + + KBTitle + + + + Suspended state + + + + + Close + + + + + Welt status + + + KylinDBus @@ -1894,17 +1917,17 @@ LightDMHelper - + failed to start session. - + Login Iniciar sesión - + Guest 游客 @@ -1952,7 +1975,7 @@ WLAN - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -1960,53 +1983,53 @@ LoginOptionsWidget - - + + Login Options Opciones de inicio de sesión - + Password Contraseña - + Other Otro - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey Ukey - + QRCode QRCode @@ -2015,7 +2038,7 @@ 微信 - + Identify device removed! ¡Identifique el dispositivo eliminado! @@ -2030,12 +2053,12 @@ MyNetworkWidget - + LAN LAN - + WLAN WLAN @@ -2210,41 +2233,57 @@ PowerListWidget - + + Hibernate Hibernar - + + Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left Apague su computadora, pero la aplicación permanece abierta. Cuando se enciende la computadora, se puede restaurar al estado en el que la dejó - + + Suspend Suspender - - + + + The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off El ordenador permanece encendido, pero consume menos energía. La aplicación permanece abierta y puede despertarse rápidamente y volver a donde la dejó - + + Restart Reanudar - - Power Off - Apagar + + + Shut Down + Apaga - + Power Off + Apagar + + + + Close all apps, and then shut down your computer Cierre todas las aplicaciones y, a continuación, apague el equipo + + + Close all apps, turn off your computer, and then turn your computer back on + Cierre todas las aplicaciones, apague el equipo y, a continuación, vuelva a encenderlo + PowerManager @@ -2334,37 +2373,37 @@ El protector de pantalla está inactivo. - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey Ukey - + QRCode QRCode @@ -2410,7 +2449,7 @@ Tienes una nueva notificación - + View Vista @@ -2526,14 +2565,14 @@ UserListWidget - - + + Login Iniciar sesión - - + + Guest 游客 @@ -2709,12 +2748,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 63b9f5c..f4ae615 100644 --- a/i18n_ts/fr.ts +++ b/i18n_ts/fr.ts @@ -4,7 +4,7 @@ AgreementWindow - + I know Je sais @@ -24,7 +24,7 @@ 使用密码认证 - + Retry Réessayer @@ -53,130 +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 @@ -185,8 +185,8 @@ 使用绑定的微信扫码或输入密码登录 - - + + Password cannot be empty Le mot de passe ne peut pas être vide @@ -199,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 @@ -229,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 @@ -248,13 +248,13 @@ Insérez l’ukey dans le port USB - + Password Mot de passe - - + + Login Connectez-vous @@ -282,22 +282,26 @@ BatteryWidget - + + Charging... - + + fully charged - + + PowerMode - + + BatteryMode @@ -373,36 +377,36 @@ 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 ! @@ -1664,6 +1668,25 @@ Obtenir le code + + KBTitle + + + + Suspended state + + + + + Close + + + + + Welt status + + + KylinDBus @@ -1894,17 +1917,17 @@ LightDMHelper - + failed to start session. - + Login Connectez-vous - + Guest 游客 @@ -1948,7 +1971,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? @@ -1956,53 +1979,53 @@ LoginOptionsWidget - - + + Login Options Options de connexion - + Password Mot de passe - + Other Autre - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey Ukey (en anglais seulement) - + QRCode QRCode @@ -2011,7 +2034,7 @@ 微信 - + Identify device removed! Identifier l’appareil supprimé ! @@ -2026,12 +2049,12 @@ MyNetworkWidget - + LAN LAN - + WLAN Réseau local sans fil (WLAN) @@ -2206,41 +2229,57 @@ PowerListWidget - + + Hibernate Hiberner - + + Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left Éteignez votre ordinateur, mais l’application reste ouverte. Lorsque l’ordinateur est allumé, il peut être restauré dans l’état que vous avez laissé - + + Suspend Suspendre - - + + + The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off L’ordinateur reste allumé, mais consomme moins d’énergie. L’application reste ouverte et peut rapidement se réveiller et revenir à l’endroit où vous vous étiez arrêté - + + Restart Redémarrer - - Power Off - Mise hors tension + + + Shut Down + Arrêter - + Power Off + Mise hors tension + + + + Close all apps, and then shut down your computer Fermez toutes les applications, puis éteignez votre ordinateur + + + Close all apps, turn off your computer, and then turn your computer back on + Fermez toutes les applications, éteignez votre ordinateur, puis rallumez-le + PowerManager @@ -2330,37 +2369,37 @@ L’économiseur d’écran est inactif. - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey Ukey (en anglais seulement) - + QRCode QRCode @@ -2406,7 +2445,7 @@ Vous avez reçu une nouvelle notification - + View Vue @@ -2522,14 +2561,14 @@ UserListWidget - - + + Login Connectez-vous - - + + Guest 游客 @@ -2705,12 +2744,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 738b367..0c834af 100644 --- a/i18n_ts/kk.ts +++ b/i18n_ts/kk.ts @@ -4,7 +4,7 @@ AgreementWindow - + I know @@ -24,7 +24,7 @@ 使用密码认证 - + Retry Ретри @@ -53,130 +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 @@ -185,8 +185,8 @@ 使用绑定的微信扫码或输入密码登录 - - + + Password cannot be empty Құпия сөз бос болмады @@ -199,8 +199,8 @@ 无法验证%1,请输入密码. - - + + Failed to verify %1, you still have %2 verification opportunities % 1 дегенді тексеру мүмкін болмады, сізде әлі де% 2 тексеру мүмкіндіктері бар @@ -229,24 +229,24 @@ 请输入密码或者录入指纹 - - + + Authentication failure, Please try again Аутентификация сәтсіздігі, қайталап көріңіз - + Use the bound wechat scanning code or enter the password to unlock Байланыстыратын wechat сканерлеу кодын пайдаланыңыз немесе құлыптан босату үшін құпия сөзді енгізіңіз - + Password Пароль - - + + Login Кіру @@ -274,22 +274,26 @@ BatteryWidget - + + Charging... - + + fully charged - + + PowerMode - + + BatteryMode @@ -365,36 +369,36 @@ 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! Жүйенің жорыққа шығуына жол бермеу үшін келесі бағдарлама іске асырылуда! @@ -1645,6 +1649,25 @@ Кодты алу + + KBTitle + + + + Suspended state + + + + + Close + + + + + Welt status + + + KeyboardWidget @@ -1874,17 +1897,17 @@ LightDMHelper - + failed to start session. - + Login Кіру - + Guest 游客 @@ -1912,7 +1935,7 @@ Бірнеше пайдаланушы бір уақытта кіргізіледі. Бұл жүйені қайта жүктеу керек пе? - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -1920,53 +1943,53 @@ LoginOptionsWidget - - + + Login Options Кіру параметрлері - + Password 密码 - + Other - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey - + QRCode QRCode @@ -1975,7 +1998,7 @@ 微信 - + Identify device removed! Құрылғы жойылғанын анықтаңыз! @@ -1990,12 +2013,12 @@ MyNetworkWidget - + LAN ЛАН - + WLAN WLAN @@ -2170,41 +2193,57 @@ PowerListWidget - + + Hibernate Хибернате - + + Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left - + + Suspend Тоқтата тұру - - + + + The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off - + + Restart Қайта іске қосу - - Power Off - Power Off + + + Shut Down + Тоқтату - + + Close all apps, and then shut down your computer + + Power Off + Power Off + + + + Close all apps, turn off your computer, and then turn your computer back on + + PowerManager @@ -2278,37 +2317,37 @@ Экрандаушы белсенді емес. - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey - + QRCode QRCode @@ -2354,7 +2393,7 @@ Сізде жаңа хабарландыру бар - + View Көрініс @@ -2470,14 +2509,14 @@ UserListWidget - - + + Login Кіру - - + + Guest 游客 @@ -2653,12 +2692,12 @@ терезе идентифика- ты - + Backend for the ukui ScreenSaver. - + lock the screen by startup diff --git a/i18n_ts/ky.ts b/i18n_ts/ky.ts index 2c6c34c..d913128 100644 --- a/i18n_ts/ky.ts +++ b/i18n_ts/ky.ts @@ -4,7 +4,7 @@ AgreementWindow - + I know @@ -24,7 +24,7 @@ 使用密码认证 - + Retry Ретри @@ -53,130 +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 @@ -185,8 +185,8 @@ 使用绑定的微信扫码或输入密码登录 - - + + Password cannot be empty Сырсөз бош болушу мүмкүн эмес @@ -199,8 +199,8 @@ 无法验证%1,请输入密码. - - + + Failed to verify %1, you still have %2 verification opportunities %1 текшерүүгө болбоду, сизде дагы эле %2 текшерүү мүмкүнчүлүктөрү бар @@ -229,24 +229,24 @@ 请输入密码或者录入指纹 - - + + Authentication failure, Please try again Аутентификациянын жетишсиздиги, сураныч, кайрадан аракет кылыңыз - + Use the bound wechat scanning code or enter the password to unlock Чектелген вечат сканерлеу кодын колдонуңуз же сырсөздү ачуу үчүн киргизиңиз - + Password Сырсөз - - + + Login Кирүү @@ -274,22 +274,26 @@ BatteryWidget - + + Charging... - + + fully charged - + + PowerMode - + + BatteryMode @@ -365,36 +369,36 @@ 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! Системанын уктап кетишине жол бербөө үчүн төмөнкү программа иштеп жатат! @@ -1645,6 +1649,25 @@ Кодду алуу + + KBTitle + + + + Suspended state + + + + + Close + + + + + Welt status + + + KeyboardWidget @@ -1874,17 +1897,17 @@ LightDMHelper - + failed to start session. - + Login Кирүү - + Guest 游客 @@ -1912,7 +1935,7 @@ Бир эле учурда бир нече колдонуучулар катталган. Сиз бул системаны кайра жүктөп келет деп ишенесизби? - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -1920,53 +1943,53 @@ LoginOptionsWidget - - + + Login Options Кирүү параметрлери - + Password 密码 - + Other - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey - + QRCode QRCode @@ -1975,7 +1998,7 @@ 微信 - + Identify device removed! Орнотмо алынып салынганын аныктоо! @@ -1990,12 +2013,12 @@ MyNetworkWidget - + LAN ЛАН - + WLAN ВЛАН @@ -2170,41 +2193,57 @@ PowerListWidget - + + Hibernate Хибернат - + + Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left - + + Suspend Токтотуу - - + + + The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off - + + Restart Кайра иштетүү - - Power Off - Электр энергиясын өчүрүү + + + Shut Down + Өчүрүү - + + Close all apps, and then shut down your computer + + Power Off + Электр энергиясын өчүрүү + + + + Close all apps, turn off your computer, and then turn your computer back on + + PowerManager @@ -2278,37 +2317,37 @@ Экран сактагыч активдүү эмес. - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey - + QRCode QRCode @@ -2354,7 +2393,7 @@ Сизде жаңы билдирүү бар - + View Көрүү @@ -2470,14 +2509,14 @@ UserListWidget - - + + Login Кирүү - - + + Guest 游客 @@ -2653,12 +2692,12 @@ терезе идентификату - + Backend for the ukui ScreenSaver. - + lock the screen by startup diff --git a/i18n_ts/mn.ts b/i18n_ts/mn.ts index 878ef7e..d887d0e 100644 --- a/i18n_ts/mn.ts +++ b/i18n_ts/mn.ts @@ -2310,6 +2310,15 @@ Close all apps, and then shut down your computer བཀོལ་སྤྱོད་ཡོད་ཚད་སྒོ་བརྒྱབ་ནས་རྩིས་འཁོར་སྒོ་རྒྱག་དགོས། + + Power Off + ᠬᠠᠭᠠᠬᠤ + + + + Close all apps, turn off your computer, and then turn your computer back on + ᠪᠤᠢ ᠪᠥᠬᠥᠢ ᠬᠡᠷᠡᠭ᠍ᠯᠡᠭᠡ ᠶᠢ ᠬᠠᠭᠠᠵᠤ ᠂ ᠺᠣᠮᠫᠢᠦ᠋ᠲ᠋ᠧᠷ ᠢ ᠬᠠᠭᠠᠵᠤ ᠂ ᠳᠠᠷᠠᠭ᠎ᠠ ᠨᠢ ᠺᠣᠮᠫᠢᠦ᠋ᠲ᠋ᠧᠷ ᠢ ᠳᠠᠬᠢᠨ ᠨᠡᠭᠡᠭᠡᠨ᠎ᠡ ᠃ + PowerManager diff --git a/i18n_ts/pt.ts b/i18n_ts/pt.ts index 37d4686..d4844df 100644 --- a/i18n_ts/pt.ts +++ b/i18n_ts/pt.ts @@ -43,24 +43,28 @@ Senha incorreta, por favor tente novamente - Authentication failure, Please try again - + FingerPrint + Impressão digital - Please try again in %1 minutes. - + FingerVein + FingerVein - Please try again in %1 seconds. - + Iris + Íris - Account locked permanently. - + Face + Face - Password cannot be empty - + VoicePrint + VoicePrint + + + Guest + Convidado Login @@ -86,34 +90,22 @@ Verify iris or enter password to unlock - - Failed to verify %1, you still have %2 verification opportunities - - Use the bound wechat scanning code or enter the password to unlock - Failed to verify %1, please enter password to unlock - - - - Unable to verify %1, please enter password to unlock - - - - Input Password - - - - Abnormal network + Password cannot be empty Password + + Input Password + + Username @@ -122,34 +114,46 @@ User name input error! + + Authentication failure, Please try again + + login + + 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 - Impressão digital - - - FingerVein - FingerVein - - - Iris - Íris - - - Face - Face - - - VoicePrint - VoicePrint - Ukey @@ -158,10 +162,6 @@ QRCode - - Guest - Convidado - BatteryWidget @@ -470,6 +470,21 @@ + + KBTitle + + Suspended state + + + + Close + + + + Welt status + + + KeyboardWidget @@ -490,6 +505,10 @@ LightDMHelper + + Guest + Convidado + failed to start session. @@ -498,10 +517,6 @@ Login - - Guest - Convidado - LockWidget @@ -532,22 +547,10 @@ LoginOptionsWidget - - Login Options - - Password Senha - - Identify device removed! - - - - Other - - FingerPrint Impressão digital @@ -568,6 +571,18 @@ VoicePrint VoicePrint + + Login Options + + + + Other + + + + Identify device removed! + + Ukey @@ -636,13 +651,17 @@ - Power Off + Shut Down Close all apps, and then shut down your computer + + Close all apps, turn off your computer, and then turn your computer back on + + PowerManager @@ -653,14 +672,6 @@ QObject - - The screensaver is active. - - - - The screensaver is inactive. - - FingerPrint Impressão digital @@ -689,6 +700,14 @@ QRCode + + The screensaver is active. + + + + The screensaver is inactive. + + S: @@ -729,14 +748,14 @@ UserListWidget - - Login - - Guest Convidado + + Login + + Widget @@ -781,6 +800,46 @@ activated by session idle signal ativado por sinal ocioso de sessão + + Backend for the ukui ScreenSaver. + + + + lock the screen by startup + + + + query the status of the screen saver + + + + unlock the screen saver + + + + show the screensaver + + + + show blank and delay to lock,param:idle/lid/lowpower + + + + lock the screen and show screensaver immediately + + + + show screensaver immediately + + + + show blank screensaver immediately and delay time to show lock + + + + show blank screensaver immediately and if lock + + Screensaver for ukui-screensaver @@ -797,45 +856,5 @@ window id - - query the status of the screen saver - - - - lock the screen and show screensaver immediately - - - - unlock the screen saver - - - - show the screensaver - - - - show screensaver immediately - - - - show blank and delay to lock,param:idle/lid/lowpower - - - - show blank screensaver immediately and delay time to show lock - - - - show blank screensaver immediately and if lock - - - - Backend for the ukui ScreenSaver. - - - - lock the screen by startup - - diff --git a/i18n_ts/ru.ts b/i18n_ts/ru.ts index ad5ee8b..727d0b5 100644 --- a/i18n_ts/ru.ts +++ b/i18n_ts/ru.ts @@ -43,24 +43,28 @@ Пароль неверен, повторите попытку - Authentication failure, Please try again - + FingerPrint + FingerPrint - Please try again in %1 minutes. - + FingerVein + FingerVein - Please try again in %1 seconds. - + Iris + Ирис - Account locked permanently. - + Face + Лицо - Password cannot be empty - + VoicePrint + Voiceprint + + + Guest + гость Login @@ -86,34 +90,22 @@ Verify iris or enter password to unlock - - Failed to verify %1, you still have %2 verification opportunities - - Use the bound wechat scanning code or enter the password to unlock - Failed to verify %1, please enter password to unlock - - - - Unable to verify %1, please enter password to unlock - - - - Input Password - - - - Abnormal network + Password cannot be empty Password + + Input Password + + Username @@ -122,34 +114,46 @@ User name input error! + + Authentication failure, Please try again + + login + + 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 - FingerPrint - - - FingerVein - FingerVein - - - Iris - Ирис - - - Face - Лицо - - - VoicePrint - Voiceprint - Ukey @@ -158,10 +162,6 @@ QRCode - - Guest - гость - BatteryWidget @@ -470,6 +470,21 @@ + + KBTitle + + Suspended state + + + + Close + + + + Welt status + + + KeyboardWidget @@ -490,6 +505,10 @@ LightDMHelper + + Guest + гость + failed to start session. @@ -498,10 +517,6 @@ Login - - Guest - гость - LockWidget @@ -532,22 +547,10 @@ LoginOptionsWidget - - Login Options - - Password пароль - - Identify device removed! - - - - Other - - FingerPrint FingerPrint @@ -568,6 +571,18 @@ VoicePrint Voiceprint + + Login Options + + + + Other + + + + Identify device removed! + + Ukey @@ -636,13 +651,17 @@ - Power Off + Shut Down Close all apps, and then shut down your computer + + Close all apps, turn off your computer, and then turn your computer back on + + PowerManager @@ -653,14 +672,6 @@ QObject - - The screensaver is active. - - - - The screensaver is inactive. - - FingerPrint FingerPrint @@ -689,6 +700,14 @@ QRCode + + The screensaver is active. + + + + The screensaver is inactive. + + S: @@ -729,14 +748,14 @@ UserListWidget - - Login - - Guest гость + + Login + + Widget @@ -781,6 +800,46 @@ activated by session idle signal активируется сигналом холостого хода + + Backend for the ukui ScreenSaver. + + + + lock the screen by startup + + + + query the status of the screen saver + + + + unlock the screen saver + + + + show the screensaver + + + + show blank and delay to lock,param:idle/lid/lowpower + + + + lock the screen and show screensaver immediately + + + + show screensaver immediately + + + + show blank screensaver immediately and delay time to show lock + + + + show blank screensaver immediately and if lock + + Screensaver for ukui-screensaver @@ -797,45 +856,5 @@ window id - - query the status of the screen saver - - - - lock the screen and show screensaver immediately - - - - unlock the screen saver - - - - show the screensaver - - - - show screensaver immediately - - - - show blank and delay to lock,param:idle/lid/lowpower - - - - show blank screensaver immediately and delay time to show lock - - - - show blank screensaver immediately and if lock - - - - Backend for the ukui ScreenSaver. - - - - lock the screen by startup - - diff --git a/i18n_ts/tr.ts b/i18n_ts/tr.ts index eaed354..3bb0040 100644 --- a/i18n_ts/tr.ts +++ b/i18n_ts/tr.ts @@ -4,7 +4,7 @@ AgreementWindow - + I know @@ -24,7 +24,7 @@ Parola - + Retry Yeniden Dene @@ -49,164 +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 - - - - + + + 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! + + + + + + Authentication failure, Please try again + + + + + login + + + + + 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 Parmak İzi - + FingerVein - + Iris Göz - + Face Yüz - + VoicePrint Ses İzi - + Ukey - + QRCode @@ -226,22 +226,26 @@ BatteryWidget - + + Charging... - + + fully charged - + + PowerMode - + + BatteryMode @@ -317,36 +321,36 @@ 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! @@ -582,6 +586,25 @@ Tamam + + KBTitle + + + + Suspended state + + + + + Close + + + + + Welt status + + + LettersWidget @@ -598,17 +621,17 @@ LightDMHelper - + failed to start session. - + Login - + Guest Misafir @@ -632,7 +655,7 @@ Kullanıcı Değiştir - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -640,58 +663,58 @@ LoginOptionsWidget - - + + Login Options - + Password Parola - + Other - + Identify device removed! - + FingerPrint Parmak İzi - + FingerVein - + Iris Göz - + Face Yüz - + VoicePrint Ses İzi - + Ukey - + QRCode @@ -699,12 +722,12 @@ MyNetworkWidget - + LAN - + WLAN @@ -726,41 +749,57 @@ PowerListWidget - + + Hibernate - + + Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left - + + Suspend - - + + + The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off - + + Restart Yeniden Başlat - - Power Off - Bilgisayarı Kapat + + + Shut Down + - + + Close all apps, and then shut down your computer + + Power Off + Bilgisayarı Kapat + + + + Close all apps, turn off your computer, and then turn your computer back on + + PowerManager @@ -807,6 +846,41 @@ QObject + + + FingerPrint + Parmak İzi + + + + FingerVein + + + + + Iris + Göz + + + + Face + Yüz + + + + VoicePrint + Ses İzi + + + + Ukey + + + + + QRCode + + The screensaver is active. @@ -817,41 +891,6 @@ The screensaver is inactive. - - - FingerPrint - Parmak İzi - - - - FingerVein - - - - - Iris - Göz - - - - Face - Yüz - - - - VoicePrint - Ses İzi - - - - Ukey - - - - - QRCode - - S: @@ -872,16 +911,6 @@ exit çıkış - - - Picture does not exist - - - - - View - - Set as desktop wallpaper Masaüstü arkaplanı olarak ayarla @@ -890,6 +919,16 @@ Automatic switching Otomatik değiştir + + + Picture does not exist + + + + + View + + SleepTime @@ -902,14 +941,14 @@ UserListWidget - - + + Login - - + + Guest Misafir @@ -977,6 +1016,16 @@ show blank and delay to lock,param:idle/lid/lowpower + + + Backend for the ukui ScreenSaver. + + + + + lock the screen by startup + + Dialog for the ukui ScreenSaver. @@ -1028,15 +1077,5 @@ window id - - - Backend for the ukui ScreenSaver. - - - - - lock the screen by startup - - diff --git a/i18n_ts/ug.ts b/i18n_ts/ug.ts index 79732f2..f0bc847 100644 --- a/i18n_ts/ug.ts +++ b/i18n_ts/ug.ts @@ -4,7 +4,7 @@ AgreementWindow - + I know @@ -24,7 +24,7 @@ 使用密码认证 - + Retry قايتا قايتا تىرشىش @@ -53,130 +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 @@ -185,8 +185,8 @@ 使用绑定的微信扫码或输入密码登录 - - + + Password cannot be empty مەخپىي نومۇرنى بوش قويۇشقا بولمايدۇ @@ -199,8 +199,8 @@ 无法验证%1,请输入密码. - - + + Failed to verify %1, you still have %2 verification opportunities ٪1 نى دەلىللەش مەغلۇپ بولدى، سىزدە يەنىلا ٪2 دەلىللەش پۇرسىتى بار @@ -229,24 +229,24 @@ 请输入密码或者录入指纹 - - + + Authentication failure, Please try again دەلىللەش مەغلۇپ بولدى، قايتا سىناپ بېقىڭ - + Use the bound wechat scanning code or enter the password to unlock باغلانغان ئۈندىدارنى سىكاننېرلاش كودى ياكى مەخپىي نومۇرىنى كىرگۈزۈپ قۇلۇپ ئېچىش - + Password ئىم - - + + Login كىرىش @@ -274,22 +274,26 @@ BatteryWidget - + + Charging... - + + fully charged - + + PowerMode - + + BatteryMode @@ -365,36 +369,36 @@ 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! سېستىمىنىڭ تىزگىنلەپ قېلىشىنىڭ ئالدىنى ئېلىش ئۈچۈن تۆۋەندىكى پروگرامما ئىجرا بولىۋاتىدۇ! @@ -1645,6 +1649,25 @@ كود ئېلىش + + KBTitle + + + + Suspended state + + + + + Close + + + + + Welt status + + + KeyboardWidget @@ -1874,17 +1897,17 @@ LightDMHelper - + failed to start session. - + Login كىرىش - + Guest 游客 @@ -1912,7 +1935,7 @@ بىرلا ۋاقىتتا كۆپ ئابونت تىزىملىتىپ كىرىدۇ. سىز بۇ سىستېمىنى قايتىدىن قوزغىماقچى ئىكەنلىكىڭىزنى جەزىملەشتۈرەلەمسىز؟ - + Multiple users are logged in at the same time.Are you sure you want to %1 this system? @@ -1920,53 +1943,53 @@ LoginOptionsWidget - - + + Login Options كىرىش تاللانمىلىرى - + Password 密码 - + Other - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey - + QRCode QRCode @@ -1975,7 +1998,7 @@ 微信 - + Identify device removed! ئۈسكۈنىنى پەرقلەندۈرۈڭ! @@ -1990,12 +2013,12 @@ MyNetworkWidget - + LAN LAN - + WLAN WLAN @@ -2170,41 +2193,57 @@ PowerListWidget - + + Hibernate Hibernate - + + Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left - + + Suspend توختىتىپ قويۇش - - + + + The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off - + + Restart قايتا قوزغىتىش - - Power Off - توكسىز + + + Shut Down + تاقىۋەت - + + Close all apps, and then shut down your computer + + Power Off + توكسىز + + + + Close all apps, turn off your computer, and then turn your computer back on + + PowerManager @@ -2278,37 +2317,37 @@ ئېكران ئېكرانى ھەرىكەتسىز. - + FingerPrint - + FingerVein - + Iris - + Face - + VoicePrint - + Ukey - + QRCode QRCode @@ -2354,7 +2393,7 @@ سىزدە يېڭى ئۇقتۇرۇش بار - + View كۆرۈش @@ -2470,14 +2509,14 @@ UserListWidget - - + + Login كىرىش - - + + Guest 游客 @@ -2653,12 +2692,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 f8c7ea0..25ae695 100644 --- a/i18n_ts/zh_CN.ts +++ b/i18n_ts/zh_CN.ts @@ -2275,7 +2275,7 @@ Power Off - 关机 + 关机 @@ -2283,6 +2283,11 @@ Close all apps, and then shut down your computer 关闭所有应用,然后关闭电脑。 + + + Close all apps, turn off your computer, and then turn your computer back on + 关闭所有应用,关闭电脑,然后重新打开电脑。 + PowerManager @@ -2691,6 +2696,16 @@ show blank and delay to lock,param:idle/lid/lowpower + + + Backend for the ukui ScreenSaver. + + + + + lock the screen by startup + + Dialog for the ukui ScreenSaver. diff --git a/i18n_ts/zh_HK.ts b/i18n_ts/zh_HK.ts index 50fcd27..c4b1093 100644 --- a/i18n_ts/zh_HK.ts +++ b/i18n_ts/zh_HK.ts @@ -2303,6 +2303,11 @@ Close all apps, and then shut down your computer 關閉所有應用,然後關閉電腦 + + + Close all apps, turn off your computer, and then turn your computer back on + 關閉所有應用,關閉計算機,然後重新打開計算機 + PowerManager diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4e14324..f0d38c8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,6 +17,7 @@ pkg_check_modules(kylin-nm-base REQUIRED kylin-nm-base) pkg_check_modules(IMLIB2 REQUIRED imlib2) pkg_check_modules(LIGHTDM-QT5-3 REQUIRED liblightdm-qt5-3) pkg_check_modules(LIBSYSTEMD REQUIRED libsystemd) +pkg_check_modules(LIBXRANDR REQUIRED xrandr) # 查找pam动态库全路径并缓存到PAM_LIBRARIES变量 find_library(PAM_LIBRARIES pam) @@ -62,6 +63,7 @@ include_directories( ${OpenCV_INCLUDE_DIRS} ${LIGHTDM-QT5-3_INCLUDE_DIRS} ${LIBSYSTEMD_INCLUDE_DIRS} + ${LIBXRANDR_INCLUDE_DIRS} ) set(EXTRA_LIBS @@ -74,6 +76,7 @@ set(EXTRA_LIBS ${GLIB2_LIBRARIES} ${MMIX_LIBRARIES} ${IMLIB2_LIBRARIES} + ${LIBXRANDR_LIBRARIES} -lrt -lpthread -llibnm-icon-kylin diff --git a/src/widgets/fullbackgroundwidget.cpp b/src/widgets/fullbackgroundwidget.cpp index 4402e7a..b2f2eca 100644 --- a/src/widgets/fullbackgroundwidget.cpp +++ b/src/widgets/fullbackgroundwidget.cpp @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, see . * -**/ + **/ #include "fullbackgroundwidget.h" #include "../lock-dialog/lockdialogmodel.h" #include "utils.h" @@ -34,6 +34,7 @@ #include "grab-x11.h" #include #include +#include #include #include #include @@ -45,10 +46,10 @@ #include "screensavermode.h" #include "screensaverwidget.h" #include "displayservice.h" +#include "configuration.h" FullBackgroundWidget::FullBackgroundWidget(LockDialogModel *model, QWidget *parent) - : QWidget(parent) - , m_modelLockDialog(model) + : QWidget(parent), m_modelLockDialog(model) { initCurrentBackground(); initUI(); @@ -57,33 +58,31 @@ FullBackgroundWidget::FullBackgroundWidget(LockDialogModel *model, QWidget *pare FullBackgroundWidget::~FullBackgroundWidget() { - if (m_backgrondGradationTimer) - { + if (m_backgrondGradationTimer) { if (m_backgrondGradationTimer->isActive()) m_backgrondGradationTimer->stop(); m_backgrondGradationTimer->disconnect(); m_backgrondGradationTimer->deleteLater(); } - - } + void FullBackgroundWidget::initUI() { - if(QX11Info::isPlatformX11()){ + if (QX11Info::isPlatformX11()) { /*捕获键盘,如果捕获失败,则可能是由于弹出菜单项已经捕获,那么模拟一次esc按键来退出菜单,如果仍捕获失败,则放弃锁屏,避免密码无法输入*/ - if(establishGrab()) - qDebug()<<"establishGrab : true"; + if (establishGrab()) + qDebug() << "establishGrab : true"; else { - qDebug()<<"establishGrab : false"; + qDebug() << "establishGrab : false"; /*检测当前是否存在弹出菜单,只有存在弹出菜单时,才模拟按键esc*/ - if(checkHasPopupMenu()){ - XTestFakeKeyEvent(QX11Info::display(), XKeysymToKeycode(QX11Info::display(),XK_Escape), True, 1); - XTestFakeKeyEvent(QX11Info::display(), XKeysymToKeycode(QX11Info::display(),XK_Escape), False, 1); + if (checkHasPopupMenu()) { + qDebug() << "XTestFakeKeyEvent Esc!!"; + XTestFakeKeyEvent(QX11Info::display(), XKeysymToKeycode(QX11Info::display(), XK_Escape), True, 1); + XTestFakeKeyEvent(QX11Info::display(), XKeysymToKeycode(QX11Info::display(), XK_Escape), False, 1); XFlush(QX11Info::display()); sleep(1); } - if(!establishGrab()) - { + if (!establishGrab()) { exit(1); } } @@ -96,18 +95,18 @@ void FullBackgroundWidget::initUI() if (!m_lockWidget) { m_lockWidget = new LockWidget(m_modelLockDialog, this); connect(m_lockWidget, &LockWidget::authSucceed, this, &FullBackgroundWidget::onAuthSucceed); - m_lockWidget->setGeometry(this->geometry()); - m_lockWidget->show(); + moveToPrimaryScreen(); } - if(m_modelLockDialog->getAgreementWindowShowLoginPrompt() && (/*IsStartupMode() || */(qgetenv("USER") == "lightdm"))){ + if (m_modelLockDialog->getAgreementWindowShowLoginPrompt() + && (/*IsStartupMode() || */ (qgetenv("USER") == "lightdm"))) { bool hideTitle = m_modelLockDialog->getAgreementWindowHideTitle(); QString title = m_modelLockDialog->getAgreementWindowPromptTitle(); QString text = m_modelLockDialog->getAgreementWindowText(); //文本内容不为空 且 如果配置了标题,则标题不为空 - if(!text.isEmpty() && (hideTitle || (!hideTitle && !text.isEmpty()))){ - m_agreementWindow = new AgreementWindow(hideTitle,title,text,this); + if (!text.isEmpty() && (hideTitle || (!hideTitle && !text.isEmpty()))) { + m_agreementWindow = new AgreementWindow(hideTitle, title, text, this); m_lockWidget->hide(); m_agreementWindow->setGeometry(this->geometry()); m_agreementWindow->show(); @@ -116,15 +115,14 @@ void FullBackgroundWidget::initUI() m_agreementWindow->setFocusPolicy(Qt::StrongFocus); setFocusProxy(m_agreementWindow); m_agreementWindow->setFocus(); - //特别提示窗口抓取键盘,避免焦点在密码框上时输入事件跑到密码框,但会导致我已知晓按钮无法响应回车 - m_agreementWindow->grabKeyboard(); - connect(m_agreementWindow, &AgreementWindow::switchToGreeter, this, - [this]() { + //特别提示窗口抓取键盘,避免焦点在密码框上时输入事件跑到密码框,但会导致我已知晓按钮无法响应回车 + m_agreementWindow->grabKeyboard(); + connect(m_agreementWindow, &AgreementWindow::switchToGreeter, this, [this]() { m_agreementWindow->hide(); m_agreementWindow->releaseKeyboard(); m_agreementWindow->clearFocus(); m_lockWidget->show(); - m_lockWidget->setFocus(); + m_lockWidget->setFocus(); update(); }); } @@ -133,6 +131,13 @@ void FullBackgroundWidget::initUI() setWindowFlags(Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint); KWindowSystem::setType(this->winId(), NET::ScreenLock); + // 登录模式下监听屏幕插拔 + if (isGreeterMode()) { + XRRQueryExtension(QX11Info::display(), &m_RREventBase, &m_RRErrorBase); + XRRSelectInput(QX11Info::display(), QX11Info::appRootWindow(), RRScreenChangeNotifyMask); + QtConcurrent::run([=]() { RRScreenChangeEvent(true); }); + } + qApp->installNativeEventFilter(this); installEventFilter(this); } @@ -142,22 +147,23 @@ bool FullBackgroundWidget::eventFilter(QObject *obj, QEvent *event) static bool isFirstActive = true; if (!QX11Info::isPlatformX11()) { - if(event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseMove/* || event->type() == 7*/){ - if(screenStatus & SCREEN_SAVER && !isBlank){ + if (event->type() == QEvent::MouseButtonPress + || event->type() == QEvent::MouseMove /* || event->type() == 7*/) { + if (screenStatus & SCREEN_SAVER && !isBlank) { onClearScreensaver(); } } } - if(event->type() == QEvent::WindowDeactivate){ - QTimer::singleShot(50,this,SLOT(laterActivate())); - } else if(event->type() == QEvent::WindowActivate){ + if (event->type() == QEvent::WindowDeactivate) { + QTimer::singleShot(50, this, SLOT(laterActivate())); + } else if (event->type() == QEvent::WindowActivate) { if (isFirstActive) { isFirstActive = false; syslog(LOG_INFO, "[ukui-screensaver-dialog] window active event!!"); } - QTimer::singleShot(500,this,SLOT(setLockState())); - //QTimer::singleShot(200,this,SLOT(killWindow())); + QTimer::singleShot(500, this, SLOT(setLockState())); + // QTimer::singleShot(200,this,SLOT(killWindow())); } return QWidget::eventFilter(obj, event); } @@ -166,65 +172,58 @@ void FullBackgroundWidget::initConnections() { // 监听全屏窗口变化 QDesktopWidget *desktop = QApplication::desktop(); - connect(desktop, &QDesktopWidget::resized, - this, &FullBackgroundWidget::onDesktopResized); - connect(desktop, &QDesktopWidget::workAreaResized, - this, &FullBackgroundWidget::onDesktopResized); - connect(desktop, &QDesktopWidget::primaryScreenChanged, - this, &FullBackgroundWidget::onDesktopResized); - connect(desktop, &QDesktopWidget::screenCountChanged, - this, &FullBackgroundWidget::onDesktopResized); + connect(desktop, &QDesktopWidget::resized, this, &FullBackgroundWidget::onDesktopResized); + connect(desktop, &QDesktopWidget::workAreaResized, this, &FullBackgroundWidget::onDesktopResized); + connect(desktop, &QDesktopWidget::primaryScreenChanged, this, &FullBackgroundWidget::onDesktopResized); + connect(desktop, &QDesktopWidget::screenCountChanged, this, &FullBackgroundWidget::onDesktopResized); // 监听休眠、睡眠、唤醒 connect(m_modelLockDialog, SIGNAL(prepareForSleep(bool)), this, SLOT(onPrepareForSleep(bool))); connect(m_modelLockDialog, &LockDialogModel::currentUserChanged, this, &FullBackgroundWidget::onCurUserChanged); connect(m_modelLockDialog, &LockDialogModel::showLock, this, &FullBackgroundWidget::onShowLock); - connect(m_modelLockDialog, &LockDialogModel::showBlankScreensaver, this, &FullBackgroundWidget::onShowBlankScreensaver); - connect(m_modelLockDialog, &LockDialogModel::showLockScreensaver, this, &FullBackgroundWidget::onShowLockScreensaver); + connect( + m_modelLockDialog, &LockDialogModel::showBlankScreensaver, this, &FullBackgroundWidget::onShowBlankScreensaver); + connect( + m_modelLockDialog, &LockDialogModel::showLockScreensaver, this, &FullBackgroundWidget::onShowLockScreensaver); connect(m_modelLockDialog, &LockDialogModel::showScreensaver, this, &FullBackgroundWidget::onShowScreensaver); connect(m_modelLockDialog, &LockDialogModel::showSessionIdle, this, &FullBackgroundWidget::onShowSessionIdle); connect(m_modelLockDialog, &LockDialogModel::SecondRunParam, this, &FullBackgroundWidget::onSecondRunParam); - } void FullBackgroundWidget::setLockState() { - if(m_bIsLockState == true) - return ; + if (m_bIsLockState == true) + return; m_bIsLockState = true; QString displayNum = QString(qgetenv("DISPLAY")).replace(":", "").replace(".", "_"); QString sessionDbus = QString("%1%2").arg(QString(SS_DBUS_SERVICE)).arg(displayNum); - QDBusInterface *interface = new QDBusInterface(sessionDbus, - SS_DBUS_PATH, - SS_DBUS_INTERFACE); + QDBusInterface *interface = new QDBusInterface(sessionDbus, SS_DBUS_PATH, SS_DBUS_INTERFACE); if (!interface->isValid()) { delete interface; - interface = new QDBusInterface(SS_DBUS_SERVICE, - SS_DBUS_PATH, - SS_DBUS_INTERFACE); + interface = new QDBusInterface(SS_DBUS_SERVICE, SS_DBUS_PATH, SS_DBUS_INTERFACE); } QDBusMessage msg = interface->call("SetLockState"); - if(msg.type() == QDBusMessage::ErrorMessage) - qDebug() << msg.errorMessage(); + if (msg.type() == QDBusMessage::ErrorMessage) + qDebug() << msg.errorMessage(); interface->deleteLater(); } void FullBackgroundWidget::onSecondRunParam(const QString &str) { - qDebug()<<"onSecondRunParam"<getScreensaver(); saver->mode = SaverMode(SAVER_BLANK_ONLY); ScreenSaverWidget *saverWidget = new ScreenSaverWidget(saver, this); @@ -254,15 +252,15 @@ void FullBackgroundWidget::onShowBlankScreensaver(int nDelay, bool isHasLock) if (0 == nDelay) { /*在进行压力测试时,可能会出现锁屏界面启动极慢,导致在睡眠之前调用了锁屏,但 - * 锁屏没来得及绑定睡眠唤醒信号,导致唤醒后,锁屏界面没有收到信号从而一直显示黑屏的问题。 - * 因此这里在进入黑色屏保时,通过后台接口,获取一次当前是否应该显示黑色屏保状态*/ + * 锁屏没来得及绑定睡眠唤醒信号,导致唤醒后,锁屏界面没有收到信号从而一直显示黑屏的问题。 + * 因此这里在进入黑色屏保时,通过后台接口,获取一次当前是否应该显示黑色屏保状态*/ bool ret = Q_EMIT m_modelLockDialog->GetBlankState(); - if(!ret){ - //isBlank = false; - //onClearScreensaver(); + if (!ret) { + // isBlank = false; + // onClearScreensaver(); } - }else{ - QTimer::singleShot(nDelay, this, [=](){ + } else { + QTimer::singleShot(nDelay, this, [=]() { if (isBlank) { isBlank = false; onClearScreensaver(); @@ -278,13 +276,13 @@ void FullBackgroundWidget::onShowLock(bool isStartup) show(); Q_EMIT m_modelLockDialog->setCurrentUser(m_modelLockDialog->defaultUserName()); Q_EMIT m_modelLockDialog->lockStateChanged(true); - if(m_lockWidget && !m_lockWidget->isHidden()) + if (m_lockWidget && !m_lockWidget->isHidden()) m_lockWidget->show(); } void FullBackgroundWidget::onShowSessionIdle() { - onShowScreensaver(); + onShowScreensaver(); delayLockScreen(); Q_EMIT m_modelLockDialog->lockStateChanged(true); } @@ -299,23 +297,23 @@ void FullBackgroundWidget::onShowScreensaver() { screenStatus = (ScreenStatus)(screenStatus | SCREEN_SAVER); - for(auto screen : QGuiApplication::screens()) - { + for (auto screen : QGuiApplication::screens()) { ScreenSaver *saver = m_modelLockDialog->getScreensaver(); /*锁屏设置的Qt::WA_TranslucentBackground属性会导致第三方屏保变得透明,因此在使用第三方屏保时 - * 取消该属性,清除屏保时再设置回来*/ - if(saver->path != "/usr/lib/ukui-screensaver/ukui-screensaver-default") - { - // setAttribute(Qt::WA_TranslucentBackground,false); + * 取消该属性,清除屏保时再设置回来*/ + if (saver->path != "/usr/lib/ukui-screensaver/ukui-screensaver-default") { + // setAttribute(Qt::WA_TranslucentBackground,false); } ScreenSaverWidget *saverWidget = new ScreenSaverWidget(saver, this); qDebug() << " new ScreenSaverWidget"; widgetXScreensaverList.push_back(saverWidget); //深色模式有一像素的白边,所以主屏幕向左,向右移一个像素点;这种操作后,外显上方仍旧会有一个像素的白边,暂时不对外显做偏移处理 - if(screen == qApp->primaryScreen()) { - saverWidget->setGeometry(screen->geometry().x()-1, screen->geometry().y()-1, - screen->geometry().width()+1, screen->geometry().height()+1); + if (screen == qApp->primaryScreen()) { + saverWidget->setGeometry(screen->geometry().x() - 1, + screen->geometry().y() - 1, + screen->geometry().width() + 1, + screen->geometry().height() + 1); } else { saverWidget->setGeometry(screen->geometry()); } @@ -328,28 +326,23 @@ void FullBackgroundWidget::onClearScreensaver() { screenStatus = (ScreenStatus)(screenStatus & ~SCREEN_SAVER); - for(auto widget : widgetXScreensaverList) - { + for (auto widget : widgetXScreensaverList) { widget->close(); } widgetXScreensaverList.clear(); unsetCursor(); - if(screenStatus == UNDEFINED) - { + if (screenStatus == UNDEFINED) { onCloseScreensaver(); - } - else - { + } else { onShowLock(false); } - } void FullBackgroundWidget::delayLockScreen() { - qDebug()<<"delayLockScreen"<getLockTimeout()<getLockEnabled(); + qDebug() << "delayLockScreen" << m_modelLockDialog->getLockTimeout() << m_modelLockDialog->getLockEnabled(); if (!m_timerLock) { m_timerLock = new QTimer(this); @@ -358,7 +351,7 @@ void FullBackgroundWidget::delayLockScreen() if (m_modelLockDialog->getLockTimeout() != -1 && m_modelLockDialog->getLockEnabled()) { stopDelayLockScreen(); - m_timerLock->start(m_modelLockDialog->getLockTimeout()*1000); + m_timerLock->start(m_modelLockDialog->getLockTimeout() * 1000); } } @@ -371,7 +364,7 @@ void FullBackgroundWidget::stopDelayLockScreen() void FullBackgroundWidget::onLockScreenTimeout() { - qDebug()<<"onLockScreenTimeout:"<getLockEnabled(); + qDebug() << "onLockScreenTimeout:" << m_modelLockDialog->getLockEnabled(); if (m_modelLockDialog->getLockEnabled()) { screenStatus = (ScreenStatus)(screenStatus | SCREEN_LOCK); } @@ -397,8 +390,8 @@ void FullBackgroundWidget::onDesktopResized() qDebug() << "[FullBackgroundWidget] [onDesktopResized]"; QDesktopWidget *desktop = QApplication::desktop(); setGeometry(desktop->geometry()); - if(m_lockWidget) { - this->onCursorMoved(QCursor::pos()); + if (m_lockWidget) { + moveToPrimaryScreen(); m_lockWidget->reloadRootBackground(); } update(); @@ -408,45 +401,40 @@ void FullBackgroundWidget::onPrepareForSleep(bool sleep) { ///系统休眠时,会关闭总线,导致设备不可用,发生错误 ///在系统休眠之前停止认证,在系统唤醒后重新开始认证 - qDebug()<<"onPrepareForSleep:"<stopAuth(); - //uninhibit(); - } - else - { - if(screenStatus & SCREEN_SAVER) - { + // uninhibit(); + } else { + if (screenStatus & SCREEN_SAVER) { isBlank = false; onClearScreensaver(); - }else{ + } else { repaint(); - if(m_lockWidget) + if (m_lockWidget) m_lockWidget->startAuth(); - //inhibit(); + // inhibit(); } } - } void FullBackgroundWidget::mousePressEvent(QMouseEvent *e) { - //close(); + // close(); } QString FullBackgroundWidget::getFocusWindowName() { Window focus = 0; - int rev = 0; + int rev = 0; - XGetInputFocus (QX11Info::display(), &focus, &rev); - return getWindowNameFromWid(focus); + XGetInputFocus(QX11Info::display(), &focus, &rev); + return getWindowNameFromWid(focus); } QString FullBackgroundWidget::getWindowNameFromWid(WId window) @@ -454,7 +442,7 @@ QString FullBackgroundWidget::getWindowNameFromWid(WId window) XClassHint ch; ch.res_name = NULL; ch.res_class = NULL; - XGetClassHint (QX11Info::display(),window, &ch); + XGetClassHint(QX11Info::display(), window, &ch); QString nameStr = QString(ch.res_name); @@ -470,8 +458,8 @@ int FullBackgroundWidget::RegisteSubWnd(quint64 uWndId) { if (!m_listWndIds.contains(uWndId) && m_listWndIds.size() < SUBWND_COUNT_MAX) { m_listWndIds.append(uWndId); - qDebug()<<"RegisterSubWnd:"< FullBackgroundWidget::GetSubWndIds() return m_listWndIds; } -void FullBackgroundWidget::onCursorMoved(const QPoint &pos) +void FullBackgroundWidget::moveToPrimaryScreen() { - if(!m_lockWidget) - { + if (!m_lockWidget) { return; } bool chkInOneScreen = false; - for(auto screen : QGuiApplication::screens()) - { - if(screen == qApp->primaryScreen()){ - qInfo()<<"LockWidget:"<geometry()<geometry(); - if(!m_lockWidget->isHidden()){ + for (auto screen : QGuiApplication::screens()) { + if (screen == qApp->primaryScreen()) { + qInfo() << "LockWidget:" << screen->geometry() << m_lockWidget->geometry(); + if (!m_lockWidget->isHidden()) { m_lockWidget->hide(); m_lockWidget->setGeometry(screen->geometry()); m_lockWidget->show(); - }else{ + } else { m_lockWidget->setGeometry(screen->geometry()); } chkInOneScreen = true; @@ -518,15 +504,15 @@ void FullBackgroundWidget::onCursorMoved(const QPoint &pos) } } if (!chkInOneScreen) { - for(auto screen : QGuiApplication::screens()) { - if(!screen){ + for (auto screen : QGuiApplication::screens()) { + if (screen) { /*避免切换时闪烁*/ - qInfo()<<"LockWidget:"<geometry()<geometry()<<","<isHidden()){ + qInfo() << "LockWidget:" << screen->geometry() << m_lockWidget->geometry() << "," << screen; + if (!m_lockWidget->isHidden()) { m_lockWidget->hide(); m_lockWidget->setGeometry(screen->geometry()); m_lockWidget->show(); - }else{ + } else { m_lockWidget->setGeometry(screen->geometry()); } chkInOneScreen = true; @@ -549,37 +535,35 @@ void FullBackgroundWidget::fakeFocusIn(WId window) ev.xfocus.window = window; ev.xfocus.mode = NotifyNormal; ev.xfocus.detail = NotifyAncestor; - XSendEvent( QX11Info::display(), window, False, NoEventMask, &ev ); + XSendEvent(QX11Info::display(), window, False, NoEventMask, &ev); XFlush(QX11Info::display()); } void FullBackgroundWidget::laterActivate() { - if(!QX11Info::isPlatformX11()) - return ; - XSetInputFocus(QX11Info::display(),this->winId(),RevertToParent,CurrentTime); + if (!QX11Info::isPlatformX11()) + return; + XSetInputFocus(QX11Info::display(), this->winId(), RevertToParent, CurrentTime); activateWindow(); } void FullBackgroundWidget::showEvent(QShowEvent *event) { - if(QX11Info::isPlatformX11()) + if (QX11Info::isPlatformX11()) tryGrabKeyboard(); - QTimer::singleShot(10, this, [=](){ - KWindowSystem::setType(this->winId(), NET::ScreenLock); - }); + QTimer::singleShot(10, this, [=]() { KWindowSystem::setType(this->winId(), NET::ScreenLock); }); } void FullBackgroundWidget::keyReleaseEvent(QKeyEvent *e) { if (!QX11Info::isPlatformX11()) { - if(e->key() == Qt::Key_Escape && screenStatus == SCREEN_LOCK) { // "escape" + if (e->key() == Qt::Key_Escape && screenStatus == SCREEN_LOCK) { // "escape" bool canShow = true; if (m_lockWidget && !m_lockWidget->exitSubWidget()) canShow = false; if (canShow) onShowScreensaver(); - } else if(screenStatus & SCREEN_SAVER/* && !isBlank*/) { + } else if (screenStatus & SCREEN_SAVER /* && !isBlank*/) { onClearScreensaver(); } } @@ -595,7 +579,7 @@ void FullBackgroundWidget::tryGrabKeyboard() m_tryGrabTimes++; if (m_tryGrabTimes == 15) { - qWarning()<<"setKeyboardGrabEnable failed! focus Window is"<(message); + xcb_generic_event_t *event = reinterpret_cast(message); const uint8_t responseType = event->response_type & ~0x80; - if (responseType == XCB_FOCUS_OUT) { //丢焦点时,检测抢焦点的窗口是否为锁屏的子窗口,比如QMenu,QCombobox等, //如果不是子窗口,则重新给锁屏设置一次焦点 QString focusWindow = getFocusWindowName(); - if(focusWindow == "ukui-screensaver-dialog"){ + if (focusWindow == "ukui-screensaver-dialog") { return false; - }else{ - qDebug()<<"focus out. focus window is"<(event); - if(xc->event_type == XCB_BUTTON_PRESS){ - if(this->windowHandle()){ + xcb_ge_generic_event_t *xc = reinterpret_cast(event); + if (xc->event_type == XCB_BUTTON_PRESS) { + if (this->windowHandle()) { bool grabed = this->windowHandle()->setKeyboardGrabEnabled(true); - if(!grabed){ - qDebug()<<"setKeyboardGrabEnable failed! focus Window is"<event_type == XCB_BUTTON_RELEASE){ - }else if(xc->event_type == XCB_MOTION_NOTIFY){ - onGlobalButtonDrag(QCursor::pos().x(),QCursor::pos().y()); + } + onGlobalButtonPressed(QCursor::pos().x(), QCursor::pos().y()); + } else if (xc->event_type == XCB_BUTTON_RELEASE) { + } else if (xc->event_type == XCB_MOTION_NOTIFY) { + onGlobalButtonDrag(QCursor::pos().x(), QCursor::pos().y()); } - }else if(responseType == XCB_BUTTON_PRESS){ - xcb_button_press_event_t *xc = reinterpret_cast(event); + } else if (responseType == XCB_BUTTON_PRESS) { + xcb_button_press_event_t *xc = reinterpret_cast(event); int x = xc->root_x; int y = xc->root_y; onGlobalButtonPressed(x, y); - qDebug()<<"---------------------XCB_BUTTON_PRESS:"<(event); + qDebug() << "---------------------XCB_BUTTON_PRESS:" << x << "," << y; + } else if (responseType == XCB_BUTTON_RELEASE) { + + } else if (responseType == XCB_MOTION_NOTIFY) { + xcb_motion_notify_event_t *xc = reinterpret_cast(event); int x = xc->root_x; int y = xc->root_y; onGlobalButtonDrag(x, y); - qDebug()<<"---------------------XCB_MOTION_NOTIFY:"<(event); - //qDebug()<<"---------------------XCB_KEY_PRESS:"<detail; + qDebug() << "---------------------XCB_MOTION_NOTIFY:" << x << "," << y; + } else if (responseType == XCB_KEY_PRESS) { + xcb_key_press_event_t *xc = reinterpret_cast(event); + // qDebug()<<"---------------------XCB_KEY_PRESS:"<detail; onGlobalKeyPress(xc->detail); - } else if (responseType == XCB_KEY_RELEASE) { - xcb_key_release_event_t *xc = reinterpret_cast(event); - qDebug()<<"---------------------XCB_KEY_RELEASE:"<detail; + } else if (responseType == XCB_KEY_RELEASE) { + xcb_key_release_event_t *xc = reinterpret_cast(event); + qDebug() << "---------------------XCB_KEY_RELEASE:" << xc->detail; onGlobalKeyRelease(xc->detail); - } + } else if (responseType == m_RREventBase + RRScreenChangeNotify) { + if (isGreeterMode()) { + RRScreenChangeEvent(false); + } + } return false; } @@ -688,41 +675,36 @@ void FullBackgroundWidget::onAuthSucceed(QString strUserName) } } -void FullBackgroundWidget::onGlobalKeyPress(const quint8 &key) -{ - -} +void FullBackgroundWidget::onGlobalKeyPress(const quint8 &key) {} void FullBackgroundWidget::onGlobalKeyRelease(const quint8 &key) { -// if (m_lockWidget && m_lockWidget->isVisible()) { -// m_lockWidget->onGlobalkeyRelease(key); -// } - if(key == 9 && screenStatus == SCREEN_LOCK) { // "escape" + // if (m_lockWidget && m_lockWidget->isVisible()) { + // m_lockWidget->onGlobalkeyRelease(key); + // } + if (key == 9 && screenStatus == SCREEN_LOCK) { // "escape" bool canShow = true; if (m_lockWidget && !m_lockWidget->exitSubWidget()) canShow = false; if (canShow) onShowScreensaver(); - } else if(screenStatus & SCREEN_SAVER/* && !isBlank*/) { - qDebug() << "clearclear" ; + } else if (screenStatus & SCREEN_SAVER /* && !isBlank*/) { + qDebug() << "clearclear"; onClearScreensaver(); } } void FullBackgroundWidget::onGlobalButtonDrag(int xPos, int yPos) { - if(screenStatus & SCREEN_SAVER && !isBlank) - { - qDebug() << "clearclear" ; + if (screenStatus & SCREEN_SAVER && !isBlank) { + qDebug() << "clearclear"; onClearScreensaver(); } } void FullBackgroundWidget::onGlobalButtonPressed(int xPos, int yPos) { - if(screenStatus & SCREEN_SAVER && !isBlank) - { + if (screenStatus & SCREEN_SAVER && !isBlank) { onClearScreensaver(); } } @@ -735,24 +717,22 @@ void FullBackgroundWidget::initCurrentBackground() connect(m_backgrondGradationTimer, &QTimer::timeout, this, &FullBackgroundWidget::onTransition); connect(m_modelLockDialog, &LockDialogModel::setCurrentUser, this, &FullBackgroundWidget::onCurrentUserBackground); - connect(m_modelLockDialog, &LockDialogModel::currentUserChanged, this, &FullBackgroundWidget::onUpdateUserBackground); + connect( + m_modelLockDialog, &LockDialogModel::currentUserChanged, this, &FullBackgroundWidget::onUpdateUserBackground); -// update(); + // update(); } - QString FullBackgroundWidget::getDefaultBackgroundPath() { qDebug() << __LINE__ << __FUNCTION__; QString default_background_path = "/usr/share/backgrounds/1-warty-final-ubuntukylin.jpg"; QFile file(default_background_path); - if (!file.exists()) - { + if (!file.exists()) { default_background_path = "/usr/share/backgrounds/1-openkylin.jpg"; QFile file(default_background_path); - if (!file.exists()) - { + if (!file.exists()) { return ""; } } @@ -761,53 +741,42 @@ QString FullBackgroundWidget::getDefaultBackgroundPath() void FullBackgroundWidget::loadingAllUserBackground() { - qWarning() << __LINE__ << __FUNCTION__ ; + qWarning() << __LINE__ << __FUNCTION__; if (!getDefaultBackgroundPath().isEmpty()) addBackgroundData(getDefaultBackgroundPath()); - } void FullBackgroundWidget::paintEvent(QPaintEvent *event) { -// qDebug() << __LINE__ << __FUNCTION__; - - QPainter painter(this); - - for(QScreen *screen : QApplication::screens()){ + for (QScreen *screen : QApplication::screens()) { //在每个屏幕上绘制背景 QRect rect = screen->geometry(); int width = rect.width(); int height = rect.height(); QString currentPath = getUserBackgroundPath(m_currentUserName); QString resolution = QString("%1x%2").arg(width).arg(height); - QPair cunrrentKey(currentPath, resolution); + QPair cunrrentKey(currentPath, resolution); QString oldPath = getUserBackgroundPath(m_oldUserName); - QPair oldKey(oldPath, resolution); - - //if (m_gradualChanging && m_allBackgroundsMap.contains(m_currentUserName)) - if (m_gradualChanging && m_allBackgroundsDataMap.contains(cunrrentKey)) - { - //drawBackground(m_allBackgroundsMap[m_currentUserName],m_allBackgroundsMap[m_oldUserName],rect,m_backgroundAlpha); - drawBackground(m_allBackgroundsDataMap[cunrrentKey],m_allBackgroundsDataMap.contains(oldKey)?m_allBackgroundsDataMap[oldKey]:nullptr,rect,m_backgroundAlpha); - } - else - { + QPair oldKey(oldPath, resolution); + if (m_gradualChanging && m_allBackgroundsDataMap.contains(cunrrentKey)) { + drawBackground(m_allBackgroundsDataMap[cunrrentKey], + m_allBackgroundsDataMap.contains(oldKey) ? m_allBackgroundsDataMap[oldKey] : nullptr, + rect, + m_backgroundAlpha); + } else { stopTransition(); -// qWarning() << __LINE__<< __FUNCTION__ << "===============" << m_allBackgroundsMap.contains(m_currentUserName); - - if (m_allBackgroundsDataMap.contains(cunrrentKey)) - { - - //drawPixmap(rect, *m_allBackgroundsMap[m_currentUserName]); - painter.drawPixmap(rect, *m_allBackgroundsDataMap[cunrrentKey]); - } - else - { - QString defaultPath = getDefaultBackgroundPath(); - QPair defaultKey(defaultPath, resolution); - if (m_allBackgroundsDataMap.contains(defaultKey)) - painter.drawPixmap(rect, *m_allBackgroundsDataMap[defaultKey]); + if (m_allBackgroundsDataMap.contains(cunrrentKey)) { + drawBackground(m_allBackgroundsDataMap[cunrrentKey], m_allBackgroundsDataMap[cunrrentKey], rect); + } else { + QPainter painter(this); + QPixmap *pixmapBg = getBackground(currentPath, rect); + if (!pixmapBg) { + pixmapBg = getBackground(getDefaultBackgroundPath(), rect); + } + if (pixmapBg && !pixmapBg->isNull()) { + painter.drawPixmap(rect, *pixmapBg); + } } } } @@ -816,29 +785,15 @@ void FullBackgroundWidget::paintEvent(QPaintEvent *event) bool FullBackgroundWidget::isOpenGradation() { - qDebug() << __LINE__ << __FUNCTION__; bool isOpenGradation = false; -// return true;//test 一直触发渐变效果 + // return true;//test 一直触发渐变效果 if (m_currentUserName.isEmpty() || m_oldUserName.isEmpty()) return isOpenGradation; if (m_currentUserName == m_oldUserName) return isOpenGradation; - if (m_allBackgroundsMap.contains(m_currentUserName)) - { - int width = QApplication::primaryScreen()->geometry().width(); - int height = QApplication::primaryScreen()->geometry().height(); - QString currentPath = getUserBackgroundPath(m_currentUserName); - QString resolution = QString("%1x%2").arg(width).arg(height); - QPair cunrrentKey(currentPath, resolution); - - QString oldPath = getUserBackgroundPath(m_oldUserName); - QPair oldKey(oldPath, resolution); - - if (cunrrentKey != oldKey) - { - isOpenGradation = true; - } + if (getUserBackgroundPath(m_oldUserName) != getUserBackgroundPath(m_currentUserName)) { + isOpenGradation = true; } return isOpenGradation; @@ -846,35 +801,34 @@ bool FullBackgroundWidget::isOpenGradation() void FullBackgroundWidget::onUpdateUserBackground(const QString &strUserName) { - qWarning() << __LINE__ <<__FUNCTION__ << "==========" << strUserName ; + qDebug() << __LINE__ << __FUNCTION__ << "==========" << strUserName; if (m_currentUserName == strUserName) return; m_oldUserName = m_currentUserName; m_currentUserName = strUserName; //是否需要开启渐变效果 - m_gradualChanging = isOpenGradation(); - qWarning() << __LINE__ <<__FUNCTION__ << "==========" << m_gradualChanging ; + bool gradualChangeEnable = isOpenGradation(); + qDebug() << __LINE__ << __FUNCTION__ << "==========" << gradualChangeEnable; - if (m_gradualChanging) + if (gradualChangeEnable) startTransition(); repaint(); } void FullBackgroundWidget::onTransition() { - qWarning() << __LINE__ << __FUNCTION__ ; m_backgroundAlpha += 0.05; - if(m_backgroundAlpha >= 1.0) + if (m_backgroundAlpha >= 1.0) stopTransition(); repaint(); } void FullBackgroundWidget::startTransition() { - if(!m_backgrondGradationTimer){ - m_backgrondGradationTimer = new QTimer(this); - connect(m_backgrondGradationTimer, &QTimer::timeout, this, &FullBackgroundWidget::onTransition); + if (!m_backgrondGradationTimer) { + m_backgrondGradationTimer = new QTimer(this); + connect(m_backgrondGradationTimer, &QTimer::timeout, this, &FullBackgroundWidget::onTransition); } stopTransition(); @@ -883,54 +837,43 @@ void FullBackgroundWidget::startTransition() m_backgrondGradationTimer->start(10); } + void FullBackgroundWidget::stopTransition() { -// qDebug() << __LINE__ << __FUNCTION__; - - if(m_backgrondGradationTimer && m_backgrondGradationTimer->isActive()) + if (m_backgrondGradationTimer && m_backgrondGradationTimer->isActive()) m_backgrondGradationTimer->stop(); m_backgroundAlpha = 1.0; m_gradualChanging = false; } -void FullBackgroundWidget::drawBackground(QPixmap * backgroundBack, QPixmap * backgroundFront, - const QRect &rect, float alpha) +void FullBackgroundWidget::drawBackground(QPixmap *backgroundBack, + QPixmap *backgroundFront, + const QRect &rect, + float alpha) { -// qDebug() << __LINE__ << __FUNCTION__; - - if(backgroundBack->isNull()) - { + if (!backgroundBack || backgroundBack->isNull()) { stopTransition(); - repaint(); - return; } QPainter painter(this); - - if(backgroundFront == nullptr) - { - + if (!backgroundBack || backgroundBack->isNull() || !backgroundFront) { painter.setOpacity(alpha); - //QString color = m_configuration->getValue("background-color").toString(); + QString color = Configuration::instance(this)->getValue("background-color").toString(); QColor cor; - //if(!color.isEmpty()) - // cor = color; - //else + if (!color.isEmpty()) + cor = color; + else cor = "#035290"; painter.setBrush(cor); painter.drawRect(rect); - - } - else - { - + } else { painter.drawPixmap(rect, *backgroundFront); painter.setOpacity(alpha); painter.drawPixmap(rect, *backgroundBack); QPainterPath path; QPainter painter1(this); painter1.setOpacity(0.25); - painter1.setRenderHint(QPainter::Antialiasing); // 反锯齿; + painter1.setRenderHint(QPainter::Antialiasing); // 反锯齿; painter1.setClipping(true); painter1.setPen(Qt::transparent); path.addRect(this->rect()); @@ -939,23 +882,18 @@ void FullBackgroundWidget::drawBackground(QPixmap * backgroundBack, QPixmap * ba painter1.setPen(Qt::transparent); painter1.drawPath(path); } -// qDebug() << __LINE__ << __FUNCTION__<< "===============2"; } void FullBackgroundWidget::onRemoveUserBackground(const QString &strUserName) { - qDebug() << __LINE__ << __FUNCTION__; - if (m_allBackgroundsMap.contains(strUserName)) m_allBackgroundsMap.remove(strUserName); } QString FullBackgroundWidget::getUserBackgroundPath(const QString &strUserName) { - for (UserInfoPtr userInfo : m_modelLockDialog->usersInfo()) - { - if (strUserName == userInfo->name()) - { + for (UserInfoPtr userInfo : m_modelLockDialog->usersInfo()) { + if (strUserName == userInfo->name()) { if (!userInfo->greeterBackGround().isEmpty() && QFile(userInfo->greeterBackGround()).exists()) { return userInfo->greeterBackGround(); } else { @@ -968,71 +906,118 @@ QString FullBackgroundWidget::getUserBackgroundPath(const QString &strUserName) void FullBackgroundWidget::addBackgroundData(const QString &bgPath) { - qDebug() << __LINE__ << __FUNCTION__; - - if (bgPath.isEmpty()) - { + if (bgPath.isEmpty()) { qDebug() << __LINE__ << __FUNCTION__ << bgPath << ":Path is Null"; return; } QFile file(bgPath); - if (!file.exists()) - { + if (!file.exists()) { qDebug() << __LINE__ << __FUNCTION__ << "Add background file isn't exists"; return; } - int width = QApplication::primaryScreen()->geometry().width(); - int height = QApplication::primaryScreen()->geometry().height(); + for (QScreen *screen : QApplication::screens()) { + int width = screen->geometry().width(); + int height = screen->geometry().height(); - QString resolution = QString("%1x%2").arg(width).arg(height); - QPair key(bgPath, resolution); - QPixmap *pixmap = new QPixmap(scaleBlurPixmap(width,height, bgPath)); - - m_allBackgroundsDataMap[key] = pixmap; -} - -bool FullBackgroundWidget::existsBackgroundData(const QString &bgPath) -{ - qDebug() << __LINE__ << __FUNCTION__; - - int width = QApplication::primaryScreen()->geometry().width(); - int height = QApplication::primaryScreen()->geometry().height(); - - QString resolution = QString("%1x%2").arg(width).arg(height); - QPair key(bgPath, resolution); - return m_allBackgroundsDataMap.contains(key); + QString resolution = QString("%1x%2").arg(width).arg(height); + QPair key(bgPath, resolution); + if (!m_allBackgroundsDataMap.contains(key)) { + QPixmap *pixmap = new QPixmap(scaleBlurPixmap(width, height, bgPath)); + m_allBackgroundsDataMap[key] = pixmap; + } + } } void FullBackgroundWidget::onAddUserBackground(const QString &strUserName) { - qDebug() << __LINE__ << __FUNCTION__; - - FullBackgroundWidget::m_loadingOneBackgroundFuture = QtConcurrent::run([=](){ + m_loadingOneBackgroundFuture = QtConcurrent::run([=]() { QString strBackground = getUserBackgroundPath(strUserName); - if (!existsBackgroundData(strBackground)) - addBackgroundData(strBackground); + addBackgroundData(strBackground); }); m_loadingOneBackgroundFuture.waitForFinished(); } -void FullBackgroundWidget::onUserBackgroundChanged(const QString &strUserName) -{ - -} +void FullBackgroundWidget::onUserBackgroundChanged(const QString &strUserName) {} void FullBackgroundWidget::onCurrentUserBackground(const QString &strUserName) { - qWarning() << __LINE__ << __FUNCTION__ << "===============" << strUserName; - //m_currentUserName = strUserName; - QString userPath = getUserBackgroundPath(strUserName); - int width = QApplication::primaryScreen()->geometry().width(); - int height = QApplication::primaryScreen()->geometry().height(); - QString resolution = QString("%1x%2").arg(width).arg(height); - QPair UserKey(userPath, resolution); - - if (!m_allBackgroundsDataMap.contains(UserKey)) - { - onAddUserBackground(strUserName); - } + qDebug() << __LINE__ << __FUNCTION__ << "===============" << strUserName; + onAddUserBackground(strUserName); repaint(); } + +QPixmap *FullBackgroundWidget::getBackground(const QString &path, const QRect &rect) +{ + if (path.isEmpty() || !QFile(path).exists()) + return nullptr; + + QString resolution = QString("%1x%2").arg(rect.width()).arg(rect.height()); + QPair key(path, resolution); + + if (m_allBackgroundsDataMap.isEmpty() && m_loadingOneBackgroundFuture.isRunning()) { + m_loadingOneBackgroundFuture.waitForFinished(); + } else { + if (!m_loadingOneBackgroundFuture.isFinished() && m_loadingOneBackgroundFuture.isStarted()) { + m_loadingOneBackgroundFuture.waitForFinished(); + } + } + if (!m_allBackgroundsDataMap.contains(key)) { + QPixmap *pixmap = new QPixmap(scaleBlurPixmap(width(), height(), path)); + m_allBackgroundsDataMap[key] = pixmap; + } + return m_allBackgroundsDataMap[key]; +} + +void FullBackgroundWidget::RRScreenChangeEvent(bool isFirst) +{ + XRRScreenResources *screen; + screen = XRRGetScreenResources(QX11Info::display(), QX11Info::appRootWindow()); + XRROutputInfo *info; + QList listMonitors; + + for (int i = 0; i < screen->noutput; i++) { + info = XRRGetOutputInfo(QX11Info::display(), screen, screen->outputs[i]); + if (info->connection == RR_Connected) { + listMonitors.push_back(info->name); + } + XRRFreeOutputInfo(info); + } + + qDebug() << "monitors = " << listMonitors; + if (isFirst && DisplayService::instance()->isSaveParamInUsed()) { + m_listMonitors = listMonitors; + } else { + onScreensChanged(listMonitors); + } + XRRFreeScreenResources(screen); +} + +void FullBackgroundWidget::onScreensChanged(QList listMonitors) +{ + qDebug() << "newList = " << listMonitors << " listMonitors = " << m_listMonitors + << DisplayService::instance()->isJJW7200(); + if (DisplayService::instance()->isJJW7200() == 0 && m_listMonitors.size() == listMonitors.size()) { + bool isAllFound = true; + for (auto monitor : listMonitors) { + if (!m_listMonitors.contains(monitor)) { + isAllFound = false; + break; + } + } + if (isAllFound) { + return; + } + } + + m_listMonitors = listMonitors; + if (m_listMonitors.size() < 2) { + //默认设置显示最大分辨率 + DisplayService::instance()->setOneDisplayMode(); + } else { + int mode = Configuration::instance()->getValue("display-mode").toInt(); + DisplayService::instance()->switchDisplayMode((DisplayMode)mode); + } + //在调用xrandr打开显示器以后,不能马上设置窗口大小,会设置不正确的 + //分辨率,延时1000ms正常。 + QTimer::singleShot(1000, this, SLOT(onDesktopResized())); +} diff --git a/src/widgets/fullbackgroundwidget.h b/src/widgets/fullbackgroundwidget.h index 3b258b9..2ec9609 100644 --- a/src/widgets/fullbackgroundwidget.h +++ b/src/widgets/fullbackgroundwidget.h @@ -67,7 +67,6 @@ public: inline bool IsStartupMode() { return m_isStartupMode; } public Q_SLOTS: - void onCursorMoved(const QPoint &pos); void onShowBlankScreensaver(int nDelay = 0, bool isHasLock = true); void onShowLock(bool isStartup); void onShowSessionIdle(); @@ -106,19 +105,20 @@ private: QString getWindowNameFromWid(WId window); QString getFocusWindowName(); void tryGrabKeyboard(); + void moveToPrimaryScreen(); void initCurrentBackground(); QString getDefaultBackgroundPath(); void loadingAllUserBackground(); QString getUserBackgroundPath(const QString &); - bool existsBackgroundData(const QString &); void addBackgroundData(const QString &); bool isOpenGradation(); void startTransition(); void stopTransition(); void drawBackground(QPixmap * backgroundBack, QPixmap * backgroundFront, - const QRect &rect, float alpha); + const QRect &rect, float alpha = 1.0); + QPixmap* getBackground(const QString &path, const QRect &rect); void delayLockScreen(); void onLockScreenTimeout(); @@ -129,6 +129,10 @@ private Q_SLOTS: void onGlobalKeyRelease(const quint8 &key); void onGlobalButtonDrag(int xPos, int yPos); void onGlobalButtonPressed(int xPos, int yPos); + + void RRScreenChangeEvent(bool isFirst); + void onScreensChanged(QList listMonitors); + private: LockDialogModel *m_modelLockDialog = nullptr; bool m_isStartupMode = false; @@ -150,6 +154,9 @@ private: int isBlank; QTimer *m_timerLock = nullptr; + int m_RREventBase; + int m_RRErrorBase; + QList m_listMonitors; }; #endif // FULLBACKGROUNDWIDGET_H diff --git a/src/widgets/grab-x11.cpp b/src/widgets/grab-x11.cpp index 6ae94d5..2ad74f2 100644 --- a/src/widgets/grab-x11.cpp +++ b/src/widgets/grab-x11.cpp @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, see . * -**/ + **/ #include "grab-x11.h" #include #include @@ -31,12 +31,15 @@ #define MAX_PROPERTY_VALUE_LEN 4096 -class XServerGraber{ +class XServerGraber +{ public: - XServerGraber() { + XServerGraber() + { xcb_grab_server(QX11Info::connection()); } - ~XServerGraber() { + ~XServerGraber() + { xcb_ungrab_server(QX11Info::connection()); xcb_flush(QX11Info::connection()); } @@ -44,18 +47,23 @@ public: static bool grabKeyboard() { - int rv = XGrabKeyboard(QX11Info::display(), QX11Info::appRootWindow(), - True, GrabModeAsync, GrabModeAsync, CurrentTime); + int rv = XGrabKeyboard( + QX11Info::display(), QX11Info::appRootWindow(), True, GrabModeAsync, GrabModeAsync, CurrentTime); return (rv == GrabSuccess); } static bool grabMouse() { -#define GRABEVENTS ButtonPressMask | ButtonReleaseMask | PointerMotionMask | \ - EnterWindowMask | LeaveWindowMask - int rv = XGrabPointer(QX11Info::display(), QX11Info::appRootWindow(), - True, GRABEVENTS, GrabModeAsync, GrabModeAsync, None, - None, CurrentTime); +#define GRABEVENTS ButtonPressMask | ButtonReleaseMask | PointerMotionMask | EnterWindowMask | LeaveWindowMask + int rv = XGrabPointer(QX11Info::display(), + QX11Info::appRootWindow(), + True, + GRABEVENTS, + GrabModeAsync, + GrabModeAsync, + None, + None, + CurrentTime); #undef GRABEVENTS return (rv == GrabSuccess); @@ -68,35 +76,34 @@ bool establishGrab() Q_UNUSED(xserverGraber); - if(!grabKeyboard()) + if (!grabKeyboard()) return false; - -/*抓取鼠标会导致触摸无效,这里暂时取消掉*/ -/* - if(!grabMouse()) { - XUngrabKeyboard(QX11Info::display(), CurrentTime); - XFlush(QX11Info::display()); - return false; - } -*/ + + /*抓取鼠标会导致触摸无效,这里暂时取消掉*/ + /* + if(!grabMouse()) { + XUngrabKeyboard(QX11Info::display(), CurrentTime); + XFlush(QX11Info::display()); + return false; + } + */ return true; } bool closeGrab() { - //XSync(QX11Info::display(), False); + // XSync(QX11Info::display(), False); XServerGraber xserverGraber; Q_UNUSED(xserverGraber); XUngrabKeyboard(QX11Info::display(), CurrentTime); -// XUngrabPointer(QX11Info::display(), CurrentTime); + // XUngrabPointer(QX11Info::display(), CurrentTime); XFlush(QX11Info::display()); return true; } -static Bool -Window_Has_Property(Display * dpy, Window win, Atom atom) +static Bool Window_Has_Property(Display *dpy, Window win, Atom atom) { Atom type_ret; int format_ret; @@ -105,16 +112,16 @@ Window_Has_Property(Display * dpy, Window win, Atom atom) type_ret = None; prop_ret = NULL; - XGetWindowProperty(dpy, win, atom, 0, 0, False, AnyPropertyType, - &type_ret, &format_ret, &num_ret, - &bytes_after, &prop_ret); + XGetWindowProperty( + dpy, win, atom, 0, 0, False, AnyPropertyType, &type_ret, &format_ret, &num_ret, &bytes_after, &prop_ret); if (prop_ret) XFree(prop_ret); return (type_ret != None) ? True : False; } -int getWindowByPid(Window win){ +int getWindowByPid(Window win) +{ int ret = -1; Atom xa_ret_type; @@ -125,46 +132,44 @@ int getWindowByPid(Window win){ unsigned char *ret_prop; int id = 0; + Atom xa_prop_name = XInternAtom(QX11Info::display(), "_NET_WM_PID", False); // 取对应字串的AtomID - Atom xa_prop_name = XInternAtom(QX11Info::display(), "_NET_WM_PID", False); // 取对应字串的AtomID - - if (XGetWindowProperty(QX11Info::display(), win, xa_prop_name, 0, // 获取窗口属性 - MAX_PROPERTY_VALUE_LEN / 4, - False, XA_CARDINAL, &xa_ret_type, // XA_CARDINAL为数值类型 - &ret_format, &ret_nitems, &ret_bytes_after, - &ret_prop) != Success) // 后五个参数是返回值 + if (XGetWindowProperty(QX11Info::display(), + win, + xa_prop_name, + 0, // 获取窗口属性 + MAX_PROPERTY_VALUE_LEN / 4, + False, + XA_CARDINAL, + &xa_ret_type, // XA_CARDINAL为数值类型 + &ret_format, + &ret_nitems, + &ret_bytes_after, + &ret_prop) + != Success) // 后五个参数是返回值 { - printf("Cannot get %s property.\n", "_NET_WM_PID"); - return -1; + printf("Cannot get %s property.\n", "_NET_WM_PID"); + return -1; + } else { + if (ret_prop) + memcpy(&id, ret_prop, 4); // 类型传换 + qDebug() << "window pid: " << id; } - else - { - if(ret_prop) - memcpy(&id, ret_prop, 4);// 类型传换 - qDebug()<<"window pid: "<= 0; i--) { + + if (XQueryTree(QX11Info::display(), root_window, &root, &parent, &children, &n_children)) { + for (i = (int)n_children - 1; i >= 0; i--) { if (!Window_Is_Viewable(QX11Info::display(), children[i])) { children[i] = None; /* Don't bother descending into this one */ continue; } - ccount ++; - if (!Window_Has_Property(QX11Info::display(), children[i], XInternAtom(QX11Info::display(), "_NET_WM_WINDOW_TYPE", False))) + + if (!Window_Has_Property(QX11Info::display(), + children[i], + XInternAtom(QX11Info::display(), "_NET_WM_WINDOW_TYPE", False))) continue; - count ++ ; - /* Got one */ - win = children[i]; - return getIsPopupMenu(QX11Info::display(), win, XA_ATOM, "_NET_WM_WINDOW_TYPE", NULL); + if (getIsPopupMenu(QX11Info::display(), children[i], XA_ATOM, "_NET_WM_WINDOW_TYPE", NULL)) { + return true; + } + + if (getWindowNameByWid(children[i]) == "ukui-session-tools") { + return true; + } + + continue; } } - qDebug()<<"count = "<. + * +**/ +#ifndef LOGIN_NOTIFY_INTERFACE_H +#define LOGIN_NOTIFY_INTERFACE_H + +#include "loginplugininterface.h" + +/** + * @brief 通知类窗口接口 + * + */ +class LoginNotifyInterface : public LoginPluginInterface +{ +public: + /** + * @brief 构造函数 + * + */ + LoginNotifyInterface(){} + + /** + * @brief 析构函数 + * + */ + virtual ~LoginNotifyInterface(){} + + /** + * @brief 获取插件类型 + * @return 插件类型 + */ + int getPluginType() { return MODULETYPE_NOTIFY; } + +}; + +#define LoginNotifyInterfaceIID "org.ukui.LoginNotifyInterface" + +Q_DECLARE_INTERFACE(LoginNotifyInterface, LoginNotifyInterfaceIID) + +#endif // LOGIN_NOTIFY_INTERFACE_H diff --git a/src/widgets/loginplugininterface.h b/src/widgets/loginplugininterface.h index dc3789e..abd88b7 100644 --- a/src/widgets/loginplugininterface.h +++ b/src/widgets/loginplugininterface.h @@ -32,12 +32,13 @@ class LoginPluginInterface { public: /** - * @brief 插件模块类型枚举:认证、工具 + * @brief 插件模块类型枚举:认证、工具、通知 * */ enum ModuleType{ MODULETYPE_AUTH, MODULETYPE_TOOL, + MODULETYPE_NOTIFY, MODULETYPE_MAX }; /** diff --git a/src/widgets/powerlistwidget.cpp b/src/widgets/powerlistwidget.cpp index a904f52..b6d93df 100644 --- a/src/widgets/powerlistwidget.cpp +++ b/src/widgets/powerlistwidget.cpp @@ -14,33 +14,29 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, see . * -**/ + **/ #include #include "powerlistwidget.h" -PowerListWidget::PowerListWidget(LockDialogModel *model ,QWidget *parent) - : m_modelLockDialog(model), - MyListWidget(parent) +PowerListWidget::PowerListWidget(LockDialogModel *model, QWidget *parent) + : m_modelLockDialog(model), MyListWidget(parent) { initBtnShowFlag(); initUI(); initConnections(); } -PowerListWidget::~PowerListWidget() -{ - -} +PowerListWidget::~PowerListWidget() {} bool PowerListWidget::eventFilter(QObject *obj, QEvent *event) { if (event->type() == QEvent::KeyRelease) { MyListWidget *listWidget = qobject_cast(obj); if (listWidget) { - if (listWidget && listWidget->hasFocus()) { //Tab键切入时,设置焦点状态 + if (listWidget && listWidget->hasFocus()) { // Tab键切入时,设置焦点状态 listWidget->setCurrentRow(listWidget->currentRow(), QItemSelectionModel::SelectionFlag::SelectCurrent); listWidget->currentItemChanged(listWidget->currentItem(), nullptr); - } else { //Tab键切出时,清空焦点状态 + } else { // Tab键切出时,清空焦点状态 listWidget->setCurrentRow(listWidget->currentRow(), QItemSelectionModel::SelectionFlag::Clear); } } @@ -59,20 +55,18 @@ void PowerListWidget::initUI() QString powerListStyle = "QListWidget{background:rgba(255, 255, 255, 0%); border: 0px;}" "QListWidget::item{background:rgba(255, 255, 255, 0%);}"; setStyleSheet(powerListStyle); - setFixedSize(QSize(BTN_ITEM_SIZE_WIDTH*sizeof(powerBtnList)/sizeof(powerBtnList[0])+1, BTN_ITEM_SIZE_HEIGHT)); -// powerBtnList[0].func = &PowerListWidget::setSystemSuspend1(); + setFixedSize(QSize(BTN_ITEM_SIZE_WIDTH * sizeof(powerBtnList) / sizeof(powerBtnList[0]) + 1, BTN_ITEM_SIZE_HEIGHT)); + // powerBtnList[0].func = &PowerListWidget::setSystemSuspend1(); onUpdateListInfo(); } void PowerListWidget::initConnections() { connect(this, &PowerListWidget::itemClicked, this, &PowerListWidget::onListItemClicked); - } void PowerListWidget::initBtnShowFlag() { - for (int i = 0; i < sizeof(powerBtnList)/sizeof(powerBtnList[0]) ; i++) - { + for (int i = 0; i < sizeof(powerBtnList) / sizeof(powerBtnList[0]); i++) { if (powerBtnList[i].canFuncName == QString("CanPowerOff")) powerBtnList[i].m_show_flag = m_modelLockDialog->getCanPowerOff(); @@ -84,23 +78,20 @@ void PowerListWidget::initBtnShowFlag() if (powerBtnList[i].canFuncName == QString("CanHibernate")) powerBtnList[i].m_show_flag = m_modelLockDialog->getCanHibernate(); - } - } void PowerListWidget::onUpdateListInfo() { this->clear(); - for (int i = 0; i < sizeof(powerBtnList)/sizeof(powerBtnList[0]) ; i++) - { - qWarning() << __LINE__ << __FUNCTION__<< "11111111111" << i << powerBtnList[i].m_strName << powerBtnList[i].m_show_flag ; + for (int i = 0; i < sizeof(powerBtnList) / sizeof(powerBtnList[0]); i++) { + qDebug() << powerBtnList[i].m_strName << powerBtnList[i].setFuncName << powerBtnList[i].m_show_flag; if (!powerBtnList[i].m_show_flag) continue; PowerItemWidget *btnWdg = new PowerItemWidget(this); - btnWdg->setObjectName(powerBtnList[i].m_strName); + btnWdg->setObjectName(powerBtnList[i].setFuncName); QListWidgetItem *btnItem = new QListWidgetItem(); btnItem->setSizeHint(QSize(powerBtnList[i].m_item_width, powerBtnList[i].m_item_height)); @@ -108,19 +99,18 @@ void PowerListWidget::onUpdateListInfo() this->setItemWidget(btnItem, btnWdg); btnWdg->setText(powerBtnList[i].m_strName); btnWdg->setToolTip(powerBtnList[i].m_strToolTip); - btnWdg->setIcon(QIcon(powerBtnList[i].m_strIcon).pixmap(powerBtnList[i].m_icon_width, powerBtnList[i].m_icon_width)); + btnWdg->setIcon( + QIcon(powerBtnList[i].m_strIcon).pixmap(powerBtnList[i].m_icon_width, powerBtnList[i].m_icon_width)); } } void PowerListWidget::onListItemClicked(QListWidgetItem *item) { - qWarning() << __FUNCTION__ << __LINE__ ; + qWarning() << __FUNCTION__ << __LINE__; QWidget *widget = itemWidget(item); PowerItemWidget *currentItem = qobject_cast(widget); - for (int i = 0; i < sizeof(powerBtnList)/sizeof(powerBtnList[0]) ; i++) - { - if(powerBtnList[i].m_strName == currentItem->objectName()) - { + for (int i = 0; i < sizeof(powerBtnList) / sizeof(powerBtnList[0]); i++) { + if (powerBtnList[i].setFuncName == currentItem->objectName()) { if (powerBtnList[i].setFuncName == "Hibernate" || powerBtnList[i].setFuncName == "Suspend") { QStringList sleepLockcheck = m_modelLockDialog->getSleepLockcheck(); if (!sleepLockcheck.isEmpty()) { @@ -138,7 +128,7 @@ void PowerListWidget::onListItemClicked(QListWidgetItem *item) break; } } - qWarning() << __LINE__ << "=================" << powerBtnList[i].setFuncName << __FUNCTION__; + qWarning() << __LINE__ << "=================" << powerBtnList[i].setFuncName << __FUNCTION__; Q_EMIT m_modelLockDialog->setPowerManager(powerBtnList[i].setFuncName); break; } @@ -157,35 +147,34 @@ void PowerListWidget::updateWidgetSize() void PowerListWidget::setSystemPowerStatus(QString statusName) { - qWarning() << __LINE__ << __FUNCTION__ << statusName; - + qWarning() << __LINE__ << __FUNCTION__ << statusName; } void PowerListWidget::changeEvent(QEvent *event) { - if(event->type() == QEvent::LanguageChange){ + if (event->type() == QEvent::LanguageChange) { refreshTranslate(); } } void PowerListWidget::refreshTranslate() { - for (int i = 0; i < sizeof(powerBtnList)/sizeof(powerBtnList[0]) ; i++) - { + 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"); + 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"); + 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("Close all apps, and then restart your computer"); } else if (powerBtnList[i].setFuncName == "PowerOff") { - powerBtnList[i].m_strName = tr("Power Off"); + powerBtnList[i].m_strName = tr("Shut Down"); 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 5efc3a8..d0a9927 100644 --- a/src/widgets/powerlistwidget.h +++ b/src/widgets/powerlistwidget.h @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, see . * -**/ + **/ #ifndef POWERLISTWIDGET_H #define POWERLISTWIDGET_H @@ -34,14 +34,15 @@ class MyListWidget; class PowerItemWidget; class QListWidgetItem; class LockDialogModel; -#define LISTSZIE(x) (sizeof(x)/sizeof(x[0])) +#define LISTSZIE(x) (sizeof(x) / sizeof(x[0])) //电源管理界面 -#define BTN_ITEM_SIZE_WIDTH 204 -#define BTN_ITEM_SIZE_HEIGHT 200 -#define BTN_ICON_SIZE_WIDTH 48 -#define BTN_ICON_SIZE_HEIGHT 48 +#define BTN_ITEM_SIZE_WIDTH 204 +#define BTN_ITEM_SIZE_HEIGHT 200 +#define BTN_ICON_SIZE_WIDTH 48 +#define BTN_ICON_SIZE_HEIGHT 48 -enum stateType { +enum stateType +{ REBOOT, SHUTDOWN, SLEEP, @@ -53,15 +54,15 @@ class PowerListWidget : public MyListWidget { Q_OBJECT public: - - explicit PowerListWidget(LockDialogModel *model,QWidget *parent = nullptr); + explicit PowerListWidget(LockDialogModel *model, QWidget *parent = nullptr); ~PowerListWidget(); - LockDialogModel * m_modelLockDialog; + LockDialogModel *m_modelLockDialog; void updateWidgetSize(); void setSystemSuspend1(); - struct Btn_Data_Struct { + struct Btn_Data_Struct + { QString m_strName; QString m_strToolTip; QString m_strIcon; @@ -74,65 +75,59 @@ public: QString canFuncName; QString setFuncName; int m_inhibitType; -// void (*func)(); - } powerBtnList[4] = { - //1.Hibernate - { - .m_strName = tr("Hibernate"), - .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"), - .m_strIcon = ":/image/assets/hibernate.svg", - .m_show_flag = true, - .m_item_width = BTN_ITEM_SIZE_WIDTH, - .m_item_height = BTN_ITEM_SIZE_HEIGHT, - .m_icon_width = BTN_ICON_SIZE_WIDTH, - .m_icon_height = BTN_ICON_SIZE_HEIGHT, - .canFuncName = "CanHibernate", - .setFuncName = "Hibernate", - .m_inhibitType = HIBERNATE - }, - //2.Suspend - { - .m_strName = tr("Suspend"), - .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"), - .m_strIcon = ":/image/assets/suspend.svg", - .m_show_flag = true, - .m_item_width = BTN_ITEM_SIZE_WIDTH, - .m_item_height = BTN_ITEM_SIZE_HEIGHT, - .m_icon_width = BTN_ICON_SIZE_WIDTH, - .m_icon_height = BTN_ICON_SIZE_HEIGHT, - .canFuncName = "CanSuspend", - .setFuncName = "Suspend", - .m_inhibitType = SLEEP - }, - //3.reboot - { - .m_strName = tr("Restart"), - .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"), - .m_strIcon = ":/image/assets/reboot.svg", - .m_show_flag = true, - .m_item_width = BTN_ITEM_SIZE_WIDTH, - .m_item_height = BTN_ITEM_SIZE_HEIGHT, - .m_icon_width = BTN_ICON_SIZE_WIDTH, - .m_icon_height = BTN_ICON_SIZE_HEIGHT, - .canFuncName = "CanReboot", - .setFuncName = "Reboot", - .m_inhibitType = REBOOT - }, - //4.Shut Down - { - .m_strName = tr("Power Off"), - .m_strToolTip = tr("Close all apps, and then shut down your computer"), - .m_strIcon = ":/image/assets/shutdown.svg", - .m_show_flag = true, - .m_item_width = BTN_ITEM_SIZE_WIDTH, - .m_item_height = BTN_ITEM_SIZE_HEIGHT, - .m_icon_width = BTN_ICON_SIZE_WIDTH, - .m_icon_height = BTN_ICON_SIZE_HEIGHT, - .canFuncName = "CanPowerOff", - .setFuncName = "PowerOff", - .m_inhibitType = SHUTDOWN - } - }; + // void (*func)(); + } powerBtnList[4] + = { // 1.Hibernate + { .m_strName = tr("Hibernate"), + .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"), + .m_strIcon = ":/image/assets/hibernate.svg", + .m_show_flag = true, + .m_item_width = BTN_ITEM_SIZE_WIDTH, + .m_item_height = BTN_ITEM_SIZE_HEIGHT, + .m_icon_width = BTN_ICON_SIZE_WIDTH, + .m_icon_height = BTN_ICON_SIZE_HEIGHT, + .canFuncName = "CanHibernate", + .setFuncName = "Hibernate", + .m_inhibitType = HIBERNATE }, + // 2.Suspend + { .m_strName = tr("Suspend"), + .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"), + .m_strIcon = ":/image/assets/suspend.svg", + .m_show_flag = true, + .m_item_width = BTN_ITEM_SIZE_WIDTH, + .m_item_height = BTN_ITEM_SIZE_HEIGHT, + .m_icon_width = BTN_ICON_SIZE_WIDTH, + .m_icon_height = BTN_ICON_SIZE_HEIGHT, + .canFuncName = "CanSuspend", + .setFuncName = "Suspend", + .m_inhibitType = SLEEP }, + // 3.reboot + { .m_strName = tr("Restart"), + .m_strToolTip = tr("Close all apps, turn off your computer, and then turn your computer back on"), + .m_strIcon = ":/image/assets/reboot.svg", + .m_show_flag = true, + .m_item_width = BTN_ITEM_SIZE_WIDTH, + .m_item_height = BTN_ITEM_SIZE_HEIGHT, + .m_icon_width = BTN_ICON_SIZE_WIDTH, + .m_icon_height = BTN_ICON_SIZE_HEIGHT, + .canFuncName = "CanReboot", + .setFuncName = "Reboot", + .m_inhibitType = REBOOT }, + // 4.Shut Down + { .m_strName = tr("Shut Down"), + .m_strToolTip = tr("Close all apps, and then shut down your computer"), + .m_strIcon = ":/image/assets/shutdown.svg", + .m_show_flag = true, + .m_item_width = BTN_ITEM_SIZE_WIDTH, + .m_item_height = BTN_ITEM_SIZE_HEIGHT, + .m_icon_width = BTN_ICON_SIZE_WIDTH, + .m_icon_height = BTN_ICON_SIZE_HEIGHT, + .canFuncName = "CanPowerOff", + .setFuncName = "PowerOff", + .m_inhibitType = SHUTDOWN } + }; void setSystemPowerStatus(QString); @@ -149,21 +144,19 @@ public Q_SLOTS: void onListItemClicked(QListWidgetItem *item); private: + // QDBusInterface *sessionInterface; + // QDBusInterface *loginInterface; -// QDBusInterface *sessionInterface; -// QDBusInterface *loginInterface; - - bool m_canSuspend; - bool m_canHibernate; - bool m_canReboot ; - bool m_canShutDown ; + bool m_canSuspend; + bool m_canHibernate; + bool m_canReboot; + bool m_canShutDown; void initUI(); void initBtnShowFlag(); void initConnections(); void refreshTranslate(); -// void initDBusInterface(); - + // void initDBusInterface(); }; #endif // POWERLISTWIDGET_H