mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-20 02:00:55 +07:00
feat: fix auto switch
This commit is contained in:
@@ -46,8 +46,6 @@ public:
|
||||
QQmlApplicationEngine *qmlEngine() const;
|
||||
QNetworkAccessManager *networkManager();
|
||||
QClipboard *getClipboard();
|
||||
CoreController *coreController() const { return m_coreController.data(); }
|
||||
|
||||
|
||||
public slots:
|
||||
void forceQuit();
|
||||
|
||||
@@ -225,6 +225,19 @@ void CoreController::initControllers()
|
||||
m_connectionController, this);
|
||||
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);
|
||||
setQmlContextProperty("ApiNewsController", m_apiNewsUiController);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user