From 70526fa8be0082e3697557386b8609de610b5784 Mon Sep 17 00:00:00 2001 From: liuxinhao Date: Wed, 10 Aug 2022 15:16:05 +0800 Subject: [PATCH] fix(account): error prompt box is added with the default disappearance time,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 - 错误提示框在点击消失的基础之上,加入默认消失时间,当未能搜索到相关设置界面时加入提示。修改跳转逻辑,不通过补全直接输入并回车也可以触发跳转功能 --- ...the-relevant-setting-interface-canno.patch | 106 ++++++++++++++++++ ...r-prompt-box-is-added-with-the-defau.patch | 31 +++++ kiran-control-panel.spec | 9 +- 3 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 0001-fix-search-when-the-relevant-setting-interface-canno.patch create mode 100644 0002-fix-account-error-prompt-box-is-added-with-the-defau.patch diff --git a/0001-fix-search-when-the-relevant-setting-interface-canno.patch b/0001-fix-search-when-the-relevant-setting-interface-canno.patch new file mode 100644 index 0000000..73c61f1 --- /dev/null +++ b/0001-fix-search-when-the-relevant-setting-interface-canno.patch @@ -0,0 +1,106 @@ +From fb79eb15820419ee346148abd7ce1a52d83becaf Mon Sep 17 00:00:00 2001 +From: liuxinhao +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 + #include + #include ++#include + #include + #include + #include + #include + #include + #include ++#include + + 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::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 @@ + 控制面板 + + ++ ++ SearchEdit ++ ++ ++ Info ++ 提示 ++ ++ ++ ++ Failed to find related items, please re-enter! ++ 未能搜索到相关项,请重新输入! ++ ++ + +-- +2.33.0 + diff --git a/0002-fix-account-error-prompt-box-is-added-with-the-defau.patch b/0002-fix-account-error-prompt-box-is-added-with-the-defau.patch new file mode 100644 index 0000000..10e18e4 --- /dev/null +++ b/0002-fix-account-error-prompt-box-is-added-with-the-defau.patch @@ -0,0 +1,31 @@ +From 0ea6996cf22fa8cece850bd8ba8aaa21ad1ff845 Mon Sep 17 00:00:00 2001 +From: liuxinhao +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 + diff --git a/kiran-control-panel.spec b/kiran-control-panel.spec index cc0b16c..67a0061 100644 --- a/kiran-control-panel.spec +++ b/kiran-control-panel.spec @@ -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 - 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 - 2.3.4-4 - KYOS-F: set panel creategory widget auto fill background