pin support
This commit is contained in:
@@ -23,6 +23,7 @@ class AppController : public QObject
|
||||
Q_PROPERTY(double sendProgress READ sendProgress NOTIFY sendProgressChanged)
|
||||
Q_PROPERTY(QVariantList pendingFiles READ pendingFiles NOTIFY pendingFilesChanged)
|
||||
Q_PROPERTY(bool hasPendingFiles READ hasPendingFiles NOTIFY pendingFilesChanged)
|
||||
Q_PROPERTY(QString receivePin READ receivePin WRITE setReceivePin NOTIFY receivePinChanged)
|
||||
|
||||
public:
|
||||
explicit AppController(QObject* parent = nullptr);
|
||||
@@ -49,6 +50,8 @@ public:
|
||||
double sendProgress() const;
|
||||
QVariantList pendingFiles() const;
|
||||
bool hasPendingFiles() const;
|
||||
QString receivePin() const;
|
||||
void setReceivePin(const QString& pin);
|
||||
|
||||
Q_INVOKABLE void startDiscovery();
|
||||
Q_INVOKABLE void stopDiscovery();
|
||||
@@ -63,6 +66,7 @@ public:
|
||||
Q_INVOKABLE void addFiles(const QStringList& filePaths);
|
||||
Q_INVOKABLE void removePendingFile(int index);
|
||||
Q_INVOKABLE void clearPendingFiles();
|
||||
Q_INVOKABLE void retryWithPin(const QString& pin);
|
||||
|
||||
signals:
|
||||
void aliasChanged();
|
||||
@@ -81,6 +85,8 @@ signals:
|
||||
void receiveError(const QString& sessionId, const QString& error);
|
||||
void sendCompleted(const QString& sessionId);
|
||||
void sendError(const QString& error);
|
||||
void pinRequired(bool firstAttempt);
|
||||
void receivePinChanged();
|
||||
|
||||
private slots:
|
||||
void onDeviceDiscovered(const LocalSend::Device& device);
|
||||
@@ -98,6 +104,8 @@ private slots:
|
||||
|
||||
void onPrepareUploadResponse(const LocalSend::PrepareUploadResponseDto& response);
|
||||
void onPrepareUploadError(const QString& error);
|
||||
void onPrepareUploadPinRequired();
|
||||
void onPrepareUploadTooManyAttempts();
|
||||
void onUploadProgress(qint64 sent, qint64 total);
|
||||
void onUploadCompleted();
|
||||
void onUploadError(const QString& error);
|
||||
@@ -119,6 +127,7 @@ private:
|
||||
QVariantList m_pendingFilesList;
|
||||
int m_currentFileIndex = 0;
|
||||
double m_sendProgress = 0.0;
|
||||
bool m_pinFirstAttempt = true;
|
||||
|
||||
LocalSend::InfoDto buildInfoDto() const;
|
||||
QString generateUniqueFilePath(const QString& baseDir, const QString& fileName) const;
|
||||
|
||||
Reference in New Issue
Block a user