mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
1. updated memory text when language changed,
2. updated initialize index
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -34,6 +34,8 @@ public slots:
|
||||
|
||||
void onCurrentContainerUpdated();
|
||||
|
||||
void translateMemoryText();
|
||||
|
||||
signals:
|
||||
void connectToVpn(int serverIndex, const ServerCredentials &credentials, DockerContainer container,
|
||||
const QJsonObject &containerConfig);
|
||||
@@ -44,6 +46,8 @@ signals:
|
||||
void reconnectWithUpdatedContainer(const QString &message);
|
||||
|
||||
private:
|
||||
Vpn::ConnectionState getCurrentConnectionState();
|
||||
|
||||
QSharedPointer<ServersModel> m_serversModel;
|
||||
QSharedPointer<ContainersModel> m_containersModel;
|
||||
|
||||
@@ -52,6 +56,8 @@ private:
|
||||
bool m_isConnected = false;
|
||||
bool m_isConnectionInProgress = false;
|
||||
QString m_connectionStateText = tr("Connect");
|
||||
|
||||
Vpn::ConnectionState m_state;
|
||||
};
|
||||
|
||||
#endif // CONNECTIONCONTROLLER_H
|
||||
|
||||
@@ -171,6 +171,8 @@ PageType {
|
||||
onClicked: {
|
||||
tabBarStackView.goToTabBarPage(PageEnum.PageHome)
|
||||
ServersModel.currentlyProcessedIndex = ServersModel.defaultIndex
|
||||
|
||||
ConnectionController.translateMemoryText()
|
||||
}
|
||||
}
|
||||
TabImageButtonType {
|
||||
|
||||
Reference in New Issue
Block a user