mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-20 02:00:55 +07:00
remove old code
This commit is contained in:
@@ -10,7 +10,6 @@ using AmneziaPairingQrOverlayBackHandler = std::function<void()>;
|
||||
void amneziaIosPairingQrOverlayPresent(AmneziaPairingQrScannedUtf8Handler onScanned, AmneziaPairingQrOverlayBackHandler onBack,
|
||||
const std::string &titleUtf8, const std::string &subtitleUtf8);
|
||||
void amneziaIosPairingQrOverlayDismiss();
|
||||
bool amneziaIosPairingQrOverlayIsPresented();
|
||||
void amneziaIosPairingQrOverlaySetTorchEnabled(bool on);
|
||||
void amneziaIosPairingQrOverlayRestartCapture();
|
||||
|
||||
|
||||
@@ -905,18 +905,6 @@ void amneziaIosPairingQrOverlayDismiss()
|
||||
});
|
||||
}
|
||||
|
||||
bool amneziaIosPairingQrOverlayIsPresented()
|
||||
{
|
||||
if ([NSThread isMainThread]) {
|
||||
return gPairingQrOverlayWindow != nil && !gPairingQrOverlayWindow.hidden;
|
||||
}
|
||||
__block bool out = false;
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
out = (gPairingQrOverlayWindow != nil && !gPairingQrOverlayWindow.hidden);
|
||||
});
|
||||
return out;
|
||||
}
|
||||
|
||||
void amneziaIosPairingQrOverlaySetTorchEnabled(bool on)
|
||||
{
|
||||
NSLog(@"[PairingQrOverlay] C++ setTorch=%d", (int)on);
|
||||
|
||||
@@ -238,15 +238,6 @@ void PairingUiController::clearPendingPhonePairingUuid()
|
||||
emit pendingPhonePairingUuidChanged();
|
||||
}
|
||||
|
||||
void PairingUiController::setTvPairingUiPhase(int phase)
|
||||
{
|
||||
if (m_tvPairingUiPhase == phase) {
|
||||
return;
|
||||
}
|
||||
m_tvPairingUiPhase = phase;
|
||||
emit tvPairingUiPhaseChanged();
|
||||
}
|
||||
|
||||
void PairingUiController::openPairingQrScanner()
|
||||
{
|
||||
#if defined(Q_OS_ANDROID)
|
||||
@@ -626,7 +617,6 @@ void PairingUiController::startTvQrSession()
|
||||
emit tvSessionUuidChanged();
|
||||
|
||||
setTvBusy(true);
|
||||
setTvPairingUiPhase(1);
|
||||
|
||||
dispatchTvGenerateQrAttempt(generation, 0);
|
||||
}
|
||||
@@ -680,7 +670,6 @@ void PairingUiController::dispatchTvGenerateQrAttempt(quint64 generation, int re
|
||||
out.config, out.serviceInfo, out.supportedProtocols);
|
||||
setTvBusy(false);
|
||||
if (impErr != ErrorCode::NoError) {
|
||||
setTvPairingUiPhase(2);
|
||||
m_tvStatusMessage = tvFailureMessage(impErr);
|
||||
emit tvStatusMessageChanged();
|
||||
emit errorOccurred(impErr);
|
||||
@@ -691,7 +680,6 @@ void PairingUiController::dispatchTvGenerateQrAttempt(quint64 generation, int re
|
||||
m_tvStatusMessage = tr("Configuration received");
|
||||
emit tvStatusMessageChanged();
|
||||
emit tvPairingConfigReceived();
|
||||
setTvPairingUiPhase(0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -707,7 +695,6 @@ void PairingUiController::dispatchTvGenerateQrAttempt(quint64 generation, int re
|
||||
}
|
||||
|
||||
setTvBusy(false);
|
||||
setTvPairingUiPhase(logicalErr == ErrorCode::ApiConfigTimeoutError ? 3 : 2);
|
||||
m_tvStatusMessage = tvFailureMessage(logicalErr);
|
||||
emit tvStatusMessageChanged();
|
||||
emit errorOccurred(logicalErr);
|
||||
@@ -731,7 +718,6 @@ void PairingUiController::cancelTvQrSession()
|
||||
m_tvStatusMessage.clear();
|
||||
emit tvStatusMessageChanged();
|
||||
resetTvQrDisplay();
|
||||
setTvPairingUiPhase(0);
|
||||
}
|
||||
|
||||
void PairingUiController::cancelAllPairingActivity()
|
||||
|
||||
@@ -32,7 +32,6 @@ class PairingUiController : public QObject
|
||||
pendingPhonePairingUuidChanged)
|
||||
Q_PROPERTY(QString lastSuccessfulPhonePairingDisplayName READ lastSuccessfulPhonePairingDisplayName NOTIFY
|
||||
lastSuccessfulPhonePairingDisplayNameChanged)
|
||||
Q_PROPERTY(int tvPairingUiPhase READ tvPairingUiPhase NOTIFY tvPairingUiPhaseChanged)
|
||||
Q_PROPERTY(bool embeddedPairingQrCameraActive READ embeddedPairingQrCameraActive WRITE setEmbeddedPairingQrCameraActive NOTIFY
|
||||
embeddedPairingQrCameraActiveChanged)
|
||||
Q_PROPERTY(bool iosNativePairingQrOverlayBuild READ iosNativePairingQrOverlayBuild CONSTANT)
|
||||
@@ -58,7 +57,6 @@ public:
|
||||
QString pendingPhonePairingUuid() const { return m_pendingPhonePairingUuid; }
|
||||
void setPendingPhonePairingUuid(const QString &uuid);
|
||||
QString lastSuccessfulPhonePairingDisplayName() const { return m_lastSuccessfulPhonePairingDisplayName; }
|
||||
int tvPairingUiPhase() const { return m_tvPairingUiPhase; }
|
||||
bool embeddedPairingQrCameraActive() const { return m_embeddedPairingQrCameraActive; }
|
||||
bool iosNativePairingQrOverlayBuild() const;
|
||||
bool androidNativePairingQrOverlayBuild() const;
|
||||
@@ -67,7 +65,6 @@ public:
|
||||
Q_INVOKABLE void refreshIosEmbeddedPairingQrChrome();
|
||||
|
||||
qint64 androidPairingReaderCooldownUntilEpochMs() const { return m_androidPairingReaderCooldownUntilEpochMs; }
|
||||
Q_INVOKABLE void suppressAndroidNativePairingReaderStarts(int ms);
|
||||
|
||||
Q_INVOKABLE void presentIosPairingQrNativeOverlayScanner(const QString &title = QString(),
|
||||
const QString &subtitle = QString());
|
||||
@@ -97,8 +94,6 @@ public slots:
|
||||
|
||||
bool applyScannedTextAsPairingUuid(const QString &raw);
|
||||
|
||||
Q_INVOKABLE void clearPendingPhonePairingUuid();
|
||||
|
||||
signals:
|
||||
void errorOccurred(amnezia::ErrorCode errorCode);
|
||||
void tvQrCodesChanged();
|
||||
@@ -114,7 +109,6 @@ signals:
|
||||
void phonePairingSucceeded();
|
||||
|
||||
void pairingUuidFromScan(const QString &uuid);
|
||||
void tvPairingUiPhaseChanged();
|
||||
void pairingCameraAccessFinished(bool granted);
|
||||
void embeddedPairingQrCameraActiveChanged();
|
||||
void androidPairingReaderCooldownUntilEpochMsChanged();
|
||||
@@ -126,12 +120,13 @@ private:
|
||||
void setTvBusy(bool busy);
|
||||
void setPhoneBusy(bool busy);
|
||||
void resetTvQrDisplay();
|
||||
void clearPendingPhonePairingUuid();
|
||||
void suppressAndroidNativePairingReaderStarts(int ms);
|
||||
QString tvFailureMessage(amnezia::ErrorCode code) const;
|
||||
void dispatchTvGenerateQrAttempt(quint64 generation, int retryAttempt);
|
||||
void dispatchPhoneScanQrAttempt(const QString &qrUuid, bool isTestPurchase, const QString &vpnKey, const QJsonObject &serviceInfo,
|
||||
const QJsonArray &supportedProtocols, const QString &apiKey, const QString &serviceType,
|
||||
const QString &userCountryCode, quint64 generation, int retryAttempt);
|
||||
void setTvPairingUiPhase(int phase);
|
||||
|
||||
PairingController *m_pairingController {};
|
||||
ServersController *m_serversController {};
|
||||
@@ -145,7 +140,6 @@ private:
|
||||
QPointer<QFutureWatcher<QPair<amnezia::ErrorCode, QByteArray>>> m_tvWatcher;
|
||||
QPointer<QNetworkReply> m_tvNetworkReply;
|
||||
quint64 m_tvSessionGeneration { 0 };
|
||||
int m_tvPairingUiPhase { 0 };
|
||||
|
||||
bool m_phonePairingBusy = false;
|
||||
QString m_phoneStatusMessage;
|
||||
|
||||
Reference in New Issue
Block a user