keyring开关接口

This commit is contained in:
jzxc95 2021-12-15 15:18:16 +08:00
parent 40f08e7fe0
commit 4b2a557a05
6 changed files with 39 additions and 0 deletions

View File

@ -403,6 +403,9 @@ applet_agent_cancel_secrets_cb (AppletAgent *agent,
void agent_init()
{
if (NULL != kylinAgent) {
return;
}
GError *error = NULL;
kylinAgent = applet_agent_new (&error);
@ -414,3 +417,12 @@ void agent_init()
return;
}
void agent_clear()
{
if (NULL == kylinAgent) {
return;
}
g_clear_object (&kylinAgent);
kylinAgent = NULL;
}

View File

@ -3,6 +3,7 @@
#ifdef __cplusplus
extern "C"{
void agent_init();
void agent_clear();
}
#endif

View File

@ -234,3 +234,13 @@ void DbusAdaptor::reScan()
{
parent()->rescan();
}
void DbusAdaptor::keyRingInit()
{
parent()->keyRingInit();
}
void DbusAdaptor::keyRingClear()
{
parent()->keyRingClear();
}

View File

@ -83,6 +83,9 @@ public Q_SLOTS: // METHODS
QStringList getApInfoBySsid(QString devName, QString ssid);
//wifi扫描
void reScan();
//keyring
void keyRingInit();
void keyRingClear();
Q_SIGNALS: // SIGNALS
// void wirelessActivating(QString devName, QString ssid);
// void wiredActivating(QString devName, QString ssid);

View File

@ -711,3 +711,13 @@ void MainWindow::rescan()
{
m_wlanWidget->requestScan();
}
void MainWindow::keyRingInit()
{
agent_init();
}
void MainWindow::keyRingClear()
{
agent_clear();
}

View File

@ -68,6 +68,9 @@ public:
void rescan();
void keyRingInit();
void keyRingClear();
signals:
//设备插拔
void deviceStatusChanged();