feat: ISSUE #I69IJI 自动关闭到托盘以防止下载和安装中断

添加托盘图标,主窗口关闭后仍然在后台运行;左键单机托盘图标显示主窗口

Log: 添加托盘图标;重构 MainWindow 构造函数,拆分 UI 初始化代码至单独函数;修改启动时窗口渐变动画初始化位置至 showEvent 中
This commit is contained in:
zty199
2023-01-30 18:30:43 +08:00
parent 4b40e3caca
commit cf549c540d
9 changed files with 443 additions and 279 deletions

View File

@@ -240,12 +240,12 @@
<context>
<name>DAboutDialog</name>
<message>
<location filename="../src/application.cpp" line="88"/>
<location filename="../src/application.cpp" line="90"/>
<source>Version: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/application.cpp" line="95"/>
<location filename="../src/application.cpp" line="97"/>
<source>%1 is released under %2</source>
<translation type="unfinished"></translation>
</message>
@@ -452,32 +452,32 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="45"/>
<location filename="../src/mainwindow-dtk.cpp" line="161"/>
<source>Submit App</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="46"/>
<location filename="../src/mainwindow-dtk.cpp" line="162"/>
<source>Submit App with client(Recommanded)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="47"/>
<location filename="../src/mainwindow-dtk.cpp" line="163"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="48"/>
<location filename="../src/mainwindow-dtk.cpp" line="164"/>
<source>APP Upgrade and Install Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="161"/>
<location filename="../src/mainwindow-dtk.cpp" line="123"/>
<source>Spark Store</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="162"/>
<location filename="../src/mainwindow-dtk.cpp" line="128"/>
<source>Search or enter spk://</source>
<translation type="unfinished"></translation>
</message>
@@ -485,19 +485,19 @@
<context>
<name>QObject</name>
<message>
<location filename="../src/application.cpp" line="26"/>
<location filename="../src/application.cpp" line="27"/>
<location filename="../src/mainwindow-dtk.cpp" line="22"/>
<location filename="../src/application.cpp" line="28"/>
<location filename="../src/application.cpp" line="29"/>
<location filename="../src/mainwindow-dtk.cpp" line="103"/>
<source>Spark Store</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/application.cpp" line="31"/>
<location filename="../src/application.cpp" line="33"/>
<source>&lt;span style=&apos; font-size:10pt;font-weight:60;&apos;&gt;An appstore powered by community&lt;/span&gt;&lt;br/&gt;&lt;a href=&apos;https://www.spark-app.store/&apos;&gt;https://www.spark-app.store&lt;/a&gt;&lt;br/&gt;&lt;span style=&apos; font-size:12pt;&apos;&gt;Spark developers&lt;/span&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/application.cpp" line="92"/>
<location filename="../src/application.cpp" line="94"/>
<source>Spark Project</source>
<translation type="unfinished"></translation>
</message>
@@ -506,6 +506,11 @@
<source>Download list</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="217"/>
<source>Show MainWindow</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsPage</name>
@@ -610,4 +615,17 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TitleBarMenu</name>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="218"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="219"/>
<source>Exit</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@@ -240,12 +240,12 @@
<context>
<name>DAboutDialog</name>
<message>
<location filename="../src/application.cpp" line="88"/>
<location filename="../src/application.cpp" line="90"/>
<source>Version: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/application.cpp" line="95"/>
<location filename="../src/application.cpp" line="97"/>
<source>%1 is released under %2</source>
<translation type="unfinished"></translation>
</message>
@@ -452,32 +452,32 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="45"/>
<location filename="../src/mainwindow-dtk.cpp" line="161"/>
<source>Submit App</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="46"/>
<location filename="../src/mainwindow-dtk.cpp" line="162"/>
<source>Submit App with client(Recommanded)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="47"/>
<location filename="../src/mainwindow-dtk.cpp" line="163"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="48"/>
<location filename="../src/mainwindow-dtk.cpp" line="164"/>
<source>APP Upgrade and Install Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="161"/>
<location filename="../src/mainwindow-dtk.cpp" line="123"/>
<source>Spark Store</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="162"/>
<location filename="../src/mainwindow-dtk.cpp" line="128"/>
<source>Search or enter spk://</source>
<translation type="unfinished"></translation>
</message>
@@ -485,19 +485,19 @@
<context>
<name>QObject</name>
<message>
<location filename="../src/application.cpp" line="26"/>
<location filename="../src/application.cpp" line="27"/>
<location filename="../src/mainwindow-dtk.cpp" line="22"/>
<location filename="../src/application.cpp" line="28"/>
<location filename="../src/application.cpp" line="29"/>
<location filename="../src/mainwindow-dtk.cpp" line="103"/>
<source>Spark Store</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/application.cpp" line="31"/>
<location filename="../src/application.cpp" line="33"/>
<source>&lt;span style=&apos; font-size:10pt;font-weight:60;&apos;&gt;An appstore powered by community&lt;/span&gt;&lt;br/&gt;&lt;a href=&apos;https://www.spark-app.store/&apos;&gt;https://www.spark-app.store&lt;/a&gt;&lt;br/&gt;&lt;span style=&apos; font-size:12pt;&apos;&gt;Spark developers&lt;/span&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/application.cpp" line="92"/>
<location filename="../src/application.cpp" line="94"/>
<source>Spark Project</source>
<translation type="unfinished"></translation>
</message>
@@ -506,6 +506,11 @@
<source>Download list</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="217"/>
<source>Show MainWindow</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsPage</name>
@@ -610,4 +615,17 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TitleBarMenu</name>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="218"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="219"/>
<source>Exit</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@@ -131,7 +131,7 @@
<location filename="../src/pages/appintopage.ui" line="429"/>
<location filename="../src/pages/appintopage.ui" line="432"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capable to Ubuntu 22.04&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ubuntu 22.04&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ubuntu 22.04&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<location filename="../src/pages/appintopage.ui" line="543"/>
@@ -240,12 +240,12 @@
<context>
<name>DAboutDialog</name>
<message>
<location filename="../src/application.cpp" line="88"/>
<location filename="../src/application.cpp" line="90"/>
<source>Version: %1</source>
<translation>%1</translation>
</message>
<message>
<location filename="../src/application.cpp" line="95"/>
<location filename="../src/application.cpp" line="97"/>
<source>%1 is released under %2</source>
<translation>%1%2</translation>
</message>
@@ -452,32 +452,32 @@
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="45"/>
<location filename="../src/mainwindow-dtk.cpp" line="161"/>
<source>Submit App</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="46"/>
<location filename="../src/mainwindow-dtk.cpp" line="162"/>
<source>Submit App with client(Recommanded)</source>
<translation>使稿</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="47"/>
<location filename="../src/mainwindow-dtk.cpp" line="163"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="48"/>
<location filename="../src/mainwindow-dtk.cpp" line="164"/>
<source>APP Upgrade and Install Settings</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="161"/>
<location filename="../src/mainwindow-dtk.cpp" line="123"/>
<source>Spark Store</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="162"/>
<location filename="../src/mainwindow-dtk.cpp" line="128"/>
<source>Search or enter spk://</source>
<translation></translation>
</message>
@@ -485,19 +485,19 @@
<context>
<name>QObject</name>
<message>
<location filename="../src/application.cpp" line="26"/>
<location filename="../src/application.cpp" line="27"/>
<location filename="../src/mainwindow-dtk.cpp" line="22"/>
<location filename="../src/application.cpp" line="28"/>
<location filename="../src/application.cpp" line="29"/>
<location filename="../src/mainwindow-dtk.cpp" line="103"/>
<source>Spark Store</source>
<translation></translation>
</message>
<message>
<location filename="../src/application.cpp" line="31"/>
<location filename="../src/application.cpp" line="33"/>
<source>&lt;span style=&apos; font-size:10pt;font-weight:60;&apos;&gt;An appstore powered by community&lt;/span&gt;&lt;br/&gt;&lt;a href=&apos;https://www.spark-app.store/&apos;&gt;https://www.spark-app.store&lt;/a&gt;&lt;br/&gt;&lt;span style=&apos; font-size:12pt;&apos;&gt;Spark developers&lt;/span&gt;</source>
<translation>&lt;span style=&apos; font-size:10pt;font-weight:60;&apos;&gt;&lt;/span&gt;&lt;br/&gt;&lt;a href=&apos;https://www.spark-app.store/&apos;&gt;https://www.spark-app.store&lt;/a&gt;&lt;br/&gt;&lt;span style=&apos; font-size:12pt;&apos;&gt;星火计划开发者&lt;/span&gt;</translation>
</message>
<message>
<location filename="../src/application.cpp" line="92"/>
<location filename="../src/application.cpp" line="94"/>
<source>Spark Project</source>
<translation></translation>
</message>
@@ -506,6 +506,11 @@
<source>Download list</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="217"/>
<source>Show MainWindow</source>
<translation></translation>
</message>
</context>
<context>
<name>SettingsPage</name>
@@ -610,4 +615,17 @@
<translation></translation>
</message>
</context>
<context>
<name>TitleBarMenu</name>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="218"/>
<source>About</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="219"/>
<source>Exit</source>
<translation>退</translation>
</message>
</context>
</TS>