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

View File

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

View File

@ -55,9 +55,28 @@
#define PEAP_SCRO_HEIGHT 300 #define PEAP_SCRO_HEIGHT 300
#define TLS_SCRO_HEIGHT 480 #define TLS_SCRO_HEIGHT 480
#define MAX_TAB_TEXT_LENGTH 44 #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); //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) void NetDetail::showDesktopNotify(const QString &message, QString soundName)
{ {
QDBusInterface iface("org.freedesktop.Notifications", QDBusInterface iface("org.freedesktop.Notifications",
@ -264,6 +283,11 @@ void NetDetail::closeEvent(QCloseEvent *event)
{ {
Q_EMIT this->detailPageClose(false); Q_EMIT this->detailPageClose(false);
Q_EMIT this->createPageClose(m_deviceName); Q_EMIT this->createPageClose(m_deviceName);
if (m_hasDetailPageShowed) {
LaunchApp("ukui-control-center.desktop");
m_hasDetailPageShowed = false;
}
return QWidget::closeEvent(event); return QWidget::closeEvent(event);
} }
@ -399,6 +423,7 @@ void NetDetail::loadPage()
pageFrame->hide(); pageFrame->hide();
stackWidget->setCurrentIndex(CREATE_NET_PAGE_NUM); stackWidget->setCurrentIndex(CREATE_NET_PAGE_NUM);
this->setWindowTitle(tr("Add Lan Connect")); this->setWindowTitle(tr("Add Lan Connect"));
setDetailPageShowed(true);
} else { } else {
stackWidget->setCurrentIndex(DETAIL_PAGE_NUM); stackWidget->setCurrentIndex(DETAIL_PAGE_NUM);
this->setWindowTitle(m_name); this->setWindowTitle(m_name);
@ -1131,6 +1156,11 @@ bool NetDetail::eventFilter(QObject *w, QEvent *event)
return QWidget::eventFilter(w, event); return QWidget::eventFilter(w, event);
} }
void NetDetail::setDetailPageShowed(bool state)
{
m_hasDetailPageShowed = state;
}
void NetDetail::setNetTabToolTip() void NetDetail::setNetTabToolTip()
{ {
int tabCount = m_netTabBar->count(); int tabCount = m_netTabBar->count();

View File

@ -98,6 +98,8 @@ public:
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
bool eventFilter(QObject *w, QEvent *event); bool eventFilter(QObject *w, QEvent *event);
void setDetailPageShowed(bool state);
private: private:
void initUI(); void initUI();
void centerToScreen(); void centerToScreen();
@ -181,7 +183,7 @@ private:
bool isIpv6Ok; bool isIpv6Ok;
bool isSecuOk; bool isSecuOk;
bool isConfirmBtnEnable; bool isConfirmBtnEnable;
bool m_hasDetailPageShowed = false;
ConInfo m_info; ConInfo m_info;
ThreadObject *m_object; 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 *netDetail = new NetDetail(devName, p_item->m_connectName, uuid, isActive, false, false);
netDetail->show(); netDetail->show();
netDetail->setDetailPageShowed(true);
delete p_item; delete p_item;
p_item = nullptr; p_item = nullptr;

View File

@ -1099,7 +1099,7 @@ void WlanPage::requestScan()
void WlanPage::onHiddenWlanClicked() 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 *netDetail = new NetDetail(m_currentDevice, "", "", false, true, true);
// netDetail->show(); // netDetail->show();
if(m_hiddenWiFi != nullptr){ 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 *netDetail = new NetDetail(devName, ssid, wirelessNetItem.m_connectUuid, isActive, true, !wirelessNetItem.m_isConfigured);
netDetail->show(); netDetail->show();
netDetail->setDetailPageShowed(true);
return; return;
} }