Add detection for LingmoOS

This commit is contained in:
Floating dream 2023-06-08 01:30:17 +08:00
parent 22a54cd0ed
commit 0edf87c95c
11 changed files with 75 additions and 5 deletions

View File

@ -85,6 +85,8 @@ QString tags=json["Tags"].toString(); //Read the Tags
ui->tag_community->show();//Tags icon shows like this ui->tag_community->show();//Tags icon shows like this
if(tagList[i]=="ubuntu") if(tagList[i]=="ubuntu")
ui->tag_ubuntu->show(); ui->tag_ubuntu->show();
if(tagList[i]=="ubuntu")
ui->tag_ubuntu->show();
if(tagList[i]=="deepin") if(tagList[i]=="deepin")
ui->tag_deepin->show(); ui->tag_deepin->show();
if(tagList[i]=="uos") if(tagList[i]=="uos")

View File

@ -45,7 +45,7 @@ sudo apt install git qt5-default debhelper pkg-config qtchooser libqt5core5a lib
``` ```
Ubuntu 22.04 系统下, 安装依赖 Debian 11.x/Lingmo OS/Ubuntu 22.04 系统下, 安装依赖
```shell ```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* 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*

View File

@ -59,6 +59,8 @@
<file>tags/logo_icon.svg</file> <file>tags/logo_icon.svg</file>
<file>tags/ubuntu-small.png</file> <file>tags/ubuntu-small.png</file>
<file>tags/ubuntu.png</file> <file>tags/ubuntu.png</file>
<file>tags/lingmo-small.png</file>
<file>tags/lingmo.png</file>
<file>tags/uos-authorize.svg</file> <file>tags/uos-authorize.svg</file>
<file>tags/uos-small.png</file> <file>tags/uos-small.png</file>
<file>tags/uos.svg</file> <file>tags/uos.svg</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
src/assets/tags/lingmo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -196,6 +196,7 @@ void AppIntoPage::clear()
ui->tag_dwine2->hide(); ui->tag_dwine2->hide();
ui->tag_dwine5->hide(); ui->tag_dwine5->hide();
ui->tag_ubuntu->hide(); ui->tag_ubuntu->hide();
ui->tag_lingmo->hide();
ui->tag_community->hide(); ui->tag_community->hide();
ui->icon->clear(); ui->icon->clear();
ui->title->clear(); ui->title->clear();
@ -334,6 +335,7 @@ void AppIntoPage::isDownloading(const QUrl &url)
void AppIntoPage::setAppinfoTags(const QStringList &tagList) void AppIntoPage::setAppinfoTags(const QStringList &tagList)
{ {
bool ubuntuSupport = false; bool ubuntuSupport = false;
bool lingmoSupport = false;
bool deepinSupport = false; bool deepinSupport = false;
bool uosSupport = false; bool uosSupport = false;
foreach (const QString &tag, tagList) foreach (const QString &tag, tagList)
@ -347,6 +349,11 @@ void AppIntoPage::setAppinfoTags(const QStringList &tagList)
ui->tag_ubuntu->show(); ui->tag_ubuntu->show();
ubuntuSupport = true; ubuntuSupport = true;
} }
else if (tag == "lingmo")
{
ui->tag_lingmo->show();
lingmoSupport = true;
}
else if (tag == "deepin") else if (tag == "deepin")
{ {
ui->tag_deepin->show(); ui->tag_deepin->show();
@ -375,15 +382,33 @@ void AppIntoPage::setAppinfoTags(const QStringList &tagList)
ui->tag_a2d->show(); ui->tag_a2d->show();
} }
} }
notifyUserUnsupportedTags(ubuntuSupport, deepinSupport, uosSupport); notifyUserUnsupportedTags(ubuntuSupport, lingmoSupport, deepinSupport, uosSupport);
} }
void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport) void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool lingmoSupport, bool deepinSupport, bool uosSupport)
{ {
bool isDeepin = Dtk::Core::DSysInfo::productType() == Dtk::Core::DSysInfo::Deepin; bool isDeepin = Dtk::Core::DSysInfo::productType() == Dtk::Core::DSysInfo::Deepin;
bool isUOS = Dtk::Core::DSysInfo::productType() == Dtk::Core::DSysInfo::Uos; bool isUOS = Dtk::Core::DSysInfo::productType() == Dtk::Core::DSysInfo::Uos;
bool checkdeepin = (isDeepin && !deepinSupport); bool checkdeepin = (isDeepin && !deepinSupport);
bool checkuos = (isUOS && !uosSupport); bool checkuos = (isUOS && !uosSupport);
bool isLingmo = false;
if (!checkdeepin && !checkuos)
{
// 检查是否为 Lingmo OS
QFile lsb("/etc/lsb-release");
//由于LingmoOS没有lsb-release所以创建一个lsb只供星火商店检测。
if (!lsb.open(QIODevice::ReadOnly))
{
qDebug() << "打开 /etc/lsb-release 失败";
}
else if (lsb.readAll().contains("Lingmo"))
{
isLingmo = true;
lsb.close();
}
}
bool checklingmo = (isLingmo && !lingmoSupport);
bool isUbuntu = false; bool isUbuntu = false;
if (!checkdeepin && !checkuos) if (!checkdeepin && !checkuos)
{ {
@ -413,7 +438,11 @@ void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSuppo
{ {
Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support Ubuntu, there may be problems")); Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support Ubuntu, there may be problems"));
} }
else if (!isUbuntu && !isDeepin && !isUOS) else if (checklingmo)
{
Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support LingmoOS, there may be problems"));
}
else if (!isUbuntu && !isLingmo && !isDeepin && !isUOS)
{ {
Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support current platform, there may be problems")); Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support current platform, there may be problems"));
} }

View File

@ -29,7 +29,7 @@ private:
void initConnections(); void initConnections();
void isDownloading(const QUrl &url); void isDownloading(const QUrl &url);
void setAppinfoTags(const QStringList &tagList); void setAppinfoTags(const QStringList &tagList);
void notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport); void notifyUserUnsupportedTags(bool ubuntuSupport, bool lingmoSupport, bool deepinSupport, bool uosSupport);
signals: signals:
void clickedDownloadBtn(); void clickedDownloadBtn();

View File

@ -436,6 +436,25 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QLabel" name="tag_lingmo">
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capable to Lingmo OS&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capable to Lingmo OS&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/tags/lingmo-small.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="tag_uos"> <widget class="QLabel" name="tag_uos">
<property name="maximumSize"> <property name="maximumSize">

View File

@ -47,6 +47,12 @@
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/tags/ubuntu-small.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/tags/ubuntu-small.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="../src/pages/appintopage.ui" line="448"/>
<Location filename="../src/pages/appintopage.ui" line="451"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capable to Lingmo OS&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location filename="../src/pages/appintopage.ui" line="448"/> <location filename="../src/pages/appintopage.ui" line="448"/>
<location filename="../src/pages/appintopage.ui" line="451"/> <location filename="../src/pages/appintopage.ui" line="451"/>

View File

@ -47,6 +47,12 @@
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/tags/ubuntu-small.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/tags/ubuntu-small.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<location filename="../src/pages/appintopage.ui" line="448"/>
<Location filename="../src/pages/appintopage.ui" line="451"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capable to Lingmo OS&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt; Lingmo OS&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message> <message>
<location filename="../src/pages/appintopage.ui" line="448"/> <location filename="../src/pages/appintopage.ui" line="448"/>
<location filename="../src/pages/appintopage.ui" line="451"/> <location filename="../src/pages/appintopage.ui" line="451"/>

View File

@ -47,6 +47,12 @@
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/tags/ubuntu-small.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/tags/ubuntu-small.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<location filename="../src/pages/appintopage.ui" line="448"/>
<Location filename="../src/pages/appintopage.ui" line="451"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capable to Lingmo OS&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt; Lingmo OS&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message> <message>
<location filename="../src/pages/appintopage.ui" line="448"/> <location filename="../src/pages/appintopage.ui" line="448"/>
<location filename="../src/pages/appintopage.ui" line="451"/> <location filename="../src/pages/appintopage.ui" line="451"/>