mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-13 20:32:05 +08:00
feat: 更新管理器
change: 翻译
This commit is contained in:
@@ -63,7 +63,8 @@ Widget::Widget(DBlurEffectWidget *parent) :
|
||||
connect(ui->menu_system, &QPushButton::clicked, this, [=](){Widget::chooseLeftMenu(10);});
|
||||
connect(ui->menu_theme, &QPushButton::clicked, this, [=](){Widget::chooseLeftMenu(11);});
|
||||
connect(ui->menu_other, &QPushButton::clicked, this, [=](){Widget::chooseLeftMenu(12);});
|
||||
connect(ui->menu_download, &QPushButton::clicked, this, [=](){Widget::chooseLeftMenu(13);});
|
||||
connect(ui->menu_upgrade, &QPushButton::clicked, this, [=](){Widget::chooseLeftMenu(13);});
|
||||
connect(ui->menu_download, &QPushButton::clicked, this, [=](){Widget::chooseLeftMenu(14);});
|
||||
|
||||
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [=](DGuiApplicationHelper::ColorType themeType)
|
||||
{
|
||||
@@ -255,7 +256,8 @@ void Widget::initUI()
|
||||
left_list[10] = ui->menu_system;
|
||||
left_list[11] = ui->menu_theme;
|
||||
left_list[12] = ui->menu_other;
|
||||
left_list[13] = ui->menu_download;
|
||||
left_list[13] = ui->menu_upgrade;
|
||||
left_list[14] = ui->menu_download;
|
||||
|
||||
ui->label_show->hide();
|
||||
|
||||
@@ -482,7 +484,8 @@ void Widget::updateUI()
|
||||
left_list[10]->setIcon(QIcon(":/icons/icons/category_system_dark.svg"));
|
||||
left_list[11]->setIcon(QIcon(":/icons/icons/theme-symbolic_dark.svg"));
|
||||
left_list[12]->setIcon(QIcon(":/icons/icons/category_others_dark.svg"));
|
||||
left_list[13]->setIcon(QIcon(":/icons/icons/downloads-symbolic_dark.svg"));
|
||||
left_list[13]->setIcon(QIcon(":/icons/icons/upgrades-symbolic_dark.svg"));
|
||||
left_list[14]->setIcon(QIcon(":/icons/icons/downloads-symbolic_dark.svg"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -499,10 +502,11 @@ void Widget::updateUI()
|
||||
left_list[10]->setIcon(QIcon(":/icons/icons/category_system.svg"));
|
||||
left_list[11]->setIcon(QIcon(":/icons/icons/theme-symbolic.svg"));
|
||||
left_list[12]->setIcon(QIcon(":/icons/icons/category_others.svg"));
|
||||
left_list[13]->setIcon(QIcon(":/icons/icons/downloads-symbolic.svg"));
|
||||
left_list[13]->setIcon(QIcon(":/icons/icons/upgrades-symbolic.svg"));
|
||||
left_list[14]->setIcon(QIcon(":/icons/icons/downloads-symbolic.svg"));
|
||||
}
|
||||
|
||||
for(int i = 0; i < 14; i++)
|
||||
for(int i = 0; i < 15; i++)
|
||||
{
|
||||
/* 设置左侧菜单字体
|
||||
* QFont temp = font;
|
||||
@@ -590,7 +594,10 @@ void Widget::updateUI()
|
||||
left_list[12]->setIcon(QIcon(":/icons/icons/category_others_dark.svg"));
|
||||
break;
|
||||
case 13:
|
||||
left_list[13]->setIcon(QIcon(":/icons/icons/downloads-symbolic_dark.svg"));
|
||||
left_list[13]->setIcon(QIcon(":/icons/icons/upgrades-symbolic_dark.svg"));
|
||||
break;
|
||||
case 14:
|
||||
left_list[14]->setIcon(QIcon(":/icons/icons/downloads-symbolic_dark.svg"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -630,6 +637,16 @@ void Widget::chooseLeftMenu(int index)
|
||||
|
||||
ui->stackedWidget->setCurrentIndex(0);
|
||||
}
|
||||
else if (index == 13){
|
||||
QtConcurrent::run([=]{
|
||||
auto upgradeP = new QProcess();
|
||||
upgradeP->startDetached("/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh");
|
||||
upgradeP->waitForStarted();
|
||||
upgradeP->waitForFinished(-1);
|
||||
|
||||
});
|
||||
ui->stackedWidget->setCurrentIndex(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->stackedWidget->setCurrentIndex(1);
|
||||
@@ -649,7 +666,7 @@ void Widget::updatefoot()
|
||||
|
||||
void Widget::on_pushButton_download_clicked()
|
||||
{
|
||||
chooseLeftMenu(13);
|
||||
chooseLeftMenu(14);
|
||||
|
||||
allDownload += 1;
|
||||
|
||||
|
||||
251
src/widget.ui
251
src/widget.ui
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1053</width>
|
||||
<height>711</height>
|
||||
<height>754</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -93,6 +93,20 @@
|
||||
<property name="rightMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item row="13" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_theme">
|
||||
<property name="text">
|
||||
<string>Beautify</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_chat">
|
||||
<property name="text">
|
||||
<string>Chat</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer_7">
|
||||
<property name="orientation">
|
||||
@@ -109,86 +123,30 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_music">
|
||||
<item row="3" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_network">
|
||||
<property name="text">
|
||||
<string>Music</string>
|
||||
<string>Network</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_photo">
|
||||
<property name="text">
|
||||
<string>Graphics</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_dev">
|
||||
<property name="text">
|
||||
<string>Development</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="icon">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>36</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>36</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>icon</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<item row="18" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>3</width>
|
||||
<height>20</height>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="12" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_system">
|
||||
<item row="8" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_game">
|
||||
<property name="text">
|
||||
<string>Tools</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_read">
|
||||
<property name="text">
|
||||
<string>Reading</string>
|
||||
<string>Games</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -199,6 +157,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_download">
|
||||
<property name="text">
|
||||
<string>Download</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="pushButton_refresh">
|
||||
<property name="maximumSize">
|
||||
@@ -219,10 +184,10 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_chat">
|
||||
<item row="6" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_video">
|
||||
<property name="text">
|
||||
<string>Chat</string>
|
||||
<string>Video</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -246,44 +211,10 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="13" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_theme">
|
||||
<item row="12" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_system">
|
||||
<property name="text">
|
||||
<string>Beautify</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_network">
|
||||
<property name="text">
|
||||
<string>Network</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_game">
|
||||
<property name="text">
|
||||
<string>Games</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_other">
|
||||
<property name="text">
|
||||
<string>Others</string>
|
||||
<string>Tools</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -300,17 +231,63 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_download">
|
||||
<item row="10" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_read">
|
||||
<property name="text">
|
||||
<string>Download</string>
|
||||
<string>Reading</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_video">
|
||||
<item row="14" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_other">
|
||||
<property name="text">
|
||||
<string>Video</string>
|
||||
<string>Others</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_photo">
|
||||
<property name="text">
|
||||
<string>Graphics</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="icon">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>36</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>36</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>icon</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="11" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_dev">
|
||||
<property name="text">
|
||||
<string>Development</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -333,6 +310,36 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>3</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_music">
|
||||
<property name="text">
|
||||
<string>Music</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_upgrade">
|
||||
<property name="text">
|
||||
<string>Upgrade</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -365,11 +372,11 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWebEngineView" name="webEngineView" native="true">
|
||||
<widget class="QWebEngineView" name="webEngineView">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::DefaultContextMenu</enum>
|
||||
</property>
|
||||
<property name="url" stdset="0">
|
||||
<property name="url">
|
||||
<url>
|
||||
<string>about:blank</string>
|
||||
</url>
|
||||
@@ -489,8 +496,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>889</width>
|
||||
<height>849</height>
|
||||
<width>903</width>
|
||||
<height>848</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_17">
|
||||
@@ -993,8 +1000,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>851</width>
|
||||
<height>324</height>
|
||||
<width>869</width>
|
||||
<height>326</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
@@ -1123,8 +1130,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>889</width>
|
||||
<height>716</height>
|
||||
<width>738</width>
|
||||
<height>833</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_23">
|
||||
|
||||
Reference in New Issue
Block a user