From 4ab28628a7959c1250e9018e4f2fad9b056b274b Mon Sep 17 00:00:00 2001 From: kylinsecos_admin Date: Wed, 2 Mar 2022 14:26:58 +0800 Subject: [PATCH] Remove the prefix Create User Failed and Add BuildRequires gtk-update-icon-cache (cherry picked from commit 73f686f0cf53201926ee9dcaa9cb6182dc1e6499) --- ...type-class-QPainterPath-bui-8c9d4052.patch | 12 +- ...e-prefix-Create-User-Failed-dfba753b.patch | 684 ++++++++++++++++++ kiran-cpanel-account.spec | 15 +- 3 files changed, 703 insertions(+), 8 deletions(-) rename 0001-fix-build-fix-incomplete-type-class-QPainterPath-bui.patch => 0003-fix-build-fix-incomplete-type-class-QPainterPath-bui-8c9d4052.patch (92%) create mode 100644 0004-fix-create-user-Remove-the-prefix-Create-User-Failed-dfba753b.patch diff --git a/0001-fix-build-fix-incomplete-type-class-QPainterPath-bui.patch b/0003-fix-build-fix-incomplete-type-class-QPainterPath-bui-8c9d4052.patch similarity index 92% rename from 0001-fix-build-fix-incomplete-type-class-QPainterPath-bui.patch rename to 0003-fix-build-fix-incomplete-type-class-QPainterPath-bui-8c9d4052.patch index 07ea637..aec82d0 100644 --- a/0001-fix-build-fix-incomplete-type-class-QPainterPath-bui.patch +++ b/0003-fix-build-fix-incomplete-type-class-QPainterPath-bui-8c9d4052.patch @@ -1,8 +1,8 @@ -From 04c065a529a55619cb640fbe4df85dd68993c90b Mon Sep 17 00:00:00 2001 -From: root -Date: Tue, 25 Jan 2022 16:09:54 +0800 -Subject: [PATCH] fix(build): fix incomplete type 'class QPainterPath' build - error +From 8c9d4052045bc5ca6e6341ca0b31479531f357a7 Mon Sep 17 00:00:00 2001 +From: kylinsecos_admin +Date: Mon, 14 Feb 2022 11:38:50 +0800 +Subject: [PATCH] fix(build): fix incomplete type 'class QPainterPath' build + (#49472) --- avatar-editor/src/image-preview-widget.cpp | 1 + @@ -73,5 +73,5 @@ index 7305ca6..b1974c4 100644 UserAvatarWidget::UserAvatarWidget(QWidget *parent) : QWidget(parent), -- -2.33.0 +2.27.0 diff --git a/0004-fix-create-user-Remove-the-prefix-Create-User-Failed-dfba753b.patch b/0004-fix-create-user-Remove-the-prefix-Create-User-Failed-dfba753b.patch new file mode 100644 index 0000000..71b5989 --- /dev/null +++ b/0004-fix-create-user-Remove-the-prefix-Create-User-Failed-dfba753b.patch @@ -0,0 +1,684 @@ +From dfba753be5a293317f9572177953020143304aa5 Mon Sep 17 00:00:00 2001 +From: luoqing +Date: Mon, 21 Feb 2022 17:56:57 +0800 +Subject: [PATCH] fix(create user):Remove the prefix "Create User Failed" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 去掉前缀“创建用户失败” + +Closes #47439 +--- + src/hard-worker.cpp | 24 +++- + .../create-user-page/create-user-page.cpp | 7 ++ + translations/kiran-cpanel-account.zh_CN.ts | 115 +++++------------- + 3 files changed, 59 insertions(+), 87 deletions(-) + +diff --git a/src/hard-worker.cpp b/src/hard-worker.cpp +index 3ab232c..ab1048b 100644 +--- a/src/hard-worker.cpp ++++ b/src/hard-worker.cpp +@@ -43,8 +43,8 @@ void HardWorker::doCreateUser(QString userName, + ACCOUNTS_OBJECT_PATH, + QDBusConnection::systemBus()); + QString userObjPath; +- QString errMsgPrefix = tr("Create User failed"); + QString errMsgDetail; ++ QString errMsgPrefix = ""; + + ///step1.创建用户 + QDBusPendingReply createUserRep; +@@ -55,6 +55,7 @@ void HardWorker::doCreateUser(QString userName, + createUserRep.waitForFinished(); + if (createUserRep.isError()) + { ++ errMsgPrefix = tr("Create User Failed"); + KLOG_WARNING() << "create user failed," << createUserRep.error(); + errMsgDetail = createUserRep.error().message(); + goto failed; +@@ -129,13 +130,26 @@ failed: + } + } + #endif ++ //#47439 去掉前缀“创建用户失败” + QString errMsg = errMsgPrefix; +- if (!errMsgDetail.isEmpty()) ++ if (!errMsg.isEmpty()) + { +- errMsg.append(","); +- errMsg.append(errMsgDetail); ++ if (!errMsgDetail.isEmpty()) ++ { ++ errMsg.append(","); ++ errMsg.append(errMsgDetail); ++ } ++ emit sigCreateUserDnoe(userObjPath, errMsg); ++ } ++ else ++ { ++ if(errMsgDetail.isEmpty()) ++ { ++ errMsgDetail = tr("Unknown Error"); ++ } ++ emit sigCreateUserDnoe(userObjPath, errMsgDetail); + } +- emit sigCreateUserDnoe(userObjPath, errMsg); ++ + } + + void HardWorker::doUpdatePasswd(QString objPath, +diff --git a/src/pages/create-user-page/create-user-page.cpp b/src/pages/create-user-page/create-user-page.cpp +index 7f3956e..ff17a47 100644 +--- a/src/pages/create-user-page/create-user-page.cpp ++++ b/src/pages/create-user-page/create-user-page.cpp +@@ -31,6 +31,8 @@ + #include + #include + ++#define ERROR_MESSAGE_CREATE_USER_FAILED "Create User Failed" ++ + CreateUserPage::CreateUserPage(QWidget *parent) : QWidget(parent), + ui(new Ui::CreateUserPage) + { +@@ -236,6 +238,7 @@ void CreateUserPage::handlerCreateNewUser() + iconFile); + } + ++ + void CreateUserPage::handlerCreateNewUserIsDone(QString userPath, + QString errMsg) + { +@@ -247,6 +250,10 @@ void CreateUserPage::handlerCreateNewUserIsDone(QString userPath, + } + else if(!errMsg.isEmpty() && !userPath.isEmpty()) + { ++ if(errMsg.startsWith(ERROR_MESSAGE_CREATE_USER_FAILED)) ++ { ++ KiranMessageBox::message(nullptr,tr("Error"),errMsg,KiranMessageBox::Ok); ++ } + KiranMessageBox::message(nullptr,tr("Warning"),errMsg,KiranMessageBox::Ok); + } + +diff --git a/translations/kiran-cpanel-account.zh_CN.ts b/translations/kiran-cpanel-account.zh_CN.ts +index 6b430c9..7cd427f 100644 +--- a/translations/kiran-cpanel-account.zh_CN.ts ++++ b/translations/kiran-cpanel-account.zh_CN.ts +@@ -6,14 +6,12 @@ + + + +- + Form + + + + + +- + Tom Hardy + + +@@ -43,35 +41,30 @@ + + + +- + Form + + + + + +- + Login shell + 登录Shell + + + + +- + Specify user id + 指定用户ID + + + + +- + confirm + 确认 + + + + +- + cancel + 取消 + +@@ -84,7 +77,6 @@ + + + +- + Specify user home + 指定用户目录 + +@@ -109,42 +101,36 @@ + + + +- + AuthManagerPage + + + + + +- + Fingerprint Authentication + 指纹认证 + + + + +- + Face Authentication + 人脸认证 + + + + +- + Password Authentication + 密码认证 + + + + +- + save + 保存 + + + + +- + return + 返回 + +@@ -186,21 +172,18 @@ + + + +- + BiometricItem + + + + + +- + text + + + + + +- + add + 添加 + +@@ -212,68 +195,60 @@ + 账户类型 + + +- ++ + standard + 普通用户 + + +- ++ + administrator + 管理员 + + + + +- + Form + + + + + +- + User name + 用户名 + + + + +- + User type + 用户类型 + + + + +- + Password + 用户密码 + + + + +- + Confirm password + 确认密码 + + + + +- + Advance setting + 高级设置 + + + + +- + Confirm + 创建 + + + + +- + Cancel + 取消 + +@@ -298,55 +273,56 @@ + 请输入用户名 + + +- ++ + Please enter user name first + 请输入用户名 + + +- ++ + Please enter your user name + 请输入用户名 + + +- ++ + user name cannot be a pure number + 用户名不能全为数字 + + +- ++ + user name already exists + 用户名已存在 + + +- ++ + Please enter your password +- 请输入密码 ++ 请输入密码 + + +- ++ + Please enter the password again + 请再次输入密码 + + +- ++ + The password you enter must be the same as the former one + 两次密码不相同,请核对后,再次输入 + + +- +- ++ ++ ++ + Error + 错误 + + +- ++ + Password encryption failed + 密码加密失败 + + +- ++ + Warning +- 警告 ++ 警告 + + + +@@ -354,28 +330,24 @@ + + + +- + FaceEnrollDialog + + + + + +- + balabalalbala... + + + + + +- + save + 保存 + + + + +- + cancel + 取消 + +@@ -424,28 +396,24 @@ + + + +- + FingerprintEnrollDialog + + + + + +- + balabalalbala... + + + + + +- + save + 保存 + + + + +- + cancel + 取消 + +@@ -500,9 +468,8 @@ + + HardWorker + +- + Create User failed +- 创建用户失败 ++ 创建用户失败 + + + password +@@ -525,17 +492,27 @@ + 设置用户属性失败 + + +- ++ ++ Create User Failed ++ 创建用户失败 ++ ++ ++ ++ Unknown Error ++ 未知错误 ++ ++ ++ + update password failed + 更新密码失败 + + +- ++ + icon file + 头像 + + +- ++ + userName type + 用户名 + +@@ -544,12 +521,12 @@ + 账户类型 + + +- ++ + locked + 启用状态 + + +- ++ + Failed to update user properties,%1 + 更新用户属性失败,%1 + +@@ -558,7 +535,7 @@ + 更新用户属性失败(%1) + + +- ++ + Failed to delete user,%1 + 删除用户失败,%1 + +@@ -618,7 +595,6 @@ + + + +- + Form + + +@@ -628,70 +604,60 @@ + + + +- + PasswordExpirationPolicyPage + + + + + +- + User expires + 用户过期时间 + + + + +- + yyyy-MM-dd + + + + + +- + Last password change + 最近一次密码修改时间 + + + + +- + 1990-01-01 + + + + + +- + Maximum vaild days of password + 密码最大有限天数 + + + + +- + Prompt time before password expiration + 密码过期之前提醒的天数 + + + + +- + how many days after password expires will become inactive + 密码过期多少天认定为失效 + + + + +- + save + 保存 + + + + +- + return + 返回 + +@@ -731,35 +697,30 @@ + + + +- + Form + + + + + +- + Account + + + + + +- + Change password + 修改密码 + + + + +- + Password expiration policy + 密码过期策略 + + + + +- + User id + 用户ID + +@@ -774,70 +735,60 @@ + + + +- + User type + 用户类型 + + + + +- + User status + 启用用户 + + + + +- + auth manager + 认证管理 + + + + +- + Confirm + 保存 + + + + +- + Delete + 删除用户 + + + + +- + Current password + 当前密码 + + + + +- + New password + 新密码 + + + + +- + Enter the new password again + 再次输入新密码 + + + + +- + Save + 保存 + + + + +- + Cancel + 取消 + +-- +2.27.0 + diff --git a/kiran-cpanel-account.spec b/kiran-cpanel-account.spec index ef544d8..e8224cb 100644 --- a/kiran-cpanel-account.spec +++ b/kiran-cpanel-account.spec @@ -1,6 +1,6 @@ Name: kiran-cpanel-account Version: 2.2.0 -Release: 3.kb4 +Release: 5 Summary: Kiran Account Manager Summary(zh_CN): 用户管理工具 @@ -9,7 +9,8 @@ Source0: %{name}-%{version}.tar.gz Patch0001: 0000-fix-control-center-fix-kiran-session-account-managem-97343173.patch Patch0002: 0002-fix-create-user-the-user-was-created-successfully-bu-60fd3816.patch -Patch0003: 0001-fix-build-fix-incomplete-type-class-QPainterPath-bui.patch +Patch0003: 0003-fix-build-fix-incomplete-type-class-QPainterPath-bui-8c9d4052.patch +Patch0004: 0004-fix-create-user-Remove-the-prefix-Create-User-Failed-dfba753b.patch BuildRequires: cmake BuildRequires: gcc-c++ @@ -39,6 +40,7 @@ Requires: kiran-system-daemon Requires: kiran-biometrics Requires: kiran-log-qt5 Requires: kiran-cpanel-launcher +Requires: gtk-update-icon-cache Provides: kiran-avatar-editor Obsoletes: kiran-account-manager @@ -85,6 +87,15 @@ fi rm -rf %{buildroot} %changelog +* Tue Mar 01 2022 longcheng - 2.2.0-5 +- KYOS-B: Add Requires gtk-update-icon-cache + +* Thu Feb 24 2022 chendingjian - 2.2.0-4 +- rebuild for KY3.4-MATE-modules-dev + +* Tue Feb 22 2022 luoqing - 2.2.0-3.kb5 +- KYOS-F: remove the prefix "Create User Failed" + * Wed Jan 26 2022 longcheng - 2.2.0-3.kb4 - KYOS-B: fix compilation errors on OpenEuler