ip冲突通知
This commit is contained in:
parent
f5a55910ba
commit
eaf3589844
|
@ -80,6 +80,8 @@ KyConnectResourse::KyConnectResourse(QObject *parent) : QObject(parent)
|
|||
connect(m_networkResourceInstance, &KyNetworkResourceManager::connectionRemove, this, &KyConnectResourse::connectionRemove);
|
||||
connect(m_networkResourceInstance, &KyNetworkResourceManager::connectionUpdate, this, &KyConnectResourse::connectionUpdate);
|
||||
connect(m_networkResourceInstance, &KyNetworkResourceManager::connectivityChanged, this, &KyConnectResourse::connectivityChanged);
|
||||
|
||||
connect(m_networkResourceInstance, &KyNetworkResourceManager::needShowDesktop, this, &KyConnectResourse::needShowDesktop);
|
||||
}
|
||||
|
||||
KyConnectResourse::~KyConnectResourse()
|
||||
|
|
|
@ -87,6 +87,8 @@ Q_SIGNALS:
|
|||
void connectionRemove(QString path);
|
||||
void connectivityChanged(NetworkManager::Connectivity connectivity);
|
||||
|
||||
void needShowDesktop(QString);
|
||||
|
||||
private:
|
||||
KyNetworkResourceManager *m_networkResourceInstance = nullptr;
|
||||
};
|
||||
|
|
|
@ -228,6 +228,10 @@ void KyNetworkResourceManager::removeDevice(int pos)
|
|||
{
|
||||
//connections signals
|
||||
NetworkManager::Device::Ptr device = m_devices.takeAt(pos);
|
||||
QDBusConnection::systemBus().disconnect(QString("org.freedesktop.NetworkManager"),
|
||||
device.data()->uni(),
|
||||
QString("org.freedesktop.NetworkManager.Device"),
|
||||
QString("AcdIpProbed"), this, SIGNAL(needShowDesktop(QString)));
|
||||
device->disconnect(this);
|
||||
}
|
||||
|
||||
|
@ -303,6 +307,10 @@ void KyNetworkResourceManager::addDevice(NetworkManager::Device::Ptr device)
|
|||
//TODO: other device types!
|
||||
break;
|
||||
}
|
||||
QDBusConnection::systemBus().connect(QString("org.freedesktop.NetworkManager"),
|
||||
device.data()->uni(),
|
||||
QString("org.freedesktop.NetworkManager.Device"),
|
||||
QString("AcdIpProbed"), this, SIGNAL(needShowDesktop(QString)));
|
||||
}
|
||||
|
||||
void KyNetworkResourceManager::insertDevices()
|
||||
|
|
|
@ -144,6 +144,7 @@ Q_SIGNALS:
|
|||
void connectivityChanged(NetworkManager::Connectivity connectivity);
|
||||
void stateChanged(NetworkManager::Device::State newstate, NetworkManager::Device::State oldstate, NetworkManager::Device::StateChangeReason reason);
|
||||
|
||||
void needShowDesktop(QString);
|
||||
|
||||
public Q_SLOTS:
|
||||
void onInitNetwork();
|
||||
|
|
|
@ -63,6 +63,10 @@ LanPage::LanPage(QWidget *parent) : TabPage(parent)
|
|||
connect(m_connectResourse, &KyConnectResourse::connectionRemove, this, &LanPage::onRemoveConnection);
|
||||
connect(m_connectResourse, &KyConnectResourse::connectionUpdate, this, &LanPage::onUpdateConnection);
|
||||
|
||||
connect(m_connectResourse, &KyConnectResourse::needShowDesktop, this, [=](QString ip) {
|
||||
this->showDesktopNotify(ip + tr("conflict, unable to connect to the network normally!"), QString());
|
||||
});
|
||||
|
||||
connect(m_deviceResource, &KyNetworkDeviceResourse::deviceAdd, this, &LanPage::onDeviceAdd);
|
||||
connect(m_deviceResource, &KyNetworkDeviceResourse::deviceRemove, this, &LanPage::onDeviceRemove);
|
||||
connect(m_deviceResource, &KyNetworkDeviceResourse::deviceNameUpdate, this, &LanPage::onDeviceNameUpdate);
|
||||
|
|
|
@ -458,43 +458,48 @@
|
|||
<context>
|
||||
<name>LanPage</name>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1183"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1187"/>
|
||||
<source>No ethernet device avaliable</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="740"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="744"/>
|
||||
<source>LAN</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="742"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="67"/>
|
||||
<source>conflict, unable to connect to the network normally!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="746"/>
|
||||
<source>Activated LAN</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="752"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="756"/>
|
||||
<source>Inactivated LAN</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1227"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1231"/>
|
||||
<source>Wired Device not carried</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1321"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1329"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1325"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1333"/>
|
||||
<source>Connected: </source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1321"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1325"/>
|
||||
<source>(Limited)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1323"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1327"/>
|
||||
<source>Not Connected</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
|
@ -786,22 +786,27 @@
|
|||
<context>
|
||||
<name>LanPage</name>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1183"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1187"/>
|
||||
<source>No ethernet device avaliable</source>
|
||||
<translation>ཨེ་ཙི་དྲ་རྒྱའི་སྒྲིག་ཆས་ལ་བཙན་འཛུལ་བྱས་མི་ཆོག།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="740"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="744"/>
|
||||
<source>LAN</source>
|
||||
<translation>སྐུད་ཡོད་དྲ་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="742"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="67"/>
|
||||
<source>conflict, unable to connect to the network normally!</source>
|
||||
<translation>གདོང་གཏུག་རྒྱུན་ལྡན་ལྟར་དྲ་རྒྱ་དང་འབྲེལ་མཐུད་བྱེད་ཐབས་བྲལ་བ་རེད།!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="746"/>
|
||||
<source>Activated LAN</source>
|
||||
<translation>ངའི་དྲ་རྒྱ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="752"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="756"/>
|
||||
<source>Inactivated LAN</source>
|
||||
<translation>དྲ་བ་གཞན་དག</translation>
|
||||
</message>
|
||||
|
@ -810,7 +815,7 @@
|
|||
<translation type="vanished">སྐུད་ཡོད་དྲ་བ་ཆད་སོང་།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1227"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1231"/>
|
||||
<source>Wired Device not carried</source>
|
||||
<translation>སྐུད་ཡོད་སྒྲིག་ཆས་འཁྱེར་མེད་པ།</translation>
|
||||
</message>
|
||||
|
@ -819,18 +824,18 @@
|
|||
<translation type="vanished">སྐུད་ཡོད་དྲ་བ་སྦྲེལ་ཡོད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1321"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1329"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1325"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1333"/>
|
||||
<source>Connected: </source>
|
||||
<translation>འབྲེལ་མཐུད་བྱུང་ཡོད།: </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1323"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1327"/>
|
||||
<source>Not Connected</source>
|
||||
<translation>འབྲེལ་མཐུད་མ་བྱས་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1321"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1325"/>
|
||||
<source>(Limited)</source>
|
||||
<translation>(དྲ་བར་ཚོད་འཛིན་ཐེབས་པ་རེད།)</translation>
|
||||
</message>
|
||||
|
|
|
@ -1484,43 +1484,48 @@
|
|||
<context>
|
||||
<name>LanPage</name>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1183"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1187"/>
|
||||
<source>No ethernet device avaliable</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="740"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="744"/>
|
||||
<source>LAN</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="742"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="67"/>
|
||||
<source>conflict, unable to connect to the network normally!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="746"/>
|
||||
<source>Activated LAN</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="752"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="756"/>
|
||||
<source>Inactivated LAN</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1227"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1231"/>
|
||||
<source>Wired Device not carried</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1321"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1329"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1325"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1333"/>
|
||||
<source>Connected: </source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1321"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1325"/>
|
||||
<source>(Limited)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1323"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1327"/>
|
||||
<source>Not Connected</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
|
@ -786,22 +786,27 @@
|
|||
<context>
|
||||
<name>LanPage</name>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1183"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1187"/>
|
||||
<source>No ethernet device avaliable</source>
|
||||
<translation>未检测到有线设备</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="740"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="744"/>
|
||||
<source>LAN</source>
|
||||
<translation>有线网络</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="742"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="67"/>
|
||||
<source>conflict, unable to connect to the network normally!</source>
|
||||
<translation>冲突,无法正常连接到网络!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="746"/>
|
||||
<source>Activated LAN</source>
|
||||
<translation>我的网络</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="752"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="756"/>
|
||||
<source>Inactivated LAN</source>
|
||||
<translation>其他网络</translation>
|
||||
</message>
|
||||
|
@ -810,7 +815,7 @@
|
|||
<translation type="vanished">有线网络已断开</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1227"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1231"/>
|
||||
<source>Wired Device not carried</source>
|
||||
<translation>未插入网线</translation>
|
||||
</message>
|
||||
|
@ -819,18 +824,18 @@
|
|||
<translation type="vanished">有线网络已连接</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1321"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1329"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1325"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1333"/>
|
||||
<source>Connected: </source>
|
||||
<translation>已连接: </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1323"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1327"/>
|
||||
<source>Not Connected</source>
|
||||
<translation>未连接</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1321"/>
|
||||
<location filename="../frontend/tab-pages/lanpage.cpp" line="1325"/>
|
||||
<source>(Limited)</source>
|
||||
<translation>(网络受限)</translation>
|
||||
</message>
|
||||
|
|
Loading…
Reference in New Issue