From a252e7b724034ff7887aeaab9e373b73f892fb45 Mon Sep 17 00:00:00 2001 From: shenmo Date: Thu, 1 Sep 2022 00:29:37 +0800 Subject: [PATCH 1/4] =?UTF-8?q?3.2.1=20=E6=9B=B4=E6=96=B0=E6=BA=90?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E6=94=B9=E4=B8=BAaptss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 7 ++++ src/main.cpp | 4 +-- src/widget.cpp | 55 +++++-------------------------- translations/spark-store_en.ts | 20 +++++------ translations/spark-store_fr.ts | 20 +++++------ translations/spark-store_zh_CN.ts | 20 ++++++----- 6 files changed, 49 insertions(+), 77 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7a6f97c..8938191 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +spark-store (3.2.1) stable; urgency=medium + + * 更改刷新系统源的功能 + + +-- shenmo Fri, 30 Jan 2022 00:00:00 +0800 + spark-store (3.2) stable; urgency=medium * 新增 下载量统计功能 diff --git a/src/main.cpp b/src/main.cpp index 35d72e6..7b29aeb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -30,7 +30,7 @@ int main(int argc, char *argv[]) DAboutDialog dialog; a.setAboutDialog(&dialog); dialog.setLicense(QObject::tr("We publish this program under GPL V3")); - dialog.setVersion(DApplication::buildVersion("Version 3.2")); + dialog.setVersion(DApplication::buildVersion("Version 3.2.1")); dialog.setProductIcon(QIcon::fromTheme("spark-store")); // 设置Logo dialog.setProductName(QLabel::tr("Spark Store")); dialog.setDescription( @@ -51,7 +51,7 @@ int main(int argc, char *argv[]) a.setOrganizationName("spark-union"); a.setOrganizationDomain("https://www.deepinos.org/"); a.setApplicationName("Spark Store"); //不需要翻译,否则 ~/.local/share/ 下文件夹名称也被翻译为中文 - a.setApplicationVersion(DApplication::buildVersion("3.2")); + a.setApplicationVersion(DApplication::buildVersion("3.2.1")); a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store"); a.setApplicationDescription( QObject::tr( diff --git a/src/widget.cpp b/src/widget.cpp index 877f713..3a40641 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -1090,46 +1090,8 @@ void Widget::on_pushButton_updateApt_clicked() ui->pushButton_updateApt->setEnabled(false); ui->label_aptserver->setText(tr("Updating, please wait...")); - std::fstream sourcesList, policy, update; - QDir tmpdir("/tmp"); - auto tmpPath = QString::fromUtf8(TMP_PATH).toStdString(); - bool unknownError = true; - - tmpdir.mkpath("spark-store"); - sourcesList.open(tmpPath + "/sparkstore.list", std::ios::out); - // 商店已经下架会替换系统库的包,优先级 policy 弃用 - // policy.open(tmpPath + "/sparkstore", std::ios::out); - - if(sourcesList /*&& policy*/) - { - auto serverAddr = ui->comboBox_server->currentText(); - - sourcesList << "deb [by-hash=force] "; - sourcesList << serverAddr.toUtf8().toStdString(); - sourcesList << " /"; - sourcesList.close(); - - /* - * policy << "Package: *\n" << "Pin: origin *" << - * serverAddr.mid(serverAddr.indexOf('.')).toUtf8().toStdString() << "\n" << - * "Pin-Priority: 90"; // 降低星火源的优先级,防止从星火安装已存在的系统包,破坏依赖 - * policy.close(); - */ - - update.open(tmpPath + "/update.sh", std::ios::out); - if(update) - { - unknownError = false; - update << "#!/bin/sh\n" << - "mv " + tmpPath + "/sparkstore.list /etc/apt/sources.list.d/sparkstore.list && " << - // "mv " + tmpPath + "/sparkstore /etc/apt/preferences.d/sparkstore && " << - "apt update"; - update.close(); - - system(("chmod +x " + tmpPath + "/update.sh").c_str()); - QProcess runupdate; - runupdate.start("pkexec", QStringList() << QString::fromStdString(tmpPath + "/update.sh")); + runupdate.start("pkexec" , QStringList() << "aptss" << "ssupdate"); runupdate.waitForFinished(); QString error = runupdate.readAllStandardError(); @@ -1145,22 +1107,21 @@ void Widget::on_pushButton_updateApt_clicked() if(!haveError) { - ui->label_aptserver->setText("deb [by-hash=force] " + ui->comboBox_server->currentText().toUtf8() + " /"); + ui->label_aptserver->setText(tr("Update finished")); } else { ui->label_aptserver->setText(tr("Apt has reported an error. Please use apt update in terminal to locate the problem.")); } - } - } - if(unknownError) - { - ui->label_aptserver->setText(tr("Unknown error!")); - } + + + + ui->pushButton_updateApt->setEnabled(true); - }); + }); + } void Widget::on_pushButton_uninstall_clicked() diff --git a/translations/spark-store_en.ts b/translations/spark-store_en.ts index 04f1a75..bde37e6 100644 --- a/translations/spark-store_en.ts +++ b/translations/spark-store_en.ts @@ -150,7 +150,7 @@ - + Install @@ -493,17 +493,12 @@ - + Apt has reported an error. Please use apt update in terminal to locate the problem. - - Unknown error! - - - - + Uninstall succeeded @@ -518,12 +513,17 @@ - + + Update finished + + + + Temporary cache was cleaned - + The URL has been copied to the clipboard diff --git a/translations/spark-store_fr.ts b/translations/spark-store_fr.ts index 072f3ac..3f3caa7 100644 --- a/translations/spark-store_fr.ts +++ b/translations/spark-store_fr.ts @@ -211,7 +211,7 @@ Nous sommes nés pour le changement. - + Install @@ -650,6 +650,11 @@ Nous sommes nés pour le changement. Reinstall + + + Update finished + + Failed to get the name to the file to be downloaded. @@ -676,27 +681,22 @@ Nous sommes nés pour le changement. - + Apt has reported an error. Please use apt update in terminal to locate the problem. - - Unknown error! - - - - + Uninstall succeeded - + Temporary cache was cleaned - + The URL has been copied to the clipboard diff --git a/translations/spark-store_zh_CN.ts b/translations/spark-store_zh_CN.ts index a3975b1..1b619df 100644 --- a/translations/spark-store_zh_CN.ts +++ b/translations/spark-store_zh_CN.ts @@ -205,7 +205,7 @@ - + Install 安装 @@ -476,7 +476,7 @@ Request Update - 软件催更/应用反馈 + 软件催更/应用反馈 @@ -518,6 +518,11 @@ Not Exist 不存在 + + + Update finished + 更新完毕 + @@ -599,14 +604,13 @@ 正在更新,请稍候…… - + Apt has reported an error. Please use apt update in terminal to locate the problem. 更新中发生错误,请在终端使用apt update来查看错误原因。 - Unknown error! - 未知错误! + 未知错误! Yes @@ -656,17 +660,17 @@ Click yes to continue. 服务器未知错误 - + Uninstall succeeded 卸载成功 - + Temporary cache was cleaned 缓存目录已清空 - + The URL has been copied to the clipboard 链接已复制到剪贴板 From 971a5dcc63374bab1d42175f5b45751286b2174a Mon Sep 17 00:00:00 2001 From: shenmo Date: Thu, 1 Sep 2022 00:40:16 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=09=E5=AE=89=E8=A3=85=E6=97=B6=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=B7=B2=E6=9C=89=E7=9A=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/spark-store.postinst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debian/spark-store.postinst b/debian/spark-store.postinst index 199f892..e437c97 100755 --- a/debian/spark-store.postinst +++ b/debian/spark-store.postinst @@ -6,6 +6,11 @@ case "$1" in # config for aptss mkdir -p /etc/aptss/sources.list.d ln -s -f /etc/apt/sources.list /etc/aptss/sources.list + + # Remove the sources.list file + if [ -e /etc/apt/sources.list.d/sparkstore.list ];then + rm /etc/apt/sources.list.d/sparkstore.list + fi # Check if /usr/local/bin existed From af89e644784eb0f77066b066a6757756f8afd993 Mon Sep 17 00:00:00 2001 From: Pluto Date: Wed, 31 Aug 2022 17:50:24 +0000 Subject: [PATCH 3/4] =?UTF-8?q?!110=20=E6=A3=80=E6=B5=8B=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=20*=20=E6=96=87=E6=A1=88=E4=BF=AE=E6=94=B9=20*=20update=20src/?= =?UTF-8?q?widget.ui.=20*=20feat:=20=E6=98=9F=E7=81=AB=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=95=86=E5=BA=97=E6=A3=80=E6=B5=8B=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget.cpp | 31 +++---------------------------- src/widget.ui | 4 ++-- translations/spark-store_en.ts | 30 ++++++++++-------------------- translations/spark-store_fr.ts | 28 +++++++++------------------- translations/spark-store_zh_CN.ts | 30 ++++++++++++++++-------------- 5 files changed, 40 insertions(+), 83 deletions(-) diff --git a/src/widget.cpp b/src/widget.cpp index 3a40641..594315b 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -1090,34 +1090,9 @@ void Widget::on_pushButton_updateApt_clicked() ui->pushButton_updateApt->setEnabled(false); ui->label_aptserver->setText(tr("Updating, please wait...")); - QProcess runupdate; - runupdate.start("pkexec" , QStringList() << "aptss" << "ssupdate"); - runupdate.waitForFinished(); - QString error = runupdate.readAllStandardError(); - - QStringList everyError = error.split("\n"); - bool haveError = false; - for(int i = 0; i < everyError.size(); i++) - { - if(everyError[i].left(2) == "E:") - { - haveError = true; - } - } - - if(!haveError) - { - ui->label_aptserver->setText(tr("Update finished")); - } - else - { - ui->label_aptserver->setText(tr("Apt has reported an error. Please use apt update in terminal to locate the problem.")); - } - - - - - + QString storeSpk = "spk://store/tools/spark-store"; + openUrl(storeSpk); + ui->label_aptserver->setText(tr("")); ui->pushButton_updateApt->setEnabled(true); }); diff --git a/src/widget.ui b/src/widget.ui index a31e9c5..2b25684 100644 --- a/src/widget.ui +++ b/src/widget.ui @@ -1220,7 +1220,7 @@ color:#808080 - <html><head/><body><p>The role of the source server is to ensure that the software is updated, and supports the use of the apt tool to get the software. We usually prefer that you use the first line as the update source, which is generally the most stable. </p></body></html> + <html><head/><body><p>Check update for Spark Store. </p></body></html> true @@ -1237,7 +1237,7 @@ - Source Server + Spark Store Update diff --git a/translations/spark-store_en.ts b/translations/spark-store_en.ts index bde37e6..823177f 100644 --- a/translations/spark-store_en.ts +++ b/translations/spark-store_en.ts @@ -150,7 +150,7 @@ - + Install @@ -347,11 +347,6 @@ Refresh - - - <html><head/><body><p>The role of the source server is to ensure that the software is updated, and supports the use of the apt tool to get the software. We usually prefer that you use the first line as the update source, which is generally the most stable. </p></body></html> - - Update @@ -359,7 +354,7 @@ - Source Server + Spark Store Update @@ -427,6 +422,11 @@ Take effect when restart + + + <html><head/><body><p>Check update for Spark Store. </p></body></html> + + 0B @@ -493,12 +493,7 @@ - - Apt has reported an error. Please use apt update in terminal to locate the problem. - - - - + Uninstall succeeded @@ -513,17 +508,12 @@ - - Update finished - - - - + Temporary cache was cleaned - + The URL has been copied to the clipboard diff --git a/translations/spark-store_fr.ts b/translations/spark-store_fr.ts index 3f3caa7..2529c5f 100644 --- a/translations/spark-store_fr.ts +++ b/translations/spark-store_fr.ts @@ -211,7 +211,7 @@ Nous sommes nés pour le changement. - + Install @@ -370,7 +370,7 @@ Nous sommes nés pour le changement. - <html><head/><body><p>The role of the source server is to ensure that the software is updated, and supports the use of the apt tool to get the software. We usually prefer that you use the first line as the update source, which is generally the most stable. </p></body></html> + <html><head/><body><p>Check update for Spark Store. </p></body></html> @@ -380,7 +380,7 @@ Nous sommes nés pour le changement. - Source Server + Spark Store Update @@ -557,15 +557,15 @@ Nous sommes nés pour le changement. Redémarrez pour prendre effet - <html><head/><body><p>源服务器的作用是保证软件更新,并且支持使用apt工具获取软件。通常我们更建议你使用第一个线路作为更新源,一般是最稳定的。</p></body></html> + <html><head/><body><p>跳转到星火应用商店主页检测更新。</p></body></html> <html><head/><body><p>Le rôle du serveur source est de s'assurer que le logiciel est mis à jour et prend en charge l'utilisation de l'outil apt pour obtenir le logiciel. Nous préférons généralement que vous utilisiez la première ligne comme source de mise à jour, qui est généralement la plus stable. </p></body></html> - 更新源 + 跳转更新 Mettre à jour la source APT - 更新源服务器: + 星火应用商店更新检测: Source APT: @@ -650,11 +650,6 @@ Nous sommes nés pour le changement. Reinstall - - - Update finished - - Failed to get the name to the file to be downloaded. @@ -681,22 +676,17 @@ Nous sommes nés pour le changement. - - Apt has reported an error. Please use apt update in terminal to locate the problem. - - - - + Uninstall succeeded - + Temporary cache was cleaned - + The URL has been copied to the clipboard diff --git a/translations/spark-store_zh_CN.ts b/translations/spark-store_zh_CN.ts index 1b619df..5545f8c 100644 --- a/translations/spark-store_zh_CN.ts +++ b/translations/spark-store_zh_CN.ts @@ -205,7 +205,7 @@ - + Install 安装 @@ -379,19 +379,18 @@ 重启商店后生效 - - <html><head/><body><p>The role of the source server is to ensure that the software is updated, and supports the use of the apt tool to get the software. We usually prefer that you use the first line as the update source, which is generally the most stable. </p></body></html> - <html><head/><body><p>源服务器的作用是保证软件更新,并且支持使用apt工具获取软件。通常我们更建议你使用第一个线路作为更新源,一般是最稳定的。</p></body></html> + <html><head/><body><p>Jump to the Spark app store home page to check for updates. </p></body></html> + <html><head/><body><p>跳转到星火应用商店主页检测更新。</p></body></html> Update - 更新源 + 跳转更新 - Source Server - 更新源服务器 + Spark Store Update + 星火应用商店更新检测 @@ -483,6 +482,11 @@ Take effect when restart 重启商店后生效 + + + <html><head/><body><p>Check update for Spark Store. </p></body></html> + 检查星火应用商店更新 + 0B @@ -519,9 +523,8 @@ 不存在 - Update finished - 更新完毕 + 更新完毕 @@ -604,9 +607,8 @@ 正在更新,请稍候…… - Apt has reported an error. Please use apt update in terminal to locate the problem. - 更新中发生错误,请在终端使用apt update来查看错误原因。 + 更新中发生错误,请在终端使用apt update来查看错误原因。 Unknown error! @@ -660,17 +662,17 @@ Click yes to continue. 服务器未知错误 - + Uninstall succeeded 卸载成功 - + Temporary cache was cleaned 缓存目录已清空 - + The URL has been copied to the clipboard 链接已复制到剪贴板 From 9e4df5c5c27c9c0f6399462659dab2651082cfb4 Mon Sep 17 00:00:00 2001 From: Pluto Date: Sat, 3 Sep 2022 09:25:19 +0000 Subject: [PATCH 4/4] =?UTF-8?q?!111=20feat=EF=BC=9A=20=E6=B8=85=E9=99=A4Qt?= =?UTF-8?q?WebCore=E7=9A=84=E7=BC=93=E5=AD=98=20*=20Merge=20remote-trackin?= =?UTF-8?q?g=20branch=20'upstream/dev'=20into=20dev=20*=20Merge=20branch?= =?UTF-8?q?=20'dev'=20of=20gitee.com:uniartisan2018/spark-store=20into=20d?= =?UTF-8?q?ev=20*=20feat:=20=E6=B8=85=E9=99=A4=E7=BD=91=E9=A1=B5=E7=BC=93?= =?UTF-8?q?=E5=AD=98=20*=20=E6=96=87=E6=A1=88=E4=BF=AE=E6=94=B9=20*=20upda?= =?UTF-8?q?te=20src/widget.ui.=20*=20feat:=20=E6=98=9F=E7=81=AB=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=95=86=E5=BA=97=E6=A3=80=E6=B5=8B=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget.cpp | 10 +++++++++ src/widget.h | 1 + src/widget.ui | 61 ++++++++++++++++++++++++++++---------------------- 3 files changed, 45 insertions(+), 27 deletions(-) diff --git a/src/widget.cpp b/src/widget.cpp index 594315b..f0bb212 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -1148,6 +1148,16 @@ void Widget::on_pushButton_clear_clicked() // 清空临时缓存目录 }); } +void Widget::on_pushButton_clearWebCache_clicked() +{ + QtConcurrent::run([=]() + { + + QString dataLocal = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation); + QDir cacheDir(dataLocal ); + cacheDir.removeRecursively(); }); +} + quint64 Widget::dirFileSize(const QString &path) { QDir dir(path); diff --git a/src/widget.h b/src/widget.h index 254b26c..f9faad9 100644 --- a/src/widget.h +++ b/src/widget.h @@ -91,6 +91,7 @@ private slots: void on_pushButton_updateApt_clicked(); void on_pushButton_uninstall_clicked(); void on_pushButton_clear_clicked(); + void on_pushButton_clearWebCache_clicked(); void on_pushButton_website_clicked(); void on_pushButton_clicked(); void on_btn_openDir_clicked(); diff --git a/src/widget.ui b/src/widget.ui index 2b25684..e35fede 100644 --- a/src/widget.ui +++ b/src/widget.ui @@ -345,7 +345,7 @@ 0 - 2 + 3 @@ -489,7 +489,7 @@ 0 0 - 903 + 889 849 @@ -993,8 +993,8 @@ 0 0 - 869 - 325 + 851 + 324 @@ -1123,8 +1123,8 @@ 0 0 - 738 - 886 + 889 + 716 @@ -1285,7 +1285,31 @@ - + + + + color:#808080 + + + Since the dictionary is at /tmp,It would be cleaned automatically when system reboot. + + + + + + + 0B + + + + + + + Location:/tmp/spark-store + + + + Qt::Horizontal @@ -1305,16 +1329,6 @@ - - - - color:#808080 - - - Since the dictionary is at /tmp,It would be cleaned automatically when system reboot. - - - @@ -1328,17 +1342,10 @@ - - + + - 0B - - - - - - - Location:/tmp/spark-store + Clear Web Cache