From f91ee56d97921c8a1dee9ba6621c8c59c0401631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=9A=E5=AD=90?= Date: Sat, 28 Jan 2023 16:44:12 +0000 Subject: [PATCH 01/15] =?UTF-8?q?=E5=88=A4=E6=96=ADoyo=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 柚子 --- tool/apt-fast-conf/apt-fast.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tool/apt-fast-conf/apt-fast.conf b/tool/apt-fast-conf/apt-fast.conf index 9089290..a2389fe 100644 --- a/tool/apt-fast-conf/apt-fast.conf +++ b/tool/apt-fast-conf/apt-fast.conf @@ -17,6 +17,9 @@ if grep -Eqi "linuxmint" /etc/os-release;then _APTMGR=apt-get fi +if [ -x "$(command -v oyo)" ]; then +_APTMGR=apt-get +fi #### # From 18d2b1edbb11af2ddf40fd704227cfa81eb754e7 Mon Sep 17 00:00:00 2001 From: shenmo Date: Mon, 30 Jan 2023 03:30:45 +0000 Subject: [PATCH 02/15] update tool/apt-fast-conf/apt-fast.conf. Signed-off-by: shenmo --- tool/apt-fast-conf/apt-fast.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tool/apt-fast-conf/apt-fast.conf b/tool/apt-fast-conf/apt-fast.conf index a2389fe..bb4637e 100644 --- a/tool/apt-fast-conf/apt-fast.conf +++ b/tool/apt-fast-conf/apt-fast.conf @@ -11,7 +11,12 @@ # # Default: apt-get # +_APTMGR=apt-get + +if [ -x "$(command -v apt)" ]; then _APTMGR=apt +fi + if grep -Eqi "linuxmint" /etc/os-release;then _APTMGR=apt-get From 50e895938b1ab5bd67349ecc03e2e4df2bc9abbf Mon Sep 17 00:00:00 2001 From: shenmo Date: Mon, 30 Jan 2023 13:19:07 +0800 Subject: [PATCH 03/15] =?UTF-8?q?transhell=E6=94=B9=E4=B8=BA=E7=94=A8sourc?= =?UTF-8?q?e=E5=BC=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 7 +++++ src/main.cpp | 2 +- tool/bashimport/transhell.amber | 31 ++++++++++++++++++++++ tool/ssinstall | 27 ++----------------- tool/update-upgrade/ss-do-upgrade.sh | 26 ++---------------- tool/update-upgrade/ss-update-controler.sh | 27 ++----------------- tool/update-upgrade/ss-update-notifier.sh | 27 ++----------------- 7 files changed, 47 insertions(+), 100 deletions(-) create mode 100755 tool/bashimport/transhell.amber diff --git a/debian/changelog b/debian/changelog index 2c00065..4b97fc5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +spark-store (4.2.2) stable; urgency=medium + + * 调整:脚本应用的transhell支持转为source + + --shenmo Fri, 30 Jan 2022 00:00:00 +0800 + + spark-store (4.2.1) stable; urgency=medium * 调整:支持在安装前进行测试(ss-do-upgrade-worker),但是未实装到appinfo diff --git a/src/main.cpp b/src/main.cpp index c52ffab..100922a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,7 +15,7 @@ DWIDGET_USE_NAMESPACE int main(int argc, char *argv[]) { // Get build time - static const QString version = "4.2.1"; + static const QString version = "4.2.2"; static const QDate buildDate = QLocale(QLocale::English).toDate(QString(__DATE__).replace(" ", " 0"), "MMM dd yyyy"); static const QTime buildTime = QTime::fromString(__TIME__, "hh:mm:ss"); static const QString buildDateTime = buildDate.toString("yyyy.MM.dd") + "-" + buildTime.toString("hh:mm:ss"); diff --git a/tool/bashimport/transhell.amber b/tool/bashimport/transhell.amber new file mode 100755 index 0000000..73b8d90 --- /dev/null +++ b/tool/bashimport/transhell.amber @@ -0,0 +1,31 @@ +#!/bin/bash + +##load transhell +function load_transhell_debug() +{ +local WORK_PATH="$(cd "$(dirname "${0}")" && pwd)" +local CURRENT_LANG="$(echo ${LANG%.*})" +if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell; echo "Loading transhell from /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell ..."; fi +if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell; echo "Loading transhell from /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell ..."; fi +if [ -e "${WORK_PATH}/transhell/$(basename $0)_en_US.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell; echo "Loading transhell from ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell ..."; fi +if [ -e "${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell; echo "Loading transhell from ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell ..."; fi + +echo "-----------------------------------------------------------------------------" +} + +function load_transhell() +{ +local WORK_PATH="$(cd "$(dirname "${0}")" && pwd)" +local CURRENT_LANG="$(echo ${LANG%.*})" +if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell; fi +if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell; fi +if [ -e "${WORK_PATH}/transhell/$(basename $0)_en_US.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell; fi +if [ -e "${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell; fi + +} + +function update_transhell() +{ +load_transhell $@ +} + diff --git a/tool/ssinstall b/tool/ssinstall index 19c63eb..d879f0f 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -1,30 +1,7 @@ #!/bin/bash -##load transhell -function load_transhell() -{ -local WORK_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -local CURRENT_LANG="$(echo ${LANG%.*})" -if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell; echo "Loading transhell from /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell ..."; fi -if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell; echo "Loading transhell from /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell ..."; fi -if [ -e "${WORK_PATH}/transhell/$(basename $0)_en_US.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell; echo "Loading transhell from ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell ..."; fi -if [ -e "${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell; echo "Loading transhell from ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell ..."; fi - -echo "-----------------------------------------------------------------------------" -} - -function update_transhell() -{ -local WORK_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -local CURRENT_LANG="$(echo ${LANG%.*})" -if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell; fi -if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell; fi -if [ -e "${WORK_PATH}/transhell/$(basename $0)_en_US.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell; fi -if [ -e "${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell; fi - -} - -load_transhell +source /opt/durapps/spark-store/bin/bashimport/transhell.amber +load_transhell_debug diff --git a/tool/update-upgrade/ss-do-upgrade.sh b/tool/update-upgrade/ss-do-upgrade.sh index 1570fc2..d9e000d 100755 --- a/tool/update-upgrade/ss-do-upgrade.sh +++ b/tool/update-upgrade/ss-do-upgrade.sh @@ -1,30 +1,8 @@ #!/bin/bash -##load transhell -function load_transhell() -{ -local WORK_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -local CURRENT_LANG="$(echo ${LANG%.*})" -if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell; echo "Loading transhell from /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell ..."; fi -if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell; echo "Loading transhell from /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell ..."; fi -if [ -e "${WORK_PATH}/transhell/$(basename $0)_en_US.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell; echo "Loading transhell from ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell ..."; fi -if [ -e "${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell; echo "Loading transhell from ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell ..."; fi +source /opt/durapps/spark-store/bin/bashimport/transhell.amber +load_transhell_debug -echo "-----------------------------------------------------------------------------" -} - -function update_transhell() -{ -local WORK_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -local CURRENT_LANG="$(echo ${LANG%.*})" -if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell; fi -if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell; fi -if [ -e "${WORK_PATH}/transhell/$(basename $0)_en_US.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell; fi -if [ -e "${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell; fi - -} - -load_transhell touch /tmp/spark-store/upgradeStatus.txt diff --git a/tool/update-upgrade/ss-update-controler.sh b/tool/update-upgrade/ss-update-controler.sh index 28f2e2f..7546b37 100755 --- a/tool/update-upgrade/ss-update-controler.sh +++ b/tool/update-upgrade/ss-update-controler.sh @@ -1,30 +1,7 @@ #!/bin/bash -##load transhell -function load_transhell() -{ -local WORK_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -local CURRENT_LANG="$(echo ${LANG%.*})" -if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell; echo "Loading transhell from /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell ..."; fi -if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell; echo "Loading transhell from /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell ..."; fi -if [ -e "${WORK_PATH}/transhell/$(basename $0)_en_US.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell; echo "Loading transhell from ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell ..."; fi -if [ -e "${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell; echo "Loading transhell from ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell ..."; fi - -echo "-----------------------------------------------------------------------------" -} - -function update_transhell() -{ -local WORK_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -local CURRENT_LANG="$(echo ${LANG%.*})" -if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell; fi -if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell; fi -if [ -e "${WORK_PATH}/transhell/$(basename $0)_en_US.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell; fi -if [ -e "${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell; fi - -} - -load_transhell +source /opt/durapps/spark-store/bin/bashimport/transhell.amber +load_transhell_debug endloop=0 diff --git a/tool/update-upgrade/ss-update-notifier.sh b/tool/update-upgrade/ss-update-notifier.sh index c02cd4e..61b883c 100755 --- a/tool/update-upgrade/ss-update-notifier.sh +++ b/tool/update-upgrade/ss-update-notifier.sh @@ -1,31 +1,8 @@ #!/bin/bash LANGUAGE=en_US -##load transhell -function load_transhell() -{ -local WORK_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -local CURRENT_LANG="$(echo ${LANG%.*})" -if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell; echo "Loading transhell from /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell ..."; fi -if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell; echo "Loading transhell from /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell ..."; fi -if [ -e "${WORK_PATH}/transhell/$(basename $0)_en_US.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell; echo "Loading transhell from ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell ..."; fi -if [ -e "${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell; echo "Loading transhell from ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell ..."; fi - -echo "-----------------------------------------------------------------------------" -} - -function update_transhell() -{ -local WORK_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -local CURRENT_LANG="$(echo ${LANG%.*})" -if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell; fi -if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell; fi -if [ -e "${WORK_PATH}/transhell/$(basename $0)_en_US.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell; fi -if [ -e "${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell; fi - -} - -load_transhell +source /opt/durapps/spark-store/bin/bashimport/transhell.amber +load_transhell_debug ############################################################# From b1fd1a3c3c34a25fad775d0dfb75fc1b422c0589 Mon Sep 17 00:00:00 2001 From: shenmo Date: Mon, 30 Jan 2023 15:51:35 +0800 Subject: [PATCH 04/15] fix:zenity-fail-on-wayland --- tool/ssinstall | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tool/ssinstall b/tool/ssinstall index d879f0f..18a925f 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -17,19 +17,19 @@ function pkexec_as_current_user() { sudo -u $user DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus pkexec "$@" } -function zenity() { - #Detect the name of the display in use - local display=":$(ls /tmp/.X11-unix/* | sed 's#/tmp/.X11-unix/X##' | head -n 1)" +function zenity() +{ + #Detect the user using such display - local user=$(who | grep '('$display')' | awk '{print $1}' | head -n 1) + local user=$(who | awk '{print $1}' | head -n 1) #Detect the id of the user local uid=$(id -u $user) - sudo -u $user DISPLAY=$display DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus zenity "$@" -} + sudo -u $user DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus zenity "$@" +} #################检测文件是否存在 if [ $# -eq 0 ];then echo "没有接收到参数,退出" From 1a89c2a1a672f40565431381bd18df6bbc6a6e66 Mon Sep 17 00:00:00 2001 From: shenmo Date: Mon, 30 Jan 2023 15:53:35 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20?= =?UTF-8?q?=20=20debian/changelog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 4b97fc5..c4886c7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ spark-store (4.2.2) stable; urgency=medium - * 调整:脚本应用的transhell支持转为source + * 调整:脚本应用的transhell支持转为source导入 + * 修复:ssinstall弹窗支持wayland --shenmo Fri, 30 Jan 2022 00:00:00 +0800 From 4b40e3cacae906f0825ee4351b9e11d8e4b0cb1b Mon Sep 17 00:00:00 2001 From: zty199 <46324746+zty199@users.noreply.github.com> Date: Mon, 30 Jan 2023 16:15:07 +0800 Subject: [PATCH 06/15] =?UTF-8?q?feat:=20ISSUE=20#I67K8Y=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20spk://search/keyword=20=E9=93=BE=E6=8E=A5=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 支持打开该链接跳转搜索页面(禁止直接搜索 %,搜索结果过多会导致搜索页面 QtWebEngine 进程崩溃,无法继续搜索) Log: 支持链接跳转搜索结果页面;暂不支持直接跳转到应用详情页 --- src/main.cpp | 2 +- src/mainwindow-dtk.cpp | 42 ++++++++++++++++++++++++++++----------- src/mainwindow-dtk.h | 2 +- src/pages/applistpage.cpp | 4 ++-- src/pages/applistpage.h | 2 +- 5 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 100922a..51526ae 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -136,7 +136,7 @@ int main(int argc, char *argv[]) QString arg1 = argv[1]; if (arg1.trimmed().startsWith("spk://")) { - w.openUrl(QUrl(argv[1])); + w.openUrl(arg1); } } w.show(); diff --git a/src/mainwindow-dtk.cpp b/src/mainwindow-dtk.cpp index 0fa509a..6b1480d 100644 --- a/src/mainwindow-dtk.cpp +++ b/src/mainwindow-dtk.cpp @@ -200,11 +200,18 @@ MainWindow::MainWindow(QWidget *parent) QString searchtext = searchEdit->text(); if (!searchtext.isEmpty()) { if (searchtext.startsWith("spk://")) { - openUrl(QUrl(searchtext)); + openUrl(searchtext); searchEdit->clearEdit(); } else { - ui->applistpage_1->getSearchList(searchtext); - switchPage(AppPageSearchlist); + if (searchtext == "%") + { + qWarning() << "keyword '%' matches too many results, which will cause QtWebEngine crash."; + } + else + { + ui->applistpage_1->getSearchList(searchtext); + switchPage(AppPageSearchlist); + } } } this->setFocus(); }); @@ -213,11 +220,11 @@ MainWindow::MainWindow(QWidget *parent) { downloadButton->setProgress(i); }); // 列表点击事件 connect(ui->applistpage, &AppListPage::clicked, this, [=](QUrl spk) - { openUrl(spk); }); + { openUrl(spk.toString()); }); connect(ui->applistpage_1, &AppListPage::clicked, this, [=](QUrl spk) - { openUrl(spk); }); + { openUrl(spk.toString()); }); connect(ui->settingspage, &SettingsPage::openUrl, this, [=](QUrl spk) - { openUrl(spk); }); + { openUrl(spk.toString()); }); emit DGuiApplicationHelper::instance()->themeTypeChanged(DGuiApplicationHelper::instance()->themeType()); connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::newProcessInstance, this, &MainWindow::onNewProcessInstance); @@ -246,7 +253,7 @@ void MainWindow::onGetUrl(const QString &url) { if (url.trimmed().startsWith("spk://")) { - openUrl(QUrl(url)); + openUrl(url); } activateWindow(); } @@ -261,16 +268,27 @@ void MainWindow::onNewProcessInstance(qint64 pid, const QStringList &arguments) } } -void MainWindow::openUrl(QUrl url) +void MainWindow::openUrl(const QString &url) { - if (url.toString().startsWith("spk://")) + if (url.startsWith("spk://search/")) { - ui->appintopage->openUrl(QUrl(url.toString().replace("+", "%2B"))); + QString keyword = url.mid(13); + if (keyword == "%") + { + qWarning() << "keyword '%' is not valid, which will cause QtWebEngine crash."; + return; + } + ui->applistpage_1->getSearchList(keyword); + switchPage(AppPageSearchlist); + } + else if (url.startsWith("spk://")) + { + ui->appintopage->openUrl(QUrl::fromUserInput(url)); switchPage(AppPageAppdetail); } else { - QDesktopServices::openUrl(QUrl(url.toString().replace("+", "%2B"))); + QDesktopServices::openUrl(QUrl::fromUserInput(url)); } } @@ -355,5 +373,5 @@ void MainWindow::on_pushButton_14_clicked() upgradeP->waitForFinished(-1); upgradeP->deleteLater(); }); } - } + } } diff --git a/src/mainwindow-dtk.h b/src/mainwindow-dtk.h index 3eab079..c1dad7e 100644 --- a/src/mainwindow-dtk.h +++ b/src/mainwindow-dtk.h @@ -31,7 +31,7 @@ public: explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); - void openUrl(QUrl); + void openUrl(const QString &url); private: void initDbus(); diff --git a/src/pages/applistpage.cpp b/src/pages/applistpage.cpp index 43d56b5..3e166d5 100644 --- a/src/pages/applistpage.cpp +++ b/src/pages/applistpage.cpp @@ -56,7 +56,7 @@ void AppListPage::getAppList(QString type) delete api; } -void AppListPage::getSearchList(QString keyword) +void AppListPage::getSearchList(const QString &keyword) { isSearch = true; nowType = keyword; @@ -71,7 +71,7 @@ void AppListPage::getSearchList(QString keyword) { theme = "theme=light"; } - url = api->getServerUrl() + "store/#/flamescion/search?keywords=" + keyword + "&" + theme; + url = api->getServerUrl() + "store/#/flamescion/search?keywords=" + QUrl::toPercentEncoding(keyword) + "&" + theme; ui->webEngineView->setUrl(url); delete api; } diff --git a/src/pages/applistpage.h b/src/pages/applistpage.h index 9715088..cb8c0cb 100644 --- a/src/pages/applistpage.h +++ b/src/pages/applistpage.h @@ -14,7 +14,7 @@ class AppListPage : public QWidget public: void setTheme(bool dark); - void getSearchList(QString keyword); + void getSearchList(const QString &keyword); void getAppList(QString type); explicit AppListPage(QWidget *parent = nullptr); ~AppListPage(); From cf549c540d8612b13910ae60ac6b85621ecdbbe0 Mon Sep 17 00:00:00 2001 From: zty199 <46324746+zty199@users.noreply.github.com> Date: Mon, 30 Jan 2023 18:30:43 +0800 Subject: [PATCH 07/15] =?UTF-8?q?feat:=20ISSUE=20#I69IJI=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=85=B3=E9=97=AD=E5=88=B0=E6=89=98=E7=9B=98=E4=BB=A5?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E4=B8=8B=E8=BD=BD=E5=92=8C=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E4=B8=AD=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加托盘图标,主窗口关闭后仍然在后台运行;左键单机托盘图标显示主窗口 Log: 添加托盘图标;重构 MainWindow 构造函数,拆分 UI 初始化代码至单独函数;修改启动时窗口渐变动画初始化位置至 showEvent 中 --- src/application.cpp | 2 + src/main.cpp | 5 +- src/mainwindow-dtk.cpp | 506 ++++++++++++++----------- src/mainwindow-dtk.h | 37 +- src/widgets/base/basewidgetopacity.cpp | 26 +- src/widgets/base/basewidgetopacity.h | 12 +- translations/spark-store_en.ts | 44 ++- translations/spark-store_fr.ts | 44 ++- translations/spark-store_zh_CN.ts | 46 ++- 9 files changed, 443 insertions(+), 279 deletions(-) diff --git a/src/application.cpp b/src/application.cpp index 9bf7cd4..b3c53a2 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -19,6 +19,8 @@ Application::Application(int &argc, char **argv) } setAttribute(Qt::AA_UseHighDpiPixmaps); + setQuitOnLastWindowClosed(false); // 启用托盘图标时,关闭窗口程序仍然运行 + loadTranslator(); // 载入翻译 setOrganizationName("spark-union"); diff --git a/src/main.cpp b/src/main.cpp index 51526ae..66bcc1b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,6 +5,10 @@ #include #include +#include +#include +#include +#include #include DCORE_USE_NAMESPACE @@ -124,7 +128,6 @@ int main(int argc, char *argv[]) return -1; } - DGuiApplicationHelper::instance()->setPaletteType(DGuiApplicationHelper::LightType); // 固定主题为浅色主题 DApplicationSettings settings; // 定义 DApplicationSettings,自动保存主题设置 MainWindow w; diff --git a/src/mainwindow-dtk.cpp b/src/mainwindow-dtk.cpp index 6b1480d..33cbe15 100644 --- a/src/mainwindow-dtk.cpp +++ b/src/mainwindow-dtk.cpp @@ -1,10 +1,16 @@ #include "mainwindow-dtk.h" #include "ui_mainwindow-dtk.h" +#include "utils/widgetanimation.h" +#include "widgets/common/progressbutton.h" +#include "widgets/downloadlistwidget.h" +#include "dbus/dbussparkstoreservice.h" +#include "application.h" +#include #include #include -#include -#include + +#include #define AppPageApplist 0 #define AppPageSearchlist 1 @@ -16,228 +22,28 @@ #define UploadServerUrl "https://upload.deepinos.org/" MainWindow::MainWindow(QWidget *parent) - : BaseWidgetOpacity(parent), ui(new Ui::MainWindow) + : BaseWidgetOpacity(parent) + , ui(new Ui::MainWindow) + , downloadlistwidget(new DownloadListWidget) + , trayIcon(new QSystemTrayIcon(QIcon::fromTheme("spark-store"), this)) { ui->setupUi(this); - setWindowTitle(QObject::tr("Spark Store")); - initConfig(); - // FIXME: wayland 不支持直接设置窗口透明度,需要调用 wayland 相关库(考虑抄控制中心“窗口移动时启用透明特效”代码?) - QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat); - bool isWayland = config.value("build/isWayland").toBool(); - if (!isWayland) - { - WidgetAnimation::widgetOpacity(this, true); - } + initTmpDir(); + + initUI(); + initConnections(); - searchEdit = new DSearchEdit(ui->titlebar); - downloadlistwidget = new DownloadListWidget; - downloadButton = new ProgressButton(ui->titlebar); - backButtom = new QPushButton(ui->titlebar); ui->appintopage->setDownloadWidget(downloadlistwidget); - ui->stackedWidget->setCurrentIndex(0); - ui->titlebar->setBackgroundTransparent(true); - // ui->titlebar->setSwitchThemeMenuVisible(false); // 去除 dtk 标题栏主题切换菜单 - setMaskAlpha(250); - updateUi(0); - - QAction *actionSubmission = new QAction(tr("Submit App"), this); - QAction *actionSubmissionWithClient = new QAction(tr("Submit App with client(Recommanded)"), this); - QAction *setting = new QAction(tr("Settings")); - QAction *upgrade = new QAction(tr("APP Upgrade and Install Settings")); - QMenu *menu = new QMenu; - menu->addAction(setting); - menu->addAction(upgrade); - menu->addAction(actionSubmission); - menu->addAction(actionSubmissionWithClient); - - ui->titlebar->setMenu(menu); - connect(actionSubmission, &QAction::triggered, this, [=] - { QDesktopServices::openUrl(QUrl(UploadServerUrl)); }); - connect(setting, &QAction::triggered, this, [=] - { - switchPage(AppPageSettings); - ui->settingspage->updateUI(); }); - connect(upgrade, &QAction::triggered, this, [=] - { QProcess::startDetached("/opt/durapps/spark-store/bin/update-upgrade/ss-update-controler.sh", QStringList()); }); - // 投稿器 - connect(actionSubmissionWithClient, &QAction::triggered, this, [=] - { - QString submitterSpk = "spk://store/tools/spark-store-submitter"; - QFile actionSubmissionClientStatus("/opt/spark-store-submitter/bin/spark-store-submitter"); - if (actionSubmissionClientStatus.exists()) - { - qDebug() << "投稿器存在"; - QProcess::startDetached("/opt/spark-store-submitter/bin/spark-store-submitter", QStringList()); - } - else - { - qDebug() << "投稿器不存在,跳转页面"; - openUrl(submitterSpk); - } }); - - // 主题切换 - connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [=](DGuiApplicationHelper::ColorType themeType) - { - if (themeType == DGuiApplicationHelper::DarkType) { - //深色模式 - setMaskColor(QColor("#2a2b2b")); - backButtom->setIcon(QIcon(":/icon/dark/back.svg")); - downloadButton->setIcon(":/icon/dark/download.svg"); - downloadButton->setBackgroundColor(QColor("#444444")); - downloadButton->setColor(QColor("#66CCFF")); - ui->pushButton_14->setIcon(QIcon(":/icon/dark/update.svg")); - for (int i = 0; i < ui->buttonGroup->buttons().size(); i++) { - ui->buttonGroup->buttons()[i]->setIcon(QIcon(":/icon/dark/leftbutton_" + QString::number(i) + ".svg")); - if (QLocale::system().name() == "zh_CN") { - ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{background-color:transparent;}\ - QPushButton:hover{background-color:#7a7a7a;border:0px;border-radius:8px;}\ - QPushButton:checked{background-color:#6e6e6e;border:0px;border-radius:8px;}"); - } else { - ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{background-color:transparent;text-align: left; padding-left: 15px;}\ - QPushButton:hover{background-color:#7a7a7a;border:0px;border-radius:8px;text-align: left; padding-left: 15px;}\ - QPushButton:checked{background-color:#6e6e6e;border:0px;border-radius:8px;text-align: left; padding-left: 15px;}"); - } - } - } else { - //亮色模式 - setMaskColor(QColor("#f3f7f8")); - backButtom->setIcon(QIcon(":/icon/light/back.svg")); - downloadButton->setBackgroundColor(QColor("#e3e4e4")); - downloadButton->setColor(QColor("#66CCFF")); - downloadButton->setIcon(":/icon/light/download.svg"); - ui->pushButton_14->setIcon(QIcon(":/icon/light/update.svg")); - for (int i = 0; i < ui->buttonGroup->buttons().size(); i++) { - ui->buttonGroup->buttons()[i]->setIcon(QIcon(":/icon/light/leftbutton_" + QString::number(i) + ".svg")); - if (QLocale::system().name() == "zh_CN") { - ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{background-color:transparent;}\ - QPushButton:hover{background-color:#eAeAeA;border:0px;border-radius:8px;}\ - QPushButton:checked{background-color:#dddddd;border:0px;border-radius:8px;}"); - } else { - ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{background-color:transparent;text-align: left; padding-left: 15px;}\ - QPushButton:hover{background-color:#eAeAeA;border:0px;border-radius:8px;text-align: left; padding-left: 15px;}\ - QPushButton:checked{background-color:#dddddd;border:0px;border-radius:8px;text-align: left; padding-left: 15px;}"); - } - } - } - ui->pushButton_14->setStyleSheet(ui->pushButton_4->styleSheet()); - ui->applistpage->setTheme(themeType == DGuiApplicationHelper::DarkType); - ui->applistpage_1->setTheme(themeType == DGuiApplicationHelper::DarkType); - ui->appintopage->setTheme(themeType == DGuiApplicationHelper::DarkType); - ui->settingspage->setTheme(themeType == DGuiApplicationHelper::DarkType); }); - - // 初始化标题栏控件 - connect(downloadButton, &ProgressButton::clicked, [=]() - { - QPoint pos; - pos.setX(downloadButton->mapToGlobal(QPoint(0, 0)).x() + downloadButton->width() / 2 - downloadlistwidget->width() / 2); - pos.setY(downloadButton->mapToGlobal(QPoint(0, 0)).y() + downloadButton->height() + 5); - downloadlistwidget->m_move(pos.x(), pos.y()); - downloadlistwidget->show(); }); - - // appintopage按下下载按钮时标题栏下载列表按钮抖动 - connect(ui->appintopage, &AppIntoPage::clickedDownloadBtn, [=]() - { - WidgetAnimation::widgetShake(downloadButton, 6); // 第一个参数是抖动的控件,第二个参数是抖动范围(像素) - }); - - connect(backButtom, &QPushButton::clicked, [=]() - { - ui->stackedWidget->setCurrentIndex(pageHistory.at(pageHistory.count() - 2)); - pageHistory.removeLast(); - if (pageHistory.count() > 1) { - backButtom->show(); - } else { - backButtom->hide(); - } }); - downloadlistwidget->hide(); - backButtom->hide(); - ui->titlebar->setIcon(QIcon::fromTheme(":/icon/logo.svg")); - - QWidget *w_titlebar = new QWidget(ui->titlebar); - QHBoxLayout *ly_titlebar = new QHBoxLayout(w_titlebar); - QLabel *title = new QLabel(ui->titlebar); - title->setText(tr("Spark Store")); - searchEdit->setPlaceholderText(tr("Search or enter spk://")); - ly_titlebar->addWidget(title); - ly_titlebar->addWidget(backButtom); - - // Check wayland configs - // QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat); - if (!config.value("build/isDeepinOS").toBool() && config.value("build/useWayland").toBool()) - { - // Wayland 搜索栏居中 - ly_titlebar->addStretch(WaylandSearchCenter); - } - else - { - // dwayland dxcb 搜索栏顶部右侧居中 - ly_titlebar->addStretch(OtherSearchCenter); - } - - ly_titlebar->addWidget(searchEdit); - ly_titlebar->addWidget(downloadButton); - ly_titlebar->addStretch(RightSearchSpace); - ui->titlebar->setCustomWidget(w_titlebar); - // 侧边栏按钮 - int i = 0; - while (i < ui->buttonGroup->buttons().size()) - { - ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{qproperty-icon: url(data/images/userMangaer/teacher.png);}"); - connect(ui->buttonGroup->buttons()[i], &QPushButton::toggled, [=](bool checked) - { - if (checked == true) { - searchEdit->clearEdit(); - updateUi(i); - } }); - i++; - } - - // 搜索事件 - connect(searchEdit, &DSearchEdit::returnPressed, this, [=]() - { - QString searchtext = searchEdit->text(); - if (!searchtext.isEmpty()) { - if (searchtext.startsWith("spk://")) { - openUrl(searchtext); - searchEdit->clearEdit(); - } else { - if (searchtext == "%") - { - qWarning() << "keyword '%' matches too many results, which will cause QtWebEngine crash."; - } - else - { - ui->applistpage_1->getSearchList(searchtext); - switchPage(AppPageSearchlist); - } - } - } - this->setFocus(); }); - - connect(downloadlistwidget, &DownloadListWidget::downloadProgress, this, [=](int i) - { downloadButton->setProgress(i); }); - // 列表点击事件 - connect(ui->applistpage, &AppListPage::clicked, this, [=](QUrl spk) - { openUrl(spk.toString()); }); - connect(ui->applistpage_1, &AppListPage::clicked, this, [=](QUrl spk) - { openUrl(spk.toString()); }); - connect(ui->settingspage, &SettingsPage::openUrl, this, [=](QUrl spk) - { openUrl(spk.toString()); }); emit DGuiApplicationHelper::instance()->themeTypeChanged(DGuiApplicationHelper::instance()->themeType()); - - connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::newProcessInstance, this, &MainWindow::onNewProcessInstance); } MainWindow::~MainWindow() { delete ui; - if (downloadlistwidget) - { - downloadlistwidget->deleteLater(); - } + downloadlistwidget->deleteLater(); } void MainWindow::initDbus() @@ -292,7 +98,279 @@ void MainWindow::openUrl(const QString &url) } } -void MainWindow::initConfig() +void MainWindow::initUI() +{ + setWindowTitle(QObject::tr("Spark Store")); + setMaskAlpha(250); + + initTitleBar(); + initLeftMenu(); + + ui->stackedWidget->setCurrentIndex(0); + updateUi(0); + + initTrayIcon(); +} + +void MainWindow::initTitleBar() +{ + ui->titlebar->setIcon(QIcon::fromTheme("spark-store")); + ui->titlebar->setBackgroundTransparent(true); + // ui->titlebar->setSwitchThemeMenuVisible(false); // 去除 dtk 标题栏主题切换菜单 + + // 初始化标题栏控件 + DLabel *title = new DLabel(ui->titlebar); + title->setText(tr("Spark Store")); + + backButton = new DPushButton(ui->titlebar); + + searchEdit = new DSearchEdit(ui->titlebar); + searchEdit->setPlaceholderText(tr("Search or enter spk://")); + + downloadButton = new ProgressButton(ui->titlebar); + + QWidget *w_titlebar = new QWidget(ui->titlebar); + QHBoxLayout *ly_titlebar = new QHBoxLayout(w_titlebar); + ly_titlebar->addWidget(title); + ly_titlebar->addWidget(backButton); + // Check wayland configs + QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat); + if (!config.value("build/isDeepinOS").toBool() && config.value("build/useWayland").toBool()) + { + // Wayland 搜索栏居中 + ly_titlebar->addStretch(WaylandSearchCenter); + } + else + { + // dwayland dxcb 搜索栏顶部右侧居中 + ly_titlebar->addStretch(OtherSearchCenter); + } + ly_titlebar->addWidget(searchEdit); + ly_titlebar->addWidget(downloadButton); + ly_titlebar->addStretch(RightSearchSpace); + ui->titlebar->setCustomWidget(w_titlebar); + + initTitleBarMenu(); + + backButton->hide(); + downloadlistwidget->hide(); +} + +void MainWindow::initTitleBarMenu() +{ + QAction *actionSubmission = new QAction(tr("Submit App"), this); + QAction *actionSubmissionWithClient = new QAction(tr("Submit App with client(Recommanded)"), this); + QAction *setting = new QAction(tr("Settings")); + QAction *upgrade = new QAction(tr("APP Upgrade and Install Settings")); + QMenu *menu = new QMenu(ui->titlebar); + menu->addAction(setting); + menu->addAction(upgrade); + menu->addAction(actionSubmission); + menu->addAction(actionSubmissionWithClient); + + ui->titlebar->setMenu(menu); + + connect(actionSubmission, &QAction::triggered, this, [=] + { QDesktopServices::openUrl(QUrl(UploadServerUrl)); }); + connect(setting, &QAction::triggered, this, [=] + { + switchPage(AppPageSettings); + ui->settingspage->updateUI(); }); + connect(upgrade, &QAction::triggered, this, [=] + { QProcess::startDetached("/opt/durapps/spark-store/bin/update-upgrade/ss-update-controler.sh", QStringList()); }); + // 投稿器 + connect(actionSubmissionWithClient, &QAction::triggered, this, [=] + { + QString submitterSpk = "spk://store/tools/spark-store-submitter"; + QFile actionSubmissionClientStatus("/opt/spark-store-submitter/bin/spark-store-submitter"); + if (actionSubmissionClientStatus.exists()) + { + qDebug() << "投稿器存在"; + QProcess::startDetached("/opt/spark-store-submitter/bin/spark-store-submitter", QStringList()); + } + else + { + qDebug() << "投稿器不存在,跳转页面"; + openUrl(submitterSpk); + } }); +} + +void MainWindow::initLeftMenu() +{ + // 侧边栏按钮 + foreach (QAbstractButton *button, ui->buttonGroup->buttons()) + { + button->setStyleSheet("QPushButton{qproperty-icon: url(data/images/userMangaer/teacher.png);}"); + connect(button, &QPushButton::toggled, [=](bool checked) + { + if (checked == true) { + searchEdit->clearEdit(); + updateUi(ui->buttonGroup->buttons().indexOf(button)); + } }); + } +} + +void MainWindow::initTrayIcon() +{ + QMenu *menu = new QMenu(this); + + QAction *showAction = new QAction(QObject::tr("Show MainWindow"), menu); + QAction *aboutAction = new QAction(qApp->translate("TitleBarMenu", "About"), menu); + QAction *exitAction = new QAction(qApp->translate("TitleBarMenu", "Exit"), menu); + menu->addAction(showAction); + menu->addAction(aboutAction); + menu->addAction(exitAction); + trayIcon->setContextMenu(menu); + + connect(showAction, &QAction::triggered, this, [=]() + { + showWindowAnimation = false; + closeWindowAnimation = false; + + setWindowState(Qt::WindowActive); + activateWindow(); + show(); }); + connect(aboutAction, &QAction::triggered, this, [=]() + { + qobject_cast(qApp)->handleAboutAction(); }); + connect(exitAction, &QAction::triggered, this, [=]() + { + qobject_cast(qApp)->quit(); }); + + trayIcon->show(); +} + +void MainWindow::initConnections() +{ + // 主题切换 + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [=](DGuiApplicationHelper::ColorType themeType) + { + if (themeType == DGuiApplicationHelper::DarkType) { + //深色模式 + setMaskColor(QColor("#2a2b2b")); + backButton->setIcon(QIcon(":/icon/dark/back.svg")); + downloadButton->setIcon(":/icon/dark/download.svg"); + downloadButton->setBackgroundColor(QColor("#444444")); + downloadButton->setColor(QColor("#66CCFF")); + ui->pushButton_14->setIcon(QIcon(":/icon/dark/update.svg")); + for (int i = 0; i < ui->buttonGroup->buttons().size(); i++) { + ui->buttonGroup->buttons()[i]->setIcon(QIcon(":/icon/dark/leftbutton_" + QString::number(i) + ".svg")); + if (QLocale::system().name() == "zh_CN") { + ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{background-color:transparent;}\ + QPushButton:hover{background-color:#7a7a7a;border:0px;border-radius:8px;}\ + QPushButton:checked{background-color:#6e6e6e;border:0px;border-radius:8px;}"); + } else { + ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{background-color:transparent;text-align: left; padding-left: 15px;}\ + QPushButton:hover{background-color:#7a7a7a;border:0px;border-radius:8px;text-align: left; padding-left: 15px;}\ + QPushButton:checked{background-color:#6e6e6e;border:0px;border-radius:8px;text-align: left; padding-left: 15px;}"); + } + } + } else { + //亮色模式 + setMaskColor(QColor("#f3f7f8")); + backButton->setIcon(QIcon(":/icon/light/back.svg")); + downloadButton->setBackgroundColor(QColor("#e3e4e4")); + downloadButton->setColor(QColor("#66CCFF")); + downloadButton->setIcon(":/icon/light/download.svg"); + ui->pushButton_14->setIcon(QIcon(":/icon/light/update.svg")); + for (int i = 0; i < ui->buttonGroup->buttons().size(); i++) { + ui->buttonGroup->buttons()[i]->setIcon(QIcon(":/icon/light/leftbutton_" + QString::number(i) + ".svg")); + if (QLocale::system().name() == "zh_CN") { + ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{background-color:transparent;}\ + QPushButton:hover{background-color:#eAeAeA;border:0px;border-radius:8px;}\ + QPushButton:checked{background-color:#dddddd;border:0px;border-radius:8px;}"); + } else { + ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{background-color:transparent;text-align: left; padding-left: 15px;}\ + QPushButton:hover{background-color:#eAeAeA;border:0px;border-radius:8px;text-align: left; padding-left: 15px;}\ + QPushButton:checked{background-color:#dddddd;border:0px;border-radius:8px;text-align: left; padding-left: 15px;}"); + } + } + } + ui->pushButton_14->setStyleSheet(ui->pushButton_4->styleSheet()); + ui->applistpage->setTheme(themeType == DGuiApplicationHelper::DarkType); + ui->applistpage_1->setTheme(themeType == DGuiApplicationHelper::DarkType); + ui->appintopage->setTheme(themeType == DGuiApplicationHelper::DarkType); + ui->settingspage->setTheme(themeType == DGuiApplicationHelper::DarkType); }); + + connect(downloadButton, &ProgressButton::clicked, [=]() + { + QPoint pos; + pos.setX(downloadButton->mapToGlobal(QPoint(0, 0)).x() + downloadButton->width() / 2 - downloadlistwidget->width() / 2); + pos.setY(downloadButton->mapToGlobal(QPoint(0, 0)).y() + downloadButton->height() + 5); + downloadlistwidget->m_move(pos.x(), pos.y()); + downloadlistwidget->show(); }); + + // appintopage按下下载按钮时标题栏下载列表按钮抖动 + connect(ui->appintopage, &AppIntoPage::clickedDownloadBtn, [=]() + { + WidgetAnimation::widgetShake(downloadButton, 6); // 第一个参数是抖动的控件,第二个参数是抖动范围(像素) + }); + + connect(backButton, &QPushButton::clicked, [=]() + { + ui->stackedWidget->setCurrentIndex(pageHistory.at(pageHistory.count() - 2)); + pageHistory.removeLast(); + if (pageHistory.count() > 1) { + backButton->show(); + } else { + backButton->hide(); + } }); + + // 搜索事件 + connect(searchEdit, &DSearchEdit::returnPressed, this, [=]() + { + QString searchtext = searchEdit->text(); + if (!searchtext.isEmpty()) { + if (searchtext.startsWith("spk://")) { + openUrl(searchtext); + searchEdit->clearEdit(); + } else { + if (searchtext == "%") + { + qWarning() << "keyword '%' matches too many results, which will cause QtWebEngine crash."; + } + else + { + ui->applistpage_1->getSearchList(searchtext); + switchPage(AppPageSearchlist); + } + } + } + this->setFocus(); }); + + connect(downloadlistwidget, &DownloadListWidget::downloadProgress, this, [=](int i) + { downloadButton->setProgress(i); }); + // 列表点击事件 + connect(ui->applistpage, &AppListPage::clicked, this, [=](QUrl spk) + { openUrl(spk.toString()); }); + connect(ui->applistpage_1, &AppListPage::clicked, this, [=](QUrl spk) + { openUrl(spk.toString()); }); + connect(ui->settingspage, &SettingsPage::openUrl, this, [=](QUrl spk) + { openUrl(spk.toString()); }); + + // 托盘图标点击事件 + connect(trayIcon, &QSystemTrayIcon::activated, this, [=](QSystemTrayIcon::ActivationReason reason) + { + switch (reason) { + case QSystemTrayIcon::Trigger: + { + showWindowAnimation = false; + closeWindowAnimation = false; + + setWindowState(Qt::WindowActive); + activateWindow(); + show(); + + Q_FALLTHROUGH(); + } + default: + break; + } }); + + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::newProcessInstance, this, &MainWindow::onNewProcessInstance); +} + +void MainWindow::initTmpDir() { // 新建临时文件夹 QDir dir; @@ -304,11 +382,11 @@ void MainWindow::switchPage(int now) // 临时方案,回家后修改 qDebug() << pageHistory.count(); if (pageHistory.count() >= 1) { - backButtom->show(); + backButton->show(); } else { - backButtom->hide(); + backButton->hide(); } ui->stackedWidget->setCurrentIndex(now); ui->stackedWidget->currentWidget()->setFocus(); diff --git a/src/mainwindow-dtk.h b/src/mainwindow-dtk.h index c1dad7e..8b1ca60 100644 --- a/src/mainwindow-dtk.h +++ b/src/mainwindow-dtk.h @@ -1,21 +1,15 @@ #ifndef MAINWINDOWDTK_H #define MAINWINDOWDTK_H +#include "widgets/base/basewidgetopacity.h" + #include #include +#include #include -#include #include -#include -#include -#include - -#include "widgets/base/basewidgetopacity.h" -#include "widgets/downloadlistwidget.h" -#include "widgets/common/progressbutton.h" -#include "utils/widgetanimation.h" -#include "dbus/dbussparkstoreservice.h" +#include DWIDGET_USE_NAMESPACE @@ -23,6 +17,8 @@ namespace Ui { class MainWindow; } +class ProgressButton; +class DownloadListWidget; class MainWindow : public BaseWidgetOpacity { Q_OBJECT @@ -34,8 +30,14 @@ public: void openUrl(const QString &url); private: + void initUI(); + void initTitleBar(); + void initTitleBarMenu(); + void initLeftMenu(); + void initTrayIcon(); + void initConnections(); void initDbus(); - void initConfig(); + void initTmpDir(); void switchPage(int now); void updateUi(int now); @@ -46,13 +48,16 @@ private slots: void on_pushButton_14_clicked(); private: - QList pageHistory; - Ui::MainWindow *ui; - DownloadListWidget *downloadlistwidget; - ProgressButton *downloadButton; - QPushButton *backButtom; + + DPushButton *backButton; DSearchEdit *searchEdit; + ProgressButton *downloadButton; + DownloadListWidget *downloadlistwidget; + + QSystemTrayIcon *trayIcon = nullptr; + + QList pageHistory; }; #endif // MAINWINDOWDTK_H diff --git a/src/widgets/base/basewidgetopacity.cpp b/src/widgets/base/basewidgetopacity.cpp index dfb0492..fc26ab0 100644 --- a/src/widgets/base/basewidgetopacity.cpp +++ b/src/widgets/base/basewidgetopacity.cpp @@ -1,15 +1,37 @@ #include "basewidgetopacity.h" +#include "utils/widgetanimation.h" -#include #include #include #include +#include BaseWidgetOpacity::BaseWidgetOpacity(QWidget *parent) : DBlurEffectWidget(parent) { // WidgetAnimation::widgetOpacity(this,true); } +/** + * @brief 窗口显示事件 + * @param event + */ +void BaseWidgetOpacity::showEvent(QShowEvent *event) +{ + // FIXME: wayland 不支持直接设置窗口透明度,需要调用 wayland 相关库(考虑抄控制中心“窗口移动时启用透明特效”代码?) + QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat); + bool isWayland = config.value("build/isWayland").toBool(); + if (!isWayland) + { + if (!showWindowAnimation) + { + showWindowAnimation = true; + WidgetAnimation::widgetOpacity(this, true); + } + } + + DBlurEffectWidget::showEvent(event); +} + /// @brief 窗口关闭事件 /// @param event void BaseWidgetOpacity::closeEvent(QCloseEvent *event) @@ -17,7 +39,7 @@ void BaseWidgetOpacity::closeEvent(QCloseEvent *event) // FIXME: wayland 不支持直接设置窗口透明度,需要调用 wayland 相关库(考虑抄控制中心“窗口移动时启用透明特效”代码?) QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat); bool isWayland = config.value("build/isWayland").toBool(); - if(isWayland) + if (isWayland) { return DBlurEffectWidget::closeEvent(event); } diff --git a/src/widgets/base/basewidgetopacity.h b/src/widgets/base/basewidgetopacity.h index 9d77dc3..406f865 100644 --- a/src/widgets/base/basewidgetopacity.h +++ b/src/widgets/base/basewidgetopacity.h @@ -8,17 +8,17 @@ DWIDGET_USE_NAMESPACE class BaseWidgetOpacity : public DBlurEffectWidget { Q_OBJECT + public: explicit BaseWidgetOpacity(QWidget *parent = nullptr); -signals: - -public slots: - - // QWidget interface protected: - bool closeWindowAnimation = false; + void showEvent(QShowEvent *event) override; void closeEvent(QCloseEvent *event) override; + +protected: + bool showWindowAnimation = false; + bool closeWindowAnimation = false; }; #endif // BASEWIDGETOPACITY_H diff --git a/translations/spark-store_en.ts b/translations/spark-store_en.ts index 887820e..f2f7c8c 100644 --- a/translations/spark-store_en.ts +++ b/translations/spark-store_en.ts @@ -240,12 +240,12 @@ DAboutDialog - + Version: %1 - + %1 is released under %2 @@ -452,32 +452,32 @@ - + Submit App - + Submit App with client(Recommanded) - + Settings - + APP Upgrade and Install Settings - + Spark Store - + Search or enter spk:// @@ -485,19 +485,19 @@ QObject - - - + + + Spark Store - + <span style=' font-size:10pt;font-weight:60;'>An appstore powered by community</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style=' font-size:12pt;'>Spark developers</span> - + Spark Project @@ -506,6 +506,11 @@ Download list + + + Show MainWindow + + SettingsPage @@ -610,4 +615,17 @@ + + TitleBarMenu + + + About + + + + + Exit + + + diff --git a/translations/spark-store_fr.ts b/translations/spark-store_fr.ts index 2e1a0db..fb02688 100644 --- a/translations/spark-store_fr.ts +++ b/translations/spark-store_fr.ts @@ -240,12 +240,12 @@ DAboutDialog - + Version: %1 - + %1 is released under %2 @@ -452,32 +452,32 @@ - + Submit App - + Submit App with client(Recommanded) - + Settings - + APP Upgrade and Install Settings - + Spark Store - + Search or enter spk:// @@ -485,19 +485,19 @@ QObject - - - + + + Spark Store - + <span style=' font-size:10pt;font-weight:60;'>An appstore powered by community</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style=' font-size:12pt;'>Spark developers</span> - + Spark Project @@ -506,6 +506,11 @@ Download list + + + Show MainWindow + + SettingsPage @@ -610,4 +615,17 @@ + + TitleBarMenu + + + About + + + + + Exit + + + diff --git a/translations/spark-store_zh_CN.ts b/translations/spark-store_zh_CN.ts index 8c5c406..fe8b89e 100644 --- a/translations/spark-store_zh_CN.ts +++ b/translations/spark-store_zh_CN.ts @@ -131,7 +131,7 @@ <html><head/><body><p>Capable to Ubuntu 22.04</p></body></html> - <html><head/><body><p>支持Ubuntu 22.04</p></body></html> + <html><head/><body><p>支持Ubuntu 22.04</p></body></html> @@ -240,12 +240,12 @@ DAboutDialog - + Version: %1 版本:%1 - + %1 is released under %2 %1遵循%2协议发布 @@ -452,32 +452,32 @@ 更新 - + Submit App 投递应用 - + Submit App with client(Recommanded) 使用本地投稿器投递应用(推荐) - + Settings 设置 - + APP Upgrade and Install Settings 应用更新和安装设置 - + Spark Store 星火应用商店 - + Search or enter spk:// 搜索或打开链接 @@ -485,19 +485,19 @@ QObject - - - + + + Spark Store 星火应用商店 - + <span style=' font-size:10pt;font-weight:60;'>An appstore powered by community</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style=' font-size:12pt;'>Spark developers</span> <span style=' font-size:10pt;font-weight:60;'>一款由社区提供的应用商店</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style=' font-size:12pt;'>星火计划开发者</span> - + Spark Project 星火计划 @@ -506,6 +506,11 @@ Download list 下载列表 + + + Show MainWindow + 显示主窗口 + SettingsPage @@ -610,4 +615,17 @@ 缓存目录已清空 + + TitleBarMenu + + + About + 关于 + + + + Exit + 退出 + + From 2104b992080f89e50fbb1b9dc1661876d8fba831 Mon Sep 17 00:00:00 2001 From: zinface Date: Mon, 30 Jan 2023 21:54:31 +0800 Subject: [PATCH 08/15] =?UTF-8?q?cmake-patch:=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=A1=A5=E4=B8=81=E7=94=A8=E4=BA=8E=E6=94=AF=E6=8C=81=20debian?= =?UTF-8?q?/changelog=20=E7=89=88=E6=9C=AC=E8=A6=86=E7=9B=96=E6=9E=84?= =?UTF-8?q?=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...zinface-community-cmake-build-system.patch | 196 +++++++++++++++++- 1 file changed, 186 insertions(+), 10 deletions(-) diff --git a/patchs/zinface-community-cmake-build-system.patch b/patchs/zinface-community-cmake-build-system.patch index adc5e3a..8199d77 100644 --- a/patchs/zinface-community-cmake-build-system.patch +++ b/patchs/zinface-community-cmake-build-system.patch @@ -1,7 +1,7 @@ -From 9d1714ec7ceb3748bd151af059389ed10d37e676 Mon Sep 17 00:00:00 2001 +From 5c78aff9b5be86cf3d1874a71f2045b1362e0572 Mon Sep 17 00:00:00 2001 From: zinface Date: Sun, 11 Dec 2022 22:27:23 +0800 -Subject: [PATCH 1/5] =?UTF-8?q?repo:=20=E4=B8=80=E6=AC=A1=E6=80=A7?= +Subject: [PATCH 1/7] =?UTF-8?q?repo:=20=E4=B8=80=E6=AC=A1=E6=80=A7?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=20spark=20=E9=AA=A8=E6=9E=B6=E4=BB=A5?= =?UTF-8?q?=E5=8F=98=E4=B8=BA=20cmake=20=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 @@ -1789,10 +1789,10 @@ index 0000000..0fa070b 2.20.1 -From 1e1cb19995536d74626960ae863bf4c5cd9e3a4b Mon Sep 17 00:00:00 2001 +From 0ba6387230becafa5c91817b036084dd702c47c0 Mon Sep 17 00:00:00 2001 From: zinface Date: Sun, 11 Dec 2022 22:37:26 +0800 -Subject: [PATCH 2/5] =?UTF-8?q?repo:=20=E5=A4=84=E7=90=86=20deb=20?= +Subject: [PATCH 2/7] =?UTF-8?q?repo:=20=E5=A4=84=E7=90=86=20deb=20?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E8=84=9A=E6=9C=AC=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E5=AE=8C=E6=88=90=20cmake=20=E5=8C=96=E6=9E=84?= =?UTF-8?q?=E5=BB=BA?= @@ -1856,10 +1856,10 @@ index 2ab24e7..38ad2d7 100644 2.20.1 -From 4f07b34bc268bc3c49ef1c51c524d50ccbbf6d07 Mon Sep 17 00:00:00 2001 +From bfef40012ff241f50d9448f2d4b787d22b24813a Mon Sep 17 00:00:00 2001 From: zinface Date: Mon, 12 Dec 2022 00:50:01 +0800 -Subject: [PATCH 3/5] =?UTF-8?q?docs:=20=E6=B7=BB=E5=8A=A0=20Spark=20?= +Subject: [PATCH 3/7] =?UTF-8?q?docs:=20=E6=B7=BB=E5=8A=A0=20Spark=20?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=20=E4=B8=8E=20CMake=20=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E9=A2=84=E8=A7=88=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 @@ -2184,10 +2184,10 @@ index 0000000..a807009 2.20.1 -From cb59139fcfd74b530a14f2a987aa38d28d403225 Mon Sep 17 00:00:00 2001 +From f07c4dd69ccbc74dbf44f6417ecbd076ac01b620 Mon Sep 17 00:00:00 2001 From: zinface Date: Thu, 15 Dec 2022 19:59:46 +0800 -Subject: [PATCH 4/5] =?UTF-8?q?repo:=20=E6=9B=B4=E6=96=B0=E7=94=A8?= +Subject: [PATCH 4/7] =?UTF-8?q?repo:=20=E6=9B=B4=E6=96=B0=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=20Qt5=20Svg=20=E4=BE=9D=E8=B5=96=E7=9A=84=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 @@ -2236,10 +2236,10 @@ index b56399f..67e29b6 100644 2.20.1 -From 72e5ca47cef718cdbd4ea45134d574874fb43ba9 Mon Sep 17 00:00:00 2001 +From dbd36f105e69ee736f19fa4d7632e3f12316955c Mon Sep 17 00:00:00 2001 From: zinface Date: Mon, 19 Dec 2022 02:58:17 +0800 -Subject: [PATCH 5/5] =?UTF-8?q?repo:=20=E6=9B=B4=E6=96=B0=E7=94=A8?= +Subject: [PATCH 5/7] =?UTF-8?q?repo:=20=E6=9B=B4=E6=96=B0=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E6=94=AF=E6=8C=81=20BaseWidgetOpacity=20=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E7=B1=BB=E7=9A=84=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 @@ -2282,3 +2282,179 @@ index 14530e1..b5e32d8 100644 -- 2.20.1 + +From 16b723cd1a37c49e9af668f5f97d17a2e383420a Mon Sep 17 00:00:00 2001 +From: zinface +Date: Mon, 30 Jan 2023 20:48:25 +0800 +Subject: [PATCH 6/7] =?UTF-8?q?spark:=20=E5=88=9B=E5=BB=BA=E6=96=B0?= + =?UTF-8?q?=E7=9A=84=E6=A8=A1=E5=9D=97=E7=94=A8=E4=BA=8E=20debian/changelo?= + =?UTF-8?q?g=20=E7=9A=84=E7=89=88=E6=9C=AC=E5=8F=B7=E9=87=8D=E5=86=99?= + =?UTF-8?q?=E8=A7=84=E5=88=99?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +1. SparkDebianChangelogVersion.cmake + 在此文件中提供 spark_debian_changelog_override_version 宏: + 基于指定的 debian/changelog 文件并用于读取最新版本号并覆盖到项目版本 + +@Since: v4.0.0 +--- + CMakeLists.txt | 4 ++ + cmake/SparkDebianChangelogVersion.cmake | 58 +++++++++++++++++++++++++ + 2 files changed, 62 insertions(+) + create mode 100644 cmake/SparkDebianChangelogVersion.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b5e32d8..73221bc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -11,6 +11,10 @@ include(cmake/SparkFindDtkConfig.cmake) # 提供了 target_link_dtk 用 + include(cmake/SparkTranslatorConfig.cmake) # 提供了 qt5 ts转qm 的操作,最终生成 SPARK_QM_TRANSLATIONS 变量用于构建可执行文件时参与编译 + include(cmake/SparkMacrosExtendConfig.cmake) # 使用了 spark_ 宏基于已提供的宏参数自动展开构建可执行目标文件 + include(cmake/SparkInstallMacrosConfig.cmake) # 提供了 spark_install 开头的 macro 宏用于安装 target、file、program、directory、changelog 等内容 ++include(cmake/SparkDebianChangelogVersion.cmake)# 提供了 spark_debian_ 开头的宏进行进行覆盖 PROJECT_VERSION ++ ++# 在开始之前,使用项目中提供的 debian/changelog 进行重写本构建系统的 PROJECT_VERSION ++spark_debian_changelog_override_version(debian/changelog) + + # 资源文件路径 + set(QRC_SOURCES "src/assets/assets.qrc") +diff --git a/cmake/SparkDebianChangelogVersion.cmake b/cmake/SparkDebianChangelogVersion.cmake +new file mode 100644 +index 0000000..9d8bca2 +--- /dev/null ++++ b/cmake/SparkDebianChangelogVersion.cmake +@@ -0,0 +1,58 @@ ++# SparkDebianChangelogVersion ++ ++# 尝试读取 debian/changelog 文件的第一行数据,并查找 ++# spark-store (4.2.2) stable; urgency=medium ++# 将 (version) 信息应用用于 PROJECT_VERSION ++ ++ ++macro(spark_debian_changelog_override_version _CHANGELOG_FILE_PATH) ++ set(CHANGELOG_FILE_PATH ${_CHANGELOG_FILE_PATH}) ++ set(CHANGELOG_FILE_EXISTS FALSE) ++ ++ # 首次判断,如果判断文件不存在,将尽可能的判断文件是存在的 ++ if(NOT EXISTS ${CHANGELOG_FILE_PATH}) ++ ++ # 在 CMake v3.19 起,可以使用 file(REAL_PATH ) 进行获取 path 的绝对路径 ++ if(CMAKE_VERSION GREATER_EQUAL 3.19) ++ file(REAL_PATH ${CHANGELOG_FILE_PATH} CHANGELOG_FILE_ABSOLUTE_PATH) ++ if(EXISTS ${CHANGELOG_FILE_ABSOLUTE_PATH}) ++ set(CHANGELOG_FILE_EXISTS TRUE) ++ set(CHANGELOG_FILE_PATH ${CHANGELOG_FILE_ABSOLUTE_PATH}) ++ endif(EXISTS ${CHANGELOG_FILE_ABSOLUTE_PATH}) ++ endif(CMAKE_VERSION GREATER_EQUAL 3.19) ++ ++ # 第二次判断与处理 使用 file(SIZE) 方式 ++ if(NOT CHANGELOG_FILE_EXISTS) ++ file(SIZE ${CHANGELOG_FILE_PATH} CHANGELOG_FILE_SIZE) ++ if(CHANGELOG_FILE_SIZE GREATER 0) ++ set(CHANGELOG_FILE_EXISTS TRUE) ++ endif(CHANGELOG_FILE_SIZE GREATER 0) ++ endif(NOT CHANGELOG_FILE_EXISTS) ++ ++ # 第三次判断与处理 使用路径拼接方式 ++ if(NOT CHANGELOG_FILE_EXISTS) ++ if(EXISTS ${CMAKE_SOURCE_DIR}/${CHANGELOG_FILE_PATH}) ++ set(CHANGELOG_FILE_PATH ${CMAKE_SOURCE_DIR}/${CHANGELOG_FILE_PATH}) ++ set(CHANGELOG_FILE_EXISTS TRUE) ++ endif(EXISTS ${CMAKE_SOURCE_DIR}/${CHANGELOG_FILE_PATH}) ++ endif(NOT CHANGELOG_FILE_EXISTS) ++ endif(NOT EXISTS ${CHANGELOG_FILE_PATH}) ++ ++ message("> V = ${CHANGELOG_FILE_PATH}") ++ if(CHANGELOG_FILE_EXISTS) ++ file(READ ${CHANGELOG_FILE_PATH} CHANGELOG_CONTENT LIMIT 20) ++ ++ string(FIND ${CHANGELOG_CONTENT} "(" V_PRE) # +1 to V_BEGIN ++ string(FIND ${CHANGELOG_CONTENT} ")" V_END) ++ ++ math(EXPR V_BEGIN "${V_PRE}+1") ++ math(EXPR V_LENGTH "${V_END}-${V_BEGIN}") ++ ++ string(SUBSTRING ${CHANGELOG_CONTENT} ${V_BEGIN} ${V_LENGTH} V) ++ ++ message("> V = ${CHANGELOG_CONTENT}") ++ message("> V = [${V}]") ++ ++ set(PROJECT_VERSION ${V}) ++ endif(CHANGELOG_FILE_EXISTS) ++endmacro(spark_debian_changelog_override_version _CHANGELOG_FILE_PATH) +-- +2.20.1 + + +From b16b02606c94cf3f3b23c8e59facd827b4ef38b6 Mon Sep 17 00:00:00 2001 +From: zinface +Date: Mon, 30 Jan 2023 21:23:15 +0800 +Subject: [PATCH 7/7] =?UTF-8?q?spark:=20=E5=AF=B9=20SparkDebianChangelogVe?= + =?UTF-8?q?rsion.cmake=20=E6=A8=A1=E5=9D=97=E7=9A=84=E6=89=A9=E5=B1=95?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +1. 增加 SPARK_OVERRIDE_VERSION 的文件输出 + 以解决 Makefile 中无法明确多个 deb 包时无法确定最新版本的情况 +--- + Makefile | 15 +++++++++++++-- + cmake/SparkDebianChangelogVersion.cmake | 1 + + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index c673c76..81ca078 100644 +--- a/Makefile ++++ b/Makefile +@@ -8,6 +8,17 @@ SUFFIX=_$(OSID)$(OSRELEASE) + endif + + PROJECT_NAME=spark-store ++PROJECT_VERSION=* ++ ++ifneq ($(wildcard build/SPARK_OVERRIDE_VERSION),) ++SPARK_OVERRIDE_VERSION=`cat build/SPARK_OVERRIDE_VERSION` ++.PHONY: override-version ++override-version: ++ @echo $(SPARK_OVERRIDE_VERSION) ++ @echo "wildcard - good: $(wildcard build/SPARK_OVERRIDE_VERSION)" ++ @echo "wildcard - bad.: $(wildcard build/SPARK_OVERRIDE_VERSIONS)" ++PROJECT_VERSION=$(SPARK_OVERRIDE_VERSION)- ++endif + + all: + mkdir -p build +@@ -44,7 +55,7 @@ debian-build-scripts: + package: release debian-build-scripts + cd build && make package + tree build/_CPack_Packages/Linux/DEB/$(PROJECT_NAME)-* +- dpkg-deb --contents build/$(PROJECT_NAME)_*$(CALENDAR)*$(SUFFIX).deb ++ dpkg-deb --contents build/$(PROJECT_NAME)_$(PROJECT_VERSION)$(CALENDAR)*$(SUFFIX).deb + # cd build/_CPack_Packages/Linux/DEB/$(PROJECT_NAME)_*$(CALENDAR)*$(SUFFIX).deb && find . + + builddeps: +@@ -54,7 +65,7 @@ cpus: + @echo "CPU数量: $(CPUS)" + + copytosource:package +- cp build/$(PROJECT_NAME)_*$(CALENDAR)*.deb . ++ cp build/$(PROJECT_NAME)_$(PROJECT_VERSION)$(CALENDAR)*.deb . + + # 进入 qdebug 模式,在 deepin 中默认被禁用,可 env | grep QT 查看,并在 /etc/X11/Xsession.d/00deepin-dde-env 配置中已定义 + # 1. 禁止 qt 的 debug 打印: qt.*.debug=false +diff --git a/cmake/SparkDebianChangelogVersion.cmake b/cmake/SparkDebianChangelogVersion.cmake +index 9d8bca2..65e1c16 100644 +--- a/cmake/SparkDebianChangelogVersion.cmake ++++ b/cmake/SparkDebianChangelogVersion.cmake +@@ -54,5 +54,6 @@ macro(spark_debian_changelog_override_version _CHANGELOG_FILE_PATH) + message("> V = [${V}]") + + set(PROJECT_VERSION ${V}) ++ file(WRITE ${CMAKE_BINARY_DIR}/SPARK_OVERRIDE_VERSION ${V}) + endif(CHANGELOG_FILE_EXISTS) + endmacro(spark_debian_changelog_override_version _CHANGELOG_FILE_PATH) +-- +2.20.1 + From 24519e6560e1b6dfd1c84d559185bbe22c9d728c Mon Sep 17 00:00:00 2001 From: zinface Date: Mon, 30 Jan 2023 22:05:08 +0800 Subject: [PATCH 09/15] =?UTF-8?q?patchs-doc:=20=E5=A2=9E=E5=8A=A0=E8=A1=A5?= =?UTF-8?q?=E4=B8=81=E6=93=8D=E4=BD=9C=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patchs/README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 patchs/README.md diff --git a/patchs/README.md b/patchs/README.md new file mode 100644 index 0000000..7195060 --- /dev/null +++ b/patchs/README.md @@ -0,0 +1,30 @@ +# 补丁操作说明 + +- 克隆与构建本项目 + + > 用于 zinface-community-cmake-build-system.patch 补丁化构建方式 + + ```shell + git clone https://gitee.com/deepin-community-store/spark-store + cd spark-store + git am < patchs/zinface-community-cmake-build-system.patch + make package + sudo dpkg -i build/*.deb + ``` + + +- 在应用补丁时,并对补丁进行的更新操作 + + ```shell + # 切换到一个新的分支,即可开始进行补丁内的更新提交 + git checkout -b cmake-build-system + + # origin/dev 表示本仓库的 dev 开发分支 + # 在应用过补丁,并产生了新的提交,即可在当前所在补丁更新分支内 + # 相对基于 origin/dev 为参考,目前所包含的所有最新提交内容将生成为一个补丁文件(其中尾部为增量更新) + git format-patch --stdout origin/dev > patchs/zinface-community-cmake-build-system.patch + + # 最后,回到你的原 dev 分支,将被改变的补丁文件进行提交 + # 在推送完成后,即可放弃你在 cmake-build-system 分支中所有产生的内容(因为都已经进入补丁) + ``` + From 7a16b5c52f68e62186108b0e264f572baf8d4d70 Mon Sep 17 00:00:00 2001 From: zinface Date: Mon, 30 Jan 2023 22:21:19 +0800 Subject: [PATCH 10/15] =?UTF-8?q?patchs-doc:=20=E8=A1=A5=E5=85=85=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E6=B3=A8=E6=84=8F=E4=BA=8B=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patchs/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/patchs/README.md b/patchs/README.md index 7195060..2020a5c 100644 --- a/patchs/README.md +++ b/patchs/README.md @@ -28,3 +28,17 @@ # 在推送完成后,即可放弃你在 cmake-build-system 分支中所有产生的内容(因为都已经进入补丁) ``` +- 一些注意事项 + + ```shell + # 在不了解补丁时,你需要认识一下补丁,但补丁与补丁之间有着不同的用法 + # 本 patchs/zinface-community-cmake-build-system.patch 补丁为 cmake 化构建 + + # 关于补丁的一些方面 + # 1. 首先你需要了解 git 是什么,以及简单的使用 + # 2. 你需要了解补丁是什么,以及简单的使用(应用补丁) + # 3. 你需要了解如何创建一个补丁,最基本的就是相对于旧目标分支,将本分区新增的提交进行导出为补丁 + # 4. 你可能只会将单个提交、或多个提交导出为补丁,但这还不够,你需要具有绝对的对于补丁的理解 + # 5. 对于不同的目的补丁,应该是多个 patch 文件存在的形式 + # 6. 最后,不管在什么时候,你在应用补丁前,你应该考虑是否应用到当前分支?为什么不切换到一个新的分支呢? + ``` From 9420959023ed66d66679fbc8299ad655f43d10e1 Mon Sep 17 00:00:00 2001 From: zinface Date: Mon, 30 Jan 2023 23:24:44 +0800 Subject: [PATCH 11/15] =?UTF-8?q?cmake-patch:=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=A1=A5=E4=B8=81=E7=94=A8=E4=BA=8E=E5=A4=84=E7=90=86=20v4.2.2?= =?UTF-8?q?=20=E6=97=B6=E6=9C=9F=E7=9A=84=E5=8F=98=E5=8A=A8=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=8F=98=E5=8A=A8=E4=B8=8E=E5=85=B6=E5=AE=83=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. v4.2.2 时期的新增的安装文件 2. Makefile 的默认触发的目标异常 3. 以及 SPARK_QM_TRANSLATIONS 文件输出的部分 其与 SPARK_OVERRIDE_VERSION 的文件输出相同 --- ...zinface-community-cmake-build-system.patch | 166 ++++++++++++++++-- 1 file changed, 151 insertions(+), 15 deletions(-) diff --git a/patchs/zinface-community-cmake-build-system.patch b/patchs/zinface-community-cmake-build-system.patch index 8199d77..a6e235e 100644 --- a/patchs/zinface-community-cmake-build-system.patch +++ b/patchs/zinface-community-cmake-build-system.patch @@ -1,7 +1,7 @@ -From 5c78aff9b5be86cf3d1874a71f2045b1362e0572 Mon Sep 17 00:00:00 2001 +From abbfbf12c1ea9853039e6864d0ede91973189ce6 Mon Sep 17 00:00:00 2001 From: zinface Date: Sun, 11 Dec 2022 22:27:23 +0800 -Subject: [PATCH 1/7] =?UTF-8?q?repo:=20=E4=B8=80=E6=AC=A1=E6=80=A7?= +Subject: [PATCH 01/10] =?UTF-8?q?repo:=20=E4=B8=80=E6=AC=A1=E6=80=A7?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=20spark=20=E9=AA=A8=E6=9E=B6=E4=BB=A5?= =?UTF-8?q?=E5=8F=98=E4=B8=BA=20cmake=20=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 @@ -1789,10 +1789,10 @@ index 0000000..0fa070b 2.20.1 -From 0ba6387230becafa5c91817b036084dd702c47c0 Mon Sep 17 00:00:00 2001 +From d1974334ce60291894b53f6839b78f3147aaa233 Mon Sep 17 00:00:00 2001 From: zinface Date: Sun, 11 Dec 2022 22:37:26 +0800 -Subject: [PATCH 2/7] =?UTF-8?q?repo:=20=E5=A4=84=E7=90=86=20deb=20?= +Subject: [PATCH 02/10] =?UTF-8?q?repo:=20=E5=A4=84=E7=90=86=20deb=20?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E8=84=9A=E6=9C=AC=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E5=AE=8C=E6=88=90=20cmake=20=E5=8C=96=E6=9E=84?= =?UTF-8?q?=E5=BB=BA?= @@ -1856,10 +1856,10 @@ index 2ab24e7..38ad2d7 100644 2.20.1 -From bfef40012ff241f50d9448f2d4b787d22b24813a Mon Sep 17 00:00:00 2001 +From 5a978c7db6c34d7dcd4aa56d94605e51245004a5 Mon Sep 17 00:00:00 2001 From: zinface Date: Mon, 12 Dec 2022 00:50:01 +0800 -Subject: [PATCH 3/7] =?UTF-8?q?docs:=20=E6=B7=BB=E5=8A=A0=20Spark=20?= +Subject: [PATCH 03/10] =?UTF-8?q?docs:=20=E6=B7=BB=E5=8A=A0=20Spark=20?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=20=E4=B8=8E=20CMake=20=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E9=A2=84=E8=A7=88=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 @@ -2184,10 +2184,10 @@ index 0000000..a807009 2.20.1 -From f07c4dd69ccbc74dbf44f6417ecbd076ac01b620 Mon Sep 17 00:00:00 2001 +From 4b5b4bc91a42cc860efbe1728f2dba9f255ea954 Mon Sep 17 00:00:00 2001 From: zinface Date: Thu, 15 Dec 2022 19:59:46 +0800 -Subject: [PATCH 4/7] =?UTF-8?q?repo:=20=E6=9B=B4=E6=96=B0=E7=94=A8?= +Subject: [PATCH 04/10] =?UTF-8?q?repo:=20=E6=9B=B4=E6=96=B0=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=20Qt5=20Svg=20=E4=BE=9D=E8=B5=96=E7=9A=84=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 @@ -2236,10 +2236,10 @@ index b56399f..67e29b6 100644 2.20.1 -From dbd36f105e69ee736f19fa4d7632e3f12316955c Mon Sep 17 00:00:00 2001 +From ede820a7267afa113a2d8b4f93f45fa6c1b4b23b Mon Sep 17 00:00:00 2001 From: zinface Date: Mon, 19 Dec 2022 02:58:17 +0800 -Subject: [PATCH 5/7] =?UTF-8?q?repo:=20=E6=9B=B4=E6=96=B0=E7=94=A8?= +Subject: [PATCH 05/10] =?UTF-8?q?repo:=20=E6=9B=B4=E6=96=B0=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E6=94=AF=E6=8C=81=20BaseWidgetOpacity=20=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E7=B1=BB=E7=9A=84=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 @@ -2283,10 +2283,10 @@ index 14530e1..b5e32d8 100644 2.20.1 -From 16b723cd1a37c49e9af668f5f97d17a2e383420a Mon Sep 17 00:00:00 2001 +From b63790722efa275977b2033a1beeb21b730c1895 Mon Sep 17 00:00:00 2001 From: zinface Date: Mon, 30 Jan 2023 20:48:25 +0800 -Subject: [PATCH 6/7] =?UTF-8?q?spark:=20=E5=88=9B=E5=BB=BA=E6=96=B0?= +Subject: [PATCH 06/10] =?UTF-8?q?spark:=20=E5=88=9B=E5=BB=BA=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E5=9D=97=E7=94=A8=E4=BA=8E=20debian/changelo?= =?UTF-8?q?g=20=E7=9A=84=E7=89=88=E6=9C=AC=E5=8F=B7=E9=87=8D=E5=86=99?= =?UTF-8?q?=E8=A7=84=E5=88=99?= @@ -2388,11 +2388,11 @@ index 0000000..9d8bca2 2.20.1 -From b16b02606c94cf3f3b23c8e59facd827b4ef38b6 Mon Sep 17 00:00:00 2001 +From cca243c18b125a0e24a08c06a358ee04f0861884 Mon Sep 17 00:00:00 2001 From: zinface Date: Mon, 30 Jan 2023 21:23:15 +0800 -Subject: [PATCH 7/7] =?UTF-8?q?spark:=20=E5=AF=B9=20SparkDebianChangelogVe?= - =?UTF-8?q?rsion.cmake=20=E6=A8=A1=E5=9D=97=E7=9A=84=E6=89=A9=E5=B1=95?= +Subject: [PATCH 07/10] =?UTF-8?q?spark:=20=E5=AF=B9=20SparkDebianChangelog?= + =?UTF-8?q?Version.cmake=20=E6=A8=A1=E5=9D=97=E7=9A=84=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -2458,3 +2458,139 @@ index 9d8bca2..65e1c16 100644 -- 2.20.1 + +From f3595a55f567fc01a5928fea8e4b89f99cf8793e Mon Sep 17 00:00:00 2001 +From: zinface +Date: Mon, 30 Jan 2023 23:17:24 +0800 +Subject: [PATCH 08/10] =?UTF-8?q?repo:=20=E5=A4=84=E7=90=86=20v4.2.2=20?= + =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=97=B6=E6=9C=9F=E6=96=B0=E5=A2=9E=E7=9A=84?= + =?UTF-8?q?=E5=AE=89=E8=A3=85=E6=96=87=E4=BB=B6?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +pkg/usr/share/ssinstall/transhell + -> /usr/share/ssinstall +--- + CMakeLists.txt | 5 +++++ + cmake/SparkInstallMacrosConfig.cmake | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 73221bc..22a788d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -86,6 +86,11 @@ spark_install_file(/usr/share/icons/hicolor/scalable/apps + spark_install_program(/tmp/spark-store-install + pkg/tmp/spark-store-install/feedback.sh) + ++# 安装什么翻译? Since: v4.2.2 ++spark_install_directory(/usr/share/ssinstall ++ pkg/usr/share/ssinstall/transhell ++) ++ + # 安装 qm 文件? + spark_install_file(/usr/share/spark-store/translations + ${SPARK_QM_TRANSLATIONS}) +diff --git a/cmake/SparkInstallMacrosConfig.cmake b/cmake/SparkInstallMacrosConfig.cmake +index bbb958a..c7ea53b 100644 +--- a/cmake/SparkInstallMacrosConfig.cmake ++++ b/cmake/SparkInstallMacrosConfig.cmake +@@ -79,7 +79,7 @@ macro(spark_install_directory INSTALL_DIRECTORY_DIR INSTALL_DIRECOTRY) + # message(FATAL_ERROR " directory: ${INSTALL_DIRECTORY_FIND_INDEX_SUBSTRING_FILE_GLOB_LIST_LENGTH}") + + else() +- message(FATAL_ERROR "install: ${INSTALL_DIRECTORY_DIR}") ++ # message(FATAL_ERROR "install: ${INSTALL_DIRECTORY_DIR}") + + install(DIRECTORY + ${INSTALL_DIRECOTRY} ${ARGN} +-- +2.20.1 + + +From da9ef6f95ea7be97595b1e3285ac8e98a34c8c0a Mon Sep 17 00:00:00 2001 +From: zinface +Date: Mon, 30 Jan 2023 23:18:44 +0800 +Subject: [PATCH 09/10] =?UTF-8?q?spark:=20=E5=AF=B9=20SparkTranslatorConfi?= + =?UTF-8?q?g.cmake=20=E6=A8=A1=E5=9D=97=E7=9A=84=E6=89=A9=E5=B1=95?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +1. 增加 SPARK_QM_TRANSLATIONS 的文件输出 + 无任何其它变动 +--- + cmake/SparkTranslatorConfig.cmake | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/cmake/SparkTranslatorConfig.cmake b/cmake/SparkTranslatorConfig.cmake +index 272dd9d..689e70d 100644 +--- a/cmake/SparkTranslatorConfig.cmake ++++ b/cmake/SparkTranslatorConfig.cmake +@@ -12,6 +12,11 @@ endforeach(item IN LISTS SPARK_TRANSLATIONS) + qt5_add_translation(SPARK_QM_TRANSLATIONS + ${SPARK_TRANSLATIONS}) + ++file(WRITE ${CMAKE_BINARY_DIR}/SPARK_QM_TRANSLATIONS "") ++foreach(item IN LISTS SPARK_QM_TRANSLATIONS) ++ file(APPEND ${CMAKE_BINARY_DIR}/SPARK_QM_TRANSLATIONS "${item}\n") ++endforeach(item IN LISTS SPARK_QM_TRANSLATIONS) ++ + message("translator(ts -> qm):") + foreach(item IN LISTS SPARK_QM_TRANSLATIONS) + message("-> ${item}") +-- +2.20.1 + + +From 22eea0e930a073cac8e6dd750b6389044668dcd6 Mon Sep 17 00:00:00 2001 +From: zinface +Date: Mon, 30 Jan 2023 23:20:12 +0800 +Subject: [PATCH 10/10] =?UTF-8?q?make:=20=E5=A4=84=E7=90=86=E9=BB=98?= + =?UTF-8?q?=E8=AE=A4=20make=20=E7=9B=AE=E6=A0=87=E4=B8=BA=20override-versi?= + =?UTF-8?q?on=20=E7=9A=84=E9=97=AE=E9=A2=98?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + Makefile | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +diff --git a/Makefile b/Makefile +index 81ca078..076502c 100644 +--- a/Makefile ++++ b/Makefile +@@ -12,11 +12,6 @@ PROJECT_VERSION=* + + ifneq ($(wildcard build/SPARK_OVERRIDE_VERSION),) + SPARK_OVERRIDE_VERSION=`cat build/SPARK_OVERRIDE_VERSION` +-.PHONY: override-version +-override-version: +- @echo $(SPARK_OVERRIDE_VERSION) +- @echo "wildcard - good: $(wildcard build/SPARK_OVERRIDE_VERSION)" +- @echo "wildcard - bad.: $(wildcard build/SPARK_OVERRIDE_VERSIONS)" + PROJECT_VERSION=$(SPARK_OVERRIDE_VERSION)- + endif + +@@ -82,4 +77,13 @@ copytosource:package + enter-qdebug-mode: + # 进入新的 bash 环境 + @# export QT_LOGGING_RULES=".debug=true; qt.*.debug=false; dtk.*.debug=false; dde.*.debug=false; qtc*=false; " && bash +- export QT_LOGGING_RULES=".debug=true" && bash +\ No newline at end of file ++ export QT_LOGGING_RULES=".debug=true" && bash ++ ++ ++ifneq ($(wildcard build/SPARK_OVERRIDE_VERSION),) ++.PHONY: override-version ++override-version: ++ @echo $(SPARK_OVERRIDE_VERSION) ++ @echo "wildcard - good: $(wildcard build/SPARK_OVERRIDE_VERSION)" ++ @echo "wildcard - bad.: $(wildcard build/SPARK_OVERRIDE_VERSIONS)" ++endif +\ No newline at end of file +-- +2.20.1 + From 35bc1efbad959ff175a6bbd8bd45e47e6d71c3d1 Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 31 Jan 2023 02:33:59 +0000 Subject: [PATCH 12/15] =?UTF-8?q?=E8=BD=ACoyo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shenmo --- tool/apt-fast-conf/apt-fast.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/apt-fast-conf/apt-fast.conf b/tool/apt-fast-conf/apt-fast.conf index bb4637e..ffac077 100644 --- a/tool/apt-fast-conf/apt-fast.conf +++ b/tool/apt-fast-conf/apt-fast.conf @@ -23,7 +23,7 @@ _APTMGR=apt-get fi if [ -x "$(command -v oyo)" ]; then -_APTMGR=apt-get +_APTMGR=oyo fi #### From e69eaa62964b74e352aa4e911e53c30b7ce39592 Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 31 Jan 2023 02:50:11 +0000 Subject: [PATCH 13/15] update tool/apt-fast-conf/apt-fast.conf. Signed-off-by: shenmo --- tool/apt-fast-conf/apt-fast.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/apt-fast-conf/apt-fast.conf b/tool/apt-fast-conf/apt-fast.conf index ffac077..328a7e2 100644 --- a/tool/apt-fast-conf/apt-fast.conf +++ b/tool/apt-fast-conf/apt-fast.conf @@ -23,7 +23,7 @@ _APTMGR=apt-get fi if [ -x "$(command -v oyo)" ]; then -_APTMGR=oyo +_APTMGR=/usr/bin/apt fi #### From 9275074e1076d7505f7bdb066037cd85326eb8c2 Mon Sep 17 00:00:00 2001 From: zty199 <46324746+zty199@users.noreply.github.com> Date: Tue, 31 Jan 2023 12:12:04 +0800 Subject: [PATCH 14/15] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E5=85=B3=E9=97=AD=E5=90=8E=E5=8F=B0=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E8=B0=83=E7=94=A8=20spk=20=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E4=B8=8D=E4=BC=9A=E8=87=AA=E5=8A=A8=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 链接调用时仅执行了窗口 activateWindow() 操作,在窗口隐藏时无效 Log: 添加 setWindowState(Qt::WindowActive) 操作和 show() 操作 --- src/mainwindow-dtk.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mainwindow-dtk.cpp b/src/mainwindow-dtk.cpp index 33cbe15..f8ab730 100644 --- a/src/mainwindow-dtk.cpp +++ b/src/mainwindow-dtk.cpp @@ -61,7 +61,13 @@ void MainWindow::onGetUrl(const QString &url) { openUrl(url); } + + showWindowAnimation = false; + closeWindowAnimation = false; + + setWindowState(windowState() & Qt::WindowActive); activateWindow(); + show(); } void MainWindow::onNewProcessInstance(qint64 pid, const QStringList &arguments) @@ -227,7 +233,7 @@ void MainWindow::initTrayIcon() showWindowAnimation = false; closeWindowAnimation = false; - setWindowState(Qt::WindowActive); + setWindowState(windowState() & Qt::WindowActive); activateWindow(); show(); }); connect(aboutAction, &QAction::triggered, this, [=]() @@ -357,7 +363,7 @@ void MainWindow::initConnections() showWindowAnimation = false; closeWindowAnimation = false; - setWindowState(Qt::WindowActive); + setWindowState(windowState() & Qt::WindowActive); activateWindow(); show(); From 17c152ce8b4d22ded471a722332446fb0c2953c9 Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 31 Jan 2023 04:30:03 +0000 Subject: [PATCH 15/15] update debian/changelog. Signed-off-by: shenmo --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index c4886c7..5d674d0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ spark-store (4.2.2) stable; urgency=medium * 调整:脚本应用的transhell支持转为source导入 * 修复:ssinstall弹窗支持wayland + * 新增:应用托盘,下载时候可以放心关闭窗口了 + * 新增:支持spk://search/内容 格式链接 --shenmo Fri, 30 Jan 2022 00:00:00 +0800