From e3dd2e212774b91fd69b8ea9ee270f3eb3bc1840 Mon Sep 17 00:00:00 2001 From: yangdonghai Date: Tue, 12 Sep 2023 14:38:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=AE=B8=E5=8F=AF?= =?UTF-8?q?=E5=8D=8F=E8=AE=AEdbus=E4=B8=8D=E7=94=9F=E6=95=88=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E6=94=B9=E4=B8=BA=E5=8A=A0=E4=B8=8A=E5=B0=86?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8E=E7=9A=84dbus=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=8B=B7=E8=B4=9D=E5=88=B0=E6=96=B0=E6=96=87=E4=BB=B6=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 6 +++++ scripts/prepare/16copy-basic-filesystem | 1 + src/plugins/KyLicense/licenseframe.cpp | 32 ++++++++++++++++++++----- src/plugins/KyLicense/licenseframe.h | 1 + 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 60922ce..d0ea9e8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +kylin-os-installer (0.2.1-0k24) yangtze; urgency=medium + + * openKylin 1.0版本许可协议dbus不生效修改,改为加上将修改后的dbus文件拷贝到新文件系统中 + + -- yangdonghai Tue, 12 Sep 2023 14:28:55 +0800 + kylin-os-installer (0.2.1-0k23) yangtze; urgency=medium * openKylin 1.0版本,更新changelog diff --git a/scripts/prepare/16copy-basic-filesystem b/scripts/prepare/16copy-basic-filesystem index 41ed355..aff39dd 100755 --- a/scripts/prepare/16copy-basic-filesystem +++ b/scripts/prepare/16copy-basic-filesystem @@ -82,6 +82,7 @@ deal_squashfs rsync -aHAX /rofs/ /target msg "文件系统拷贝完成" sync +cp /var/cache/kylin-daq/kylinDaqConf.json /target/var/cache/kylin-daq/ # 加密 if [[ "${isluks_lvm}" == "true" ]]; then diff --git a/src/plugins/KyLicense/licenseframe.cpp b/src/plugins/KyLicense/licenseframe.cpp index af44de5..12537e2 100644 --- a/src/plugins/KyLicense/licenseframe.cpp +++ b/src/plugins/KyLicense/licenseframe.cpp @@ -73,7 +73,12 @@ void LicenseFrame::initUI() m_sendData = new QCheckBox; // licneseLayout->addWidget(m_sendData, 5, 1, 1, 1, Qt::AlignCenter); m_sendData->setCheckable(true); - m_sendData->setChecked(true); + int nUploadState = 0; + getUploadState(nUploadState); + if(1 == nUploadState) + m_sendData->setChecked(true); + else + m_sendData->setChecked(false); vLayout->addWidget(m_sendData, 0, Qt::AlignLeft); m_timetip = new QCheckBox; // licneseLayout->addWidget(m_timetip, 6, 1, 1, 1, Qt::AlignCenter); @@ -229,17 +234,32 @@ void LicenseFrame::setUploadState(bool isSet)//写dbus总线: 1收集;0不收 QDBusMessage messageCallStats = QDBusMessage::createMethodCall("com.kylin.daq", "/com/kylin/daq", "com.kylin.daq.interface","SetUploadState"); if (isSet) - messageCallStats << 1; + nStatus = 1; else - messageCallStats << 0; + nStatus = 0; + + messageCallStats << nStatus; QDBusMessage messageResponseStats = QDBusConnection::systemBus().call(messageCallStats); if (messageResponseStats.type() == QDBusMessage::ReplyMessage) { -// strDate = messageResponseStats.arguments().takeFirst().toInt(); -// qDebug() << "strDate:"<< strDate; - qDebug() << "Set dbus SetUploadState successfully"; + qDebug() << "Set dbus SetUploadState["<< nStatus <<"] successfully"; } else { qDebug() << "Set dbus SetUploadState error:" << QDBusConnection::systemBus().lastError().message(); } } +bool LicenseFrame::getUploadState(int& status) +{ + QDBusMessage messageCallStats = QDBusMessage::createMethodCall("com.kylin.daq", "/com/kylin/daq", + "com.kylin.daq.interface","GetUploadState"); + QDBusMessage messageResponseStats = QDBusConnection::systemBus().call(messageCallStats); + if (messageResponseStats.type() == QDBusMessage::ReplyMessage) { + status = messageResponseStats.arguments().takeFirst().toInt(); + qDebug() << "Get dbus SetUploadState successfully:"< Date: Tue, 12 Sep 2023 15:01:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/KyLicense/licenseframe.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/KyLicense/licenseframe.cpp b/src/plugins/KyLicense/licenseframe.cpp index 12537e2..da1de24 100644 --- a/src/plugins/KyLicense/licenseframe.cpp +++ b/src/plugins/KyLicense/licenseframe.cpp @@ -254,10 +254,10 @@ bool LicenseFrame::getUploadState(int& status) QDBusMessage messageResponseStats = QDBusConnection::systemBus().call(messageCallStats); if (messageResponseStats.type() == QDBusMessage::ReplyMessage) { status = messageResponseStats.arguments().takeFirst().toInt(); - qDebug() << "Get dbus SetUploadState successfully:"<