!15 解决openKylin VPN相关BUG,增加详细信息按钮,去掉标题栏
Merge pull request !15 from chenxuechao/openkylin/yangtze-fork
This commit is contained in:
commit
38b50bfe77
|
@ -26,7 +26,6 @@
|
||||||
|
|
||||||
VpnListItem::VpnListItem(const KyConnectItem *lanConnectItem, QWidget *parent):ListItem(parent)
|
VpnListItem::VpnListItem(const KyConnectItem *lanConnectItem, QWidget *parent):ListItem(parent)
|
||||||
{
|
{
|
||||||
m_infoButton->setVisible(false);
|
|
||||||
m_connectOperation = new KyWiredConnectOperation(this);
|
m_connectOperation = new KyWiredConnectOperation(this);
|
||||||
m_deviceResource = new KyNetworkDeviceResourse(this);
|
m_deviceResource = new KyNetworkDeviceResourse(this);
|
||||||
|
|
||||||
|
@ -166,37 +165,10 @@ void VpnListItem::onMenuTriggered(QAction *action)
|
||||||
|
|
||||||
void VpnListItem::onInfoButtonClicked()
|
void VpnListItem::onInfoButtonClicked()
|
||||||
{
|
{
|
||||||
// if (m_vpnConnectItem.m_connectUuid.isEmpty()) {
|
//openKylin 优先做出infoButton功能,等自研详情页面做好后合入
|
||||||
// qDebug() << LOG_FLAG << "connect is empty, so can not show detail info.";
|
QString cmd = "nm-connection-editor";
|
||||||
// return;
|
QProcess process(this);
|
||||||
// }
|
process.startDetached(cmd);
|
||||||
|
|
||||||
// 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);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,7 @@ void SinglePage::initWindowProperties()
|
||||||
this->setFixedWidth(MAX_WIDTH);
|
this->setFixedWidth(MAX_WIDTH);
|
||||||
this->setAttribute(Qt::WA_TranslucentBackground);
|
this->setAttribute(Qt::WA_TranslucentBackground);
|
||||||
this->setProperty("useStyleWindowManager", false); //禁用拖动
|
this->setProperty("useStyleWindowManager", false); //禁用拖动
|
||||||
|
this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint);
|
||||||
//绘制毛玻璃特效
|
//绘制毛玻璃特效
|
||||||
QString platform = QGuiApplication::platformName();
|
QString platform = QGuiApplication::platformName();
|
||||||
if(!platform.startsWith(QLatin1String("wayland"),Qt::CaseInsensitive))
|
if(!platform.startsWith(QLatin1String("wayland"),Qt::CaseInsensitive))
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include "windowmanager/windowmanager.h"
|
#include "windowmanager/windowmanager.h"
|
||||||
|
#include "ukuistylehelper/ukuistylehelper.h"
|
||||||
|
|
||||||
|
|
||||||
VpnPage::VpnPage(QWidget *parent) : SinglePage(parent)
|
VpnPage::VpnPage(QWidget *parent) : SinglePage(parent)
|
||||||
|
@ -649,11 +650,15 @@ void VpnPage::showDetailPage(QString devName, QString uuid)
|
||||||
void VpnPage::showUI()
|
void VpnPage::showUI()
|
||||||
{
|
{
|
||||||
//2209中窗管在hide界面时会刷新属性,需要重新设置无图标属性
|
//2209中窗管在hide界面时会刷新属性,需要重新设置无图标属性
|
||||||
const KWindowInfo info(this->winId(), NET::WMState);
|
QString platform = QGuiApplication::platformName();
|
||||||
if (!info.hasState(NET::SkipTaskbar) || !info.hasState(NET::SkipPager)) {
|
if(!platform.startsWith(QLatin1String("wayland"),Qt::CaseInsensitive)) {
|
||||||
KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager);
|
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();
|
resetPageHight();
|
||||||
|
|
||||||
showNormal();
|
showNormal();
|
||||||
|
|
|
@ -93,7 +93,7 @@ void vpnObject::deactivateVpn(const QString& connUuid)
|
||||||
|
|
||||||
void vpnObject::onShowMainWindow()
|
void vpnObject::onShowMainWindow()
|
||||||
{
|
{
|
||||||
kdk::UkuiStyleHelper::self()->removeHeader(m_vpnPage);
|
// kdk::UkuiStyleHelper::self()->removeHeader(m_vpnPage);
|
||||||
m_vpnPage->showUI();;
|
m_vpnPage->showUI();;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "dbusadaptor.h"
|
#include "dbusadaptor.h"
|
||||||
#include "vpndbusadaptor.h"
|
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include "qt-single-application.h"
|
#include "qt-single-application.h"
|
||||||
|
@ -31,6 +30,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "vpnobject.h"
|
#include "vpnobject.h"
|
||||||
|
#include "vpndbusadaptor.h"
|
||||||
|
|
||||||
#define LOG_IDENT "ukui_kylin_nm"
|
#define LOG_IDENT "ukui_kylin_nm"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue