mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
feat: fix auto switch
This commit is contained in:
@@ -46,8 +46,6 @@ public:
|
|||||||
QQmlApplicationEngine *qmlEngine() const;
|
QQmlApplicationEngine *qmlEngine() const;
|
||||||
QNetworkAccessManager *networkManager();
|
QNetworkAccessManager *networkManager();
|
||||||
QClipboard *getClipboard();
|
QClipboard *getClipboard();
|
||||||
CoreController *coreController() const { return m_coreController.data(); }
|
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void forceQuit();
|
void forceQuit();
|
||||||
|
|||||||
@@ -225,6 +225,19 @@ void CoreController::initControllers()
|
|||||||
m_connectionController, this);
|
m_connectionController, this);
|
||||||
setQmlContextProperty("SubscriptionUiController", m_subscriptionUiController);
|
setQmlContextProperty("SubscriptionUiController", m_subscriptionUiController);
|
||||||
|
|
||||||
|
connect(m_connectionUiController, &ConnectionUiController::requestSetCurrentProtocol,
|
||||||
|
this, [this](const QString &protocol) {
|
||||||
|
const QString serverId = m_serversController->getDefaultServerId();
|
||||||
|
if (!serverId.isEmpty()) {
|
||||||
|
m_subscriptionUiController->setCurrentProtocol(serverId, protocol);
|
||||||
|
}
|
||||||
|
}, Qt::QueuedConnection);
|
||||||
|
connect(m_connectionUiController, &ConnectionUiController::requestUpdateServiceFromGateway,
|
||||||
|
m_subscriptionUiController, &SubscriptionUiController::updateServiceFromGateway, Qt::QueuedConnection);
|
||||||
|
connect(m_subscriptionUiController, &SubscriptionUiController::updateServiceFromGatewayCompleted,
|
||||||
|
m_connectionUiController, &ConnectionUiController::onUpdateServiceFromGatewayCompleted,
|
||||||
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
m_apiNewsUiController = new ApiNewsUiController(m_newsModel, m_newsController, this);
|
m_apiNewsUiController = new ApiNewsUiController(m_newsModel, m_newsController, this);
|
||||||
setQmlContextProperty("ApiNewsController", m_apiNewsUiController);
|
setQmlContextProperty("ApiNewsController", m_apiNewsUiController);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user