diff --git a/debian/changelog b/debian/changelog index 4ab6668..285edd6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +kylin-update-notify (1.3.2.1-ok4) yangtze; urgency=medium + + *BUG号:135671 【wayland】【更新升级】设置推迟时间不生效,到推迟的时间后没有再次出现自动更新弹窗 + *需求号:无 + *其他改动说明:无 + *影响域: 无 + + -- luoxueyi <luoxueyi@kylinos.cn> Tue, 18 Apr 2023 09:46:45 +0800 + kylin-update-notify (1.3.2.1-ok3) yangtze; urgency=medium * patch from zhangdongwei diff --git a/debian/patches/0002-index-0.patch b/debian/patches/0002-index-0.patch new file mode 100644 index 0000000..507d03e --- /dev/null +++ b/debian/patches/0002-index-0.patch @@ -0,0 +1,406 @@ +From: luoxueyi <luoxueyi@kylinos.cn> +Date: Thu, 20 Apr 2023 16:16:13 +0800 +Subject: =?utf-8?b?6YCJ5oup5o6o6L+f5ZCO5bCG5aSN6YCJ5qGG6buY6K6k6YCJ6aG55oyH?= + =?utf-8?b?5ZCRaW5kZXggMA==?= + +--- + kylin-background-upgrade.pro.user | 11 ++-- + src/main.cpp | 2 +- + src/updatehandle.cpp | 7 ++- + src/updatewidget.cpp | 82 +++++++++++-------------- + src/updatewidget.h | 8 ++- + translations/kylin-background-upgrade_zh_CN.qm | Bin 1306 -> 1124 bytes + translations/kylin-background-upgrade_zh_CN.ts | 64 ++++--------------- + 7 files changed, 65 insertions(+), 109 deletions(-) + +diff --git a/kylin-background-upgrade.pro.user b/kylin-background-upgrade.pro.user +index ffee34f..f026e3e 100644 +--- a/kylin-background-upgrade.pro.user ++++ b/kylin-background-upgrade.pro.user +@@ -1,6 +1,6 @@ + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE QtCreatorProject> +-<!-- Written by QtCreator 4.11.0, 2022-07-21T18:26:42. --> ++<!-- Written by QtCreator 4.11.0, 2022-08-23T14:03:45. --> + <qtcreator> + <data> + <variable>EnvironmentId</variable> +@@ -282,10 +282,9 @@ + </valuelist> + <value type="int" key="PE.EnvironmentAspect.Base">2</value> + <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> +- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">kylin-background-upgrade2</value> +- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/lxy/kylin-background-upgrade/OpenKylin/make_deb/kylin-background-upgrade/kylin-background-upgrade.pro</value> +- <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/lxy/kylin-background-upgrade/OpenKylin/make_deb/kylin-background-upgrade/kylin-background-upgrade.pro</value> +- <value type="QString" key="RunConfiguration.Arguments"></value> ++ <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> +@@ -295,7 +294,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"></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> +diff --git a/src/main.cpp b/src/main.cpp +index f7179b2..4ec6e8d 100644 +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -149,6 +149,6 @@ int main(int argc, char *argv[]) + qunsetenv("SESSION_MANAGER"); + QApplication a(argc, argv); + core *m_core= new core(arg); +- QObject::connect(m_core,SIGNAL(execSignal()),&a,SLOT(quit())); ++// QObject::connect(m_core,SIGNAL(execSignal()),&a,SLOT(quit())); + return a.exec(); + } +diff --git a/src/updatehandle.cpp b/src/updatehandle.cpp +index 8529333..e3a8eee 100644 +--- a/src/updatehandle.cpp ++++ b/src/updatehandle.cpp +@@ -353,7 +353,7 @@ void updatehandle::UpdateDectCheck() + { + //判断是否有系统更新 + // if(!checktime()){ +- qDebug()<<"Detection update has been opened ..."; ++ 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(); +@@ -487,7 +487,10 @@ void updatehandle::InstallFinsih(bool state,QStringList pkgname,QString error,QS + */ + void updatehandle::execslots() + { +- emit execSignal(); ++ choice_window->comboBox->setCurrentIndex(0); ++ choice_window->hide(); ++ qDebug()<<"Hide choice_window."; ++// emit execSignal(); + } + + /** +diff --git a/src/updatewidget.cpp b/src/updatewidget.cpp +index 233e971..ebd7c81 100644 +--- a/src/updatewidget.cpp ++++ b/src/updatewidget.cpp +@@ -50,7 +50,7 @@ updatewidget::updatewidget(QWidget *parent) : + + comboBox = new QComboBox(); + comboBox->clear(); +- strList<<tr("In 30 minutes")<<tr("one hours later")<<tr("five hours later")<<tr("one day later")<<tr("three day later")<<tr("five day later"); ++ strList<<tr("In 30 minutes")<<tr("three hours later")<<tr("one day later"); + comboBox->addItems(strList); + + labelwidget = new QWidget(); +@@ -313,63 +313,53 @@ void updatewidget::set_window_position() + */ + char *updatewidget::insideTime() + { +- qDebug()<<comboBox->currentText(); ++ qDebug()<<"Current index: "<<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(); +- return nowtime; ++ delaytime = 1800; ++ delayTimer->start(delaytime * 1000); ++ delayTimer_Checker->start(60 * 1000); + } else if (comboBox->currentText() == strList.at(1)) { +- 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(); +- 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; +- } else if (comboBox->currentText() == strList.at(5)) { +- 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(5); ++ QDateTime bojb = QDateTime::fromString(str,"yyyy-MM-dd hh:mm:ss").addSecs(3600 * 3); + QString str1 = bojb.toString("yyyy-MM-dd hh:mm:ss"); + QByteArray str2char2 = str1.toLatin1(); // must + nowtime = str2char2.data(); +- return nowtime; ++ delaytime = 3600 * 3; ++ delayTimer->start(delaytime * 1000); ++ delayTimer_Checker->start(60 * 1000); + } ++ 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"; + } + + /** +@@ -379,12 +369,11 @@ char *updatewidget::insideTime() + void updatewidget::agreeBtnClicked() + { + emit agreeBtnSignals(); +- qDebug()<<"WifiButtonClickSlot is running"; ++// qDebug()<<"WifiButtonClickSlot is running"; + QProcess p(0); + p.startDetached("update-manager"); + p.waitForStarted(); + qDebug()<<"Open the control panel and start updating immediately, exit tray program!"; +-// exit(0); + this->hide(); + } + +@@ -417,8 +406,8 @@ void updatewidget::disAgreeBtnClicked() + timersettings->endGroup(); + } + emit disAgreeBtnSignals(); +- qDebug()<<"Users do not update, exit tray program!"; +- exit(0); ++ qDebug()<<"Delay updating the system."; ++// exit(0); + } + + /** +@@ -500,4 +489,3 @@ void updateTip::paintEvent(QPaintEvent *e) + QWidget::paintEvent(e); + } + +- +diff --git a/src/updatewidget.h b/src/updatewidget.h +index c27b470..77f3983 100644 +--- a/src/updatewidget.h ++++ b/src/updatewidget.h +@@ -19,6 +19,7 @@ + #include <QScreen> + #include <QDBusReply> + #include <QSettings> ++#include <QTimer> + #include <sys/stat.h> + #include <unistd.h> + +@@ -45,6 +46,9 @@ public: + QLabel *update_lab; + QLabel *tip_lab; + QLabel *tip_lab1; ++ QTimer *delayTimer; ++ QTimer *delayTimer_Checker; ++ unsigned int delaytime; + + QPushButton *agreebtn; + QPushButton *disagreebtn; +@@ -78,7 +82,9 @@ public: + void initset_window_position(); + void listenPanelChange(); + void initPanelDbusGsetting(); // 初始化与任务栏gsetting和dbus +- ++public slots: ++ void delayTimeout(); ++ void delayTimeOutChecker(); + private: + Ui::Form *ui; + void paintEvent(QPaintEvent *e); +diff --git a/translations/kylin-background-upgrade_zh_CN.qm b/translations/kylin-background-upgrade_zh_CN.qm +index 99232f2..c9d0fd6 100644 +--- a/translations/kylin-background-upgrade_zh_CN.qm ++++ b/translations/kylin-background-upgrade_zh_CN.qm +@@ -1,2 +1,2 @@ +-<�d��!�`���B���������A�J��{��1���F�����*y�����*y���L�*y���6�������嚲��<�����ƨ�����S���ƨ���(G^��������f������ 5�2���i��p���|�~�kcW(�Y��f�e��������The system is updating silently���trayicon���|�~�kcW(�Y��f�e��������The system is updating silently��� updateTip���h�mKR0g |�~�f�e��������System update detected���updatehandle���$|�~�[�bN��yQs�.f�e��^���`�z�Ss��T/�������]The system has completed an important update, It is recommended that you restart immediately.���updatehandle���|�~�kcW(�Y��f�e��������The system is updating silently���updatehandle���TS�f�e�z^��������kylin-background-upgrade���updatehandle���|�~�SG~��������update���updatehandle���SG~�Y1�%�������update error���updatehandle���c����������Delay���updatewidget���N SAR��������� In 30 minutes���updatewidget��� +-Q�N Q�cБ��������No reminders���updatewidget���z�Ssf�e��������Update���updatewidget���W(�������at���updatewidget���N�Y)�������five day later���updatewidget���N�N*\e��������five hours later���updatewidget���N�Y)������� one day later���updatewidget���N�N*\e��������one hours later���updatewidget���N Y)�������three day later���updatewidget +\ No newline at end of file ++<�d��!�`���B���x�����A�J��{��1���F�����*y�����*y���L�*y�������������ƨ�����S���ƨ���(G^���������� 5�2��fi������|�~�kcW(�Y��f�e��������The system is updating silently���trayicon���|�~�kcW(�Y��f�e��������The system is updating silently��� updateTip���h�mKR0g |�~�f�e��������System update detected���updatehandle���$|�~�[�bN��yQs�.f�e��^���`�z�Ss��T/�������]The system has completed an important update, It is recommended that you restart immediately.���updatehandle���|�~�kcW(�Y��f�e��������The system is updating silently���updatehandle���TS�f�e�z^��������kylin-background-upgrade���updatehandle���|�~�SG~��������update���updatehandle���SG~�Y1�%�������update error���updatehandle���c����������Delay���updatewidget���N SAR��������� In 30 minutes���updatewidget��� ++Q�N Q�cБ��������No reminders���updatewidget���z�Ssf�e��������Update���updatewidget���W(�������at���updatewidget���N�Y)������� one day later���updatewidget���N N*\e��������three hours later���updatewidget +\ No newline at end of file +diff --git a/translations/kylin-background-upgrade_zh_CN.ts b/translations/kylin-background-upgrade_zh_CN.ts +index 2e07623..baec187 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="464"/> ++ <location filename="../src/updatewidget.cpp" line="445"/> + <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="303"/> +- <location filename="../src/updatehandle.cpp" line="310"/> +- <location filename="../src/updatehandle.cpp" line="315"/> ++ <location filename="../src/updatehandle.cpp" line="298"/> ++ <location filename="../src/updatehandle.cpp" line="306"/> ++ <location filename="../src/updatehandle.cpp" line="312"/> + <source>The system is updating silently</source> + <translation>系统正在静默更新</translation> + </message> +@@ -50,8 +50,8 @@ + <translation type="vanished">检测到有系统更新</translation> + </message> + <message> +- <location filename="../src/updatehandle.cpp" line="105"/> +- <location filename="../src/updatehandle.cpp" line="336"/> ++ <location filename="../src/updatehandle.cpp" line="100"/> ++ <location filename="../src/updatehandle.cpp" line="334"/> + <source>System update detected</source> + <translation>检测到有系统更新</translation> + </message> +@@ -60,42 +60,33 @@ + <translation type="obsolete">系统完成一项关键更新,部分软件包更新失败,建议您立即重启</translation> + </message> + <message> +- <location filename="../src/updatehandle.cpp" line="482"/> +- <location filename="../src/updatehandle.cpp" line="483"/> ++ <location filename="../src/updatehandle.cpp" line="471"/> + <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="485"/> ++ <location filename="../src/updatehandle.cpp" line="473"/> + <source>update error</source> + <translation>升级失败</translation> + </message> + <message> +- <location filename="../src/updatehandle.cpp" line="518"/> ++ <location filename="../src/updatehandle.cpp" line="508"/> + <source>kylin-background-upgrade</source> + <translation>后台更新程序</translation> + </message> + <message> +- <location filename="../src/updatehandle.cpp" line="521"/> ++ <location filename="../src/updatehandle.cpp" line="511"/> + <source>update</source> + <translation>系统升级</translation> + </message> + </context> + <context> + <name>updatewidget</name> +- <message> +- <source>Please remind me later</source> +- <translation type="vanished">请在以下时间段之后提醒我</translation> +- </message> + <message> + <location filename="../src/updatewidget.cpp" line="40"/> + <source>at</source> + <translation>在</translation> + </message> +- <message> +- <source>No more reminders</source> +- <translation type="vanished">内不再提醒</translation> +- </message> + <message> + <location filename="../src/updatewidget.cpp" line="42"/> + <source>No reminders</source> +@@ -108,18 +99,8 @@ + </message> + <message> + <location filename="../src/updatewidget.cpp" line="53"/> +- <source>one hours later</source> +- <translation>一个小时</translation> +- </message> +- <message> +- <location filename="../src/updatewidget.cpp" line="53"/> +- <source>three day later</source> +- <translation>三天</translation> +- </message> +- <message> +- <location filename="../src/updatewidget.cpp" line="53"/> +- <source>five day later</source> +- <translation>五天</translation> ++ <source>three hours later</source> ++ <translation>三个小时</translation> + </message> + <message> + <location filename="../src/updatewidget.cpp" line="60"/> +@@ -131,31 +112,10 @@ + <source>Delay</source> + <translation>推迟</translation> + </message> +- <message> +- <source>Two hours later</source> +- <translation type="vanished">两个小时</translation> +- </message> +- <message> +- <location filename="../src/updatewidget.cpp" line="53"/> +- <source>five hours later</source> +- <translation>五个小时</translation> +- </message> + <message> + <location filename="../src/updatewidget.cpp" line="53"/> + <source>one day later</source> + <translation>一天</translation> + </message> +- <message> +- <source>two day later</source> +- <translation type="vanished">两天</translation> +- </message> +- <message> +- <source>Agree</source> +- <translation type="vanished">立即更新</translation> +- </message> +- <message> +- <source>Disagree</source> +- <translation type="vanished">推迟</translation> +- </message> + </context> + </TS> diff --git a/debian/patches/series b/debian/patches/series index a2c5c76..61e1f87 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ 0001-patch-from-zhangdongwei.patch +0002-index-0.patch