feat: 更新管理器

change: 翻译
This commit is contained in:
uniartisan 2022-10-21 17:15:49 +08:00
parent eaf65a326c
commit 3feae61b1b
6 changed files with 221 additions and 130 deletions

@ -32,6 +32,8 @@
<file>icons/category_active.svg</file>
<file>icons/refresh-page-dark.svg</file>
<file>icons/refresh-page.svg</file>
<file>icons/upgrades-symbolic_dark.svg</file>
<file>icons/upgrades-symbolic.svg</file>
</qresource>
<qresource prefix="/">
<file>tags/a2d.png</file>

@ -0,0 +1,7 @@
<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" stroke="null" style="vector-effect: non-scaling-stroke;">
<g stroke="null">
<title stroke="null">Layer 1</title>
<path transform="rotate(-180 8 8)" stroke="null" id="svg_1" d="m8,1c3.86599,0 7,3.13401 7,7c0,3.86599 -3.13401,7 -7,7c-3.86599,0 -7,-3.13401 -7,-7c0,-3.86599 3.13401,-7 7,-7zm1.5,7l-3,0c-0.27614,0 -0.5,0.22386 -0.5,0.5c0,0.27614 -0.22386,0.5 -0.5,0.5l0,0l-0.5,0c-0.10986,0 -0.21521,0.04364 -0.29289,0.12132c-0.16176,0.16176 -0.16176,0.42403 0,0.58579l0,0l2.93934,2.93934c0.19526,0.19526 0.51184,0.19526 0.7071,0l0,0l2.93934,-2.93934c0.07768,-0.07768 0.12132,-0.18304 0.12132,-0.2929c0,-0.22876 -0.18545,-0.41421 -0.41421,-0.41421l0,0l-0.5,0c-0.27614,0 -0.5,-0.22386 -0.5,-0.5c0,-0.27614 -0.22386,-0.5 -0.5,-0.5l0,0zm0,-2l-3,0c-0.27614,0 -0.5,0.22386 -0.5,0.5c0,0.27614 0.22386,0.5 0.5,0.5l0,0l3,0c0.27614,0 0.5,-0.22386 0.5,-0.5c0,-0.27614 -0.22386,-0.5 -0.5,-0.5l0,0zm0,-2l-3,0c-0.27614,0 -0.5,0.22386 -0.5,0.5c0,0.27614 0.22386,0.5 0.5,0.5l0,0l3,0c0.27614,0 0.5,-0.22386 0.5,-0.5c0,-0.27614 -0.22386,-0.5 -0.5,-0.5l0,0z" fill-rule="evenodd"/>
</g>
</svg>

After

(image error) Size: 1.1 KiB

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16"
height="16"
viewBox="0 0 16 16"
version="1.1"
id="svg4"
sodipodi:docname="downloads-symbolic_dark.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="982"
id="namedview6"
showgrid="false"
inkscape:zoom="14.75"
inkscape:cx="8"
inkscape:cy="8"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
transform="rotate(-180 8 8)"
fill="#FFF"
fill-opacity=".8"
fill-rule="evenodd"
d="M8,1 C11.8659932,1 15,4.13400675 15,8 C15,11.8659932 11.8659932,15 8,15 C4.13400675,15 1,11.8659932 1,8 C1,4.13400675 4.13400675,1 8,1 Z M9.5,8 L6.5,8 C6.22385763,8 6,8.22385763 6,8.5 C6,8.77614237 5.77614237,9 5.5,9 L5.5,9 L5,9 C4.89014373,9 4.78478689,9.04364023 4.70710678,9.12132034 C4.54534632,9.2830808 4.54534632,9.54534632 4.70710678,9.70710678 L4.70710678,9.70710678 L7.64644661,12.6464466 C7.84170876,12.8417088 8.15829124,12.8417088 8.35355339,12.6464466 L8.35355339,12.6464466 L11.2928932,9.70710678 C11.3705733,9.62942667 11.4142136,9.52406983 11.4142136,9.41421356 C11.4142136,9.18544973 11.2287638,9 11,9 L11,9 L10.5,9 C10.2238576,9 10,8.77614237 10,8.5 C10,8.22385763 9.77614237,8 9.5,8 L9.5,8 Z M9.5,6 L6.5,6 C6.22385763,6 6,6.22385763 6,6.5 C6,6.77614237 6.22385763,7 6.5,7 L6.5,7 L9.5,7 C9.77614237,7 10,6.77614237 10,6.5 C10,6.22385763 9.77614237,6 9.5,6 L9.5,6 Z M9.5,4 L6.5,4 C6.22385763,4 6,4.22385763 6,4.5 C6,4.77614237 6.22385763,5 6.5,5 L6.5,5 L9.5,5 C9.77614237,5 10,4.77614237 10,4.5 C10,4.22385763 9.77614237,4 9.5,4 L9.5,4 Z"
id="path2"
style="fill:#ffffff;fill-opacity:0.60000002" />
</svg>

After

(image error) Size: 2.6 KiB

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

@ -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">

@ -617,7 +617,7 @@
<message>
<location filename="../src/widget.cpp" line="937"/>
<source>Upgrade</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widget.cpp" line="1124"/>