From dfce4278910141d6ac78ccfbb2c6ab5748413e49 Mon Sep 17 00:00:00 2001 From: uniartisan Date: Thu, 21 Sep 2023 19:55:28 +0800 Subject: [PATCH 01/23] =?UTF-8?q?enhance:=20=E6=9B=B4=E8=AF=A6=E7=BB=86?= =?UTF-8?q?=E7=9A=84=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.cpp | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 541e3ab..a9f3f39 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -27,6 +28,21 @@ DWIDGET_USE_NAMESPACE static QString buildDateTime; +void gatherInfo(FILE *fp, std::ofstream& logFile, const char* description) { + if (fp) { + char buffer[512]; + logFile << description << ":\n"; + while (fgets(buffer, sizeof(buffer), fp) != NULL) { + buffer[strcspn(buffer, "\n")] = 0; + logFile << buffer << "\n"; + } + pclose(fp); + } else { + logFile << "Failed to gather " << description << " info.\n"; + } +} + + void crashHandler(int sig) { void *array[50]; size_t size = backtrace(array, 50); @@ -42,40 +58,24 @@ void crashHandler(int sig) { tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); std::ofstream logFile(filename, std::ios::out); + if (!logFile.is_open()) { perror("ofstream"); exit(1); } logFile << "Please send this log to the developer. QQ Group: 872690351\n"; + logFile << "Gitee: https://gitee.com/deepin-community-store/spark-store/issues\n"; + logFile << "Gihub: https://github.com/spark-store-project/spark-store/issues\n"; logFile << "Build Date and Time: " << buildDateTime.toStdString() << "\n"; + gatherInfo(popen("cat ~/.config/spark-union/spark-store/config.ini", "r"), logFile, "User Config File"); - FILE *fp = popen("uname -m", "r"); - if (fp) { - char buffer[256]; - if (fgets(buffer, sizeof(buffer), fp) != NULL) { - // 移除换行符 - buffer[strcspn(buffer, "\n")] = 0; - logFile << "CPU Architecture: " << buffer << "\n"; - } - pclose(fp); - } else { - logFile << "Failed to gather CPU architecture info.\n"; - } - - - - - FILE *fp2 = popen("lsb_release -a", "r"); - if (fp2) { - char buffer[256]; - while (fgets(buffer, sizeof(buffer), fp2) != NULL) { - logFile << buffer; - } - pclose(fp2); - } else { - logFile << "Failed to gather distribution info.\n"; - } + // Collecting System Information + gatherInfo(popen("uname -m", "r"), logFile, "CPU Architecture"); + gatherInfo(popen("lsb_release -a", "r"), logFile, "Distribution info"); + gatherInfo(popen("LANG=C lscpu", "r"), logFile, "All CPU Info"); + gatherInfo(popen("free -h | grep Mem | awk '{print $2}'", "r"), logFile, "Memory Size"); + logFile << "Error: signal " << sig << ":\n"; From 5ceb8d78cb735aa170fea915c178e543b0c14091 Mon Sep 17 00:00:00 2001 From: uniartisan Date: Thu, 21 Sep 2023 19:59:47 +0800 Subject: [PATCH 02/23] =?UTF-8?q?fixup!=20enhance:=20=E6=9B=B4=E8=AF=A6?= =?UTF-8?q?=E7=BB=86=E7=9A=84=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a9f3f39..41fdd94 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -69,12 +69,12 @@ void crashHandler(int sig) { logFile << "Gihub: https://github.com/spark-store-project/spark-store/issues\n"; logFile << "Build Date and Time: " << buildDateTime.toStdString() << "\n"; gatherInfo(popen("cat ~/.config/spark-union/spark-store/config.ini", "r"), logFile, "User Config File"); - + // Collecting System Information - gatherInfo(popen("uname -m", "r"), logFile, "CPU Architecture"); - gatherInfo(popen("lsb_release -a", "r"), logFile, "Distribution info"); - gatherInfo(popen("LANG=C lscpu", "r"), logFile, "All CPU Info"); - gatherInfo(popen("free -h | grep Mem | awk '{print $2}'", "r"), logFile, "Memory Size"); + gatherInfo(popen("LANG=en_US.UTF-8 uname -m", "r"), logFile, "CPU Architecture"); + gatherInfo(popen("LANG=en_US.UTF-8 lsb_release -a", "r"), logFile, "Distribution info"); + gatherInfo(popen("LANG=en_US.UTF-8 lscpu", "r"), logFile, "All CPU Info"); + gatherInfo(popen("LANG=en_US.UTF-8 free -h | grep Mem | awk '{print $2}'", "r"), logFile, "Memory Size"); From 985e7d829e0bfa4510de86347ac3f508f8d6dbec Mon Sep 17 00:00:00 2001 From: uniartisan Date: Thu, 21 Sep 2023 20:14:16 +0800 Subject: [PATCH 03/23] =?UTF-8?q?enhance:=20=E6=9B=B4=E6=96=B0=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 72 +++++++++++++++++++++++++++++++++++++++- README.zh.md | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 165 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1cf9391..d95c681 100644 --- a/README.md +++ b/README.md @@ -80,4 +80,74 @@ https://www.deepinos.org/ #### QQ Group -https://blog.shenmo.tech/post/%E6%95%85%E9%9A%9C%E5%85%AC%E5%91%8A/ \ No newline at end of file +https://blog.shenmo.tech/post/%E6%95%85%E9%9A%9C%E5%85%AC%E5%91%8A/ + + +## FAQ +### Spark Application Store FAQ and Support Guide + +#### Introduction +The Spark Application Store is an application store for Linux users, supporting various Linux distributions. Here are some common questions and solutions. Please note that this document is primarily aimed at ordinary users who are not familiar with Linux and the APT software package management system. + +--- + +#### Communication and Feedback +**Q: Where can I join the communication group?** +**A:** You can click [here](https://www.deepinos.org/) to access the main communication platform for the Spark Store. +> ⚠️ If the above link is not accessible, you can also join our QQ groups as an alternative, with group numbers 872690351 and 865927727. We also provide a forum as a communication platform. + +#### Differences Between arm64 and amd64 +**arm64** +- Full name: Advanced RISC Machine 64-bit +- Main usage: Primarily used in mobile devices, embedded systems, and some new servers and desktop computers. +- Advantages: Low power consumption, high efficiency, suitable for battery-driven and thermally sensitive devices. +- Main manufacturers: Apple, Qualcomm, Hisilicon, Feiteng, and more. + +**amd64** +- Full name: AMD 64-bit, also known as x86_64 +- Main usage: Mainly used in desktop computers, laptops, and servers. +- Advantages: High performance, suitable for compute-intensive applications. +- Main manufacturers: Intel and AMD. + +The most significant differences between them lie in instruction sets and application scenarios. amd64 is typically used in computers and servers with high-performance requirements, while arm64 is more suitable for scenarios with stricter power consumption requirements. + +To check your Linux system's processor architecture, you can follow these steps: +1. Open a terminal. +2. Enter `uname -m` or `arch` and press Enter. +3. You will see your processor architecture (possibly x86_64, aarch64, etc.). + +#### Domestic Architecture Support +**Q: I have a domestic architecture. How can I get applications?** +**A:** Currently, the Spark Store supports domestic chips with the **arm** architecture. You can download deb packages (software installation packages) for the arm64 architecture. +> ⚠️ Please note that this is experimental support. If you encounter issues, please provide feedback on the Spark communication platform, QQ groups, or the forum. + +#### Dependency Installation Issues +**Q: I encountered an error while installing dependencies** +**A:** If you are using UOS or Deepin, please do not install dependency packages. For Kali Linux/Kdeneon, etc., which are temporarily not supported, you need to compile and install them yourself. +> 💡 When an error occurs, try running `sudo apt update` before attempting to install. If the problem persists, refer to the first question and seek help on the communication platform. + +#### Submissions and Application Updates +**Q: Where can I submit applications?** +**A:** You can find the "Submit Application" option in the top-right menu of the app store interface. + +#### Support for Non-deepin/UOS Users +**Q: I am not a deepin/UOS user. Can I use the Spark Application Store?** +**A:** Yes, you can. If you are using Ubuntu 22.04, you can install it directly. For Ubuntu 20.04/Debian10/Debian11, please install the dependency packages first. + +#### Installation Methods +**Q: Can I install with dpkg -i?** +**A:** No! Use `sudo apt install ./xxxx.deb` to install, or use graphical installers like gdebi. +> ⚠️ Using dpkg directly will not handle software dependencies, and this is a common mistake. + +#### System Updates +**Q: Will the Spark Store affect normal system updates?** +**A:** No, the Spark Store separates application sources from system sources and will not affect regular system updates. + +#### Reporting Issues and Application Removal +**Q: Some applications are outdated or no longer working, and I want them removed** +**A:** You can report issues [here](https://gitee.com/deepin-community-store/software_-issue). + +#### Installing the Spark Application Store +If you want to install the Spark Application Store, please open the [Release page](https://gitee.com/deepin-community-store/spark-store/releases), find the latest version, and choose the installation package suitable for your current system. + +> ⚠️ Special Note: If you are using Debian 10/Debian 11 or Ubuntu 20.04, you may need to download additional dependency supplement packages. After downloading the dependency packages, unzip multiple times until you see the software usage instructions inside. For operating system versions after Ubuntu 22.04, you do not need to install dependency packages. Follow the above instructions to directly install the main program. \ No newline at end of file diff --git a/README.zh.md b/README.zh.md index 58c13f5..3fadaea 100644 --- a/README.zh.md +++ b/README.zh.md @@ -80,3 +80,97 @@ https://www.deepinos.org/ #### QQ群: https://blog.shenmo.tech/post/%E6%95%85%E9%9A%9C%E5%85%AC%E5%91%8A/ + + +## FAQ +### 星火应用商店FAQ与支持指南 + +#### 简介 +星火应用商店是一个面向 Linux 用户的应用商店,支持多种不同的 Linux 发行版。以下是一些常见问题及解决方案。请注意,该文档主要面向对 Linux 和 APT 软件包管理系统不熟悉的普通用户。 + +--- + +#### 交流与反馈 +**Q: 在哪进交流群?** +**A:** 你可以点击[这里](https://www.deepinos.org/)进入星火商店的主交流平台。 +> ⚠️ 如果上面的链接无法使用,你还可以加入我们的 QQ 群作为备选方案,群号是 872690351 和 865927727。我们还提供论坛作为交流平台。 + +arm64与amd64的区别 + +arm64 + +* 全称: Advanced RISC Machine 64-bit +* 主要用途: 主要应用于移动设备、嵌入式系统以及一些新型的服务器和桌面计算机。 +* 优势: 低功耗、高效率,适合用在电池驱动和热敏感的设备。 +* 主要生产商: 苹果、高通、海思、飞腾等。 + +amd64 + +* 全称: AMD 64-bit, 也被称为 x86_64 +* 主要用途: 主要应用于桌面计算机、笔记本以及服务器。 +* 优势: 高性能,适用于计算密集型应用。 +* 主要生产商: Intel和AMD。 +* 两者最主要的不同在于指令集和应用场景。amd64通常用于高性能需求的计算机和服务器,而arm64则更多应用于功耗要求更严格的场合。 + +查看方法: + +Linux: + +- 打开终端。 +- 输入 uname -m 或 arch 并按回车。 +- 你将看到你的处理器架构(可能是 x86_64, aarch64 等)。 +--- + +#### 国产架构支持 +**Q: 我是国产架构,怎么获取应用?** +**A:** 目前,星火商店支持**arm**架构的国产芯片。你可以下载适用于 arm64 架构的deb包(软件安装包)。 +> ⚠️ 请注意,这是实验性的支持。如果遇到问题,请在星火交流平台、QQ群或论坛向我们反馈。 + +--- + +#### 安装依赖问题 +**Q: 安装依赖包出现错误** +**A:** 如果你使用UOS或deepin,请不要安装依赖包。对于Kali Linux/Kdeneon等,暂时不支持,请自行编译安装。 +> 💡 出现错误时,尝试运行 `sudo apt update` 后再尝试安装。如果问题仍然存在,请参考第一条,进入交流平台寻求帮助。 + +--- + +#### 投稿与应用更新 +**Q: 在哪里投稿?** +**A:** 你可以在应用商店界面的右上角菜单找到“投递应用”的选项。 + +--- + +#### 非deepin/UOS用户支持 +**Q: 我不是deepin/UOS用户,可以使用星火应用商店吗?** +**A:** 可以,如果你是使用 Ubuntu 22.04,请直接安装。对于 Ubuntu 20.04/Debian10/Debian11,请先安装依赖包。 + +--- + +#### 安装方法 +**Q: 我可以用dpkg -i安装吗?** +**A:** 不可以!使用 `sudo apt install ./xxxx.deb` 来安装,或者使用gdebi等图形化的安装器。 +> ⚠️ 直接使用dpkg是不会处理软件依赖的,这是一个常见的错误。 + +--- + +#### 系统更新 +**Q: 星火商店会影响系统正常更新吗?** +**A:** 不会,星火商店已经将应用源与系统源分开,不会影响系统的正常更新。 + +--- + +#### 报告问题和应用下架 +**Q: 有些应用已经过时或者失效了,我想让他下架** +**A:** 你可以前往 [这里](https://gitee.com/deepin-community-store/software_-issue) 报告问题。 + +--- + +#### 安装星火应用商店 +如果你想安装星火应用商店,请打开[Release页面](https://gitee.com/deepin-community-store/spark-store/releases),找到最新版本,并选择适用于当前系统的安装包下载。 + +> ⚠️ 特别提示: 如果你在使用 Debian10/Debian11 或 Ubuntu 20.04,你可能额外下载依赖补充包。您需要在下载完依赖包后,解压多次一直到看到内部的软件使用说明,对于 Ubuntu22.04 以后的操作系统版本,您无需安装依赖包,您需要按照上面的操作直接安装本体程序。 + +--- + + From a7d86d9120a708baa8909d75e26a23d70735e989 Mon Sep 17 00:00:00 2001 From: zty199 <46324746+zty199@users.noreply.github.com> Date: Tue, 10 Oct 2023 16:10:38 +0800 Subject: [PATCH 04/23] =?UTF-8?q?i18n:=20=E6=9B=B4=E6=96=B0=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=96=87=E6=A1=88=E5=8F=8A=E7=BF=BB=E8=AF=91=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改详情页“下载”按钮为“下载并安装”;修正部分文案中错误使用全角标点符号导致翻译文件中无法正常显示;修正部分文案翻译错误;尝试补充 QWebEngineView 右键菜单项翻译 Log: 修改详情页“下载”按钮为“下载并安装”;修正部分文案及翻译;补充 QWebEngineView 部分右键菜单项翻译 --- src/application.cpp | 13 +- src/application.h | 2 + src/assets/assets.qrc | 1 + src/assets/translations/qtwebengine_zh.qm | Bin 0 -> 6244 bytes src/assets/translations/qtwebengine_zh.ts | 305 ++++++++++++++++++++++ src/pages/appintopage.cpp | 6 +- src/pages/appintopage.ui | 2 +- src/spark-store.pro | 1 + src/widgets/common/downloaditem.cpp | 6 +- src/widgets/common/webenginepage.cpp | 27 +- src/widgets/common/webenginepage.h | 3 + src/widgets/common/webengineview.cpp | 2 - translations/spark-store_en.ts | 18 +- translations/spark-store_es.ts | 40 +-- translations/spark-store_fr.ts | 22 +- translations/spark-store_zh_CN.ts | 24 +- translations/spark-store_zh_TW.ts | 24 +- 17 files changed, 412 insertions(+), 84 deletions(-) create mode 100644 src/assets/translations/qtwebengine_zh.qm create mode 100644 src/assets/translations/qtwebengine_zh.ts diff --git a/src/application.cpp b/src/application.cpp index b3e5965..9aeea14 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -93,7 +93,7 @@ void Application::setBuildDateTime(const QString &buildDateTime) qDebug() << "Spark Store has been updated!"; config.setValue("build/version", QString(APP_VERSION)); - config.setValue("build/branch",QString(APP_BRANCH)); + config.setValue("build/branch", QString(APP_BRANCH)); config.setValue("build/time", buildDateTime); config.sync(); } @@ -158,6 +158,17 @@ void Application::initAboutDialog() dialog->hide(); } +void Application::loadTranslator() +{ + DApplication::loadTranslator(); + + if (QLocale::system().language() == QLocale::Chinese) { + QTranslator *webengineTranslator = new QTranslator(this); + webengineTranslator->load(QLocale(QLocale::Chinese), "qtwebengine", "_", ":/translations"); + installTranslator(webengineTranslator); + } +} + #if (DTK_VERSION >= DTK_VERSION_CHECK(5, 6, 4, 0)) /** * @brief Application::initFeatureDisplayDialog 初始化版本特性对话框 diff --git a/src/application.h b/src/application.h index de66a7e..22f6b14 100644 --- a/src/application.h +++ b/src/application.h @@ -30,6 +30,8 @@ private: void initFeatureDisplayDialog(); #endif + void loadTranslator(); + private: QJsonObject m_featuresJsonObj; diff --git a/src/assets/assets.qrc b/src/assets/assets.qrc index ed35fdf..c0548c9 100644 --- a/src/assets/assets.qrc +++ b/src/assets/assets.qrc @@ -62,5 +62,6 @@ tags/uos-authorize.svg tags/uos-small.png tags/uos.svg + translations/qtwebengine_zh.qm diff --git a/src/assets/translations/qtwebengine_zh.qm b/src/assets/translations/qtwebengine_zh.qm new file mode 100644 index 0000000000000000000000000000000000000000..d3c927ba266d9f1658169cc59ef19eaa8d7339a2 GIT binary patch literal 6244 zcmb_gdu&@*8UK>{ZO0*PlawwIXQj!qN>$R8ts{g&>$q)7;`o(hB^AlFeeB%!=3eJM z;<$UkKnzH$w9qQi7=?*+RD;ophcpRQfYvgJX$XM|)94te;~zxTKQ@Fkjg0Tyo7~v# zwQo|9$o}r*e82NM-}4;zyqwwc+gs0`d;Q*)UyeU_`K|o`wOs&*uK>7y0*s z&K__)U&OmELpq-Y=jS8*Uh1R*7?ujKLRw2xOUtMAdl;YbbZp* z-FOwCX3UVT>#p#P#;grvTi4aQ){`_}+Wby>}SL z`~K|y+@(gGch->J_uRwVcH#Y!A$?PxQ~$;J8_#+c1`gsn9yX-^i=G$nTLjqDW@jrb2ERMhF?>~cfg>geVU-h4SFp2hF z^nd?4uFv;;Kr6h4^ItWj@BYBo>K?;&v>MW-1ulos&keT%fA{13^z-#~xY+%Tm3 zSRMc7cEnSH!qhc@&F6y8bZkHO_`uv>Of~lbNiJ}5rmBi(;#awU#6ph~Q?0&FRPr>flCVH0si;<0Kl3_$DgM2= z$4zxtoC*?WGwI-4qmPt_N`jlFYX}t&(=0QNSJ$*PjjqTXY!db9in?>FE-?^yr&D7u zD3>xX(!Hj3Fe&A70ww*Dl;_2qJp!9M{ezN>YFtJz!Yd?+sw@dgRUi+eGJjP;M^%uivK2sQ_NnMm6QE%kAS!Uh&M2oT)nQ!FURFk&?JIR87&A*q6cb)AAvn4$ zB0cRTA!()HgZ4WD%H6&iQC2!z#xKr@qtAT(OT}M|!B`?bu%OMSlFc7}%v|IB`(#Rr zl13D5`J%vyDp4gOP!@LT1h0@hlKu>{zSSHRYNypuPfR&?lTk3I_k{#Wp@dnbBEEI4 zwZva3mL>RQW!6e*%@wwy@*0Y3McuX3RV!sj{8-#=E^|Xj(`%8{$iO;_uN6iMB!EH= zG~hu70@H94L`dVk0Fue#_F8O(RJjaWjb2*?w$j`@(m`LEa6kIQf)?4CN{m5SVca~J z$9AK4KVBpeS|CX-RVe^BGN=>ti5nI`&36Ee@M1P$|KIL%0vtl_z%pp|q;t2Jy~QHX4Q;@aG+Pi`80#GI+wD1|!B{lz?| zC?v$CCo1yPyI!?MYek?14r0(V6K3>pf+iKwSR5LWnpDdBt`&}L%e7K+#3oLA%}IO- zDzL4{K0&Bt-(Ed!1>~64oh%_&!~L3m#X^AH=W&FJR|K!vJ-bqHohcR+=7i156J{kL zLuJ+?wEW6;#*%LI=<(G`??|Xpz7o+j?<1_{(UsS+g|Nb~-#u7qt#9LCh2Y36o+~+c z3}Nl4WTXFgFRzcO=B^|p$;Pf^I~+#uPvb|y*pSixd5jD)n@t|ZnAnM*HrQoGMB`y@ znp4s;pJ!o6WtHqCZM)b4)&o8x&MsPjH%&@O}g$I}mRKb0!60%%dDyNyNKhloSg1Y(~#0X1z&#BI>y%0Ga-Z{I3(Q zjh-KzH7&R|#EGJ$5J&8>4Vb~zqQ1V zrSGDGhG$lNui3L^?s;qpGV{0v*N4{6H808fzT_@A9?&-z0#+~m1sNM|+8I2qkNq%y!sV@7i_|Zko?=DldtL zctw?D{YQlgyn1bY+KYS&$PQaMa?L;=GNc%hR{Xlx=i6SXAhOcmr_xE5?iD!N#~s^N zs=6In9x0aG)){vRs;YSE)K7~Qc-iN22zjwQ;3112)+L$k!uU+qy=-N}o^l&j&*TtR zOFqk|G1bGeEXh@@xZl>({mUM<&yPLp;n + + + + QWebEnginePage + + Cut + 剪切 + + + Back + 后退 + + + Copy + 复制 + + + Redo + 恢复 + + + Stop + 停止 + + + Undo + 撤销 + + + &Back + &后退 + + + Paste + 粘贴 + + + Copy Image URL + 复制图片地址 + + + Open Link in This Window + 在当前窗口中打开链接 + + + Toggle Mute + 切换静音 + + + Inspect Element + 检查元素 + + + Toggle Media Controls + 切换媒体控制 + + + Reload + 重新加载 + + + Copy Link URL + 复制链接地址 + + + Exit Full Screen Mode + 退出全屏模式 + + + Paste and Match Style + Pegar y coincidir estilo + + + Follow Link + Seguir vínculo + + + Open Link in New Tab + 在新标签页中打开链接 + + + Reload and Bypass Cache + 重新加载且绕过缓存 + + + Select folder to upload + Seleccionar una carpeta para subir + + + Save Image + 保存图片 + + + Save Media + 保存媒体 + + + Toggle Looping + 切换循环播放 + + + Close Page + 关闭页面 + + + Toggle Play/Pause + 切换播放/暂停 + + + Copy Image + 复制图片 + + + &Reload + &重新加载 + + + Select All + 全选 + + + Save Link + Guardar enlace + + + Copy Media URL + 复制媒体地址 + + + Forward + 前进 + + + &Forward + &前进 + + + Open Link in New Window + 在新窗口中打开链接 + + + Are you sure you want to leave this page? + 您确定要离开当前页面吗? + + + + QQuickWebEngineView + + Back + 后退 + + + Copy + 复制 + + + Copy Image URL + 复制图片地址 + + + Toggle Mute + 切换静音 + + + Inspect Element + 检查元素 + + + Toggle Media Controls + 切换媒体控制 + + + Reload + 重新加载 + + + Copy Link URL + 复制链接地址 + + + Exit Full Screen Mode + 退出全屏模式 + + + Follow Link + 跳转链接 + + + Save Image + 保存图片 + + + Save Media + 保存媒体 + + + Toggle Looping + 切换循环播放 + + + Toggle Play/Pause + 切换播放/暂停 + + + Copy Image + 复制图片 + + + Save Link + 保存链接 + + + Copy Media URL + 复制媒体地址 + + + Forward + 前进 + + + + QtWebEngineCore + + Javascript Alert - %1 + Javascript 警告 - %1 + + + Javascript Confirm - %1 + Javascript 确认 - %1 + + + Javascript Prompt - %1 + Javascript 提示 - %1 + + + Are you sure you want to leave this page? + 您确定要离开当前页面吗? + + + + QtWebEnginePlugin + + Cannot create a separate instance of WebEngineDownloadItem + 无法创建一个 WebEngineDownloadItem 的独立实例 + + + Cannot create separate instance of WebEngineLoadRequest + 无法创建一个 WebEngineLoadRequest 的独立实例 + + + Cannot create a separate instance of WebEngineSettings + 无法创建一个 WebEngineSettings 的独立实例 + + + Cannot create separate instance of WebEngineNavigationRequest + 无法创建一个 WebEngineNavigationRequest 的独立实例 + + + Cannot create separate instance of WebEngineNewViewRequest + 无法创建一个 WebEngineNewViewRequest 的独立实例 + + + Cannot create separate instance of WebEngineCertificateError + 无法创建一个 WebEngineCertificateError 的独立实例 + + + Cannot create a separate instance of FullScreenRequest + 无法创建一个 FullScreenRequest 的独立实例 + + + Cannot create a separate instance of NavigationHistory + 无法创建一个 NavigationHistory 的独立实例 + + + + QtWebEngineExperimentalPlugin + + Cannot create a separate instance of WebEngineViewExperimental + 无法创建一个 WebEngineViewExperimental 的独立实例 + + + Cannot create a separate instance of WebEngineViewport + 无法创建一个 WebEngineViewport 的独立实例 + + + + UIDelegatesManager + + Enter username and password for "%1" at %2://%3 + 为在 %2://%3 的“%1”输入用户名和密码 + + + Connect to proxy "%1" using: + 使用“%1”连接代理: + + + + QtWebEngineTestSupportPlugin + + Cannot create a separate instance of WebEngineErrorPage + 无法创建一个 WebEngineErrorPage 的独立实例 + + + diff --git a/src/pages/appintopage.cpp b/src/pages/appintopage.cpp index 15e6252..73d8315 100644 --- a/src/pages/appintopage.cpp +++ b/src/pages/appintopage.cpp @@ -172,7 +172,7 @@ void AppIntoPage::openUrl(const QUrl &url) } else { - ui->downloadButton->setText(tr("Download")); + ui->downloadButton->setText(tr("Download and Install")); ui->downloadButton->setEnabled(true); ui->downloadButton->show(); } @@ -310,7 +310,7 @@ void AppIntoPage::isDownloading(const QUrl &url) if (item->download == 2) { ui->downloadButton->setEnabled(true); - ui->downloadButton->setText(tr("Download")); + ui->downloadButton->setText(tr("Download and Install")); } if (item->download == 1) { @@ -480,7 +480,7 @@ void AppIntoPage::on_pushButton_3_clicked() if (check.readAllStandardOutput().isEmpty()) { - ui->downloadButton->setText(tr("Download")); + ui->downloadButton->setText(tr("Download and Install")); ui->pushButton_3->hide(); updatesEnabled(); diff --git a/src/pages/appintopage.ui b/src/pages/appintopage.ui index c3c8024..bb82364 100644 --- a/src/pages/appintopage.ui +++ b/src/pages/appintopage.ui @@ -241,7 +241,7 @@ - Download + Download and Install diff --git a/src/spark-store.pro b/src/spark-store.pro index 33a7429..724cb81 100644 --- a/src/spark-store.pro +++ b/src/spark-store.pro @@ -93,6 +93,7 @@ RESOURCES += \ TRANSLATIONS += \ ../translations/spark-store_en.ts \ + ../translations/spark-store_es.ts \ ../translations/spark-store_fr.ts \ ../translations/spark-store_zh_CN.ts \ ../translations/spark-store_zh_TW.ts diff --git a/src/widgets/common/downloaditem.cpp b/src/widgets/common/downloaditem.cpp index 045647d..f20ecca 100644 --- a/src/widgets/common/downloaditem.cpp +++ b/src/widgets/common/downloaditem.cpp @@ -234,9 +234,9 @@ void DownloadItem::slotAsyncInstall(int t) if (notRoot) { - Utils::sendNotification("spark-store", tr("Spark Store"), tr("dpkg progress had been aborted,please check the install info or try to reinstall.")); - ui->label_2->setText(tr("dpkg progress had been aborted,please check the install info or try to reinstall.")); - ui->label_2->setToolTip(tr("dpkg progress had been aborted,please check the install info or try to reinstall.")); + Utils::sendNotification("spark-store", tr("Spark Store"), tr("dpkg progress had been aborted, please check the install info or try to reinstall.")); + ui->label_2->setText(tr("dpkg progress had been aborted, please check the install info or try to reinstall.")); + ui->label_2->setToolTip(tr("dpkg progress had been aborted, please check the install info or try to reinstall.")); ui->pushButton_install->show(); ui->pushButton_3->hide(); } diff --git a/src/widgets/common/webenginepage.cpp b/src/widgets/common/webenginepage.cpp index f52b336..767caae 100644 --- a/src/widgets/common/webenginepage.cpp +++ b/src/widgets/common/webenginepage.cpp @@ -7,20 +7,7 @@ WebEnginePage::WebEnginePage(QObject *parent) : QWebEnginePage(parent) { - QLocale ql; - switch (ql.language()) - { - case QLocale::Chinese: - { - // 系统语言是中文,获取网页为中文 @momen @uniartisan - QWebEngineProfile *profile = QWebEngineProfile::defaultProfile(); - qDebug() << profile->httpAcceptLanguage(); - profile->setHttpAcceptLanguage("zh-CN,zh;q=0.8,en;q=0.6"); - } - break; - default: - break; - } + initHttpAcceptLanguage(); } WebEnginePage::~WebEnginePage() @@ -47,6 +34,18 @@ QWebEnginePage *WebEnginePage::createWindow(QWebEnginePage::WebWindowType type) return page; } +void WebEnginePage::initHttpAcceptLanguage() +{ + switch (QLocale::system().language()) { + case QLocale::Chinese: { + // 系统语言是中文,获取网页为中文 @momen @uniartisan + profile()->setHttpAcceptLanguage("zh-CN,zh;q=0.8,en;q=0.6"); + } break; + default: + break; + } +} + void WebEnginePage::slotUrlChanged(const QUrl &url) { if (m_currentUrl == url) diff --git a/src/widgets/common/webenginepage.h b/src/widgets/common/webenginepage.h index 6ebfb19..15f0cf3 100644 --- a/src/widgets/common/webenginepage.h +++ b/src/widgets/common/webenginepage.h @@ -16,6 +16,9 @@ public: protected: QWebEnginePage *createWindow(WebWindowType type) override; +private: + void initHttpAcceptLanguage(); + private slots: void slotUrlChanged(const QUrl &url); diff --git a/src/widgets/common/webengineview.cpp b/src/widgets/common/webengineview.cpp index 21eb678..afd500b 100644 --- a/src/widgets/common/webengineview.cpp +++ b/src/widgets/common/webengineview.cpp @@ -1,8 +1,6 @@ #include "webengineview.h" #include "webenginepage.h" -#include - WebEngineView::WebEngineView(QWidget *parent) : QWebEngineView(parent) { diff --git a/translations/spark-store_en.ts b/translations/spark-store_en.ts index d031691..1579777 100644 --- a/translations/spark-store_en.ts +++ b/translations/spark-store_en.ts @@ -8,14 +8,6 @@ Form - - - - - - Download - - Uninstall @@ -132,6 +124,14 @@ Screen capture + + + + + + Download and Install + + @@ -374,7 +374,7 @@ - dpkg progress had been aborted,please check the install info or try to reinstall. + dpkg progress had been aborted, please check the install info or try to reinstall. diff --git a/translations/spark-store_es.ts b/translations/spark-store_es.ts index c4fe5c3..bb740a2 100644 --- a/translations/spark-store_es.ts +++ b/translations/spark-store_es.ts @@ -8,14 +8,6 @@ Form Tipo - - - - - - Download - Descargar - Uninstall @@ -132,6 +124,14 @@ Screen capture Captura de pantalla + + + + + + Download and Install + Descargar e instalar + @@ -268,16 +268,24 @@ DAboutDialog - + Version: %1 Versión %1 - + %1 is released under %2 %1 publicado bajo %2 + + DownloadController + + + Download Failed, please retry :( + Descarga fall, por favor vuelva a intentarlo + + DownloadItem @@ -366,8 +374,8 @@ - dpkg progress had been aborted,please check the install info or try to reinstall. - El proceso dpkg ha sido abortado, verifique la información de instalación o intente reinstalarlo. + dpkg progress had been aborted, please check the install info or try to reinstall. + El proceso de DPKG ha sido interrumpido, compruebe la información de instalación o intente reinstalar. @@ -506,19 +514,19 @@ QObject - - + + Spark Store 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;'>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 Proyecto spark diff --git a/translations/spark-store_fr.ts b/translations/spark-store_fr.ts index 5e574ff..abde11d 100644 --- a/translations/spark-store_fr.ts +++ b/translations/spark-store_fr.ts @@ -8,14 +8,6 @@ Form Type - - - - - - Download - Télécharger - Uninstall @@ -132,6 +124,14 @@ Screen capture Captures d'écran + + + + + + Download and Install + Télécharger et installer + @@ -283,7 +283,7 @@ Download Failed, please retry :( - + Le téléchargement a échoué, veuillez réessayer @@ -374,8 +374,8 @@ - dpkg progress had been aborted,please check the install info or try to reinstall. - Le processus dpkg a été abandonné, vérifiez les informations d'installation ou essayez de le réinstaller. + dpkg progress had been aborted, please check the install info or try to reinstall. + La progression de DPKG a été interrompue, veuillez vérifier les informations d’installation ou essayer de réinstaller. diff --git a/translations/spark-store_zh_CN.ts b/translations/spark-store_zh_CN.ts index 78c024e..7cb6ae0 100644 --- a/translations/spark-store_zh_CN.ts +++ b/translations/spark-store_zh_CN.ts @@ -8,14 +8,6 @@ Form - - - - - - Download - 下载 - Uninstall @@ -127,6 +119,14 @@ Screen capture 屏幕截图 + + + + + + Download and Install + 下载并安装 + @@ -283,7 +283,7 @@ Download Failed, please retry :( - + 下载失败,请重试 @@ -368,14 +368,14 @@ Error happened in dpkg progress , please check the install info or try to reinstall. - 安装被中止,请检查安装详情或尝试重新安装 + 安装出现错误,请检查安装详情或尝试重新安装。 - dpkg progress had been aborted,please check the install info or try to reinstall. - dpkg出现错误,请检查安装详情或尝试重新安装 + dpkg progress had been aborted, please check the install info or try to reinstall. + 安装被中止,请检查安装详情或尝试重新安装。 diff --git a/translations/spark-store_zh_TW.ts b/translations/spark-store_zh_TW.ts index d4f2af1..4aa4b63 100644 --- a/translations/spark-store_zh_TW.ts +++ b/translations/spark-store_zh_TW.ts @@ -8,14 +8,6 @@ Form - - - - - - Download - 下载 - Uninstall @@ -127,6 +119,14 @@ Screen capture 軟體演示 + + + + + + Download and Install + 下載並安裝 + @@ -283,7 +283,7 @@ Download Failed, please retry :( - + 下載失敗,請重試 @@ -368,14 +368,14 @@ Error happened in dpkg progress , please check the install info or try to reinstall. - 安裝被中止,請檢查安裝詳情或嘗試重新安裝 + 安裝出現錯誤,請檢查安裝詳情或嘗試重新安裝。 - dpkg progress had been aborted,please check the install info or try to reinstall. - dpkg出現錯誤,請檢查安裝詳情或嘗試重新安裝 + dpkg progress had been aborted, please check the install info or try to reinstall. + 安裝被中止,請檢查安裝詳情或嘗試重新安裝。 From 74d4cc05d99e4fd3853519541061fd986956a66b Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 10 Oct 2023 08:40:55 +0000 Subject: [PATCH 05/23] update debian/changelog. Signed-off-by: shenmo --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index cb4d444..7725157 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +spark-store (4.2.8) stable; urgency=medium + + * 修复:ssinstall在aptss上锁时应当报错中断(WIP) + * 调整:下载安装按钮文案修改 + + -- shenmo Sun, 5 Mar 2022 11:45:14 +0800 + spark-store (4.2.7.3) stable; urgency=medium * 修复:aptss现在会正确地透传错误码而不是exit 0 From b2fc80215d9454fc5a2ebbeb396964ab440ed96a Mon Sep 17 00:00:00 2001 From: uniartisan Date: Sun, 22 Oct 2023 10:48:36 +0800 Subject: [PATCH 06/23] =?UTF-8?q?enhance:=20=E6=96=87=E6=A1=A3=E6=94=B9?= =?UTF-8?q?=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FAQ.md | 91 ++++++++++++++++++ FAQ.zh.md | 90 ++++++++++++++++++ README.md | 250 ++++++++++++++++++++++++------------------------ README.zh.md | 261 ++++++++++++++++++++++++--------------------------- 4 files changed, 433 insertions(+), 259 deletions(-) create mode 100644 FAQ.md create mode 100644 FAQ.zh.md diff --git a/FAQ.md b/FAQ.md new file mode 100644 index 0000000..3ec114b --- /dev/null +++ b/FAQ.md @@ -0,0 +1,91 @@ +# FAQ +## Spark App Store FAQ and Support Guide + +### Introduction +The Spark App Store is an application store aimed at Linux users and supports multiple Linux distributions. Below are some commonly asked questions and solutions. Please note that this document is primarily intended for ordinary users who are not familiar with Linux and the APT package management system. + +--- + +### Communication and Feedback +**Q: Where can I join the community group?** +**A:** You can click [here](https://www.deepinos.org/) to enter the main communication platform of the Spark Store. +> ⚠️ If the above link doesn't work, you can also join our QQ groups as an alternative. The group numbers are 872690351 and 865927727. We also offer forums for communication. + +#### Differences Between arm64 and amd64 + +arm64 + +* Full Name: Advanced RISC Machine 64-bit +* Main Use: Primarily used in mobile devices, embedded systems, and some new servers and desktop computers. +* Advantages: Low power consumption, high efficiency, suitable for battery-driven and heat-sensitive devices. +* Main Manufacturers: Apple, Qualcomm, HiSilicon, Phytium, etc. + +amd64 + +* Full Name: AMD 64-bit, also known as x86_64 +* Main Use: Primarily used in desktop computers, laptops, and servers. +* Advantages: High performance, suitable for computation-intensive applications. +* Main Manufacturers: Intel and AMD. +* The main differences between the two are in the instruction sets and application scenarios. amd64 is usually used for high-performance computers and servers, while arm64 is more commonly used in power-sensitive settings. + +#### How to Check: + +Linux: + +- Open the terminal. +- Type `uname -m` or `arch` and press Enter. +- You will see your processor architecture (possibly x86_64, aarch64, etc.). + +--- + +### Domestic Architecture Support +**Q: I use a domestic chip architecture, how can I get applications?** +**A:** Currently, Spark Store supports **arm** architecture for domestic chips. You can download deb packages suitable for arm64 architecture. +> ⚠️ Please note that this is experimental support. If you encounter any issues, please provide feedback via Spark's communication platform, QQ group, or forums. + +--- + +### Dependency Issues +**Q: I get errors when installing dependencies** +**A:** If you are using UOS or deepin, please do not install the dependency packages. For Kali Linux/Kdeneon etc., temporary support is not available, please compile and install yourself. +> 💡 If errors occur, try running `sudo apt update` before attempting the installation again. If the issue persists, refer to the first question and seek help on the community platform. + +--- + +### Submission and App Updates +**Q: Where can I submit applications?** +**A:** You can find the "Submit Application" option in the upper-right corner menu of the app store interface. + +--- + +### Support for Non-deepin/UOS Users +**Q: I'm not a deepin/UOS user; can I use the Spark App Store?** +**A:** Yes, you can directly install if you're using Ubuntu 22.04. For Ubuntu 20.04/Debian10/Debian11, please install the dependencies first. + +--- + +### Installation Methods +**Q: Can I use dpkg -i for installation?** +**A:** No! Use `sudo apt install ./xxxx.deb` to install, or use graphical installers like gdebi. +> ⚠️ Using dpkg directly will not handle software dependencies, which is a common mistake. + +--- + +### System Updates +**Q: Will the Spark Store affect normal system updates?** +**A:** No, the Spark Store has separated its application sources from system sources and will not affect regular system updates. + +--- + +### Reporting Issues and Removing Apps +**Q: Some apps are outdated or inactive, and I want them removed** +**A:** You can report issues [here](https://gitee.com/deepin-community-store/software_-issue). + +--- + +### Installing Spark App Store +If you wish to install the Spark App Store, please visit the [Release page](https://gitee.com/deepin-community-store/spark-store/releases), find the latest version, and choose the package suitable for your current system. + +> ⚠️ Special Note: If you are using Debian10/Debian11 or Ubuntu 20.04, you may need to download additional dependency packages. After downloading, unzip multiple times until you see the software user guide. For operating systems later than Ubuntu 22.04, you do not need to install dependency packages. Just follow the steps above to install the main program directly. + +--- \ No newline at end of file diff --git a/FAQ.zh.md b/FAQ.zh.md new file mode 100644 index 0000000..0a91f2d --- /dev/null +++ b/FAQ.zh.md @@ -0,0 +1,90 @@ +# FAQ +## 星火应用商店FAQ与支持指南 + +### 简介 +星火应用商店是一个面向 Linux 用户的应用商店,支持多种不同的 Linux 发行版。以下是一些常见问题及解决方案。请注意,该文档主要面向对 Linux 和 APT 软件包管理系统不熟悉的普通用户。 + +--- + +### 交流与反馈 +**Q: 在哪进交流群?** +**A:** 你可以点击[这里](https://www.deepinos.org/)进入星火商店的主交流平台。 +> ⚠️ 如果上面的链接无法使用,你还可以加入我们的 QQ 群作为备选方案,群号是 872690351 和 865927727。我们还提供论坛作为交流平台。 + +arm64与amd64的区别 + +arm64 + +* 全称: Advanced RISC Machine 64-bit +* 主要用途: 主要应用于移动设备、嵌入式系统以及一些新型的服务器和桌面计算机。 +* 优势: 低功耗、高效率,适合用在电池驱动和热敏感的设备。 +* 主要生产商: 苹果、高通、海思、飞腾等。 + +amd64 + +* 全称: AMD 64-bit, 也被称为 x86_64 +* 主要用途: 主要应用于桌面计算机、笔记本以及服务器。 +* 优势: 高性能,适用于计算密集型应用。 +* 主要生产商: Intel和AMD。 +* 两者最主要的不同在于指令集和应用场景。amd64通常用于高性能需求的计算机和服务器,而arm64则更多应用于功耗要求更严格的场合。 + +查看方法: + +Linux: + +- 打开终端。 +- 输入 uname -m 或 arch 并按回车。 +- 你将看到你的处理器架构(可能是 x86_64, aarch64 等)。 +--- + +### 国产架构支持 +**Q: 我是国产架构,怎么获取应用?** +**A:** 目前,星火商店支持**arm**架构的国产芯片。你可以下载适用于 arm64 架构的deb包(软件安装包)。 +> ⚠️ 请注意,这是实验性的支持。如果遇到问题,请在星火交流平台、QQ群或论坛向我们反馈。 + +--- + +### 安装依赖问题 +**Q: 安装依赖包出现错误** +**A:** 如果你使用UOS或deepin,请不要安装依赖包。对于Kali Linux/Kdeneon等,暂时不支持,请自行编译安装。 +> 💡 出现错误时,尝试运行 `sudo apt update` 后再尝试安装。如果问题仍然存在,请参考第一条,进入交流平台寻求帮助。 + +--- + +### 投稿与应用更新 +**Q: 在哪里投稿?** +**A:** 你可以在应用商店界面的右上角菜单找到“投递应用”的选项。 + +--- + +### 非deepin/UOS用户支持 +**Q: 我不是deepin/UOS用户,可以使用星火应用商店吗?** +**A:** 可以,如果你是使用 Ubuntu 22.04,请直接安装。对于 Ubuntu 20.04/Debian10/Debian11,请先安装依赖包。 + +--- + +### 安装方法 +**Q: 我可以用dpkg -i安装吗?** +**A:** 不可以!使用 `sudo apt install ./xxxx.deb` 来安装,或者使用gdebi等图形化的安装器。 +> ⚠️ 直接使用dpkg是不会处理软件依赖的,这是一个常见的错误。 + +--- + +### 系统更新 +**Q: 星火商店会影响系统正常更新吗?** +**A:** 不会,星火商店已经将应用源与系统源分开,不会影响系统的正常更新。 + +--- + +### 报告问题和应用下架 +**Q: 有些应用已经过时或者失效了,我想让他下架** +**A:** 你可以前往 [这里](https://gitee.com/deepin-community-store/software_-issue) 报告问题。 + +--- + +### 安装星火应用商店 +如果你想安装星火应用商店,请打开[Release页面](https://gitee.com/deepin-community-store/spark-store/releases),找到最新版本,并选择适用于当前系统的安装包下载。 + +> ⚠️ 特别提示: 如果你在使用 Debian10/Debian11 或 Ubuntu 20.04,你可能额外下载依赖补充包。您需要在下载完依赖包后,解压多次一直到看到内部的软件使用说明,对于 Ubuntu22.04 以后的操作系统版本,您无需安装依赖包,您需要按照上面的操作直接安装本体程序。 + +--- \ No newline at end of file diff --git a/README.md b/README.md index d95c681..532b566 100644 --- a/README.md +++ b/README.md @@ -1,153 +1,159 @@ -# Spark App Store -[![star](https://gitee.com/deepin-community-store/spark-store/badge/star.svg?theme=gvp)](https://gitee.com/deepin-community-store/spark-store/stargazers) [![fork](https://gitee.com/deepin-community-store/spark-store/badge/fork.svg?theme=gvp)](https://gitee.com/deepin-community-store/spark-store/members) +# Spark App Store +[![star](https://gitee.com/deepin-community-store/spark-store/badge/star.svg?theme=gvp)](https://gitee.com/deepin-community-store/spark-store/stargazers) [![fork](https://gitee.com/deepin-community-store/spark-store/badge/fork.svg?theme=gvp)](https://gitee.com/deepin-community-store/spark-store/members) +## Introduction +Welcome to the Spark App Store! This is an app store designed for Linux users, aiming to solve the problem of dispersed and difficult-to-obtain applications in the Linux ecosystem. No matter what type of Linux distribution you are using, you may find suitable software packages here. -Spark Store aims to collect Linux apps for the convieniece of Linux new comers +The number of Linux applications is relatively limited, and the availability of Wine software is also quite challenging. Excellent development and tool resources are scattered across various communities and forums, making it difficult for the entire ecosystem to improve comprehensively. -The collecting process needs everyone's help +The construction of the ecosystem is not dependent on the isolated efforts of individuals but requires the participation of the entire community. Only when everyone's "sparks" gather together can they ignite a "prairie fire." -We set up this APP Store and collect APPs/tools that everyone need widely. Also we pack Windows apps with wine. +To improve this situation, we have launched this app store. We have broadly included various user-demand software packages, gathered high-quality tools, and actively adapted Wine applications, all stored in our software library for easy user access. -All packages will be shared in our repository for users to get freely. +**Currently supported Linux distributions include:** -Distrobution supported: +- **amd64 architecture:** deepin 20 / deepin 23 / Ubuntu 20.04 / Ubuntu 22.04 / UOS Home Edition 20 +- **arm64 architecture:** UOS Professional Edition 1060 / Ubuntu 22.04 / deepin 23 -* amd64: deepin 20 / deepin 23 / Ubuntu 22.04 LTS / UniontechOS Home 21 -* arm64: UniontechOS Professional 1060 / Ubuntu 22.04 LTS / deepin 23 +> Special Note: We also support all versions of Ubuntu operating systems higher than Ubuntu 22.04, such as Ubuntu 22.10, 23.04, 23.10, etc. +**Important Notice:** This software does not provide any form of warranty. If you plan to use it on UOS Professional Edition, please make sure to understand and enable Developer Mode. Make sure you have basic troubleshooting capabilities. It should be clear that we have not conducted extensive testing on the UOS operating system. Therefore, using the Spark client may lead to a series of issues like failed system updates, data loss, etc., all risks to be borne by the user. -You can track our Issue resoving progress here https://gitee.com/deepin-community-store/spark-store/board +## Team Collaboration: For detailed documentation related to branch management, please see [this link](https://deepin-community-store.gitee.io/spark-wiki/#/Dev/Spark-Store-Git-Repo). +We warmly welcome you to join our development team. Whether you want to participate in development or submit applications, you can find your place here to jointly promote the development of the Linux application ecosystem. -We hope people who see here can also join our team,development help or submit applications are welcomed +You can track our Issue handling status in real-time through the following link: [Gitee Issue Board](https://gitee.com/deepin-community-store/spark-store/board). -If you want to submit an APP to share with others,Please [Click here](https://upload.deepinos.org/index) +If you have a software package you'd like to submit, please [click here to submit](https://upload.deepinos.org/index). +## Contents -## 🙌 A simple start - -If you simply want to install the Spark Store,just enter the [Release] page, find the version you want and install. - -If you are using Debian11/Ubuntu 20.04, you will need extra dependency package. Available [here](https://zunyun01.store.deepinos.org.cn/spark-store-dependencies-kylin.zip) - ---- -#### Compile and developement - - **dev branch is for development, Flamescion branch is for amd64 and Reason branch is for arrch64.** Although, for the most of the time, Flamescion branch is same as Reason. - -For Deepin V20/UOS 21/ Debian 11 - -```shell -sudo apt install git qt5-default debhelper pkg-config qtchooser libqt5core5a libqt5gui5 libqt5widgets5 libqt5network5 libqt5concurrent5 libdtkcore-dev libdtkgui-dev libdtkwidget-dev qttools5-private-dev libnotify-dev qtwebengine5-dev fakeroot qtwayland5 qtwayland5-dev-tools dde-qt5wayland-plugin libqt5svg5* - -``` - -Ubuntu 22.04 -```shell -sudo apt install git qtbase5-dev debhelper pkg-config qtchooser libqt5core5a libqt5gui5 libqt5widgets5 libqt5network5 libqt5concurrent5 libdtkcore-dev libdtkgui-dev libdtkwidget-dev qttools5-private-dev libnotify-dev qtwebengine5-dev qtwayland5 qtwayland5-dev-tools libqt5svg5* - -``` - -Then - -```shell -git clone https://gitee.com/deepin-community-store/spark-store.git -cd spark-store -dpkg-buildpackage -j -``` - -Or: -```shell -git clone https://gitee.com/deepin-community-store/spark-store.git -cd spark-store -./build_and_install.sh -``` -## EULA - -This is our [EULA](https://genshin-impact.fandom.com/wiki/Eula) - - -## 🚀 Coorperation - -We use Gitee as our code hosting platform. Please click here to contact us. - -https://gitee.com/deepin-community-store/spark-store - -### Forum - -https://www.deepinos.org/ - -#### QQ Group - -https://blog.shenmo.tech/post/%E6%95%85%E9%9A%9C%E5%85%AC%E5%91%8A/ - - -## FAQ -### Spark Application Store FAQ and Support Guide - -#### Introduction -The Spark Application Store is an application store for Linux users, supporting various Linux distributions. Here are some common questions and solutions. Please note that this document is primarily aimed at ordinary users who are not familiar with Linux and the APT software package management system. +- [Determine your system architecture](#determine-your-system-architecture) +- [System support and installation guide](#system-support-and-installation-guide) + - [For Deepin / UOS Users](#for-deepin-users) + - [For Ubuntu Users](#for-ubuntu-users) + - [For Debian Users](#for-debian-users) +- [Frequently Asked Questions (FAQ)](#frequently-asked-questions-faq) +- [Contact and Feedback](#contact-and-feedback) --- -#### Communication and Feedback -**Q: Where can I join the communication group?** -**A:** You can click [here](https://www.deepinos.org/) to access the main communication platform for the Spark Store. -> ⚠️ If the above link is not accessible, you can also join our QQ groups as an alternative, with group numbers 872690351 and 865927727. We also provide a forum as a communication platform. +## Determine your system architecture -#### Differences Between arm64 and amd64 -**arm64** -- Full name: Advanced RISC Machine 64-bit -- Main usage: Primarily used in mobile devices, embedded systems, and some new servers and desktop computers. -- Advantages: Low power consumption, high efficiency, suitable for battery-driven and thermally sensitive devices. -- Main manufacturers: Apple, Qualcomm, Hisilicon, Feiteng, and more. +Before installing any software, you need to know what architecture your computer runs on (such as x86_64/amd64 or aarch64/arm64). -**amd64** -- Full name: AMD 64-bit, also known as x86_64 -- Main usage: Mainly used in desktop computers, laptops, and servers. -- Advantages: High performance, suitable for compute-intensive applications. -- Main manufacturers: Intel and AMD. +**How to check:** -The most significant differences between them lie in instruction sets and application scenarios. amd64 is typically used in computers and servers with high-performance requirements, while arm64 is more suitable for scenarios with stricter power consumption requirements. +1. Open a Linux terminal. +2. Type `uname -m` or `arch` and press Enter. -To check your Linux system's processor architecture, you can follow these steps: -1. Open a terminal. -2. Enter `uname -m` or `arch` and press Enter. -3. You will see your processor architecture (possibly x86_64, aarch64, etc.). +You will see an output, and that's your system architecture. -#### Domestic Architecture Support -**Q: I have a domestic architecture. How can I get applications?** -**A:** Currently, the Spark Store supports domestic chips with the **arm** architecture. You can download deb packages (software installation packages) for the arm64 architecture. -> ⚠️ Please note that this is experimental support. If you encounter issues, please provide feedback on the Spark communication platform, QQ groups, or the forum. +- If you see `x86_64`, your system is AMD64 architecture. +- If you see `aarch64`, your system is ARM64 architecture. -#### Dependency Installation Issues -**Q: I encountered an error while installing dependencies** -**A:** If you are using UOS or Deepin, please do not install dependency packages. For Kali Linux/Kdeneon, etc., which are temporarily not supported, you need to compile and install them yourself. -> 💡 When an error occurs, try running `sudo apt update` before attempting to install. If the problem persists, refer to the first question and seek help on the communication platform. +--- -#### Submissions and Application Updates -**Q: Where can I submit applications?** -**A:** You can find the "Submit Application" option in the top-right menu of the app store interface. +## System support and installation guide -#### Support for Non-deepin/UOS Users -**Q: I am not a deepin/UOS user. Can I use the Spark Application Store?** -**A:** Yes, you can. If you are using Ubuntu 22.04, you can install it directly. For Ubuntu 20.04/Debian10/Debian11, please install the dependency packages first. +### For Deepin Users -#### Installation Methods -**Q: Can I install with dpkg -i?** -**A:** No! Use `sudo apt install ./xxxx.deb` to install, or use graphical installers like gdebi. -> ⚠️ Using dpkg directly will not handle software dependencies, and this is a common mistake. +#### For Deepin V20 Users -#### System Updates -**Q: Will the Spark Store affect normal system updates?** -**A:** No, the Spark Store separates application sources from system sources and will not affect regular system updates. +1. **Install Dependencies** + + Open terminal and execute: -#### Reporting Issues and Application Removal -**Q: Some applications are outdated or no longer working, and I want them removed** -**A:** You can report issues [here](https://gitee.com/deepin-community-store/software_-issue). + ```shell + sudo apt install git qt5-default debhelper pkg-config qtchooser libqt5core5a libqt5gui5 libqt5widgets5 libqt5network5 libqt5concurrent5 libdtkcore-dev libdtkgui-dev libdtkwidget-dev qttools5-private-dev libnotify-dev qtwebengine5-dev fakeroot qtwayland5 qtwayland5-dev-tools dde-qt5wayland-plugin libqt5svg5* + ``` -#### Installing the Spark Application Store -If you want to install the Spark Application Store, please open the [Release page](https://gitee.com/deepin-community-store/spark-store/releases), find the latest version, and choose the installation package suitable for your current system. +2. **Download and Install** -> ⚠️ Special Note: If you are using Debian 10/Debian 11 or Ubuntu 20.04, you may need to download additional dependency supplement packages. After downloading the dependency packages, unzip multiple times until you see the software usage instructions inside. For operating system versions after Ubuntu 22.04, you do not need to install dependency packages. Follow the above instructions to directly install the main program. \ No newline at end of file + Please visit [Spark App Store's Release page](https://gitee.com/deepin-community-store/spark-store/releases) and download the latest version suitable for Deepin. Install it to use. + + Assuming you download it to the user directory under the Downloads folder, we recommend using APT tools for installation: + + ```shell + cd ~/Downloads + sudo apt install ./spark-store*.deb + ``` + +### For Ubuntu Users + +#### For Ubuntu 20.04 Users + +1. **Download Dependencies** +* Visit [Spark App Store's dependency download page](https://spark-app.store/download_dependencies_latest), download the latest dependencies. +* Unzip the dependencies multiple times until you can see many installation packages ending with .deb. +* Install all dependencies at once, following the instructions in the dependency package. + +2. **Download and Install** + + Visit [Spark App Store's Release page](https://gitee.com/deepin-community-store/spark-store/releases), download and install. + + Assuming you download it to the user directory under the Downloads folder, we recommend using APT tools for installation: + + ```shell + cd ~/Downloads + sudo apt install ./spark-store*.deb + ``` + +#### For Ubuntu 22.04 Users + +1. **Install Dependencies** + + Open terminal and execute: + + ```shell + sudo apt install git qtbase5-dev debhelper pkg-config qtchooser libqt5core5a libqt5gui5 libqt5widgets5 libqt5network5 libqt5concurrent5 libdtkcore-dev libdtkgui-dev libdtkwidget-dev qttools5-private-dev libnotify-dev qtwebengine5-dev qt + +webengine5-dev fakeroot qtwayland5 qtwayland5-dev-tools + ``` + +2. **Download and Install** + + Visit [Spark App Store's Release page](https://gitee.com/deepin-community-store/spark-store/releases), download and install. + + Assuming you download it to the user directory under the Downloads folder, we recommend using APT tools for installation: + + ```shell + cd ~/Downloads + sudo apt install ./spark-store*.deb + ``` + +Certainly, here's the English translation of the additional text: + +--- + +### For Debian 11 Users + +1. **Download Dependencies** +* Please visit the [Spark App Store's dependency download page](https://spark-app.store/download_dependencies_latest) to download the latest dependencies. +* Unzip the dependencies multiple times until you see many installation packages ending with .deb. +* Install all dependencies at once, following the instructions in the dependency package. + +2. **Download and Install** + + Please visit the [Spark App Store's Release page](https://gitee.com/deepin-community-store/spark-store/releases) and download. Install it to use. + +--- + +## Frequently Asked Questions (FAQ) + +Please refer to the [Spark App Store FAQ and Support Guide](https://gitee.com/deepin-community-store/spark-store/blob/dev/FAQ.md). + +You can also check the [Chinese version](https://gitee.com/deepin-community-store/spark-store/blob/dev/FAQ.zh.md) here. + +--- + +## Contact and Feedback + +- If you have any questions or suggestions, please submit them via email or on our [Gitee page](https://gitee.com/deepin-community-store/spark-store/issues). +- If you want to follow our development progress, you can go to the [Spark App Store Board](https://gitee.com/deepin-community-store/spark-store/board) for more information. +- Our [Forum](https://www.deepinos.org/) +- Our [QQ Group](https://blog.shenmo.tech/post/%E6%95%85%E9%9A%9C%E5%85%AC%E5%91%8A/) + +--- diff --git a/README.zh.md b/README.zh.md index 3fadaea..50ac75b 100644 --- a/README.zh.md +++ b/README.zh.md @@ -2,175 +2,162 @@ [![star](https://gitee.com/deepin-community-store/spark-store/badge/star.svg?theme=gvp)](https://gitee.com/deepin-community-store/spark-store/stargazers) [![fork](https://gitee.com/deepin-community-store/spark-store/badge/fork.svg?theme=gvp)](https://gitee.com/deepin-community-store/spark-store/members) +## 简介 -国内的Linux应用比较少,wine应用难以获取,优质工具分散在民间各大论坛,无法形成合力,难以改善生态 - -生态构建需要的不是某一方的单打独斗,而是人人行动起来,汇聚星火,产生燎原之势 - -我们创建了这个应用商店,广泛收录大家需要的软件包,搜集优质小工具,主动适配wine应用,存放到储存库供大家获取 - -发行版支持: - -* amd64: deepin 20 / deepin 23 / Ubuntu 22.04 / UOS家庭版20 -* arm64: UOS专业版1060 / Ubuntu 22.04 / deepin 23 - - **请注意:本程序不包含任何保证,若你要在UOS专业版上使用,请确保你打开了开发者模式且拥有排查错误的能力,风险自负!** - -## 关于协作:分支相关的文档见 [这里](https://deepin-community-store.gitee.io/spark-wiki/#/Dev/Spark-Store-Git-Repo) +欢迎来到星火应用商店!这是一个为Linux用户设计的应用商店,旨在解决Linux生态下应用分散、难以获取的问题。无论你是使用什么类型的Linux发行版,这里都有可能找到适合你的软件包。 -希望看到这里的人也可以加入我们的队伍,开发或者投递应用都很欢迎,共同构建Linux应用生态 +Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。优秀的开发和工具资源散布在各大社区和论坛之间,这种分散化让整个生态系统难以得到全面的提升。 -在这里追踪我们的Issue处理情况 https://gitee.com/deepin-community-store/spark-store/board +生态系统的构建并非依赖个体的孤立努力,而需要全社区共同参与。只有当大家的“星火”聚集一处,方可引发“燎原之势”。 -如果有想要提交的软件包,请 [在这里投稿](https://upload.deepinos.org/index) +为了改善这一现状,我们推出了这个应用商店。我们广泛地收录了各种用户需求的软件包,汇集了高质量的小工具,并主动对 Wine 应用进行了适配,一切都储存在我们的软件库中,以便用户方便地获取。 + +**当前支持的Linux发行版包括:** + +- **amd64架构:** deepin 20 / deepin 23 / Ubuntu 20.04 / Ubuntu 22.04 / UOS家庭版20 +- **arm64架构:** UOS专业版1060 / Ubuntu 22.04 / deepin 23 + +> 特别说明:我们还支持所有版本高于Ubuntu 22.04的Ubuntu操作系统,例如Ubuntu 22.10、23.04、23.10等。 + +**重要须知:** 本软件不提供任何形式的保证。若您计划在UOS专业版上使用,请务必了解并启用开发者模式。请确保您具备基础的故障排查能力。需要明确的是,我们没有在UOS操作系统上进行广泛的测试。因此,使用星火客户端可能会导致一系列问题,如系统更新失败、数据丢失等,所有风险需由用户自行承担。 -## 🙌 简单的开始 -如果想安装 `星火应用商店` ,请打开右侧的 [Release] 页面,找到最新版本,并选择适用于当前系统的安装包下载。 +## 关于团队协作:分支管理相关的详细文档可参见 [此链接](https://deepin-community-store.gitee.io/spark-wiki/#/Dev/Spark-Store-Git-Repo)。 -如果你在使用 `Debian 11/Ubuntu 20.04`,你需要额外下载[依赖补充包](https://zunyun01.store.deepinos.org.cn/spark-store-dependencies-kylin.zip) +我们热忱欢迎您加入我们的开发团队。无论您是想参与开发,还是想提交应用,都能在这里找到属于您的一席之地,共同推动Linux应用生态的发展。 ---- -#### 编译安装 +您可以通过以下链接,实时跟踪我们的Issue处理状态:[Gitee Issue看板](https://gitee.com/deepin-community-store/spark-store/board)。 - **dev分支用于开发,Flamescion分支是amd64,Reason分支是aarch64**。然而,绝大多数情况下,Flamescion和Reason的内容是一致的 - -Deepin V20/UOS 21 系统下, 安装依赖 - -```shell -sudo apt install git qt5-default debhelper pkg-config qtchooser libqt5core5a libqt5gui5 libqt5widgets5 libqt5network5 libqt5concurrent5 libdtkcore-dev libdtkgui-dev libdtkwidget-dev qttools5-private-dev libnotify-dev qtwebengine5-dev fakeroot qtwayland5 qtwayland5-dev-tools dde-qt5wayland-plugin libqt5svg5* - -``` - -Ubuntu 22.04 系统下, 安装依赖 -```shell -sudo apt install git qtbase5-dev debhelper pkg-config qtchooser libqt5core5a libqt5gui5 libqt5widgets5 libqt5network5 libqt5concurrent5 libdtkcore-dev libdtkgui-dev libdtkwidget-dev qttools5-private-dev libnotify-dev qtwebengine5-dev qtwayland5 qtwayland5-dev-tools libqt5svg5* - -``` - -然后 -```shell -git clone https://gitee.com/deepin-community-store/spark-store.git -cd spark-store -dpkg-buildpackage -j -``` - -或者: 编译并安装 -```shell -git clone https://gitee.com/deepin-community-store/spark-store.git -cd spark-store -./build_and_install.sh -``` - -## EULA - -这里是我们的[EULA](https://mzh.moegirl.org.cn/%E4%BC%98%E8%8F%88%C2%B7%E5%8A%B3%E4%BC%A6%E6%96%AF) +若您有软件包想要提交,敬请 [点击此处进行投稿](https://upload.deepinos.org/index)。 -## 🚀 协作 - -非常感谢有兴趣的开发者或爱好者参与 `星火应用商店` 项目,分享你的见解与思路。 - -### 论坛 - -https://www.deepinos.org/ - -#### QQ群: - -https://blog.shenmo.tech/post/%E6%95%85%E9%9A%9C%E5%85%AC%E5%91%8A/ -## FAQ -### 星火应用商店FAQ与支持指南 +## 目录 -#### 简介 -星火应用商店是一个面向 Linux 用户的应用商店,支持多种不同的 Linux 发行版。以下是一些常见问题及解决方案。请注意,该文档主要面向对 Linux 和 APT 软件包管理系统不熟悉的普通用户。 +- [确定你的系统架构](#确定你的系统架构) +- [系统支持与安装指引](#系统支持与安装指引) + - [对于 Deepin / UOS 用户](#对于deepin用户) + - [对于 Ubuntu 用户](#对于ubuntu用户) + - [对于 Debian 用户](#对于debian用户) +- [常见问题(FAQ)](#常见问题faq) +- [联系与反馈](#联系与反馈) --- -#### 交流与反馈 -**Q: 在哪进交流群?** -**A:** 你可以点击[这里](https://www.deepinos.org/)进入星火商店的主交流平台。 -> ⚠️ 如果上面的链接无法使用,你还可以加入我们的 QQ 群作为备选方案,群号是 872690351 和 865927727。我们还提供论坛作为交流平台。 +## 确定你的系统架构 -arm64与amd64的区别 +在安装任何软件之前,你需要知道你的计算机运行的是哪种架构(如x86_64/amd64或aarch64/arm64)。 -arm64 +**如何检查:** -* 全称: Advanced RISC Machine 64-bit -* 主要用途: 主要应用于移动设备、嵌入式系统以及一些新型的服务器和桌面计算机。 -* 优势: 低功耗、高效率,适合用在电池驱动和热敏感的设备。 -* 主要生产商: 苹果、高通、海思、飞腾等。 +1. 打开Linux终端。 +2. 输入 `uname -m` 或 `arch` 并按回车。 -amd64 +你会看到一个输出,这就是你的系统架构。 -* 全称: AMD 64-bit, 也被称为 x86_64 -* 主要用途: 主要应用于桌面计算机、笔记本以及服务器。 -* 优势: 高性能,适用于计算密集型应用。 -* 主要生产商: Intel和AMD。 -* 两者最主要的不同在于指令集和应用场景。amd64通常用于高性能需求的计算机和服务器,而arm64则更多应用于功耗要求更严格的场合。 - -查看方法: - -Linux: - -- 打开终端。 -- 输入 uname -m 或 arch 并按回车。 -- 你将看到你的处理器架构(可能是 x86_64, aarch64 等)。 ---- - -#### 国产架构支持 -**Q: 我是国产架构,怎么获取应用?** -**A:** 目前,星火商店支持**arm**架构的国产芯片。你可以下载适用于 arm64 架构的deb包(软件安装包)。 -> ⚠️ 请注意,这是实验性的支持。如果遇到问题,请在星火交流平台、QQ群或论坛向我们反馈。 +- 如果看到 `x86_64`,你的系统是AMD64架构。 +- 如果看到 `aarch64`,你的系统是ARM64架构。 --- -#### 安装依赖问题 -**Q: 安装依赖包出现错误** -**A:** 如果你使用UOS或deepin,请不要安装依赖包。对于Kali Linux/Kdeneon等,暂时不支持,请自行编译安装。 -> 💡 出现错误时,尝试运行 `sudo apt update` 后再尝试安装。如果问题仍然存在,请参考第一条,进入交流平台寻求帮助。 +## 系统支持与安装指引 + +根据你的Linux发行版和系统架构,以下是安装星火应用商店的详细步骤。 + +### 对于Deepin用户 + +#### 对于 Deepin V20 用户 + +1. **安装依赖** + + 打开终端并执行: + + ```shell + sudo apt install git qt5-default debhelper pkg-config qtchooser libqt5core5a libqt5gui5 libqt5widgets5 libqt5network5 libqt5concurrent5 libdtkcore-dev libdtkgui-dev libdtkwidget-dev qttools5-private-dev libnotify-dev qtwebengine5-dev fakeroot qtwayland5 qtwayland5-dev-tools dde-qt5wayland-plugin libqt5svg5* + ``` + +2. **下载并安装** + + 请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases)并下载适用于Deepin的最新版本。安装后即可使用。 + + 假设您下载到用户目录下的 Downloads 文件夹, 我们推荐您使用 APT 工具安装: + + ```shell + cd ~/Downloads + sudo apt install ./spark-store*.deb + ``` + +### 对于 Ubuntu 用户 + +#### 对于 Ubuntu 20.04 用户 + +1. **下载依赖包** +* 请访问[星火应用商店依赖包下载页面](https://spark-app.store/download_dependencies_latest), 下载最新的依赖包。 +* 请多次解压依赖包,直到你可以看到诸多以 deb 结尾的安装包。 +* 依据依赖包内的说明,一次性安装所有的依赖包。 + + +2. **下载并安装** + +请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases),下载并安装。 + + 假设您下载到用户目录下的 Downloads 文件夹, 我们推荐您使用 APT 工具安装: + + ```shell + cd ~/Downloads + sudo apt install ./spark-store*.deb + ``` + +#### 对于 Ubuntu 22.04 用户 +1. **安装依赖** + + 打开终端并执行: + + ```shell + sudo apt install git qtbase5-dev debhelper pkg-config qtchooser libqt5core5a libqt5gui5 libqt5widgets5 libqt5network5 libqt5concurrent5 libdtkcore-dev libdtkgui-dev libdtkwidget-dev qttools5-private-dev libnotify-dev qtwebengine5-dev qtwayland5 qtwayland5-dev-tools libqt5svg5* + ``` + +2. **下载并安装** + + 如果你是Ubuntu 22.04用户,请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases),下载并安装。 + + 假设您下载到用户目录下的 Downloads 文件夹, 我们推荐您使用 APT 工具安装: + + ```shell + cd ~/Downloads + sudo apt install ./spark-store*.deb + ``` + +### 对于Debian 11用户 + +1. **下载依赖包** +* 请访问[星火应用商店依赖包下载页面](https://spark-app.store/download_dependencies_latest), 下载最新的依赖包。 +* 请多次解压依赖包,直到你可以看到诸多以 deb 结尾的安装包。 +* 依据依赖包内的说明,一次性安装所有的依赖包。 + +2. **下载并安装** + + 请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases)并下载,安装后即可使用。 --- -#### 投稿与应用更新 -**Q: 在哪里投稿?** -**A:** 你可以在应用商店界面的右上角菜单找到“投递应用”的选项。 +## 常见问题(FAQ) + +请参见[星火应用商店FAQ与支持指南](https://gitee.com/deepin-community-store/spark-store/blob/dev/FAQ.md)。 + +在这里可以查阅[中文版本](https://gitee.com/deepin-community-store/spark-store/blob/dev/FAQ.zh.md)。 --- -#### 非deepin/UOS用户支持 -**Q: 我不是deepin/UOS用户,可以使用星火应用商店吗?** -**A:** 可以,如果你是使用 Ubuntu 22.04,请直接安装。对于 Ubuntu 20.04/Debian10/Debian11,请先安装依赖包。 +## 联系与反馈 + +- 如果您有任何问题或建议,请通过邮件或在[Gitee页面](https://gitee.com/deepin-community-store/spark-store/issues)上提交问题。 +- 如果你想关注我们的开发进度,可以跳转[星火应用商店Board](https://gitee.com/deepin-community-store/spark-store/board)获取更多信息。 +- 我们的[论坛](https://www.deepinos.org/) +- 我们的[QQ群](https://blog.shenmo.tech/post/%E6%95%85%E9%9A%9C%E5%85%AC%E5%91%8A/) + --- - -#### 安装方法 -**Q: 我可以用dpkg -i安装吗?** -**A:** 不可以!使用 `sudo apt install ./xxxx.deb` 来安装,或者使用gdebi等图形化的安装器。 -> ⚠️ 直接使用dpkg是不会处理软件依赖的,这是一个常见的错误。 - ---- - -#### 系统更新 -**Q: 星火商店会影响系统正常更新吗?** -**A:** 不会,星火商店已经将应用源与系统源分开,不会影响系统的正常更新。 - ---- - -#### 报告问题和应用下架 -**Q: 有些应用已经过时或者失效了,我想让他下架** -**A:** 你可以前往 [这里](https://gitee.com/deepin-community-store/software_-issue) 报告问题。 - ---- - -#### 安装星火应用商店 -如果你想安装星火应用商店,请打开[Release页面](https://gitee.com/deepin-community-store/spark-store/releases),找到最新版本,并选择适用于当前系统的安装包下载。 - -> ⚠️ 特别提示: 如果你在使用 Debian10/Debian11 或 Ubuntu 20.04,你可能额外下载依赖补充包。您需要在下载完依赖包后,解压多次一直到看到内部的软件使用说明,对于 Ubuntu22.04 以后的操作系统版本,您无需安装依赖包,您需要按照上面的操作直接安装本体程序。 - ---- - - From 3f9200bf01a12b16cf5099d1407beb7099a9933d Mon Sep 17 00:00:00 2001 From: shenmo Date: Sun, 22 Oct 2023 07:03:39 +0000 Subject: [PATCH 07/23] update README.zh.md. Signed-off-by: shenmo --- README.zh.md | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/README.zh.md b/README.zh.md index 50ac75b..4e3b2b9 100644 --- a/README.zh.md +++ b/README.zh.md @@ -30,7 +30,7 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。 您可以通过以下链接,实时跟踪我们的Issue处理状态:[Gitee Issue看板](https://gitee.com/deepin-community-store/spark-store/board)。 -若您有软件包想要提交,敬请 [点击此处进行投稿](https://upload.deepinos.org/index)。 +若您有软件包想要提交,敬请 [点击此处进行投稿](https://deepin-community-store.gitee.io/spark-wiki/#/Submit/Submit)。 @@ -69,19 +69,13 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。 ### 对于Deepin用户 -#### 对于 Deepin V20 用户 +#### 对于 Deepin 用户 -1. **安装依赖** - - 打开终端并执行: +1. **下载并安装** - ```shell - sudo apt install git qt5-default debhelper pkg-config qtchooser libqt5core5a libqt5gui5 libqt5widgets5 libqt5network5 libqt5concurrent5 libdtkcore-dev libdtkgui-dev libdtkwidget-dev qttools5-private-dev libnotify-dev qtwebengine5-dev fakeroot qtwayland5 qtwayland5-dev-tools dde-qt5wayland-plugin libqt5svg5* - ``` + 您可直接在深度商店搜索 星火应用商店 安装,或点击此链接安装 [appstore://deepin-home-appstore-client?app_detail_info/spark-store](appstore://deepin-home-appstore-client?app_detail_info/spark-store) -2. **下载并安装** - - 请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases)并下载适用于Deepin的最新版本。安装后即可使用。 + 若要使用最新版本,请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases)并下载适用于Deepin的最新版本。安装后即可使用。 假设您下载到用户目录下的 Downloads 文件夹, 我们推荐您使用 APT 工具安装: @@ -112,13 +106,8 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。 ``` #### 对于 Ubuntu 22.04 用户 -1. **安装依赖** +1. **无需安装依赖包** - 打开终端并执行: - - ```shell - sudo apt install git qtbase5-dev debhelper pkg-config qtchooser libqt5core5a libqt5gui5 libqt5widgets5 libqt5network5 libqt5concurrent5 libdtkcore-dev libdtkgui-dev libdtkwidget-dev qttools5-private-dev libnotify-dev qtwebengine5-dev qtwayland5 qtwayland5-dev-tools libqt5svg5* - ``` 2. **下载并安装** From 6946f20d64a40ce939772748d33c3445f08ad2be Mon Sep 17 00:00:00 2001 From: shenmo Date: Sun, 22 Oct 2023 07:09:59 +0000 Subject: [PATCH 08/23] update README.zh.md. Signed-off-by: shenmo --- README.zh.md | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/README.zh.md b/README.zh.md index 4e3b2b9..c501b67 100644 --- a/README.zh.md +++ b/README.zh.md @@ -67,13 +67,13 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。 根据你的Linux发行版和系统架构,以下是安装星火应用商店的详细步骤。 -### 对于Deepin用户 +### 对于 Deepin 用户 -#### 对于 Deepin 用户 +#### 对于 Deepin 用户 1. **下载并安装** - 您可直接在深度商店搜索 星火应用商店 安装,或点击此链接安装 [appstore://deepin-home-appstore-client?app_detail_info/spark-store](appstore://deepin-home-appstore-client?app_detail_info/spark-store) + 您可直接在深度商店搜索 星火应用商店 安装,或复制此链接到浏览器打开安装 appstore://deepin-home-appstore-client?app_detail_info/spark-store 若要使用最新版本,请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases)并下载适用于Deepin的最新版本。安装后即可使用。 @@ -96,7 +96,7 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。 2. **下载并安装** -请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases),下载并安装。 + 请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases),下载并安装。 假设您下载到用户目录下的 Downloads 文件夹, 我们推荐您使用 APT 工具安装: @@ -111,7 +111,7 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。 2. **下载并安装** - 如果你是Ubuntu 22.04用户,请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases),下载并安装。 + 请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases),下载并安装。 假设您下载到用户目录下的 Downloads 文件夹, 我们推荐您使用 APT 工具安装: @@ -120,7 +120,9 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。 sudo apt install ./spark-store*.deb ``` -### 对于Debian 11用户 +### 对于 Debian 用户 + +#### 对于 Debian 11用户 1. **下载依赖包** * 请访问[星火应用商店依赖包下载页面](https://spark-app.store/download_dependencies_latest), 下载最新的依赖包。 @@ -131,6 +133,22 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。 请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases)并下载,安装后即可使用。 + +#### 对于 Debian 12+ 用户 + +1. **无需安装依赖包** + + +2. **下载并安装** + + 请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases),下载并安装。 + + 假设您下载到用户目录下的 Downloads 文件夹, 我们推荐您使用 APT 工具安装: + + ```shell + cd ~/Downloads + sudo apt install ./spark-store*.deb + ``` --- ## 常见问题(FAQ) From e5a2fd2d94d327c769da9c8049c77fb4cde43593 Mon Sep 17 00:00:00 2001 From: shenmo Date: Sun, 22 Oct 2023 07:10:54 +0000 Subject: [PATCH 09/23] update README.zh.md. Signed-off-by: shenmo --- README.zh.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.zh.md b/README.zh.md index c501b67..841b8d2 100644 --- a/README.zh.md +++ b/README.zh.md @@ -73,7 +73,9 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。 1. **下载并安装** - 您可直接在深度商店搜索 星火应用商店 安装,或复制此链接到浏览器打开安装 appstore://deepin-home-appstore-client?app_detail_info/spark-store + 您可直接在深度商店搜索 星火应用商店 安装,或复制此链接到浏览器打开安装 + +> appstore://deepin-home-appstore-client?app_detail_info/spark-store 若要使用最新版本,请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases)并下载适用于Deepin的最新版本。安装后即可使用。 From 35218a917b14d8dd8b621a11b25273d75f98135a Mon Sep 17 00:00:00 2001 From: shenmo Date: Sun, 22 Oct 2023 07:11:23 +0000 Subject: [PATCH 10/23] update README.zh.md. Signed-off-by: shenmo --- README.zh.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.zh.md b/README.zh.md index 841b8d2..f15741b 100644 --- a/README.zh.md +++ b/README.zh.md @@ -77,6 +77,7 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。 > appstore://deepin-home-appstore-client?app_detail_info/spark-store + 若要使用最新版本,请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases)并下载适用于Deepin的最新版本。安装后即可使用。 假设您下载到用户目录下的 Downloads 文件夹, 我们推荐您使用 APT 工具安装: From 20e17639295f72bc3f901d2be27cb4b603b7100a Mon Sep 17 00:00:00 2001 From: shenmo Date: Sun, 22 Oct 2023 07:11:52 +0000 Subject: [PATCH 11/23] update README.zh.md. Signed-off-by: shenmo --- README.zh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.zh.md b/README.zh.md index f15741b..3a59d5a 100644 --- a/README.zh.md +++ b/README.zh.md @@ -75,7 +75,7 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。 您可直接在深度商店搜索 星火应用商店 安装,或复制此链接到浏览器打开安装 -> appstore://deepin-home-appstore-client?app_detail_info/spark-store + > appstore://deepin-home-appstore-client?app_detail_info/spark-store 若要使用最新版本,请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases)并下载适用于Deepin的最新版本。安装后即可使用。 From 831bef82330233620a754afd78b38003a43d6958 Mon Sep 17 00:00:00 2001 From: uniartisan Date: Sun, 22 Oct 2023 17:19:35 +0800 Subject: [PATCH 12/23] =?UTF-8?q?enhance:=20=E5=90=8C=E6=AD=A5=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E6=9B=B4=E6=94=B9=E5=88=B0=E8=8B=B1=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 97 ++++++++++++++++++++++++++-------------------------- README.zh.md | 10 +++--- 2 files changed, 54 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 532b566..489f185 100644 --- a/README.md +++ b/README.md @@ -60,84 +60,85 @@ You will see an output, and that's your system architecture. ### For Deepin Users -#### For Deepin V20 Users +#### For Deepin Users -1. **Install Dependencies** - - Open terminal and execute: +1. **Download and Install** - ```shell - sudo apt install git qt5-default debhelper pkg-config qtchooser libqt5core5a libqt5gui5 libqt5widgets5 libqt5network5 libqt5concurrent5 libdtkcore-dev libdtkgui-dev libdtkwidget-dev qttools5-private-dev libnotify-dev qtwebengine5-dev fakeroot qtwayland5 qtwayland5-dev-tools dde-qt5wayland-plugin libqt5svg5* - ``` + You can directly search for Spark App Store in the Deepin Store to install, or copy this link to open and install in your browser: -2. **Download and Install** + > appstore://deepin-home-appstore-client?app_detail_info/spark-store - Please visit [Spark App Store's Release page](https://gitee.com/deepin-community-store/spark-store/releases) and download the latest version suitable for Deepin. Install it to use. + To use the latest version, please visit the [Spark App Store Release page](https://gitee.com/deepin-community-store/spark-store/releases) and download the latest version suitable for Deepin. Install to use. - Assuming you download it to the user directory under the Downloads folder, we recommend using APT tools for installation: + Assuming you've downloaded to the `Downloads` folder in your user directory, we recommend you use the APT tool to install: - ```shell - cd ~/Downloads - sudo apt install ./spark-store*.deb - ``` + ```shell + cd ~/Downloads + sudo apt install ./spark-store*.deb + ``` ### For Ubuntu Users #### For Ubuntu 20.04 Users 1. **Download Dependencies** -* Visit [Spark App Store's dependency download page](https://spark-app.store/download_dependencies_latest), download the latest dependencies. -* Unzip the dependencies multiple times until you can see many installation packages ending with .deb. -* Install all dependencies at once, following the instructions in the dependency package. +* Please visit the [Spark App Store Dependency Download page](https://spark-app.store/download_dependencies_latest) and download the latest dependency package. +* Unzip the dependency package multiple times until you see multiple installation packages ending with `.deb`. +* Follow the instructions in the dependency package to install all the dependencies at once. 2. **Download and Install** - Visit [Spark App Store's Release page](https://gitee.com/deepin-community-store/spark-store/releases), download and install. + Visit the [Spark App Store Release page](https://gitee.com/deepin-community-store/spark-store/releases), download the installation package that matches your computer's architecture, and install it. - Assuming you download it to the user directory under the Downloads folder, we recommend using APT tools for installation: + Assuming you've downloaded to the `Downloads` folder in your user directory, we recommend you use the APT tool to install: - ```shell - cd ~/Downloads - sudo apt install ./spark-store*.deb - ``` + ```shell + cd ~/Downloads + sudo apt install ./spark-store*.deb + ``` -#### For Ubuntu 22.04 Users +#### For Ubuntu 22.04 and Higher Version Users -1. **Install Dependencies** - - Open terminal and execute: - - ```shell - sudo apt install git qtbase5-dev debhelper pkg-config qtchooser libqt5core5a libqt5gui5 libqt5widgets5 libqt5network5 libqt5concurrent5 libdtkcore-dev libdtkgui-dev libdtkwidget-dev qttools5-private-dev libnotify-dev qtwebengine5-dev qt - -webengine5-dev fakeroot qtwayland5 qtwayland5-dev-tools - ``` +1. **No Need to Install Dependencies** 2. **Download and Install** - Visit [Spark App Store's Release page](https://gitee.com/deepin-community-store/spark-store/releases), download and install. + Visit the [Spark App Store Release page](https://gitee.com/deepin-community-store/spark-store/releases), download the installation package that matches your computer's architecture, and install it. - Assuming you download it to the user directory under the Downloads folder, we recommend using APT tools for installation: + Assuming you've downloaded to the `Downloads` folder in your user directory, we recommend you use the APT tool to install: - ```shell - cd ~/Downloads - sudo apt install ./spark-store*.deb - ``` + ```shell + cd ~/Downloads + sudo apt install ./spark-store*.deb + ``` -Certainly, here's the English translation of the additional text: +### For Debian Users ---- - -### For Debian 11 Users +#### For Debian 11 Users 1. **Download Dependencies** -* Please visit the [Spark App Store's dependency download page](https://spark-app.store/download_dependencies_latest) to download the latest dependencies. -* Unzip the dependencies multiple times until you see many installation packages ending with .deb. -* Install all dependencies at once, following the instructions in the dependency package. +* Please visit the [Spark App Store Dependency Download page](https://spark-app.store/download_dependencies_latest) and download the latest dependency package. +* Unzip the dependency package multiple times until you see multiple installation packages ending with `.deb`. +* Follow the instructions in the dependency package to install all the dependencies at once. 2. **Download and Install** - Please visit the [Spark App Store's Release page](https://gitee.com/deepin-community-store/spark-store/releases) and download. Install it to use. + Please visit the [Spark App Store Release page](https://gitee.com/deepin-community-store/spark-store/releases) and download. Install to use. + +#### For Debian 12+ Users + +1. **No Need to Install Dependencies** + +2. **Download and Install** + + Please visit the [Spark App Store Release page](https://gitee.com/deepin-community-store/spark-store/releases), download the installation package that matches your computer's architecture, and install it. + + Assuming you've downloaded to the `Downloads` folder in your user directory, we recommend you use the APT tool to install: + + ```shell + cd ~/Downloads + sudo apt install ./spark-store*.deb + ``` --- @@ -156,4 +157,4 @@ You can also check the [Chinese version](https://gitee.com/deepin-community-stor - Our [Forum](https://www.deepinos.org/) - Our [QQ Group](https://blog.shenmo.tech/post/%E6%95%85%E9%9A%9C%E5%85%AC%E5%91%8A/) ---- +--- \ No newline at end of file diff --git a/README.zh.md b/README.zh.md index 3a59d5a..33af549 100644 --- a/README.zh.md +++ b/README.zh.md @@ -99,7 +99,7 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。 2. **下载并安装** - 请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases),下载并安装。 + 请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases),下载和您电脑相同架构的安装包并安装。 假设您下载到用户目录下的 Downloads 文件夹, 我们推荐您使用 APT 工具安装: @@ -108,13 +108,13 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。 sudo apt install ./spark-store*.deb ``` -#### 对于 Ubuntu 22.04 用户 +#### 对于 Ubuntu 22.04 及更高版本的 Ubuntu 用户 1. **无需安装依赖包** 2. **下载并安装** - 请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases),下载并安装。 + 请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases),下载和您电脑相同架构的安装包并安装。 假设您下载到用户目录下的 Downloads 文件夹, 我们推荐您使用 APT 工具安装: @@ -125,7 +125,7 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。 ### 对于 Debian 用户 -#### 对于 Debian 11用户 +#### 对于 Debian 11 用户 1. **下载依赖包** * 请访问[星火应用商店依赖包下载页面](https://spark-app.store/download_dependencies_latest), 下载最新的依赖包。 @@ -144,7 +144,7 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。 2. **下载并安装** - 请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases),下载并安装。 + 请访问[星火应用商店的Release页面](https://gitee.com/deepin-community-store/spark-store/releases),下载和您电脑相同架构的安装包并安装。 假设您下载到用户目录下的 Downloads 文件夹, 我们推荐您使用 APT 工具安装: From c00d62c010ee7e4be72adb815e0cd766d60466c1 Mon Sep 17 00:00:00 2001 From: uniartisan Date: Tue, 24 Oct 2023 15:36:26 +0800 Subject: [PATCH 13/23] =?UTF-8?q?feat:=20=E5=8C=BF=E5=90=8D=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=90=9C=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/DataCollectorAndUploader.cpp | 85 ++++++++++++++++++++++++ src/backend/DataCollectorAndUploader.h | 21 ++++++ src/main.cpp | 13 ++++ src/spark-store.pro | 2 + src/utils/utils.cpp | 14 ++++ src/utils/utils.h | 1 + 6 files changed, 136 insertions(+) create mode 100644 src/backend/DataCollectorAndUploader.cpp create mode 100644 src/backend/DataCollectorAndUploader.h diff --git a/src/backend/DataCollectorAndUploader.cpp b/src/backend/DataCollectorAndUploader.cpp new file mode 100644 index 0000000..494f267 --- /dev/null +++ b/src/backend/DataCollectorAndUploader.cpp @@ -0,0 +1,85 @@ +#include "DataCollectorAndUploader.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +DataCollectorAndUploader::DataCollectorAndUploader(QObject *parent) : QObject(parent) +{ +} + +void DataCollectorAndUploader::collectAndUploadData() +{ + collectData(); +} + +void DataCollectorAndUploader::collectData() +{ + QString distributor_id; + QString release; + QString architecture; + + QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat); + QString version = config.value("build/version").toString(); + QString uuid = config.value("info/uuid").toString(); + + + // Execute lsb_release --all and capture the output + QProcess lsbProcess; + lsbProcess.start("lsb_release", QStringList() << "--all"); + lsbProcess.waitForFinished(); + QString lsbOutput = lsbProcess.readAllStandardOutput(); + + QStringList lines = lsbOutput.split('\n'); + for (const QString &line : lines) { + if (line.contains("Distributor ID:")) { + distributor_id = line.split(":").last().trimmed(); + } else if (line.contains("Release:")) { + release = line.split(":").last().trimmed(); + } + } + + // Execute uname -m to get the architecture + QProcess unameProcess; + unameProcess.start("uname", QStringList() << "-m"); + unameProcess.waitForFinished(); + architecture = unameProcess.readAllStandardOutput().trimmed(); + + // Create a JSON object + QJsonObject json; + json.insert("Distributor ID", distributor_id); + json.insert("Release", release); + json.insert("Architecture", architecture); + json.insert("Store_Version", version); + json.insert("UUID", uuid); + + + + // Convert to byte array + QJsonDocument doc(json); + QByteArray jsonData = doc.toJson(); + + // Initialize a network request + QNetworkAccessManager *manager = new QNetworkAccessManager(this); + QUrl url("http://zunyun01.store.deepinos.org.cn:12345"); + + QNetworkRequest request(url); + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + + // Send the POST request + QNetworkReply *reply = manager->post(request, jsonData); + + connect(reply, &QNetworkReply::finished, [=]() { + if (reply->error() == QNetworkReply::NoError) { + emit uploadSuccessful(); + } else { + emit uploadFailed(reply->errorString()); + } + reply->deleteLater(); + }); +} diff --git a/src/backend/DataCollectorAndUploader.h b/src/backend/DataCollectorAndUploader.h new file mode 100644 index 0000000..d251b3c --- /dev/null +++ b/src/backend/DataCollectorAndUploader.h @@ -0,0 +1,21 @@ +#ifndef DATACOLLECTORANDUPLOADER_H +#define DATACOLLECTORANDUPLOADER_H + +#include + +class DataCollectorAndUploader : public QObject +{ + Q_OBJECT +public: + explicit DataCollectorAndUploader(QObject *parent = nullptr); + void collectAndUploadData(); + +signals: + void uploadSuccessful(); + void uploadFailed(QString errorString); + +private: + void collectData(); +}; + +#endif // DATACOLLECTORANDUPLOADER_H diff --git a/src/main.cpp b/src/main.cpp index 41fdd94..632ab4f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,6 +22,8 @@ #include #include +#include + DCORE_USE_NAMESPACE DWIDGET_USE_NAMESPACE @@ -124,6 +126,17 @@ int main(int argc, char *argv[]) // 初始化 config.ini 配置文件 Utils::initConfig(); + // 回传版本信息,不涉及个人隐私 + DataCollectorAndUploader uploader; + QObject::connect(&uploader, &DataCollectorAndUploader::uploadSuccessful, [](){ + qDebug() << "Data uploaded successfully"; + }); + QObject::connect(&uploader, &DataCollectorAndUploader::uploadFailed, [](QString error){ + qDebug() << "Upload failed with error: " << error; + }); + + uploader.collectAndUploadData(); + // Set display backend Utils::setQPAPlatform(); diff --git a/src/spark-store.pro b/src/spark-store.pro index 724cb81..16dfc5d 100644 --- a/src/spark-store.pro +++ b/src/spark-store.pro @@ -34,6 +34,7 @@ CONFIG += c++11 link_pkgconfig PKGCONFIG += dtkcore dtkgui dtkwidget SOURCES += \ + backend/DataCollectorAndUploader.cpp \ backend/downloadworker.cpp \ backend/image_show.cpp \ backend/sparkapi.cpp \ @@ -58,6 +59,7 @@ SOURCES += \ mainwindow-dtk.cpp HEADERS += \ + backend/DataCollectorAndUploader.h \ backend/downloadworker.h \ backend/image_show.h \ backend/sparkapi.h \ diff --git a/src/utils/utils.cpp b/src/utils/utils.cpp index e502d8e..e4c7c34 100644 --- a/src/utils/utils.cpp +++ b/src/utils/utils.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #define UOSDeveloperModeFile "/var/lib/deepin/developer-mode/enabled" @@ -96,6 +97,11 @@ void Utils::initConfig() { config.setValue("runtime/useWayland", useWayland); } + + // check uuid + if (!config.contains("info/uuid")){ + config.setValue("info/uuid", initUUID()); + } config.sync(); // 写入更改至 config.ini,并同步最新内容 checkUOSDeveloperMode(); // Check UOS developer mode @@ -126,6 +132,14 @@ bool Utils::isUOS() return isUOS; } +/** + * @brief Utils::initUUID 生成 UUID +*/ +QString Utils::initUUID(){ + QUuid uuid = QUuid::createUuid(); + return uuid.toString(); +} + /** * @brief Utils::setQPAPlatform Set display backend */ diff --git a/src/utils/utils.h b/src/utils/utils.h index 154e9b8..4351c08 100644 --- a/src/utils/utils.h +++ b/src/utils/utils.h @@ -12,6 +12,7 @@ public: static bool isWayland(); static void initConfig(); static bool isUOS(); + static QString initUUID(); static void setQPAPlatform(); static void checkUOSDeveloperMode(); static QJsonObject parseFeatureJsonFile(); From 8d4874d55313545720350619f5562e1dc3bf963b Mon Sep 17 00:00:00 2001 From: uniartisan Date: Tue, 24 Oct 2023 19:25:32 +0800 Subject: [PATCH 14/23] =?UTF-8?q?feat:=20=E4=BD=BF=E7=94=A8dbus=E6=94=AF?= =?UTF-8?q?=E6=8C=81kde=E7=9A=84=E6=9A=97=E8=89=B2=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/ThemeChecker.cpp | 44 ++++++++++++ src/backend/ThemeChecker.h | 26 ++++++++ src/mainwindow-dtk.cpp | 126 ++++++++++++++++++++++------------- src/mainwindow-dtk.h | 3 + src/spark-store.pro | 2 + 5 files changed, 153 insertions(+), 48 deletions(-) create mode 100644 src/backend/ThemeChecker.cpp create mode 100644 src/backend/ThemeChecker.h diff --git a/src/backend/ThemeChecker.cpp b/src/backend/ThemeChecker.cpp new file mode 100644 index 0000000..3d57b1c --- /dev/null +++ b/src/backend/ThemeChecker.cpp @@ -0,0 +1,44 @@ +#include "ThemeChecker.h" +#include +#include +#include + +ThemeChecker::ThemeChecker(QObject *parent) : QObject(parent), lastColorSchema(-1) { + timer = new QTimer(this); + connect(timer, SIGNAL(timeout()), this, SLOT(checkThemeChange())); + timer->start(1000); +} + +void ThemeChecker::checkThemeChange() { + + + QProcess process; + QStringList parameters; + parameters << "-c" << "dbus-send --session --print-reply=literal --reply-timeout=1000 --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:'org.freedesktop.appearance' string:'color-scheme'"; + process.start("/bin/sh", parameters); + + if (process.waitForFinished(-1)) { + QString errorOutput = QString(process.readAllStandardError()).trimmed(); + if (!errorOutput.isEmpty()) { + qWarning() << "检测到DBus错误:" << errorOutput; + return; + } + + QString output = QString(process.readAll()).trimmed(); + int systemColorSchema = output.right(1).toInt(); + + if(systemColorSchema != lastColorSchema) { + lastColorSchema = systemColorSchema; + qDebug() << "主题已更改,新的主题是:" << systemColorSchema; + if(systemColorSchema == 1){ + emit themeChanged(true); + } + else if(systemColorSchema == 0 || systemColorSchema == 2){ + emit themeChanged(false); + } + } + } else { + qWarning() << "DBus调用未能完成"; + } +} + diff --git a/src/backend/ThemeChecker.h b/src/backend/ThemeChecker.h new file mode 100644 index 0000000..4ca29f2 --- /dev/null +++ b/src/backend/ThemeChecker.h @@ -0,0 +1,26 @@ +#ifndef THEMECHECKER_H +#define THEMECHECKER_H + +#include +#include + + +class ThemeChecker : public QObject +{ + Q_OBJECT +public: + explicit ThemeChecker(QObject *parent = nullptr); + +signals: + void themeChanged(bool isDark); + +public slots: + void checkThemeChange(); + + +private: + int lastColorSchema; + QTimer *timer; +}; + +#endif // THEMECHECKER_H diff --git a/src/mainwindow-dtk.cpp b/src/mainwindow-dtk.cpp index 4cc8a90..48155bb 100644 --- a/src/mainwindow-dtk.cpp +++ b/src/mainwindow-dtk.cpp @@ -16,6 +16,8 @@ #include #include +#include + #define AppPageApplist 0 #define AppPageSearchlist 1 #define AppPageAppdetail 2 @@ -267,57 +269,85 @@ void MainWindow::initTrayIcon() trayIcon->show(); } -void MainWindow::initConnections() +void MainWindow::refreshTheme(bool isDarkMode) { - // 主题切换 - 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;}"); - } + // 使用isDarkMode变量来判断是否是深色模式 + if (isDarkMode) { + //深色模式 + 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;}"); } } - 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); }); + } 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(isDarkMode); + ui->applistpage_1->setTheme(isDarkMode); + ui->appintopage->setTheme(isDarkMode); + ui->settingspage->setTheme(isDarkMode); +} + +void MainWindow::onThemeChanged(bool isDark) { + DGuiApplicationHelper::ColorType currentTheme = DGuiApplicationHelper::instance()->themeType(); + + // 检查是否用户手动设置为暗色模式 + bool isUserSetDark = (currentTheme == DGuiApplicationHelper::DarkType); + bool isUserSetWhite = !(currentTheme == DGuiApplicationHelper::LightType); + + if (!isUserSetDark && !isUserSetWhite) { + // 否则,根据传入的 isDark 值设置 + refreshTheme(isDark); + } +} + + +void MainWindow::initConnections() +{ + + // 主题切换 + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [=](DGuiApplicationHelper::ColorType themeType) + { + bool isDarkMode = (themeType == DGuiApplicationHelper::ColorType::DarkType); + refreshTheme(isDarkMode); + }); + + ThemeChecker *themeChecker = new ThemeChecker(this); + connect(themeChecker, SIGNAL(themeChanged(bool)), this, SLOT(onThemeChanged(bool))); + + // appintopage按下下载按钮时标题栏下载列表按钮抖动 connect(ui->appintopage, &AppIntoPage::clickedDownloadBtn, [=]() diff --git a/src/mainwindow-dtk.h b/src/mainwindow-dtk.h index 11fd60e..4831a59 100644 --- a/src/mainwindow-dtk.h +++ b/src/mainwindow-dtk.h @@ -30,6 +30,8 @@ public: void openUrl(const QString &url); bool isCloseWindowAnimation(); + void refreshTheme(bool isDarkMode); + protected: void closeEvent(QCloseEvent *event) override; @@ -48,6 +50,7 @@ private: public slots: void notify(QObject *receiver, QEvent *event); + void onThemeChanged(bool isDark); private slots: //接受来自dbus的url diff --git a/src/spark-store.pro b/src/spark-store.pro index 16dfc5d..481c4db 100644 --- a/src/spark-store.pro +++ b/src/spark-store.pro @@ -35,6 +35,7 @@ PKGCONFIG += dtkcore dtkgui dtkwidget SOURCES += \ backend/DataCollectorAndUploader.cpp \ + backend/ThemeChecker.cpp \ backend/downloadworker.cpp \ backend/image_show.cpp \ backend/sparkapi.cpp \ @@ -60,6 +61,7 @@ SOURCES += \ HEADERS += \ backend/DataCollectorAndUploader.h \ + backend/ThemeChecker.h \ backend/downloadworker.h \ backend/image_show.h \ backend/sparkapi.h \ From 5cb1cff0cabd7103d049ab0146a0e75fd4a0277a Mon Sep 17 00:00:00 2001 From: uniartisan Date: Tue, 24 Oct 2023 19:25:32 +0800 Subject: [PATCH 15/23] =?UTF-8?q?feat:=20=E4=BD=BF=E7=94=A8dbus=E6=94=AF?= =?UTF-8?q?=E6=8C=81kde=E7=9A=84=E6=9A=97=E8=89=B2=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + src/backend/ThemeChecker.cpp | 44 ++++++++++ src/backend/ThemeChecker.h | 26 ++++++ src/mainwindow-dtk.cpp | 134 +++++++++++++++++++----------- src/mainwindow-dtk.h | 3 + src/spark-store.pro | 2 + translations/spark-store_en.ts | 22 ++--- translations/spark-store_es.ts | 22 ++--- translations/spark-store_fr.ts | 22 ++--- translations/spark-store_zh_CN.ts | 22 ++--- translations/spark-store_zh_TW.ts | 22 ++--- 11 files changed, 216 insertions(+), 104 deletions(-) create mode 100644 src/backend/ThemeChecker.cpp create mode 100644 src/backend/ThemeChecker.h diff --git a/.gitignore b/.gitignore index 6fe4004..21d239c 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,4 @@ debian/*.substvars debian/spark-store .vscode/* +src/spark-store diff --git a/src/backend/ThemeChecker.cpp b/src/backend/ThemeChecker.cpp new file mode 100644 index 0000000..3d57b1c --- /dev/null +++ b/src/backend/ThemeChecker.cpp @@ -0,0 +1,44 @@ +#include "ThemeChecker.h" +#include +#include +#include + +ThemeChecker::ThemeChecker(QObject *parent) : QObject(parent), lastColorSchema(-1) { + timer = new QTimer(this); + connect(timer, SIGNAL(timeout()), this, SLOT(checkThemeChange())); + timer->start(1000); +} + +void ThemeChecker::checkThemeChange() { + + + QProcess process; + QStringList parameters; + parameters << "-c" << "dbus-send --session --print-reply=literal --reply-timeout=1000 --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:'org.freedesktop.appearance' string:'color-scheme'"; + process.start("/bin/sh", parameters); + + if (process.waitForFinished(-1)) { + QString errorOutput = QString(process.readAllStandardError()).trimmed(); + if (!errorOutput.isEmpty()) { + qWarning() << "检测到DBus错误:" << errorOutput; + return; + } + + QString output = QString(process.readAll()).trimmed(); + int systemColorSchema = output.right(1).toInt(); + + if(systemColorSchema != lastColorSchema) { + lastColorSchema = systemColorSchema; + qDebug() << "主题已更改,新的主题是:" << systemColorSchema; + if(systemColorSchema == 1){ + emit themeChanged(true); + } + else if(systemColorSchema == 0 || systemColorSchema == 2){ + emit themeChanged(false); + } + } + } else { + qWarning() << "DBus调用未能完成"; + } +} + diff --git a/src/backend/ThemeChecker.h b/src/backend/ThemeChecker.h new file mode 100644 index 0000000..4ca29f2 --- /dev/null +++ b/src/backend/ThemeChecker.h @@ -0,0 +1,26 @@ +#ifndef THEMECHECKER_H +#define THEMECHECKER_H + +#include +#include + + +class ThemeChecker : public QObject +{ + Q_OBJECT +public: + explicit ThemeChecker(QObject *parent = nullptr); + +signals: + void themeChanged(bool isDark); + +public slots: + void checkThemeChange(); + + +private: + int lastColorSchema; + QTimer *timer; +}; + +#endif // THEMECHECKER_H diff --git a/src/mainwindow-dtk.cpp b/src/mainwindow-dtk.cpp index 4cc8a90..1e1e210 100644 --- a/src/mainwindow-dtk.cpp +++ b/src/mainwindow-dtk.cpp @@ -16,6 +16,8 @@ #include #include +#include + #define AppPageApplist 0 #define AppPageSearchlist 1 #define AppPageAppdetail 2 @@ -139,7 +141,7 @@ void MainWindow::initTitleBar() { ui->titlebar->setIcon(QIcon::fromTheme("spark-store")); ui->titlebar->setBackgroundTransparent(true); - // ui->titlebar->setSwitchThemeMenuVisible(false); // 去除 dtk 标题栏主题切换菜单 + ui->titlebar->setSwitchThemeMenuVisible(false); // 去除 dtk 标题栏主题切换菜单 // 初始化标题栏控件 DLabel *title = new DLabel(ui->titlebar); @@ -267,57 +269,91 @@ void MainWindow::initTrayIcon() trayIcon->show(); } -void MainWindow::initConnections() +void MainWindow::refreshTheme(bool isDarkMode) { - // 主题切换 - 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;}"); - } + // 使用isDarkMode变量来判断是否是深色模式 + if (isDarkMode) { + //深色模式 + 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;}"); } } - 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); }); + } 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(isDarkMode); + ui->applistpage_1->setTheme(isDarkMode); + ui->appintopage->setTheme(isDarkMode); + ui->settingspage->setTheme(isDarkMode); +} + +void MainWindow::onThemeChanged(bool isDark) { + DGuiApplicationHelper::ColorType currentTheme = DGuiApplicationHelper::instance()->themeType(); + + // 检查当前外观设置 + bool isUserSetDark = (currentTheme == DGuiApplicationHelper::DarkType); //当前已经是深色模式 + bool isUserSetWhite = (currentTheme == DGuiApplicationHelper::LightType); //当前已经是浅色模式 + + // 检查 isDark 为 true 时, isUserSetDark 是否为 true + // 检查 isDark 为 false , isUserSetWhite 是否为 ture + qDebug() << isUserSetDark << isUserSetWhite << isDark; + + + if ((isUserSetDark != isDark) || (isUserSetWhite == !isDark)) { + // 否则,根据传入的 isDark 值设置 + refreshTheme(isDark); + } + +} + + +void MainWindow::initConnections() +{ + + // 主题切换 + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [=](DGuiApplicationHelper::ColorType themeType) + { + bool isDarkMode = (themeType == DGuiApplicationHelper::ColorType::DarkType); + refreshTheme(isDarkMode); + }); + + ThemeChecker *themeChecker = new ThemeChecker(this); + connect(themeChecker, SIGNAL(themeChanged(bool)), this, SLOT(onThemeChanged(bool))); + + // appintopage按下下载按钮时标题栏下载列表按钮抖动 connect(ui->appintopage, &AppIntoPage::clickedDownloadBtn, [=]() diff --git a/src/mainwindow-dtk.h b/src/mainwindow-dtk.h index 11fd60e..4831a59 100644 --- a/src/mainwindow-dtk.h +++ b/src/mainwindow-dtk.h @@ -30,6 +30,8 @@ public: void openUrl(const QString &url); bool isCloseWindowAnimation(); + void refreshTheme(bool isDarkMode); + protected: void closeEvent(QCloseEvent *event) override; @@ -48,6 +50,7 @@ private: public slots: void notify(QObject *receiver, QEvent *event); + void onThemeChanged(bool isDark); private slots: //接受来自dbus的url diff --git a/src/spark-store.pro b/src/spark-store.pro index 16dfc5d..481c4db 100644 --- a/src/spark-store.pro +++ b/src/spark-store.pro @@ -35,6 +35,7 @@ PKGCONFIG += dtkcore dtkgui dtkwidget SOURCES += \ backend/DataCollectorAndUploader.cpp \ + backend/ThemeChecker.cpp \ backend/downloadworker.cpp \ backend/image_show.cpp \ backend/sparkapi.cpp \ @@ -60,6 +61,7 @@ SOURCES += \ HEADERS += \ backend/DataCollectorAndUploader.h \ + backend/ThemeChecker.h \ backend/downloadworker.h \ backend/image_show.h \ backend/sparkapi.h \ diff --git a/translations/spark-store_en.ts b/translations/spark-store_en.ts index 1579777..aa11124 100644 --- a/translations/spark-store_en.ts +++ b/translations/spark-store_en.ts @@ -480,33 +480,33 @@ - + Submit App - + Submit App with client(Recommanded) - + Settings - + APP Upgrade and Install Settings - - + + Spark Store - + Search or enter spk:// @@ -516,7 +516,7 @@ - + Spark Store @@ -536,7 +536,7 @@ - + Show MainWindow @@ -658,12 +658,12 @@ TitleBarMenu - + About - + Exit diff --git a/translations/spark-store_es.ts b/translations/spark-store_es.ts index bb740a2..28ee71c 100644 --- a/translations/spark-store_es.ts +++ b/translations/spark-store_es.ts @@ -480,33 +480,33 @@ Actualización de app - + Submit App Presentación de la aplicación - + Submit App with client(Recommanded) Enviar la aplicación al cliente (recomendación) - + Settings Configuración - + APP Upgrade and Install Settings Actualización e instalación de app - - + + Spark Store SPARK Store - + Search or enter spk:// Buscar o introducir spk: /% @@ -516,7 +516,7 @@ - + Spark Store SPARK Store @@ -536,7 +536,7 @@ Descargar lista - + Show MainWindow Mostrar la ventana principal @@ -658,12 +658,12 @@ TitleBarMenu - + About Sobre - + Exit Exportaciones diff --git a/translations/spark-store_fr.ts b/translations/spark-store_fr.ts index abde11d..5801d28 100644 --- a/translations/spark-store_fr.ts +++ b/translations/spark-store_fr.ts @@ -480,33 +480,33 @@ Mise à niveau app - + Submit App Soumettre une application - + Submit App with client(Recommanded) Soumettre une demande au client (recommandé) - + Settings Paramètres - + APP Upgrade and Install Settings Paramètres de mise à niveau et d'installation de l'app - - + + Spark Store Le Spark store - + Search or enter spk:// Rechercher ou entrer SPK / @@ -516,7 +516,7 @@ - + Spark Store Le Spark store @@ -536,7 +536,7 @@ Télécharger la Liste - + Show MainWindow Afficher la fenêtre principale @@ -658,12 +658,12 @@ TitleBarMenu - + About À propos - + Exit Exportations diff --git a/translations/spark-store_zh_CN.ts b/translations/spark-store_zh_CN.ts index 7cb6ae0..8ebdcae 100644 --- a/translations/spark-store_zh_CN.ts +++ b/translations/spark-store_zh_CN.ts @@ -480,33 +480,33 @@ 更新 - + Submit App 投递应用 - + Submit App with client(Recommanded) 使用本地投稿器投递应用(推荐) - + Settings 设置 - + APP Upgrade and Install Settings 应用更新和安装设置 - - + + Spark Store 星火应用商店 - + Search or enter spk:// 搜索或打开链接 @@ -516,7 +516,7 @@ - + Spark Store 星火应用商店 @@ -536,7 +536,7 @@ 下载列表 - + Show MainWindow 显示主窗口 @@ -658,12 +658,12 @@ TitleBarMenu - + About 关于 - + Exit 退出 diff --git a/translations/spark-store_zh_TW.ts b/translations/spark-store_zh_TW.ts index 4aa4b63..3c2f0c3 100644 --- a/translations/spark-store_zh_TW.ts +++ b/translations/spark-store_zh_TW.ts @@ -480,33 +480,33 @@ 軟體更新 - + Submit App 上傳軟體 - + Submit App with client(Recommanded) 從客戶端上傳軟體(推薦的) - + Settings 設定 - + APP Upgrade and Install Settings 軟體升級 和 安裝設定 - - + + Spark Store 星火应用商店 - + Search or enter spk:// 搜索或打开链接 @@ -516,7 +516,7 @@ - + Spark Store 星火应用商店 @@ -536,7 +536,7 @@ 下载列表 - + Show MainWindow 显示主窗口 @@ -658,12 +658,12 @@ TitleBarMenu - + About 关于 - + Exit 退出 From 0db7fad6408b40bf633050c9e3571e5b88e15fb6 Mon Sep 17 00:00:00 2001 From: zty199 <1282441920@qq.com> Date: Sat, 28 Oct 2023 12:15:45 +0000 Subject: [PATCH 16/23] =?UTF-8?q?!241=20chore:=20=E4=BC=98=E5=8C=96=20KDE?= =?UTF-8?q?=20=E6=B7=B1=E8=89=B2=E6=A8=A1=E5=BC=8F=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=96=B9=E5=BC=8F=20*=20chore:=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20KDE=20=E6=B7=B1=E8=89=B2=E6=A8=A1=E5=BC=8F=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=AE=9E=E7=8E=B0=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/ThemeChecker.cpp | 171 ++++++++++++++++++++++++++++------- src/backend/ThemeChecker.h | 26 ++++-- src/mainwindow-dtk.cpp | 37 +------- src/mainwindow-dtk.h | 4 +- 4 files changed, 161 insertions(+), 77 deletions(-) mode change 100644 => 100755 src/backend/ThemeChecker.cpp mode change 100644 => 100755 src/backend/ThemeChecker.h mode change 100644 => 100755 src/mainwindow-dtk.cpp mode change 100644 => 100755 src/mainwindow-dtk.h diff --git a/src/backend/ThemeChecker.cpp b/src/backend/ThemeChecker.cpp old mode 100644 new mode 100755 index 3d57b1c..754c3bb --- a/src/backend/ThemeChecker.cpp +++ b/src/backend/ThemeChecker.cpp @@ -1,44 +1,147 @@ #include "ThemeChecker.h" -#include -#include + +#include #include -ThemeChecker::ThemeChecker(QObject *parent) : QObject(parent), lastColorSchema(-1) { - timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(checkThemeChange())); - timer->start(1000); +Q_GLOBAL_STATIC(ThemeChecker, m_instance) + +constexpr char kFreedesktopPortalServiceName[] = "org.freedesktop.portal.Desktop"; +constexpr char kFreedesktopPortalServicePath[] = "/org/freedesktop/portal/desktop"; +constexpr char kFreedesktopPortalSettingsInterface[] = "org.freedesktop.portal.Settings"; + +ThemeChecker::ThemeChecker(QObject *parent) + : QObject(parent) + , m_paletteType(Dtk::Gui::DGuiApplicationHelper::instance()->paletteType()) +{ + m_interface = new QDBusInterface(kFreedesktopPortalServiceName, + kFreedesktopPortalServicePath, + kFreedesktopPortalSettingsInterface, + QDBusConnection::sessionBus(), + this); + + initThemeType(); + initConnections(); } -void ThemeChecker::checkThemeChange() { +ThemeChecker *ThemeChecker::instance() +{ + return m_instance; +} - - QProcess process; - QStringList parameters; - parameters << "-c" << "dbus-send --session --print-reply=literal --reply-timeout=1000 --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:'org.freedesktop.appearance' string:'color-scheme'"; - process.start("/bin/sh", parameters); - - if (process.waitForFinished(-1)) { - QString errorOutput = QString(process.readAllStandardError()).trimmed(); - if (!errorOutput.isEmpty()) { - qWarning() << "检测到DBus错误:" << errorOutput; - return; - } - - QString output = QString(process.readAll()).trimmed(); - int systemColorSchema = output.right(1).toInt(); - - if(systemColorSchema != lastColorSchema) { - lastColorSchema = systemColorSchema; - qDebug() << "主题已更改,新的主题是:" << systemColorSchema; - if(systemColorSchema == 1){ - emit themeChanged(true); - } - else if(systemColorSchema == 0 || systemColorSchema == 2){ - emit themeChanged(false); - } - } +bool ThemeChecker::useDarkTheme() +{ + if (m_paletteType == Dtk::Gui::DGuiApplicationHelper::ColorType::UnknownType) { + return m_themeType == Dtk::Gui::DGuiApplicationHelper::ColorType::DarkType; } else { - qWarning() << "DBus调用未能完成"; + return m_paletteType == Dtk::Gui::DGuiApplicationHelper::ColorType::DarkType; } } +void ThemeChecker::initThemeType() +{ + QVariantList args { "org.freedesktop.appearance", "color-scheme" }; + QDBusMessage msg = m_interface->callWithArgumentList(QDBus::Block, "Read", args); + if (msg.type() != QDBusMessage::MessageType::ReplyMessage || msg.arguments().size() < 1) { + qWarning().noquote() << "Init color-scheme from D-Bus failed:" << msg.errorName() << msg.errorMessage(); + m_themeType = Dtk::Gui::DGuiApplicationHelper::toColorType(Dtk::Gui::DGuiApplicationHelper::fetchPalette(Dtk::Gui::DGuiApplicationHelper::instance()->applicationTheme())); + return; + } + + quint32 colorScheme = qvariant_cast(qvariant_cast(msg.arguments().first()).variant()).variant().toUInt(); + switch (colorScheme) { + case 1: + m_themeType = Dtk::Gui::DGuiApplicationHelper::ColorType::DarkType; + break; + case 2: + m_themeType = Dtk::Gui::DGuiApplicationHelper::ColorType::LightType; + break; + default: + qInfo().noquote() << QString("color-scheme: %1, fetching themeType according to QPalette::Window").arg(colorScheme); + m_themeType = Dtk::Gui::DGuiApplicationHelper::toColorType(Dtk::Gui::DGuiApplicationHelper::fetchPalette(Dtk::Gui::DGuiApplicationHelper::instance()->applicationTheme())); + break; + } + + if (m_paletteType == Dtk::Gui::DGuiApplicationHelper::ColorType::UnknownType) { + Dtk::Gui::DGuiApplicationHelper::instance()->setApplicationPalette(Dtk::Gui::DGuiApplicationHelper::standardPalette(m_themeType)); + } +} + +void ThemeChecker::initConnections() +{ + QDBusConnection::sessionBus().connect(kFreedesktopPortalServiceName, + kFreedesktopPortalServicePath, + kFreedesktopPortalSettingsInterface, + "SettingChanged", + this, + SLOT(slotSettingChanged(const QString &, const QString &, const QDBusVariant &))); + + connect(Dtk::Gui::DGuiApplicationHelper::instance()->applicationTheme(), &Dtk::Gui::DPlatformTheme::themeNameChanged, this, &ThemeChecker::slotThemeNameChanged); + connect(Dtk::Gui::DGuiApplicationHelper::instance(), &Dtk::Gui::DGuiApplicationHelper::paletteTypeChanged, this, &ThemeChecker::slotPaletteTypeChanged); +} + +void ThemeChecker::slotSettingChanged(const QString &_namespace, const QString &key, const QDBusVariant &variant) +{ + if (_namespace != "org.freedesktop.appearance" || key != "color-scheme") { + return; + } + + Dtk::Gui::DGuiApplicationHelper::ColorType colorType = Dtk::Gui::DGuiApplicationHelper::ColorType::UnknownType; + + quint32 colorScheme = variant.variant().toUInt(); + switch (colorScheme) { + case 1: + colorType = Dtk::Gui::DGuiApplicationHelper::ColorType::DarkType; + break; + case 2: + colorType = Dtk::Gui::DGuiApplicationHelper::ColorType::LightType; + break; + default: + qInfo().noquote() << QString("color-scheme: %1, fetching themeType according to QPalette::Window").arg(colorScheme); + colorType = Dtk::Gui::DGuiApplicationHelper::toColorType(Dtk::Gui::DGuiApplicationHelper::fetchPalette(Dtk::Gui::DGuiApplicationHelper::instance()->applicationTheme())); + break; + } + + if (m_paletteType != Dtk::Gui::DGuiApplicationHelper::ColorType::UnknownType) { + m_themeType = colorType; + return; + } + + if (m_themeType != colorType) { + Dtk::Gui::DGuiApplicationHelper::instance()->setApplicationPalette(Dtk::Gui::DGuiApplicationHelper::standardPalette(colorType)); + emit themeChanged(colorType == Dtk::Gui::DGuiApplicationHelper::ColorType::DarkType); + m_themeType = colorType; + } +} + +void ThemeChecker::slotThemeNameChanged(const QByteArray &theme) +{ + Dtk::Gui::DGuiApplicationHelper::ColorType themeType = Dtk::Gui::DGuiApplicationHelper::ColorType::LightType; + if (theme.endsWith("dark")) { + themeType = Dtk::Gui::DGuiApplicationHelper::ColorType::DarkType; + } + + if (m_paletteType != Dtk::Gui::DGuiApplicationHelper::ColorType::UnknownType) { + m_themeType = themeType; + return; + } + + if (m_themeType != themeType) { + Dtk::Gui::DGuiApplicationHelper::instance()->setApplicationPalette(Dtk::Gui::DGuiApplicationHelper::standardPalette(themeType)); + emit themeChanged(themeType == Dtk::Gui::DGuiApplicationHelper::ColorType::DarkType); + m_themeType = themeType; + } +} + +void ThemeChecker::slotPaletteTypeChanged(Dtk::Gui::DGuiApplicationHelper::ColorType paletteType) +{ + m_paletteType = paletteType; + + if (m_paletteType != Dtk::Gui::DGuiApplicationHelper::ColorType::UnknownType) { + Dtk::Gui::DGuiApplicationHelper::instance()->setApplicationPalette(Dtk::Gui::DGuiApplicationHelper::standardPalette(m_paletteType)); + emit themeChanged(m_paletteType == Dtk::Gui::DGuiApplicationHelper::ColorType::DarkType); + return; + } + + Dtk::Gui::DGuiApplicationHelper::instance()->setApplicationPalette(Dtk::Gui::DGuiApplicationHelper::standardPalette(m_themeType)); + emit themeChanged(m_themeType == Dtk::Gui::DGuiApplicationHelper::ColorType::DarkType); +} diff --git a/src/backend/ThemeChecker.h b/src/backend/ThemeChecker.h old mode 100644 new mode 100755 index 4ca29f2..f74ae44 --- a/src/backend/ThemeChecker.h +++ b/src/backend/ThemeChecker.h @@ -2,25 +2,39 @@ #define THEMECHECKER_H #include -#include +#include +#include +#include +#include class ThemeChecker : public QObject { Q_OBJECT + public: explicit ThemeChecker(QObject *parent = nullptr); + static ThemeChecker *instance(); + + bool useDarkTheme(); + +private: + void initThemeType(); + void initConnections(); signals: void themeChanged(bool isDark); -public slots: - void checkThemeChange(); - +private slots: + void slotSettingChanged(const QString &_namespace, const QString &key, const QDBusVariant &variant); + void slotThemeNameChanged(const QByteArray &theme); + void slotPaletteTypeChanged(Dtk::Gui::DGuiApplicationHelper::ColorType paletteType); private: - int lastColorSchema; - QTimer *timer; + QDBusInterface *m_interface = nullptr; + + Dtk::Gui::DGuiApplicationHelper::ColorType m_paletteType; + Dtk::Gui::DGuiApplicationHelper::ColorType m_themeType; }; #endif // THEMECHECKER_H diff --git a/src/mainwindow-dtk.cpp b/src/mainwindow-dtk.cpp old mode 100644 new mode 100755 index 1e1e210..151a758 --- a/src/mainwindow-dtk.cpp +++ b/src/mainwindow-dtk.cpp @@ -41,8 +41,6 @@ MainWindow::MainWindow(QWidget *parent) initTmpDir(); ui->appintopage->setDownloadWidget(downloadlistwidget); - - emit DGuiApplicationHelper::instance()->themeTypeChanged(DGuiApplicationHelper::instance()->themeType()); } MainWindow::~MainWindow() @@ -135,13 +133,14 @@ void MainWindow::initUI() updateUi(0); initTrayIcon(); + + refreshTheme(ThemeChecker::instance()->useDarkTheme()); } 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); @@ -320,40 +319,10 @@ void MainWindow::refreshTheme(bool isDarkMode) ui->settingspage->setTheme(isDarkMode); } -void MainWindow::onThemeChanged(bool isDark) { - DGuiApplicationHelper::ColorType currentTheme = DGuiApplicationHelper::instance()->themeType(); - - // 检查当前外观设置 - bool isUserSetDark = (currentTheme == DGuiApplicationHelper::DarkType); //当前已经是深色模式 - bool isUserSetWhite = (currentTheme == DGuiApplicationHelper::LightType); //当前已经是浅色模式 - - // 检查 isDark 为 true 时, isUserSetDark 是否为 true - // 检查 isDark 为 false , isUserSetWhite 是否为 ture - qDebug() << isUserSetDark << isUserSetWhite << isDark; - - - if ((isUserSetDark != isDark) || (isUserSetWhite == !isDark)) { - // 否则,根据传入的 isDark 值设置 - refreshTheme(isDark); - } - -} - - void MainWindow::initConnections() { - // 主题切换 - connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [=](DGuiApplicationHelper::ColorType themeType) - { - bool isDarkMode = (themeType == DGuiApplicationHelper::ColorType::DarkType); - refreshTheme(isDarkMode); - }); - - ThemeChecker *themeChecker = new ThemeChecker(this); - connect(themeChecker, SIGNAL(themeChanged(bool)), this, SLOT(onThemeChanged(bool))); - - + connect(ThemeChecker::instance(), &ThemeChecker::themeChanged, this, &MainWindow::refreshTheme); // appintopage按下下载按钮时标题栏下载列表按钮抖动 connect(ui->appintopage, &AppIntoPage::clickedDownloadBtn, [=]() diff --git a/src/mainwindow-dtk.h b/src/mainwindow-dtk.h old mode 100644 new mode 100755 index 4831a59..a5621c3 --- a/src/mainwindow-dtk.h +++ b/src/mainwindow-dtk.h @@ -30,8 +30,7 @@ public: void openUrl(const QString &url); bool isCloseWindowAnimation(); - void refreshTheme(bool isDarkMode); - + Q_INVOKABLE void refreshTheme(bool isDarkMode); protected: void closeEvent(QCloseEvent *event) override; @@ -50,7 +49,6 @@ private: public slots: void notify(QObject *receiver, QEvent *event); - void onThemeChanged(bool isDark); private slots: //接受来自dbus的url From 9a47b5515cb35a3cca5a617e0f78c6ce77967850 Mon Sep 17 00:00:00 2001 From: shenmo Date: Sun, 29 Oct 2023 08:00:19 +0000 Subject: [PATCH 17/23] update debian/changelog. Signed-off-by: shenmo --- debian/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index 7725157..09d7a0d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ spark-store (4.2.8) stable; urgency=medium * 修复:ssinstall在aptss上锁时应当报错中断(WIP) * 调整:下载安装按钮文案修改 + * 优化 KDE 深色模式支持实现方式 -- shenmo Sun, 5 Mar 2022 11:45:14 +0800 From 7bde95a65c7c7adcd41a83fb05fc1ac7c6161479 Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 31 Oct 2023 22:07:21 +0800 Subject: [PATCH 18/23] =?UTF-8?q?feat:=20aptss=E6=94=AF=E6=8C=81=E7=AD=89?= =?UTF-8?q?=E5=BE=85=E8=A7=A3=E9=94=81=E8=80=8C=E4=B8=8D=E6=98=AF=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E9=80=80=E5=87=BA=20feat:=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=9B=E5=BB=BAdesktop=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 3 +- tool/apt-fast/ss-apt-fast | 25 +- tool/ssinstall | 226 ++++++++---------- tool/update-upgrade/ss-update-controler.sh | 21 +- ...=> ss-update-controler.sh.zh_CN.transhell} | 2 + .../ss-update-controler.sh.zh_TW.transhell | 2 + .../ss-update-controler.sh_en_US.transhell | 10 +- 7 files changed, 145 insertions(+), 144 deletions(-) rename tool/update-upgrade/transhell/{ss-update-controler.sh_zh_CN.transhell => ss-update-controler.sh.zh_CN.transhell} (83%) diff --git a/debian/changelog b/debian/changelog index 09d7a0d..49956cd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ spark-store (4.2.8) stable; urgency=medium - * 修复:ssinstall在aptss上锁时应当报错中断(WIP) + * 修复:在aptss上锁时支持等待释放锁而不是直接报错退出 * 调整:下载安装按钮文案修改 * 优化 KDE 深色模式支持实现方式 + * 新增:ssinstall现在会自动创建desktop文件 -- shenmo Sun, 5 Mar 2022 11:45:14 +0800 diff --git a/tool/apt-fast/ss-apt-fast b/tool/apt-fast/ss-apt-fast index 8b04b2a..ee04c61 100755 --- a/tool/apt-fast/ss-apt-fast +++ b/tool/apt-fast/ss-apt-fast @@ -158,7 +158,7 @@ DOWNLOADBEFORE= VERBOSE_OUTPUT= # Download command. -_DOWNLOADER='aria2c --no-conf -c -j ${_MAXNUM} -x ${_MAXCONPERSRV} -s ${_SPLITCON} -i ${DLLIST} --min-split-size=${_MINSPLITSZ} --stream-piece-selector=${_PIECEALGO} --connect-timeout=600 --timeout=600 -m0' +_DOWNLOADER='aria2c --no-conf -c -j ${_MAXNUM} -x ${_MAXCONPERSRV} -s ${_SPLITCON} -i ${DLLIST} --min-split-size=${_MINSPLITSZ} --stream-piece-selector=${_PIECEALGO} --connect-timeout=60 --timeout=600 -m0' # Load config file. CONFFILE="/tmp/aptss-conf/apt-fast.conf" @@ -207,17 +207,15 @@ fi msg_already_running() { - msg "apt-fast already running!" "warning" - msg "apt-fast 已经在运行了" "warning" - msg "Verify that all apt-fast processes are finished then remove $LCK_FILE.lock and try again." "hint" - msg "请确认所有的apt-fast进程已经结束,然后删除 $LCK_FILE.lock 后重试." "hint" + msg "Other aptss is running. Waited $timer senconds..." "normal" + msg "有其他的aptss正在运行。已经等待了$timer秒" "normal" } # Check if a lock file exists. -if [ -f "$LCK_FILE.lock" ]; then - msg_already_running - exit 1 -fi +#if [ -f "$LCK_FILE.lock" ]; then +# msg_already_running +# exit 1 +#fi # create the lock file and lock it, die on failure @@ -229,8 +227,13 @@ _create_lock() # This will hide the exit code trap "cleanup_aptfast" EXIT trap "cleanup_aptfast; exit 1" INT TERM - - flock -n $LCK_FD || { msg_already_running; exit 1; } + timer=0 + until $(flock -xn $LCK_FD);do + msg_already_running + sleep 1 + let timer+=1 + done + unset timer } # unlock and remove the lock file diff --git a/tool/ssinstall b/tool/ssinstall index 590e0e9..4c3e90b 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -3,7 +3,7 @@ source /opt/durapps/spark-store/bin/bashimport/transhell.amber load_transhell_debug -case `arch` in +case $(arch) in x86_64) STORE_URL="store" ;; @@ -12,156 +12,132 @@ case `arch` in ;; esac - - - -echo "Spark Store Install script.星火商店安装脚本" +echo "Spark Store Install script. 星火商店安装脚本" function pkexec_as_current_user() { - - #Detect the user using such display - local user=$(who | awk '{print $1}' | head -n 1) - #Detect the id of the user - local uid=$(id -u $user) - - sudo -u $user DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus pkexec "$@" + local user=$(who | awk '{print $1}' | head -n 1) + local uid=$(id -u "$user") + sudo -u "$user" DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/"$uid"/bus pkexec "$@" +} +function create_desktop_file() { + if [ -e $(sudo -u "$user" xdg-user-dir)/.config/spark-union/spark-store/ssshell-config-do-not-show-upgrade-notify ];then + echo "It is configured that do not create desktop file. Give up" + else + create_desktop_file + fi +] +function exec_create_desktop_file() { + local user=$(who | awk '{print $1}' | head -n 1) + for desktop_file_path in $(dpkg -L "$package_name" | grep .desktop); do + if [ "$(cat $desktop_file_path | grep NoDisplay=true)" = "" ];then + echo $desktop_file_path is checked and will be installed to desktop + sudo -u "$user" cp "$desktop_file_path" "$(sudo -u "$user" xdg-user-dir DESKTOP)/" + fi + done } -function zenity() -{ - - - #Detect the user using such display - local user=$(who | awk '{print $1}' | head -n 1) - - #Detect the id of the user - local uid=$(id -u $user) - - - sudo -u $user DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus zenity "$@" +function zenity() { + local user=$(who | awk '{print $1}' | head -n 1) + local uid=$(id -u "$user") + sudo -u "$user" DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/"$uid"/bus zenity "$@" } -function hash_check() -{ -if [ ! -e "/var/lib/aptss/lists/cdn.d.store.deepinos.org.cn_${STORE_URL}_Packages" ] && [ ! -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ] && [ ! -e "/var/lib/aptss/lists/mirrors.sdu.edu.cn_spark-store-repository_${STORE_URL}_Packages" ];then -echo "接收星火仓库软件信息中..." -aptss ssupdate -fi +function hash_check() { + if [ ! -e "/var/lib/aptss/lists/cdn.d.store.deepinos.org.cn_${STORE_URL}_Packages" ] && \ + [ ! -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ] && \ + [ ! -e "/var/lib/aptss/lists/mirrors.sdu.edu.cn_spark-store-repository_${STORE_URL}_Packages" ]; then + echo "接收星火仓库软件信息中..." + aptss ssupdate + fi -### 选择包信息位置 - -if [ -e "/var/lib/aptss/lists/cdn.d.store.deepinos.org.cn_${STORE_URL}_Packages" ];then -PACKAGES_DATA_PATH="/var/lib/aptss/lists/cdn.d.store.deepinos.org.cn_${STORE_URL}_Packages" -echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH,是星火域名单目录仓库配置" -elif [ -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ];then -PACKAGES_DATA_PATH="/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" -echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH,是星火域名单目录仓库配置" -else -PACKAGES_DATA_PATH="/var/lib/aptss/lists/mirrors.sdu.edu.cn_spark-store-repository_${STORE_URL}_Packages" -echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH,是SDU镜像仓库配置" -fi - - - -echo "正在运行包验证..." -echo "Running Spark Package Verify..." - -DEB_SHA512SUM=$(sha512sum "$1" | cut -d ' ' -f 1) - - -IS_SHA512SUM_CHECKD=`cat $PACKAGES_DATA_PATH | grep $DEB_SHA512SUM` + if [ -e "/var/lib/aptss/lists/cdn.d.store.deepinos.org.cn_${STORE_URL}_Packages" ]; then + PACKAGES_DATA_PATH="/var/lib/aptss/lists/cdn.d.store.deepinos.org.cn_${STORE_URL}_Packages" + echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH,是星火域名单目录仓库配置" + elif [ -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ]; then + PACKAGES_DATA_PATH="/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" + echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH,是星火域名单目录仓库配置" + else + PACKAGES_DATA_PATH="/var/lib/aptss/lists/mirrors.sdu.edu.cn_spark-store-repository_${STORE_URL}_Packages" + echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH,是SDU镜像仓库配置" + fi + echo "正在运行包验证..." + echo "Running Spark Package Verify..." + DEB_SHA512SUM=$(sha512sum "$1" | cut -d ' ' -f 1) + IS_SHA512SUM_CHECKED=$(cat "$PACKAGES_DATA_PATH" | grep "$DEB_SHA512SUM") } -########################################################################## -#################检测文件是否存在 -if [ $# -eq 0 ];then -echo "没有接收到参数,退出" -echo "用法:$0 deb路径" -echo "OMG-IT-GOES-WRONG" -exit -fi -if [ ! -f "$1" ] -then - echo "${TRANSHELL_CONTENT_FILE_NOT_EXIST}" +#################################### + +if [ $# -eq 0 ]; then + echo "没有接收到参数,退出" + echo "用法:$0 deb路径" echo "OMG-IT-GOES-WRONG" - exit 1 + exit fi -if [ "$(id -u)" != "0" ];then -#############################无root权限时 -echo "${TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT}" -echo "OMG-IT-GOES-WRONG" -exit 1 +if [ ! -f "$1" ]; then + echo "${TRANSHELL_CONTENT_FILE_NOT_EXIST}" + echo "OMG-IT-GOES-WRONG" + exit 1 fi -### +if [ "$(id -u)" != "0" ]; then + echo "${TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT}" + echo "OMG-IT-GOES-WRONG" + exit 1 +fi - -DEBPATH=`realpath $1` +DEBPATH=$(realpath "$1") hash_check "$DEBPATH" -if [ -z "$IS_SHA512SUM_CHECKD" ];then -echo "尝试更新仓库信息重新校验" -aptss ssupdate -hash_check "$DEBPATH" +if [ -z "$IS_SHA512SUM_CHECKED" ]; then + echo "尝试更新仓库信息重新校验" + aptss ssupdate + hash_check "$DEBPATH" fi -if [ ! -z "$IS_SHA512SUM_CHECKD" ];then +if [ ! -z "$IS_SHA512SUM_CHECKED" ]; then + echo "校验成功,开始安装" + echo "----------------------------------------------------------------------------------" + package_name=$(dpkg-deb -f "$DEBPATH" Package) + echo "Package name is $package_name" + try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH") + try_run_ret="$?" -echo "校验成功,开始安装" -echo ---------------------------------------------------------------------------------- -package_name=$(dpkg-deb -f "$DEBPATH" Package) -echo "Package name is $package_name" -try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH") -try_run_ret="$?" + if [ "$try_run_ret" -ne 0 ]; then + echo "OMG-IT-GOES-WRONG" + echo -e "${try_run_output}" + exit "$try_run_ret" + fi - if [ "$try_run_ret" -ne 0 ] - then - echo "OMG-IT-GOES-WRONG" - echo -e "${try_run_output}" - exit "$try_run_ret" - fi + dpkg -i "$DEBPATH" || aptss install -yf - -dpkg -i "$DEBPATH" || aptss install -yf - -#### --delete -if [ "$?" = "0" ] && [ "$2" = "--delete-after-install" ];then -##check if is installed yet -if dpkg -s "$package_name" >/dev/null 2>&1; then - echo "软件包已安装:$package_name" - rm "$DEBPATH" -echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}" -else - echo "软件包未安装:$package_name" - echo "安装异常!抛出错误" -echo "OMG-IT-GOES-WRONG" + if [ "$?" = "0" ] && [ "$2" = "--delete-after-install" ]; then + if dpkg -s "$package_name" >/dev/null 2>&1; then + echo "软件包已安装:$package_name" + create_desktop_file + rm "$DEBPATH" + echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}" + else + echo "软件包未安装:$package_name" + echo "安装异常!抛出错误" + echo "OMG-IT-GOES-WRONG" + fi + else + echo "${TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB}" + if dpkg -s "$package_name" >/dev/null 2>&1; then + echo "软件包已安装:$package_name" + create_desktop_file + else + echo "软件包未安装:$package_name" + echo "安装异常!抛出错误" + echo "OMG-IT-GOES-WRONG" + fi + fi fi - -else -echo "${TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB}" -if dpkg -s "$package_name" >/dev/null 2>&1; then - echo "软件包已安装:$package_name" -else - echo "软件包未安装:$package_name" - echo "安装异常!抛出错误" -echo "OMG-IT-GOES-WRONG" -fi - -fi - -else - - -zenity --info --icon-name=spark-store --height 270 --width 500 --text "${TRANSHELL_CONTENT_HASH_CHECK_FAILED}" - -echo -e ${TRANSHELL_CONTENT_HASH_CHECK_FAILED} -echo "OMG-IT-GOES-WRONG" - -fi diff --git a/tool/update-upgrade/ss-update-controler.sh b/tool/update-upgrade/ss-update-controler.sh index f75f73d..c6297a0 100755 --- a/tool/update-upgrade/ss-update-controler.sh +++ b/tool/update-upgrade/ss-update-controler.sh @@ -15,9 +15,16 @@ else text_update_open="${TRANSHELL_CONTENT_OPEN}" fi +if [ ! -e $HOME/.config/spark-union/spark-store/ssshell-config-do-not-create-desktop ];then +CONTENT_SET_CREATE_DESKTOP="${TRANSHELL_CONTENT_CLOSE_CREATE_DESKTOP}" +#已经开启了就显示关闭 +else +CONTENT_SET_CREATE_DESKTOP="${TRANSHELL_CONTENT_OPEN_CREATE_DESKTOP}" +fi + update_transhell -option=`zenity --list --text="${TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN}" --column 数字 --column=${TRANSHELL_CONTENT_OPTIONS} --print-column=2 --height 350 --width 760 0 "${TRANSHELL_CONTENT_OPEN_OR_CLOSE_UPGRADE_CHECK}" 1 "${TRANSHELL_CONTENT_CHECK_FOR_UPDATE}" 2 "${TRANSHELL_CONTENT_EXIT}" --hide-column=1 --print-column=1` +option=`zenity --list --text="${TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN}" --column 数字 --column=${TRANSHELL_CONTENT_OPTIONS} --print-column=2 --height 350 --width 760 0 "${TRANSHELL_CONTENT_OPEN_OR_CLOSE_UPGRADE_CHECK}" 1 "${CONTENT_SET_CREATE_DESKTOP}" 2 "${TRANSHELL_CONTENT_CHECK_FOR_UPDATE}" 3 "${TRANSHELL_CONTENT_EXIT}" --hide-column=1 --print-column=1` case $option in 0) @@ -30,12 +37,20 @@ case $option in zenity --info --icon-name=spark-store --height 150 --width 200 --text "${TRANSHELL_CONTENT_OPENED}" --timeout=2 fi ;; - 1) + if [ ! -e $HOME/.config/spark-union/spark-store/ssshell-config-do-not-create-desktop ];then + mkdir -p $HOME/.config/spark-union/spark-store/ + touch $HOME/.config/spark-union/spark-store/ssshell-config-do-not-create-desktop + zenity --info --icon-name=spark-store --height 150 --width 200 --text "${TRANSHELL_CONTENT_CLOSED}" --timeout=2 + else + rm -f $HOME/.config/spark-union/spark-store/ssshell-config-do-not-create-desktop + zenity --info --icon-name=spark-store --height 150 --width 200 --text "${TRANSHELL_CONTENT_OPENED}" --timeout=2 + ;; + 2) /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh ;; - 2) + 3) exit 0 ;; *) diff --git a/tool/update-upgrade/transhell/ss-update-controler.sh_zh_CN.transhell b/tool/update-upgrade/transhell/ss-update-controler.sh.zh_CN.transhell similarity index 83% rename from tool/update-upgrade/transhell/ss-update-controler.sh_zh_CN.transhell rename to tool/update-upgrade/transhell/ss-update-controler.sh.zh_CN.transhell index 091c198..50151d0 100644 --- a/tool/update-upgrade/transhell/ss-update-controler.sh_zh_CN.transhell +++ b/tool/update-upgrade/transhell/ss-update-controler.sh.zh_CN.transhell @@ -10,3 +10,5 @@ TRANSHELL_CONTENT_CLOSING_UPGRADE_CHECK="执行关闭自动更新检测,请授 TRANSHELL_CONTENT_CLOSED="已关闭" TRANSHELL_CONTENT_OPENING_UPGRADE_CHECK="执行启动自动更新检测,请授权" TRANSHELL_CONTENT_OPENED="已开启" +TRANSHELL_CONTENT_CLOSE_CREATE_DESKTOP="关闭自动创建桌面启动器" +TRANSHELL_CONTENT_OPEN_CREATE_DESKTOP="开启自动创建桌面启动器" diff --git a/tool/update-upgrade/transhell/ss-update-controler.sh.zh_TW.transhell b/tool/update-upgrade/transhell/ss-update-controler.sh.zh_TW.transhell index 091c198..50151d0 100644 --- a/tool/update-upgrade/transhell/ss-update-controler.sh.zh_TW.transhell +++ b/tool/update-upgrade/transhell/ss-update-controler.sh.zh_TW.transhell @@ -10,3 +10,5 @@ TRANSHELL_CONTENT_CLOSING_UPGRADE_CHECK="执行关闭自动更新检测,请授 TRANSHELL_CONTENT_CLOSED="已关闭" TRANSHELL_CONTENT_OPENING_UPGRADE_CHECK="执行启动自动更新检测,请授权" TRANSHELL_CONTENT_OPENED="已开启" +TRANSHELL_CONTENT_CLOSE_CREATE_DESKTOP="关闭自动创建桌面启动器" +TRANSHELL_CONTENT_OPEN_CREATE_DESKTOP="开启自动创建桌面启动器" diff --git a/tool/update-upgrade/transhell/ss-update-controler.sh_en_US.transhell b/tool/update-upgrade/transhell/ss-update-controler.sh_en_US.transhell index b46fd24..8b16f7d 100644 --- a/tool/update-upgrade/transhell/ss-update-controler.sh_en_US.transhell +++ b/tool/update-upgrade/transhell/ss-update-controler.sh_en_US.transhell @@ -1,12 +1,14 @@ #!/bin/bash -TRANSHELL_CONTENT_CLOSE="Close" -TRANSHELL_CONTENT_OPEN="Open" +TRANSHELL_CONTENT_CLOSE="Disable" +TRANSHELL_CONTENT_OPEN="Enable" TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN="Welcome to Spark Store APP Upgrade Settings\nPlease choose one option to run" TRANSHELL_CONTENT_OPTIONS="Options" TRANSHELL_CONTENT_OPEN_OR_CLOSE_UPGRADE_CHECK="$text_update_open Spark Store APP upgrade check. (Will notify APP upgrade at start up if opened.)" TRANSHELL_CONTENT_CHECK_FOR_UPDATE="Check Upgradable app list." TRANSHELL_CONTENT_EXIT="Exit" TRANSHELL_CONTENT_CLOSING_UPGRADE_CHECK="Please authorize to close APP upgrade check" -TRANSHELL_CONTENT_CLOSED="Closed" +TRANSHELL_CONTENT_CLOSED="Disabled" TRANSHELL_CONTENT_OPENING_UPGRADE_CHECK="Please authorize to open APP upgrade check" -TRANSHELL_CONTENT_OPENED="Opened" +TRANSHELL_CONTENT_OPENED="Enabled" +TRANSHELL_CONTENT_CLOSE_CREATE_DESKTOP="Disable auto create desktop shortcut" +TRANSHELL_CONTENT_OPEN_CREATE_DESKTOP="Enable auto create desktop shortcut" From 4de6b167dabc16e2a24d835427cffaabafbae457 Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 31 Oct 2023 22:17:52 +0800 Subject: [PATCH 19/23] =?UTF-8?q?feat:=20ssaudit=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=20feat:=20=E4=BF=AE=E5=A4=8D=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E9=97=AE=E9=A2=98=E5=92=8C=E7=BC=BAfi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tool/ssaudit | 166 +++++++++++++----- tool/update-upgrade/ss-update-controler.sh | 3 +- ...=> ss-update-controler.sh_zh_CN.transhell} | 0 ...=> ss-update-controler.sh_zh_TW.transhell} | 0 translations/spark-store_en.ts | 22 +-- translations/spark-store_es.ts | 22 +-- translations/spark-store_fr.ts | 22 +-- translations/spark-store_zh_CN.ts | 22 +-- translations/spark-store_zh_TW.ts | 22 +-- 9 files changed, 182 insertions(+), 97 deletions(-) rename tool/update-upgrade/transhell/{ss-update-controler.sh.zh_CN.transhell => ss-update-controler.sh_zh_CN.transhell} (100%) rename tool/update-upgrade/transhell/{ss-update-controler.sh.zh_TW.transhell => ss-update-controler.sh_zh_TW.transhell} (100%) diff --git a/tool/ssaudit b/tool/ssaudit index 7d63180..b34d870 100755 --- a/tool/ssaudit +++ b/tool/ssaudit @@ -1,50 +1,134 @@ #!/bin/bash -echo "Spark Store Audit script.星火商店审核脚本" +source /opt/durapps/spark-store/bin/bashimport/transhell.amber +load_transhell_debug + +case $(arch) in + x86_64) + STORE_URL="store" + ;; + aarch64) + STORE_URL="aarch64-store" + ;; +esac + +echo "Spark Store Install script. 星火商店安装脚本" + +function pkexec_as_current_user() { + local user=$(who | awk '{print $1}' | head -n 1) + local uid=$(id -u "$user") + sudo -u "$user" DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/"$uid"/bus pkexec "$@" +} +function create_desktop_file() { + if [ -e $(sudo -u "$user" xdg-user-dir)/.config/spark-union/spark-store/ssshell-config-do-not-show-upgrade-notify ];then + echo "It is configured that do not create desktop file. Give up" + else + create_desktop_file + fi +] +function exec_create_desktop_file() { + local user=$(who | awk '{print $1}' | head -n 1) + for desktop_file_path in $(dpkg -L "$package_name" | grep .desktop); do + if [ "$(cat $desktop_file_path | grep NoDisplay=true)" = "" ];then + echo $desktop_file_path is checked and will be installed to desktop + sudo -u "$user" cp "$desktop_file_path" "$(sudo -u "$user" xdg-user-dir DESKTOP)/" + fi + done +} + +function zenity() { + local user=$(who | awk '{print $1}' | head -n 1) + local uid=$(id -u "$user") + sudo -u "$user" DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/"$uid"/bus zenity "$@" +} + +function hash_check() { + if [ ! -e "/var/lib/aptss/lists/cdn.d.store.deepinos.org.cn_${STORE_URL}_Packages" ] && \ + [ ! -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ] && \ + [ ! -e "/var/lib/aptss/lists/mirrors.sdu.edu.cn_spark-store-repository_${STORE_URL}_Packages" ]; then + echo "接收星火仓库软件信息中..." + aptss ssupdate + fi + + if [ -e "/var/lib/aptss/lists/cdn.d.store.deepinos.org.cn_${STORE_URL}_Packages" ]; then + PACKAGES_DATA_PATH="/var/lib/aptss/lists/cdn.d.store.deepinos.org.cn_${STORE_URL}_Packages" + echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH,是星火域名单目录仓库配置" + elif [ -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ]; then + PACKAGES_DATA_PATH="/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" + echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH,是星火域名单目录仓库配置" + else + PACKAGES_DATA_PATH="/var/lib/aptss/lists/mirrors.sdu.edu.cn_spark-store-repository_${STORE_URL}_Packages" + echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH,是SDU镜像仓库配置" + fi + + echo "正在运行包验证..." + echo "Running Spark Package Verify..." + + DEB_SHA512SUM=$(sha512sum "$1" | cut -d ' ' -f 1) + IS_SHA512SUM_CHECKED=$(cat "$PACKAGES_DATA_PATH" | grep "$DEB_SHA512SUM") +} -#################检测文件是否存在 -if [ $# -eq 0 ];then -echo "没有接收到参数,退出" -echo "用法:$0 deb路径" -exit -fi -if [ ! -f "$1" ] -then - echo "文件不存在" - exit 1 -fi +#################################### -if [ "$(id -u)" != "0" ];then -#############################无root权限时 -echo "请使用root启动ssaudit" -exit 1 -fi - -### - - -DEBPATH=`realpath $1` -echo ------------------------------------------------------------ -try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH") -try_run_ret="$?" - - if [ "$try_run_ret" -ne 0 ] - then +if [ $# -eq 0 ]; then + echo "没有接收到参数,退出" + echo "用法:$0 deb路径" echo "OMG-IT-GOES-WRONG" - echo -e "${try_run_output}" - exit "$try_run_ret" - fi + exit +fi - -dpkg -i "$DEBPATH" || aptss install -yf -install_ret="$?" - - - if [ "$install_ret" -ne 0 ] - then +if [ ! -f "$1" ]; then + echo "${TRANSHELL_CONTENT_FILE_NOT_EXIST}" echo "OMG-IT-GOES-WRONG" - exit "$install_ret" - fi -echo ---------------安装结束--------------- \ No newline at end of file + exit 1 +fi + +if [ "$(id -u)" != "0" ]; then + echo "${TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT}" + echo "OMG-IT-GOES-WRONG" + exit 1 +fi + +DEBPATH=$(realpath "$1") + + + + package_name=$(dpkg-deb -f "$DEBPATH" Package) + echo "Package name is $package_name" + try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH") + try_run_ret="$?" + + if [ "$try_run_ret" -ne 0 ]; then + echo "OMG-IT-GOES-WRONG" + echo -e "${try_run_output}" + exit "$try_run_ret" + fi + + dpkg -i "$DEBPATH" || aptss install -yf + + if [ "$?" = "0" ] && [ "$2" = "--delete-after-install" ]; then + if dpkg -s "$package_name" >/dev/null 2>&1; then + echo "软件包已安装:$package_name" + create_desktop_file + rm "$DEBPATH" + echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}" + else + echo "软件包未安装:$package_name" + echo "安装异常!抛出错误" + echo "OMG-IT-GOES-WRONG" + fi + else + echo "${TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB}" + if dpkg -s "$package_name" >/dev/null 2>&1; then + echo "软件包已安装:$package_name" + create_desktop_file + else + echo "软件包未安装:$package_name" + echo "安装异常!抛出错误" + echo "OMG-IT-GOES-WRONG" + fi + fi + + diff --git a/tool/update-upgrade/ss-update-controler.sh b/tool/update-upgrade/ss-update-controler.sh index c6297a0..74f6130 100755 --- a/tool/update-upgrade/ss-update-controler.sh +++ b/tool/update-upgrade/ss-update-controler.sh @@ -24,7 +24,7 @@ fi update_transhell -option=`zenity --list --text="${TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN}" --column 数字 --column=${TRANSHELL_CONTENT_OPTIONS} --print-column=2 --height 350 --width 760 0 "${TRANSHELL_CONTENT_OPEN_OR_CLOSE_UPGRADE_CHECK}" 1 "${CONTENT_SET_CREATE_DESKTOP}" 2 "${TRANSHELL_CONTENT_CHECK_FOR_UPDATE}" 3 "${TRANSHELL_CONTENT_EXIT}" --hide-column=1 --print-column=1` +option=$(zenity --list --text="${TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN}" --column 数字 --column=${TRANSHELL_CONTENT_OPTIONS} --print-column=2 --height 350 --width 760 0 "${TRANSHELL_CONTENT_OPEN_OR_CLOSE_UPGRADE_CHECK}" 1 "${CONTENT_SET_CREATE_DESKTOP}" 2 "${TRANSHELL_CONTENT_CHECK_FOR_UPDATE}" 3 "${TRANSHELL_CONTENT_EXIT}" --hide-column=1 --print-column=1) case $option in 0) @@ -45,6 +45,7 @@ case $option in else rm -f $HOME/.config/spark-union/spark-store/ssshell-config-do-not-create-desktop zenity --info --icon-name=spark-store --height 150 --width 200 --text "${TRANSHELL_CONTENT_OPENED}" --timeout=2 + fi ;; 2) /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh diff --git a/tool/update-upgrade/transhell/ss-update-controler.sh.zh_CN.transhell b/tool/update-upgrade/transhell/ss-update-controler.sh_zh_CN.transhell similarity index 100% rename from tool/update-upgrade/transhell/ss-update-controler.sh.zh_CN.transhell rename to tool/update-upgrade/transhell/ss-update-controler.sh_zh_CN.transhell diff --git a/tool/update-upgrade/transhell/ss-update-controler.sh.zh_TW.transhell b/tool/update-upgrade/transhell/ss-update-controler.sh_zh_TW.transhell similarity index 100% rename from tool/update-upgrade/transhell/ss-update-controler.sh.zh_TW.transhell rename to tool/update-upgrade/transhell/ss-update-controler.sh_zh_TW.transhell diff --git a/translations/spark-store_en.ts b/translations/spark-store_en.ts index aa11124..2fe4e31 100644 --- a/translations/spark-store_en.ts +++ b/translations/spark-store_en.ts @@ -480,33 +480,33 @@ - + Submit App - + Submit App with client(Recommanded) - + Settings - + APP Upgrade and Install Settings - - + + Spark Store - + Search or enter spk:// @@ -516,7 +516,7 @@ - + Spark Store @@ -536,7 +536,7 @@ - + Show MainWindow @@ -658,12 +658,12 @@ TitleBarMenu - + About - + Exit diff --git a/translations/spark-store_es.ts b/translations/spark-store_es.ts index 28ee71c..421c0e3 100644 --- a/translations/spark-store_es.ts +++ b/translations/spark-store_es.ts @@ -480,33 +480,33 @@ Actualización de app - + Submit App Presentación de la aplicación - + Submit App with client(Recommanded) Enviar la aplicación al cliente (recomendación) - + Settings Configuración - + APP Upgrade and Install Settings Actualización e instalación de app - - + + Spark Store SPARK Store - + Search or enter spk:// Buscar o introducir spk: /% @@ -516,7 +516,7 @@ - + Spark Store SPARK Store @@ -536,7 +536,7 @@ Descargar lista - + Show MainWindow Mostrar la ventana principal @@ -658,12 +658,12 @@ TitleBarMenu - + About Sobre - + Exit Exportaciones diff --git a/translations/spark-store_fr.ts b/translations/spark-store_fr.ts index 5801d28..89dd7b8 100644 --- a/translations/spark-store_fr.ts +++ b/translations/spark-store_fr.ts @@ -480,33 +480,33 @@ Mise à niveau app - + Submit App Soumettre une application - + Submit App with client(Recommanded) Soumettre une demande au client (recommandé) - + Settings Paramètres - + APP Upgrade and Install Settings Paramètres de mise à niveau et d'installation de l'app - - + + Spark Store Le Spark store - + Search or enter spk:// Rechercher ou entrer SPK / @@ -516,7 +516,7 @@ - + Spark Store Le Spark store @@ -536,7 +536,7 @@ Télécharger la Liste - + Show MainWindow Afficher la fenêtre principale @@ -658,12 +658,12 @@ TitleBarMenu - + About À propos - + Exit Exportations diff --git a/translations/spark-store_zh_CN.ts b/translations/spark-store_zh_CN.ts index 8ebdcae..1601d08 100644 --- a/translations/spark-store_zh_CN.ts +++ b/translations/spark-store_zh_CN.ts @@ -480,33 +480,33 @@ 更新 - + Submit App 投递应用 - + Submit App with client(Recommanded) 使用本地投稿器投递应用(推荐) - + Settings 设置 - + APP Upgrade and Install Settings 应用更新和安装设置 - - + + Spark Store 星火应用商店 - + Search or enter spk:// 搜索或打开链接 @@ -516,7 +516,7 @@ - + Spark Store 星火应用商店 @@ -536,7 +536,7 @@ 下载列表 - + Show MainWindow 显示主窗口 @@ -658,12 +658,12 @@ TitleBarMenu - + About 关于 - + Exit 退出 diff --git a/translations/spark-store_zh_TW.ts b/translations/spark-store_zh_TW.ts index 3c2f0c3..d61447a 100644 --- a/translations/spark-store_zh_TW.ts +++ b/translations/spark-store_zh_TW.ts @@ -480,33 +480,33 @@ 軟體更新 - + Submit App 上傳軟體 - + Submit App with client(Recommanded) 從客戶端上傳軟體(推薦的) - + Settings 設定 - + APP Upgrade and Install Settings 軟體升級 和 安裝設定 - - + + Spark Store 星火应用商店 - + Search or enter spk:// 搜索或打开链接 @@ -516,7 +516,7 @@ - + Spark Store 星火应用商店 @@ -536,7 +536,7 @@ 下载列表 - + Show MainWindow 显示主窗口 @@ -658,12 +658,12 @@ TitleBarMenu - + About 关于 - + Exit 退出 From 22532e04367eda60db9a98b4e259a71c96953812 Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 31 Oct 2023 22:25:46 +0800 Subject: [PATCH 20/23] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tool/ssaudit | 11 +++++------ tool/ssinstall | 7 ++++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tool/ssaudit b/tool/ssaudit index b34d870..f1c2a97 100755 --- a/tool/ssaudit +++ b/tool/ssaudit @@ -12,7 +12,7 @@ case $(arch) in ;; esac -echo "Spark Store Install script. 星火商店安装脚本" +echo "Spark Store Install script. 星火商店审核脚本" function pkexec_as_current_user() { local user=$(who | awk '{print $1}' | head -n 1) @@ -20,12 +20,13 @@ function pkexec_as_current_user() { sudo -u "$user" DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/"$uid"/bus pkexec "$@" } function create_desktop_file() { - if [ -e $(sudo -u "$user" xdg-user-dir)/.config/spark-union/spark-store/ssshell-config-do-not-show-upgrade-notify ];then + local user=$(who | awk '{print $1}' | head -n 1) + if [ -e $(sudo -u "$user" xdg-user-dir)/.config/spark-union/spark-store/ssshell-config-do-not-create-desktop ];then echo "It is configured that do not create desktop file. Give up" else - create_desktop_file + exec_create_desktop_file fi -] +} function exec_create_desktop_file() { local user=$(who | awk '{print $1}' | head -n 1) for desktop_file_path in $(dpkg -L "$package_name" | grep .desktop); do @@ -130,5 +131,3 @@ DEBPATH=$(realpath "$1") echo "OMG-IT-GOES-WRONG" fi fi - - diff --git a/tool/ssinstall b/tool/ssinstall index 4c3e90b..4710a1c 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -20,12 +20,13 @@ function pkexec_as_current_user() { sudo -u "$user" DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/"$uid"/bus pkexec "$@" } function create_desktop_file() { - if [ -e $(sudo -u "$user" xdg-user-dir)/.config/spark-union/spark-store/ssshell-config-do-not-show-upgrade-notify ];then + local user=$(who | awk '{print $1}' | head -n 1) + if [ -e $(sudo -u "$user" xdg-user-dir)/.config/spark-union/spark-store/ssshell-config-do-not-create-desktop ];then echo "It is configured that do not create desktop file. Give up" else - create_desktop_file + exec_create_desktop_file fi -] +} function exec_create_desktop_file() { local user=$(who | awk '{print $1}' | head -n 1) for desktop_file_path in $(dpkg -L "$package_name" | grep .desktop); do From efac507fed0c590886be468f45fe041c002a79ad Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 31 Oct 2023 22:29:10 +0800 Subject: [PATCH 21/23] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tool/ssinstall | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tool/ssinstall b/tool/ssinstall index 4710a1c..50ad0c1 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -100,6 +100,12 @@ if [ -z "$IS_SHA512SUM_CHECKED" ]; then echo "尝试更新仓库信息重新校验" aptss ssupdate hash_check "$DEBPATH" + if [ -z "$IS_SHA512SUM_CHECKED" ]; then + echo "$TRANSHELL_CONTENT_HASH_CHECK_FAILED" + zenity "$TRANSHELL_CONTENT_HASH_CHECK_FAILED" + echo "OMG-IT-GOES-WRONG" + exit 1 + fi fi if [ ! -z "$IS_SHA512SUM_CHECKED" ]; then From a8d82480e76cf236d492f9634df14f572644c184 Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 31 Oct 2023 22:30:40 +0800 Subject: [PATCH 22/23] =?UTF-8?q?=E6=88=91=E7=9C=9F=E8=A0=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tool/ssinstall | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tool/ssinstall b/tool/ssinstall index 50ad0c1..df7f696 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -102,8 +102,8 @@ if [ -z "$IS_SHA512SUM_CHECKED" ]; then hash_check "$DEBPATH" if [ -z "$IS_SHA512SUM_CHECKED" ]; then echo "$TRANSHELL_CONTENT_HASH_CHECK_FAILED" - zenity "$TRANSHELL_CONTENT_HASH_CHECK_FAILED" - echo "OMG-IT-GOES-WRONG" + zenity --info --icon-name=spark-store --height 270 --width 500 --text "$TRANSHELL_CONTENT_HASH_CHECK_FAILED" + echo -e "OMG-IT-GOES-WRONG" exit 1 fi fi From 51369843435edb4d70677ab94ae701bfb810ef28 Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 31 Oct 2023 22:31:30 +0800 Subject: [PATCH 23/23] =?UTF-8?q?=E6=88=91=E7=9C=9F=E8=A0=A2=EF=BC=8C?= =?UTF-8?q?=E7=9C=9F=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tool/ssinstall | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tool/ssinstall b/tool/ssinstall index df7f696..774b865 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -101,9 +101,9 @@ if [ -z "$IS_SHA512SUM_CHECKED" ]; then aptss ssupdate hash_check "$DEBPATH" if [ -z "$IS_SHA512SUM_CHECKED" ]; then - echo "$TRANSHELL_CONTENT_HASH_CHECK_FAILED" + echo -e "$TRANSHELL_CONTENT_HASH_CHECK_FAILED" zenity --info --icon-name=spark-store --height 270 --width 500 --text "$TRANSHELL_CONTENT_HASH_CHECK_FAILED" - echo -e "OMG-IT-GOES-WRONG" + echo "OMG-IT-GOES-WRONG" exit 1 fi fi