!24 修复账户管理错误提示以及搜索部分问题

From: @liubuguiii 
Reviewed-by: @tangjie02 
Signed-off-by: @tangjie02
This commit is contained in:
openeuler-ci-bot 2022-08-12 02:26:20 +00:00 committed by Gitee
commit 2a63ba01fc
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 145 additions and 1 deletions

View File

@ -0,0 +1,106 @@
From fb79eb15820419ee346148abd7ce1a52d83becaf Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Wed, 10 Aug 2022 14:42:05 +0800
Subject: [PATCH 1/2] fix(search): when the relevant setting interface cannot
be searched, a prompt will be added
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 当未能搜索到相关设置界面时加入提示。修改跳转逻辑,不通过补全直接输入并回车也可以触发跳转功能
Closes #I5H192
---
src/search-edit/search-edit.cpp | 30 +++++++++++++++++++++--
translations/kiran-control-panel.zh_CN.ts | 13 ++++++++++
2 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/src/search-edit/search-edit.cpp b/src/search-edit/search-edit.cpp
index a4b9d9e..5ffcfb6 100644
--- a/src/search-edit/search-edit.cpp
+++ b/src/search-edit/search-edit.cpp
@@ -21,12 +21,14 @@
#include <QApplication>
#include <QCompleter>
#include <QEvent>
+#include <QTimer>
#include <QKeyEvent>
#include <QHBoxLayout>
#include <QLabel>
#include <QListView>
#include <QSpacerItem>
#include <QStandardItemModel>
+#include <kiran-message-box.h>
SearchEdit::SearchEdit(QWidget *parent)
: KiranSearchBox(parent)
@@ -53,17 +55,41 @@ void SearchEdit::init()
m_completer->installEventFilter(this);
setCompleter(m_completer);
-
// clang-format off
connect(m_completer, QOverload<const QModelIndex &>::of(&QCompleter::activated), [this](const QModelIndex &index) {
if( !index.isValid() )
+ {
return ;
-
+ }
QString categoryID,subItemID;
auto filterModel = m_completer->completionModel();
categoryID = filterModel->data(index,SearchModel::roleCategoryID).toString();
subItemID = filterModel->data(index,SearchModel::roleSubItemID).toString();
emit requestJumpTo(categoryID,subItemID);
+ QTimer::singleShot(0,this,&QLineEdit::clear);
+ });
+ connect(this,&QLineEdit::returnPressed,[this](){
+ QString searchkey = text();
+ if( searchkey.isEmpty() )
+ {
+ return;
+ }
+
+ auto items = m_searchModel->findItems(searchkey);
+ if( items.isEmpty() )
+ {
+ auto clickedButton = KiranMessageBox::message(this,tr("Info"),tr("Failed to find related items, please re-enter!"),KiranMessageBox::Ok|KiranMessageBox::No);
+ if( clickedButton == KiranMessageBox::Ok )
+ clear();
+ return;
+ }
+
+ auto item = items.at(0);
+ auto categoryID = item->data(SearchModel::roleCategoryID).toString();
+ auto subItemID = item->data(SearchModel::roleSubItemID).toString();
+ clear();
+
+ emit requestJumpTo(categoryID,subItemID);
});
// clang-format on
}
\ No newline at end of file
diff --git a/translations/kiran-control-panel.zh_CN.ts b/translations/kiran-control-panel.zh_CN.ts
index 4da29a1..8e4a4a0 100644
--- a/translations/kiran-control-panel.zh_CN.ts
+++ b/translations/kiran-control-panel.zh_CN.ts
@@ -30,4 +30,17 @@
<translation>控制面板</translation>
</message>
</context>
+<context>
+ <name>SearchEdit</name>
+ <message>
+ <location filename="../src/search-edit/search-edit.cpp" line="81"/>
+ <source>Info</source>
+ <translation>提示</translation>
+ </message>
+ <message>
+ <location filename="../src/search-edit/search-edit.cpp" line="81"/>
+ <source>Failed to find related items, please re-enter!</source>
+ <translation>未能搜索到相关项,请重新输入!</translation>
+ </message>
+</context>
</TS>
--
2.33.0

View File

@ -0,0 +1,31 @@
From 0ea6996cf22fa8cece850bd8ba8aaa21ad1ff845 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Wed, 10 Aug 2022 14:59:37 +0800
Subject: [PATCH 2/2] fix(account): error prompt box is added with the default
disappearance time
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 错误提示框在点击消失的基础之上,加入默认消失时间
Closes #I5HR61
---
plugins/account/src/widgets/kiran-tips.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/account/src/widgets/kiran-tips.cpp b/plugins/account/src/widgets/kiran-tips.cpp
index 294671d..622be54 100644
--- a/plugins/account/src/widgets/kiran-tips.cpp
+++ b/plugins/account/src/widgets/kiran-tips.cpp
@@ -82,6 +82,7 @@ KiranTips::KiranTips(QWidget *parent) : QWidget(parent),
}
});
setVisible(false);
+ setHideTimeout(3000);
}
KiranTips::~KiranTips()
--
2.33.0

View File

@ -1,15 +1,18 @@
Name: kiran-control-panel
Version: 2.3.4
Release: 4
Release: 5
Summary: Kiran Control Panel
Summary(zh_CN): Kiran桌面控制面板
License: MulanPSL-2.0
Source0: %{name}-%{version}.tar.gz
Patch0001: 0001-fix-system-buttons-on-the-system-information-page-ar.patch
Patch0002: 0002-refactor-systeminfo-update-systeminfo-plugin-dialog-.patch
Patch0003: 0001-fix-netwowrk-fix-not-searching-the-wireless-network-.patch
Patch0004: 0001-refactor-panel-set-panel-creategory-widget-auto-fill.patch
Patch0005: 0001-fix-search-when-the-relevant-setting-interface-canno.patch
Patch0006: 0002-fix-account-error-prompt-box-is-added-with-the-defau.patch
BuildRequires: gcc-c++
BuildRequires: cmake >= 3.2
@ -168,6 +171,10 @@ make %{?_smp_mflags}
rm -rf %{buildroot}
%changelog
* Wed Aug 10 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.3.4-5
- KYOS-B: error prompt box is added with the default disappearance time(#I5HR61)
- KYOS-B: when the relevant setting interface cannot be searched, a prompt will be added(#I5H192)
* Tue Aug 09 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.3.4-4
- KYOS-F: set panel creategory widget auto fill background