From 26bf3bf21625d70f8269510a1d60d9895d950a83 Mon Sep 17 00:00:00 2001 From: kangshuning Date: Wed, 13 Oct 2021 13:54:57 +0800 Subject: [PATCH 1/3] bug#81259:delay --- .../kylinnetworkresourcemanager.cpp | 5 ++++- src/frontend/tab-pages/lanpage.cpp | 4 ++-- translations/kylin-nm_zh_CN.qm | Bin 6255 -> 6541 bytes 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/backend/dbus-interface/kylinnetworkresourcemanager.cpp b/src/backend/dbus-interface/kylinnetworkresourcemanager.cpp index b1156588..018bb7c5 100644 --- a/src/backend/dbus-interface/kylinnetworkresourcemanager.cpp +++ b/src/backend/dbus-interface/kylinnetworkresourcemanager.cpp @@ -17,6 +17,8 @@ */ #include "kylinnetworkresourcemanager.h" +#define SIGNAL_DELAY 80000 +#define EMIT_DELAY 10000 KyNetworkResourceManager* KyNetworkResourceManager::m_pInstance = nullptr; @@ -556,9 +558,10 @@ void KyNetworkResourceManager::onActiveConnectionChanged( if (activeConnect->isValid()) { qDebug()<<"!New state change activate connect"<uuid(); qDebug()<<"!New the active connect state"<state() != state) { qDebug()<<"connect real state"<state() <<"change state"<uuid(), state, NetworkManager::ActiveConnection::Reason::UknownReason); diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index 3a77c360..42abe2c7 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -684,9 +684,9 @@ void LanPage::initUI() QListWidgetItem *LanPage::addNewItem(KyConnectItem *itemData, QListWidget *listWidget) { - QListWidgetItem *p_listWidgetItem = new QListWidgetItem(listWidget); + QListWidgetItem *p_listWidgetItem = new QListWidgetItem(); p_listWidgetItem->setSizeHint(QSize(listWidget->width(),ITEM_HEIGHT)); - listWidget->addItem(p_listWidgetItem); + listWidget->insertItem(0, p_listWidgetItem); LanListItem *p_lanItem = nullptr; if (itemData != nullptr) { diff --git a/translations/kylin-nm_zh_CN.qm b/transl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ODZq>= z$==#qokb0KO^z!p z{MPnZ#-_-*{g<_S&0}i(-1^KExmDQ9tZuhuDM>W|>Krk7UE zajg_POK*u(E_hSqKRWMC(;*fTjC@cT(OIsn#Pn-LWitXoaSAc?T#XVf)^E8c+x)!! Hek1aKQ9 Date: Thu, 14 Oct 2021 09:03:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?simplify=20translation=20methods=EF=BC=9B?= =?UTF-8?q?=20Ignore=20dependent=20details=20to=20prevent=20compilation=20?= =?UTF-8?q?errors=20=E7=AE=80=E5=8C=96=E7=BF=BB=E8=AF=91=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=EF=BC=9B=E5=BF=BD=E7=95=A5=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E7=9A=84=E8=AF=A6=E6=83=85=E4=BB=A5=E9=98=B2=E6=AD=A2=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/control | 3 +-- debian/rules | 4 ++++ src/main.cpp | 16 +++++++--------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/debian/control b/debian/control index 0dec5721..c34468cd 100644 --- a/debian/control +++ b/debian/control @@ -16,14 +16,13 @@ Build-Depends: debhelper (>=9), libx11-dev, libqt5svg5-dev, libkf5networkmanagerqt-dev (>= 5.36.0), - libnm-dev, + libnm-dev, libcap-dev, Standards-Version: 4.5.0 Rules-Requires-Root: no Homepage: https://github.com/ukui/kylin-nm Vcs-Git: https://github.com/ukui/kylin-nm.git Vcs-Browser: https://github.com/ukui/kylin-nm - Package: kylin-nm Architecture: any Depends: network-manager (>=1.2.6), diff --git a/debian/rules b/debian/rules index 545fc119..9454d51a 100755 --- a/debian/rules +++ b/debian/rules @@ -28,3 +28,7 @@ override_dh_auto_clean: override_dh_auto_build: dh_auto_build -- $(MAKE_OPTS) + +override_dh_shlibdeps: + dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info + diff --git a/src/main.cpp b/src/main.cpp index cac828c9..6c34052a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -85,6 +85,7 @@ int main(int argc, char *argv[]) QtSingleApplication a(id, argc, argv); qInstallMessageHandler(messageOutput); if (a.isRunning()) { + qInfo() << "Kylin-Network-Manager Is Already Launched, just show"; auto connection = QDBusConnection::sessionBus(); QDBusInterface iface("com.kylin.network", "/com/kylin/network", @@ -94,22 +95,19 @@ int main(int argc, char *argv[]) return 0; } - qDebug()<<"Kylin Network Manager Is Already Launched"; - QApplication::setQuitOnLastWindowClosed(false); // Internationalization QString locale = QLocale::system().name(); QTranslator trans_global; - if (locale == "zh_CN") { - trans_global.load(":/translations/kylin-nm_zh_CN.qm"); + qDebug() << "QLocale " << QLocale(); + if (trans_global.load(QLocale(), "kylin-nm", "_", ":/translations/")) + { a.installTranslator(&trans_global); + qDebug()<<"Translations load success"; + } else { + qWarning() << "Translations load fail"; } - if (locale == "tr_TR") { - trans_global.load(":/translations/kylin-nm_tr.qm"); - a.installTranslator(&trans_global); - } - qDebug()<<"Translations Are Already Loaded"; MainWindow w; w.setProperty("useStyleWindowManager", false); //禁用拖动 From 7aa0c6852544a40ecf6ed74ce83204e8008b2f71 Mon Sep 17 00:00:00 2001 From: kangshuning Date: Thu, 14 Oct 2021 09:56:27 +0800 Subject: [PATCH 3/3] update icon --- src/frontend/list-items/lanlistitem.cpp | 2 +- src/frontend/netdetails/detailitem.cpp | 6 ++++++ src/frontend/netdetails/detailitem.h | 16 ++++++++++++++++ src/frontend/tab-pages/lanpage.cpp | 2 +- 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/frontend/netdetails/detailitem.cpp create mode 100644 src/frontend/netdetails/detailitem.h diff --git a/src/frontend/list-items/lanlistitem.cpp b/src/frontend/list-items/lanlistitem.cpp index d9aaddd8..a08850e7 100644 --- a/src/frontend/list-items/lanlistitem.cpp +++ b/src/frontend/list-items/lanlistitem.cpp @@ -32,7 +32,7 @@ LanListItem::LanListItem(KyConnectItem *data, QString deviceName, QWidget *paren LanListItem::LanListItem(QWidget *parent) : ListItem(parent) { m_isActive = false; - m_netButton->setButtonIcon(QIcon::fromTheme("network-wireless-signal-none-symbolic")); + m_netButton->setButtonIcon(QIcon::fromTheme("network-offline-symbolic")); const QString str=tr("Not connected"); m_nameLabel->setText(str); this->m_infoButton->hide(); diff --git a/src/frontend/netdetails/detailitem.cpp b/src/frontend/netdetails/detailitem.cpp new file mode 100644 index 00000000..be9001a4 --- /dev/null +++ b/src/frontend/netdetails/detailitem.cpp @@ -0,0 +1,6 @@ +#include "detailitem.h" + +DetailItem::DetailItem(QWidget *parent) : QWidget(parent) +{ + +} diff --git a/src/frontend/netdetails/detailitem.h b/src/frontend/netdetails/detailitem.h new file mode 100644 index 00000000..6e775c6f --- /dev/null +++ b/src/frontend/netdetails/detailitem.h @@ -0,0 +1,16 @@ +#ifndef DETAILITEM_H +#define DETAILITEM_H + +#include + +class DetailItem : public QWidget +{ + Q_OBJECT +public: + explicit DetailItem(QWidget *parent = nullptr); + +signals: + +}; + +#endif // DETAILITEM_H diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index 42abe2c7..4b3eb211 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -22,6 +22,7 @@ LanPage::LanPage(QWidget *parent) : TabPage(parent) m_activeResourse = new KyActiveConnectResourse(this); m_connectResourse = new KyConnectResourse(this); m_deviceResource = new KyNetworkDeviceResourse(this); + m_wiredConnectOperation = new KyWiredConnectOperation(this); initUI(); initNetSwitch(); @@ -679,7 +680,6 @@ void LanPage::initUI() inactiveLanListLayout->addWidget(m_inactivatedLanListWidget); m_settingsLabel->installEventFilter(this); -// emit this->lanConnectChanged(); } QListWidgetItem *LanPage::addNewItem(KyConnectItem *itemData, QListWidget *listWidget)