!15 解决openKylin VPN相关BUG,增加详细信息按钮,去掉标题栏

Merge pull request !15 from chenxuechao/openkylin/yangtze-fork
This commit is contained in:
zhaoshixu 2022-12-16 03:33:14 +00:00 committed by Gitee
commit 38b50bfe77
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 15 additions and 37 deletions

View File

@ -26,7 +26,6 @@
VpnListItem::VpnListItem(const KyConnectItem *lanConnectItem, QWidget *parent):ListItem(parent)
{
m_infoButton->setVisible(false);
m_connectOperation = new KyWiredConnectOperation(this);
m_deviceResource = new KyNetworkDeviceResourse(this);
@ -166,37 +165,10 @@ void VpnListItem::onMenuTriggered(QAction *action)
void VpnListItem::onInfoButtonClicked()
{
// if (m_vpnConnectItem.m_connectUuid.isEmpty()) {
// qDebug() << LOG_FLAG << "connect is empty, so can not show detail info.";
// return;
// }
// if(netDetail != nullptr){
// netDetail->activateWindow();
// return;
// }
// qDebug()<< LOG_FLAG << "the info button of lan is clicked! uuid = "
// << m_vpnConnectItem.m_connectUuid << "; name = " << m_vpnConnectItem.m_connectName
// << "." <<Q_FUNC_INFO << __LINE__;
// bool isActivated = false;
// if (Activated == m_vpnConnectItem.m_connectState) {
// isActivated = true;
// }
// netDetail = new NetDetail(m_deviceName, m_vpnConnectItem.m_connectName,
// m_vpnConnectItem.m_connectUuid, isActivated,false, false);
// connect(netDetail, &NetDetail::destroyed, [&](){
// if (netDetail != nullptr) {
// netDetail = nullptr;
// }
// });
// netDetail->show();
// Q_EMIT this->detailShow(true);
//openKylin 优先做出infoButton功能等自研详情页面做好后合入
QString cmd = "nm-connection-editor";
QProcess process(this);
process.startDetached(cmd);
return;
}

View File

@ -92,6 +92,7 @@ void SinglePage::initWindowProperties()
this->setFixedWidth(MAX_WIDTH);
this->setAttribute(Qt::WA_TranslucentBackground);
this->setProperty("useStyleWindowManager", false); //禁用拖动
this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint);
//绘制毛玻璃特效
QString platform = QGuiApplication::platformName();
if(!platform.startsWith(QLatin1String("wayland"),Qt::CaseInsensitive))

View File

@ -21,6 +21,7 @@
#include <QDebug>
#include <QScrollBar>
#include "windowmanager/windowmanager.h"
#include "ukuistylehelper/ukuistylehelper.h"
VpnPage::VpnPage(QWidget *parent) : SinglePage(parent)
@ -649,11 +650,15 @@ void VpnPage::showDetailPage(QString devName, QString uuid)
void VpnPage::showUI()
{
//2209中窗管在hide界面时会刷新属性需要重新设置无图标属性
const KWindowInfo info(this->winId(), NET::WMState);
if (!info.hasState(NET::SkipTaskbar) || !info.hasState(NET::SkipPager)) {
KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager);
QString platform = QGuiApplication::platformName();
if(!platform.startsWith(QLatin1String("wayland"),Qt::CaseInsensitive)) {
const KWindowInfo info(this->winId(), NET::WMState);
if (!info.hasState(NET::SkipTaskbar) || !info.hasState(NET::SkipPager)) {
KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager);
}
}
kdk::UkuiStyleHelper::self()->removeHeader(this);
resetPageHight();
showNormal();

View File

@ -93,7 +93,7 @@ void vpnObject::deactivateVpn(const QString& connUuid)
void vpnObject::onShowMainWindow()
{
kdk::UkuiStyleHelper::self()->removeHeader(m_vpnPage);
// kdk::UkuiStyleHelper::self()->removeHeader(m_vpnPage);
m_vpnPage->showUI();;
}

View File

@ -18,7 +18,6 @@
#include "mainwindow.h"
#include "dbusadaptor.h"
#include "vpndbusadaptor.h"
#include <QTranslator>
#include <QLocale>
#include "qt-single-application.h"
@ -31,6 +30,7 @@
#endif
#include "vpnobject.h"
#include "vpndbusadaptor.h"
#define LOG_IDENT "ukui_kylin_nm"