From 5e501b9d178c3126b90d73b53890008498bfa46b Mon Sep 17 00:00:00 2001 From: uniartisann Date: Sat, 8 Oct 2022 23:27:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E6=8A=95=E7=A8=BF=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/widget.cpp b/src/widget.cpp index 8e7d2eb..c54c3db 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -193,6 +193,7 @@ void Widget::initUI() // 添加菜单项 QAction *actionSubmission = new QAction(tr("Submit App"), this); + QAction *actionSubmissionWithClient = new QAction(tr("Submit App with client(Recommanded)"), this); QAction *setting = new QAction(tr("Settings")); QAction *upgrade = new QAction(tr("APP Upgrade and Install Settings")); @@ -200,6 +201,7 @@ void Widget::initUI() menu->addAction(setting); menu->addAction(upgrade); menu->addAction(actionSubmission); + menu->addAction(actionSubmissionWithClient); titlebar->setMenu(menu); @@ -207,6 +209,23 @@ void Widget::initUI() connect(setting, &QAction::triggered, this, &Widget::opensetting); connect(upgrade, &QAction::triggered, this, [=]{QProcess::startDetached("x-terminal-emulator -e /opt/durapps/spark-store/bin/update-upgrade/ss-update-controler.sh");}); + // 投稿器 + connect(actionSubmissionWithClient, &QAction::triggered, this, [=] + { + QString submitterSpk = "spk://store/tools/spark-store-submitter"; + QFile actionSubmissionClientStatus("/opt/spark-store-submitter/bin/spark-store-submitter"); + if (actionSubmissionClientStatus.exists()) + { + qDebug() << "投稿器存在"; + QProcess::startDetached("/opt/spark-store-submitter/bin/spark-store-submitter"); + } + else{ + qDebug() << "投稿器不存在,跳转页面"; + openUrl(submitterSpk); + } + + }); + // 载入自定义字体 int loadedFontID = QFontDatabase::addApplicationFont(":/fonts/fonts/hksnzt.ttf"); QStringList loadedFontFamilies = QFontDatabase::applicationFontFamilies(loadedFontID); From 967f62f82510dcd97b220826c9aefbe38be85f4f Mon Sep 17 00:00:00 2001 From: uniartisann Date: Sun, 9 Oct 2022 18:36:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E8=B6=85=E6=97=B6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/downloadlist.cpp | 4 ++-- src/widget.cpp | 4 ++-- src/workerthreads.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/downloadlist.cpp b/src/downloadlist.cpp index 799a9ce..8e6c7dc 100644 --- a/src/downloadlist.cpp +++ b/src/downloadlist.cpp @@ -151,7 +151,7 @@ void downloadlist::install(int t) bool haveError = false; bool notRoot = false; - installer.waitForFinished(); + installer.waitForFinished(-1); // 不设置超时 out = installer.readAllStandardOutput(); QStringList everyOut = out.split("\n"); @@ -169,7 +169,7 @@ void downloadlist::install(int t) QProcess isInstall; isInstall.start("dpkg -s " + pkgName); - isInstall.waitForFinished(); + isInstall.waitForFinished(180); // 默认超时 3 分钟 int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length(); if(error == 0) { diff --git a/src/widget.cpp b/src/widget.cpp index c54c3db..910615d 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -1128,11 +1128,11 @@ void Widget::on_pushButton_uninstall_clicked() QProcess uninstall; uninstall.start("pkexec", QStringList() << "apt" << "purge" << "-y" << pkgName.toLower()); - uninstall.waitForFinished(); + uninstall.waitForFinished(180); // 默认超时 3 分钟 QProcess check; check.start("dpkg", QStringList() << "-s" << pkgName.toLower()); - check.waitForFinished(); + check.waitForFinished(180); // 默认超时 3 分钟 if (check.readAllStandardOutput().isEmpty()) { diff --git a/src/workerthreads.cpp b/src/workerthreads.cpp index 86ac7cb..99d40c7 100644 --- a/src/workerthreads.cpp +++ b/src/workerthreads.cpp @@ -92,7 +92,7 @@ void SpkAppInfoLoaderThread::run() QProcess isInstall; packagename = json["Pkgname"].toString(); isInstall.start("dpkg -s " + json["Pkgname"].toString()); - isInstall.waitForFinished(); + isInstall.waitForFinished(180); // 默认超时 3 分钟 int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length(); if(error == 0) { @@ -100,12 +100,12 @@ void SpkAppInfoLoaderThread::run() QProcess isUpdate; isUpdate.start("dpkg-query --showformat='${Version}' --show " + json["Pkgname"].toString()); - isUpdate.waitForFinished(); + isUpdate.waitForFinished(180); // 默认超时 3 分钟 QString localVersion = isUpdate.readAllStandardOutput(); localVersion.replace("'", ""); isUpdate.start("dpkg --compare-versions " + localVersion + " ge " + json["Version"].toString()); - isUpdate.waitForFinished(); + isUpdate.waitForFinished(180); // 默认超时 3 分钟 if(!isUpdate.exitCode()) { isUpdated = true; From 8c08b7e995935a999ca463bf026568bde3c6e0a8 Mon Sep 17 00:00:00 2001 From: shenmo Date: Sun, 9 Oct 2022 10:41:48 +0000 Subject: [PATCH 3/3] update src/widget.cpp. Signed-off-by: shenmo --- src/widget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widget.cpp b/src/widget.cpp index 910615d..ed8846e 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -1128,7 +1128,7 @@ void Widget::on_pushButton_uninstall_clicked() QProcess uninstall; uninstall.start("pkexec", QStringList() << "apt" << "purge" << "-y" << pkgName.toLower()); - uninstall.waitForFinished(180); // 默认超时 3 分钟 + uninstall.waitForFinished(-1); // 默认无限时长 QProcess check; check.start("dpkg", QStringList() << "-s" << pkgName.toLower());