!29 网络详情页 修改IPv4DNS列表 适配高分屏

Merge pull request !29 from zy-yuan1/upstr-dev
This commit is contained in:
zhaoshixu 2023-04-10 09:56:17 +00:00 committed by Gitee
commit 20bb186817
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 35 additions and 3 deletions

View File

@ -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) {

View File

@ -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<bool> 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)

View File

@ -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
{