1. updated memory text when language changed,

2. updated initialize index
This commit is contained in:
ronoaer 2023-10-01 11:12:27 +08:00
parent 07d7fac490
commit eaede032b4
5 changed files with 27 additions and 5 deletions

View file

@ -19,6 +19,8 @@ ConnectionController::ConnectionController(const QSharedPointer<ServersModel> &s
Qt::QueuedConnection);
connect(this, &ConnectionController::disconnectFromVpn, m_vpnConnection.get(), &VpnConnection::disconnectFromVpn,
Qt::QueuedConnection);
m_state = Vpn::ConnectionState::Disconnected;
}
ConnectionController::~ConnectionController()
@ -70,6 +72,8 @@ QString ConnectionController::getLastConnectionError()
void ConnectionController::onConnectionStateChanged(Vpn::ConnectionState state)
{
m_state = state;
m_isConnected = false;
m_connectionStateText = tr("Connection...");
switch (state) {
@ -126,6 +130,16 @@ void ConnectionController::onCurrentContainerUpdated()
}
}
void ConnectionController::translateMemoryText()
{
onConnectionStateChanged(getCurrentConnectionState());
}
Vpn::ConnectionState ConnectionController::getCurrentConnectionState()
{
return m_state;
}
QString ConnectionController::connectionStateText() const
{
return m_connectionStateText;