From 46a1daeafceedfd3847003bf51a78980e658209f Mon Sep 17 00:00:00 2001 From: shenmo <jifengshenmo@outlook.com> Date: Mon, 24 Feb 2025 21:11:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=20Debian=20/=20GXDE=20?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/assets.qrc | 1 + src/assets/tags/debian.svg | 1 + src/pages/appintopage.cpp | 47 ++++++++++++++++++++------------------ src/pages/appintopage.h | 2 +- src/pages/appintopage.ui | 30 ++++++++++++++---------- src/spark-store.pro | 2 ++ 6 files changed, 48 insertions(+), 35 deletions(-) create mode 100644 src/assets/tags/debian.svg diff --git a/src/assets/assets.qrc b/src/assets/assets.qrc index c0548c9..f2f5df4 100644 --- a/src/assets/assets.qrc +++ b/src/assets/assets.qrc @@ -63,5 +63,6 @@ <file>tags/uos-small.png</file> <file>tags/uos.svg</file> <file>translations/qtwebengine_zh.qm</file> + <file>tags/debian.svg</file> </qresource> </RCC> diff --git a/src/assets/tags/debian.svg b/src/assets/tags/debian.svg new file mode 100644 index 0000000..c8e64b2 --- /dev/null +++ b/src/assets/tags/debian.svg @@ -0,0 +1 @@ +<?xml version="1.0" ?><svg enable-background="new 0 0 515.91 728.5" height="512" id="Layer_1" version="1.1" viewBox="0 0 512.00003 512" width="512" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg"><defs id="defs7"/><g id="g7966" transform="translate(-2045.7803,196.99031)"><path d="m -733.62329,72.267944 c 0,203.804876 -165.21649,369.021366 -369.02141,369.021366 -203.8048,0 -369.0213,-165.21649 -369.0213,-369.021366 0,-203.804874 165.2165,-369.021364 369.0213,-369.021364 203.80492,0 369.02141,165.21649 369.02141,369.021364 z" id="path4894" style="fill:#d70751;fill-opacity:1;fill-rule:nonzero;stroke:none" transform="matrix(0.69372678,0,0,0.69372678,3066.7144,8.875483)"/><path d="m 2408.1596,34.171381 c 0.3467,9.30934 -2.7166,13.83297 -5.4872,21.83223 l -4.9819,2.47761 c -4.0729,7.91448 0.4042,5.02457 -2.5123,11.31686 -6.3657,5.65264 -19.2891,17.68231 -23.4276,18.78434 -3.0249,-0.0655 2.0461,-3.56809 2.7089,-4.93597 -8.512,5.84146 -6.8319,8.76991 -19.8518,12.32641 l -0.3776,-0.85158 c -32.097,15.104549 -76.6864,-14.82325 -76.1007,-55.65175 -0.3391,2.58937 -0.9749,1.94202 -1.6838,2.98236 -1.657,-21.00376 9.7025,-42.10003968 28.8603,-50.7273397 18.7381,-9.2708003 40.7053,-5.4715403 54.1186,7.04749 -7.3675,-9.6561203 -22.0443,-19.8940603 -39.426,-18.9461803 -17.035,0.27743 -32.9761,11.1010603 -38.2931,22.8571903 -8.7239,5.4908 -9.7411,21.1771597 -13.5405,24.0516597 -5.1207,37.60724 9.6217,53.84846 34.5635,72.96419 3.9146,2.643279 1.1021,3.047869 1.626,5.059239 -8.2845,-3.87632 -15.8677,-9.733189 -22.1096,-16.903989 3.3139,4.84346 6.8853,9.55209 11.5055,13.251159 -7.818,-2.639459 -18.2564,-18.930769 -21.2968,-19.593529 13.4672,24.113309 54.6307,42.288879 76.1971,33.268509 -9.9796,0.36992 -22.653,0.20422 -33.858,-3.93793 -4.7203,-2.42368 -11.1125,-7.43668 -9.9685,-8.37302 29.4233,10.98546 59.8095,8.31522 85.2639,-12.087479 6.4812,-5.04771 13.5554,-13.62877 15.6016,-13.74437 -3.0788,4.63156 0.5278,2.22715 -1.8381,6.31541 6.4427,-10.40752 -2.809,-4.23853 6.6662,-17.97135 l 3.4988,4.81653 c -1.3102,-8.64661 10.7309,-19.13501 9.5056,-32.79846 2.7628,-4.17684 3.0788,4.50055 0.1503,14.11044 4.0652,-10.6618 1.075,-12.37651 2.1155,-21.17721 1.1212,2.95928 2.6125,6.09963 3.3716,9.22456 -2.6511,-10.30729 2.7088,-17.35093 4.0421,-23.34266 -1.3179,-0.57799 -4.0884,4.55446 -4.728,-7.6139297 0.096,-5.28658 1.4758,-2.77046 2.0037,-4.07284 -1.0327,-0.59725 -3.757,-4.65078998 -5.41,-12.4227 1.1906,-1.8302603 3.2059,4.73557 4.8397,5.00144 -1.052,-6.17669 -2.8592,-10.8891303 -2.9362,-15.6324003 -4.7781,-9.9798 -1.6916,1.3332 -5.5603,-4.28478 -5.0863,-15.85207 4.2155,-3.6798 4.8475,-10.87757 7.6989,11.15501 12.0874,28.4558503 14.1103,35.6189803 -1.5413,-8.73523 -4.0267,-17.2006903 -7.0665,-25.3887503 2.3462,0.99029 -3.7724,-17.96746 3.0475,-5.41374 -7.2785,-26.76045 -31.1259,-51.76773 -53.0701,-63.49688 2.6781,2.4545 6.0651,5.53704 4.8553,6.02256 -10.92,-6.49263 -9.0009,-7.00511 -10.5655,-9.74861 -8.8817,-3.618151 -9.475,0.29671 -15.3514,0.008 -16.7614,-8.893181 -19.9904,-7.949121 -35.4147,-13.513151 l 0.7013,3.28292 c -11.1008,-3.69907 -12.9351,1.39485 -24.9299,0.008 -0.7283,-0.56643 3.8452,-2.06531 7.6137,-2.60863 -10.7348,1.41801 -10.234,-2.11926 -20.738,0.38919 2.5856,-1.81487 5.3291,-3.0209 8.0881,-4.56217 -8.7508,0.53171 -20.8998,5.09392 -17.1506,0.94016 -14.276,6.37321 -39.6341,15.316471 -53.8639,28.660111 l -0.4469,-2.99011 c -6.5198,7.82586 -28.433,23.37353 -30.1785,33.51898 l -1.7456,0.4046 c -3.3867,5.74512 -5.5868,12.25316 -8.2764,18.16012 -4.4352,7.56383 -6.5044,2.91304 -5.8724,4.09981 -8.7273,17.69388 -13.0699,32.5595203 -16.8115,44.75876 2.6665,3.98807 0.066,24.01314 1.0712,40.03858 -4.3773,79.160109 55.5554,156.012179 121.0678,173.752299 9.602,3.44094 23.878,3.31763 36.0235,3.65669 -14.3264,-4.09978 -16.1761,-2.16933 -30.14,-7.03594 -10.0682,-4.74712 -12.2724,-10.16086 -19.4085,-16.35296 l 2.8244,4.98987 c -13.987,-4.95135 -8.1339,-6.12655 -19.5165,-9.72929 l 3.0171,-3.93413 c -4.5353,-0.34679 -12.0102,-7.63704 -14.0524,-11.68676 l -4.9631,0.19651 c -5.9572,-7.34419 -9.1358,-12.65004 -8.9007,-16.76142 l -1.603,2.85911 c -1.8149,-3.11727 -21.9286,-27.58124 -11.4943,-21.88621 -1.9382,-1.76476 -4.516,-2.87832 -7.3093,-7.96068 l 2.1232,-2.42367 c -5.0131,-6.46184 -9.2402,-14.74234 -8.9165,-17.50125 2.678,3.6143 4.5352,4.29247 6.3771,4.91285 -12.6811,-31.457509 -13.3939,-1.73009 -22.9921,-32.020089 l 2.0268,-0.16184 c -1.5528,-2.35432 -2.5046,-4.89355 -3.7531,-7.39429 l 0.8863,-8.80455 c -9.1245,-10.54238 -2.5509,-44.87051 -1.2292,-63.69339 0.9055,-7.6524597 7.6179,-15.8019597 12.7154,-28.58301 l -3.1053,-0.53176 c 5.9414,-10.35741 33.9158,-41.61071 46.8779,-40.00778 6.277,-7.88363 -1.2485,-0.0308 -2.4777,-2.01138 13.7905,-14.26838 18.1254,-10.07994 27.4311,-12.65005 10.0297,-5.95315 -8.6121,2.32735 -3.8571,-2.2695 17.3509,-4.42734 12.2916,-10.07228 34.9215,-12.3187 2.389,1.35632 -5.5372,2.09614 -7.5255,3.85706 14.4498,-7.07447 45.7338,-5.45998 66.0634,3.92255 23.57,11.024 50.0683,43.59508 51.1164,74.23959032 l 1.1907,0.31982998 c -0.6012,12.1837897 1.8649,26.2749597 -2.4161,39.2140097 l 2.8939,-6.13045" id="path14-1" style="fill:#ffffff;fill-opacity:1"/></g></svg> \ No newline at end of file diff --git a/src/pages/appintopage.cpp b/src/pages/appintopage.cpp index 9ef148c..8152db4 100644 --- a/src/pages/appintopage.cpp +++ b/src/pages/appintopage.cpp @@ -231,6 +231,7 @@ void AppIntoPage::clear() ui->tag_deepin->hide(); ui->tag_dwine2->hide(); ui->tag_dwine5->hide(); + ui->tag_debian->hide(); ui->tag_ubuntu->hide(); ui->tag_community->hide(); ui->icon->clear(); @@ -402,12 +403,18 @@ void AppIntoPage::setAppinfoTags(const QStringList &tagList) bool ubuntuSupport = false; bool deepinSupport = false; bool uosSupport = false; + bool debianSupport = false; foreach (const QString &tag, tagList) { if (tag == "community") { ui->tag_community->show(); } + else if (tag == "debian") + { + ui->tag_debian->show(); + debianSupport = true; + } else if (tag == "ubuntu") { ui->tag_ubuntu->show(); @@ -441,10 +448,10 @@ void AppIntoPage::setAppinfoTags(const QStringList &tagList) ui->tag_a2d->show(); } } - notifyUserUnsupportedTags(ubuntuSupport, deepinSupport, uosSupport); + notifyUserUnsupportedTags(ubuntuSupport, deepinSupport, uosSupport ,debianSupport); } -void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport) +void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport, bool debianSupport) { if (!SettingsPage::needUncompatibleNotification) { return; @@ -455,30 +462,21 @@ void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSuppo bool checkdeepin = (isDeepin && !deepinSupport); bool checkuos = (isUOS && !uosSupport); bool isUbuntu = false; + bool isDebian = false; if (!checkdeepin && !checkuos) { - // 检查是否为 ubuntu 系统 - QFile lsb("/etc/lsb-release"); - if (!lsb.open(QIODevice::ReadOnly)) - { - qDebug() << "打开 /etc/lsb-release 失败"; - } - else { - QString lsbInfo = lsb.readAll(); // 因为使用 readAll 读取后会默认跳转到文件末尾导致读出的数据为空,所以用单独一个 string 存储 - if (lsbInfo.contains("Ubuntu")) - { - isUbuntu = true; - lsb.close(); - } - else if (lsbInfo.contains("GXDE")) - { - // GXDE 使用 Ubuntu 的 tag - isUbuntu = true; - lsb.close(); - } + // 使用更可靠的/etc/os-release检测 + QFile osRelease("/etc/os-release"); + if (osRelease.open(QIODevice::ReadOnly)) { + QString content = osRelease.readAll(); + isUbuntu = content.contains("ID=ubuntu"); + isDebian = content.contains("ID=debian") || content.contains("ID_LIKE=debian"); // 合并Debian系检测 + osRelease.close(); } } + bool checkubuntu = (isUbuntu && !ubuntuSupport); + bool checkdebian = (isDebian && !debianSupport); if (checkdeepin) { @@ -492,12 +490,17 @@ void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSuppo { Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support or tested on Ubuntu, there may be problems")); } - else if (!isUbuntu && !isDeepin && !isUOS) + else if (checkdebian) + { + Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support or tested on Debian, there may be problems")); + } + if (!isUbuntu && !isDeepin && !isUOS && !isDebian) { Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support or tested on current platform, there may be problems")); } return; + } void AppIntoPage::on_downloadButton_clicked() diff --git a/src/pages/appintopage.h b/src/pages/appintopage.h index d2306e6..0f54854 100644 --- a/src/pages/appintopage.h +++ b/src/pages/appintopage.h @@ -29,7 +29,7 @@ private: void initConnections(); void isDownloading(const QUrl &url); void setAppinfoTags(const QStringList &tagList); - void notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport); + void notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport, bool debianSupport); signals: void clickedDownloadBtn(); diff --git a/src/pages/appintopage.ui b/src/pages/appintopage.ui index bb82364..24b5bf1 100644 --- a/src/pages/appintopage.ui +++ b/src/pages/appintopage.ui @@ -160,7 +160,6 @@ <property name="font"> <font> <pointsize>14</pointsize> - <weight>75</weight> <bold>true</bold> </font> </property> @@ -413,7 +412,7 @@ <string><html><head/><body><p>This app is developed by community user,we give this tag to honor those who contribute to the Linux Ecology</p></body></html></string> </property> <property name="text"> - <string><html><head/><body><p><img src=":/tags/community-small.png"/></p></body></html></string> + <string><html><head/><body><p><img src=":/tags/community.svg" height=30 width=30 /></p></body></html></string> </property> </widget> </item> @@ -432,7 +431,7 @@ <string><html><head/><body><p>Capable to Ubuntu 22.04</p></body></html></string> </property> <property name="text"> - <string><html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html></string> + <string><html><head/><body><p><img src=":/tags/ubuntu.png" width=30 height=30 /></p></body></html></string> </property> </widget> </item> @@ -451,7 +450,7 @@ <string><html><head/><body><p>Capable to UOS home 20</p></body></html></string> </property> <property name="text"> - <string><html><head/><body><p><img src=":/tags/uos-small.png"/></p></body></html></string> + <string><html><head/><body><p><img src=":/tags/uos-authorize.svg" height=30 width=30 /></p></body></html></string> </property> </widget> </item> @@ -489,7 +488,7 @@ <string><html><head/><body><p>This is a DTK5 app,which means it would have better effect on Deepin Desktop Environment</p></body></html></string> </property> <property name="text"> - <string><html><head/><body><p><img src=":/tags/dtk-small.png"/></p></body></html></string> + <string><html><head/><body><p><img src=":/tags/logo_icon.svg" height=30 width=30 /></p></body></html></string> </property> </widget> </item> @@ -508,7 +507,7 @@ <string><html><head/><body><p>Capable to deepin 20</p></body></html></string> </property> <property name="text"> - <string><html><head/><body><p><img src=":/tags/deepin-small.png"/></p></body></html></string> + <string><html><head/><body><p><img src=":/tags/deepin.svg" height=30 width=30 /></p></body></html></string> </property> </widget> </item> @@ -527,7 +526,7 @@ <string><html><head/><body><p>An Appimage to deb app.</p></body></html></string> </property> <property name="text"> - <string><html><head/><body><p><img src=":/tags/a2d-small.png"/></p></body></html></string> + <string><html><head/><body><p><img src=":/tags/a2d.png"height=30 width=30 /></p></body></html></string> </property> </widget> </item> @@ -546,7 +545,17 @@ <string><html><head/><body><p>A Wine app.Spark Store will automatically configure the wine kit for you</p></body></html></string> </property> <property name="text"> - <string><html><head/><body><p><img src=":/tags/dwine5-small.png"/></p></body></html></string> + <string><html><head/><body><p><img src=":/tags/dwine5.svg" height=30 width=30 /></p></body></html></string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="tag_debian"> + <property name="whatsThis"> + <string><html><head/><body><p>Capable to Debian Stable</p></body></html></string> + </property> + <property name="text"> + <string><html><head/><body><p><img src=":/tags/debian.svg" height="30" width="30"/></p></body></html></string> </property> </widget> </item> @@ -676,7 +685,7 @@ <rect> <x>0</x> <y>0</y> - <width>482</width> + <width>477</width> <height>601</height> </rect> </property> @@ -757,7 +766,6 @@ <property name="font"> <font> <pointsize>12</pointsize> - <weight>75</weight> <bold>true</bold> </font> </property> @@ -895,7 +903,6 @@ <property name="font"> <font> <pointsize>12</pointsize> - <weight>75</weight> <bold>true</bold> </font> </property> @@ -1060,7 +1067,6 @@ QListWidget::item::selected <property name="font"> <font> <pointsize>12</pointsize> - <weight>75</weight> <bold>true</bold> </font> </property> diff --git a/src/spark-store.pro b/src/spark-store.pro index 481c4db..e6ffa3e 100644 --- a/src/spark-store.pro +++ b/src/spark-store.pro @@ -106,3 +106,5 @@ TRANSLATIONS += \ qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/durapps/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target + +DISTFILES +=