feat: 星火应用商店检测更新

This commit is contained in:
lizhiyuan 2022-09-01 01:39:09 +08:00
parent 971a5dcc63
commit 2df5363c2c
5 changed files with 17 additions and 42 deletions

View File

@ -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);
});

View File

@ -1220,7 +1220,7 @@
<string notr="true">color:#808080</string>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;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. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Jump to the Spark app store home page to check for updates. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@ -1237,7 +1237,7 @@
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Source Server</string>
<string>Spark Store Update</string>
</property>
</widget>
</item>

View File

@ -349,7 +349,7 @@
</message>
<message>
<location filename="../src/widget.ui" line="1223"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;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. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Jump to the Spark app store home page to check for updates. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
@ -359,7 +359,7 @@
</message>
<message>
<location filename="../src/widget.ui" line="1240"/>
<source>Source Server</source>
<source>Spark Store Update</source>
<translation type="unfinished"></translation>
</message>
<message>

View File

@ -370,7 +370,7 @@ Nous sommes nés pour le changement.</translation>
</message>
<message>
<location filename="../src/widget.ui" line="1223"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;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. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Jump to the Spark app store home page to check for updates. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
@ -380,7 +380,7 @@ Nous sommes nés pour le changement.</translation>
</message>
<message>
<location filename="../src/widget.ui" line="1240"/>
<source>Source Server</source>
<source>Spark Store Update</source>
<translation type="unfinished"></translation>
</message>
<message>
@ -557,15 +557,15 @@ Nous sommes nés pour le changement.</translation>
<translation type="vanished">Redémarrez pour prendre effet</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;使apt工具获取软件使线&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="vanished">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Le rôle du serveur source est de s&apos;assurer que le logiciel est mis à jour et prend en charge l&apos;utilisation de l&apos;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. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<source></source>
<source></source>
<translation type="vanished">Mettre à jour la source APT</translation>
</message>
<message>
<source></source>
<source></source>
<translation type="vanished">Source APT: </translation>
</message>
<message>

View File

@ -380,18 +380,18 @@
</message>
<message>
<location filename="../src/widget.ui" line="1223"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;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. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;使apt工具获取软件使线&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Jump to the Spark app store home page to check for updates. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<location filename="../src/widget.ui" line="1233"/>
<source>Update</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widget.ui" line="1240"/>
<source>Source Server</source>
<translation></translation>
<source>Spark Store Update</source>
<translation></translation>
</message>
<message>
<location filename="../src/widget.ui" line="1260"/>