Auto start

Auto connect
Dns settings
ui fixes
This commit is contained in:
pokamest 2021-02-24 21:58:32 +03:00
parent ad643bf76e
commit c63990f720
14 changed files with 801 additions and 99 deletions

View file

@ -49,7 +49,7 @@ void VpnConnection::onConnectionStateChanged(VpnProtocol::ConnectionState state)
IpcClient::Interface()->routeAddList(m_vpnProtocol->vpnGateway(), black_custom);
}
}
else if (state == VpnProtocol::ConnectionState::Error || state == VpnProtocol::ConnectionState::Disconnected) {
else if (state == VpnProtocol::ConnectionState::Error) {
IpcClient::Interface()->flushDns();
if (m_settings.customRouting()) {
@ -162,8 +162,11 @@ void VpnConnection::disconnectFromVpn()
{
qDebug() << "Disconnect from VPN";
// m_vpnProtocol->communicator()->sendMessage(Message(Message::State::ClearSavedRoutesRequest, QStringList()));
// m_vpnProtocol->communicator()->sendMessage(Message(Message::State::FlushDnsRequest, QStringList()));
IpcClient::Interface()->flushDns();
if (m_settings.customRouting()) {
IpcClient::Interface()->clearSavedRoutes();
}
if (!m_vpnProtocol.data()) {
return;