From ae1c50893d16f034f3aeb71d8f4e432b36f6808d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=9A=E5=AD=90?= Date: Sun, 11 Dec 2022 01:06:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E4=B8=AD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=8A=95=E7=A8=BF=E5=99=A8=EF=BC=8C=E6=9B=B4=E6=96=B0=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mainwindow-dtk.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/mainwindow-dtk.cpp b/src/mainwindow-dtk.cpp index f760f83..e00c249 100644 --- a/src/mainwindow-dtk.cpp +++ b/src/mainwindow-dtk.cpp @@ -31,16 +31,41 @@ MainWindow::MainWindow(QWidget *parent) updateUi(0); + 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")); QMenu *menu = new QMenu; menu->addAction(setting); + menu->addAction(upgrade); + menu->addAction(actionSubmission); + menu->addAction(actionSubmissionWithClient); ui->titlebar->setMenu(menu); + 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");}); + // 投稿器 + 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); + } + + }); + + //主题切换 connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [=](DGuiApplicationHelper::ColorType themeType) { if (themeType == DGuiApplicationHelper::DarkType) {