mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-09 12:52:22 +08:00
Add detection for LingmoOS
This commit is contained in:
parent
22a54cd0ed
commit
0edf87c95c
@ -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")
|
||||||
|
@ -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*
|
||||||
|
|
||||||
|
@ -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>
|
||||||
|
BIN
src/assets/tags/lingmo-small.png
Normal file
BIN
src/assets/tags/lingmo-small.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
BIN
src/assets/tags/lingmo.png
Normal file
BIN
src/assets/tags/lingmo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
@ -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"));
|
||||||
}
|
}
|
||||||
|
@ -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();
|
||||||
|
@ -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><html><head/><body><p>Capable to Lingmo OS</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string><html><head/><body><p>Capable to Lingmo OS</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p><img src=":/tags/lingmo-small.png"/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="tag_uos">
|
<widget class="QLabel" name="tag_uos">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
|
@ -47,6 +47,12 @@
|
|||||||
<source><html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html></source>
|
<source><html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html></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><html><head/><body><p>Capable to Lingmo OS</p></body></html></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"/>
|
||||||
|
@ -47,6 +47,12 @@
|
|||||||
<source><html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html></source>
|
<source><html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html></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><html><head/><body><p>Capable to Lingmo OS</p></body></html></source>
|
||||||
|
<translation><html><head/><body><p>支持 Lingmo OS</p></body></html></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"/>
|
||||||
|
@ -47,6 +47,12 @@
|
|||||||
<source><html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html></source>
|
<source><html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html></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><html><head/><body><p>Capable to Lingmo OS</p></body></html></source>
|
||||||
|
<translation><html><head/><body><p>支持 Lingmo OS</p></body></html></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"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user