Compare commits

..

24 Commits

Author SHA1 Message Date
8850cfd4a3 update dtk-build-release-tag-20220425.yml 2022-12-25 07:45:19 +00:00
bec8a14baf !177 将默认的README改为英文
Merge pull request !177 from shenmo/dev
2022-12-25 04:46:51 +00:00
1b9c925183 把默认的README改成英文 2022-12-25 12:43:51 +08:00
09221bc2e9 update debian/changelog.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2022-12-25 03:21:04 +00:00
98da0c22fc enhance: 规范代码行为 2022-12-24 10:29:55 +08:00
cadbb351fb enhance: 限制循环变量的作用范围 2022-12-24 10:04:40 +08:00
2de237ce83 fix: aptss ssupdate出错时不再锁死
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2022-12-24 10:04:40 +08:00
511fbaa0b0 update src/main.cpp.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2022-12-23 13:55:58 +00:00
a6d85b6ade update debian/changelog.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2022-12-23 13:55:40 +00:00
5889ac3045 enhance: 下载列表新增 wayland 窗口标题 2022-12-23 18:42:19 +08:00
c1ba14bbd0 fix: 安装依赖缺失 2022-12-23 18:28:38 +08:00
7bdccc7783 Merge branch 'dev' of gitee.com:deepin-community-store/spark-store into dev 2022-12-23 18:12:36 +08:00
momen
3a54cba3e5 !176 让浏览器获取中文页面
* !1 enhanced: 判断系统语言,中文则修改请求头,请求中文网页
2022-12-23 10:12:18 +00:00
79463246fb fix: 修复编译依赖 2022-12-23 18:11:44 +08:00
cc8ff5eff2 enhance: 消除 c11 标准警告 2022-12-23 16:46:32 +08:00
613327b2cc fix: 修复非deepin的wayland环境下ui显示 2022-12-23 16:30:36 +08:00
8b31db843c fix: Wayland 在某些环境下错误识别为 dde 2022-12-23 16:30:36 +08:00
fd4fdbe970 format: 代码格式化 2022-12-23 12:13:48 +08:00
89a3ab0b4c feat: support wayland 2022-12-22 21:50:27 +08:00
0179c2f04f feat: wayland 2022-12-22 00:49:11 +08:00
8918e63484 !171 4.1.1-real
Merge pull request !171 from shenmo/dev
2022-12-21 16:18:05 +00:00
6d1fb80f0f update src/main.cpp.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2022-12-21 16:17:32 +00:00
4add78c6d7 update debian/changelog.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2022-12-21 16:17:19 +00:00
zty199
89c32013bf fix: 修复应用更新失败问题
zenity 处理多选框时,返回结果取值错误导致,获取值实际为已安装版本号,而不是包名

Log: 修改 zenity 参数为 --print-column=2 获取包名
2022-12-21 23:57:06 +08:00
27 changed files with 680 additions and 583 deletions

View File

@@ -1,73 +0,0 @@
# 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 Store aims to collect Linux apps for the convieniece of Linux new comers
The collecting process needs everyone's help
We set up this APP Store and collect APPs/tools that everyone need widely. Also we pack Windows apps with wine.
All packages will be shared in our repository for users to get freely.
Distrobution supportedDeepin 20 ; Ubuntu 22.04 LTS / Ubuntu 20.04 LTS(May stop support in the future ; UniontechOS Home 21
*About OpenKylin and deepin 23*
The adaptation work is scheduled after their official release.
You can track our Issue resoving progress here https://gitee.com/deepin-community-store/spark-store/board
We hope people who see here can also join our teamdevelopment help or submit applications are welcomed
If you want to submit an APP to share with othersPlease [Click here](https://upload.deepinos.org/index)
## 🙌 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://code.gitlink.org.cn/shenmo7192/spark-store-dependencies/raw/branch/master/spark-store-dependencies-kylin.zip)
---
#### Compile and developement
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
```
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
```
Then
```shell
git clone https://gitee.com/deepin-community-store/spark-store.git
cd spark-store
dpkg-buildpackage
```
## 🚀 Coorperation
We use Gitee as our code hosting platform. Please click here to contact us.
https://gitee.com/deepin-community-store/spark-store
### Rocket Chat
https://chat.shenmo.tech/
PWA Client
spk://store/chat/store.spark-app.feedback
Copy and paste to search bar or in browser address bar after installing Spark Store

View File

@@ -1,50 +1,53 @@
# 星火应用商店
# 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)
众所周知国内的Linux应用比较少wine应用难以获取优质工具分散在民间各大论坛无法形成合力难以改善生态
Spark Store aims to collect Linux apps for the convieniece of Linux new comers
生态构建需要的不是某一方的单打独斗,而是人人行动起来,汇聚星火,产生燎原之势
The collecting process needs everyone's help
我们创建了这个应用商店广泛收录大家需要的软件包搜集优质小工具主动适配wine应用存放到储存库供大家获取
我们支持Deepin 20 ; Ubuntu 22.04 LTS / Ubuntu 20.04 LTS(将会逐渐停止支持) ; UOS Home 21
We set up this APP Store and collect APPs/tools that everyone need widely. Also we pack Windows apps with wine.
## 关于协作:分支相关的文档见 [这里](https://deepin-community-store.gitee.io/spark-wiki/#/Dev/Spark-Store-Git-Repo)
All packages will be shared in our repository for users to get freely.
*关于OpenKylin和deepin 23*
Distrobution supportedDeepin 20 ; Ubuntu 22.04 LTS / Ubuntu 20.04 LTS(May stop support in the future ; UniontechOS Home 21
支持计划将会在对应系统发布正式版之后开始评估和执行
*About OpenKylin and deepin 23*
希望看到这里的人也可以加入我们的队伍开发或者投递应用都很欢迎共同构建Linux应用生态
The adaptation work is scheduled after their official release.
在这里追踪我们的Issue处理情况 https://gitee.com/deepin-community-store/spark-store/board
如果有想要提交的软件包,请 [在这里投稿](https://upload.deepinos.org/index)
You can track our Issue resoving progress here https://gitee.com/deepin-community-store/spark-store/board
## 🙌 简单的开始
We hope people who see here can also join our teamdevelopment help or submit applications are welcomed
如果想安装 `星火应用商店` ,请打开右侧的 [Release] 页面,找到最新版本,并选择适用于当前系统的安装包下载。
If you want to submit an APP to share with othersPlease [Click here](https://upload.deepinos.org/index)
如果你在使用 `Debian 11/Ubuntu 20.04`,你需要额外下载[依赖补充包](https://code.gitlink.org.cn/shenmo7192/spark-store-dependencies/raw/branch/master/spark-store-dependencies-kylin.zip)
## 🙌 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://code.gitlink.org.cn/shenmo7192/spark-store-dependencies/raw/branch/master/spark-store-dependencies-kylin.zip)
---
#### 编译安装
#### Compile and developement
Deepin V20/UOS 21 系统下, 安装依赖
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
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
```
Ubuntu 22.04 系统下, 安装依赖
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
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
```
然后
Then
```shell
git clone https://gitee.com/deepin-community-store/spark-store.git
cd spark-store
@@ -53,16 +56,18 @@ dpkg-buildpackage
## 🚀 协作
## 🚀 Coorperation
非常感谢有兴趣的开发者或爱好者参与 `星火应用商店` 项目,分享你的见解与思路。
We use Gitee as our code hosting platform. Please click here to contact us.
### 交流平台
https://gitee.com/deepin-community-store/spark-store
### Rocket Chat
https://chat.shenmo.tech/
客户端PWA
PWA Client
spk://store/chat/store.spark-app.feedback
安装星火商店后在浏览器打开或复制到搜索栏打开
Copy and paste to search bar or in browser address bar after installing Spark Store

68
README.zh.md Normal file
View File

@@ -0,0 +1,68 @@
# 星火应用商店
[![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应用存放到储存库供大家获取
我们支持Deepin 20 ; Ubuntu 22.04 LTS / Ubuntu 20.04 LTS(将会逐渐停止支持) ; UOS Home 21
## 关于协作:分支相关的文档见 [这里](https://deepin-community-store.gitee.io/spark-wiki/#/Dev/Spark-Store-Git-Repo)
*关于OpenKylin和deepin 23*
支持计划将会在对应系统发布正式版之后开始评估和执行
希望看到这里的人也可以加入我们的队伍开发或者投递应用都很欢迎共同构建Linux应用生态
在这里追踪我们的Issue处理情况 https://gitee.com/deepin-community-store/spark-store/board
如果有想要提交的软件包,请 [在这里投稿](https://upload.deepinos.org/index)
## 🙌 简单的开始
如果想安装 `星火应用商店` ,请打开右侧的 [Release] 页面,找到最新版本,并选择适用于当前系统的安装包下载。
如果你在使用 `Debian 11/Ubuntu 20.04`,你需要额外下载[依赖补充包](https://code.gitlink.org.cn/shenmo7192/spark-store-dependencies/raw/branch/master/spark-store-dependencies-kylin.zip)
---
#### 编译安装
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
```
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
```
然后
```shell
git clone https://gitee.com/deepin-community-store/spark-store.git
cd spark-store
dpkg-buildpackage
```
## 🚀 协作
非常感谢有兴趣的开发者或爱好者参与 `星火应用商店` 项目,分享你的见解与思路。
### 交流平台
https://chat.shenmo.tech/
客户端PWA
spk://store/chat/store.spark-app.feedback
(安装星火商店后在浏览器打开或复制到搜索栏打开)

16
debian/changelog vendored
View File

@@ -1,3 +1,19 @@
spark-store (4.1.2) stable; urgency=medium
* feat: 初步的wayland支持
* fix: 首页的捐赠页面在中文环境下显示中文
* chore: 新增编译依赖,测试安装时不会出现报错
* fix: 更新检测模块在aptss ssupdate操作失败后现在会正确地移除锁而不是错误的残留锁。
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
spark-store (4.1.1) stable; urgency=medium
* fix:更新失效
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
spark-store (4.1.0) stable; urgency=medium
* feat: 现在可以支持UOS签名包问题了

8
debian/control vendored
View File

@@ -15,7 +15,11 @@ Build-Depends:
libdtkgui-dev(>=5.0),
libdtkwidget-dev(>=5.0),
qttools5-private-dev,
qtwebengine5-dev
qtwebengine5-dev,
qtwayland5,
qtwayland5-dev-tools,
gcc,
g++
Standards-Version: 3.0
Homepage: https://www.spark-app.store/
@@ -28,12 +32,12 @@ Depends:${shlibs:Depends}, ${misc:Depends},
libqt5widgets5,
libqt5network5,
libqt5concurrent5,
qtwayland5,
libdtkcore5,
libdtkgui5,
libdtkwidget5,
curl,
openssl,
libssl-dev,
dde-qt5integration,
bubblewrap,
aria2,

View File

@@ -8,6 +8,7 @@ TARGET = spark-store
TEMPLATE = subdirs
CONFIG += ordered
CONFIG += wayland-compositor
SUBDIRS += \
src/spark-dstore-patch \

View File

@@ -30,7 +30,6 @@ void DownloadController::setFilename(QString filename)
this->filename = filename;
}
bool checkMeatlink(QString metaUrl)
{
QFile metaStatus("/tmp/spark-store/metaStatus.txt");

View File

@@ -4,8 +4,7 @@
#include <QScreen> // Qt5 不再建议使用 QDesktopWidget
#include <QGuiApplication>
image_show::image_show(QWidget *parent) :
QWidget(parent),
image_show::image_show(QWidget *parent) : QWidget(parent),
m_dialog(new big_image),
m_label(new QLabel)
{

View File

@@ -17,7 +17,8 @@ void SparkAPI::get(QUrl url)
QNetworkRequest request;
HttpRequest *httprequest = new HttpRequest;
request.setUrl(QUrl(url.toString().replace("+", "%2B")));
connect(httprequest,&HttpRequest::finished,[=](QString data){
connect(httprequest, &HttpRequest::finished, [=](QString data)
{
QByteArray arr = data.toUtf8();
//解析Json
QJsonParseError error;
@@ -30,8 +31,7 @@ void SparkAPI::get(QUrl url)
emit finishedObject(doc);
}
httprequest->deleteLater();
});
httprequest->deleteLater(); });
httprequest->getRequest(request);
}
void SparkAPI::getRAW(QUrl url)
@@ -39,10 +39,10 @@ void SparkAPI::getRAW(QUrl url)
QNetworkRequest request;
HttpRequest *httprequest = new HttpRequest;
request.setUrl(QUrl(url.toString().replace("+", "%2B")));
connect(httprequest,&HttpRequest::finished,[=](QString data){
connect(httprequest, &HttpRequest::finished, [=](QString data)
{
emit finishedRAW(data);
httprequest->deleteLater();
});
httprequest->deleteLater(); });
httprequest->getRequest(request);
}
void SparkAPI::getAppList(QString type)

View File

@@ -3,7 +3,6 @@
DBusSparkStoreService::DBusSparkStoreService(QObject *parent)
: QDBusAbstractAdaptor(parent)
{
}
void DBusSparkStoreService::activeWindow(const QString &arg)

View File

@@ -7,60 +7,101 @@
#include <DAboutDialog>
#include <QLabel>
#include <DWidgetUtil>
#include <DSysInfo>
DCORE_USE_NAMESPACE
DWIDGET_USE_NAMESPACE
int main(int argc, char *argv[])
{
// Get build time
static const QString version = "Version 4.1.0";
static const QString version = "Version 4.1.2";
static const QDate buildDate = QLocale(QLocale::English).toDate(QString(__DATE__).replace(" ", " 0"), "MMM dd yyyy");
static const QTime buildTime = QTime::fromString(__TIME__, "hh:mm:ss");
QSettings readConfig(QDir::homePath() + "/.config/spark-store/config.ini", QSettings::IniFormat);
QSettings *setConfig = new QSettings(QDir::homePath() + "/.config/spark-store/config.ini", QSettings::IniFormat);
// 设置桌面环境环境变量
if (!QString(qgetenv("XDG_CURRENT_DESKTOP")).toLower().startsWith("deepin")) {
bool isDeepinOS = true;
if (!QString(qgetenv("XDG_CURRENT_DESKTOP")).toLower().startsWith("deepin"))
{
setenv("XDG_CURRENT_DESKTOP", "Deepin", 1);
isDeepinOS = false;
}
bool isWayland = false;
auto e = QProcessEnvironment::systemEnvironment();
QString XDG_SESSION_TYPE = e.value(QStringLiteral("XDG_SESSION_TYPE"));
QString WAYLAND_DISPLAY = e.value(QStringLiteral("WAYLAND_DISPLAY"));
if (XDG_SESSION_TYPE == QLatin1String("wayland") || WAYLAND_DISPLAY.contains(QLatin1String("wayland"), Qt::CaseInsensitive))
{
isWayland = true;
}
setConfig->setValue("build/isWayland", isWayland);
setConfig->setValue("build/isDeepinOS", isDeepinOS);
// Check config file, if there is no wayland config, then set it to default, which means use wayland if possible.
if (!readConfig.contains("build/useWayland"))
{
setConfig->setValue("build/useWayland", true);
}
bool useWayland = readConfig.value("build/useWayland").toBool();
qDebug() << "System Wayland enabled:" << isWayland << ". Spark Wayland enabled:" << useWayland;
// Set display backend
if (isWayland && useWayland && !(Dtk::Core::DSysInfo::isDDE() || isDeepinOS))
{
qputenv("QT_QPA_PLATFORM", "wayland");
}
else if (isWayland && useWayland && (Dtk::Core::DSysInfo::isDDE() && isDeepinOS))
{
qputenv("QT_QPA_PLATFORM", "dwayland");
}
else
{
qputenv("QT_QPA_PLATFORM", "dxcb");
}
DApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // 开启 Hidpi 支持
#ifndef DSTORE_NO_DXCBs
DApplication::loadDXcbPlugin(); // 加载 DXCB 插件
#endif
// 浏览器开启 GPU 支持
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--ignore-gpu-blocklist --enable-gpu-rasterization --enable-native-gpu-memory-buffers --enable-accelerated-video-decode");
QVector<char *> fakeArgs(argc + 2);
fakeArgs[0] = argv[0];
fakeArgs[1] = "-platformtheme";
fakeArgs[2] = "deepin";
for(int i = 1; i < argc; i++) fakeArgs[i + 2] = argv[i];
int fakeArgc = argc + 2; // 为啥DApplication的argc要用引用啊
DApplication a(fakeArgc, fakeArgs.data());
QString fakeArgs1 = "-platformtheme";
QByteArray fakeArgsTemp = fakeArgs1.toLatin1(); // must
fakeArgs[1] = fakeArgsTemp.data();
fakeArgs1 = "deepin";
fakeArgsTemp = fakeArgs1.toLatin1(); // must
fakeArgs[2] = fakeArgsTemp.data();
for (int i = 1; i < argc; i++)
fakeArgs[i + 2] = argv[i];
int fakeArgc = argc + 2; // DApplication的argc要用引用避免c++编译器优化
DApplication a(fakeArgc, fakeArgs.data());
// 初始化日志模块 (默认日志位置 ~/.cache/deepin/spark-store)
DLogManager::registerConsoleAppender();
DLogManager::registerFileAppender();
// Wayland 环境下使用,防止子控件 Native 化
if (!DPlatformWindowHandle::pluginVersion().isEmpty()) {
if (!DPlatformWindowHandle::pluginVersion().isEmpty())
{
a.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings, true);
}
a.setAttribute(Qt::AA_UseHighDpiPixmaps);
a.loadDXcbPlugin();
a.setApplicationDisplayName("Spark Store");
a.loadTranslator(); // 载入翻译
QSettings readConfig(QDir::homePath() + "/.config/spark-store/config.ini", QSettings::IniFormat);
if (readConfig.value("build/version").toString() != version){
if (readConfig.value("build/version").toString() != version)
{
qDebug() << "Spark Store has been updated!";
QSettings *setConfig = new QSettings(QDir::homePath() + "/.config/spark-store/config.ini", QSettings::IniFormat);
setConfig->setValue("build/version", version);
setConfig->setValue("build/time", buildDate.toString("yyyy.MM.dd") + "-" + buildTime.toString());
setConfig->deleteLater();
}
setConfig->deleteLater();
// Customized DAboutDialog
@@ -74,9 +115,7 @@ int main(int argc, char *argv[])
QObject::tr(
"<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:12pt;'>Spark developers</span>"));
dialog.setProductName(QLabel::tr("Spark Store"));
dialog.setCompanyLogo(QPixmap(":/spark-store.png"));
@@ -93,9 +132,7 @@ int main(int argc, char *argv[])
"<span style='font-size:10pt;font-weight:60;'>An appstore powered by deepin 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><br/><br/>"
"Published under GPL V3"
)
);
"Published under GPL V3"));
// 限制单实例运行
if (!a.setSingleInstance("spark-store"))
{
@@ -109,7 +146,6 @@ int main(int argc, char *argv[])
iface.asyncCall("activeWindow", arg1);
return -1;
}
@@ -121,10 +157,12 @@ int main(int argc, char *argv[])
Dtk::Widget::moveToCenter(&w);
QString arg1 = argv[1];
if (arg1.startsWith("spk://")) {
if (arg1.startsWith("spk://"))
{
w.openUrl(QUrl(argv[1]));
}
w.show();
w.setWindowTitle("Spark Store");
return a.exec();
}

View File

@@ -3,16 +3,19 @@
#include <DWidgetUtil>
#include <DGuiApplicationHelper>
#include <DApplicationSettings>
#include <QSizePolicy>
#define AppPageApplist 0
#define AppPageSearchlist 1
#define AppPageAppdetail 2
#define AppPageSettings 3
#define WaylandSearchCenter 1
#define OtherSearchCenter 2
#define RightSearchSpace 1
MainWindow::MainWindow(QWidget *parent)
: BaseWidgetOpacity(parent)
, ui(new Ui::MainWindow)
: BaseWidgetOpacity(parent), ui(new Ui::MainWindow)
{
ui->setupUi(this);
initConfig();
@@ -42,12 +45,14 @@ MainWindow::MainWindow(QWidget *parent)
menu->addAction(actionSubmissionWithClient);
ui->titlebar->setMenu(menu);
connect(actionSubmission, &QAction::triggered, this, [=]{QDesktopServices::openUrl(QUrl("https://upload.deepinos.org/"));});
connect(setting, &QAction::triggered, this, [=]{
connect(actionSubmission, &QAction::triggered, this, [=]
{ QDesktopServices::openUrl(QUrl("https://upload.deepinos.org/")); });
connect(setting, &QAction::triggered, this, [=]
{
switchPage(AppPageSettings);
ui->settingspage->updateUI();
});
connect(upgrade, &QAction::triggered, this, [=]{QProcess::startDetached("/opt/durapps/spark-store/bin/update-upgrade/ss-update-controler.sh");});
ui->settingspage->updateUI(); });
connect(upgrade, &QAction::triggered, this, [=]
{ QProcess::startDetached("/opt/durapps/spark-store/bin/update-upgrade/ss-update-controler.sh"); });
// 投稿器
connect(actionSubmissionWithClient, &QAction::triggered, this, [=]
{
@@ -58,16 +63,15 @@ MainWindow::MainWindow(QWidget *parent)
qDebug() << "投稿器存在";
QProcess::startDetached("/opt/spark-store-submitter/bin/spark-store-submitter");
}
else{
else
{
qDebug() << "投稿器不存在,跳转页面";
openUrl(submitterSpk);
}
});
} });
// 主题切换
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [=](DGuiApplicationHelper::ColorType themeType) {
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [=](DGuiApplicationHelper::ColorType themeType)
{
if (themeType == DGuiApplicationHelper::DarkType) {
//深色模式
setMaskColor(QColor("#2a2b2b"));
@@ -79,8 +83,7 @@ MainWindow::MainWindow(QWidget *parent)
downloadButton->setBackgroundColor(QColor("#444444"));
downloadButton->setColor(QColor("#66CCFF"));
ui->pushButton_14->setIcon(QIcon(":/icon/dark/update.svg"));
int i = 0;
while (i < ui->buttonGroup->buttons().size()) {
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;}\
@@ -91,7 +94,6 @@ MainWindow::MainWindow(QWidget *parent)
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;}");
}
i++;
}
} else {
//亮色模式
@@ -104,8 +106,7 @@ MainWindow::MainWindow(QWidget *parent)
downloadButton->setColor(QColor("#66CCFF"));
downloadButton->setIcon(":/icon/light/download.svg");
ui->pushButton_14->setIcon(QIcon(":/icon/light/update.svg"));
int i = 0;
while (i < ui->buttonGroup->buttons().size()) {
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;}\
@@ -116,42 +117,45 @@ MainWindow::MainWindow(QWidget *parent)
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;}");
}
i++;
}
}
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);
});
ui->settingspage->setTheme(themeType == DGuiApplicationHelper::DarkType); });
// 初始化标题栏控件
connect(downloadButton, &ProgressButton::clicked, [=]() {
connect(downloadButton, &ProgressButton::clicked, [=]()
{
QPoint pos;
pos.setX(downloadButton->mapToGlobal(QPoint(0, 0)).x() + downloadButton->width() / 2 - downloadlistwidget->width() / 2);
pos.setY(downloadButton->mapToGlobal(QPoint(0, 0)).y() + downloadButton->height() + 5);
downloadlistwidget->m_move(pos.x(), pos.y());
downloadlistwidget->show();
});
downloadlistwidget->show(); });
// appintopage按下下载按钮时标题栏下载列表按钮抖动
connect(ui->appintopage, &AppIntoPage::clickedDownloadBtn, [=]() {
connect(ui->appintopage, &AppIntoPage::clickedDownloadBtn, [=]()
{
WidgetAnimation::widgetShake(downloadButton, 6); // 第一个参数是抖动的控件,第二个参数是抖动范围(像素)
});
connect(backButtom, &QPushButton::clicked, [=]() {
connect(backButtom, &QPushButton::clicked, [=]()
{
ui->stackedWidget->setCurrentIndex(pageHistory.at(pageHistory.count() - 2));
pageHistory.removeLast();
if (pageHistory.count() > 1) {
backButtom->show();
} else {
backButtom->hide();
}
});
} });
downloadlistwidget->hide();
backButtom->hide();
ui->titlebar->setIcon(QIcon::fromTheme(":/icon/logo.svg"));
// Check wayland configs
QSettings readConfig(QDir::homePath() + "/.config/spark-store/config.ini", QSettings::IniFormat);
QWidget *w_titlebar = new QWidget(ui->titlebar);
QHBoxLayout *ly_titlebar = new QHBoxLayout(w_titlebar);
QLabel *title = new QLabel(this);
@@ -159,26 +163,39 @@ MainWindow::MainWindow(QWidget *parent)
searchEdit->setPlaceholderText(tr("Search or enter spk://"));
ly_titlebar->addWidget(title);
ly_titlebar->addWidget(backButtom);
ly_titlebar->addStretch(2.5);
if (!readConfig.value("build/isDeepinOS").toBool() && readConfig.value("build/useWayland").toBool())
{
// Wayland 搜索栏居中
ly_titlebar->addStretch(WaylandSearchCenter);
}
else
{
// dwayland dxcb 搜索栏顶部右侧居中
ly_titlebar->addStretch(OtherSearchCenter);
}
ly_titlebar->addWidget(searchEdit);
ly_titlebar->addWidget(downloadButton);
ly_titlebar->addStretch(1);
ly_titlebar->addStretch(RightSearchSpace);
ui->titlebar->setCustomWidget(w_titlebar);
// 侧边栏按钮
int i = 0;
while (i < ui->buttonGroup->buttons().size()) {
while (i < ui->buttonGroup->buttons().size())
{
ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{qproperty-icon: url(data/images/userMangaer/teacher.png);}");
connect(ui->buttonGroup->buttons()[i], &QPushButton::toggled, [=](bool checked) {
connect(ui->buttonGroup->buttons()[i], &QPushButton::toggled, [=](bool checked)
{
if (checked == true) {
searchEdit->clearEdit();
updateUi(i);
}
});
} });
i++;
}
// 搜索事件
connect(searchEdit, &DSearchEdit::returnPressed, this, [=]() {
connect(searchEdit, &DSearchEdit::returnPressed, this, [=]()
{
QString searchtext = searchEdit->text();
if (!searchtext.isEmpty()) {
if (searchtext.startsWith("spk://")) {
@@ -189,22 +206,17 @@ MainWindow::MainWindow(QWidget *parent)
switchPage(AppPageSearchlist);
}
}
this->setFocus();
});
this->setFocus(); });
connect(downloadlistwidget, &DownloadListWidget::downloadProgress, this, [=](int i) {
downloadButton->setProgress(i);
});
connect(downloadlistwidget, &DownloadListWidget::downloadProgress, this, [=](int i)
{ downloadButton->setProgress(i); });
// 列表点击事件
connect(ui->applistpage, &AppListPage::clicked, this, [=](QUrl spk) {
openUrl(spk);
});
connect(ui->applistpage_1, &AppListPage::clicked, this, [=](QUrl spk) {
openUrl(spk);
});
connect(ui->settingspage, &SettingsPage::openUrl, this, [=](QUrl spk) {
openUrl(spk);
});
connect(ui->applistpage, &AppListPage::clicked, this, [=](QUrl spk)
{ openUrl(spk); });
connect(ui->applistpage_1, &AppListPage::clicked, this, [=](QUrl spk)
{ openUrl(spk); });
connect(ui->settingspage, &SettingsPage::openUrl, this, [=](QUrl spk)
{ openUrl(spk); });
emit DGuiApplicationHelper::instance()->themeTypeChanged(DGuiApplicationHelper::instance()->themeType());
initDbus();
@@ -237,10 +249,13 @@ void MainWindow::onGetUrl(const QString &url)
void MainWindow::openUrl(QUrl url)
{
if (url.toString().startsWith("spk://")) {
if (url.toString().startsWith("spk://"))
{
ui->appintopage->openUrl(QUrl(url.toString().replace("+", "%2B")));
switchPage(AppPageAppdetail);
} else {
}
else
{
QDesktopServices::openUrl(QUrl(url.toString().replace("+", "%2B")));
}
}
@@ -255,9 +270,12 @@ void MainWindow::initConfig()
void MainWindow::switchPage(int now) // 临时方案,回家后修改
{
qDebug() << pageHistory.count();
if (pageHistory.count() >= 1) {
if (pageHistory.count() >= 1)
{
backButtom->show();
} else {
}
else
{
backButtom->hide();
}
ui->stackedWidget->setCurrentIndex(now);
@@ -290,12 +308,14 @@ void MainWindow::updateUi(int now)
void MainWindow::on_pushButton_14_clicked()
{
QFile upgradeStatus("/tmp/spark-store/upgradeStatus.txt");
if (!upgradeStatus.exists()){
QtConcurrent::run([=]{
if (!upgradeStatus.exists())
{
QtConcurrent::run([=]
{
auto upgradeP = new QProcess();
upgradeP->startDetached("/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh");
upgradeP->waitForStarted();
upgradeP->waitForFinished(-1);
});
upgradeP->deleteLater(); });
}
}

View File

@@ -1,7 +1,6 @@
#include "appintopage.h"
#include "ui_appintopage.h"
AppIntoPage::AppIntoPage(QWidget *parent) :
QWidget(parent),
AppIntoPage::AppIntoPage(QWidget *parent) : QWidget(parent),
ui(new Ui::AppIntoPage)
{
ui->setupUi(this);
@@ -10,11 +9,11 @@ AppIntoPage::AppIntoPage(QWidget *parent) :
ui->listWidget->setMaximumHeight(200);
ui->listWidget->setFlow(QListView::TopToBottom);
api1 = new SparkAPI(this);
connect(api1,&SparkAPI::finishedRAW,[=](QString download_times){
connect(api1, &SparkAPI::finishedRAW, [=](QString download_times)
{
download_times.remove(QRegExp("\\n"));
ui->download_times->setText(download_times);
qDebug()<<"Download Times:"+download_times;
});
qDebug()<<"Download Times:"+download_times; });
clear();
}
@@ -50,16 +49,16 @@ void AppIntoPage::clear()
void AppIntoPage::setDownloadWidget(DownloadListWidget *w)
{
dw = w;
connect(w, &DownloadListWidget::downloadFinished, [=]() {
isDownloading(SparkAPI::getServerUrl()+"store"+spk.path()+"/"+info["Filename"].toString());
});
connect(w, &DownloadListWidget::downloadFinished, [=]()
{ isDownloading(SparkAPI::getServerUrl() + "store" + spk.path() + "/" + info["Filename"].toString()); });
}
void AppIntoPage::openUrl(QUrl url)
{
spk = url;
SparkAPI *api = new SparkAPI(this);
clear();
connect(api,&SparkAPI::finishedObject,[=](QJsonObject appinfo){
connect(api, &SparkAPI::finishedObject, [=](QJsonObject appinfo)
{
info = appinfo;
// qDebug()<<url;
@@ -188,36 +187,42 @@ void AppIntoPage::openUrl(QUrl url)
}
this->sltAppinfoTags(&taglist);
disconnect(api,&SparkAPI::finished,nullptr,nullptr);
api->deleteLater();
});
api->deleteLater(); });
api->getAppInfo(url);
api1->getAppDownloadTimes(url);
}
void AppIntoPage::isDownloading(QUrl url)
{
if (dw->getUrlList().lastIndexOf(url) == -1) {
if (dw->getUrlList().lastIndexOf(url) == -1)
{
ui->downloadButton->setEnabled(true);
return;
} else {
}
else
{
ui->downloadButton->setEnabled(false);
}
ui->pushButton_3->hide();
if (dw->getDIList()[dw->getUrlList().lastIndexOf(url)]->download == 2) {
if (dw->getDIList()[dw->getUrlList().lastIndexOf(url)]->download == 2)
{
ui->downloadButton->setEnabled(true);
ui->downloadButton->setText(tr("Download"));
}
if (dw->getDIList()[dw->getUrlList().lastIndexOf(url)]->download == 1) {
if (dw->getDIList()[dw->getUrlList().lastIndexOf(url)]->download == 1)
{
ui->downloadButton->setEnabled(true);
ui->downloadButton->setText(tr("Install"));
}
if (dw->getDIList()[dw->getUrlList().lastIndexOf(url)]->isInstall) {
if (dw->getDIList()[dw->getUrlList().lastIndexOf(url)]->isInstall)
{
ui->downloadButton->setEnabled(false);
ui->downloadButton->setText(tr("Installing"));
return;
}
if (dw->getDIList()[dw->getUrlList().lastIndexOf(url)]->download == 3) {
if (dw->getDIList()[dw->getUrlList().lastIndexOf(url)]->download == 3)
{
ui->downloadButton->setEnabled(true);
ui->downloadButton->setText(tr("Reinstall"));
ui->downloadButton->show();
@@ -279,7 +284,9 @@ void AppIntoPage::setTheme(bool dark)
ui->icon_4->setPixmap(QPixmap(":/icon/dark/text.svg"));
ui->icon_5->setPixmap(QPixmap(":/icon/dark/folder.svg"));
ui->icon_6->setPixmap(QPixmap(":/icon/dark/globe.svg"));
}else {
}
else
{
// 亮色模式
QString frameStyleSheet = "#frame,#frame_2,#frame_3,#frame_4{background-color: #fbfbfb;border-radius:14px;border:1px solid rgb(229,229,229);}";
ui->frame->setStyleSheet(frameStyleSheet);
@@ -293,7 +300,6 @@ void AppIntoPage::setTheme(bool dark)
ui->icon_4->setPixmap(QPixmap(":/icon/light/text.svg"));
ui->icon_5->setPixmap(QPixmap(":/icon/light/folder.svg"));
ui->icon_6->setPixmap(QPixmap(":/icon/light/globe.svg"));
}
}
AppIntoPage::~AppIntoPage()
@@ -307,10 +313,10 @@ void AppIntoPage::on_downloadButton_clicked()
{
dw->getDIList()[dw->getUrlList().lastIndexOf(SparkAPI::getServerUrl() + "store" + spk.path() + "/" + info["Filename"].toString())]->install(0);
isDownloading(SparkAPI::getServerUrl() + "store" + spk.path() + "/" + info["Filename"].toString());
QObject::connect(dw->getDIList()[dw->getUrlList().lastIndexOf(SparkAPI::getServerUrl()+"store"+spk.path()+"/"+info["Filename"].toString())],&DownloadItem::finished,[=](){
QObject::connect(dw->getDIList()[dw->getUrlList().lastIndexOf(SparkAPI::getServerUrl() + "store" + spk.path() + "/" + info["Filename"].toString())], &DownloadItem::finished, [=]()
{
isDownloading(SparkAPI::getServerUrl()+"store"+spk.path()+"/"+info["Filename"].toString());
disconnect(dw->getDIList()[dw->getUrlList().lastIndexOf(SparkAPI::getServerUrl()+"store"+spk.path()+"/"+info["Filename"].toString())],&DownloadItem::finished,nullptr,nullptr);
});
disconnect(dw->getDIList()[dw->getUrlList().lastIndexOf(SparkAPI::getServerUrl()+"store"+spk.path()+"/"+info["Filename"].toString())],&DownloadItem::finished,nullptr,nullptr); });
return;
}
emit clickedDownloadBtn();
@@ -320,10 +326,10 @@ void AppIntoPage::on_downloadButton_clicked()
dw->getDIList()[dw->allDownload - 1]->reinstall = true;
}
ui->downloadButton->setEnabled(false);
QObject::connect(dw->getDIList()[dw->getUrlList().lastIndexOf(SparkAPI::getServerUrl()+"store"+spk.path()+"/"+info["Filename"].toString())],&DownloadItem::finished,[=](){
QObject::connect(dw->getDIList()[dw->getUrlList().lastIndexOf(SparkAPI::getServerUrl() + "store" + spk.path() + "/" + info["Filename"].toString())], &DownloadItem::finished, [=]()
{
isDownloading(SparkAPI::getServerUrl()+"store"+spk.path()+"/"+info["Filename"].toString());
disconnect(dw->getDIList()[dw->getUrlList().lastIndexOf(SparkAPI::getServerUrl()+"store"+spk.path()+"/"+info["Filename"].toString())],&DownloadItem::finished,nullptr,nullptr);
});
disconnect(dw->getDIList()[dw->getUrlList().lastIndexOf(SparkAPI::getServerUrl()+"store"+spk.path()+"/"+info["Filename"].toString())],&DownloadItem::finished,nullptr,nullptr); });
isDownloading(SparkAPI::getServerUrl() + "store" + spk.path() + "/" + info["Filename"].toString());
}
@@ -352,8 +358,7 @@ void AppIntoPage::on_pushButton_3_clicked()
}
ui->downloadButton->setEnabled(true);
ui->pushButton_3->setEnabled(true);
});
ui->pushButton_3->setEnabled(true); });
}
void AppIntoPage::on_shareButton_clicked()
@@ -364,7 +369,6 @@ void AppIntoPage::on_shareButton_clicked()
clipboard->setText(spk.toString());
}
void AppIntoPage::on_updateButton_clicked()
{
QString feedbackSpk = "spk://store/chat/store.spark-app.feedback";
@@ -374,9 +378,9 @@ void AppIntoPage::on_updateButton_clicked()
qDebug() << "反馈器存在";
QProcess::startDetached("sh /opt/durapps/store.spark-app.feedback/launch.sh");
}
else{
else
{
qDebug() << "反馈器不存在,跳转页面";
openUrl(feedbackSpk);
}
}

View File

@@ -1,8 +1,7 @@
#include "applistpage.h"
#include "ui_applistpage.h"
AppListPage::AppListPage(QWidget *parent) :
QWidget(parent),
AppListPage::AppListPage(QWidget *parent) : QWidget(parent),
ui(new Ui::AppListPage)
{
ui->setupUi(this);
@@ -14,14 +13,18 @@ void AppListPage::setTheme(bool dark)
if (dark)
{
this->setStyleSheet("#frame{background-color: #252525;border-radius:14px;border:1px solid rgb(64, 64, 64);}");
}else {
}
else
{
// 亮色模式
this->setStyleSheet("#frame{background-color: #ffffff;border-radius:14px;border:1px solid rgb(229,229,229);}");
}
if (isSearch)
{
getSearchList(nowType);
}else{
}
else
{
getAppList(nowType);
}
}
@@ -35,13 +38,17 @@ void AppListPage::getAppList(QString type)
if (isDark)
{
theme = "theme=dark";
}else{
}
else
{
theme = "theme=light";
}
if (type == "")
{
url = api->getServerUrl() + "store/#/flamescion/?" + theme;
}else{
}
else
{
url = api->getServerUrl() + "store/#/flamescion/applist?type=" + type + "&" + theme;
}
@@ -58,7 +65,9 @@ void AppListPage::getSearchList(QString keyword)
if (isDark)
{
theme = "theme=dark";
}else{
}
else
{
theme = "theme=light";
}
url = api->getServerUrl() + "store/#/flamescion/search?keywords=" + keyword + "&" + theme;
@@ -83,4 +92,3 @@ void AppListPage::on_webEngineView_urlChanged(const QUrl &arg1)
emit clicked(url);
}
}

View File

@@ -1,8 +1,7 @@
#include "settingspage.h"
#include "ui_settingspage.h"
bool SettingsPage::isdownload = false;
SettingsPage::SettingsPage(QWidget *parent) :
QWidget(parent),
SettingsPage::SettingsPage(QWidget *parent) : QWidget(parent),
ui(new Ui::SettingsPage)
{
ui->setupUi(this);
@@ -15,7 +14,9 @@ void SettingsPage::setTheme(bool dark)
if (dark)
{
this->setStyleSheet("#frame{background-color: #252525;border-radius:14px;border:1px solid rgb(64, 64, 64);}");
}else {
}
else
{
// 亮色模式
this->setStyleSheet("#frame{background-color: #ffffff;border-radius:14px;border:1px solid rgb(229,229,229);}");
}
@@ -97,11 +98,9 @@ void SettingsPage::on_pushButton_updateServer_clicked()
ui->pushButton_updateServer->setEnabled(true);
readServerList();
ui->comboBox_server->setCurrentIndex(0);
});
ui->comboBox_server->setCurrentIndex(0); });
}
void SettingsPage::on_comboBox_server_currentIndexChanged(const QString &arg1)
{
SparkAPI::setServerUrl(arg1); // 服务器信息更新
@@ -184,11 +183,9 @@ void SettingsPage::on_pushButton_updateApt_clicked()
emit openUrl(QUrl("spk://store/tools/spark-store"));
ui->label_aptserver->setText(tr(""));
ui->pushButton_updateApt->setEnabled(true);
});
ui->pushButton_updateApt->setEnabled(true); });
}
void SettingsPage::on_pushButton_clear_clicked()
{
QtConcurrent::run([=]()
@@ -204,11 +201,9 @@ void SettingsPage::on_pushButton_clear_clicked()
}
Utils::sendNotification("spark-store",tr("Spark Store"),tr("Temporary cache was cleaned"));
ui->pushButton_clear->setEnabled(true);
updateUI();
});
updateUI(); });
}
void SettingsPage::on_pushButton_clearWebCache_clicked()
{
QtConcurrent::run([=]()
@@ -220,7 +215,5 @@ void SettingsPage::on_pushButton_clearWebCache_clicked()
dataLocal = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
qDebug() << dataLocal;
QDir cacheDir(dataLocal);
cacheDir.removeRecursively();
});
cacheDir.removeRecursively(); });
}

View File

@@ -1,10 +1,7 @@
#include "httprequest.h"
HttpRequest::HttpRequest()
{
}
void HttpRequest::getRequest(QNetworkRequest request)

View File

@@ -2,10 +2,9 @@
Utils::Utils()
{
}
//这个函数是chatGPT写的
// Author: chatGPT
void Utils::sendNotification(QString icon, QString title, QString body)
{
QDBusInterface iface("org.freedesktop.Notifications",

View File

@@ -2,7 +2,6 @@
WidgetAnimation::WidgetAnimation()
{
}
void WidgetAnimation::widgetShake(QWidget *pWidget, int nRange)
@@ -16,7 +15,8 @@ void WidgetAnimation::widgetShake(QWidget *pWidget, int nRange)
int nShakeCount = 8;
double nStep = 1.0 / nShakeCount;
for(int i = 1; i < nShakeCount; i++){
for (int i = 1; i < nShakeCount; i++)
{
nRange = i & 1 ? -nRange : nRange;
pAnimation->setKeyValueAt(nStep * i, QRect(QPoint(nX + nRange, nY), pWidget->size()));
}
@@ -38,7 +38,9 @@ QPropertyAnimation* WidgetAnimation::createWidgetOpacity(QWidget *pWidget, bool
animation->setKeyValueAt(0, 0);
// m_animation->setKeyValueAt(0.5, 0);
animation->setKeyValueAt(1, 1);
}else{
}
else
{
animation->setKeyValueAt(0, 1);
animation->setKeyValueAt(1, 0);
}

View File

@@ -12,7 +12,8 @@ BaseWidgetOpacity::BaseWidgetOpacity(QWidget *parent) : DBlurEffectWidget(parent
/// @param event
void BaseWidgetOpacity::closeEvent(QCloseEvent *event)
{
if (!closeWindowAnimation) {
if (!closeWindowAnimation)
{
closeWindowAnimation = true;
QPropertyAnimation *animation = new QPropertyAnimation(this, "windowOpacity");
@@ -21,18 +22,20 @@ void BaseWidgetOpacity::closeEvent(QCloseEvent *event)
animation->setStartValue(1.0);
animation->setEndValue(0.0);
QObject::connect(animation, &QPropertyAnimation::valueChanged, this, [=](const QVariant &value){
QObject::connect(animation, &QPropertyAnimation::valueChanged, this, [=](const QVariant &value)
{
this->update();
// setWindowTitle(QString("ヾ(⌒∇⌒*)See You♪ - %1%").arg(int(value.toFloat() * 100)));
});
QObject::connect(animation, &QPropertyAnimation::finished, this, [=](){
this->close();
});
QObject::connect(animation, &QPropertyAnimation::finished, this, [=]()
{ this->close(); });
animation->start();
event->ignore();
} else {
}
else
{
event->accept();
}
}

View File

@@ -3,8 +3,7 @@
#include <QHBoxLayout>
#include <QtConcurrent>
big_image::big_image(DBlurEffectWidget *parent) :
DBlurEffectWidget(parent),
big_image::big_image(DBlurEffectWidget *parent) : DBlurEffectWidget(parent),
m_image(new QLabel)
{
// setWindowFlags(this->windowFlags() | Qt::WindowStaysOnTopHint); // 设置图片对话框总在最前

View File

@@ -6,8 +6,7 @@
bool DownloadItem::isInstall = false;
DownloadItem::DownloadItem(QWidget *parent) :
QWidget(parent),
DownloadItem::DownloadItem(QWidget *parent) : QWidget(parent),
reinstall(false),
close(false),
ui(new Ui::DownloadItem),
@@ -164,8 +163,7 @@ void DownloadItem::install(int t)
ui->widget_spinner->hide();
DownloadItem::isInstall = false;
emit finished();
});
emit finished(); });
// emit finished();
qDebug() << ui->label_filename->text().toUtf8();
}

View File

@@ -152,14 +152,11 @@ void ProgressButton::mousePressEvent(QMouseEvent *event)
void ProgressButton::operationProcessing()
{
}
const int RADIUS = 60;
WaterDrop::WaterDrop(QWidget *parent)
: QWidget(parent)
, m_waterDropAnimation(nullptr)
, m_animationRadius(0)
: QWidget(parent), m_waterDropAnimation(nullptr), m_animationRadius(0)
{
this->setFixedSize(QSize(RADIUS * 2, RADIUS * 2));
this->setWindowFlags(Qt::FramelessWindowHint | Qt::Tool);

View File

@@ -1,10 +1,26 @@
#include "webenginepage.h"
#include <QDesktopServices>
#include <QWebEngineSettings>
#include <QWebEngineProfile>
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;
}
}
WebEnginePage::~WebEnginePage()
@@ -13,7 +29,8 @@ WebEnginePage::~WebEnginePage()
void WebEnginePage::setUrl(const QUrl &url)
{
if (m_currentUrl == url) {
if (m_currentUrl == url)
{
return;
}
@@ -32,7 +49,8 @@ QWebEnginePage *WebEnginePage::createWindow(QWebEnginePage::WebWindowType type)
void WebEnginePage::slotUrlChanged(const QUrl &url)
{
if (m_currentUrl == url) {
if (m_currentUrl == url)
{
sender()->deleteLater();
return;
}

View File

@@ -3,11 +3,11 @@
#include <QGraphicsOpacityEffect>
#include <QPropertyAnimation>
#include <QDebug>
DownloadListWidget::DownloadListWidget(QWidget *parent) :
DBlurEffectWidget(parent),
DownloadListWidget::DownloadListWidget(QWidget *parent) : DBlurEffectWidget(parent),
ui(new Ui::DownloadListWidget)
{
ui->setupUi(this);
setWindowTitle("Download list");
installEventFilter(this);
this->setAttribute(Qt::WA_Hover, true);
setFocus();
@@ -47,13 +47,13 @@ DownloadListWidget::DownloadListWidget(QWidget *parent) :
downloaditemlist[nowDownload - 1]->setSpeed(theSpeed);
}else{
emit downloadProgress(0);
}
});
} });
}
DownloadListWidget::~DownloadListWidget()
{
if (downloadController) {
if (downloadController)
{
downloadController->stopDownload();
downloadController->deleteLater();
}
@@ -175,7 +175,6 @@ void DownloadListWidget::updateDataReadProgress(QString speedInfo, qint64 bytesR
}
}
void DownloadListWidget::m_move(int x, int y)
{
m_rect.setX(x);
@@ -185,11 +184,14 @@ void DownloadListWidget::m_move(int x,int y)
}
bool DownloadListWidget::eventFilter(QObject *watched, QEvent *event)
{
if (Q_NULLPTR == watched) {
if (Q_NULLPTR == watched)
{
return false;
}
if (QEvent::ActivationChange == event->type()) {
if(QApplication::activeWindow() != this){
if (QEvent::ActivationChange == event->type())
{
if (QApplication::activeWindow() != this)
{
this->close();
}
}

View File

@@ -12,6 +12,7 @@ else
zenity --error --text "检查更新进程出现错误!按确定查看报错,可用于反馈" --title "星火商店更新检测模块" --height 200 --width 350 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
zenity --text-info --filename=/tmp/spark-store-app-ssupdate-log.txt --checkbox="我已复制了此文本框中的日志,且将会在反馈时附上。反馈渠道可以在右上角菜单的设置中找到" --title="反馈渠道在商店右上角的设置里" --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh clean-log
rm -f /tmp/spark-store/upgradeStatus.txt
exit
fi
@@ -57,7 +58,7 @@ done`
if [ -z "$PKG_UPGRADE_LIST" ] ; then
zenity --info --text "没有软件需要更新\n但是你并没有站在世界之巅" --title "星火商店更新检测服务" --height 150 --width 300 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
else
PKG_UPGRADE_LIST=$(echo "$PKG_UPGRADE_LIST" | zenity --list --text="选择你想更新的应用" --column="是否更新" --column="包名" --column="新版本" --column="从该版本更新" --separator=" " --checklist --multiple --print-column=4 --height 350 --width 550 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg)
PKG_UPGRADE_LIST=$(echo "$PKG_UPGRADE_LIST" | zenity --list --text="选择你想更新的应用" --column="是否更新" --column="包名" --column="新版本" --column="从该版本更新" --separator=" " --checklist --multiple --print-column=2 --height 350 --width 550 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg)
## 如果没有选择,则直接退出
if [ -z "$PKG_UPGRADE_LIST" ] ; then
zenity --info --text "没有选中任何软件\n但是你并没有站在世界之巅" --title "星火商店更新检测服务" --height 150 --width 300 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
@@ -77,5 +78,5 @@ done`
fi
fi
rm -f touch /tmp/spark-store/upgradeStatus.txt
rm -f /tmp/spark-store/upgradeStatus.txt
# 从最开头