mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-17 01:21:36 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5b55646789 |
11
debian/changelog
vendored
11
debian/changelog
vendored
@@ -1,12 +1,5 @@
|
|||||||
spark-store (3.0.3-10) stable; urgency=medium
|
spark-store (3.0.3-11~bt) stable; urgency=medium
|
||||||
|
* BT test 01
|
||||||
* Now also compile dstore patch
|
|
||||||
|
|
||||||
-- shenmo <shenmo@spark-app.store> Mon, 17 Jan 2022 00:00:00 +0800
|
-- shenmo <shenmo@spark-app.store> Mon, 17 Jan 2022 00:00:00 +0800
|
||||||
|
|
||||||
|
|
||||||
spark-store (3.0.3-9) stable; urgency=medium
|
|
||||||
|
|
||||||
* Support dpkg-buildpackage
|
|
||||||
|
|
||||||
-- shenmo <shenmo@spark-app.store> Mon, 17 Jan 2022 00:00:00 +0800
|
|
||||||
|
|||||||
15
debian/control
vendored
15
debian/control
vendored
@@ -11,9 +11,9 @@ Build-Depends:
|
|||||||
libqt5widgets5,
|
libqt5widgets5,
|
||||||
libqt5network5,
|
libqt5network5,
|
||||||
libqt5concurrent5,
|
libqt5concurrent5,
|
||||||
libdtkcore-dev(>=5.4),
|
libdtkcore-dev,
|
||||||
libdtkgui-dev(>=5.4),
|
libdtkgui-dev,
|
||||||
libdtkwidget-dev(>=5.4),
|
libdtkwidget-dev,
|
||||||
qttools5-private-dev,
|
qttools5-private-dev,
|
||||||
libnotify-dev,
|
libnotify-dev,
|
||||||
qtwebengine5-dev
|
qtwebengine5-dev
|
||||||
@@ -29,9 +29,10 @@ Depends:${shlibs:Depends}, ${misc:Depends},
|
|||||||
libqt5widgets5,
|
libqt5widgets5,
|
||||||
libqt5network5,
|
libqt5network5,
|
||||||
libqt5concurrent5,
|
libqt5concurrent5,
|
||||||
libdtkcore5(>=5.4),
|
libdtkcore5,
|
||||||
libdtkgui5(>=5.4),
|
libdtkgui5,
|
||||||
libdtkwidget5(>=5.4),
|
libdtkwidget5,
|
||||||
libnotify4
|
libnotify4,
|
||||||
|
aria2
|
||||||
Description: Spark Store
|
Description: Spark Store
|
||||||
A community powered app store, based on DTK.
|
A community powered app store, based on DTK.
|
||||||
|
|||||||
35
src/main.cpp
35
src/main.cpp
@@ -1,8 +1,7 @@
|
|||||||
#include <DApplication>
|
#include <DApplication>
|
||||||
#include <DApplicationSettings>
|
#include <DApplicationSettings>
|
||||||
#include <DWidgetUtil> // Dtk::Widget::moveToCenter(&w); 要调用它,就得引用 DWidgetUtil
|
#include <DWidgetUtil> // Dtk::Widget::moveToCenter(&w); 要调用它,就得引用 DWidgetUtil
|
||||||
|
#include <DAboutDialog>
|
||||||
#include <QVector>
|
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
|
|
||||||
#include "widget.h"
|
#include "widget.h"
|
||||||
@@ -12,45 +11,17 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
DApplication::loadDXcbPlugin(); // 让 bar 处在标题栏中
|
DApplication::loadDXcbPlugin(); // 让 bar 处在标题栏中
|
||||||
DApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // 开启 Hidpi 支持
|
DApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // 开启 Hidpi 支持
|
||||||
// 程序内强制添加"-platformtheme deepin"参数喂给Qt让Qt正确使用Deepin主题修复各种奇怪样式问题
|
DApplication a(argc, argv);
|
||||||
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());
|
|
||||||
|
|
||||||
a.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
a.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||||
a.loadTranslator(); // 载入翻译
|
a.loadTranslator(); // 载入翻译
|
||||||
|
|
||||||
/* Customized DAboutDialog (Can't work on other distro like Ubuntu...)
|
|
||||||
*
|
|
||||||
* DAboutDialog dialog;
|
|
||||||
* a.setAboutDialog(&dialog);
|
|
||||||
* dialog.setLicense(QObject::tr("We publish this program under GPL V3"));
|
|
||||||
* dialog.setVersion(DApplication::buildVersion("Version 2.0.2.5"));
|
|
||||||
* dialog.setProductIcon(QIcon::fromTheme("spark-store")); // 设置Logo
|
|
||||||
* dialog.setProductName(QLabel::tr("Spark Store"));
|
|
||||||
* dialog.setDescription(
|
|
||||||
* QObject::tr(
|
|
||||||
* "<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>"
|
|
||||||
* )
|
|
||||||
* );
|
|
||||||
* dialog.setProductName(QLabel::tr("Spark Store"));
|
|
||||||
* dialog.setCompanyLogo(QPixmap(":/Logo-Spark.png"));
|
|
||||||
* dialog.setWebsiteName(QObject::tr("The Spark Project"));
|
|
||||||
* dialog.setWebsiteLink("https://gitee.com/deepin-community-store");
|
|
||||||
*/
|
|
||||||
|
|
||||||
a.setProductName(QLabel::tr("Spark Store"));
|
a.setProductName(QLabel::tr("Spark Store"));
|
||||||
a.setProductIcon(QIcon::fromTheme("spark-store")); //设置Logo
|
a.setProductIcon(QIcon::fromTheme("spark-store")); //设置Logo
|
||||||
a.setOrganizationName("spark-union");
|
a.setOrganizationName("spark-union");
|
||||||
a.setOrganizationDomain("https://www.deepinos.org/");
|
a.setOrganizationDomain("https://www.deepinos.org/");
|
||||||
a.setApplicationName("Spark Store"); //不需要翻译,否则 ~/.local/share/ 下文件夹名称也被翻译为中文
|
a.setApplicationName("Spark Store"); //不需要翻译,否则 ~/.local/share/ 下文件夹名称也被翻译为中文
|
||||||
a.setApplicationVersion(DApplication::buildVersion("3.0.3-10"));
|
a.setApplicationVersion(DApplication::buildVersion("3.0.3-11~bt"));
|
||||||
a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store");
|
a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store");
|
||||||
a.setApplicationDescription(
|
a.setApplicationDescription(
|
||||||
QObject::tr(
|
QObject::tr(
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QGraphicsOpacityEffect>
|
#include <QGraphicsOpacityEffect>
|
||||||
#include <QtConcurrent> // 并发
|
#include <QtConcurrent> // 并发
|
||||||
|
#include <QDebug>
|
||||||
#include <DApplication>
|
#include <DApplication>
|
||||||
#include <DGuiApplicationHelper>
|
#include <DGuiApplicationHelper>
|
||||||
#include <DDialog>
|
#include <DDialog>
|
||||||
@@ -606,19 +606,39 @@ void Widget::updatefoot()
|
|||||||
|
|
||||||
void Widget::on_pushButton_download_clicked()
|
void Widget::on_pushButton_download_clicked()
|
||||||
{
|
{
|
||||||
chooseLeftMenu(13);
|
// chooseLeftMenu(13);
|
||||||
|
|
||||||
allDownload += 1;
|
// allDownload += 1;
|
||||||
|
|
||||||
QFileInfo info(url.path());
|
QFileInfo info(url.path());
|
||||||
QString fileName(info.fileName()); // 获取文件名
|
QString fileName(info.fileName()); // 获取文件名
|
||||||
download_list[allDownload - 1].pkgName = pkgName;
|
// download_list[allDownload - 1].pkgName = pkgName;
|
||||||
if(fileName.isEmpty())
|
QString downloadurl(url.path());
|
||||||
{
|
downloadurl.remove(0,2);
|
||||||
sendNotification(tr("Failed to get the name to the file to be downloaded."));
|
//日了,获取serverurl那么远。。。直接写死了,反正在测试
|
||||||
return;
|
downloadurl.prepend("https://d.store.deepinos.org.cn");
|
||||||
}
|
qInfo()<<"下载链接拼接之后是"<<downloadurl<<",注意这里的serverUrl是写死的!!正式上线不要用"<<endl;
|
||||||
|
QString btUrl = downloadurl + ".torrent";
|
||||||
|
qInfo()<<"合成的bt链接是"<<btUrl<<endl;
|
||||||
|
qInfo()<<"虽然很奇怪这个链接为什么要这样处理但是确实能获取到的filename是"<<fileName<<endl;
|
||||||
|
|
||||||
|
QtConcurrent::run([=]()
|
||||||
|
{
|
||||||
|
ui->pushButton_download->setEnabled(false);
|
||||||
|
|
||||||
|
QProcess btinst;
|
||||||
|
btinst.start("x-terminal-emulator", QStringList() << "-e" << "/opt/durapps/spark-store/bin/btinst" << btUrl << fileName);
|
||||||
|
btinst.waitForFinished();
|
||||||
|
ui->pushButton_download->setEnabled(true);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
download_list[allDownload - 1].setParent(ui->listWidget);
|
download_list[allDownload - 1].setParent(ui->listWidget);
|
||||||
QListWidgetItem *item = new QListWidgetItem(ui->listWidget);
|
QListWidgetItem *item = new QListWidgetItem(ui->listWidget);
|
||||||
item->setSizeHint(download_list[allDownload - 1].size());
|
item->setSizeHint(download_list[allDownload - 1].size());
|
||||||
@@ -632,29 +652,24 @@ void Widget::on_pushButton_download_clicked()
|
|||||||
icon.load("/tmp/spark-store/icon.png", "PNG");
|
icon.load("/tmp/spark-store/icon.png", "PNG");
|
||||||
system("cp /tmp/spark-store/icon.png /tmp/spark-store/icon_" + QString::number(allDownload - 1).toUtf8() + ".png");
|
system("cp /tmp/spark-store/icon.png /tmp/spark-store/icon_" + QString::number(allDownload - 1).toUtf8() + ".png");
|
||||||
download_list[allDownload - 1].seticon(icon);
|
download_list[allDownload - 1].seticon(icon);
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
if(!isBusy)
|
if(!isBusy)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
file = new QFile(fileName);
|
|
||||||
if(!file->open(QIODevice::WriteOnly))
|
|
||||||
{
|
|
||||||
delete file;
|
|
||||||
file = nullptr;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
nowDownload += 1;
|
nowDownload += 1;
|
||||||
startRequest(urList.at(nowDownload - 1), fileName); // 进行链接请求
|
startRequest(urList.at(nowDownload - 1), fileName); // 进行链接请求
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if(ui->pushButton_download->text() == tr("Reinstall"))
|
if(ui->pushButton_download->text() == tr("Reinstall"))
|
||||||
{
|
{
|
||||||
download_list[allDownload - 1].reinstall = true;
|
download_list[allDownload - 1].reinstall = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Widget::startRequest(QUrl url, QString fileName)
|
void Widget::startRequest(QUrl url, QString fileName)
|
||||||
{
|
{
|
||||||
ui->listWidget->show();
|
ui->listWidget->show();
|
||||||
@@ -869,6 +884,8 @@ void Widget::sltAppinfoTags(QStringList *tagList)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 在这里添加选择新的json项目,比如bt专用链接
|
||||||
void Widget::sltAppinfoDetails(QString *name, QString *details, QString *info,
|
void Widget::sltAppinfoDetails(QString *name, QString *details, QString *info,
|
||||||
QString *website, QString *packageName, QUrl *fileUrl,
|
QString *website, QString *packageName, QUrl *fileUrl,
|
||||||
bool isInstalled, bool isUpdated)
|
bool isInstalled, bool isUpdated)
|
||||||
|
|||||||
21
tool/btinst
Executable file
21
tool/btinst
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# 第一个参数固定是bittorrent下载链接或者magnet
|
||||||
|
# 第二个参数就是文件名
|
||||||
|
export DISPLAY=:0
|
||||||
|
export XAUTHORITY=/home/shenmo/.Xauthority
|
||||||
|
|
||||||
|
if [ -x /tmp/spark-store/$2 ];then
|
||||||
|
rm /tmp/spark-store/$2
|
||||||
|
echo "检测到之前下载了软件包,未避免不能覆盖,先删除"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p /tmp/spark-store
|
||||||
|
cd /tmp/spark-store
|
||||||
|
echo "开始下载软件包"
|
||||||
|
|
||||||
|
aria2c "$1"
|
||||||
|
echo "安装"
|
||||||
|
pkexec ssinstall "/tmp/spark-store/$2"
|
||||||
|
echo 安装结束,按回车关闭窗口
|
||||||
|
read
|
||||||
|
exit 0
|
||||||
@@ -193,7 +193,7 @@
|
|||||||
<location filename="../src/widget.cpp" line="902"/>
|
<location filename="../src/widget.cpp" line="902"/>
|
||||||
<location filename="../src/widget.cpp" line="1171"/>
|
<location filename="../src/widget.cpp" line="1171"/>
|
||||||
<source>Install</source>
|
<source>Install</source>
|
||||||
<translation>安装</translation>
|
<translation>很厉害但没种子就会失败的bt下载</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/widget.ui" line="313"/>
|
<location filename="../src/widget.ui" line="313"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user