mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-07-12 16:42:21 +08:00
左侧边栏加入更新按钮
This commit is contained in:
parent
f948c8905a
commit
6ff58adffa
src
@ -58,5 +58,7 @@
|
||||
<file>icon/dark/leftbutton_11.svg</file>
|
||||
<file>icon/dark/leftbutton_12.svg</file>
|
||||
<file>icon/dark/text.svg</file>
|
||||
<file>icon/light/update.svg</file>
|
||||
<file>icon/dark/update.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
1
src/assets/icon/dark/update.svg
Normal file
1
src/assets/icon/dark/update.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z" fill="none" stroke="#f0f0f0" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><path d="M33.5424 27C32.2681 31.0571 28.4778 34 24.0002 34C19.5226 34 15.7323 31.0571 14.458 27V33" stroke="#f0f0f0" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><path d="M33.5424 15V21C32.2681 16.9429 28.4778 14 24.0002 14C19.5226 14 15.7323 16.9429 14.458 21" stroke="#f0f0f0" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
After (image error) Size: 721 B |
1
src/assets/icon/light/update.svg
Normal file
1
src/assets/icon/light/update.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z" fill="none" stroke="#212121" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><path d="M33.5424 27C32.2681 31.0571 28.4778 34 24.0002 34C19.5226 34 15.7323 31.0571 14.458 27V33" stroke="#212121" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><path d="M33.5424 15V21C32.2681 16.9429 28.4778 14 24.0002 14C19.5226 14 15.7323 16.9429 14.458 21" stroke="#212121" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
After (image error) Size: 721 B |
@ -76,6 +76,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
");
|
||||
backButtom->setIcon(QIcon(":/icon/dark/back.svg"));
|
||||
downloadButton->setIcon(QIcon(":/icon/dark/download.svg"));
|
||||
ui->pushButton_14->setIcon(QIcon(":/icon/dark/update.svg"));
|
||||
int i = 0;
|
||||
while (i < ui->buttonGroup->buttons().size()) {
|
||||
ui->buttonGroup->buttons()[i]->setIcon(QIcon(":/icon/dark/leftbutton_" + QString::number(i) + ".svg"));
|
||||
@ -98,6 +99,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
");
|
||||
backButtom->setIcon(QIcon(":/icon/light/back.svg"));
|
||||
downloadButton->setIcon(QIcon(":/icon/light/download.svg"));
|
||||
ui->pushButton_14->setIcon(QIcon(":/icon/light/update.svg"));
|
||||
int i = 0;
|
||||
while (i < ui->buttonGroup->buttons().size()) {
|
||||
ui->buttonGroup->buttons()[i]->setIcon(QIcon(":/icon/light/leftbutton_" + QString::number(i) + ".svg"));
|
||||
@ -276,3 +278,17 @@ void MainWindow::updateUi(int now)
|
||||
qDebug() << itemlist[now];
|
||||
switchPage(AppPageApplist);
|
||||
}
|
||||
|
||||
void MainWindow::on_pushButton_14_clicked()
|
||||
{
|
||||
QFile upgradeStatus("/tmp/spark-store/upgradeStatus.txt");
|
||||
if (!upgradeStatus.exists()){
|
||||
QtConcurrent::run([=]{
|
||||
auto upgradeP = new QProcess();
|
||||
upgradeP->startDetached("/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh");
|
||||
upgradeP->waitForStarted();
|
||||
upgradeP->waitForFinished(-1);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,7 @@ private:
|
||||
private slots:
|
||||
//接受来自dbus的url
|
||||
void onGetUrl(const QString &url);
|
||||
void on_pushButton_14_clicked();
|
||||
};
|
||||
|
||||
#endif // MAINWINDOWDTK_H
|
||||
|
@ -521,6 +521,31 @@
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_14">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>36</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>更新</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoRepeat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
Loading…
x
Reference in New Issue
Block a user