From 4644bba1c626236f421f7af9c430314f1dbd6d06 Mon Sep 17 00:00:00 2001 From: luoxueyi <luoxueyi@kylinos.cn> Date: Thu, 8 Jun 2023 19:43:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=B8=BB=E7=BA=BF=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/Resources.qrc | 2 + data/background_upgrade_icon.png | Bin 0 -> 5225 bytes data/close.png | Bin 0 -> 957 bytes data/kylin-background-upgrade-manul.service | 4 +- data/kylin-background-upgrade-manul.timer | 9 +- data/kylin-background-upgrade-silent.service | 10 + data/kylin-background-upgrade-silent.timer | 12 + data/kylin-background-upgrade.desktop | 10 + data/update.png | Bin 715 -> 8074 bytes debian/changelog | 135 +++++++- debian/control | 8 +- debian/postinst | 5 +- env.pri | 4 + kylin-background-upgrade.pro | 35 +- kylin-background-upgrade.pro.user | 24 +- kylin-background-upgrade.pro.user.3d34bcf | 314 ++++++++++++++++++ src/core.cpp | 2 +- src/main.cpp | 89 +++-- src/traydbus.cpp | 20 +- src/traydbus.h | 2 +- src/updatehandle.cpp | 192 +++++++---- src/updatehandle.h | 6 +- src/updatewidget.cpp | 302 ++++++++++++----- src/updatewidget.h | 28 +- .../kylin-background-upgrade_bo_CN.qm | Bin 2535 -> 2003 bytes .../kylin-background-upgrade_bo_CN.ts | 164 +++++---- .../kylin-background-upgrade_zh_CN.qm | Bin 1124 -> 1305 bytes .../kylin-background-upgrade_zh_CN.ts | 94 ++++-- widgets/Button/button.pri | 6 + widgets/Button/fixbutton.cpp | 36 ++ widgets/Button/fixbutton.h | 21 ++ widgets/widgets.pri | 4 + 32 files changed, 1193 insertions(+), 345 deletions(-) create mode 100644 data/background_upgrade_icon.png create mode 100644 data/close.png create mode 100644 data/kylin-background-upgrade-silent.service create mode 100644 data/kylin-background-upgrade-silent.timer create mode 100644 data/kylin-background-upgrade.desktop create mode 100644 env.pri create mode 100644 kylin-background-upgrade.pro.user.3d34bcf create mode 100644 widgets/Button/button.pri create mode 100644 widgets/Button/fixbutton.cpp create mode 100644 widgets/Button/fixbutton.h create mode 100644 widgets/widgets.pri diff --git a/data/Resources.qrc b/data/Resources.qrc index 6859cf5..d68938f 100644 --- a/data/Resources.qrc +++ b/data/Resources.qrc @@ -2,5 +2,7 @@ <qresource prefix="/json"/> <qresource prefix="/"> <file>update.png</file> + <file>background_upgrade_icon.png</file> + <file>close.png</file> </qresource> </RCC> diff --git a/data/background_upgrade_icon.png b/data/background_upgrade_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..19fb6d0bc3ccd3c74f1f7caa323e1d65ac2e6f1d GIT binary patch literal 5225 zcmV-v6qf6WP)<h;3K|Lk000e1NJLTq001li001lq1^@s69)wx}00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj532;bRa{vGmbN~PnbOGLGA9w%&6aGm=K~z{rO<DJQ z995Rpzp%R#3}b_B<<!c_0Wdb<V}JpJ18HD(2_`PX%<v6^@c;vO1_L(P7;J3C4pQgt z>gwv8Bz07<B-@fDXZF81d+uw?!w>hX(A8Dvop<iJ_f=Ksr7H*(BrY*7!r(SMb>Vtk zR1xBSq;wfk{uU|7{t9Bn6~rY<=aHB?kI99Lm|DDw+2#K$$N8Tyvvdv9JXe^%jQrdc zq<CGta30b85<=M}gmcRX^M0Y?B?R+)4!45CP&od5{PR$NjpAxt=1GF&)+iF#GyyWg zC7vtsnCD^zg5^UKg(day%+xvLX3im*n?Wc!34bIBZzu*Wlt3Voh7q4cEK@>!a)#HQ z#rV`B(u_p$JR$;I#WDdBJju~XMu5k``~^jx0{ye72okV>*2$n=;z)}e9rq0ZNU#P0 z8adv)xUASrmllzmTSkN+BB=sGu?a+?DMaHLga|eoOTh?55soAf3df*_qX<Sg0B!^E z3FyfzVp)POEvUgJOXm>Do`F7bmPD-}GE*kY$gdDI2g0p!V|xJ=2Ehgh&`+R#f-HkB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A3` zR6cp3(trE}EcD*tQ~jKFGY2t<clYmC+7Ec8!FQ^PH_8Uc!g~ynkP`!D*xfqLEng#9 z=MbJ);G&aKAhy`lPcU*9%P+M3WLPW6TlgyoPRYj^{vhv*d9i%ikvE4Kj@W9WiSx!b z0+4BRQEOw=;K<37uv6=vF>0LWt%CzRFWW&iFbO#>TjU6f!VpGA254C}43dD8yytiQ zBk;v1DMk5&MvJ8z#Q5we0Y*#Lh~pY1ON{bDTLAmT)=HPv$C&{29N=+q>KfxJw8^sw z=fv_Tm1LgnUVy-<Z8j&;09l3znlczX*{>F%ax7JCj9_G%ZInhiMldvV3L`8^Bi0d| z<lv6W`9Ktzd4ii>;dAAC#sxL~5$04lcNt-VHHySixPpLu_L5hvnj{?$<V1iM>&0dD zRmsPK5}CP5iEuzHi<5H~Fm>i4Gq=DB<ix4|VVpWSh<?Tpr*wp?-C=GAd46Qb3d?Xg zh6gR`oS70BrWC%TR2-~osnThJT|#_jiO*Oj;PZ@2WRiI`NxRKmx&hcITvaNlkWp!Q zk$?cbh=AIck9*~>HyZuV#|X<eJD$@f=8-Hdp~SV|cwqsN*d$lDVJ^+bH~=eIv}0g! z3@1-n7*_6&vM9KyRX1#21Hn`lv*)j%xOj<~KgU?$w9BV1GD@O!J}byDvMUO3D1VK0 z;wJ`WA%GRb^xyzN%11@@1(N$lVUZypL}b()JvA)@lMf^z9w#}4nb{S3<RY@uOKh%J zFgdlznm>=&_zZ(t&QdRt%+4_ukmhycb1O*lI*By*L-_@=c#iihe-#x{<nwS;zR2c9 j5=^)vU5pVdUBdqZu#;XkARUz!00000NkvXXu0mjfa!SmN literal 0 HcmV?d00001 diff --git a/data/close.png b/data/close.png new file mode 100644 index 0000000000000000000000000000000000000000..ff398324b9a3191300119cce7a6582467bd83112 GIT binary patch literal 957 zcmV;u148_XP)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F8000AoNkl<Zc-qBR z>rzr-6r~gu5>XBZj))%aB#?*}jZT`^bhN|^hGiol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&XsByd3b@DJ7^G6`6HPO-FE9z;snmPcZwV~yhDF6QX=F`_JIZl_i f_K^2DE+l>d^phG!znYv+00000NkvXXu0mjf*!RB^ literal 0 HcmV?d00001 diff --git a/data/kylin-background-upgrade-manul.service b/data/kylin-background-upgrade-manul.service index 1e1fac8..34f7c2a 100644 --- a/data/kylin-background-upgrade-manul.service +++ b/data/kylin-background-upgrade-manul.service @@ -1,10 +1,10 @@ [Unit] Description=系统升级后台检测程序 + [Service] Type=forking TimeoutStartSec=infinity -ExecStartPre=apt update -ExecStart=/usr/share/kylin-update-notify/checkUpdate.py +ExecStart=/usr/bin/kylin-background-upgrade --check-upgrade diff --git a/data/kylin-background-upgrade-manul.timer b/data/kylin-background-upgrade-manul.timer index ab72258..4268f77 100644 --- a/data/kylin-background-upgrade-manul.timer +++ b/data/kylin-background-upgrade-manul.timer @@ -2,10 +2,11 @@ Description=系统升级定时检测 [Timer] -OnCalendar=*-*-* 14:00 -RandomizedDelaySec=2h -Persistent=true +OnStartupSec=5min 10s +OnUnitInactiveSec=5min 10s +AccuracySec=5s +Unit=kylin-background-upgrade-manul.service [Install] -WantedBy=timers.target +WantedBy=default.target diff --git a/data/kylin-background-upgrade-silent.service b/data/kylin-background-upgrade-silent.service new file mode 100644 index 0000000..d10f47f --- /dev/null +++ b/data/kylin-background-upgrade-silent.service @@ -0,0 +1,10 @@ +[Unit] +Description=自动更新托盘更新程序 + + +[Service] +Type=forking +TimeoutStartSec=infinity +ExecStart=/usr/bin/kylin-background-upgrade + + diff --git a/data/kylin-background-upgrade-silent.timer b/data/kylin-background-upgrade-silent.timer new file mode 100644 index 0000000..89a2a70 --- /dev/null +++ b/data/kylin-background-upgrade-silent.timer @@ -0,0 +1,12 @@ +[Unit] +Description=静默更新定时检测 + +[Timer] +OnStartupSec=30min +OnUnitInactiveSec=2h +AccuracySec=20s +Unit=kylin-background-upgrade-silent.service + +[Install] +WantedBy=default.target + diff --git a/data/kylin-background-upgrade.desktop b/data/kylin-background-upgrade.desktop new file mode 100644 index 0000000..2e53db2 --- /dev/null +++ b/data/kylin-background-upgrade.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=kylin-background-upgrade +Name[zh_CN]=更新管理器托盘程序 +Exec=/usr/bin/kylin-background-upgrade --check-immediately +Icon=kylin-update-manager +Type=Application +X-UKUI-AutoRestart=true +OnlyShowIn=UKUI +X-UKUI-Autostart-Phase=Application +NoDisplay=true diff --git a/data/update.png b/data/update.png index a28e913243c91874881e9b93cdabdf95a8e18d21..fe222a39f346935d1812c4d08822de6a12e23932 100644 GIT binary patch literal 8074 zcmV;5A9dh~P)<h;3K|Lk000e1NJLTq003YB003YJ1^@s6;+S_h00009a7bBm000XT z000XT0n*)m`~UzSJV``BRCt{2T?up)Ro4Ehdd)&QAw<~%$ReAdBa472FyMg8p!mzU z45H4jj3Of<jE)GRgF55F;OOY!f{fxgxBwz5qKHIR0g+9@5(r^Q*pklD>9v;syjqgi zFICmmorugi|K+^XMY{Secfa@DSH;P)jQ@w95BUGb{m%=||E9@091hOvdr=hs>%{q- zR6z+4ZS|e$V$N0KoD&3S-n=<iRaHg*i8Hxozhi-2jBIp$E)nBrBLIVR7U3Lo&6(T> z3#7|bgTb`|KQ}SXIsq8<VuWCx`8)f67)XH`k|l-^k{MAlGc!?DRdv>han=YxA>Ih# zJaf$({GBr(1Pw-rmZ(PlFEW2Ol9ID36+bxv3=nUGXb1IK*Y@t)fA@KLc|$#3PkX1s z*_`M3be`uNR^!RCEQ+EO6h)yT9Elz-KXYbHmoA-O(-1CbM9>K!nh--~C1TpNX?#IJ zfupRf%vn}e=IGL;i_p4tYhlQcA>yoAvr<OlPeuR>#5)Wcafh87H*UJ2Q|C^jeOXzT zIi1dCP!S4AmLW?}KNHNC=Q$|<c!1|PaGW{~K@e+dY62TeN)9jU)92D96fxLVM}(0h zM`FW<4W8?B^E*xGbn%29S-HQ?aeF(^;{}A+fvQ+!VW|+F*Khg!)5+qg$q7IiS0j#h zq8{Nc^7+IQPj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;ha?6H9I8}slyLBMcZ)Q99QFJ)%s~j3rv7i+Y zoilLyNgaVc523^+g7Hms-1Vgv%NjBh3{T2VdjW^ShmjC6i|fcPZR|s4aqn|oW_EUV x{<QvDus8fo-j4(^F&V>5Dknisjo$tNeghO5NixqE2k8I+002ovPDHLkV1j>-K#%|c diff --git a/debian/changelog b/debian/changelog index 285edd6..0bf9830 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,39 +1,142 @@ -kylin-update-notify (1.3.2.1-ok4) yangtze; urgency=medium +kylin-background-upgrade (1.3.2.9-0k0.7) v101; urgency=medium - *BUG号:135671 【wayland】【更新升级】设置推迟时间不生效,到推迟的时间后没有再次出现自动更新弹窗 + *BUG号: 170221 【在线更新】藏文环境下,字号大于“小”时,系统升级提示更新窗口按钮文字显示不全 *需求号:无 *其他改动说明:无 *影响域: 无 - -- luoxueyi <luoxueyi@kylinos.cn> Tue, 18 Apr 2023 09:46:45 +0800 + -- luoxueyi <luoxueyi@kylinos.cn> Sat, 20 May 2023 19:30:19 +0800 -kylin-update-notify (1.3.2.1-ok3) yangtze; urgency=medium +kylin-background-upgrade (1.3.2.9-0k0.6) v101; urgency=medium - * patch from zhangdongwei + *BUG号: 167695 【可信开发试点】kylin-background-upgrade 内存泄露类安全编码规范问题整改 + *需求号:无 + *其他改动说明:无 + *影响域: 无 - -- Xie Wei <xiewei@kylinos.cn> Thu, 21 Jul 2022 19:41:21 +0800 + -- luoxueyi <luoxueyi@kylinos.cn> Wed, 10 May 2023 09:50:19 +0800 -kylin-update-notify (1.3.2.1-ok2) yangtze; urgency=medium +kylin-background-upgrade (1.3.2.9-0k0.5) v101; urgency=medium - * add BR: python2.7-dev + *BUG号: 167695 【可信开发试点】kylin-background-upgrade 内存泄露类安全编码规范问题整改 + 169646 【更新升级】系统有更新的提示窗口,关闭按钮无hover状态和悬浮提示 + *需求号:无 + *其他改动说明:无 + *影响域: 无 - -- Xie Wei <xiewei@kylinos.cn> Thu, 21 Jul 2022 18:26:14 +0800 + -- luoxueyi <luoxueyi@kylinos.cn> Wed, 10 May 2023 09:50:19 +0800 -kylin-update-notify (1.3.2.1-ok1) yangtze; urgency=medium +kylin-background-upgrade (1.3.2.9-0k0.4) v101; urgency=medium - * build for openKylin - * 修改为quilt格式 + *BUG号: 163745 【在线更新】藏文系统下,系统升级提示更新窗口未完全藏化 + *需求号:无 + *其他改动说明:无 + *影响域: 无 - -- Xie Wei <xiewei@kylinos.cn> Thu, 21 Jul 2022 18:08:51 +0800 + -- luoxueyi <luoxueyi@kylinos.cn> Mon, 10 Apr 2023 16:45:56 +0800 -kylin-update-notify (1.3.2.1) yangtze; urgency=medium +kylin-background-upgrade (1.3.2.9-0k0.3) v101; urgency=medium - *BUG号:无 + *BUG号: 164842 【系统更新】系统还原至出厂备份成功后,不登录进桌面,放置机器一段时间,查看日志发现生成多次kylin-background-upgrade崩溃的core文件 + *需求号:无 + *其他改动说明:无 + *影响域: 无 + + -- luoxueyi <luoxueyi@kylinos.cn> Wed, 29 Mar 2023 17:17:34 +0800 + +kylin-background-upgrade (1.3.2.9-0k0.2) v101; urgency=medium + + *BUG号: 127614 【更新升级】在源管理服务器上将需要安装依赖的包添加到静默更新,静默更新成功但是通知显示为失败 + *需求号:无 + *其他改动说明:无 + *影响域: 无 + + -- luoxueyi <luoxueyi@kylinos.cn> Wed, 23 Nov 2022 18:15:12 +0800 + +kylin-background-upgrade (1.3.2.9-0k0.1) v101; urgency=medium + + *BUG号: 无 + *需求号:无 + *其他改动说明:版本号整改 + *影响域: 无 + + -- luoxueyi <luoxueyi@kylinos.cn> Wed, 23 Nov 2022 18:15:12 +0800 + +kylin-background-upgrade (1.3.2.9) v101; urgency=medium + + *BUG号: 无 + *需求号:无 + *其他改动说明:优化升级功能增加异常处理 + *影响域: 系统更新-静默升级 + + -- luoxueyi <luoxueyi@kylinos.cn> Wed, 02 Nov 2022 18:15:12 +0800 + +kylin-background-upgrade (1.3.2.8) v101; urgency=medium + + *BUG号: #144997 【2203自适应升级2209】系统更新提示弹窗未汉化 + #144104 【在线更新】【2107在线升级2203-update1-RC6】升完基础组件立即重启登录系统后,第二阶段提示窗口中点击立即更新后弹窗未消失 *需求号:无 *其他改动说明:无 *影响域: 系统更新-静默升级 - -- luoxueyi <luoxueyi@kylinos.cn> Thu, 21 Jul 2022 17:57:12 +0800 + -- luoxueyi <luoxueyi@kylinos.cn> Fri, 21 Oct 2022 20:46:42 +0800 + +kylin-background-upgrade (1.3.2.7) v101; urgency=medium + + *BUG号: 无 + *需求号:无 + *其他改动说明:修复立即更新托盘不退出 + *影响域: 系统更新-静默升级 + + -- luoxueyi <luoxueyi@kylinos.cn> Tue, 18 Oct 2022 09:25:31 +0800 + +kylin-background-upgrade (1.3.2.6) v101; urgency=medium + + *BUG号: 无 + *需求号:无 + *其他改动说明:同步2107自适应升级的问题 + *影响域: 系统更新-静默升级 + + -- luoxueyi <luoxueyi@kylinos.cn> Tue, 18 Oct 2022 09:25:31 +0800 + +kylin-background-upgrade (1.3.2.5) v101; urgency=medium + + *BUG号: #bug#140139 在定时弹窗中选择推迟三十分钟,三十分钟后弹窗未弹出 + *需求号:无 + *其他改动说明:无 + *影响域: 系统更新-静默升级 + + -- luoxueyi <luoxueyi@kylinos.cn> Thu, 13 Oct 2022 16:53:39 +0800 + +kylin-background-upgrade (1.3.2.4) v101; urgency=medium + + *BUG号: #136765 【离线更新】使用U盘源时,控制面板-更新中,“有更新应用时通知”打开无效果 + #140203 【在线更新】【PTOF】在规定时间段内桌面右下角未弹出更新通知 + *需求号:无 + *其他改动说明:无 + *影响域: 系统更新-静默升级 + + -- luoxueyi <luoxueyi@kylinos.cn> Fri, 16 Sep 2022 17:59:09 +0800 + +kylin-background-upgrade (1.3.2.3) v101; urgency=medium + + *BUG号: #134834 【在线更新】【PTOF】http源-定时更新-推迟后,未弹出托盘 + #129698 【在线更新】14:30~16:30点外仍会弹出更新通知 + #122183 【在线更新】上午8-12点外仍会弹出更新通知 + *需求号:无 + *其他改动说明:无 + *影响域: 系统更新-静默升级 + + -- luoxueyi <luoxueyi@kylinos.cn> Mon, 29 Aug 2022 17:32:49 +0800 + +kylin-background-upgrade (1.3.2.2) v101; urgency=medium + + *BUG号: #122425 【在线更新】设置每隔1min38s弹出通知,在弹出的通知弹窗中点击推迟,1min38s后再次弹出更新通知 + *需求号:无 + *其他改动说明:无 + *影响域: 系统更新-静默升级 + + -- luoxueyi <luoxueyi@kylinos.cn> Wed, 10 Aug 2022 16:56:28 +0800 kylin-background-upgrade (1.3.2.1) v101; urgency=medium diff --git a/debian/control b/debian/control index 8cd16de..08101ff 100644 --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: kylin-update-notify +Source: kylin-background-upgrade Maintainer: kylin <kylin@kylinos.cn> Section: universe/admin Priority: optional @@ -21,10 +21,12 @@ Build-Depends: debhelper-compat(=12), libukui-log4qt-dev, Standards-Version: 4.1.3 -Package: kylin-update-notify +Package: kylin-background-upgrade Architecture: any Section: universe/admin Priority: optional Depends: ${shlibs:Depends}, -Breaks: + kylin-software-properties ( >= 0.0.1-55 ), + kylin-system-updater ( >= 2.0.5.1 ) +Breaks: kylin-update-tray Description: kylin background upgrade diff --git a/debian/postinst b/debian/postinst index cd9fd10..18fefff 100755 --- a/debian/postinst +++ b/debian/postinst @@ -1,4 +1,5 @@ #!/bin/bash -systemctl daemon-reload -systemctl enable kylin-background-upgrade-manul.timer +systemctl --user daemon-reload +systemctl --global enable kylin-background-upgrade-silent.timer +systemctl --global enable kylin-background-upgrade-manul.timer \ No newline at end of file diff --git a/env.pri b/env.pri new file mode 100644 index 0000000..673db9f --- /dev/null +++ b/env.pri @@ -0,0 +1,4 @@ +PROJECT_ROOTDIR = $$PWD + +INCLUDEPATH = ./widgets +include(./widgets/widgets.pri) diff --git a/kylin-background-upgrade.pro b/kylin-background-upgrade.pro index b210da0..d9a126a 100644 --- a/kylin-background-upgrade.pro +++ b/kylin-background-upgrade.pro @@ -4,7 +4,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++11 link_pkgconfig # 项目名 -TARGET = kylin-update-notify +TARGET = kylin-background-upgrade TEMPLATE = app LIBS +=-lukui-log4qt @@ -13,6 +13,9 @@ LIBS +=-lukui-log4qt target.path = /usr/bin target.source += $$TARGET +include(env.pri) +INCLUDEPATH +=./widgets + SOURCES += \ ./src/core.cpp \ ./src/main.cpp \ @@ -28,15 +31,27 @@ HEADERS += \ ./src/updatehandle.h \ ./src/updatewidget.h +# service文件装载 silent +service.files = ./data/kylin-background-upgrade-silent.service +service.path = /usr/lib/systemd/user/ + +# timer文件装载 +timer.files = ./data/kylin-background-upgrade-silent.timer +timer.path = /usr/lib/systemd/user/ + # service文件装载 manul service_manul.files = ./data/kylin-background-upgrade-manul.service -service_manul.path = /usr/lib/systemd/system/ +service_manul.path = /usr/lib/systemd/user/ # timer文件装载 timer_manul.files = ./data/kylin-background-upgrade-manul.timer -timer_manul.path = /usr/lib/systemd/system/ +timer_manul.path = /usr/lib/systemd/user/ +# desktop文件装载 +desktop.files = ./data/kylin-background-upgrade.desktop +desktop.path = /etc/xdg/autostart + conf.files = ./data/kylin-background-upgrade-template.conf conf.path = /var/lib/kylin-background-upgrade/ @@ -45,14 +60,15 @@ schemes.files += data/org.ukui.log4qt.kylin-background-upgrade.gschema.xml schemes.path = /usr/share/glib-2.0/schemas/ -TRANSLATIONS += translations/kylin-background-upgrade_zh_CN.ts +TRANSLATIONS += translations/kylin-background-upgrade_zh_CN.ts \ translations/kylin-background-upgrade_bo_CN.ts - translation.path = /usr/share/kylin-background-upgrade - translation.files += translations/kylin-background-upgrade_zh_CN.qm - translation.files += translations/kylin-background-upgrade_bo_CN.qm + +translation.path = /usr/share/kylin-background-upgrade +translation.files += translations/kylin-background-upgrade_zh_CN.qm +translation.files += translations/kylin-background-upgrade_bo_CN.qm -INSTALLS += target conf translation schemes service_manul timer_manul +INSTALLS += service target desktop timer conf translation schemes service_manul timer_manul PKGCONFIG += gsettings-qt @@ -64,6 +80,3 @@ RESOURCES += \ DISTFILES += \ ./data/update.png - -DISTFILES += \ - checkUpdate.py diff --git a/kylin-background-upgrade.pro.user b/kylin-background-upgrade.pro.user index f026e3e..475afd8 100644 --- a/kylin-background-upgrade.pro.user +++ b/kylin-background-upgrade.pro.user @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE QtCreatorProject> -<!-- Written by QtCreator 4.11.0, 2022-08-23T14:03:45. --> +<!-- Written by QtCreator 4.11.0, 2023-05-20T19:07:34. --> <qtcreator> <data> <variable>EnvironmentId</variable> - <value type="QByteArray">{3d34bcf0-6a81-46d0-90d9-4cc7667111f8}</value> + <value type="QByteArray">{d65ece66-fdbd-4e6d-96fa-dd17567c5b6f}</value> </data> <data> <variable>ProjectExplorer.Project.ActiveTarget</variable> @@ -54,19 +54,22 @@ </data> <data> <variable>ProjectExplorer.Project.PluginSettings</variable> - <valuemap type="QVariantMap"/> + <valuemap type="QVariantMap"> + <valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey"/> + <value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value> + </valuemap> </data> <data> <variable>ProjectExplorer.Project.Target.0</variable> <valuemap type="QVariantMap"> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">桌面</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">桌面</value> - <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{fb955230-392d-4c01-8fb0-8bfc9c0d7279}</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{93f11d50-6f62-41c4-8ce9-7bf187ad830b}</value> <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> - <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/lxy/kylin-background-upgrade/sp3/build-kylin-background-upgrade-unknown-Debug</value> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/lxy/project/kylin-background-upgrade/1.3.2.0/build-kylin-background-upgrade-unknown-Debug</value> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> @@ -114,7 +117,7 @@ <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> </valuemap> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> - <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/lxy/kylin-background-upgrade/sp3/build-kylin-background-upgrade-unknown-Release</value> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/lxy/project/kylin-background-upgrade/1.3.2.0/build-kylin-background-upgrade-unknown-Release</value> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> @@ -162,7 +165,7 @@ <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> </valuemap> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> - <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/lxy/kylin-background-upgrade/sp3/build-kylin-background-upgrade-unknown-Profile</value> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/lxy/project/kylin-background-upgrade/1.3.2.0/build-kylin-background-upgrade-unknown-Profile</value> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> @@ -282,8 +285,9 @@ </valuelist> <value type="int" key="PE.EnvironmentAspect.Base">2</value> <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> - <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/lxy/project/kylin-background-upgrade/openKylin/kylin-background-upgrade/kylin-background-upgrade.pro</value> - <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/lxy/project/kylin-background-upgrade/openKylin/kylin-background-upgrade/kylin-background-upgrade.pro</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">kylin-background-upgrade2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/lxy/project/kylin-background-upgrade/yhkylin-v101/kylin-background-upgrade/kylin-background-upgrade.pro</value> + <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/lxy/project/kylin-background-upgrade/yhkylin-v101/kylin-background-upgrade/kylin-background-upgrade.pro</value> <value type="QString" key="RunConfiguration.Arguments">--check-upgrade</value> <value type="bool" key="RunConfiguration.Arguments.multi">false</value> <value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value> @@ -294,7 +298,7 @@ <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> <value type="QString" key="RunConfiguration.WorkingDirectory"></value> - <value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/lxy/kylin-background-upgrade/sp3/build-kylin-background-upgrade-unknown-Debug</value> + <value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/lxy/project/kylin-background-upgrade/1.3.2.0/build-kylin-background-upgrade-unknown-Debug</value> </valuemap> <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> </valuemap> diff --git a/kylin-background-upgrade.pro.user.3d34bcf b/kylin-background-upgrade.pro.user.3d34bcf new file mode 100644 index 0000000..f026e3e --- /dev/null +++ b/kylin-background-upgrade.pro.user.3d34bcf @@ -0,0 +1,314 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE QtCreatorProject> +<!-- Written by QtCreator 4.11.0, 2022-08-23T14:03:45. --> +<qtcreator> + <data> + <variable>EnvironmentId</variable> + <value type="QByteArray">{3d34bcf0-6a81-46d0-90d9-4cc7667111f8}</value> + </data> + <data> + <variable>ProjectExplorer.Project.ActiveTarget</variable> + <value type="int">0</value> + </data> + <data> + <variable>ProjectExplorer.Project.EditorSettings</variable> + <valuemap type="QVariantMap"> + <value type="bool" key="EditorConfiguration.AutoIndent">true</value> + <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value> + <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value> + <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0"> + <value type="QString" key="language">Cpp</value> + <valuemap type="QVariantMap" key="value"> + <value type="QByteArray" key="CurrentPreferences">CppGlobal</value> + </valuemap> + </valuemap> + <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1"> + <value type="QString" key="language">QmlJS</value> + <valuemap type="QVariantMap" key="value"> + <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value> + </valuemap> + </valuemap> + <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value> + <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value> + <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value> + <value type="int" key="EditorConfiguration.IndentSize">4</value> + <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value> + <value type="int" key="EditorConfiguration.MarginColumn">80</value> + <value type="bool" key="EditorConfiguration.MouseHiding">true</value> + <value type="bool" key="EditorConfiguration.MouseNavigation">true</value> + <value type="int" key="EditorConfiguration.PaddingMode">1</value> + <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value> + <value type="bool" key="EditorConfiguration.ShowMargin">false</value> + <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> + <value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value> + <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> + <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> + <value type="int" key="EditorConfiguration.TabSize">8</value> + <value type="bool" key="EditorConfiguration.UseGlobal">true</value> + <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value> + <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value> + <value type="bool" key="EditorConfiguration.cleanIndentation">true</value> + <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value> + <value type="bool" key="EditorConfiguration.inEntireDocument">false</value> + </valuemap> + </data> + <data> + <variable>ProjectExplorer.Project.PluginSettings</variable> + <valuemap type="QVariantMap"/> + </data> + <data> + <variable>ProjectExplorer.Project.Target.0</variable> + <valuemap type="QVariantMap"> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">桌面</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">桌面</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{fb955230-392d-4c01-8fb0-8bfc9c0d7279}</value> + <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> + <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> + <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/lxy/kylin-background-upgrade/sp3/build-kylin-background-upgrade-unknown-Debug</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/lxy/kylin-background-upgrade/sp3/build-kylin-background-upgrade-unknown-Release</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/lxy/kylin-background-upgrade/sp3/build-kylin-background-upgrade-unknown-Profile</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> + <value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value> + <valuelist type="QVariantList" key="Analyzer.Perf.Events"> + <value type="QString">cpu-cycles</value> + </valuelist> + <valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/> + <value type="int" key="Analyzer.Perf.Frequency">250</value> + <valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments"> + <value type="QString">-e</value> + <value type="QString">cpu-cycles</value> + <value type="QString">--call-graph</value> + <value type="QString">dwarf,4096</value> + <value type="QString">-F</value> + <value type="QString">250</value> + </valuelist> + <value type="QString" key="Analyzer.Perf.SampleMode">-F</value> + <value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value> + <value type="int" key="Analyzer.Perf.StackSize">4096</value> + <value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value> + <value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value> + <value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value> + <value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value> + <value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> + <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> + <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> + <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> + <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> + <value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value> + <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> + <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> + <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> + <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> + <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> + <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> + <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> + <value type="int">0</value> + <value type="int">1</value> + <value type="int">2</value> + <value type="int">3</value> + <value type="int">4</value> + <value type="int">5</value> + <value type="int">6</value> + <value type="int">7</value> + <value type="int">8</value> + <value type="int">9</value> + <value type="int">10</value> + <value type="int">11</value> + <value type="int">12</value> + <value type="int">13</value> + <value type="int">14</value> + </valuelist> + <value type="int" key="PE.EnvironmentAspect.Base">2</value> + <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/lxy/project/kylin-background-upgrade/openKylin/kylin-background-upgrade/kylin-background-upgrade.pro</value> + <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/lxy/project/kylin-background-upgrade/openKylin/kylin-background-upgrade/kylin-background-upgrade.pro</value> + <value type="QString" key="RunConfiguration.Arguments">--check-upgrade</value> + <value type="bool" key="RunConfiguration.Arguments.multi">false</value> + <value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value> + <value type="bool" key="RunConfiguration.UseCppDebugger">false</value> + <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> + <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value> + <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> + <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> + <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> + <value type="QString" key="RunConfiguration.WorkingDirectory"></value> + <value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/lxy/kylin-background-upgrade/sp3/build-kylin-background-upgrade-unknown-Debug</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> + </valuemap> + </data> + <data> + <variable>ProjectExplorer.Project.TargetCount</variable> + <value type="int">1</value> + </data> + <data> + <variable>ProjectExplorer.Project.Updater.FileVersion</variable> + <value type="int">22</value> + </data> + <data> + <variable>Version</variable> + <value type="int">22</value> + </data> +</qtcreator> diff --git a/src/core.cpp b/src/core.cpp index 00dc303..269318f 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -11,7 +11,7 @@ core::core(QString getnum, QWidget *parent) core::~core() { - + qDebug() << Q_FUNC_INFO << __LINE__; } void core::execSlots() diff --git a/src/main.cpp b/src/main.cpp index 4ec6e8d..631f621 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,42 +6,50 @@ #include <iostream> #include <ukui-log4qt.h> #include<qdebug.h> +#include <QLockFile> #define PROGRAM_NAME "kylin-background-upgrade" +#define LOG_NAME "/.config/kylin-background-upgrade/kylin-background-upgrade.log" +#define LOG_SILENT_NAME "/.config/kylin-background-upgrade/kylin-background-upgrade-silent.log" +#define LOG_MANUL_NAME "/.config/kylin-background-upgrade/kylin-background-upgrade-manul.log" static FILE *fp = NULL; +QString toDir; +static bool _silentOrManul = true; void msgHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg) { static char logPath[255] = {0}; - static int uid = -1; + int uid = -1; + static int pid = 0; Q_UNUSED(context); QDateTime currentTime = QDateTime::currentDateTime(); QString timeStr = currentTime.toString("yy.MM.dd hh:mm:ss +zzz"); - + pid = (int)getpid(); + uid = (int)getuid(); // 获取用于控制命令行输出的环境变量 - char *ctrlEnv = getenv("XXXX_DEBUG"); + char *ctrlEnv = getenv("BACKGROUND_UPGRADE_DEBUG"); QString env; // 格式化输出字符串,添加消息发生时间、消息等级 QString outMsg; switch (type) { case QtDebugMsg: - outMsg = QString("[%1 D]: %2").arg(timeStr).arg(msg); + outMsg = QString("[%1 D .%2 :%4]: %3").arg(timeStr).arg(pid).arg(msg).arg(uid); break; case QtInfoMsg: - outMsg = QString("[%1 I]: %2").arg(timeStr).arg(msg); + outMsg = QString("[%1 D .%2 :%4]: %3").arg(timeStr).arg(pid).arg(msg).arg(uid); break; case QtWarningMsg: - outMsg = QString("[%1 W]: %2").arg(timeStr).arg(msg); + outMsg = QString("[%1 D .%2 :%4]: %3").arg(timeStr).arg(pid).arg(msg).arg(uid); break; case QtCriticalMsg: - outMsg = QString("[%1 C]: %2").arg(timeStr).arg(msg); + outMsg = QString("[%1 D .%2 :%4]: %3").arg(timeStr).arg(pid).arg(msg).arg(uid); break; case QtFatalMsg: - outMsg = QString("[%1 F]: %2").arg(timeStr).arg(msg); + outMsg = QString("[%1 D .%2 :%4]: %3").arg(timeStr).arg(pid).arg(msg).arg(uid); } if (fp != NULL) { @@ -64,31 +72,43 @@ void msgHandler(QtMsgType type, const QMessageLogContext& context, const QString abort(); } -void log_env_init(){ +void log_env_init(QString arg){ static int uid = -1; - static char logPath[255] = {0}; + static char logPath[98] = {0}; bool _is_root = false; + toDir = QDir::homePath(); + toDir += "/.config/kylin-background-upgrade/"; + QDir dir(toDir); + if(!dir.exists()) { + dir.mkdir(toDir); + } // 初始执行时,设置log文件路径 if (uid == -1) { uid = getuid(); - } if (uid == 0) { // root user - sprintf(logPath, "/var/log/kylin-background-upgrade/kylin-background-upgrade.log", uid, PROGRAM_NAME); + sprintf(logPath, "/var/log/kylin-background-upgrade/kylin-background-upgrade.log"); _is_root = true; } else { // normal user - sprintf(logPath, "/run/user/%d/%s.log", uid, PROGRAM_NAME); + // sprintf(logPath, "/run/user/%d/%s.log", uid, PROGRAM_NAME); + //QString 转 const char* + std::string str = QDir::homePath().toStdString(); + const char* ch = str.c_str(); + if (arg == "--check-upgrade" || arg == "--check-immediately") { + sprintf(logPath, "%s%s", ch, LOG_MANUL_NAME); + } else { + sprintf(logPath, "%s%s", ch, LOG_SILENT_NAME); + } } - printf("Logfile path: %s\n", logPath); if (access(logPath, F_OK|W_OK) == 0) { // log文件存在且可写 if (fp == NULL) fp = fopen(logPath, "a+"); QFileInfo info(logPath); - if (info.size() > 1024*1024*200) { //200MB + if (info.size() > 1024*1024*20) { //20MB fclose(fp); fp = NULL; QFile fileclean(logPath); fileclean.open(QIODevice::WriteOnly | QIODevice::Text | QFile::Truncate); @@ -123,32 +143,47 @@ void log_env_init(){ int main(int argc, char *argv[]) { QString arg=QString::fromLatin1(argv[1]); -// initUkuiLog4qt("kylin-background-upgrade"); - log_env_init(); + log_env_init(arg); qInstallMessageHandler(msgHandler); - char *x=getenv("DISPLAY"); + char *dis_env=getenv("DISPLAY"); + QString display_env(dis_env); + if(display_env != NULL){ + qDebug()<<"The desktop graphics environment is normal, DISPLAY="<<dis_env; + } else { + qDebug()<<"The desktop graphics environment is abnormal, DISPLAY="<<dis_env<<", exit!"; + exit(0); + } + QLockFile manul_lock(toDir+"manul.lock"); + QLockFile silent_lock(toDir+"silent.lock"); qDebug()<<""; qDebug()<<"---------------------------------------------------------------------------------------------------"; - qDebug()<<"Start check upgradable ..."; - - QString s1(x); - if(s1 != NULL){ - qDebug()<<"The desktop graphics environment is normal ."; + if (arg == "--check-upgrade" || arg == "--check-immediately") { + qDebug()<<"Start check upgradable ..."; + if (arg == "--check-immediately") { + qDebug()<<"Perform a boot update check ..."; + } + if (!manul_lock.tryLock(0)) { + qDebug()<<"Another process is checking for updates, exit!"; + exit(0); + } } else { - qDebug()<<"The desktop graphics environment is abnormal ."; - putenv("DISPLAY=:0"); + qDebug()<<"Start silent upgrade ..."; + if (!silent_lock.tryLock(0)) { + qDebug()<<"Another process is silently upgrading, exit!"; + exit(0); + } } + #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); #endif -// callPyFunc *lxy = new callPyFunc(); setenv("QT_QPA_PLATFORMTHEME","ukui",true); qunsetenv("SESSION_MANAGER"); QApplication a(argc, argv); - core *m_core= new core(arg); + core m_core(arg); // QObject::connect(m_core,SIGNAL(execSignal()),&a,SLOT(quit())); return a.exec(); } diff --git a/src/traydbus.cpp b/src/traydbus.cpp index 9d44cd5..7618f0d 100644 --- a/src/traydbus.cpp +++ b/src/traydbus.cpp @@ -70,12 +70,12 @@ source_dbus::source_dbus(QObject *parent) :QObject(parent) { connectTimer = new QTimer(this); -// connect(connectTimer, SIGNAL(timeout()), this, SLOT(connectDbus())); + connect(connectTimer, SIGNAL(timeout()), this, SLOT(connectDbus())); } source_dbus::~source_dbus() { - + qDebug() << Q_FUNC_INFO << __LINE__; } /** @@ -164,7 +164,7 @@ update_dbus* update_dbus::getInstance() update_dbus::update_dbus(QObject *parent) :QObject(parent) { -// initUpdate_Dbus(); + initUpdate_Dbus(); } @@ -270,17 +270,9 @@ QStringList update_dbus::checkForUpdates(QStringList arg) bool update_dbus::checkForUpdateDect() { qDebug()<<"Start to check system upgrade ..."; -// connect(interface,SIGNAL(UpdateDetectFinished(bool, QStringList, QString, QString)),this,SLOT(UpdateDectSlot(bool, QStringList, QString, QString))); -// QDBusReply<QVariantList> res = interface->call("UpdateDetect"); -// QProcess process; -// process.start("/home/lxy/kylin-background-upgrade/OpenKylin/kylin-background-upgrade/checkUpdate.py"); -// process.waitForStarted(); -// process.waitForFinished();//以阻塞的方式等待释放 -// QStringList updatelists; -// updatelists.append("kylin-video"); -// QString errorcode = ""; -// QString errorstring = ""; -// UpdateDectSlot(true,updatelists,errorcode, errorstring); + connect(interface,SIGNAL(UpdateDetectFinished(bool, QStringList, QString, QString)),this,SLOT(UpdateDectSlot(bool, QStringList, QString, QString))); + QDBusReply<QVariantList> res = interface->asyncCall("UpdateDetect"); + qDebug() << "UpdateDetect (mode: MODE_UPDATE_DETECT) ..."; return true; } diff --git a/src/traydbus.h b/src/traydbus.h index 4772831..795f869 100644 --- a/src/traydbus.h +++ b/src/traydbus.h @@ -11,7 +11,7 @@ #include <QDebug> #include <QFile> #include <QMutexLocker> -#include <QProcess> + #include <sys/stat.h> #include <unistd.h> diff --git a/src/updatehandle.cpp b/src/updatehandle.cpp index e3a8eee..473bc55 100644 --- a/src/updatehandle.cpp +++ b/src/updatehandle.cpp @@ -1,5 +1,6 @@ #include "updatehandle.h" #include <iostream> +#include <QProcess> updatehandle::updatehandle(QString getnum1,QWidget *parent) : QWidget(parent) { @@ -14,7 +15,7 @@ updatehandle::updatehandle(QString getnum1,QWidget *parent) : QWidget(parent) updatehandle::~updatehandle() { - + qDebug() << Q_FUNC_INFO << __LINE__; } /** @@ -73,16 +74,31 @@ void updatehandle::initUI(QString argnum) timerDownload = new QTimer(this); connect(timerDownload, SIGNAL(timeout()), this, SLOT(downloadTimeout())); + if(argnum.contains("--check-immediately")){ + qDebug()<<"exec --check-immediately"; + } else if(argnum.contains("--check-upgrade")) { + qDebug()<<"exec --check-upgrade"; + } else { + qDebug()<<"exec slient."; + } + trayIcon = new trayicon(this); - choice_window = new updatewidget();//更新选择页面 + bool ignore_or_delay = ignoreOrDelay(argnum.contains("--check-immediately",Qt::CaseInsensitive)); + choice_window = new updatewidget(ignore_or_delay);//更新选择页面 tip_window = new updateTip(); //静默升级提示 - if (argnum.contains("--check-upgrade",Qt::CaseInsensitive)) { + if (argnum == "") { + //监听连接源管理器d-bus + //监听托盘点击事件,3:单击,2:双击,1:右键 + connect(trayIcon,&trayicon::activated, this,&updatehandle::onActivated); + connect(m_sourceMutual,&source_dbus::ready,this,&updatehandle::getTemplateList); + m_sourceMutual->connectDbus(); + } else if (argnum.contains("--check-upgrade",Qt::CaseInsensitive)||ignore_or_delay) { //连接关闭功能槽函数 connect(choice_window,&updatewidget::disAgreeBtnSignals,this,&updatehandle::execslots); - UpdateDectCheck(); + UpdateDectCheck(ignore_or_delay); } else { - qDebug()<<"no --check-upgrade, exit."; + qDebug()<<"No update,exit!"; exit(0); } } @@ -97,7 +113,7 @@ void updatehandle::tray_Show() if (!m_updateMutual->listenState()) { if (m_getsql()) { qDebug()<<"m_getsql 的值为true"; - choice_window->update_lab->setText(tr("System update detected")); + choice_window->update_lab->setText(tr("System update")); if (argnum != "update") { choice_window->show(); } @@ -203,8 +219,10 @@ void updatehandle::getTemplateList() QString str2; QStringList m_crucial; QFile file1("/var/lib/kylin-software-properties/template/crucial.list"); - if (!file1.open(QIODevice::ReadOnly | QIODevice::Text)) - return ; + if (!file1.open(QIODevice::ReadOnly | QIODevice::Text)){ + qDebug()<<"cat not open file crucial.list"; + exit(0); + } while (!file1.atEnd()) { QByteArray line = file1.readLine(); str1 += QString(line); @@ -216,8 +234,10 @@ void updatehandle::getTemplateList() QStringList m_important; QFile file2("/var/lib/kylin-software-properties/template/important.list"); - if (!file2.open(QIODevice::ReadOnly | QIODevice::Text)) - return ; + if (!file2.open(QIODevice::ReadOnly | QIODevice::Text)) { + qDebug()<<"cat not open file important.list"; + exit(0); + } while (!file2.atEnd()) { QByteArray line = file2.readLine(); str2 += QString(line); @@ -289,6 +309,7 @@ void updatehandle::handleCrucial(QStringList checkCrucialAll) for (int i=1;i<checkCrucialAll.count();i+=2) { crucialPackageSize.append(checkCrucialAll.at(i)); } + checkCrucial = crucialPackage; qDebug()<<"Checking for inactivity in silent upgrading ..."; timerDownload->start(20*60*1000); if (powerState) { //判断是否获取到电量 @@ -312,31 +333,31 @@ void updatehandle::handleCrucial(QStringList checkCrucialAll) notify_send(tr("The system is updating silently")); trayIcon->setVisible(true); qDebug()<<"The system is updating silently ..."; -// m_updateMutual->installAndUpgrade(crucialPackage); + m_updateMutual->installAndUpgrade(crucialPackage); } } } /** - * @brief updatehandle::handleImportant + * @brief updatehandle::UpdateDectSlot * 处理可选升级包 */ -void updatehandle::UpdateDectSlot() +void updatehandle::UpdateDectSlot(bool status,QStringList list,QString errorstring,QString errorcode) { -// if (!status) { -//// qDebug() << "Update Detect failed: " << QString("%1 %2").arg(errorstring).arg(errorcode); -// exit(0); -// } else { -// if (list.length() == 0) { -// qDebug() << "The software on this computer is up to date, exit!"; -// exit(0); -// } else { - choice_window->update_lab->setText(tr("System update detected")); + if (!status) { + qDebug() << "Update Detect failed: " << QString("%1 %2").arg(errorstring).arg(errorcode); + exit(0); + } else { + if (list.length() == 0) { + qDebug() << "The software on this computer is up to date, exit!"; + exit(0); + } else { + choice_window->update_lab->setText(tr("System update")); if (argnum != "update") { choice_window->show(); } -// } -// } + } + } //完成检测,刷新下次更新标志位 timersetting->beginGroup(QString::fromLocal8Bit("Timer")); timersetting->setValue("GeneratRandomTime",true); @@ -349,31 +370,11 @@ void updatehandle::UpdateDectSlot() * @brief updatehandle::UpdateDectCheck * 处理可选升级包 */ -void updatehandle::UpdateDectCheck() +void updatehandle::UpdateDectCheck(bool _check_immediately) { //判断是否有系统更新 -// if(!checktime()){ - qDebug()<<"wait for upgrade ..."; -// connect(m_updateMutual,&update_dbus::UpdateDectFinished,this,&updatehandle::UpdateDectSlot); - QDBusConnection::systemBus().connect(QString(),QString("/"),"com.kylin.update.notification","DownloadFinish",this,SLOT(UpdateDectSlot())); -// bool ret= m_updateMutual->checkForUpdateDect(); -// } else { -// qDebug()<<"The scheduled time is not reached, exit."; -// exit(0); -// } -} - -/** - * @brief updatehandle::handleImportant - * 处理可选升级包 - */ -void updatehandle::handleImportant() -{ - //判断是否需要检查系统更新 - - if(checktime()){ - if (!m_updateMutual->listenState()) { - if (m_getsql()) { + if(checktime() || !RandomizedExecute || _check_immediately){ + if (m_getsql() || _check_immediately) { qDebug()<<"Detection update has been opened ..."; connect(m_updateMutual,&update_dbus::UpdateDectFinished,this,&updatehandle::UpdateDectSlot); bool ret= m_updateMutual->checkForUpdateDect(); @@ -382,13 +383,48 @@ void updatehandle::handleImportant() exit(0); } } else { - qDebug()<<"更新管理器已运行,程序退出"; + qDebug()<<"The scheduled time is not reached, exit."; exit(0); } +} + + +/** + * @brief updatehandle::ignoreOrDelays + * 处理可选升级包 + */ +bool updatehandle::ignoreOrDelay(bool mode) +{ + static char flagPath[64] = {0}; + sprintf(flagPath, "/var/cache/kylin-update-manager/ignoreOrDelay"); + bool ignore_or_delay = false; + QFile file(flagPath); + + //判断是否完成第一步更新 + if (access(flagPath, F_OK) == 0) { // flag文件存在且可写 + qDebug()<<flagPath<<"is found!"; + + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) + ignore_or_delay = false; + QByteArray line = file.readLine(); + if(QString(line).contains("2107",Qt::CaseInsensitive)) { + ignore_or_delay = true; + qDebug()<<"The first step of the upgrade has been completed, Detection of the second step of the upgrade! [2107]"; +// //需要清空文件 +// file.close(); +// file.open(QIODevice::Truncate); +// file.close(); +// file.open(QIODevice::WriteOnly); + } else if (QString(line).contains("2203",Qt::CaseInsensitive)) { + ignore_or_delay = true; + qDebug()<<"The first step of the upgrade has been completed, Detection of the second step of the upgrade! [2203]"; + } } else { - qDebug()<<"The scheduled time is not reached, exit."; - exit(0); + qDebug()<<flagPath<<"isn't found!"; + ignore_or_delay = false; } + file.close(); + return ignore_or_delay&&mode; } /** @@ -464,10 +500,14 @@ void updatehandle::d_busStatus(QString arg,int32_t args,QString state) void updatehandle::InstallFinsih(bool state,QStringList pkgname,QString error,QString reason) { + bool _check_status; timerDownload->stop(); - if(state){ + //apt返回失败时判断是否安装成功 + if (!state) + _check_status = package_installation_status(checkCrucial); + + if(state || _check_status){ qDebug() << "Silent upgrade is complete, exit."; -// qDebug() << (tr("The system has completed an important update, It is recommended that you restart immediately.")); notify_send(tr("The system has completed an important update, It is recommended that you restart immediately.")); }else{ QString errorstate = tr("update error"); @@ -481,16 +521,56 @@ void updatehandle::InstallFinsih(bool state,QStringList pkgname,QString error,QS exit(0); } +bool updatehandle::package_installation_status(QStringList pkgs) +{ + QString pkgname; + QString cmd; + QProcess process; + bool status,status_single; + for (QStringList::iterator it = pkgs.begin(); it != pkgs.end(); ++it) { + pkgname = *it; + status_single = false; + cmd = QString("dpkg -l %1").arg(pkgname); + process.start(cmd); + process.waitForFinished(); + QByteArray result_ = process.readAllStandardOutput(); + if (QString::fromLocal8Bit(result_) != "") { + QStringList rets = QString::fromLocal8Bit(result_).split(QRegExp("[\n]"),QString::SkipEmptyParts); + for (QStringList::iterator it_ret = rets.begin(); it_ret != rets.end(); ++it_ret) { + QString ret; + ret = *it_ret; + if (ret.contains(pkgname) && ret.startsWith("ii")) { + status_single = true; + qDebug() << "pkg "<<pkgname<<",Installation succeeded."; + } + } + if (!status_single) { //install failed + status = false; + break; + } + } else { + status = false; + break; + } + if (status_single) + status = true; + } + return status; +} + /** * @brief updatehandle::execslots * 关闭界面槽函数 */ void updatehandle::execslots() { - choice_window->comboBox->setCurrentIndex(0); - choice_window->hide(); - qDebug()<<"Hide choice_window."; -// emit execSignal(); + //设置推迟检测,更新标志位 + timersetting->beginGroup(QString::fromLocal8Bit("Timer")); + timersetting->setValue("CheckCompleted",false); + timersetting->setValue("GeneratRandomTime",false); + timersetting->sync(); + timersetting->endGroup(); + emit execSignal(); } /** diff --git a/src/updatehandle.h b/src/updatehandle.h index 49ebe77..9eb4250 100644 --- a/src/updatehandle.h +++ b/src/updatehandle.h @@ -86,7 +86,9 @@ public: void readconf(); //读取配置文件 int _secsTo(QString,QString); //时间差 void getpower(); //获取电量值 - void UpdateDectCheck(); //调用后端UpdateDetect + void UpdateDectCheck(bool); //调用后端UpdateDetect + bool ignoreOrDelay(bool mode); //是否开机检查检查弹窗 + bool package_installation_status(QStringList); signals: void execSignal(); //关闭窗口信号 @@ -97,7 +99,7 @@ protected slots: void d_busStatus(QString,int32_t,QString); //判断下载状态的槽函数 void InstallFinsih(bool,QStringList,QString,QString); //状态槽函数 void downloadTimeout(); //延时检测下载状态 - void UpdateDectSlot(); //updatedetect回调函数 + void UpdateDectSlot(bool,QStringList,QString,QString); //updatedetect回调函数 }; #endif // TRAY_H diff --git a/src/updatewidget.cpp b/src/updatewidget.cpp index ebd7c81..a075e62 100644 --- a/src/updatewidget.cpp +++ b/src/updatewidget.cpp @@ -1,6 +1,8 @@ #include "updatewidget.h" #include "ui_updatewidget.h" #include <QPainterPath> +#include <QToolTip> +#include <QHoverEvent> #define PANEL_DBUS_SERVICE "com.ukui.panel.desktop" #define PANEL_DBUS_PATH "/" #define PANEL_DBUS_INTERFACE "com.ukui.panel.desktop" @@ -10,7 +12,7 @@ #define DBUS_PATH "/org/ukui/SettingsDaemon/wayland" #define DBUS_INTERFACE "org.ukui.SettingsDaemon.wayland" -updatewidget::updatewidget(QWidget *parent) : +updatewidget::updatewidget(bool check_Tips, QWidget *parent) : QWidget(parent), ui(new Ui::Form) { @@ -30,68 +32,166 @@ updatewidget::updatewidget(QWidget *parent) : GetsAvailableAreaScreen(); qDebug()<<"wayland"; } - + _check_Tips = check_Tips; //设置任务栏无显示 setWindowFlags(Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint); setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); update_lab = new QLabel(); + icon_lab = new QLabel(); + tip_lab = new QLabel(); - tip_lab->setText(tr("at")); - tip_lab1 = new QLabel(); - tip_lab1->setText(tr("No reminders")); - agreebtn = new QPushButton(); - disagreebtn = new QPushButton(); + tip_lab->setText(tr(" Updatable app detected on your system!")); + agreebtn = new FixButton(); + delaybtn = new FixButton(); + window_close = new QPushButton(this); + + window_close->setIcon(QIcon::fromTheme("window-close-symbolic")); + window_close->setProperty("isWindowButton", 0x2); + window_close->setProperty("useIconHighlightEffect", 0x8); + window_close->setFlat(true); + window_close->setToolTip(tr("Close")); + window_close->installEventFilter(this); + connect(window_close, &QPushButton::clicked, this, &updatewidget::onClick_close_btn); + + QPixmap icon(QIcon::fromTheme("ukui-control-center").pixmap(QSize(26,26))); m_pfirstlayout = new QVBoxLayout(); m_labellayout = new QHBoxLayout(); m_psecondlayout = new QHBoxLayout(); m_pselectlayout = new QHBoxLayout(); - comboBox = new QComboBox(); comboBox->clear(); - strList<<tr("In 30 minutes")<<tr("three hours later")<<tr("one day later"); + strList<<tr("30 minutes later")<<tr("1 hour later")<<tr("5 hours later")<<tr("1 day later")<<tr("3 days later"); comboBox->addItems(strList); + comboBox->installEventFilter(this); labelwidget = new QWidget(); - statwidget = new QWidget(); selectWidget = new QWidget(); + statwidget = new QWidget(); - agreebtn->setText(tr("Update")); - disagreebtn->setText(tr("Delay")); + agreebtn->setText(tr("Update"),1); + agreebtn->installEventFilter(this); + delaybtn->setText(tr("Delay"),1); + delaybtn->installEventFilter(this); connect(agreebtn,&QPushButton::clicked,this,&updatewidget::agreeBtnClicked); - connect(disagreebtn,&QPushButton::clicked,this,&updatewidget::disAgreeBtnClicked); - + connect(comboBox,SIGNAL(activated(int)),this,SLOT(comboBoxClicked(int))); + connect(delaybtn,&QPushButton::clicked,this,&updatewidget::delayBtnClicked); + icon_lab->setPixmap(icon); + icon_lab->setScaledContents(true); + icon_lab->setMaximumSize(26,26); + update_lab->setMaximumHeight(26); + update_lab->setContentsMargins(0,0,0,3); + window_close->setFixedSize(24,24); + window_close->setContentsMargins(0,0,0,3); + m_labellayout->addWidget(icon_lab); m_labellayout->addWidget(update_lab); + m_labellayout->addStretch(); + m_labellayout->addWidget(window_close); + m_labellayout->setContentsMargins(0,0,0,20); labelwidget->setLayout(m_labellayout); m_pselectlayout->addWidget(tip_lab); - m_pselectlayout->addWidget(comboBox); - m_pselectlayout->addWidget(tip_lab1); - m_pselectlayout->addStretch(); + m_pselectlayout->setContentsMargins(0,0,0,25); selectWidget->setLayout(m_pselectlayout); - - m_psecondlayout->addWidget(disagreebtn); + m_psecondlayout->addStretch(); + comboBox->setFixedHeight(35); + comboBox->setMinimumWidth(135); + comboBox->setMaximumWidth(155); + agreebtn->setFixedSize(100,35); + if (_check_Tips) + m_psecondlayout->addWidget(delaybtn); + else + m_psecondlayout->addWidget(comboBox); m_psecondlayout->addWidget(agreebtn); + m_psecondlayout->setSpacing(15); //set space between comboBox and btn + m_psecondlayout->setContentsMargins(0,0,12,12); statwidget->setLayout(m_psecondlayout); m_pfirstlayout->addWidget(labelwidget); m_pfirstlayout->addWidget(selectWidget); m_pfirstlayout->addWidget(statwidget); - this->setLayout(m_pfirstlayout); - this->setAttribute(Qt::WA_TranslucentBackground); - this->setFixedSize(330,180); + m_pfirstlayout->setSpacing(2); + this->setLayout(m_pfirstlayout); + this->setFixedSize(435,160); + +// QGSettings *settings; +// if(QGSettings::isSchemaInstalled("org.ukui.style")){ +// settings = new QGSettings("org.ukui.style"); +// connect(settings,&QGSettings::changed,this,&ActiveConnectionWidget::GSettingsChanges); +// } + +// const QByteArray transparency_id(TRANSPARENCY_SETTINGS); +// if(QGSettings::isSchemaInstalled(transparency_id)) { +// transparency = new QGSettings(transparency_id); +// } +// if(QGSettings::isSchemaInstalled(transparency_id)) { +// getTransparency(); +// connect(transparency,&QGSettings::changed,this,&ActiveConnectionWidget::GSettingsChanges); +// } + + this->setProperty("useStyleWindowManager", false); + this->setProperty("useSystemStyleBlur", true); + this->setAttribute(Qt::WA_TranslucentBackground, true); + this->setWindowOpacity(0.9); + +// labelwidget->setStyleSheet("background-color:green;"); +// update_lab->setStyleSheet("background-color:blue;"); +// selectWidget->setStyleSheet("background-color:red;"); +// statwidget->setStyleSheet("background-color:orange;"); +// comboBox->setStyleSheet("background-color:violet;"); +// agreebtn->setStyleSheet("background-color:yellow;"); } updatewidget::~updatewidget() { + qDebug() << Q_FUNC_INFO << __LINE__; delete ui; } +void updatewidget::onClick_close_btn() +{ + // emit disAgreeBtnSignals(); + qDebug()<<"User Cancel reminder, exit tray program!"; + // exit(0); + qApp->quit(); +} + +/** + * @brief updatewidget::eventFilter + * 事件过滤器 + */ +bool updatewidget::eventFilter(QObject *obj, QEvent *event) +{ + if (obj == this->window_close) { //指定window_close + if (event->type() == QEvent::HoverMove) { + QPushButton *close_btn = qobject_cast<QPushButton *>(obj); + if (close_btn) { + QToolTip::showText(QCursor::pos(), close_btn->toolTip()); + } + } + } else if (obj == this->agreebtn || obj == this->delaybtn) { + if (event->type() == QEvent::HoverMove) { + FixButton *btn = qobject_cast<FixButton *>(obj); + if (btn) { + QToolTip::showText(QCursor::pos(), btn->toolTip()); + } + } + } else if (obj == this->comboBox) { + if (event->type() == QEvent::HoverMove) { + QComboBox *comboBox = qobject_cast<QComboBox *>(obj); + if (comboBox) { + QToolTip::showText(QCursor::pos(), comboBox->toolTip()); + } + } + } + return QWidget::eventFilter(obj, event); +} + /** * @brief updatewidget::initPanelDbusGsetting * 初始化与任务栏gsetting和dbus @@ -181,26 +281,26 @@ void updatewidget::GetsAvailableAreaScreen() { case updatewidget::PanelDown : { - this->setGeometry(m_nScreenWidth - 340,m_nScreenHeight - h - 190,300,150-100); - qDebug()<<"Taskbar coordinates: [ '"<<m_nScreenWidth-340<<"','"<< m_nScreenHeight-h-190<<"','"<<300<<"','"<<150 - 100<<"']"; + this->setGeometry(m_nScreenWidth - 445,m_nScreenHeight - h - 170,300,150-100); + qDebug()<<"Taskbar coordinates: [ '"<<m_nScreenWidth-445<<"','"<< m_nScreenHeight-h-170<<"','"<<300<<"','"<<150 - 100<<"']"; } break; case updatewidget::PanelUp: { - this->setGeometry(m_nScreenWidth - 340,m_nScreenHeight - 190,300,150-100); - qDebug()<<"任务栏在上方: 显示坐标为: "<<m_nScreenWidth - 340 << m_nScreenHeight - 190 << 300 << 150 - 100; + this->setGeometry(m_nScreenWidth - 445,m_nScreenHeight - 170,300,150-100); + qDebug()<<"任务栏在上方: 显示坐标为: "<<m_nScreenWidth - 445 << m_nScreenHeight - 170 << 300 << 150 - 100; } break; case updatewidget::PanelLeft: { - this->setGeometry(m_nScreenWidth - 340,m_nScreenHeight - 190,300,150-100); - qDebug()<<"任务栏在左侧: 显示坐标为: "<<m_nScreenWidth - 340 << m_nScreenHeight - 190 << 300 << 150 - 100; + this->setGeometry(m_nScreenWidth - 445,m_nScreenHeight - 170,300,150-100); + qDebug()<<"任务栏在左侧: 显示坐标为: "<<m_nScreenWidth - 445 << m_nScreenHeight - 170 << 300 << 150 - 100; } break; case updatewidget::PanelRight: { - this->setGeometry(m_nScreenWidth - 340 - h,m_nScreenHeight - 190,300,150-100); - qDebug()<<"任务栏在右侧: 显示坐标为: "<<m_nScreenWidth - 340 - h << m_nScreenHeight - 190 << 300 << 150 - 100; + this->setGeometry(m_nScreenWidth - 445 - h,m_nScreenHeight - 170,300,150-100); + qDebug()<<"任务栏在右侧: 显示坐标为: "<<m_nScreenWidth - 445 - h << m_nScreenHeight - 170 << 300 << 150 - 100; } break; default: @@ -289,20 +389,20 @@ void updatewidget::set_window_position() m = getTaskbarHeight("height"); if(n == 0){ //任务栏在下侧 - this->setGeometry(priWid-330-distance,availableHeight-180-m-distance,this->width(),this->height()); - qDebug()<<"任务栏在下侧"<<priWid-330-distance<<" "<<availableHeight-180-m-distance <<" "<<this->width()<<" "<<this->height(); + this->setGeometry(priWid-435-distance,availableHeight-160-m-distance,this->width(),this->height()); + qDebug()<<"任务栏在下侧"<<priWid-435-distance<<" "<<availableHeight-160-m-distance <<" "<<this->width()<<" "<<this->height(); }else if(n == 1){ //任务栏在上侧 - this->setGeometry(priWid-330-distance,availableHeight-180-distance,this->width(),this->height()); - qDebug()<<"任务栏在上侧"<<priWid-330-distance<<" "<<availableHeight-180-distance <<" "<<this->width()<<" "<<this->height(); + this->setGeometry(priWid-435-distance,availableHeight-160-distance,this->width(),this->height()); + qDebug()<<"任务栏在上侧"<<priWid-435-distance<<" "<<availableHeight-160-distance <<" "<<this->width()<<" "<<this->height(); } else if (n == 2){ //任务栏在左侧 - this->setGeometry(priWid-330-distance,availableHeight-180-distance,this->width(),this->height()); - qDebug()<<"任务栏在左侧"<<priWid-330-distance<<" "<<availableHeight-180-distance <<" "<<this->width()<<" "<<this->height(); + this->setGeometry(priWid-435-distance,availableHeight-160-distance,this->width(),this->height()); + qDebug()<<"任务栏在左侧"<<priWid-435-distance<<" "<<availableHeight-160-distance <<" "<<this->width()<<" "<<this->height(); } else if (n == 3){ //任务栏在右侧 - this->setGeometry(availableWidth-330-m-distance,availableHeight-180-distance,this->width(),this->height()); - qDebug()<<"任务栏在右侧"<<availableWidth-330-m-distance<<" "<<availableHeight-180-distance <<" "<<this->width()<<" "<<this->height(); + this->setGeometry(availableWidth-435-m-distance,availableHeight-160-distance,this->width(),this->height()); + qDebug()<<"任务栏在右侧"<<availableWidth-435-m-distance<<" "<<availableHeight-160-distance <<" "<<this->width()<<" "<<this->height(); } } @@ -313,53 +413,55 @@ void updatewidget::set_window_position() */ char *updatewidget::insideTime() { - qDebug()<<"Current index: "<<comboBox->currentText(); + qDebug()<<"current select: "<<this->comboBox->currentText(); QDateTime time = QDateTime::currentDateTime(); //获取系统现在的时间 QString str = time.toString("yyyy-MM-dd hh:mm:ss"); //设置显示格式 QByteArray str2char2 = str.toLatin1(); // must char *nowtime = str2char2.data(); - delayTimer = new QTimer(); - delayTimer_Checker = new QTimer(); - connect(delayTimer, SIGNAL(timeout()), this, SLOT(delayTimeout())); - connect(delayTimer_Checker, SIGNAL(timeout()), this, SLOT(delayTimeOutChecker())); + if(comboBox->currentText() == strList.at(0)) { + QDateTime time = QDateTime::currentDateTime(); //获取系统现在的时间 + QString str = time.toString("yyyy-MM-dd hh:mm:ss"); //设置显示格式 QDateTime bojb = QDateTime::fromString(str,"yyyy-MM-dd hh:mm:ss").addSecs(1800); QString str1 = bojb.toString("yyyy-MM-dd hh:mm:ss"); QByteArray str2char2 = str1.toLatin1(); // must nowtime = str2char2.data(); - delaytime = 1800; - delayTimer->start(delaytime * 1000); - delayTimer_Checker->start(60 * 1000); + return nowtime; } else if (comboBox->currentText() == strList.at(1)) { - QDateTime bojb = QDateTime::fromString(str,"yyyy-MM-dd hh:mm:ss").addSecs(3600 * 3); + QDateTime time = QDateTime::currentDateTime(); //获取系统现在的时间 + QString str = time.toString("yyyy-MM-dd hh:mm:ss"); //设置显示格式 + QDateTime bojb = QDateTime::fromString(str,"yyyy-MM-dd hh:mm:ss").addSecs(3600); QString str1 = bojb.toString("yyyy-MM-dd hh:mm:ss"); QByteArray str2char2 = str1.toLatin1(); // must nowtime = str2char2.data(); - delaytime = 3600 * 3; - delayTimer->start(delaytime * 1000); - delayTimer_Checker->start(60 * 1000); + return nowtime; + } else if (comboBox->currentText() == strList.at(2)) { + QDateTime time = QDateTime::currentDateTime(); //获取系统现在的时间 + QString str = time.toString("yyyy-MM-dd hh:mm:ss"); //设置显示格式 + QDateTime bojb = QDateTime::fromString(str,"yyyy-MM-dd hh:mm:ss").addSecs(18000); + QString str1 = bojb.toString("yyyy-MM-dd hh:mm:ss"); + QByteArray str2char2 = str1.toLatin1(); // must + nowtime = str2char2.data(); + return nowtime; + } else if (comboBox->currentText() == strList.at(3)) { + QDateTime time = QDateTime::currentDateTime(); //获取系统现在的时间 + QString str = time.toString("yyyy-MM-dd hh:mm:ss"); //设置显示格式 + QDateTime bojb = QDateTime::fromString(str,"yyyy-MM-dd hh:mm:ss").addDays(1); + QString str1 = bojb.toString("yyyy-MM-dd hh:mm:ss"); + QByteArray str2char2 = str1.toLatin1(); // must + nowtime = str2char2.data(); + return nowtime; + } else if (comboBox->currentText() == strList.at(4)) { + QDateTime time = QDateTime::currentDateTime(); //获取系统现在的时间 + QString str = time.toString("yyyy-MM-dd hh:mm:ss"); //设置显示格式 + QDateTime bojb = QDateTime::fromString(str,"yyyy-MM-dd hh:mm:ss").addDays(3); + QString str1 = bojb.toString("yyyy-MM-dd hh:mm:ss"); + QByteArray str2char2 = str1.toLatin1(); // must + nowtime = str2char2.data(); + return nowtime; } - qDebug()<<"delay trigger for: "<<delaytime; return nowtime; -} -/** - * @brief updatehandle::delayTimeout - * 延时超时函数 - */ -void updatewidget::delayTimeout() -{ - qDebug() << "delayTimeout, Redetect the update ..."; - delayTimer->stop(); - delayTimer_Checker->stop(); - QProcess p(0); - p.startDetached("/usr/share/kylin-update-notify/checkUpdate.py"); - p.waitForStarted(); -} - -void updatewidget::delayTimeOutChecker() -{ - qDebug()<< qSetFieldWidth(0) << "delayTimeoutChecker remainingTime: "<<delayTimer->remainingTime()/1000<<"s"; } /** @@ -369,19 +471,38 @@ void updatewidget::delayTimeOutChecker() void updatewidget::agreeBtnClicked() { emit agreeBtnSignals(); -// qDebug()<<"WifiButtonClickSlot is running"; + bool _is_2107 = true; + QFile file("/etc/os-release"); + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { + QString line; + QTextStream in(&file); + line = in.readLine(); + while(!line.isNull()) { + line = in.readLine(); + if(line.contains("KYLIN_RELEASE_ID")) { + _is_2107 = false; + } + } + } + file.close(); QProcess p(0); - p.startDetached("update-manager"); + if (_is_2107) { + p.startDetached("ukui-control-center --upgrade"); + qDebug()<<"exec --upgrade"; + } else { + p.startDetached("ukui-control-center -m upgrade"); + qDebug()<<"exec -m upgrade"; + } p.waitForStarted(); qDebug()<<"Open the control panel and start updating immediately, exit tray program!"; - this->hide(); + exit(0); } /** - * @brief updatewidget::disAgreeBtnClicked - * 延迟提醒按钮槽函数 + * @brief updatewidget::comboBoxClicked + * 推迟框槽函数 */ -void updatewidget::disAgreeBtnClicked() +void updatewidget::comboBoxClicked(int num) { //判断是否有kylin-background-upgrade目录,没有则创建 QString toDir = QDir::homePath(); @@ -398,7 +519,7 @@ void updatewidget::disAgreeBtnClicked() exit(0); } else { char *nowtime=insideTime(); - qDebug() << "nowtime "<<nowtime; + qDebug() << "current timing: "<<nowtime; timersettings = new QSettings(toDir,QSettings::IniFormat); timersettings->beginGroup(QString::fromLocal8Bit("Timer")); timersettings->setValue("CheckUpgradeTime",nowtime); @@ -406,8 +527,18 @@ void updatewidget::disAgreeBtnClicked() timersettings->endGroup(); } emit disAgreeBtnSignals(); - qDebug()<<"Delay updating the system."; -// exit(0); + qDebug()<<"Users do not update, exit tray program!"; + exit(0); +} + +/** + * @brief updatewidget::delayBtnClicked + * 延迟提醒,退出 + */ +void updatewidget::delayBtnClicked() +{ + qDebug() << "User deferred updates, exit!"; + exit(0); } /** @@ -434,6 +565,16 @@ void updatewidget::paintEvent(QPaintEvent *e) p.drawRoundedRect(opt.rect,12,12); setProperty("blurRegion",QRegion(path.toFillPolygon().toPolygon())); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); + + QFontMetrics fontMetrics(this->font()); + QString current_str = comboBox->currentText(); + int fontSize = fontMetrics.width(current_str); + int showTextSize = comboBox->width() - 32; + if (fontSize > showTextSize) { + QString elidedText = fontMetrics.elidedText(comboBox->currentText(), Qt::ElideRight, showTextSize); + comboBox->setItemText(comboBox->currentIndex(), elidedText); + comboBox->setToolTip(current_str); + } QWidget::paintEvent(e); } @@ -454,7 +595,9 @@ updateTip::updateTip(QWidget *parent) : tipLabel->setText(tr("The system is updating silently")); m_layout->addWidget(tipLabel); this->setLayout(m_layout); - this->setAttribute(Qt::WA_TranslucentBackground); + this->setProperty("useSystemStyleBlur", true); + this->setAttribute(Qt::WA_TranslucentBackground, true); + this->setWindowOpacity(0.9); } updateTip::~updateTip() @@ -489,3 +632,4 @@ void updateTip::paintEvent(QPaintEvent *e) QWidget::paintEvent(e); } + diff --git a/src/updatewidget.h b/src/updatewidget.h index 77f3983..27ee6f8 100644 --- a/src/updatewidget.h +++ b/src/updatewidget.h @@ -19,9 +19,10 @@ #include <QScreen> #include <QDBusReply> #include <QSettings> -#include <QTimer> #include <sys/stat.h> #include <unistd.h> +#include <QMouseEvent> +#include "Button/fixbutton.h" namespace Ui { class Form; @@ -32,7 +33,7 @@ class updatewidget : public QWidget Q_OBJECT public: - explicit updatewidget(QWidget *parent = nullptr); + explicit updatewidget(bool check_Tips, QWidget *parent = nullptr); ~updatewidget(); enum PanelStatePosition @@ -43,19 +44,20 @@ public: PanelRight }; + bool _check_Tips; QLabel *update_lab; + QLabel *icon_lab; QLabel *tip_lab; - QLabel *tip_lab1; - QTimer *delayTimer; - QTimer *delayTimer_Checker; - unsigned int delaytime; + QLabel *close_lab; - QPushButton *agreebtn; - QPushButton *disagreebtn; + FixButton *agreebtn; + FixButton *delaybtn; + QPushButton *window_close; QWidget *labelwidget; QWidget *statwidget; QWidget *selectWidget; QStringList strList; + QPixmap *icon; QVBoxLayout *m_pfirstlayout = nullptr; QHBoxLayout *m_labellayout = nullptr; @@ -82,9 +84,8 @@ public: void initset_window_position(); void listenPanelChange(); void initPanelDbusGsetting(); // 初始化与任务栏gsetting和dbus -public slots: - void delayTimeout(); - void delayTimeOutChecker(); + bool eventFilter(QObject *, QEvent *); // 添加事件过滤器声明 + private: Ui::Form *ui; void paintEvent(QPaintEvent *e); @@ -95,8 +96,9 @@ signals: protected slots: void agreeBtnClicked(); - void disAgreeBtnClicked(); - + void comboBoxClicked(int); + void delayBtnClicked(); + void onClick_close_btn(); }; diff --git a/translations/kylin-background-upgrade_bo_CN.qm b/translations/kylin-background-upgrade_bo_CN.qm index ced5ae65599d9983068fb2f55cf94d8ea9c26eeb..535b5f598f2ccb2f465ddce9b5d0c408cc5ef980 100644 GIT binary patch literal 2003 zcmd5-&1(}u6rUvKLy|HgC_Pv@)gmQWX($yBA~eQId#nAR2$s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^7xW z*e}_-P*tX|&u9;h$NRU0bHb!Unr!+Tv9O~h>hS9+hmB?Lj1sPFi5du`^<Tl@CgM?F zkb=>krPCauPqN+2ZST<m3s?=BI$RHOpv|X<V&IF}1}FsnX9*1<eWGE*!>+{Ogz;Gp SgDDPCV<bXyQ`Kr+9-ja^tvE&i diff --git a/translations/kylin-background-upgrade_bo_CN.ts b/translations/kylin-background-upgrade_bo_CN.ts index ba6076a..6bf37ed 100644 --- a/translations/kylin-background-upgrade_bo_CN.ts +++ b/translations/kylin-background-upgrade_bo_CN.ts @@ -2,91 +2,111 @@ <!DOCTYPE TS> <TS version="2.1" language="bo_CN"> <context> - <name>updatewidget</name> + <name>Form</name> <message> - <source>at</source> - <translation>རླུང་གནོན་ཆེན་པོ།</translation> - </message> - <message> - <source>Delay</source> - <translation>ཕྱིར་འགྱངས།</translation> - </message> - <message> - <source>five hours later</source> - <translation>རྗེས་སུ་དུས་ཚོད%d</translation> - </message> - <message> - <source>one hours later</source> - <translation>ཆུ་ཚོད་གཅིག</translation> - </message> - <message> - <source>three day later</source> - <translation>ཉིན་གསུམ།</translation> - </message> - <message> - <source>In 30 minutes</source> - <translation>སྐར་མ་སུམ་ཅུ།</translation> - </message> - <message> - <source>Update</source> - <translation>གསར་སྒྱུར།</translation> - </message> - <message> - <source>No reminders</source> - <translation>དྲན་སྐུལ།</translation> - </message> - <message> - <source>five day later</source> - <translation>ཉིན་ལྔ།</translation> - </message> - <message> - <source>one day later</source> - <translation>ཉིན་གཅིག</translation> - </message> -</context> -<context> - <name>updatehandle</name> - <message> - <source>update error</source> - <translation>རིམ་འཕར་འགྲུབ་མེད།</translation> - </message> - <message> - <source>kylin-background-upgrade</source> - <translation>རྒྱབ་སྟེགས་རིམ་འགྱུར་བྱ་རིམ།</translation> - </message> - <message> - <source>The system is updating silently</source> - <translation>རྒྱུད་ཁོངས་ཁ་རོག་གེར་རིམ་འགྱུར་བྱེད་སྒང་།</translation> - </message> - <message> - <source>update</source> - <translation>ཁུངས་གསར་བསྒྱུར།</translation> - </message> - <message> - <source>The system has completed an important update. It is recommended that you restart immediately</source> - <translation>རྒྱུད་ཁོངས་ཀྱིས་གནད་འགག་གི་རིམ་འགྱུར་ཞིག་ལེགས་འགྲུབ་བྱུང་བས། བསམ་ཚུལ་ཡིན་ན་ཁྱེད་ཀྱིས་མྱུར་དུ་འཁོར་སྒོ་སླར་ཕྱེ་བྱོས།</translation> - </message> - <message> - <source>System update detected</source> - <translation>རྒྱུད་ཁོངས་རིམ་འགྱུར་ཞིག་ཞིབ་དཔྱད་ཚད་ལེན་བྱས་པ།</translation> - </message> - <message> - <source>The system has completed a critical update, and some software packages failed to update. It is recommended that you restart immediately</source> - <translation>རྒྱུད་ཁོངས་ཀྱིས་གནད་འགག་གི་རིམ་འགྱུར་ཞིག་ལེགས་འགྲུབ་བྱུང་བས། མཉེན་ཆས་ཁག་གཅིག་རིམ་འགྱུར་ལེགས་འགྲུབ་མ་བྱུང་་། བསམ་འཆར་ཡིན་ན་ཁྱེད་ཀྱིས་མྱུར་དུ་འཁོར་སྒོ་སླར་ཕྱེ་བྱོས།</translation> + <location filename="../src/updatewidget.ui" line="16"/> + <source>Form</source> + <translation type="unfinished"></translation> </message> </context> <context> <name>trayicon</name> <message> + <location filename="../src/trayicon.cpp" line="10"/> <source>The system is updating silently</source> - <translation>རྒྱུད་ཁོངས་ཁ་རོག་གེར་རིམ་འགྱུར་བྱེད་སྒང་།</translation> + <translation type="unfinished">རྒྱུད་ཁོངས་ཁ་རོག་གེར་རིམ་འགྱུར་བྱེད་སྒང་།</translation> </message> </context> <context> <name>updateTip</name> <message> + <location filename="../src/updatewidget.cpp" line="548"/> <source>The system is updating silently</source> - <translation>རྒྱུད་ཁོངས་ཁ་རོག་གེར་རིམ་འགྱུར་བྱེད་སྒང་།</translation> + <translation type="unfinished">རྒྱུད་ཁོངས་ཁ་རོག་གེར་རིམ་འགྱུར་བྱེད་སྒང་།</translation> + </message> +</context> +<context> + <name>updatehandle</name> + <message> + <location filename="../src/updatehandle.cpp" line="116"/> + <location filename="../src/updatehandle.cpp" line="355"/> + <source>System update</source> + <translation type="unfinished">རྒྱུད་ཁོངས་གསར་སྒྱུར་</translation> + </message> + <message> + <location filename="../src/updatehandle.cpp" line="319"/> + <location filename="../src/updatehandle.cpp" line="327"/> + <location filename="../src/updatehandle.cpp" line="333"/> + <source>The system is updating silently</source> + <translation type="unfinished">རྒྱུད་ཁོངས་ཁ་རོག་གེར་རིམ་འགྱུར་བྱེད་སྒང་།</translation> + </message> + <message> + <location filename="../src/updatehandle.cpp" line="511"/> + <source>The system has completed an important update, It is recommended that you restart immediately.</source> + <translation type="unfinished">མ་ལག་གི་འགག་རྩའི་གསར་སྒྱུར་ཞིག་ལེགས་གྲུབ་དང་།བསམ་འཆར་ལ་ཁྱེད་རང་འཕྲལ་མར་བསྐྱར་འབྱེད་།</translation> + </message> + <message> + <location filename="../src/updatehandle.cpp" line="513"/> + <source>update error</source> + <translation type="unfinished">རིམ་འཕར་འགྲུབ་མེད།</translation> + </message> + <message> + <location filename="../src/updatehandle.cpp" line="589"/> + <source>kylin-background-upgrade</source> + <translation type="unfinished">རྒྱབ་སྟེགས་གསར་སྒྱུར་བྱ་རིམ།</translation> + </message> + <message> + <location filename="../src/updatehandle.cpp" line="592"/> + <source>update</source> + <translation type="unfinished">རྒྱུད་ཁོངས་རིམ་སྤོར་</translation> + </message> +</context> +<context> + <name>updatewidget</name> + <message> + <location filename="../src/updatewidget.cpp" line="42"/> + <source> Updatable app detected on your system!</source> + <translation type="unfinished"> རྒྱུད་ཁོངས་གསར་སྒྱུར་རྣམ་གྲངས་</translation> + </message> + <message> + <location filename="../src/updatewidget.cpp" line="51"/> + <source>Close</source> + <translation type="unfinished">སྒོ་རྒྱག་པ་</translation> + </message> + <message> + <location filename="../src/updatewidget.cpp" line="62"/> + <source>30 minutes later</source> + <translation type="unfinished">ཕྱིར་འགྱངས་སྐར་མ་30།</translation> + </message> + <message> + <location filename="../src/updatewidget.cpp" line="62"/> + <source>1 hour later</source> + <translation type="unfinished">ཆུ་ཚོད་གཅིག་ནར་འགྱངས་།</translation> + </message> + <message> + <location filename="../src/updatewidget.cpp" line="62"/> + <source>5 hours later</source> + <translation type="unfinished">ཆུ་ཚོད་5ནར་འགྱངས་།</translation> + </message> + <message> + <location filename="../src/updatewidget.cpp" line="62"/> + <source>1 day later</source> + <translation type="unfinished">ཉིན་གཅིག་ནར་འགྱངས་།</translation> + </message> + <message> + <location filename="../src/updatewidget.cpp" line="62"/> + <source>3 days later</source> + <translation type="unfinished">ཉིན་གསུམ་ནར་འགྱངས་།</translation> + </message> + <message> + <location filename="../src/updatewidget.cpp" line="69"/> + <source>Update</source> + <translation type="unfinished">ལམ་སང་གསར་སྒྱུར་</translation> + </message> + <message> + <location filename="../src/updatewidget.cpp" line="70"/> + <source>Delay</source> + <translation type="unfinished">ནར་འགྱངས།</translation> </message> </context> </TS> diff --git a/translations/kylin-background-upgrade_zh_CN.qm b/translations/kylin-background-upgrade_zh_CN.qm index c9d0fd6de5f5012d40097921132d5df4bcdfa6e0..1025f13b5cf7d4eb987ac30a13f2dc1b3134be4d 100644 GIT binary patch delta 490 zcmaFDF_UY8NPP!`m)TSX2IemeUWYmv7+B;ORv8{*U|=$3EKw=~ikCBPt`}usU_8jg zpjF8L1W?)sLNgXJ$v#U0s@uVOY{gQbeh)SmWuSg$JNA?sCLqns4i;x(<Ir%A18P6d zp|v>>Xi64$;sYlJ27ac~JZG3$ff6$_fx62l-gBCGC0dH3=6Buwv@fX}I6zji0WoiI zWpPPruEOL4Ofs9x7-utji!mrbAV_UGCrI^-%CdKG9a;)N5L%FuSdy5Old6zdP@s^K zT9TSvlA5BBpQlinUs|M43^r78@<C=X37+H?{r7<;8ZszEYQjz7Hk{1Iq9D(Qkc{C^ z{RWrjF;vI^8Z_C5MM8lY=uDU)#wdpH7%QYCR!;V2k<<Vw5`Y?J%wWKv5X3fRKHN9~ zV*`cU%)HW)RFGmhkYbq4rVI)wHuIWJc4Ltf2Pt6*ES~xnZU(D!PJZ#^1I*%+1(~%c IuVmH&00@zC6951J delta 345 zcmbQq^@L-Bh++i;16vCN1G6K8*P%`Z2BvC;RfdOvv>W5*dQk=j#!C}z#od~i+T|Vr z70qB_ThR=ZT*`WE#Zn+&h;8eYU?BfCJDATT&Y|HR$H2hwfM>SA6(Bv6*YtrAP+eLk zkhnDQozui8(S`yU2XeiG4AMDke%IYk`;xkW1E`XL4T!~pD~n4~a}`PpQW8s26;e`5 zQj<$kQzkPqiES=roXt4-2#dD7A7`**5Zjdba9zBfc?!k`3b~nir6sAwlg}}WDRKq2 z`tb(#CSRC139gLCFJGZ36{spDwFs<g@;eso$q$%W_?f~r;HsDsOD3;l5f}Aih}47& r^5*9OU6WWjnUO_Cmcx(JPb-E$^&4DTuq2}>HB})azqDwwBa0*eUbkC2 diff --git a/translations/kylin-background-upgrade_zh_CN.ts b/translations/kylin-background-upgrade_zh_CN.ts index baec187..480f39a 100644 --- a/translations/kylin-background-upgrade_zh_CN.ts +++ b/translations/kylin-background-upgrade_zh_CN.ts @@ -27,7 +27,7 @@ <context> <name>updateTip</name> <message> - <location filename="../src/updatewidget.cpp" line="445"/> + <location filename="../src/updatewidget.cpp" line="548"/> <source>The system is updating silently</source> <translation>系统正在静默更新</translation> </message> @@ -39,9 +39,9 @@ <translation type="vanished">系统已经完成一项关键更新,建议您立即重启</translation> </message> <message> - <location filename="../src/updatehandle.cpp" line="298"/> - <location filename="../src/updatehandle.cpp" line="306"/> - <location filename="../src/updatehandle.cpp" line="312"/> + <location filename="../src/updatehandle.cpp" line="319"/> + <location filename="../src/updatehandle.cpp" line="327"/> + <location filename="../src/updatehandle.cpp" line="333"/> <source>The system is updating silently</source> <translation>系统正在静默更新</translation> </message> @@ -50,32 +50,36 @@ <translation type="vanished">检测到有系统更新</translation> </message> <message> - <location filename="../src/updatehandle.cpp" line="100"/> - <location filename="../src/updatehandle.cpp" line="334"/> <source>System update detected</source> - <translation>检测到有系统更新</translation> + <translation type="vanished">检测到有系统更新</translation> </message> <message> <source>The system has completed a critical update, and some software packages failed to update. It is recommended that you restart immediately</source> <translation type="obsolete">系统完成一项关键更新,部分软件包更新失败,建议您立即重启</translation> </message> <message> - <location filename="../src/updatehandle.cpp" line="471"/> + <location filename="../src/updatehandle.cpp" line="116"/> + <location filename="../src/updatehandle.cpp" line="355"/> + <source>System update</source> + <translation>系统更新</translation> + </message> + <message> + <location filename="../src/updatehandle.cpp" line="511"/> <source>The system has completed an important update, It is recommended that you restart immediately.</source> <translation>系统完成一项关键更新,建议您立即重启</translation> </message> <message> - <location filename="../src/updatehandle.cpp" line="473"/> + <location filename="../src/updatehandle.cpp" line="513"/> <source>update error</source> <translation>升级失败</translation> </message> <message> - <location filename="../src/updatehandle.cpp" line="508"/> + <location filename="../src/updatehandle.cpp" line="589"/> <source>kylin-background-upgrade</source> <translation>后台更新程序</translation> </message> <message> - <location filename="../src/updatehandle.cpp" line="511"/> + <location filename="../src/updatehandle.cpp" line="592"/> <source>update</source> <translation>系统升级</translation> </message> @@ -83,39 +87,65 @@ <context> <name>updatewidget</name> <message> - <location filename="../src/updatewidget.cpp" line="40"/> + <source>Please remind me later</source> + <translation type="vanished">请在以下时间段之后提醒我</translation> + </message> + <message> <source>at</source> - <translation>在</translation> + <translation type="vanished">在</translation> + </message> + <message> + <source>No more reminders</source> + <translation type="vanished">内不再提醒</translation> + </message> + <message> + <source>No reminders</source> + <translation type="vanished">内不再提醒</translation> </message> <message> <location filename="../src/updatewidget.cpp" line="42"/> - <source>No reminders</source> - <translation>内不再提醒</translation> + <source> Updatable app detected on your system!</source> + <translation type="unfinished"> 系统有更新项目</translation> </message> <message> - <location filename="../src/updatewidget.cpp" line="53"/> - <source>In 30 minutes</source> - <translation>三十分钟</translation> + <location filename="../src/updatewidget.cpp" line="51"/> + <source>Close</source> + <translation type="unfinished">关闭</translation> </message> <message> - <location filename="../src/updatewidget.cpp" line="53"/> - <source>three hours later</source> - <translation>三个小时</translation> + <location filename="../src/updatewidget.cpp" line="62"/> + <source>30 minutes later</source> + <translation>推迟 30 分钟</translation> </message> <message> - <location filename="../src/updatewidget.cpp" line="60"/> + <location filename="../src/updatewidget.cpp" line="62"/> + <source>1 hour later</source> + <translation type="unfinished">推迟 1 小时</translation> + </message> + <message> + <location filename="../src/updatewidget.cpp" line="62"/> + <source>3 days later</source> + <translation type="unfinished">推迟 3 天</translation> + </message> + <message> + <location filename="../src/updatewidget.cpp" line="70"/> + <source>Delay</source> + <translation type="unfinished">推迟</translation> + </message> + <message> + <location filename="../src/updatewidget.cpp" line="62"/> + <source>5 hours later</source> + <translation>推迟 5 小时</translation> + </message> + <message> + <location filename="../src/updatewidget.cpp" line="62"/> + <source>1 day later</source> + <translation>推迟 1 天</translation> + </message> + <message> + <location filename="../src/updatewidget.cpp" line="69"/> <source>Update</source> <translation>立即更新</translation> </message> - <message> - <location filename="../src/updatewidget.cpp" line="61"/> - <source>Delay</source> - <translation>推迟</translation> - </message> - <message> - <location filename="../src/updatewidget.cpp" line="53"/> - <source>one day later</source> - <translation>一天</translation> - </message> </context> </TS> diff --git a/widgets/Button/button.pri b/widgets/Button/button.pri new file mode 100644 index 0000000..ded778b --- /dev/null +++ b/widgets/Button/button.pri @@ -0,0 +1,6 @@ +SOURCES += \ + $$PWD/fixbutton.cpp \ + +HEADERS += \ + $$PWD/fixbutton.h \ + diff --git a/widgets/Button/fixbutton.cpp b/widgets/Button/fixbutton.cpp new file mode 100644 index 0000000..fed4aad --- /dev/null +++ b/widgets/Button/fixbutton.cpp @@ -0,0 +1,36 @@ +#include "fixbutton.h" +#include <QFontMetrics> +#include <QDebug> + +FixButton::FixButton(QWidget *parent): + QPushButton(parent) +{ + +} + +FixButton::~FixButton() +{ + +} + +void FixButton::paintEvent(QPaintEvent *event) +{ + QFontMetrics fontMetrics(this->font()); + int fontSize = fontMetrics.width(mStr); + int showTextSize = this->width() - 32; + if (fontSize > showTextSize) { + this->setText(fontMetrics.elidedText(mStr, Qt::ElideRight, showTextSize), false); + this->setToolTip(mStr); + } else { + this->setText(mStr, false); + this->setToolTip(""); + } + QPushButton::paintEvent(event); +} + +void FixButton::setText(const QString & text, bool saveTextFlag) +{ + if (saveTextFlag) + mStr = text; + QPushButton::setText(text); +} diff --git a/widgets/Button/fixbutton.h b/widgets/Button/fixbutton.h new file mode 100644 index 0000000..2f30dbe --- /dev/null +++ b/widgets/Button/fixbutton.h @@ -0,0 +1,21 @@ +#ifndef _FIXBUTTON_H_ +#define _FIXBUTTON_H_ +#include <QPushButton> + +class FixButton : public QPushButton +{ + Q_OBJECT +public: + FixButton(QWidget *parent = nullptr); + ~FixButton(); + void setText(const QString &text, bool saveTextFlag = true); +private: + void paintEvent(QPaintEvent *event); + +private: + QString mStr; +}; + + + +#endif diff --git a/widgets/widgets.pri b/widgets/widgets.pri new file mode 100644 index 0000000..90fd274 --- /dev/null +++ b/widgets/widgets.pri @@ -0,0 +1,4 @@ +INCLUDEPATH += $$PWD + +include(Button/button.pri) +include(ComboBox/comboBox.pri)