Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
432b28d4b3
!69 Display date below time in English environment(#35552)
From: @liubuguiii 
Reviewed-by: @stonefly128 
Signed-off-by: @stonefly128
2024-04-23 08:41:47 +00:00
liuxinhao
4e9a0a594f Display date below time in English environment(#35552) 2024-04-23 15:13:27 +08:00
openeuler-ci-bot
bc9bd9fdfa
!66 Adjusting the Greeter Control Center plugin to use a new version of the interface for keyword search(#35280)
From: @liubuguiii 
Reviewed-by: @stonefly128 
Signed-off-by: @stonefly128
2024-04-22 12:14:49 +00:00
liuxinhao
4886bf8698 Adjusting the Greeter Control Center plugin to use a new version of the interface for keyword search(#35280) 2024-04-22 15:38:48 +08:00
openeuler-ci-bot
461e8faa0a
!63 Fix the issue of authentication failure after re authentication(#32411)
From: @liubuguiii 
Reviewed-by: @tangjie02 
Signed-off-by: @tangjie02
2024-04-10 06:56:44 +00:00
liuxinhao
f34c9c072c Fix the issue of authentication failure after re authentication(#32411) 2024-04-10 14:02:30 +08:00
openeuler-ci-bot
e100da1c9f
!60 sync 2.5.1-11
From: @liubuguiii 
Reviewed-by: @tangjie02 
Signed-off-by: @tangjie02
2024-04-09 09:51:27 +00:00
liuxinhao
b92e0ca25b sync 2.5.1-11 2024-04-09 17:11:59 +08:00
openeuler-ci-bot
9add8e532f
!56 同步更新,修复BUG
From: @liubuguiii 
Reviewed-by: @tangjie02 
Signed-off-by: @tangjie02
2024-01-18 12:02:08 +00:00
liuxinhao
8eb5fa4b02 添加登录背景设置标题 2024-01-18 17:19:48 +08:00
11 changed files with 2748 additions and 14 deletions

View File

@ -1,8 +1,8 @@
From 66d11ae4717a846e06a7fc85354993ba2e90ce0e Mon Sep 17 00:00:00 2001 From 66d11ae4717a846e06a7fc85354993ba2e90ce0e Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn> From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Thu, 26 Oct 2023 14:40:23 +0800 Date: Thu, 26 Oct 2023 14:40:23 +0800
Subject: [PATCH 08/10] fix(styleditemdelegate): updateEditorGeometry to update Subject: [PATCH] fix(styleditemdelegate): updateEditorGeometry to update the
the wrong size of ItemWidgets in QStyledItemDelegate wrong size of ItemWidgets in QStyledItemDelegate
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit Content-Transfer-Encoding: 8bit

View File

@ -0,0 +1,163 @@
From dde040b63753a0f8e1b8e3a65dbdefc8d188224c Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Thu, 18 Jan 2024 17:15:12 +0800
Subject: [PATCH] fix(login background): Add login background setting title
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 添加登录背景设置标题
Closes #25063
---
.../kiran-cpanel-greeter/setting-window.cpp | 9 +++-
translations/kiran-cpanel-greeter.zh_CN.ts | 43 +++++++++++--------
2 files changed, 31 insertions(+), 21 deletions(-)
diff --git a/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp b/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp
index 921e27c..5c3fd15 100644
--- a/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp
+++ b/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp
@@ -154,7 +154,7 @@ QWidget *SettingWindow::initPageAutoLogin()
auto pageAutoLogin = new QWidget(this);
auto mainLayout = new QVBoxLayout(pageAutoLogin);
- mainLayout->setContentsMargins(12, 24, 12, 0);
+ mainLayout->setContentsMargins(16, 16, 16, 0);
mainLayout->setSpacing(0);
/* 自动登录用户总开关 */
@@ -263,11 +263,16 @@ QWidget *SettingWindow::initPageGeneralSettings()
{
auto pageGeneralSettings = new QWidget(this);
auto mainLayout = new QVBoxLayout(pageGeneralSettings);
- mainLayout->setContentsMargins(12, 24, 12, 0);
+ mainLayout->setContentsMargins(16, 16, 16, 0);
mainLayout->setSpacing(0);
/* 外观设置 */
/* 图片选择控件 */
+ auto titleLabel = new QLabel(this);
+ titleLabel->setText(tr("login background setting"));
+ mainLayout->addWidget(titleLabel);
+ mainLayout->addSpacerItem(new QSpacerItem(10,10,QSizePolicy::Minimum,QSizePolicy::Fixed));
+
m_imageSelector = new KiranImageSelector(this);
m_imageSelector->setFixedHeight(148);
mainLayout->addWidget(m_imageSelector);
diff --git a/translations/kiran-cpanel-greeter.zh_CN.ts b/translations/kiran-cpanel-greeter.zh_CN.ts
index fbe76f5..5468e6f 100644
--- a/translations/kiran-cpanel-greeter.zh_CN.ts
+++ b/translations/kiran-cpanel-greeter.zh_CN.ts
@@ -110,84 +110,89 @@ Select discard to discard the modification and reload the new configuration</sou
</message>
<message>
<location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="235"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="394"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="399"/>
<source>Save</source>
<translation>保存</translation>
</message>
<message>
<location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="249"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="408"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="413"/>
<source>Reset</source>
<translation>重置</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="284"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="272"/>
+ <source>login background setting</source>
+ <translation>登录背景设置</translation>
+ </message>
+ <message>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="289"/>
<source>Scale Mode</source>
<translation>缩放模式</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="295"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="300"/>
<source>auto</source>
<translation>自动</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="296"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="301"/>
<source>manual</source>
<translation>手动</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="297"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="302"/>
<source>disable</source>
<translation>禁用</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="303"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="308"/>
<source>Scale Factor</source>
<translation>缩放比例</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="328"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="333"/>
<source>Enable manual input user login</source>
<translation>允许手动输入用户名登录</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="353"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="358"/>
<source>Show User List</source>
<translation>显示用户列表</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="460"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="536"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="465"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="541"/>
<source>Configuration changed</source>
<translation>配置已改变</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="461"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="537"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="466"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="542"/>
<source>The external configuration file has changed
If you choose to save, all external changes will be overwritten
Select discard to discard the modification and reload the new configuration</source>
<translation>配置文件已被修改,如果继续保存所有额外的修改将会被覆盖,选择丢弃将丢弃所有的修改并重新加载新的配置文件</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="514"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="584"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="519"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="589"/>
<source>Save failed, reload</source>
<translation>保存失败,已重新加载</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="518"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="594"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="523"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="599"/>
<source>Saved successfully</source>
<translation>保存成功</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="588"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="593"/>
<source>Save failed: %1</source>
<translation>保存失败: %1</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="713"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="718"/>
<source>Please ensure that one of the two options is turned on!</source>
<translation>请确保两个选项之一被打开!</translation>
</message>
--
2.27.0

View File

@ -0,0 +1,51 @@
From b97a40e3391511acd90848b18f526447f9196062 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Wed, 31 Jan 2024 09:29:47 +0800
Subject: [PATCH 12/16] feat(ci): Connect to internal CI processes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 接入内部CI流程
---
.gitlab-ci.yml | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 18db367..da5af29 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,12 +1,23 @@
variables:
EXTRA_DNF_REPOS: |
- [KiranBase2.4]
- name=KiranBase2.4
+ [Kiran2.6]
+ name=Kiran2.6
gpgcheck=0
- baseurl=http://192.168.120.71/kojifiles/repos/KY3.5-1-Kiran-base-2.4-build/latest/x86_64/
- RPM_BUILD_REQUIRES: 'gcc-c++ cmake libXtst-devel libX11-devel libXrandr-devel libXcursor-devel libXfixes-devel glib2-devel lightdm-qt5-devel pam-devel qt5-qtbase-devel qt5-linguist qt5-qtx11extras-devel qt5-qtsvg-devel gsettings-qt-devel kiran-widgets-qt5-devel kiran-log-qt5-devel kiran-biometrics-devel kiran-authentication-service-devel kiran-cc-daemon-devel kiran-control-panel-devel kiran-qt5-integration-devel kiran-screensaver-devel'
-
+ baseurl=http://build.kylinsec.com.cn:82/KylinSec:/3.5.2:/Customize:/Kiran2.6/standard_x86_64/
+ [KylinSec_3.5.2_Epol]
+ name=KylinSec 3.5.2 (standard_x86_64)
+ baseurl=http://build.kylinsec.com.cn:82/KylinSec:/3.5.2:/Epol/standard_x86_64/
+ enabled=1
+ gpgcheck=0
+ [KylinSec_3.5.2_Mainline]
+ name=KylinSec 3.5.2 (standard_x86_64)
+ baseurl=http://build.kylinsec.com.cn:82/KylinSec:/3.5.2:/Mainline/standard_x86_64/
+ gpgcheck=0
+ gpgkey=http://build.kylinsec.com.cn:82/KylinSec:/3.5.2:/Mainline/standard_x86_64/repodata/repomd.xml.key
+ enabled=1
+ RPM_BUILD_REQUIRES: 'cmake gcc-c++ libXtst-devel libX11-devel libXrandr-devel libXcursor-devel libXfixes-devel glib2-devel lightdm-qt5-devel pam-devel libxkbcommon-devel qt5-qtbase-devel qt5-linguist qt5-qtx11extras-devel qt5-qtsvg-devel gsettings-qt-devel kiran-widgets-qt5-devel kiran-log-qt5-devel kiran-authentication-service-devel kiran-cc-daemon-devel kiran-control-panel-devel kiran-qt5-integration-devel kiran-qdbusxml2cpp kiran-screensaver-devel polkit-qt5-1-devel'
include:
- - project: 'os/gitlab-ci'
+ - project: 'os/ks-devops'
ref: main
- file: '/cmake/cxx.gitlab-ci.yml'
+ file: '/entrypoint/develop/cmake.yml'
+
--
2.27.0

View File

@ -0,0 +1,987 @@
From a076bff281bf7d8b3a5b6dc61f82a2e2cb25d23c Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Wed, 31 Jan 2024 11:46:23 +0800
Subject: [PATCH 13/16] fix(code scanning ): Fix some static code scanning
issues
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复一些代码静态扫描问题
---
lib/auth-proxy/auth-controller-i.h | 13 ++
lib/common-widgets/auth-type-drawer.cpp | 15 ++-
lib/common-widgets/auth-type-drawer.h | 13 ++
lib/common-widgets/auth-type-switcher.cpp | 17 ++-
...m.kylinsec.Kiran.SystemDaemon.Accounts.xml | 8 --
lib/login-frame/login-frame.cpp | 2 +-
lib/utils/keyboard-monitor.cpp | 69 ++++------
lib/utils/scaling-helper.cpp | 125 ++++++++++--------
lib/utils/virtual-keyboard.h | 4 +-
src/lightdm-greeter/common/prefs.cpp | 26 ++--
src/lightdm-greeter/frame.cpp | 6 +-
.../kiran-cpanel-greeter/main.cpp | 13 ++
.../kiran-cpanel-greeter/setting-window.cpp | 1 -
src/lightdm-greeter/term-signal-handler.cpp | 2 +-
.../widgets/disabledeselectlistwidget.cpp | 11 +-
src/lightdm-greeter/widgets/login-button.cpp | 7 +-
src/lightdm-greeter/widgets/user-info.h | 2 +
src/lightdm-greeter/widgets/user-list.cpp | 15 ++-
src/lightdm-greeter/widgets/user-list.h | 2 +-
src/polkit-agent/auth-polkit.h | 2 +-
src/polkit-agent/dialog.cpp | 2 +-
src/polkit-agent/moreinfo-button.cpp | 16 +--
src/screensaver-dialog/auth-pam.h | 2 +-
.../checkpass-common/pam-message.cpp | 4 +-
src/screensaver-dialog/frame.cpp | 10 +-
src/screensaver-dialog/prefs.cpp | 12 +-
.../session-guard-checkpass/main.cpp | 30 +++--
27 files changed, 240 insertions(+), 189 deletions(-)
diff --git a/lib/auth-proxy/auth-controller-i.h b/lib/auth-proxy/auth-controller-i.h
index 3340807..6f75241 100644
--- a/lib/auth-proxy/auth-controller-i.h
+++ b/lib/auth-proxy/auth-controller-i.h
@@ -1,3 +1,16 @@
+/**
+ * Copyright (c) 2020 ~ 2024 KylinSec Co., Ltd.
+ * kiran-session-guard is licensed under Mulan PSL v2.
+ * You can use this software according to the terms and conditions of the Mulan PSL v2.
+ * You may obtain a copy of Mulan PSL v2 at:
+ * http://license.coscl.org.cn/MulanPSL2
+ * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ * See the Mulan PSL v2 for more details.
+ *
+ * Author: liuxinhao <liuxinhao@kylinsec.com.cn>
+ */
#pragma once
#include <QString>
#include "auth-define.h"
diff --git a/lib/common-widgets/auth-type-drawer.cpp b/lib/common-widgets/auth-type-drawer.cpp
index bddc5e8..57109ee 100644
--- a/lib/common-widgets/auth-type-drawer.cpp
+++ b/lib/common-widgets/auth-type-drawer.cpp
@@ -1,3 +1,16 @@
+/**
+ * Copyright (c) 2020 ~ 2024 KylinSec Co., Ltd.
+ * kiran-session-guard is licensed under Mulan PSL v2.
+ * You can use this software according to the terms and conditions of the Mulan PSL v2.
+ * You may obtain a copy of Mulan PSL v2 at:
+ * http://license.coscl.org.cn/MulanPSL2
+ * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ * See the Mulan PSL v2 for more details.
+ *
+ * Author: liuxinhao <liuxinhao@kylinsec.com.cn>
+ */
#include "auth-type-drawer.h"
#include "style-palette.h"
@@ -84,7 +97,7 @@ void AuthTypeDrawer::setAuthTypes(QList<std::tuple<int, QString, QString>> authT
authButtonInfo.m_icon = icon;
m_buttonMap[authType] = authButtonInfo;
}
-
+
updateValidSizeHint();
if (m_adjustColorToTheme)
diff --git a/lib/common-widgets/auth-type-drawer.h b/lib/common-widgets/auth-type-drawer.h
index 7095773..f6edb79 100644
--- a/lib/common-widgets/auth-type-drawer.h
+++ b/lib/common-widgets/auth-type-drawer.h
@@ -1,3 +1,16 @@
+/**
+ * Copyright (c) 2020 ~ 2024 KylinSec Co., Ltd.
+ * kiran-session-guard is licensed under Mulan PSL v2.
+ * You can use this software according to the terms and conditions of the Mulan PSL v2.
+ * You may obtain a copy of Mulan PSL v2 at:
+ * http://license.coscl.org.cn/MulanPSL2
+ * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ * See the Mulan PSL v2 for more details.
+ *
+ * Author: liuxinhao <liuxinhao@kylinsec.com.cn>
+ */
#pragma once
#include <QWidget>
diff --git a/lib/common-widgets/auth-type-switcher.cpp b/lib/common-widgets/auth-type-switcher.cpp
index a1a4470..37ead7d 100644
--- a/lib/common-widgets/auth-type-switcher.cpp
+++ b/lib/common-widgets/auth-type-switcher.cpp
@@ -1,3 +1,16 @@
+/**
+ * Copyright (c) 2020 ~ 2024 KylinSec Co., Ltd.
+ * kiran-session-guard is licensed under Mulan PSL v2.
+ * You can use this software according to the terms and conditions of the Mulan PSL v2.
+ * You may obtain a copy of Mulan PSL v2 at:
+ * http://license.coscl.org.cn/MulanPSL2
+ * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ * See the Mulan PSL v2 for more details.
+ *
+ * Author: liuxinhao <liuxinhao@kylinsec.com.cn>
+ */
#include "auth-type-switcher.h"
#include <qt5-log-i.h>
#include <QDebug>
@@ -21,9 +34,9 @@ AuthTypeSwitcher::AuthTypeSwitcher(AuthTypeDrawerExpandDirection direction, int
m_drawer = new AuthTypeDrawer(direction, radius, parent, this);
connect(m_drawer, &AuthTypeDrawer::authTypeClicked, this, &AuthTypeSwitcher::onAuthTypeChanged);
// clang-format off
- connect(m_drawer, &AuthTypeDrawer::expandedStatusChanged, [this](bool expaned){
+ connect(m_drawer, &AuthTypeDrawer::expandedStatusChanged, [this](bool expaned){
m_isExpanded = expaned;
- update();
+ update();
});
// clang-format on
}
diff --git a/lib/dbus/com.kylinsec.Kiran.SystemDaemon.Accounts.xml b/lib/dbus/com.kylinsec.Kiran.SystemDaemon.Accounts.xml
index 2248466..f7cb8f8 100644
--- a/lib/dbus/com.kylinsec.Kiran.SystemDaemon.Accounts.xml
+++ b/lib/dbus/com.kylinsec.Kiran.SystemDaemon.Accounts.xml
@@ -65,14 +65,6 @@
</arg>
</method>
- <!--<method name="SetGlobalAuthModes">
- <arg name="auth_modes" direction="in" type="i">
- <description>Bitwise OR the enabled authorization mode.</description>
- </arg>>
- <description>Set the global enabled authentication modes. It will reset to all users using the auth_modes
- and also use the auth_modes when user is added.</description>
- </method>-->
-
<property name="rsa_public_key" type="s" access="read">
<description>The RSA public key.</description>
</property>
diff --git a/lib/login-frame/login-frame.cpp b/lib/login-frame/login-frame.cpp
index 1657296..67e54e5 100644
--- a/lib/login-frame/login-frame.cpp
+++ b/lib/login-frame/login-frame.cpp
@@ -280,8 +280,8 @@ void LoginFrame::onShowPrmpt(const QString& text, PromptType type)
ui->edit->setPlaceHolderText(text);
m_editMode = EDIT_MODE_PROMPT_RESPOSE;
ui->edit->setEchoMode(type == PromptTypeSecret ? QLineEdit::Password : QLineEdit::Normal);
- /// FIXME:需要延时设置输入焦点到输入框不然又会被置回UserItem
m_prompted = true;
+ /// NOTE:需要延时设置输入焦点到输入框不然又会被置回UserItem
setEditFocus(200);
}
diff --git a/lib/utils/keyboard-monitor.cpp b/lib/utils/keyboard-monitor.cpp
index 290d8e4..4b7e89e 100644
--- a/lib/utils/keyboard-monitor.cpp
+++ b/lib/utils/keyboard-monitor.cpp
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
namespace Kiran
{
@@ -36,61 +37,39 @@ int KeyboardMonitor::getXiMajorVersion(Display *display)
XExtensionVersion *version;
static int vers = -1;
- if (vers != -1) return vers;
-
- version = XGetExtensionVersion(display, INAME);
-
- if (version && (version != (XExtensionVersion *)NoSuchExtension))
+ if (vers != -1)
{
- vers = version->major_version;
- XFree(version);
+ return vers;
}
- /* Announce our supported version so the server treats us correctly. */
- if (vers >= XI_2_Major)
+ version = XGetExtensionVersion(display, INAME);
+ if (!version || (version == reinterpret_cast<XExtensionVersion *>(NoSuchExtension)))
{
- const char *forced_version;
- int maj = 2, min = 2;
-
- forced_version = getenv("XINPUT_XI2_VERSION");
- if (forced_version)
- {
- if (sscanf(forced_version, "%d.%d", &maj, &min) != 2)
- {
- fprintf(stderr,
- "Invalid format of XINPUT_XI2_VERSION "
- "environment variable. Need major.minor\n");
- exit(1);
- }
- printf("Overriding XI2 version to: %d.%d\n", maj, min);
- }
-
- XIQueryVersion(display, &maj, &min);
+ vers = 0;
+ return vers;
}
+ vers = version->major_version;
+ XFree(version);
return vers;
}
void KeyboardMonitor::selectEvents(Display *display)
{
- XIEventMask m;
- m.deviceid = XIAllMasterDevices;
- m.mask_len = XIMaskLen(XI_LASTEVENT);
- m.mask = (unsigned char *)calloc(m.mask_len, sizeof(char));
-
- XISetMask(m.mask, XI_RawKeyRelease);
- // XISetMask(m.mask, XI_RawKeyPress);
- // XISetMask(m.mask, XI_RawButtonPress);
- // XISetMask(m.mask, XI_RawButtonRelease);
- // XISetMask(m.mask, XI_RawMotion);
- // XISetMask(m.mask, XI_RawTouchBegin);
- // XISetMask(m.mask, XI_RawTouchUpdate);
- // XISetMask(m.mask, XI_RawTouchEnd);
-
- XISelectEvents(display, DefaultRootWindow(display), &m, 1);
-
- free(m.mask);
- XSync(display, False);
+ XIEventMask evmask;
+ unsigned char mask[XIMaskLen(XI_LASTEVENT)] = {0};
+
+ memset(&evmask, 0, sizeof(evmask));
+ memset(mask, 0, sizeof(mask));
+
+ XISetMask(mask, XI_RawKeyRelease);
+
+ evmask.deviceid = XIAllMasterDevices;
+ evmask.mask_len = sizeof(mask);
+ evmask.mask = mask;
+
+ XISelectEvents(display, DefaultRootWindow(display), &evmask, 1);
+ XFlush(display);
}
int KeyboardMonitor::listenXiEvent(Display *display)
@@ -118,7 +97,7 @@ int KeyboardMonitor::listenXiEvent(Display *display)
}
else if (sym == XKB_KEY_Num_Lock)
{
- emit numlockStatusChanged(isNumlockOn());
+ emit this->numlockStatusChanged(isNumlockOn());
}
break;
}
diff --git a/lib/utils/scaling-helper.cpp b/lib/utils/scaling-helper.cpp
index ed051d9..697744e 100644
--- a/lib/utils/scaling-helper.cpp
+++ b/lib/utils/scaling-helper.cpp
@@ -36,8 +36,14 @@ void ScalingHelper::auto_calculate_screen_scaling()
std::list<double> scaleFactors;
display = XOpenDisplay(nullptr);
- resources = XRRGetScreenResourcesCurrent(display, DefaultRootWindow(display));
+ if (!display)
+ {
+ KLOG_WARNING("auto_calculate_screen_scaling failed,set QT_AUTO_SCREEN_SCALE_FACTOR=1");
+ qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
+ return;
+ }
+ resources = XRRGetScreenResourcesCurrent(display, DefaultRootWindow(display));
if (!resources)
{
KLOG_WARNING("XRRGetScreenResourcesCurrent failed,try XRRGetScreenResources");
@@ -47,81 +53,86 @@ void ScalingHelper::auto_calculate_screen_scaling()
if (!resources)
{
KLOG_WARNING("get screen resources failed");
- goto failed;
+ if (display)
+ {
+ XCloseDisplay(display);
+ }
+ KLOG_WARNING("auto_calculate_screen_scaling failed,set QT_AUTO_SCREEN_SCALE_FACTOR=1");
+ qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
+ return;
}
- if (resources)
+ for (int i = 0; i < resources->noutput; i++)
{
- for (int i = 0; i < resources->noutput; i++)
+ XRROutputInfo *outputInfo = XRRGetOutputInfo(display, resources, resources->outputs[i]);
+ if (!outputInfo)
+ {
+ KLOG_WARNING("get output info %d from resources failed", i);
+ continue;
+ }
+ else if ((outputInfo->crtc == 0) || (outputInfo->mm_width == 0))
{
- XRROutputInfo *outputInfo = XRRGetOutputInfo(display, resources, resources->outputs[i]);
- if (outputInfo->crtc == 0 || outputInfo->mm_width == 0)
- {
- if (outputInfo != nullptr)
- {
- XRRFreeOutputInfo(outputInfo);
- }
- continue;
- }
- XRRCrtcInfo *crtInfo = XRRGetCrtcInfo(display, resources, outputInfo->crtc);
- if (crtInfo == nullptr)
- {
- XRRFreeOutputInfo(outputInfo);
- continue;
- }
-
- // 计算屏幕尺寸
- qreal screenInch;
- screenInch = qSqrt(qPow(outputInfo->mm_width, 2.0) + qPow(outputInfo->mm_height, 2.0)) / qreal(25.4);
-
- // 计算ppi
- qreal hypotenusePixel = qSqrt(qPow(crtInfo->width, 2.0) + qPow(crtInfo->height, 2.0));
- qreal ppi = hypotenusePixel / screenInch;
-
- KLOG_INFO() << "Screen:" << outputInfo->name;
- KLOG_INFO() << " physical size: " << outputInfo->mm_width << "x" << outputInfo->mm_height;
- KLOG_INFO() << " virtual size: " << crtInfo->width << crtInfo->height;
- KLOG_INFO() << " inch: " << screenInch;
- KLOG_INFO() << " ppi: " << ppi;
-
- double screen_scale_factor = 1.0;
- if (ppi >= 150 && ppi < 196)
- {
- screen_scale_factor = 1.5;
- }
- else if (ppi >= 196)
- {
- screen_scale_factor = 2.0;
- }
- else if (crtInfo->width >= 4096)
- {
- screen_scale_factor = 2.0;
- }
- scaleFactors.push_back(screen_scale_factor);
- XRRFreeCrtcInfo(crtInfo);
+ KLOG_WARNING("ignore crtc==0 or mm_width==0 output");
XRRFreeOutputInfo(outputInfo);
+ continue;
+ }
+
+ XRRCrtcInfo *crtInfo = XRRGetCrtcInfo(display, resources, outputInfo->crtc);
+ if (crtInfo == nullptr)
+ {
+ KLOG_WARNING("ignore crtcinfo==null output");
+ XRRFreeOutputInfo(outputInfo);
+ continue;
+ }
+
+ // 计算屏幕尺寸
+ qreal screenInch;
+ screenInch = qSqrt(qPow(outputInfo->mm_width, 2.0) + qPow(outputInfo->mm_height, 2.0)) / qreal(25.4);
+
+ // 计算ppi
+ qreal hypotenusePixel = qSqrt(qPow(crtInfo->width, 2.0) + qPow(crtInfo->height, 2.0));
+ qreal ppi = hypotenusePixel / screenInch;
+
+ KLOG_INFO() << "Screen:" << outputInfo->name;
+ KLOG_INFO() << " physical size: " << outputInfo->mm_width << "x" << outputInfo->mm_height;
+ KLOG_INFO() << " virtual size: " << crtInfo->width << crtInfo->height;
+ KLOG_INFO() << " inch: " << screenInch;
+ KLOG_INFO() << " ppi: " << ppi;
+
+ double screen_scale_factor = 1.0;
+ if (ppi >= 150 && ppi < 196)
+ {
+ screen_scale_factor = 1.5;
+ }
+ else if (ppi >= 196)
+ {
+ screen_scale_factor = 2.0;
+ }
+ else if (crtInfo->width >= 4096)
+ {
+ screen_scale_factor = 2.0;
}
- XRRFreeScreenResources(resources);
+ scaleFactors.push_back(screen_scale_factor);
+
+ XRRFreeCrtcInfo(crtInfo);
+ XRRFreeOutputInfo(outputInfo);
}
+ XRRFreeScreenResources(resources);
XCloseDisplay(display);
+
if (scaleFactors.size())
{
scaleFactors.sort();
scale_factor = *scaleFactors.begin();
}
+
KLOG_INFO() << "QT_SCALE_FACTOR:" << scale_factor;
if (!qputenv("QT_SCALE_FACTOR", QString::number(scale_factor).toUtf8()))
{
KLOG_WARNING() << "set scale factor failed.";
}
+
return;
-failed:
- if (display)
- {
- XCloseDisplay(display);
- }
- KLOG_WARNING("auto_calculate_screen_scaling failed,set QT_AUTO_SCREEN_SCALE_FACTOR=1");
- qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
}
} // namespace SessionGuard
diff --git a/lib/utils/virtual-keyboard.h b/lib/utils/virtual-keyboard.h
index 09bbc37..4670105 100644
--- a/lib/utils/virtual-keyboard.h
+++ b/lib/utils/virtual-keyboard.h
@@ -44,8 +44,8 @@ private slots:
void slotReadyReadStandardOutput();
private:
- QWidget *m_keyboardWidget;
- QProcess *m_process;
+ QWidget *m_keyboardWidget = nullptr;
+ QProcess *m_process = nullptr;
QWidget *m_keyboardEmbed = nullptr;
};
} // namespace SessionGuard
diff --git a/src/lightdm-greeter/common/prefs.cpp b/src/lightdm-greeter/common/prefs.cpp
index 91d7072..82891b4 100644
--- a/src/lightdm-greeter/common/prefs.cpp
+++ b/src/lightdm-greeter/common/prefs.cpp
@@ -51,31 +51,31 @@ void Prefs::init()
/// common
settings.beginGroup("Common");
- auto hiddenSession = settings.value("hidden-sessions");
+ auto hiddenSession = settings.value("hidden-sessions","");
m_hiddenSessions = hiddenSession.toStringList();
- auto hiddenUsers = settings.value("hide-users");
- m_hiddenUsers = hiddenUsers.toStringList();
+ auto needHideUsers = settings.value("hide-users","");
+ m_hiddenUsers = needHideUsers.toStringList();
- auto numlockInitState = settings.value("numlock-init-state");
- m_numlockInitState = numlockInitState.toBool();
+ auto numInitState = settings.value("numlock-init-state");
+ m_numlockInitState = numInitState.toBool();
settings.endGroup();
/// power
settings.beginGroup("Power");
- auto canPowerOff = settings.value("can-poweroff");
- m_canPowerOff = canPowerOff.toBool();
+ auto powerOffEnable = settings.value("can-poweroff");
+ m_canPowerOff = powerOffEnable.toBool();
- auto canReboot = settings.value("can-reboot");
- m_canReboot = canReboot.toBool();
+ auto rebootEnable = settings.value("can-reboot");
+ m_canReboot = rebootEnable.toBool();
- auto canSuspend = settings.value("can-suspend");
- m_canSuspend = canSuspend.toBool();
+ auto suspendEnable = settings.value("can-suspend");
+ m_canSuspend = suspendEnable.toBool();
- auto canHibernate = settings.value("can-hibernate");
- m_canHibernate = canHibernate.toBool();
+ auto hibernateEnable = settings.value("can-hibernate");
+ m_canHibernate = hibernateEnable.toBool();
}
Prefs::~Prefs()
diff --git a/src/lightdm-greeter/frame.cpp b/src/lightdm-greeter/frame.cpp
index 3d8dada..e4afcb9 100644
--- a/src/lightdm-greeter/frame.cpp
+++ b/src/lightdm-greeter/frame.cpp
@@ -110,7 +110,7 @@ void Frame::initMenus()
auto setMenuAttributes = [](QMenu* menu)
{
menu->setAttribute(Qt::WA_TranslucentBackground); // 透明必需
- // FIXME:QMenu不能为窗口只能为控件不然透明效果依赖于窗口管理器混成特效与显卡
+ // NOTE:QMenu不能为窗口只能为控件不然透明效果依赖于窗口管理器混成特效与显卡
// 控件的话QMenu显示出来的话不能点击其他区域隐藏窗口需要手动隐藏
menu->setWindowFlags(Qt::FramelessWindowHint | Qt::Widget); // 透明必需
menu->setContentsMargins(0, 0, 0, 0);
@@ -165,7 +165,7 @@ void Frame::initUI()
{
resize(1024, 768);
- /// FIXME:因弹出窗口不是作为新的窗口,而是作为一个控件,需要我们去做隐藏
+ /// NOTE:因弹出窗口不是作为新的窗口,而是作为一个控件,需要我们去做隐藏
/// 开始监听整个应用程序事件,在窗口点击事件中判断隐藏菜单
qApp->installEventFilter(this);
@@ -205,7 +205,7 @@ void Frame::initUI()
// 初始化添加右下控件
// 获取菜单弹出坐标,按钮和触发菜单右对齐
- // FIXME: Qt在特定虚拟机环境下QMenu::popup传入正确的pos时,QMenu通过Pos找到screen,但screen的大小错误(为调整分辨率之前的分辨率)
+ // NOTE: Qt在特定虚拟机环境下QMenu::popup传入正确的pos时,QMenu通过Pos找到screen,但screen的大小错误(为调整分辨率之前的分辨率)
// 导致popup pos被修改成在错误的屏幕范围内
auto getMenuPopupPos = [this](QMenu* menu, const QToolButton* triggerBtn) -> QPoint
{
diff --git a/src/lightdm-greeter/kiran-cpanel-greeter/main.cpp b/src/lightdm-greeter/kiran-cpanel-greeter/main.cpp
index eeffb39..96567b7 100644
--- a/src/lightdm-greeter/kiran-cpanel-greeter/main.cpp
+++ b/src/lightdm-greeter/kiran-cpanel-greeter/main.cpp
@@ -1,3 +1,16 @@
+/**
+ * Copyright (c) 2020 ~ 2024 KylinSec Co., Ltd.
+ * kiran-session-guard is licensed under Mulan PSL v2.
+ * You can use this software according to the terms and conditions of the Mulan PSL v2.
+ * You may obtain a copy of Mulan PSL v2 at:
+ * http://license.coscl.org.cn/MulanPSL2
+ * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ * See the Mulan PSL v2 for more details.
+ *
+ * Author: liuxinhao <liuxinhao@kylinsec.com.cn>
+ */
#include <QApplication>
int main(int argc, char* argv[])
diff --git a/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp b/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp
index 5c3fd15..45c9fb9 100644
--- a/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp
+++ b/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp
@@ -435,7 +435,6 @@ void SettingWindow::initUserComboBox(QComboBox *combo)
iconFile.clear();
}
};
- QVector<UserInfo> userInfoVector;
QStringList users = UserManager::getCachedUsers();
users.append("root");
diff --git a/src/lightdm-greeter/term-signal-handler.cpp b/src/lightdm-greeter/term-signal-handler.cpp
index 5375d19..646c7e1 100644
--- a/src/lightdm-greeter/term-signal-handler.cpp
+++ b/src/lightdm-greeter/term-signal-handler.cpp
@@ -22,7 +22,7 @@
#include <QApplication>
#include <QSocketNotifier>
-//FIXME该种方式退出时,可能会有线程阻塞在xcb_wait_for_reply
+//TODO该种方式退出时,可能会有线程阻塞在xcb_wait_for_reply
namespace Kiran
{
namespace SessionGuard
diff --git a/src/lightdm-greeter/widgets/disabledeselectlistwidget.cpp b/src/lightdm-greeter/widgets/disabledeselectlistwidget.cpp
index c2f0190..e6a7962 100644
--- a/src/lightdm-greeter/widgets/disabledeselectlistwidget.cpp
+++ b/src/lightdm-greeter/widgets/disabledeselectlistwidget.cpp
@@ -31,24 +31,27 @@ DisableDeselectListWidget::DisableDeselectListWidget(QWidget *parent)
QItemSelectionModel::SelectionFlags
DisableDeselectListWidget::selectionCommand(const QModelIndex &index, const QEvent *event) const
{
- //FIXME:为了避免一些环境下会出现ItemFocus直接设置选中的情况
+ // NOTE:为了避免一些环境下会出现ItemFocus直接设置选中的情况
if (event == nullptr)
{
return QItemSelectionModel::NoUpdate;
}
- //禁用用户按住鼠标切换用户情况
+
+ // 禁用用户按住鼠标切换用户情况
if (event->type() == QEvent::MouseMove)
{
return QItemSelectionModel::NoUpdate;
}
- if ((event != nullptr) && (event->type() == QEvent::MouseButtonPress))
+
+ if ((event->type() == QEvent::MouseButtonPress))
{
- const QMouseEvent *mouseEvent = (QMouseEvent *)event;
+ const QMouseEvent *mouseEvent = static_cast<const QMouseEvent *>(event);
if ((mouseEvent->modifiers() & Qt::ControlModifier) != 0)
{
return QItemSelectionModel::NoUpdate;
}
}
+
return QListWidget::selectionCommand(index, event);
}
diff --git a/src/lightdm-greeter/widgets/login-button.cpp b/src/lightdm-greeter/widgets/login-button.cpp
index 428f18d..63f9367 100644
--- a/src/lightdm-greeter/widgets/login-button.cpp
+++ b/src/lightdm-greeter/widgets/login-button.cpp
@@ -24,9 +24,10 @@ namespace SessionGuard
{
namespace Greeter
{
-LoginButton::LoginButton(QWidget *parent) : QWidget(parent),
- ui(new Ui::LoginButton),
- m_pressed(false)
+LoginButton::LoginButton(QWidget *parent)
+ : QWidget(parent),
+ ui(new Ui::LoginButton),
+ m_pressed(false)
{
ui->setupUi(this);
ui->label_text->setText(tr("login"));
diff --git a/src/lightdm-greeter/widgets/user-info.h b/src/lightdm-greeter/widgets/user-info.h
index c7ca0d2..0aceaa8 100644
--- a/src/lightdm-greeter/widgets/user-info.h
+++ b/src/lightdm-greeter/widgets/user-info.h
@@ -24,6 +24,8 @@ namespace Greeter
{
struct UserInfo
{
+ UserInfo():uid(0),hasMessage(false),loggedIn(false)
+ {};
QString name;
QString realName;
QString session;
diff --git a/src/lightdm-greeter/widgets/user-list.cpp b/src/lightdm-greeter/widgets/user-list.cpp
index e59fa8b..1b9be4b 100644
--- a/src/lightdm-greeter/widgets/user-list.cpp
+++ b/src/lightdm-greeter/widgets/user-list.cpp
@@ -281,8 +281,9 @@ QString UserList::getIconByUserName(const QString &userName)
UserInfo UserList::getUserInfoByUserName(const QString &userName)
{
UserInfo info;
+ int rowCout = m_filterModel.rowCount(QModelIndex());
- for (int i = 0; i < m_filterModel.rowCount(QModelIndex()); i++)
+ for (int i = 0; i < rowCout; i++)
{
UserInfo userInfo;
getUserInfoFromModel(i, userInfo);
@@ -339,10 +340,10 @@ void UserList::onModelRowsRemoved(const QModelIndex &parent, int first, int last
const QString userName = item->text();
QListWidgetItem *removedItem = ui->userList->takeItem(i);
delete removedItem;
- emit userRemoved(userName);
+ emit this->userRemoved(userName);
}
int newCount = userCount();
- emit userCountChanged(oldCount, newCount);
+ emit this->userCountChanged(oldCount, newCount);
updateGeometry();
}
@@ -359,7 +360,7 @@ void UserList::onModelRowsInserted(const QModelIndex &parent, int first, int las
KLOG_DEBUG() << "row inserted: "
<< "cout[" << ui->userList->count() << "]";
updateGeometry();
- emit userCountChanged(oldCount, newCount);
+ emit this->userCountChanged(oldCount, newCount);
}
void UserList::onAppFocusChanged(QWidget *oldFocus, QWidget *newFocus)
@@ -409,10 +410,10 @@ void UserList::onDataChanged(const QModelIndex &topLeft,
break;
}
};
- int startRow = topLeft.row();
- int endRow = topLeft.row();
- // FIXME: QLightdDM此处信号发出时roles为默认参数, 无法判断数据变化范围
+ int startRow = topLeft.row();
+ int endRow = bottomRight.row();
+ // NOTE: QLightdDM此处信号发出时roles为默认参数, 无法判断数据变化范围
// 检查图片更新,用户列表中的顺序可能和用户不一致
for (int i = startRow; i <= endRow; i++)
{
diff --git a/src/lightdm-greeter/widgets/user-list.h b/src/lightdm-greeter/widgets/user-list.h
index e58b39c..32730cc 100644
--- a/src/lightdm-greeter/widgets/user-list.h
+++ b/src/lightdm-greeter/widgets/user-list.h
@@ -64,7 +64,7 @@ private slots:
void onAppFocusChanged(QWidget* oldFocus,QWidget* newFocus);
void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> roles);
-Q_SIGNALS:
+signals:
void userActivated(const UserInfo &userInfo);
void userCountChanged(int oldCount, int newCount);
void userRemoved(const QString &userName);
diff --git a/src/polkit-agent/auth-polkit.h b/src/polkit-agent/auth-polkit.h
index 063a964..2b3cb91 100644
--- a/src/polkit-agent/auth-polkit.h
+++ b/src/polkit-agent/auth-polkit.h
@@ -59,7 +59,7 @@ private slots:
void handleSessionShowInfo(const QString& text);
private:
- AuthControllerInterface* m_controllerInterface;
+ AuthControllerInterface* m_controllerInterface = nullptr;
QString m_cookie;
PolkitQt1::Agent::Session* m_session = nullptr;
PolkitQt1::Identity m_identity;
diff --git a/src/polkit-agent/dialog.cpp b/src/polkit-agent/dialog.cpp
index 6094a71..460e834 100644
--- a/src/polkit-agent/dialog.cpp
+++ b/src/polkit-agent/dialog.cpp
@@ -247,7 +247,7 @@ void Dialog::onAuthComplete(bool success)
{
if (m_authController->isAuthenticated())
{
- emit completed(true);
+ emit this->completed(true);
this->close();
return;
}
diff --git a/src/polkit-agent/moreinfo-button.cpp b/src/polkit-agent/moreinfo-button.cpp
index 9415f11..babdac2 100644
--- a/src/polkit-agent/moreinfo-button.cpp
+++ b/src/polkit-agent/moreinfo-button.cpp
@@ -27,17 +27,13 @@ namespace SessionGuard
namespace PolkitAgent
{
MoreInfoButton::MoreInfoButton(QWidget* parent)
- : QWidget(parent)
+ : QWidget(parent),
+ m_expandPix(style()->standardPixmap(QStyle::SP_ArrowUp)),
+ m_shrinkPix(style()->standardPixmap(QStyle::SP_ArrowRight)),
+ m_iconSize(QSize(16, 16)),
+ m_text(QString("more info"))
{
- m_shrinkPix = style()->standardPixmap(QStyle::SP_ArrowRight);
- m_expandPix = style()->standardPixmap(QStyle::SP_ArrowUp);
-
- m_iconSize = QSize(16, 16);
-
- // m_shrinkPix = m_shrinkPix.scaled(m_iconSize,Qt::KeepAspectRatio,Qt::SmoothTransformation);
- // m_expandPix = m_expandPix.scaled(m_iconSize,Qt::KeepAspectRatio,Qt::SmoothTransformation);
-
- setText("more info");
+ setText(m_text);
}
MoreInfoButton::~MoreInfoButton()
diff --git a/src/screensaver-dialog/auth-pam.h b/src/screensaver-dialog/auth-pam.h
index 210ad6f..99e0bb5 100644
--- a/src/screensaver-dialog/auth-pam.h
+++ b/src/screensaver-dialog/auth-pam.h
@@ -60,7 +60,7 @@ private:
void handleChildExit();
private:
- AuthControllerInterface* m_interface;
+ AuthControllerInterface* m_interface = nullptr;
QString m_userName;
bool m_isAuthenticated = false;
diff --git a/src/screensaver-dialog/checkpass-common/pam-message.cpp b/src/screensaver-dialog/checkpass-common/pam-message.cpp
index 3cd50f5..76fce7f 100644
--- a/src/screensaver-dialog/checkpass-common/pam-message.cpp
+++ b/src/screensaver-dialog/checkpass-common/pam-message.cpp
@@ -43,12 +43,12 @@ bool kiran_pam_message_send(int fd, QJsonDocument& content)
QByteArray qByteArray = content.toJson();
uint32_t contentLength = qByteArray.length();
- if (sendStream.writeRawData((const char*)&contentLength, sizeof(contentLength)) == -1)
+ if (sendStream.writeRawData(reinterpret_cast<const char*>(&contentLength), sizeof(contentLength)) == -1)
{
return false;
}
- if (sendStream.writeRawData((const char*)qByteArray.data(), qByteArray.length()) == -1)
+ if (sendStream.writeRawData(const_cast<const char*>(qByteArray.data()), qByteArray.length()) == -1)
{
return false;
}
diff --git a/src/screensaver-dialog/frame.cpp b/src/screensaver-dialog/frame.cpp
index 590c19d..73f50dc 100644
--- a/src/screensaver-dialog/frame.cpp
+++ b/src/screensaver-dialog/frame.cpp
@@ -50,9 +50,9 @@ Frame::Frame(Kiran::ScreenSaver::Interface* ksinterface, Power* power, QWidget*
m_power(power),
m_keyboard(nullptr),
m_ksInterface(ksinterface),
+ m_userName(UserManager::getCurrentUser()),
m_authProxy(nullptr)
{
- m_userName = UserManager::getCurrentUser();
KLOG_DEBUG() << "locker create for" << m_userName;
initMenus();
initUI();
@@ -102,9 +102,9 @@ void Frame::initUI()
{
// 初始化添加右下控件
// 获取菜单弹出坐标,按钮和触发菜单右对齐
- // FIXME: Qt在特定虚拟机环境下QMenu::popup传入正确的pos时,QMenu通过Pos找到screen,但screen的大小错误(为调整分辨率之前的分辨率)
+ // NOTE: Qt在特定虚拟机环境下QMenu::popup传入正确的pos时,QMenu通过Pos找到screen,但screen的大小错误(为调整分辨率之前的分辨率)
// 导致popup pos被修改成在错误的屏幕范围内
- auto getMenuPopupPos = [this](QMenu* menu, const QToolButton* triggerBtn) -> QPoint
+ auto getMenuPopupPos = [](QMenu* menu, const QToolButton* triggerBtn) -> QPoint
{
QSize menuSize = menu->actions().count() == 0 ? QSize(92, 10) : menu->sizeHint();
QPoint btnRightTopPos = triggerBtn->mapToGlobal(QPoint(triggerBtn->width(), 0));
@@ -137,7 +137,7 @@ void Frame::initUI()
};
// clang-format off
- m_btnSwitchToGreeter = createActionButton("btn_switchuser", tr("switch to greeter"), [](){
+ m_btnSwitchToGreeter = createActionButton("btn_switchuser", tr("switch to greeter"), [](){
KLOG_DEBUG() << "switch to greeter clicked";
UserManager::switchToGreeter();
});
@@ -159,7 +159,7 @@ void Frame::initUI()
return;
}
QPoint pos = getMenuPopupPos(m_powerMenu,m_btnPower);
- m_powerMenu->popup(pos);
+ m_powerMenu->popup(pos);
});
// clang-format on
diff --git a/src/screensaver-dialog/prefs.cpp b/src/screensaver-dialog/prefs.cpp
index 2e12e91..65fb565 100644
--- a/src/screensaver-dialog/prefs.cpp
+++ b/src/screensaver-dialog/prefs.cpp
@@ -33,14 +33,14 @@ void Prefs::init()
///power
settings.beginGroup("Power");
- auto canPowerOff = settings.value("can-poweroff");
- m_canPowerOff = canPowerOff.toBool();
+ auto powerOffEnable = settings.value("can-poweroff");
+ m_canPowerOff = powerOffEnable.toBool();
- auto canReboot = settings.value("can-reboot");
- m_canReboot = canReboot.toBool();
+ auto rebootEnable = settings.value("can-reboot");
+ m_canReboot = rebootEnable.toBool();
- auto canSuspend = settings.value("can-suspend");
- m_canSuspend = canSuspend.toBool();
+ auto suspendEnable = settings.value("can-suspend");
+ m_canSuspend = suspendEnable.toBool();
}
Prefs::~Prefs()
diff --git a/src/screensaver-dialog/session-guard-checkpass/main.cpp b/src/screensaver-dialog/session-guard-checkpass/main.cpp
index 9bad98d..30e8d91 100644
--- a/src/screensaver-dialog/session-guard-checkpass/main.cpp
+++ b/src/screensaver-dialog/session-guard-checkpass/main.cpp
@@ -33,7 +33,7 @@ int conversation(int num_msg, const pam_message **msgs, pam_response **resp, voi
struct pam_response *reply = NULL;
char *username = nullptr;
- reply = (struct pam_response *)calloc(num_msg, sizeof(*reply));
+ reply = static_cast<pam_response *>(calloc(num_msg, sizeof(pam_response)));
if (reply == nullptr)
{
KLOG_ERROR() << "can't malloc memory for replies,return PAM_CONV_ERR";
@@ -56,14 +56,14 @@ int conversation(int num_msg, const pam_message **msgs, pam_response **resp, voi
if (!kiran_pam_message_send_event(CHANNEL_WRITE, &event))
{
- //发送消息失败
+ // 发送消息失败
KLOG_DEBUG() << "send pam message to parent process failed!";
replyRet = PAM_CONV_ERR;
}
else
{
PamEvent *recvReply = nullptr;
- //接收消息失败
+ // 接收消息失败
if (!kiran_pam_message_recv_event(CHANNEL_READ, &recvReply))
{
KLOG_ERROR() << "recv pam prompt reply failed";
@@ -71,7 +71,7 @@ int conversation(int num_msg, const pam_message **msgs, pam_response **resp, voi
}
else
{
- //消息类型不正确
+ // 消息类型不正确
if (recvReply->type() != PamEvent::PromptReply)
{
KLOG_ERROR() << "recv event is not reply!";
@@ -80,8 +80,8 @@ int conversation(int num_msg, const pam_message **msgs, pam_response **resp, voi
else
{
auto replyEvent = dynamic_cast<PromptReplyEvent *>(recvReply);
- //KLOG_DEBUG() << "recv prompt reply:" << replyEvent->result() << replyEvent->text();
- //消息返回失败
+ // KLOG_DEBUG() << "recv prompt reply:" << replyEvent->result() << replyEvent->text();
+ // 消息返回失败
if (!replyEvent->result())
{
replyRet = PAM_CONV_ERR;
@@ -89,8 +89,10 @@ int conversation(int num_msg, const pam_message **msgs, pam_response **resp, voi
else
{
reply[i].resp_retcode = PAM_SUCCESS;
- reply[i].resp = (char *)calloc(1, replyEvent->text().length() + 1);
- strcpy(reply[i].resp, replyEvent->text().toStdString().c_str());
+ reply[i].resp = static_cast<char *>(calloc(1, replyEvent->text().length() + 1));
+ strncpy(reply[i].resp,
+ replyEvent->text().toStdString().c_str(),
+ replyEvent->text().length());
}
}
}
@@ -103,7 +105,7 @@ int conversation(int num_msg, const pam_message **msgs, pam_response **resp, voi
MessageEvent messageEvent(msg->msg_style == PAM_ERROR_MSG, msg->msg);
if (!kiran_pam_message_send_event(CHANNEL_WRITE, &messageEvent))
{
- //发送消息失败
+ // 发送消息失败
KLOG_DEBUG() << "send pam message to parent process failed!";
replyRet = PAM_CONV_ERR;
}
@@ -141,7 +143,7 @@ int main(int argc, char *argv[])
"kiran-screensaver-dialog",
"kiran-session-guard-checkpass");
- ///判断参数合法性
+ /// 判断参数合法性
if (argc != 3)
{
KLOG_ERROR() << "usage: pam-authproxy-checkpass READFD WRITEFD USERNAME";
@@ -172,8 +174,8 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
}
- ///安全性
- //可以参考lightdm session-child
+ /// 安全性
+ // 可以参考lightdm session-child
/* Protect memory from being paged to disk, as we deal with passwords */
mlockall(MCL_CURRENT | MCL_FUTURE);
@@ -187,7 +189,7 @@ int main(int argc, char *argv[])
<< "\t write fd: " << CHANNEL_WRITE << "\n"
<< "\t authproxy user name:" << userName;
- ///开始pam认证
+ /// 开始pam认证
// clang-format off
struct pam_conv conv = {
.conv = &conversation,
@@ -201,7 +203,7 @@ int main(int argc, char *argv[])
KLOG_WARNING() << "failed to start pam:" << pam_strerror(pamh, ret);
return EXIT_FAILURE;
}
-
+
int authRes = PAM_SUCCESS;
authRes = pam_authenticate(pamh, 0);
const char *newUserName;
--
2.27.0

View File

@ -0,0 +1,140 @@
From a76ad7de22f16efcad20236ec95dfa666ab3a8fa Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Tue, 6 Feb 2024 10:14:07 +0800
Subject: [PATCH 14/16] fix(virutalkeyboard): Add detection for whether to
install a virtual keyboard
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 新增对于是否安装虚拟键盘的检测
---
lib/utils/virtual-keyboard.cpp | 14 ++++++++++++++
lib/utils/virtual-keyboard.h | 5 +++--
src/lightdm-greeter/frame.cpp | 11 +++++++++--
src/screensaver-dialog/frame.cpp | 9 ++++++++-
4 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/lib/utils/virtual-keyboard.cpp b/lib/utils/virtual-keyboard.cpp
index 292740a..3e1e7dd 100644
--- a/lib/utils/virtual-keyboard.cpp
+++ b/lib/utils/virtual-keyboard.cpp
@@ -22,6 +22,7 @@
#include <QMutex>
#include <QScopedPointer>
#include <QScreen>
+#include <QFileInfo>
#define ONBOARD_LAYOUT "Compact"
#define ONBOARD_THEME "Blackboard"
@@ -61,10 +62,18 @@ VirtualKeyboard::~VirtualKeyboard()
bool VirtualKeyboard::init(QWidget *parent)
{
+ if( !QFileInfo::exists("/usr/bin/onboard") )
+ {
+ m_isSupported = false;
+ return false;
+ }
+
if (m_keyboardWidget != nullptr)
{
return false;
}
+
+ m_isSupported = true;
m_process = new QProcess(this);
connect(m_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
this, &VirtualKeyboard::slot_finished);
@@ -98,6 +107,11 @@ bool VirtualKeyboard::init(QWidget *parent)
return true;
}
+bool VirtualKeyboard::isSupported()
+{
+ return m_isSupported;
+}
+
bool VirtualKeyboard::isVisible()
{
if (m_keyboardWidget == nullptr)
diff --git a/lib/utils/virtual-keyboard.h b/lib/utils/virtual-keyboard.h
index 4670105..99bf405 100644
--- a/lib/utils/virtual-keyboard.h
+++ b/lib/utils/virtual-keyboard.h
@@ -29,8 +29,9 @@ public:
~VirtualKeyboard();
static VirtualKeyboard *instance();
-
bool init(QWidget *parent = nullptr);
+ bool isSupported();
+
void hide();
bool isVisible();
void showAdjustSize(QWidget *parent = nullptr);
@@ -39,11 +40,11 @@ public:
public slots:
void slot_finished(int exitCode, QProcess::ExitStatus exitStatus);
-
private slots:
void slotReadyReadStandardOutput();
private:
+ bool m_isSupported = false;
QWidget *m_keyboardWidget = nullptr;
QProcess *m_process = nullptr;
QWidget *m_keyboardEmbed = nullptr;
diff --git a/src/lightdm-greeter/frame.cpp b/src/lightdm-greeter/frame.cpp
index e4afcb9..085139a 100644
--- a/src/lightdm-greeter/frame.cpp
+++ b/src/lightdm-greeter/frame.cpp
@@ -306,7 +306,14 @@ void Frame::initUI()
rbBtnLayout->addItem(rbBtnLayoutItem);
rbBtnLayout->addWidget(m_btnSession, 1);
- rbBtnLayout->addWidget(m_btnKeyboard, 1);
+ if( VirtualKeyboard::instance()->isSupported() )
+ {
+ rbBtnLayout->addWidget(m_btnKeyboard, 1);
+ }
+ else
+ {
+ m_btnKeyboard->setVisible(false);
+ }
rbBtnLayout->addWidget(m_btnPower, 1);
setRightBottomWidget(rbBtnWidget);
@@ -316,7 +323,7 @@ void Frame::initAuth()
{
AuthLightdm* auth = new AuthLightdm(m_greeter);
LoginFrame::initAuth(auth);
- connect(m_greeter.data(),&QLightDM::Greeter::autologinTimerExpired,this,&Frame::onAutoLoginTimeout);
+ connect(m_greeter.data(), &QLightDM::Greeter::autologinTimerExpired, this, &Frame::onAutoLoginTimeout);
}
void Frame::initConnection()
diff --git a/src/screensaver-dialog/frame.cpp b/src/screensaver-dialog/frame.cpp
index 73f50dc..04f0f30 100644
--- a/src/screensaver-dialog/frame.cpp
+++ b/src/screensaver-dialog/frame.cpp
@@ -175,7 +175,14 @@ void Frame::initUI()
rbBtnLayout->addItem(rbBtnLayoutItem);
rbBtnLayout->addWidget(m_btnSwitchToGreeter, 1);
- rbBtnLayout->addWidget(m_btnKeyboard, 1);
+ if( VirtualKeyboard::instance()->isSupported() )
+ {
+ rbBtnLayout->addWidget(m_btnKeyboard, 1);
+ }
+ else
+ {
+ m_btnKeyboard->setVisible(false);
+ }
rbBtnLayout->addWidget(m_btnPower, 1);
setRightBottomWidget(rbBtnWidget);
--
2.27.0

View File

@ -0,0 +1,158 @@
From 3d55d3e81a2de1b91994473695b2bffa27c47b1b Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Tue, 6 Feb 2024 13:45:31 +0800
Subject: [PATCH 15/16] fix(cursor): incorrect scaling cursor size
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 错误的缩放光标大小
---
lib/utils/scaling-helper.cpp | 10 +++++-----
lib/utils/scaling-helper.h | 6 +++---
src/lightdm-greeter/main.cpp | 22 +++++++++++++---------
3 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/lib/utils/scaling-helper.cpp b/lib/utils/scaling-helper.cpp
index 697744e..fcfd608 100644
--- a/lib/utils/scaling-helper.cpp
+++ b/lib/utils/scaling-helper.cpp
@@ -23,12 +23,12 @@ namespace Kiran
{
namespace SessionGuard
{
-void ScalingHelper::set_scale_factor(double factor)
+void ScalingHelper::set_scale_factor(qreal factor)
{
qputenv("QT_SCALE_FACTOR", QString::number(factor).toUtf8());
}
-void ScalingHelper::auto_calculate_screen_scaling()
+qreal ScalingHelper::auto_calculate_screen_scaling()
{
Display *display = nullptr;
XRRScreenResources *resources = nullptr;
@@ -40,7 +40,7 @@ void ScalingHelper::auto_calculate_screen_scaling()
{
KLOG_WARNING("auto_calculate_screen_scaling failed,set QT_AUTO_SCREEN_SCALE_FACTOR=1");
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
- return;
+ return scale_factor;
}
resources = XRRGetScreenResourcesCurrent(display, DefaultRootWindow(display));
@@ -59,7 +59,7 @@ void ScalingHelper::auto_calculate_screen_scaling()
}
KLOG_WARNING("auto_calculate_screen_scaling failed,set QT_AUTO_SCREEN_SCALE_FACTOR=1");
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
- return;
+ return scale_factor;
}
for (int i = 0; i < resources->noutput; i++)
@@ -132,7 +132,7 @@ void ScalingHelper::auto_calculate_screen_scaling()
KLOG_WARNING() << "set scale factor failed.";
}
- return;
+ return scale_factor;
}
} // namespace SessionGuard
diff --git a/lib/utils/scaling-helper.h b/lib/utils/scaling-helper.h
index 669fef1..1a3eb9b 100644
--- a/lib/utils/scaling-helper.h
+++ b/lib/utils/scaling-helper.h
@@ -13,15 +13,15 @@
*/
#pragma once
-
+#include <QtMath>
namespace Kiran
{
namespace SessionGuard
{
namespace ScalingHelper
{
-void auto_calculate_screen_scaling();
-void set_scale_factor(double factor);
+qreal auto_calculate_screen_scaling();
+void set_scale_factor(qreal factor);
} // namespace ScalingHelper
} // namespace SessionGuard
diff --git a/src/lightdm-greeter/main.cpp b/src/lightdm-greeter/main.cpp
index 61255ec..254911a 100644
--- a/src/lightdm-greeter/main.cpp
+++ b/src/lightdm-greeter/main.cpp
@@ -31,20 +31,22 @@ using namespace ::Kiran::SessionGuard;
using namespace ::Kiran::SessionGuard::Greeter;
// 根据配置项,调整缩放率
-void adjustScaleFactor(Prefs* prefs)
+qreal adjustScaleFactor(Prefs* prefs)
{
+ qreal factor = 1.0;
+
/// 设置缩放比
switch (prefs->scale_mode())
{
case GREETER_SCALING_MODE_AUTO:
{
- ScalingHelper::auto_calculate_screen_scaling();
+ factor = ScalingHelper::auto_calculate_screen_scaling();
break;
}
case GREETER_SCALING_MODE_MANUAL:
{
- double scaleFcator = prefs->scale_factor();
- ScalingHelper::set_scale_factor(scaleFcator);
+ factor = prefs->scale_factor();
+ ScalingHelper::set_scale_factor(factor);
break;
}
case GREETER_SCALING_MODE_DISABLE:
@@ -53,6 +55,8 @@ void adjustScaleFactor(Prefs* prefs)
KLOG_ERROR("enable-scaling: unsupported options %d", prefs->scale_mode());
break;
}
+
+ return factor;
}
// 加载样式表
@@ -91,12 +95,12 @@ bool loadTranslator()
}
// 设置当前光标缩放,以及Root窗口光标避免开始会话到进入会话之中的空窗期光标错误显示
-void setCursor(Prefs* prefs)
+void setCursor(qreal factor)
{
// 光标放大
- if (!CursorHelper::setDefaultCursorSize(prefs->scale_factor()))
+ if (!CursorHelper::setDefaultCursorSize(factor))
{
- KLOG_ERROR("set default cursor size for factor %d failed!", prefs->scale_factor());
+ KLOG_ERROR("set default cursor size for factor %f failed!", factor);
}
// 登录成功和进入桌面的间隔会显示根窗口,为了避免显示根窗口时光标显示为"X",需设置ROOT窗口光标
@@ -121,12 +125,12 @@ int main(int argc, char* argv[])
Prefs::globalInit();
auto prefs = Prefs::getInstance();
- adjustScaleFactor(prefs);
+ qreal factor = adjustScaleFactor(prefs);
QApplication app(argc, argv);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
- setCursor(prefs);
+ setCursor(factor);
loadTranslator();
loadStyleSheet();
--
2.27.0

View File

@ -0,0 +1,146 @@
From a99db7807474f51454a0941d8ddbe272b6945050 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Tue, 6 Feb 2024 14:22:04 +0800
Subject: [PATCH 16/16] fix(polkit ts): fix untranslated text from polkit-agent
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复kiran-polkit-agent中未翻译的文本
---
src/polkit-agent/dialog.cpp | 2 +-
src/polkit-agent/listener.cpp | 2 +-
translations/kiran-polkit-agent.zh_CN.ts | 39 ++++++++++++++++--------
3 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/src/polkit-agent/dialog.cpp b/src/polkit-agent/dialog.cpp
index 460e834..e7da7fe 100644
--- a/src/polkit-agent/dialog.cpp
+++ b/src/polkit-agent/dialog.cpp
@@ -253,7 +253,7 @@ void Dialog::onAuthComplete(bool success)
}
else
{
- onAuthShowMessage("Authentication error", MessageTypeError);
+ onAuthShowMessage(tr("Authentication error"), MessageTypeError);
ui->edit->lineEdit()->clear();
ui->edit->setEnabled(false);
diff --git a/src/polkit-agent/listener.cpp b/src/polkit-agent/listener.cpp
index 7474329..8a79c0a 100644
--- a/src/polkit-agent/listener.cpp
+++ b/src/polkit-agent/listener.cpp
@@ -147,7 +147,7 @@ void Listener::onAuthDialogCompleted(bool isSuccess)
{
if (!isSuccess)
{
- m_result->setError("Authentication Error");
+ m_result->setError(tr("Authentication Error"));
}
m_inProcess = false;
diff --git a/translations/kiran-polkit-agent.zh_CN.ts b/translations/kiran-polkit-agent.zh_CN.ts
index ae75cc2..452e955 100644
--- a/translations/kiran-polkit-agent.zh_CN.ts
+++ b/translations/kiran-polkit-agent.zh_CN.ts
@@ -74,7 +74,7 @@
<context>
<name>Kiran::SessionGuard::AuthController</name>
<message>
- <location filename="../lib/auth-proxy/auth-controller.cpp" line="290"/>
+ <location filename="../lib/auth-proxy/auth-controller.cpp" line="311"/>
<source>Failed to authenticate</source>
<translation>认证失败</translation>
</message>
@@ -82,32 +82,32 @@
<context>
<name>Kiran::SessionGuard::AuthTypeSwitcher</name>
<message>
- <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="55"/>
+ <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="68"/>
<source>face auth</source>
<translation>人脸认证</translation>
</message>
<message>
- <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="56"/>
+ <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="69"/>
<source>finger auth</source>
<translation>人脸认证</translation>
</message>
<message>
- <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="57"/>
+ <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="70"/>
<source>password auth</source>
<translation>密码认证</translation>
</message>
<message>
- <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="58"/>
+ <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="71"/>
<source>finger vein auth</source>
<translation>指静脉认证</translation>
</message>
<message>
- <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="59"/>
+ <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="72"/>
<source>iris auth</source>
<translation>虹膜认证</translation>
</message>
<message>
- <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="60"/>
+ <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="73"/>
<source>ukey auth</source>
<translation>UKey认证</translation>
</message>
@@ -120,29 +120,44 @@
<translation>认证</translation>
</message>
<message>
- <location filename="../src/polkit-agent/dialog.cpp" line="187"/>
+ <location filename="../src/polkit-agent/dialog.cpp" line="228"/>
<source>fingerprint auth</source>
<translation>指纹认证</translation>
</message>
<message>
- <location filename="../src/polkit-agent/dialog.cpp" line="188"/>
+ <location filename="../src/polkit-agent/dialog.cpp" line="229"/>
<source>face auth</source>
<translation>人脸认证</translation>
</message>
<message>
- <location filename="../src/polkit-agent/dialog.cpp" line="189"/>
+ <location filename="../src/polkit-agent/dialog.cpp" line="230"/>
<source>fingervein auth</source>
<translation>指静脉认证</translation>
</message>
+ <message>
+ <location filename="../src/polkit-agent/dialog.cpp" line="231"/>
+ <source>iris auth</source>
+ <translation>虹膜认证</translation>
+ </message>
+ <message>
+ <location filename="../src/polkit-agent/dialog.cpp" line="256"/>
+ <source>Authentication error</source>
+ <translation>认证错误</translation>
+ </message>
</context>
<context>
<name>Kiran::SessionGuard::PolkitAgent::Listener</name>
<message>
- <location filename="../src/polkit-agent/listener.cpp" line="51"/>
- <location filename="../src/polkit-agent/listener.cpp" line="72"/>
+ <location filename="../src/polkit-agent/listener.cpp" line="73"/>
+ <location filename="../src/polkit-agent/listener.cpp" line="94"/>
<source>Existing authentication is in progress, please try again later</source>
<translation>已存在正在进行的认证,请稍后再进行尝试</translation>
</message>
+ <message>
+ <location filename="../src/polkit-agent/listener.cpp" line="150"/>
+ <source>Authentication Error</source>
+ <translation>认证错误</translation>
+ </message>
</context>
<context>
<name>Listener</name>
--
2.27.0

View File

@ -0,0 +1,35 @@
From cf643e8b7db0fd55498f325b1a6af0bda141b7fa Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Tue, 26 Mar 2024 13:40:35 +0800
Subject: [PATCH] fix(polkit-agent): Fix the issue of authentication failure
after re authentication
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复授权认证失败时点击重新认证时不会进行认证的问题
Closes #32411
---
src/polkit-agent/dialog.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/polkit-agent/dialog.cpp b/src/polkit-agent/dialog.cpp
index e7da7fe..e965c2a 100644
--- a/src/polkit-agent/dialog.cpp
+++ b/src/polkit-agent/dialog.cpp
@@ -163,7 +163,11 @@ void Dialog::startAuth(const QString& userName)
m_authController->cancelAuthentication();
}
+ ui->btn_ok->setVisible(true);
ui->btn_ok->setEnabled(false);
+
+ ui->btn_reauth->setVisible(false);
+
ui->edit->setEnabled(false);
ui->edit->lineEdit()->setPlaceholderText("");
ui->edit->lineEdit()->clear();
--
2.33.0

View File

@ -0,0 +1,716 @@
From bd524c337a59d070da621c5dbcd749d2b8354db7 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Mon, 22 Apr 2024 13:45:35 +0800
Subject: [PATCH] feat(greeter plugin): Adjusting the Greeter Control Center
plugin to use a new version of the interface for keyword search
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 调整Greeter控制中心插件使用新版本接口并支持关键字搜索
Closes #35280
---
data/kiran-cpanel-greeter.desktop.in | 33 --------
.../kiran-cpanel-greeter/CMakeLists.txt | 8 +-
...cp-interface.cpp => greeter-interface.cpp} | 58 ++++++-------
.../kiran-cpanel-greeter/greeter-interface.h | 46 ++++++++++
.../kiran-cpanel-greeter/greeter-subitem.cpp | 84 +++++++++++++++++++
.../kiran-cpanel-greeter/greeter-subitem.h | 57 +++++++++++++
.../kiran-cpanel-greeter/kcp-interface.h | 50 -----------
.../kiran-cpanel-greeter/setting-window.cpp | 28 ++++++-
.../kiran-cpanel-greeter/setting-window.h | 3 +
translations/kiran-cpanel-greeter.zh_CN.ts | 68 +++++++--------
10 files changed, 277 insertions(+), 158 deletions(-)
delete mode 100644 data/kiran-cpanel-greeter.desktop.in
rename src/lightdm-greeter/kiran-cpanel-greeter/{kcp-interface.cpp => greeter-interface.cpp} (59%)
create mode 100644 src/lightdm-greeter/kiran-cpanel-greeter/greeter-interface.h
create mode 100644 src/lightdm-greeter/kiran-cpanel-greeter/greeter-subitem.cpp
create mode 100644 src/lightdm-greeter/kiran-cpanel-greeter/greeter-subitem.h
delete mode 100644 src/lightdm-greeter/kiran-cpanel-greeter/kcp-interface.h
diff --git a/data/kiran-cpanel-greeter.desktop.in b/data/kiran-cpanel-greeter.desktop.in
deleted file mode 100644
index db1065d..0000000
--- a/data/kiran-cpanel-greeter.desktop.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env xdg-open
-[Desktop Entry]
-Encoding=UTF-8
-Name=Greeter Settings
-Name[zh_CN]=登录选项
-Comment=kiran greeter settings
-Comment=Kiran登录界面选项
-#通过启动器单独执行 <kiran-cpanel-launcher -cpanel-plugin 插件的desktop文件名>
-Exec=kiran-cpanel-launcher --cpanel-plugin=kiran-cpanel-greeter
-Icon=kcp-greeter
-Terminal=false
-Type=Application
-Categories=Lightdm;Greeter;Core;Settings;System;X-Common-Features;X-Common-Features;
-X-KIRAN-NoDisplay=true
-
-[Kiran Control Panel Plugin]
-#插件排序
-Weight=99
-#插件分类
-Category=login-settings
-#插件共享库位置,若以'/'开头则为绝对路径,也可支持通过共享库名去插件安装目录去查找
-Library=libkiran-cpanel-greeter.so
-SubItems=Greeter
-
-[Greeter]
-#插件子项名 该值提供给控制中心形成子项列表
-Name=Greeter Settings
-Name[zh_CN] = 登录选项
-#插件Icon
-Icon=kcp-greeter
-#插件关键字 该值提供给控制中心形成搜索列表
-Keywords[zh_CN]=登录选项
-Keywords = Greeter
\ No newline at end of file
diff --git a/src/lightdm-greeter/kiran-cpanel-greeter/CMakeLists.txt b/src/lightdm-greeter/kiran-cpanel-greeter/CMakeLists.txt
index e556b36..16cde77 100644
--- a/src/lightdm-greeter/kiran-cpanel-greeter/CMakeLists.txt
+++ b/src/lightdm-greeter/kiran-cpanel-greeter/CMakeLists.txt
@@ -10,8 +10,8 @@ pkg_get_variable(CPANEL_DESKTOP_DIR kiran-control-panel plugin_desktop_location)
file(GLOB CPANEL_GREETER_SRC "../common/*.cpp" "../common/*.h" "./*.cpp" "./*.h" "./*.ui")
set(CPANEL_GREETER_RESOURCE ${CMAKE_SOURCE_DIR}/resources/kcp-greeter-resources.qrc)
file(GLOB CPANEL_GREETER_TRANSLATION ${CMAKE_SOURCE_DIR}/translations/kiran-cpanel-greeter.*.ts)
-qt5_create_translation(GREETER_SETTINS_QM_FILES
- ${CMAKE_CURRENT_SOURCE_DIR}
+qt5_create_translation(GREETER_SETTINS_QM_FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}
${CPANEL_GREETER_TRANSLATION}
OPTIONS -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${CMAKE_CURRENT_BINARY_DIR} )
@@ -45,10 +45,6 @@ target_link_libraries(${TARGET_NAME}
${KIRAN_STYLE_HELPER_LIBRARIES})
# 安装
-#安装插件desktop文件
-configure_file(${CMAKE_SOURCE_DIR}/data/kiran-cpanel-greeter.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/kiran-cpanel-greeter.desktop @ONLY)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kiran-cpanel-greeter.desktop DESTINATION ${CPANEL_DESKTOP_DIR}/)
-
#安装插件
install(TARGETS ${TARGET_NAME} DESTINATION ${CPANEL_PLUGIN_DIR}/)
#翻译文件
diff --git a/src/lightdm-greeter/kiran-cpanel-greeter/kcp-interface.cpp b/src/lightdm-greeter/kiran-cpanel-greeter/greeter-interface.cpp
similarity index 59%
rename from src/lightdm-greeter/kiran-cpanel-greeter/kcp-interface.cpp
rename to src/lightdm-greeter/kiran-cpanel-greeter/greeter-interface.cpp
index 3d5691c..0b346bc 100644
--- a/src/lightdm-greeter/kiran-cpanel-greeter/kcp-interface.cpp
+++ b/src/lightdm-greeter/kiran-cpanel-greeter/greeter-interface.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2020 ~ 2021 KylinSec Co., Ltd.
+ * Copyright (c) 2020 ~ 2024 KylinSec Co., Ltd.
* kiran-session-guard is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
@@ -9,34 +9,35 @@
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*
- * Author: liuxinhao <liuxinhao@kylinos.com.cn>
+ * Author: liuxinhao <liuxinhao@kylinsec.com.cn>
*/
+#include "greeter-interface.h"
+#include "greeter-subitem.h"
-#include "kcp-interface.h"
-#include "setting-window.h"
-
-#include <qt5-log-i.h>
-#include <QApplication>
+#include <QCoreApplication>
#include <QTranslator>
-
-#define KCP_SUBITEM_GREETER_ID "Greeter"
+#include <QLocale>
+#include <qt5-log-i.h>
namespace Kiran
{
namespace SessionGuard
{
-namespace Greeter
-{
-KcpInterface::KcpInterface()
+GreeterInterface::GreeterInterface(QObject* parent)
+ :QObject()
{
+
}
-KcpInterface::~KcpInterface()
+GreeterInterface::~GreeterInterface()
{
+
}
-int KcpInterface::init()
+int GreeterInterface::init(KiranControlPanel::PanelInterface* interface)
{
+ m_panelInterface = interface;
+
if (m_translator != nullptr)
{
QCoreApplication::removeTranslator(m_translator);
@@ -51,7 +52,7 @@ int KcpInterface::init()
"/usr/share/lightdm-kiran-greeter/translations",
".qm"))
{
- KLOG_ERROR() << "load translator failed!";
+ KLOG_ERROR() << "greeter plugin load translator failed!";
m_translator->deleteLater();
m_translator = nullptr;
}
@@ -60,32 +61,23 @@ int KcpInterface::init()
QCoreApplication::installTranslator(m_translator);
}
+ m_subitem.reset(new GreeterSubItem(interface, this));
return 0;
}
-void KcpInterface::uninit()
+void GreeterInterface::uninit()
{
-}
-QWidget* KcpInterface::getSubItemWidget(QString subItemName)
-{
- QWidget* widget = nullptr;
- if (subItemName == KCP_SUBITEM_GREETER_ID)
+ if (m_translator != nullptr)
{
- widget = new SettingWindow;
+ qApp->removeTranslator(m_translator);
+ m_translator->deleteLater();
+ m_translator = nullptr;
}
- m_currentWidget = widget;
- return m_currentWidget;
}
-bool KcpInterface::haveUnsavedOptions()
+QVector<KiranControlPanel::SubItemPtr> GreeterInterface::getSubItems()
{
- return false;
+ return {m_subitem};
+}
}
-
-QStringList KcpInterface::visibleSubItems()
-{
- return QStringList() << KCP_SUBITEM_GREETER_ID;
}
-} // namespace Greeter
-} // namespace SessionGuard
-} // namespace Kiran
\ No newline at end of file
diff --git a/src/lightdm-greeter/kiran-cpanel-greeter/greeter-interface.h b/src/lightdm-greeter/kiran-cpanel-greeter/greeter-interface.h
new file mode 100644
index 0000000..6cea16a
--- /dev/null
+++ b/src/lightdm-greeter/kiran-cpanel-greeter/greeter-interface.h
@@ -0,0 +1,46 @@
+/**
+ * Copyright (c) 2020 ~ 2024 KylinSec Co., Ltd.
+ * kiran-session-guard is licensed under Mulan PSL v2.
+ * You can use this software according to the terms and conditions of the Mulan PSL v2.
+ * You may obtain a copy of Mulan PSL v2 at:
+ * http://license.coscl.org.cn/MulanPSL2
+ * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ * See the Mulan PSL v2 for more details.
+ *
+ * Author: liuxinhao <liuxinhao@kylinsec.com.cn>
+ */
+#pragma once
+#include <QObject>
+#include <plugin-interface-v2.h>
+#include <panel-interface.h>
+
+class QTranslator;
+namespace Kiran
+{
+namespace SessionGuard
+{
+class GreeterInterface: public QObject,public KiranControlPanel::PluginInterfaceV2
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID KiranControlPanel_PluginInterfaceV2_iid)
+ Q_INTERFACES(KiranControlPanel::PluginInterfaceV2)
+public:
+ GreeterInterface(QObject* parent = nullptr);
+ ~GreeterInterface();
+
+ virtual int init(KiranControlPanel::PanelInterface* interface) override;
+ virtual void uninit() override;
+
+ // 功能项数组,生存周期由插件维护
+ // 功能项发生变更时应调用init时传入KcpInterface接口通知主面板相关信息变更,及时加载新的功能项信息
+ virtual QVector<KiranControlPanel::SubItemPtr> getSubItems() override;
+
+private:
+ KiranControlPanel::PanelInterface* m_panelInterface = nullptr;
+ QTranslator* m_translator = nullptr;
+ KiranControlPanel::SubItemPtr m_subitem;
+};
+}
+}
\ No newline at end of file
diff --git a/src/lightdm-greeter/kiran-cpanel-greeter/greeter-subitem.cpp b/src/lightdm-greeter/kiran-cpanel-greeter/greeter-subitem.cpp
new file mode 100644
index 0000000..8b323e2
--- /dev/null
+++ b/src/lightdm-greeter/kiran-cpanel-greeter/greeter-subitem.cpp
@@ -0,0 +1,84 @@
+/**
+ * Copyright (c) 2020 ~ 2024 KylinSec Co., Ltd.
+ * kiran-session-guard is licensed under Mulan PSL v2.
+ * You can use this software according to the terms and conditions of the Mulan PSL v2.
+ * You may obtain a copy of Mulan PSL v2 at:
+ * http://license.coscl.org.cn/MulanPSL2
+ * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ * See the Mulan PSL v2 for more details.
+ *
+ * Author: liuxinhao <liuxinhao@kylinsec.com.cn>
+ */
+#include "greeter-subitem.h"
+#include "setting-window.h"
+
+using namespace Kiran::SessionGuard::Greeter;
+
+GreeterSubItem::GreeterSubItem(KiranControlPanel::PanelInterface* interface, QObject* parent)
+ : QObject(parent),
+ m_interface(interface)
+{
+}
+
+GreeterSubItem ::~GreeterSubItem()
+{
+}
+
+QString GreeterSubItem::getID()
+{
+ return "Greeter";
+}
+
+QString GreeterSubItem::getName()
+{
+ return tr("Greeter Settings");
+}
+
+QString GreeterSubItem::getCategory()
+{
+ return "login-settings";
+}
+
+QString GreeterSubItem::getDesc()
+{
+ return "";
+}
+
+QString GreeterSubItem::getIcon()
+{
+ return "kcp-greeter";
+}
+
+int GreeterSubItem::getWeight()
+{
+ return 999;
+}
+
+QVector<QPair<QString, QString>> GreeterSubItem::getSearchKeys()
+{
+ auto res = SettingWindow::getSearchKeys();
+ return res;
+}
+
+QWidget* GreeterSubItem::createWidget()
+{
+ m_subitemWidget = new SettingWindow();
+ m_subitemWidget->installEventFilter(this);
+ return m_subitemWidget;
+}
+
+bool GreeterSubItem::jumpToSearchEntry(const QString& key)
+{
+ if (!m_subitemWidget)
+ return false;
+
+ m_subitemWidget->jumpToSearchKey(key);
+ return true;
+}
+
+bool GreeterSubItem::haveUnSavedOptions()
+{
+ return false;
+}
\ No newline at end of file
diff --git a/src/lightdm-greeter/kiran-cpanel-greeter/greeter-subitem.h b/src/lightdm-greeter/kiran-cpanel-greeter/greeter-subitem.h
new file mode 100644
index 0000000..474392c
--- /dev/null
+++ b/src/lightdm-greeter/kiran-cpanel-greeter/greeter-subitem.h
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2020 ~ 2024 KylinSec Co., Ltd.
+ * kiran-session-guard is licensed under Mulan PSL v2.
+ * You can use this software according to the terms and conditions of the Mulan PSL v2.
+ * You may obtain a copy of Mulan PSL v2 at:
+ * http://license.coscl.org.cn/MulanPSL2
+ * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ * See the Mulan PSL v2 for more details.
+ *
+ * Author: liuxinhao <liuxinhao@kylinsec.com.cn>
+ */
+#pragma once
+#include <QDBusObjectPath>
+#include <QObject>
+#include <panel-interface.h>
+#include <plugin-subitem-interface.h>
+
+namespace Kiran
+{
+namespace SessionGuard
+{
+namespace Greeter
+{
+class SettingWindow;
+}
+} // namespace SessionGuard
+} // namespace Kiran
+
+class GreeterSubItem : public QObject,
+ public KiranControlPanel::PluginSubitemInterface
+{
+ Q_OBJECT
+public:
+ GreeterSubItem(KiranControlPanel::PanelInterface* interface, QObject* parent = nullptr);
+ ~GreeterSubItem();
+
+ QString getID() override;
+ QString getName() override;
+ QString getCategory() override;
+ QString getDesc() override;
+ QString getIcon() override;
+ int getWeight() override;
+
+ // 获取自定义搜索关键词
+ // QVector< 显示文本(已翻译)搜索跳转标识ID >
+ QVector<QPair<QString, QString>> getSearchKeys() override;
+
+ QWidget* createWidget() override;
+ bool jumpToSearchEntry(const QString& key) override;
+ bool haveUnSavedOptions() override;
+
+private:
+ KiranControlPanel::PanelInterface* m_interface = nullptr;
+ Kiran::SessionGuard::Greeter::SettingWindow* m_subitemWidget = nullptr;
+};
diff --git a/src/lightdm-greeter/kiran-cpanel-greeter/kcp-interface.h b/src/lightdm-greeter/kiran-cpanel-greeter/kcp-interface.h
deleted file mode 100644
index 4759f99..0000000
--- a/src/lightdm-greeter/kiran-cpanel-greeter/kcp-interface.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Copyright (c) 2020 ~ 2021 KylinSec Co., Ltd.
- * kiran-session-guard is licensed under Mulan PSL v2.
- * You can use this software according to the terms and conditions of the Mulan PSL v2.
- * You may obtain a copy of Mulan PSL v2 at:
- * http://license.coscl.org.cn/MulanPSL2
- * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
- * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
- * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
- * See the Mulan PSL v2 for more details.
- *
- * Author: liuxinhao <liuxinhao@kylinos.com.cn>
- */
-#pragma once
-#include <kcp-plugin-interface.h>
-
-
-QT_BEGIN_NAMESPACE
-class QTranslator;
-QT_END_NAMESPACE
-
-namespace Kiran
-{
-namespace SessionGuard
-{
-namespace Greeter
-{
-class KcpInterface : public QObject, public KcpPluginInterface
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID KcpPluginInterface_iid)
- Q_INTERFACES(KcpPluginInterface)
-public:
- KcpInterface();
- ~KcpInterface() override;
-
- int init() override;
- void uninit() override;
-
- QWidget* getSubItemWidget(QString subItemName) override;
- bool haveUnsavedOptions() override;
- QStringList visibleSubItems() override;
-
-private:
- QWidget* m_currentWidget = nullptr;
- QTranslator* m_translator = nullptr;
-};
-} // namespace Greeter
-} // namespace SessionGuard
-} // namespace Kiran
\ No newline at end of file
diff --git a/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp b/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp
index 45c9fb9..3712051 100644
--- a/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp
+++ b/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp
@@ -39,6 +39,9 @@
#define BACKGROUND_SAVE_LOCATION "/usr/share/lightdm-kiran-greeter/background"
+#define ITEM_GENERAL_SETTINGS QT_TRANSLATE_NOOP("Kiran::SessionGuard::Greeter::SettingWindow","general settings")
+#define ITEM_AUTO_LOGIN_SETTINGS QT_TRANSLATE_NOOP("Kiran::SessionGuard::Greeter::SettingWindow","autologin")
+
enum GreeterSettingsPageEnum
{
GreeterSettings_Appearance,
@@ -91,11 +94,11 @@ void SettingWindow::initUI()
layoutSideWidget->addWidget(m_sidebarWidget);
QListWidgetItem *item;
- item = new QListWidgetItem(tr("general settings"), m_sidebarWidget);
+ item = new QListWidgetItem(tr(ITEM_GENERAL_SETTINGS), m_sidebarWidget);
item->setIcon(QIcon(":/kcp-greeter/images/appearance_setting.png"));
m_sidebarWidget->addItem(item);
- item = new QListWidgetItem(tr("autologin"), m_sidebarWidget);
+ item = new QListWidgetItem(tr(ITEM_AUTO_LOGIN_SETTINGS), m_sidebarWidget);
item->setIcon(QIcon(":/kcp-greeter/images/user_login_setting.png"));
m_sidebarWidget->addItem(item);
@@ -703,6 +706,27 @@ QSize SettingWindow::sizeHint() const
return {940, 653};
}
+QVector<QPair<QString,QString>> SettingWindow::getSearchKeys()
+{
+ QVector<QPair<QString,QString>> searchEntries = {
+ {tr(ITEM_GENERAL_SETTINGS),tr(ITEM_GENERAL_SETTINGS)},
+ {tr(ITEM_AUTO_LOGIN_SETTINGS),tr(ITEM_AUTO_LOGIN_SETTINGS)}
+ };
+
+ return searchEntries;
+}
+
+void SettingWindow::jumpToSearchKey(const QString& subItem)
+{
+ auto resList = m_sidebarWidget->findItems(subItem,Qt::MatchFixedString);
+ if( resList.isEmpty() )
+ {
+ KLOG_ERROR() << "greeter plugin can't find SubItem:" << subItem;
+ return;
+ }
+ m_sidebarWidget->setCurrentItem(resList.at(0));
+}
+
void SettingWindow::onLoginOptionsChanged()
{
auto changedSwitch = qobject_cast<KiranSwitchButton *>(sender());
diff --git a/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.h b/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.h
index 1c95a1c..4975275 100644
--- a/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.h
+++ b/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.h
@@ -99,6 +99,9 @@ public:
QSize sizeHint() const override;
+ static QVector<QPair<QString,QString>> getSearchKeys();
+ void jumpToSearchKey(const QString& subItem);
+
private:
void initUI();
diff --git a/translations/kiran-cpanel-greeter.zh_CN.ts b/translations/kiran-cpanel-greeter.zh_CN.ts
index 5468e6f..d76b4b5 100644
--- a/translations/kiran-cpanel-greeter.zh_CN.ts
+++ b/translations/kiran-cpanel-greeter.zh_CN.ts
@@ -3,14 +3,6 @@
<TS version="2.1" language="zh_CN">
<context>
<name>GreeterSettingWindow</name>
- <message>
- <source>autologin</source>
- <translation type="vanished">自动登录</translation>
- </message>
- <message>
- <source>general settings</source>
- <translation type="vanished">登录选项</translation>
- </message>
<message>
<source>auto login user(take effect after restart)</source>
<translation type="vanished">自动登录用户(重启后生效)</translation>
@@ -86,113 +78,121 @@ Select discard to discard the modification and reload the new configuration</sou
<translation type="vanished">保存成功</translation>
</message>
</context>
+<context>
+ <name>GreeterSubItem</name>
+ <message>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/greeter-subitem.cpp" line="36"/>
+ <source>Greeter Settings</source>
+ <translation>登录选项</translation>
+ </message>
+</context>
<context>
<name>Kiran::SessionGuard::Greeter::SettingWindow</name>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="94"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="42"/>
<source>general settings</source>
<translation>登录选项</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="98"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="43"/>
<source>autologin</source>
<translation>自动登录</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="165"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="168"/>
<source>auto login user(take effect after restart)</source>
<translation>自动登录用户(重启后生效)</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="199"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="202"/>
<source>auto login delay(seconds)(take effect after restart)</source>
<translation>自动登录延时(秒)(重启后生效)</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="235"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="399"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="238"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="402"/>
<source>Save</source>
<translation>保存</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="249"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="413"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="252"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="416"/>
<source>Reset</source>
<translation>重置</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="272"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="275"/>
<source>login background setting</source>
<translation>登录背景设置</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="289"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="292"/>
<source>Scale Mode</source>
<translation>缩放模式</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="300"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="303"/>
<source>auto</source>
<translation>自动</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="301"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="304"/>
<source>manual</source>
<translation>手动</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="302"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="305"/>
<source>disable</source>
<translation>禁用</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="308"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="311"/>
<source>Scale Factor</source>
<translation>缩放比例</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="333"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="336"/>
<source>Enable manual input user login</source>
<translation>允许手动输入用户名登录</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="358"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="361"/>
<source>Show User List</source>
<translation>显示用户列表</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="465"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="541"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="467"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="543"/>
<source>Configuration changed</source>
<translation>配置已改变</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="466"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="542"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="468"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="544"/>
<source>The external configuration file has changed
If you choose to save, all external changes will be overwritten
Select discard to discard the modification and reload the new configuration</source>
<translation>配置文件已被修改,如果继续保存所有额外的修改将会被覆盖,选择丢弃将丢弃所有的修改并重新加载新的配置文件</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="519"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="589"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="521"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="591"/>
<source>Save failed, reload</source>
<translation>保存失败,已重新加载</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="523"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="599"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="525"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="601"/>
<source>Saved successfully</source>
<translation>保存成功</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="593"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="595"/>
<source>Save failed: %1</source>
<translation>保存失败: %1</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="718"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="730"/>
<source>Please ensure that one of the two options is turned on!</source>
<translation>请确保两个选项之一被打开!</translation>
</message>
--
2.33.0

View File

@ -0,0 +1,286 @@
From 8f2d51c98b6033307e72093c3be84c3b687ae9b5 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Tue, 23 Apr 2024 15:07:09 +0800
Subject: [PATCH] fix(greeter & locker): Display date below time in English
environment
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 英文环境下下方显示日期时间加入日期显示
Closes #35552
---
lib/login-frame/login-frame.cpp | 4 +-
translations/lightdm-kiran-greeter.zh_CN.ts | 116 ++++++++++++++------
2 files changed, 85 insertions(+), 35 deletions(-)
diff --git a/lib/login-frame/login-frame.cpp b/lib/login-frame/login-frame.cpp
index 67e54e5..cbd61d3 100644
--- a/lib/login-frame/login-frame.cpp
+++ b/lib/login-frame/login-frame.cpp
@@ -244,7 +244,7 @@ QString LoginFrame::getCurrentDateTime()
{
QDateTime dateTime = QDateTime::currentDateTime();
// tr : MM月MM日 dddd HH:mm
- QString res = dateTime.toString(tr("dddd MMM HH:mm"));
+ QString res = dateTime.toString(tr("ddd MMM dd HH:mm"));
return res;
}
@@ -360,4 +360,4 @@ void LoginFrame::onAuthTypeChanged(KADAuthType type)
}
} // namespace SessionGuard
-} // namespace Kiran
\ No newline at end of file
+} // namespace Kiran
diff --git a/translations/lightdm-kiran-greeter.zh_CN.ts b/translations/lightdm-kiran-greeter.zh_CN.ts
index 45ba866..a22b407 100644
--- a/translations/lightdm-kiran-greeter.zh_CN.ts
+++ b/translations/lightdm-kiran-greeter.zh_CN.ts
@@ -47,19 +47,60 @@
<translation type="vanished">返回</translation>
</message>
</context>
+<context>
+ <name>GreeterSubItem</name>
+ <message>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/greeter-subitem.cpp" line="36"/>
+ <source>Greeter Settings</source>
+ <translation>登录选项</translation>
+ </message>
+</context>
<context>
<name>Kiran::SessionGuard::AuthController</name>
<message>
- <location filename="../lib/auth-proxy/auth-controller.cpp" line="275"/>
+ <location filename="../lib/auth-proxy/auth-controller.cpp" line="311"/>
<source>Failed to authenticate</source>
<translation>认证失败</translation>
</message>
</context>
+<context>
+ <name>Kiran::SessionGuard::AuthTypeSwitcher</name>
+ <message>
+ <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="68"/>
+ <source>face auth</source>
+ <translation>人脸认证</translation>
+ </message>
+ <message>
+ <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="69"/>
+ <source>finger auth</source>
+ <translation>指纹认证</translation>
+ </message>
+ <message>
+ <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="70"/>
+ <source>password auth</source>
+ <translation>密码认证</translation>
+ </message>
+ <message>
+ <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="71"/>
+ <source>finger vein auth</source>
+ <translation>指静脉认证</translation>
+ </message>
+ <message>
+ <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="72"/>
+ <source>iris auth</source>
+ <translation>虹膜认证</translation>
+ </message>
+ <message>
+ <location filename="../lib/common-widgets/auth-type-switcher.cpp" line="73"/>
+ <source>ukey auth</source>
+ <translation>UKey认证</translation>
+ </message>
+</context>
<context>
<name>Kiran::SessionGuard::Greeter::Frame</name>
<message>
<location filename="../src/lightdm-greeter/frame.cpp" line="189"/>
- <location filename="../src/lightdm-greeter/frame.cpp" line="349"/>
+ <location filename="../src/lightdm-greeter/frame.cpp" line="357"/>
<source>login other user</source>
<translation>登录其他用户</translation>
</message>
@@ -99,8 +140,8 @@
<translation>虚拟键盘</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/frame.cpp" line="366"/>
- <location filename="../src/lightdm-greeter/frame.cpp" line="376"/>
+ <location filename="../src/lightdm-greeter/frame.cpp" line="374"/>
+ <location filename="../src/lightdm-greeter/frame.cpp" line="384"/>
<source>return</source>
<translation>返回</translation>
</message>
@@ -108,7 +149,7 @@
<context>
<name>Kiran::SessionGuard::Greeter::LoginButton</name>
<message>
- <location filename="../src/lightdm-greeter/widgets/login-button.cpp" line="32"/>
+ <location filename="../src/lightdm-greeter/widgets/login-button.cpp" line="33"/>
<source>login</source>
<translation>登录</translation>
</message>
@@ -116,105 +157,110 @@
<context>
<name>Kiran::SessionGuard::Greeter::SettingWindow</name>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="94"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="42"/>
<source>general settings</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="98"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="43"/>
<source>autologin</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="165"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="168"/>
<source>auto login user(take effect after restart)</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="199"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="202"/>
<source>auto login delay(seconds)(take effect after restart)</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="235"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="394"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="238"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="402"/>
<source>Save</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="249"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="408"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="252"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="416"/>
<source>Reset</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="284"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="275"/>
+ <source>login background setting</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="292"/>
<source>Scale Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="295"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="303"/>
<source>auto</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="296"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="304"/>
<source>manual</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="297"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="305"/>
<source>disable</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="303"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="311"/>
<source>Scale Factor</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="328"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="336"/>
<source>Enable manual input user login</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="353"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="361"/>
<source>Show User List</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="460"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="536"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="467"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="543"/>
<source>Configuration changed</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="461"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="537"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="468"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="544"/>
<source>The external configuration file has changed
If you choose to save, all external changes will be overwritten
Select discard to discard the modification and reload the new configuration</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="514"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="584"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="521"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="591"/>
<source>Save failed, reload</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="518"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="594"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="525"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="601"/>
<source>Saved successfully</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="588"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="595"/>
<source>Save failed: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="713"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="741"/>
<source>Please ensure that one of the two options is turned on!</source>
<translation type="unfinished"></translation>
</message>
@@ -222,15 +268,19 @@ Select discard to discard the modification and reload the new configuration</sou
<context>
<name>Kiran::SessionGuard::LoginFrame</name>
<message>
- <location filename="../lib/login-frame/login-frame.cpp" line="84"/>
+ <location filename="../lib/login-frame/login-frame.cpp" line="85"/>
<source>Entry your name</source>
<translation>请输入用户名</translation>
</message>
<message>
- <location filename="../lib/login-frame/login-frame.cpp" line="237"/>
- <source>dddd MMM HH:mm</source>
+ <location filename="../lib/login-frame/login-frame.cpp" line="247"/>
+ <source>ddd MMM dd HH:mm</source>
<translation>MM月dd日 dddd HH:mm</translation>
</message>
+ <message>
+ <source>dddd MMM HH:mm</source>
+ <translation type="vanished">MM月dd日 dddd HH:mm</translation>
+ </message>
</context>
<context>
<name>LoginButton</name>
--
2.33.0

View File

@ -1,6 +1,13 @@
%if "%{?ks_custom_name}" == "PG" || "%{?kylin_custom_name}" == "PG"
%global hidden_admin 1
%global hideen_power_menu 1
%endif
%global show_virtual_keyboard 0
Name: kiran-session-guard Name: kiran-session-guard
Version: 2.5.1 Version: 2.5.1
Release: 8%{?dist} Release: 14%{?dist}
Summary: Kiran desktop environment login and lock screen dialog Summary: Kiran desktop environment login and lock screen dialog
Summary(zh_CN): Kiran桌面环境登录和解锁框 Summary(zh_CN): Kiran桌面环境登录和解锁框
@ -17,8 +24,15 @@ Patch0007: 0007-fix-kiran-session-guard-fits-the-Qt5.9.7-interface.patch
Patch0008: 0008-fix-styleditemdelegate-updateEditorGeometry-to-updat.patch Patch0008: 0008-fix-styleditemdelegate-updateEditorGeometry-to-updat.patch
Patch0009: 0009-fix-autologin-timeout-Fix-issues-caused-by-automatic.patch Patch0009: 0009-fix-autologin-timeout-Fix-issues-caused-by-automatic.patch
Patch0010: 0010-fix-scale-Fix-the-issue-of-manual-scaling-not-taking.patch Patch0010: 0010-fix-scale-Fix-the-issue-of-manual-scaling-not-taking.patch
Patch0011: 0011-fix-login-background-Add-login-background-setting-ti.patch
%define SHOW_VIRTUAL_KEYBOARD 0 Patch0012: 0012-feat-ci-Connect-to-internal-CI-processes.patch
Patch0013: 0013-fix-code-scanning-Fix-some-static-code-scanning-issu.patch
Patch0014: 0014-fix-virutalkeyboard-Add-detection-for-whether-to-ins.patch
Patch0015: 0015-fix-cursor-incorrect-scaling-cursor-size.patch
Patch0016: 0016-fix-polkit-ts-fix-untranslated-text-from-polkit-agen.patch
Patch0017: 0017-fix-polkit-agent-Fix-the-issue-of-authentication-fai.patch
Patch0018: 0018-feat-greeter-plugin-Adjusting-the-Greeter-Control-Ce.patch
Patch0019: 0019-fix-greeter-locker-Display-date-below-time-in-Englis.patch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gcc-c++ BuildRequires: gcc-c++
@ -67,7 +81,7 @@ Requires: libXrandr
Requires: libXcursor Requires: libXcursor
Requires: glib2 Requires: glib2
Requires: pam Requires: pam
%if %{SHOW_VIRTUAL_KEYBOARD} == 1 %if 0%{show_virtual_keyboard} == 1
Requires: onboard Requires: onboard
%endif %endif
@ -108,9 +122,18 @@ Kiran desktop environment polkit agent
%build %build
%{__mkdir} -p %{buildroot} %{__mkdir} -p %{buildroot}
%cmake -DBUILD_SHARED_LIBS:BOOL=OFF \ %cmake -DBUILD_SHARED_LIBS:BOOL=OFF \
%if %{SHOW_VIRTUAL_KEYBOARD} == 1 %if 0%{?show_virtual_keyboard}
-DSHOW_VIRTUAL_KEYBOARD=on \ -DSHOW_VIRTUAL_KEYBOARD=on \
%endif %endif
%if 0%{?hidden_admin}
-DHIDDEN_USER=secadm,sysadm,audadm \
%endif
%if 0%{?hideen_power_menu}
-DCAN_POWER_OFF=false \
-DCAN_REBOOT=false \
-DCAN_SUSPEND=false \
-DCAN_HIBERNATE=false \
%endif
make %{?_smp_mflags} make %{?_smp_mflags}
@ -130,7 +153,6 @@ gtk-update-icon-cache -f /usr/share/icons/hicolor/
%files -n lightdm-kiran-greeter %files -n lightdm-kiran-greeter
%doc %doc
%{_datadir}/kiran-control-panel/plugins/libs/libkiran-cpanel-greeter.so* %{_datadir}/kiran-control-panel/plugins/libs/libkiran-cpanel-greeter.so*
%{_datadir}/kiran-control-panel/plugins/desktop/*
%{_sbindir}/lightdm-kiran-greeter %{_sbindir}/lightdm-kiran-greeter
%{_datadir}/lightdm-kiran-greeter/translations/* %{_datadir}/lightdm-kiran-greeter/translations/*
@ -154,12 +176,42 @@ gtk-update-icon-cache -f /usr/share/icons/hicolor/
rm -rf %{buildroot} rm -rf %{buildroot}
%changelog %changelog
* Tue Apr 23 2024 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-14
- KYOS-B: Display date below time in English environment(#35552)
* Mon Apr 22 2024 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-13
- KYOS-B: Adjusting the Greeter Control Center plugin to use a new version of the interface for keyword search(#35280)
* Wed Apr 10 2024 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-12
- KYOS-B: Fix the issue of authentication failure after re authentication(#32411)
* Wed Feb 21 2024 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-11
- KYOS-B: Fix ci issues
- KYOS-B: Add virtual keyboard detection(#29712)
- KYOS-B: incorrect scaling cursor size(#29286)
- KYOS-B: fix untranslated text from polkit-agent(#29452)
* Fri Jan 19 2024 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-10.kb2
- KYOS-B: Adjust the relevant compilation macros in the spec file
* Thu Jan 18 2024 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-9.kb1
- KYOS-B: Add login background setting title(#25063)
* Thu Jan 18 2024 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-8.kb2
- rebuild for KiranUI-2.6-next
* Thu Jan 18 2024 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-8.kb1 * Thu Jan 18 2024 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-8.kb1
- KYOS-B: fix the issue of manual scaling not taking effect(#25011) - KYOS-B: fix the issue of manual scaling not taking effect(#25011)
- KYOS-B: fix issues caused by automatic login timeout(#25015) - KYOS-B: fix issues caused by automatic login timeout(#25015)
* Thu Oct 26 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-7.kb1 * Wed Dec 06 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-7.kb2
- KYOS-B: fix updateEditorGeometry to update the wrong size of ItemWidgets in QStyledItemDelegate(#16513) - rebuild for KiranUi-2.6-next
* Wed Nov 29 2023 kpkg <kpkg.kylinsec.com.cn> - 2.5.1-7.kb1
- rebuild for KY3.4-5-GC-KiranUI-2.5
* Thu Oct 26 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-7
- KYOS-F: fix updateEditorGeometry to update the wrong size of ItemWidgets in QStyledItemDelegate(#16513)
* Tue Sep 12 2023 yinhongchang <yinhongchang@kylinsec.com.cn> - 2.5.1-6.kb1 * Tue Sep 12 2023 yinhongchang <yinhongchang@kylinsec.com.cn> - 2.5.1-6.kb1
- KYOS-F: fits the Qt5.9.7 interface(#15019) - KYOS-F: fits the Qt5.9.7 interface(#15019)