From 40e4e1bea7415cadd1abdb5164ee77eb7778d317 Mon Sep 17 00:00:00 2001 From: zhangdongwei Date: Sat, 30 Oct 2021 15:36:07 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=BF=E5=85=8D=E7=94=A8=E6=88=B7=E8=83=BD?= =?UTF-8?q?=E5=A4=9F=E5=A4=9A=E6=AC=A1=E7=82=B9=E5=87=BB=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 3 --- debian/control | 14 +--------- debian/kylin-system-updater.install | 2 +- debian/postinst | 2 ++ debian/rules | 4 ++- plugin/src/appupdate.cpp | 4 ++- plugin/src/appupdate.h | 1 + plugin/src/tabwidget.cpp | 41 ++++++++++------------------- plugin/src/tabwidget.h | 1 + 9 files changed, 26 insertions(+), 46 deletions(-) diff --git a/Makefile b/Makefile index baf3a00..10418cd 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,3 @@ plugins: cd plugin && make -j8 updater: cd backend && ./setup.py build -clean: - cd plugin && make clean - diff --git a/debian/control b/debian/control index 08c5c7b..bac8085 100644 --- a/debian/control +++ b/debian/control @@ -19,10 +19,6 @@ Build-Depends: debhelper (>= 9), libqt5x11extras5-dev, libxklavier-dev, libkf5widgetsaddons-dev, - libkf5config-dev, - libkf5configwidgets-dev, - libkf5screen-dev, - libkf5screen-bin, libkf5i18n-dev, libkf5windowsystem-dev, libkf5guiaddons-dev, @@ -30,31 +26,23 @@ Build-Depends: debhelper (>= 9), libkf5xmlgui-dev, libkf5globalaccel-dev, qtdeclarative5-dev, - libopencv-dev, libdconf-dev, libmatemixer-dev, qtmultimedia5-dev, libxml2-dev, qtbase5-dev, libcanberra-dev, - libx11-dev, - libxkbfile-dev, libboost-dev, qttools5-dev-tools, - libxcb-xkb-dev, libpolkit-qt5-1-dev, libpulse-dev, - libkf5bluezqt-dev, libkysec-dev, libpwquality-dev, - libudev-dev, - xserver-xorg-dev, - libupower-glib-dev, libpam0g-dev, yhkylin-backup-tools-dev(>=4.0.13-kylin19)[!sw64], libukui-log4qt-dev[!sw64], libmate-desktop-dev, - ukui-control-center(>=3.1.1+2021-1026separate9), + libukcc-dev Build-Depends-Indep: libxml-parser-perl, intltool Standards-Version: 3.8.0 diff --git a/debian/kylin-system-updater.install b/debian/kylin-system-updater.install index c5de6dc..a6494e9 100644 --- a/debian/kylin-system-updater.install +++ b/debian/kylin-system-updater.install @@ -13,4 +13,4 @@ backend/build/lib/SystemUpdater/UpdateManagerVersion.py /usr/lib/python3.8/dist- backend/build/lib/SystemUpdater/__init__.py /usr/lib/python3.8/dist-packages/SystemUpdater/ backend/build/lib/SystemUpdater/Core /usr/lib/python3.8/dist-packages/SystemUpdater/ -/plugin/libupgrade.so /usr/lib/*/ukui-control-center +plugin/libupgrade.so /usr/lib/ diff --git a/debian/postinst b/debian/postinst index 758ea21..7bbde3b 100644 --- a/debian/postinst +++ b/debian/postinst @@ -8,3 +8,5 @@ if [ ! -f /var/cache/kylin-system-updater/kylin-system-updater.db ];then fi systemctl enable kylin-system-updater +mkdir -p /usr/lib/`dpkg-architecture -qDEB_TARGET_MULTIARCH`/ukui-control-center/ +mv /usr/lib/libupgrade.so /usr/lib/`dpkg-architecture -qDEB_TARGET_MULTIARCH`/ukui-control-center/ diff --git a/debian/rules b/debian/rules index c983834..dd13863 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,9 @@ #!/usr/bin/make -f - +export DEB_HOST_GNU_TYPE=x86_64-linux-gnu +export DEB_TARGET_MULTIARCH=x86_64-linux-gnu #export PYBUILD_INTERPRETERS=python3 %: dh $@ +#override_dh_makeshlibs: #--with=python3 --buildsystem=pybuild diff --git a/plugin/src/appupdate.cpp b/plugin/src/appupdate.cpp index 6886a03..f520974 100644 --- a/plugin/src/appupdate.cpp +++ b/plugin/src/appupdate.cpp @@ -98,7 +98,7 @@ void AppUpdateWid::showInstallStatues(QStringList appAptName,int progress,QStrin if (!isUpdateAll && progress>50) { updateAPPBtn->hide(); appVersion->setText(tr("Being installed")); - appVersion->setToolTip(tr("Being installed")); + appVersion->setToolTip(""); } } @@ -632,6 +632,8 @@ void AppUpdateWid::updateOneApp(bool status) void AppUpdateWid::distUpgradePartial(bool status) { + if(status) + emit startoneappupdate(); QStringList pkgname; pkgname.append(appAllMsg.name); m_updateMutual->interface->asyncCall("DistUpgradePartial",status,pkgname); diff --git a/plugin/src/appupdate.h b/plugin/src/appupdate.h index 6dd7e5b..61a23bd 100644 --- a/plugin/src/appupdate.h +++ b/plugin/src/appupdate.h @@ -140,6 +140,7 @@ signals: void sendProgress(QString pkgName, int Progress, QString type); void changeupdateall(); void allappupdatefinishsignal(); + void startoneappupdate(); // void aptFinish(); diff --git a/plugin/src/tabwidget.cpp b/plugin/src/tabwidget.cpp index c97e7a5..b59701c 100644 --- a/plugin/src/tabwidget.cpp +++ b/plugin/src/tabwidget.cpp @@ -120,7 +120,6 @@ void TabWid::getAutoUpgradeStatus() updateSource->killProcessSignal(pid.toInt(), 10); checkUpdateBtn->setEnabled(true); checkUpdateBtn->setText(tr("Check Update")); - checkUpdateBtn->setToolTip(tr("Check Update")); checkUpdateBtnClicked(); } else if (!ret.compare("install")){ isAutoUpgrade = true; @@ -128,7 +127,6 @@ void TabWid::getAutoUpgradeStatus() isAllUpgrade = true; checkUpdateBtn->hide(); checkUpdateBtn->setText(tr("UpdateAll")); - checkUpdateBtn->setToolTip(tr("UpdateAll")); bool ret = autoUpdateLoadUpgradeList(false); if (!ret) updateMutual->disconnectDbusSignal(); @@ -136,13 +134,11 @@ void TabWid::getAutoUpgradeStatus() /*如果没有进行自动更新,那就不需要操作 */ checkUpdateBtn->setEnabled(true); checkUpdateBtn->setText(tr("Check Update")); - checkUpdateBtn->setToolTip(tr("Check Update")); checkUpdateBtnClicked(); } else { /*如果读不到,默认也不进行操作*/ checkUpdateBtn->setEnabled(true); checkUpdateBtn->setText(tr("Check Update")); - checkUpdateBtn->setToolTip(tr("Check Update")); checkUpdateBtnClicked(); } } @@ -172,7 +168,6 @@ bool TabWid::autoUpdateLoadUpgradeList(bool isBackUp) lastRefreshTime->setText(tr("Last refresh:")+ updatetime); lastRefreshTime->show(); checkUpdateBtn->setText(tr("Check Update")); - checkUpdateBtn->setToolTip(tr("Check Update")); return false; } else { QStringList list; @@ -226,7 +221,6 @@ void TabWid::backupMessageBox(QString str) // checkUpdateBtn->setText(tr("全部更新")); versionInformationLab->setText(tr("Updatable app detected on your system!")); checkUpdateBtn->setText(tr("UpdateAll")); - checkUpdateBtn->setToolTip(tr("UpdateAll")); foreach (AppUpdateWid *wid, widgetList) { wid->updateAPPBtn->show(); } @@ -276,12 +270,10 @@ void TabWid::isCancelabled(bool status) if(status) { checkUpdateBtn->setText(tr("Cancel")); - checkUpdateBtn->setToolTip(tr("Cancel")); checkUpdateBtn->setEnabled(true); } else{ checkUpdateBtn->setText(tr("Cancel")); - checkUpdateBtn->setToolTip(tr("Cancel")); checkUpdateBtn->setEnabled(false); } @@ -291,7 +283,6 @@ void TabWid::DependResloveResult(bool ResloveStatus,bool ResloveResult,QStringLi { checkUpdateBtn->stop(); checkUpdateBtn->setText(tr("Calculated")); - checkUpdateBtn->setToolTip(tr("Calculated")); if (!ResloveResult) { emit updateAllSignal(true); @@ -431,7 +422,7 @@ void TabWid::backupProgress(int progress) return; } versionInformationLab->setText(tr("System is backing up...")); - //allProgressBar->setValue(progress); + allProgressBar->setValue(progress); checkUpdateBtn->hide(); allProgressBar->show(); lastRefreshTime->hide(); @@ -471,7 +462,6 @@ void TabWid::backupHideUpdateBtn(int result) checkUpdateBtn->setEnabled(true); // checkUpdateBtn->setText(tr("全部更新")); checkUpdateBtn->setText(tr("UpdateAll")); - checkUpdateBtn->setToolTip(tr("UpdateAll")); } } @@ -602,7 +592,6 @@ void TabWid::slotUpdateCache(bool result,QStringList pkgname, QString error ,QSt checkUpdateBtn->stop(); // checkUpdateBtn->setText(tr("检查更新")); checkUpdateBtn->setText(tr("Check Update")); - checkUpdateBtn->setToolTip(tr("Check Update")); // versionInformationLab->setText(tr("软件源更新失败:")+failedInfo ); versionInformationLab->setText(tr("Software source update failed: ")+error); disconnect(updateSource->serviceInterface,SIGNAL(updateTemplateStatus(QString)),this,SLOT(slotUpdateTemplate(QString))); @@ -635,7 +624,6 @@ void TabWid::allComponents() scrollArea = new QScrollArea(this); updateTab = new QWidget(this); //更新页面 - updateTab->setMaximumSize(960,960); AppMessage = new QVBoxLayout(); AppMessage->setAlignment(Qt::AlignTop); updateTab->setLayout(AppMessage); @@ -675,7 +663,6 @@ void TabWid::allComponents() QHBoxLayout *historyUpdateLogLayout = new QHBoxLayout(); historyUpdateLog = new QPushButton(this); // 历史日志弹出窗口控制按钮 // historyUpdateLog->setText(tr("查看更新历史")); - //~ contents_path /upgrade/View history historyUpdateLog->setText(tr("View history")); historyUpdateLogWid->setLayout(historyUpdateLogLayout); historyUpdateLogLayout->setAlignment(Qt::AlignLeft); @@ -745,7 +732,7 @@ void TabWid::allComponents() updateSettingLab = new TitleLabel(); // updateSettingLab->setText(tr("更新设置")); - //~ contents_path /Upgrade/Update Settings + //~ contents_path /upgrade/Update Settings updateSettingLab->setText(tr("Update Settings")); updateSettingLab->setFixedHeight(27); updateSettingWidget = new QWidget(this); @@ -757,7 +744,6 @@ void TabWid::allComponents() isAutoCheckLayout = new QHBoxLayout(); isAutoCheckedLab = new QLabel(); // isAutoCheckedLab->setText(tr("允许通知可更新的应用")); - //~ contents_path /Upgrade/Allowed to renewable notice isAutoCheckedLab->setText(tr("Allowed to renewable notice")); isAutoCheckSBtn = new SwitchButton(); isAutoCheckWidget->setLayout(isAutoCheckLayout); @@ -825,7 +811,6 @@ void TabWid::allComponents() isAutoUpgradeWidget->setFrameShape(QFrame::Box); isAutoUpgradeLayout = new QVBoxLayout(); isAutoUpgradeLab = new QLabel(); - //~ contents_path /Upgrade/Automatically download and install updates isAutoUpgradeLab->setText(tr("Automatically download and install updates")); autoUpgradeLab = new QLabel(); autoUpgradeLab->setText(tr("After it is turned on, the system will automatically download and install updates when there is an available network and available backup and restore partitions.")); @@ -898,6 +883,7 @@ void TabWid::loadingOneUpdateMsgSlot(AppAllMsg msg) connect(updateMutual,&UpdateDbus::sendFinishGetMsgSignal,appWidget,&AppUpdateWid::showUpdateBtn); connect(appWidget,&AppUpdateWid::filelockedSignal,this,&TabWid::waitCrucialInstalled); connect(backup,&BackUp::bakeupFinish,appWidget,&AppUpdateWid::hideOrShowUpdateBtnSlot); + connect(appWidget,&AppUpdateWid::startoneappupdate,this,&TabWid::startoneappupdateslot); /*判断是否是后台自动更新*/ if (isAutoUpgrade) { // connect(appWidget, &AppUpdateWid::sendProgress, this, &TabWid::getAllProgress); @@ -945,7 +931,6 @@ void TabWid::loadingFinishedSlot(int size) checkUpdateBtn->stop(); // checkUpdateBtn->setText(tr("检查更新")); checkUpdateBtn->setText(tr("Check Update")); - checkUpdateBtn->setToolTip(tr("Check Update")); // versionInformationLab->setText(tr("您的系统已是最新!")); versionInformationLab->setText(tr("Your system is the latest!")); disconnect(updateMutual->interface,SIGNAL(UpdateDloadAndInstStaChanged(QStringList,int,QString,QString)),this,SLOT(getAllProgress(QStringList,int,QString,QString))); @@ -970,7 +955,6 @@ void TabWid::loadingFinishedSlot(int size) checkUpdateBtn->setEnabled(true); // checkUpdateBtn->setText(tr("全部更新")); checkUpdateBtn->setText(tr("UpdateAll")); - checkUpdateBtn->setToolTip(tr("UpdateAll")); // versionInformationLab->setText(tr("检测到你的系统有可更新的应用!")); if (!isAutoUpgrade) { versionInformationLab->setText(tr("Updatable app detected on your system!")); @@ -988,7 +972,6 @@ void TabWid::allappupdatefinishSlot() checkUpdateBtn->stop(); // checkUpdateBtn->setText(tr("检查更新")); checkUpdateBtn->setText(tr("Check Update")); - checkUpdateBtn->setToolTip(tr("Check Update")); // versionInformationLab->setText(tr("您的系统已是最新!")); versionInformationLab->setText(tr("Your system is the latest!")); disconnect(updateMutual->interface,SIGNAL(UpdateDloadAndInstStaChanged(QStringList,int,QString,QString)),this,SLOT(getAllProgress(QStringList,int,QString,QString))); @@ -1271,11 +1254,18 @@ void TabWid::slotCancelDownload() checkUpdateBtn->setEnabled(true); // checkUpdateBtn->setText("全部更新"); checkUpdateBtn->setText(tr("UpdateAll")); - checkUpdateBtn->setToolTip(tr("UpdateAll")); checkUpdateBtn->setCheckable(true); versionInformationLab->setText(tr("update has been canceled!")); } +void TabWid::startoneappupdateslot() +{ + foreach (AppUpdateWid *wid, widgetList) { + if(wid->updateAPPBtn->text() == tr("Update")) + wid->updateAPPBtn->setEnabled(false); + } +} + void TabWid::hideUpdateBtnSlot(bool state,QStringList pkgname,QString error,QString reason) { Q_UNUSED(pkgname); @@ -1283,7 +1273,6 @@ void TabWid::hideUpdateBtnSlot(bool state,QStringList pkgname,QString error,QStr checkUpdateBtn->stop(); // checkUpdateBtn->setText(tr("检查更新")); checkUpdateBtn->setText(tr("Check Update")); - checkUpdateBtn->setToolTip(tr("Check Update")); if(state) { versionInformationLab->setText(tr("Your system is the latest!")); systemPortraitLab->setPixmap(QPixmap(":/img/plugins/upgrade/normal.png").scaled(96,96)); @@ -1335,7 +1324,9 @@ void TabWid::oneappUpdateresultSlot(bool state,QStringList pkgname,QString error checkUpdateBtn->stop(); // checkUpdateBtn->setText(tr("检查更新")); checkUpdateBtn->setText(tr("UpdateAll")); - checkUpdateBtn->setToolTip(tr("UpdateAll")); + foreach (AppUpdateWid *wid, widgetList) { + wid->updateAPPBtn->setEnabled(true); + } if(state) { versionInformationLab->setText(tr("Part of the update success!")); systemPortraitLab->setPixmap(QPixmap(":/img/plugins/upgrade/normal.png").scaled(96,96)); @@ -1370,7 +1361,6 @@ void TabWid::oneappUpdateresultSlot(bool state,QStringList pkgname,QString error checkUpdateBtn->stop(); // checkUpdateBtn->setText(tr("检查更新")); checkUpdateBtn->setText(tr("Check Update")); - checkUpdateBtn->setToolTip(tr("Check Update")); versionInformationLab->setText(tr("Your system is the latest!")); systemPortraitLab->setPixmap(QPixmap(":/img/plugins/upgrade/normal.png").scaled(96,96)); checkUpdateBtn->hide(); @@ -1402,7 +1392,6 @@ void TabWid::updatecancel(void) checkUpdateBtn->stop(); // checkUpdateBtn->setText(tr("检查更新")); checkUpdateBtn->setText(tr("UpdateAll")); - checkUpdateBtn->setToolTip(tr("UpdateAll")); versionInformationLab->setText(tr("update has been canceled!")); checkUpdateBtn->show(); } @@ -1416,7 +1405,6 @@ void TabWid::changeUpdateAllSlot(bool isUpdate) if(checkUpdateBtn->isEnabled() == false) { checkUpdateBtn->setText(tr("UpdateAll")); - checkUpdateBtn->setToolTip(tr("UpdateAll")); checkUpdateBtn->setEnabled(true); } } @@ -1561,7 +1549,6 @@ void TabWid::updateAllApp(bool status) { if(!status){ checkUpdateBtn->setText(tr("Calculating")); - checkUpdateBtn->setToolTip(tr("Calculating")); }else{ foreach (AppUpdateWid *wid, widgetList) { wid->updateAPPBtn->hide(); diff --git a/plugin/src/tabwidget.h b/plugin/src/tabwidget.h index af556c8..079521e 100644 --- a/plugin/src/tabwidget.h +++ b/plugin/src/tabwidget.h @@ -166,6 +166,7 @@ public slots: void allappupdatefinishSlot(); void changeUpdateAllSlot(bool isUpdate); void updatecancel(void); + void startoneappupdateslot(void); void DownloadLimitSwitchChanged(); void DownloadLimitValueChanged(const QString &);