From ee491b775a8a616cd37ae6a07c78ffa0908ce8cb Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Wed, 6 Jul 2022 13:09:09 +0800 Subject: [PATCH 1/7] =?UTF-8?q?fix=20bug=20128215=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=9C=89=E7=BA=BF/=E6=97=A0=E7=BA=BF?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/component/AddBtn/addnetbtn.cpp | 5 +++++ plugins/component/AddBtn/grayinfobutton.cpp | 14 ++++++++++++++ plugins/component/AddBtn/grayinfobutton.h | 15 +++++++++++++++ plugins/component/addbtn.pri | 2 ++ plugins/netconnect/lanitem.cpp | 7 ++++++- plugins/netconnect/lanitem.h | 5 +++-- plugins/netconnect/netconnect.cpp | 4 ++-- plugins/wlanconnect/wlanconnect.cpp | 2 +- plugins/wlanconnect/wlanitem.cpp | 7 ++++++- plugins/wlanconnect/wlanitem.h | 5 +++-- 10 files changed, 57 insertions(+), 9 deletions(-) create mode 100644 plugins/component/AddBtn/grayinfobutton.cpp create mode 100644 plugins/component/AddBtn/grayinfobutton.h diff --git a/plugins/component/AddBtn/addnetbtn.cpp b/plugins/component/AddBtn/addnetbtn.cpp index 40ff3bac..f186a922 100644 --- a/plugins/component/AddBtn/addnetbtn.cpp +++ b/plugins/component/AddBtn/addnetbtn.cpp @@ -34,6 +34,11 @@ AddNetBtn::AddNetBtn(bool isWlan, QWidget *parent) : QPushButton(parent) this->setMaximumSize(QSize(16777215, 60)); this->setProperty("useButtonPalette", true); this->setFlat(true); + QPalette pal = this->palette(); + QColor color = pal.color(QPalette::Button); + color.setAlphaF(0.5); + pal.setColor(QPalette::Button, color); + this->setPalette(pal); QHBoxLayout *addLyt = new QHBoxLayout; QLabel *iconLabel = new QLabel(); diff --git a/plugins/component/AddBtn/grayinfobutton.cpp b/plugins/component/AddBtn/grayinfobutton.cpp new file mode 100644 index 00000000..79367a9f --- /dev/null +++ b/plugins/component/AddBtn/grayinfobutton.cpp @@ -0,0 +1,14 @@ +#include "grayinfobutton.h" + +#include + +#define BUTTON_SIZE 36,36 +#define ICON_SIZE 16,16 + +GrayInfoButton::GrayInfoButton(QWidget *parent): QPushButton(parent) +{ + this->setFixedSize(BUTTON_SIZE); + this->setIcon(QIcon::fromTheme("preferences-system-details-symbolic")); + this->setProperty("useButtonPalette", true); + this->setFlat(true); +} diff --git a/plugins/component/AddBtn/grayinfobutton.h b/plugins/component/AddBtn/grayinfobutton.h new file mode 100644 index 00000000..707fa087 --- /dev/null +++ b/plugins/component/AddBtn/grayinfobutton.h @@ -0,0 +1,15 @@ +#ifndef GRAYINFOBUTTON_H +#define GRAYINFOBUTTON_H + +#include +#include + +class GrayInfoButton : public QPushButton +{ + Q_OBJECT +public: + explicit GrayInfoButton(QWidget * parent = nullptr); + ~GrayInfoButton() = default; +}; + +#endif // GRAYINFOBUTTON_H diff --git a/plugins/component/addbtn.pri b/plugins/component/addbtn.pri index c22c6e7c..f3961167 100644 --- a/plugins/component/addbtn.pri +++ b/plugins/component/addbtn.pri @@ -2,8 +2,10 @@ SOURCES += \ $$PWD/AddBtn/addnetbtn.cpp \ + $$PWD/AddBtn/grayinfobutton.cpp HEADERS += \ $$PWD/AddBtn/addnetbtn.h \ + $$PWD/AddBtn/grayinfobutton.h diff --git a/plugins/netconnect/lanitem.cpp b/plugins/netconnect/lanitem.cpp index b61e4693..a8903cf3 100644 --- a/plugins/netconnect/lanitem.cpp +++ b/plugins/netconnect/lanitem.cpp @@ -31,6 +31,11 @@ LanItem::LanItem(bool isAcitve, QWidget *parent) this->setMinimumSize(550, 58); this->setProperty("useButtonPalette", true); this->setFlat(true); + QPalette pal = this->palette(); + QColor color = pal.color(QPalette::Button); + color.setAlphaF(0.5); + pal.setColor(QPalette::Button, color); + this->setPalette(pal); // setStyleSheet("QPushButton:!checked{background-color: palette(base)}"); QHBoxLayout *mLanLyt = new QHBoxLayout(this); mLanLyt->setContentsMargins(16,0,16,0); @@ -41,7 +46,7 @@ LanItem::LanItem(bool isAcitve, QWidget *parent) statusLabel = new QLabel(this); statusLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); // statusLabel->setMinimumSize(36,36); - infoLabel = new InfoButton(this); + infoLabel = new GrayInfoButton(this); mLanLyt->addWidget(iconLabel); mLanLyt->addWidget(titileLabel,Qt::AlignLeft); mLanLyt->addStretch(); diff --git a/plugins/netconnect/lanitem.h b/plugins/netconnect/lanitem.h index 6bdfa854..ea1b1355 100644 --- a/plugins/netconnect/lanitem.h +++ b/plugins/netconnect/lanitem.h @@ -30,7 +30,8 @@ #include #include #include "fixlabel.h" -#include "infobutton.h" +//#include "infobutton.h" +#include "../component/AddBtn/grayinfobutton.h" class LanItem : public QPushButton { @@ -39,7 +40,7 @@ public: ~LanItem(); public: QLabel * iconLabel = nullptr; - InfoButton * infoLabel = nullptr; + GrayInfoButton * infoLabel = nullptr; FixLabel * titileLabel = nullptr; QLabel * statusLabel = nullptr; diff --git a/plugins/netconnect/netconnect.cpp b/plugins/netconnect/netconnect.cpp index 2dbe580c..4bc29246 100644 --- a/plugins/netconnect/netconnect.cpp +++ b/plugins/netconnect/netconnect.cpp @@ -438,7 +438,7 @@ void NetConnect::addLanItem(ItemFrame *frame, QString devName, QStringList infoL lanItem->uuid = infoList.at(1); lanItem->dbusPath = infoList.at(2); - connect(lanItem->infoLabel, &InfoButton::clicked, this, [=]{ + connect(lanItem->infoLabel, &GrayInfoButton::clicked, this, [=]{ // open landetail page if (!m_interface->isValid()) { return; @@ -707,7 +707,7 @@ void NetConnect::addOneLanFrame(ItemFrame *frame, QString deviceName, QStringLis lanItem->uuid = connUuid; lanItem->dbusPath = connDbusPath; - connect(lanItem->infoLabel, &InfoButton::clicked, this, [=]{ + connect(lanItem->infoLabel, &GrayInfoButton::clicked, this, [=]{ // open landetail page if (!m_interface->isValid()) { return; diff --git a/plugins/wlanconnect/wlanconnect.cpp b/plugins/wlanconnect/wlanconnect.cpp index 62a6e935..8a824af3 100644 --- a/plugins/wlanconnect/wlanconnect.cpp +++ b/plugins/wlanconnect/wlanconnect.cpp @@ -1026,7 +1026,7 @@ void WlanConnect::addOneWlanFrame(ItemFrame *frame, QString deviceName, QString wlanItem->statusLabel->setText(""); } - connect(wlanItem->infoLabel, &InfoButton::clicked, this, [=]{ + connect(wlanItem->infoLabel, &GrayInfoButton::clicked, this, [=]{ // open detail page if (!m_interface->isValid()) { return; diff --git a/plugins/wlanconnect/wlanitem.cpp b/plugins/wlanconnect/wlanitem.cpp index 9ea091b1..01d8b269 100644 --- a/plugins/wlanconnect/wlanitem.cpp +++ b/plugins/wlanconnect/wlanitem.cpp @@ -33,6 +33,11 @@ WlanItem::WlanItem(bool bAcitve, bool isLock, QWidget *parent) this->setMinimumSize(550, 58); this->setProperty("useButtonPalette", true); this->setFlat(true); + QPalette pal = this->palette(); + QColor color = pal.color(QPalette::Button); + color.setAlphaF(0.5); + pal.setColor(QPalette::Button, color); + this->setPalette(pal); QHBoxLayout *mLanLyt = new QHBoxLayout(this); mLanLyt->setContentsMargins(16,0,16,0); mLanLyt->setSpacing(16); @@ -41,7 +46,7 @@ WlanItem::WlanItem(bool bAcitve, bool isLock, QWidget *parent) statusLabel = new QLabel(this); statusLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); // statusLabel->setMinimumSize(36,36); - infoLabel = new InfoButton(this); + infoLabel = new GrayInfoButton(this); mLanLyt->addWidget(iconLabel); mLanLyt->addWidget(titileLabel,Qt::AlignLeft); mLanLyt->addStretch(); diff --git a/plugins/wlanconnect/wlanitem.h b/plugins/wlanconnect/wlanitem.h index 3bfff005..035daccf 100644 --- a/plugins/wlanconnect/wlanitem.h +++ b/plugins/wlanconnect/wlanitem.h @@ -29,7 +29,8 @@ #include #include #include "fixlabel.h" -#include "infobutton.h" +//#include "infobutton.h" +#include "../component/AddBtn/grayinfobutton.h" class WlanItem : public QPushButton { @@ -38,7 +39,7 @@ public: ~WlanItem(); public: QLabel * iconLabel = nullptr; - InfoButton * infoLabel = nullptr; + GrayInfoButton * infoLabel = nullptr; FixLabel * titileLabel = nullptr; QLabel * statusLabel = nullptr; QString uuid = ""; From 76190c5ec7c526493e0ea5ba5be305caf3c85e5e Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Thu, 7 Jul 2022 15:22:23 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=89=98=E7=9B=98info=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E9=80=82=E9=85=8D=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/tools/infobutton.cpp | 35 ++++++++++++++++++++++++++----- src/frontend/tools/infobutton.h | 6 ++++++ 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/src/frontend/tools/infobutton.cpp b/src/frontend/tools/infobutton.cpp index 5e57f880..46d52708 100644 --- a/src/frontend/tools/infobutton.cpp +++ b/src/frontend/tools/infobutton.cpp @@ -26,8 +26,10 @@ #define ICON_SIZE 16,16 #define BACKGROUND_COLOR QColor(0,0,0,0) #define FOREGROUND_COLOR_NORMAL qApp->palette().text().color() -#define FOREGROUND_COLOR_HOVER QColor(55,144,250,255) -#define FOREGROUND_COLOR_PRESS QColor(36,109,212,255) +//#define FOREGROUND_COLOR_HOVER QColor(55,144,250,255) +//#define FOREGROUND_COLOR_PRESS QColor(36,109,212,255) +#define FOREGROUND_COLOR_BRIGHTTEXT qApp->palette().brightText().color() +#define FOREGROUND_COLOR_HIGHLIGHT qApp->palette().highlight().color() #define OUTER_PATH 8,8,16,16 #define INNER_PATH 9,9,14,14 #define TEXT_POS 14,5,16,16,0 @@ -54,6 +56,26 @@ void InfoButton::onPaletteChanged() this->repaint(); } +QColor InfoButton::mixColor(const QColor &c1, const QColor &c2, qreal bias) +{ + if (bias <= 0.0) { + return c1; + } + if (bias >= 1.0) { + return c2; + } + if (qIsNaN(bias)) { + return c1; + } + + qreal r = mixQreal(c1.redF(), c2.redF(), bias); + qreal g = mixQreal(c1.greenF(), c2.greenF(), bias); + qreal b = mixQreal(c1.blueF(), c2.blueF(), bias); + qreal a = mixQreal(c1.alphaF(), c2.alphaF(), bias); + + return QColor::fromRgbF(r, g, b, a); +} + void InfoButton::paintEvent(QPaintEvent *event) { QPalette pal = this->palette(); @@ -87,7 +109,8 @@ void InfoButton::paintEvent(QPaintEvent *event) void InfoButton::enterEvent(QEvent *event) { - m_foregroundColor = FOREGROUND_COLOR_HOVER; +// m_foregroundColor = FOREGROUND_COLOR_HOVER; + m_foregroundColor = FOREGROUND_COLOR_HIGHLIGHT; this->update(); } @@ -99,14 +122,16 @@ void InfoButton::leaveEvent(QEvent *event) void InfoButton::mousePressEvent(QMouseEvent *event) { - m_foregroundColor = FOREGROUND_COLOR_PRESS; +// m_foregroundColor = FOREGROUND_COLOR_PRESS; + m_foregroundColor = mixColor(FOREGROUND_COLOR_HIGHLIGHT, FOREGROUND_COLOR_BRIGHTTEXT, 0.2); this->update(); return QPushButton::mousePressEvent(event); } void InfoButton::mouseReleaseEvent(QMouseEvent *event) { - m_foregroundColor = FOREGROUND_COLOR_HOVER; +// m_foregroundColor = FOREGROUND_COLOR_HOVER; + m_foregroundColor = mixColor(FOREGROUND_COLOR_HIGHLIGHT, FOREGROUND_COLOR_BRIGHTTEXT, 0.2); this->update(); return QPushButton::mouseReleaseEvent(event); } diff --git a/src/frontend/tools/infobutton.h b/src/frontend/tools/infobutton.h index b10a2774..03897886 100644 --- a/src/frontend/tools/infobutton.h +++ b/src/frontend/tools/infobutton.h @@ -39,6 +39,12 @@ protected: private: void initUI(); + static inline qreal mixQreal(qreal a, qreal b, qreal bias) + { + return a + (b - a) * bias; + } + QColor mixColor(const QColor &c1, const QColor &c2, qreal bias); + private: QColor m_backgroundColor; QColor m_foregroundColor; From 57606fbee442d6930f50cdb1c5332334704b2e51 Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Fri, 8 Jul 2022 09:21:10 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fix=20bug=20126739=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E4=B8=8E=E6=96=AD=E5=BC=80=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/tab-pages/lanpage.cpp | 4 ++-- src/frontend/tab-pages/wlanpage.cpp | 6 ++++-- src/frontend/tab-pages/wlanpage.h | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index 8c31b782..b2c4dd44 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -841,7 +841,7 @@ void LanPage::updateActivatedConnectionArea(KyConnectItem *p_newItem) deleteConnectionMapItem(m_activeConnectionMap, m_activatedLanListWidget, EMPTY_CONNECT_UUID); QListWidgetItem *p_listWidgetItem = addNewItem(p_newItem, m_activatedLanListWidget); m_activeConnectionMap.insert(p_newItem->m_connectUuid, p_listWidgetItem); - this->showDesktopNotify(tr("LAN Connected Successfully"), "networkconnected"); +// this->showDesktopNotify(tr("LAN Connected Successfully"), "networkconnected"); } if (m_inactivatedLanListWidget->count() < MAX_ITEMS) { m_inactivatedLanListWidget->setFixedWidth(MIN_WIDTH); @@ -865,7 +865,7 @@ void LanPage::updateConnectionArea(KyConnectItem *p_newItem) qDebug()<<"[LanPage] update connection item"<m_connectName; QListWidgetItem *p_listWidgetItem = insertNewItem(p_newItem, m_inactivatedLanListWidget); m_inactiveConnectionMap.insert(p_newItem->m_connectUuid, p_listWidgetItem); - this->showDesktopNotify(tr("LAN Disconnected Successfully"), "networkdisconnected"); +// this->showDesktopNotify(tr("LAN Disconnected Successfully"), "networkdisconnected"); } if (m_inactivatedLanListWidget->count() < MAX_ITEMS) { m_inactivatedLanListWidget->setFixedWidth(MIN_WIDTH); diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index d106e0b6..ca85f1df 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -560,7 +560,7 @@ void WlanPage::onWlanRemoved(QString interface, QString ssid) } else { deleteWirelessItemFormMap(m_activateConnectionItemMap, m_activatedNetListWidget, ssid); - showDesktopNotify(tr("WLAN Disconnected Successfully"), "networkdisconnected"); +// showDesktopNotify(tr("WLAN Disconnected Successfully"), "networkdisconnected"); QListWidgetItem *p_listWidgetItem = addEmptyItem(m_activatedNetListWidget); m_activateConnectionItemMap.insert(EMPTY_SSID, p_listWidgetItem); @@ -812,6 +812,7 @@ void WlanPage::sendApStateChangeSignal(QString uuid, return; } +#if 0 void WlanPage::wlanShowNotify(QString ssid, NetworkManager::ActiveConnection::State state, NetworkManager::ActiveConnection::Reason reason) { @@ -825,6 +826,7 @@ void WlanPage::wlanShowNotify(QString ssid, NetworkManager::ActiveConnection::St return; } +#endif void WlanPage::updateActivatedArea(QString uuid, QString ssid, QString devName) { @@ -922,7 +924,7 @@ void WlanPage::onConnectionStateChanged(QString uuid, !m_activateConnectionItemMap.contains(ssid)) { qDebug() << "wlan remove before deactivated"; } else { - wlanShowNotify(ssid, state, reason); +// wlanShowNotify(ssid, state, reason); } } diff --git a/src/frontend/tab-pages/wlanpage.h b/src/frontend/tab-pages/wlanpage.h index 40750b6e..1f3af24f 100644 --- a/src/frontend/tab-pages/wlanpage.h +++ b/src/frontend/tab-pages/wlanpage.h @@ -170,8 +170,8 @@ private: void sendApStateChangeSignal(QString uuid, QString ssid, QString deviceName, NetworkManager::ActiveConnection::State state); - void wlanShowNotify(QString ssid, NetworkManager::ActiveConnection::State state, - NetworkManager::ActiveConnection::Reason reason); +// void wlanShowNotify(QString ssid, NetworkManager::ActiveConnection::State state, +// NetworkManager::ActiveConnection::Reason reason); private: QMap m_wirelessNetItemMap; From 11b527e3e6b85c5af23b59b8a869b7872a9c2ac8 Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Fri, 8 Jul 2022 09:27:40 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=BC=80=E6=BA=90?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/component/AddBtn/grayinfobutton.cpp | 21 ++++++++++++++++++++- plugins/component/AddBtn/grayinfobutton.h | 19 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/plugins/component/AddBtn/grayinfobutton.cpp b/plugins/component/AddBtn/grayinfobutton.cpp index 79367a9f..daa4fa1d 100644 --- a/plugins/component/AddBtn/grayinfobutton.cpp +++ b/plugins/component/AddBtn/grayinfobutton.cpp @@ -1,4 +1,23 @@ -#include "grayinfobutton.h" +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * Copyright (C) 2022 Tianjin KYLIN Information Technology Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ +#include "grayinfobutton.h" #include diff --git a/plugins/component/AddBtn/grayinfobutton.h b/plugins/component/AddBtn/grayinfobutton.h index 707fa087..0024f8b7 100644 --- a/plugins/component/AddBtn/grayinfobutton.h +++ b/plugins/component/AddBtn/grayinfobutton.h @@ -1,3 +1,22 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * Copyright (C) 2022 Tianjin KYLIN Information Technology Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ #ifndef GRAYINFOBUTTON_H #define GRAYINFOBUTTON_H From 3fbfb6c7c998c6efa0699f3327071a61e1f05108 Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Fri, 15 Jul 2022 11:07:30 +0800 Subject: [PATCH 5/7] =?UTF-8?q?sdk=E6=9B=BF=E6=8D=A2common=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/mainwindow.cpp | 17 ++++++++++------- src/frontend/mainwindow.h | 1 - src/src.pro | 5 +++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index c2410a49..5287cdd5 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -31,7 +31,7 @@ #include "ukuistylehelper/ukuistylehelper.h" #include "windowmanager/windowmanager.h" - +#include "kysdk/kysdk-system/libkysysinfo.h" #define MAINWINDOW_WIDTH 420 #define MAINWINDOW_HEIGHT 476 @@ -165,16 +165,19 @@ void MainWindow::secondaryStart() */ void MainWindow::initPlatform() { - if(v10Sp1.compare(KDKGetPrjCodeName().c_str(),Qt::CaseInsensitive) == 0) { - QString feature = KDKGetOSRelease(KEY_PRODUCT_FEATURES).c_str(); - if (feature.toInt() == 3) { + char* projectName = kdk_system_get_projectName(); + QString strProjectName(projectName); + free(projectName); + projectName = NULL; + qDebug() << "!!!!" << kdk_system_get_projectName() << "!!!!" << kdk_system_get_projectSubName() << "!!!!" << kdk_system_get_productFeatures(); + if(v10Sp1.compare(strProjectName,Qt::CaseInsensitive) == 0) { + unsigned int feature = kdk_system_get_productFeatures(); + if (feature == 3) { m_isShowInCenter = true; } - } else if (intel.compare(KDKGetPrjCodeName().c_str(),Qt::CaseInsensitive) == 0) { + } else if (intel.compare(strProjectName,Qt::CaseInsensitive) == 0) { m_isShowInCenter = true; } - - qDebug() << KDKGetPrjCodeName().c_str() << KDKGetOSRelease(KEY_PRODUCT_FEATURES).c_str() << "m_isShowInCenter" << m_isShowInCenter; } /** diff --git a/src/frontend/mainwindow.h b/src/frontend/mainwindow.h index d1c507f4..b384fb6a 100644 --- a/src/frontend/mainwindow.h +++ b/src/frontend/mainwindow.h @@ -33,7 +33,6 @@ #include "lanpage.h" #include "wlanpage.h" #include "netdetails/netdetail.h" -#include #ifdef WITHKYSEC #include diff --git a/src/src.pro b/src/src.pro index ba28497b..1ba8af46 100644 --- a/src/src.pro +++ b/src/src.pro @@ -15,11 +15,12 @@ CONFIG += c++14 qt warn_on link_pkgconfig #CONFIG += release PKGCONFIG +=gio-2.0 glib-2.0 gio-unix-2.0 libnm libnma libsecret-1 gtk+-3.0 gsettings-qt libcap kysdk-qtwidgets kysdk-waylandhelper +PKGCONFIG +=kysdk-system INCLUDEPATH += /usr/include/KF5/NetworkManagerQt -LIBS += -L/usr/lib/ -lgsettings-qt -lX11 -lKF5NetworkManagerQt -lukui-log4qt -lukui-com4c -lukui-com4cxx -lkysec -#LIBS += -lkysec +LIBS += -L/usr/lib/ -lgsettings-qt -lX11 -lKF5NetworkManagerQt -lukui-log4qt -lkysec + target.path = /usr/bin target.source += $$TARGET desktop.path = /etc/xdg/autostart/ From 0b53b58d9338ca98aa4d4a6f2de044d277c71e18 Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Fri, 15 Jul 2022 11:09:05 +0800 Subject: [PATCH 6/7] remove useless log --- src/frontend/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index 5287cdd5..0bb53675 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -169,7 +169,6 @@ void MainWindow::initPlatform() QString strProjectName(projectName); free(projectName); projectName = NULL; - qDebug() << "!!!!" << kdk_system_get_projectName() << "!!!!" << kdk_system_get_projectSubName() << "!!!!" << kdk_system_get_productFeatures(); if(v10Sp1.compare(strProjectName,Qt::CaseInsensitive) == 0) { unsigned int feature = kdk_system_get_productFeatures(); if (feature == 3) { @@ -178,6 +177,7 @@ void MainWindow::initPlatform() } else if (intel.compare(strProjectName,Qt::CaseInsensitive) == 0) { m_isShowInCenter = true; } + qDebug() << "projectName" << projectName << m_isShowInCenter; } /** From 3e4848219c6f33e7d7c49bd907bc0d342910b3fe Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Fri, 15 Jul 2022 11:41:56 +0800 Subject: [PATCH 7/7] modify control --- debian/control | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 3cc5a13b..6528159a 100644 --- a/debian/control +++ b/debian/control @@ -24,7 +24,7 @@ Build-Depends: debhelper (>=9), libukcc-dev (>= 3.1.1+1217), libukui-log4qt-dev, libkysdk-qtwidgets-dev(>= 1.2.0), - libukui-common-dev, + libkysdk-sysinfo-dev, libkysdk-waylandhelper-dev(>= 1.2.0kylin2), libkysec-dev, Standards-Version: 4.5.0 @@ -39,6 +39,7 @@ Depends: network-manager (>=1.2.6), ukui-control-center (>= 3.1.1+1217), libkysdk-qtwidgets(>= 1.2.0), libkysdk-waylandhelper(>= 1.2.0kylin2), + libkysdk-sysinfo, ${shlibs:Depends}, ${misc:Depends} Description: Gui Applet tool for display and edit network simply