diff --git a/src/frontend/netdetails/detailpage.cpp b/src/frontend/netdetails/detailpage.cpp index 21517fb0..a80cc0e8 100644 --- a/src/frontend/netdetails/detailpage.cpp +++ b/src/frontend/netdetails/detailpage.cpp @@ -87,7 +87,7 @@ void DetailPage::setIpv4(const QString &ipv4) { } void DetailPage::setIpv4Dns(const QString &ipv4Dns) { - this->m_IPV4Dns->setText(ipv4Dns); + this->m_IPV4Dns->setLabelText(ipv4Dns); } void DetailPage::setIpv6(const QString &ipv6) { diff --git a/src/frontend/netdetails/netdetail.cpp b/src/frontend/netdetails/netdetail.cpp index 32cc3f89..c3df56fc 100644 --- a/src/frontend/netdetails/netdetail.cpp +++ b/src/frontend/netdetails/netdetail.cpp @@ -660,7 +660,7 @@ void NetDetail::getStaticIpInfo(ConInfo &conInfo, bool bActived) // conInfo.ipv4ConfigType = connetSetting.m_ipv4ConfigIpType; conInfo.ipv6ConfigType = connetSetting.m_ipv6ConfigIpType; - conInfo.ipv4DnsList = connetSetting.m_ipv4Dns; +// conInfo.ipv4DnsList = connetSetting.m_ipv4Dns; conInfo.ipv6DnsList = connetSetting.m_ipv6Dns; conInfo.isAutoConnect = connetSetting.m_isAutoConnect; @@ -1196,7 +1196,26 @@ void NetDetail::setNetTabToolTip() NetTabBar::NetTabBar(QWidget *parent) :KTabBar(KTabBarStyle::SegmentDark, parent) { - + //模式切换 + QDBusConnection::sessionBus().connect(QString("com.kylin.statusmanager.interface"), + QString("/"), + QString("com.kylin.statusmanager.interface"), + QString("mode_change_signal"), this, SLOT(onModeChanged(bool))); + //模式获取 + QDBusInterface interface(QString("com.kylin.statusmanager.interface"), + QString("/"), + QString("com.kylin.statusmanager.interface"), + QDBusConnection::sessionBus()); + if(!interface.isValid()) { + this->setFixedHeight(TAB_HEIGHT); + return; + } + QDBusReply reply = interface.call("get_current_tabletmode"); + if (!reply.isValid()) { + this->setFixedHeight(TAB_HEIGHT); + return; + } + onModeChanged(reply.value()); } NetTabBar::~NetTabBar() @@ -1219,6 +1238,15 @@ QSize NetTabBar::minimumTabSizeHint(int index) const return size; } +void NetTabBar::onModeChanged(bool mode) +{ + if (mode) { + this->setFixedHeight(TAB_HEIGHT_TABLET); // 平板模式 + } else { + this->setFixedHeight(TAB_HEIGHT); // PC模式 + } +} + ThreadObject::ThreadObject(QString deviceName, QObject *parent) :m_devName(deviceName), QObject(parent) diff --git a/src/frontend/netdetails/netdetail.h b/src/frontend/netdetails/netdetail.h index 1bdaadd4..567afcab 100644 --- a/src/frontend/netdetails/netdetail.h +++ b/src/frontend/netdetails/netdetail.h @@ -68,6 +68,10 @@ public: protected: QSize sizeHint() const; QSize minimumTabSizeHint(int index) const; + +private Q_SLOTS: + void onModeChanged(bool mode); + }; class ThreadObject : public QObject {