fix bug 144990

This commit is contained in:
zhangyuanyuan1 2022-11-01 17:30:20 +08:00
parent f6ee9aad87
commit 88ca1c59c8
6 changed files with 51 additions and 3 deletions

View File

@ -35,6 +35,8 @@
#define TLS_SCRO_HEIGHT 560
#define MEDIUM_WEIGHT_VALUE 57
bool LaunchApp(QString desktopFile);
JoinHiddenWiFiPage::JoinHiddenWiFiPage(QString devName, KDialog *parent)
:m_devName(devName),
KDialog(parent)
@ -55,9 +57,19 @@ JoinHiddenWiFiPage::~JoinHiddenWiFiPage()
}
void JoinHiddenWiFiPage::setJoinHiddenWiFiShowed(bool state)
{
m_joinHiddenWiFiShowed = state;
}
void JoinHiddenWiFiPage::closeEvent(QCloseEvent *event)
{
Q_EMIT this->hiddenWiFiPageClose(m_devName);
if (m_joinHiddenWiFiShowed) {
LaunchApp("ukui-control-center.desktop");
m_joinHiddenWiFiShowed = false;
}
return QWidget::closeEvent(event);
}

View File

@ -43,6 +43,8 @@ public:
JoinHiddenWiFiPage(QString devName, KDialog *parent = nullptr);
~JoinHiddenWiFiPage();
void setJoinHiddenWiFiShowed(bool state);
protected:
void closeEvent(QCloseEvent *event);
@ -78,6 +80,7 @@ private:
bool m_isJoinBtnEnable = false;
bool m_isSecuOk = false;
bool m_joinHiddenWiFiShowed = false;
ConInfo m_info;
private Q_SLOTS:

View File

@ -55,9 +55,28 @@
#define PEAP_SCRO_HEIGHT 300
#define TLS_SCRO_HEIGHT 480
#define MAX_TAB_TEXT_LENGTH 44
#define KYLIN_APP_MANAGER_NAME "com.kylin.AppManager"
#define KYLIN_APP_MANAGER_PATH "/com/kylin/AppManager"
#define KYLIN_APP_MANAGER_INTERFACE "com.kylin.AppManager"
//extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed);
bool LaunchApp(QString desktopFile)
{
QDBusInterface m_appManagerDbusInterface(KYLIN_APP_MANAGER_NAME,
KYLIN_APP_MANAGER_PATH,
KYLIN_APP_MANAGER_INTERFACE,
QDBusConnection::sessionBus());//局部变量
if (!m_appManagerDbusInterface.isValid()) {
qWarning()<<"m_appManagerDbusInterface init error";
return false;
} else {
QDBusReply<bool> reply =m_appManagerDbusInterface.call("LaunchApp",desktopFile);
return reply;
}
}
void NetDetail::showDesktopNotify(const QString &message, QString soundName)
{
QDBusInterface iface("org.freedesktop.Notifications",
@ -264,6 +283,11 @@ void NetDetail::closeEvent(QCloseEvent *event)
{
Q_EMIT this->detailPageClose(false);
Q_EMIT this->createPageClose(m_deviceName);
if (m_hasDetailPageShowed) {
LaunchApp("ukui-control-center.desktop");
m_hasDetailPageShowed = false;
}
return QWidget::closeEvent(event);
}
@ -399,6 +423,7 @@ void NetDetail::loadPage()
pageFrame->hide();
stackWidget->setCurrentIndex(CREATE_NET_PAGE_NUM);
this->setWindowTitle(tr("Add Lan Connect"));
setDetailPageShowed(true);
} else {
stackWidget->setCurrentIndex(DETAIL_PAGE_NUM);
this->setWindowTitle(m_name);
@ -1131,6 +1156,11 @@ bool NetDetail::eventFilter(QObject *w, QEvent *event)
return QWidget::eventFilter(w, event);
}
void NetDetail::setDetailPageShowed(bool state)
{
m_hasDetailPageShowed = state;
}
void NetDetail::setNetTabToolTip()
{
int tabCount = m_netTabBar->count();

View File

@ -98,6 +98,8 @@ public:
void closeEvent(QCloseEvent *event);
bool eventFilter(QObject *w, QEvent *event);
void setDetailPageShowed(bool state);
private:
void initUI();
void centerToScreen();
@ -181,7 +183,7 @@ private:
bool isIpv6Ok;
bool isSecuOk;
bool isConfirmBtnEnable;
bool m_hasDetailPageShowed = false;
ConInfo m_info;
ThreadObject *m_object;

View File

@ -1265,6 +1265,7 @@ void LanPage::showDetailPage(QString devName, QString uuid)
NetDetail *netDetail = new NetDetail(devName, p_item->m_connectName, uuid, isActive, false, false);
netDetail->show();
netDetail->setDetailPageShowed(true);
delete p_item;
p_item = nullptr;

View File

@ -1099,7 +1099,7 @@ void WlanPage::requestScan()
void WlanPage::onHiddenWlanClicked()
{
// qDebug() << "[wlanPage] AddHideWifi Clicked! " << Q_FUNC_INFO << __LINE__ ;
qDebug() << "[wlanPage] AddHideWifi Clicked! " << Q_FUNC_INFO << __LINE__ ;
// NetDetail *netDetail = new NetDetail(m_currentDevice, "", "", false, true, true);
// netDetail->show();
if(m_hiddenWiFi != nullptr){
@ -1486,7 +1486,7 @@ void WlanPage::showDetailPage(QString devName, QString ssid)
NetDetail *netDetail = new NetDetail(devName, ssid, wirelessNetItem.m_connectUuid, isActive, true, !wirelessNetItem.m_isConfigured);
netDetail->show();
netDetail->setDetailPageShowed(true);
return;
}