2025-11-12 13:54:22 +01:00
|
|
|
/*
|
|
|
|
|
* This file is part of the Flowee project
|
|
|
|
|
* Copyright (C) 2025 Tom Zander <tom@flowee.org>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
#ifndef BACKUPACCOUNTINFO_H
|
|
|
|
|
#define BACKUPACCOUNTINFO_H
|
|
|
|
|
|
|
|
|
|
#include <AccountInfo.h>
|
|
|
|
|
|
|
|
|
|
class WalletData;
|
|
|
|
|
|
|
|
|
|
class BackupAccountInfo : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_PROPERTY(AccountInfo *account READ account WRITE setAccount NOTIFY accountChanged FINAL REQUIRED)
|
|
|
|
|
Q_PROPERTY(QString lastSaved READ lastSaved NOTIFY lastSavedChanged FINAL)
|
|
|
|
|
Q_PROPERTY(QString address READ address NOTIFY accountChanged FINAL)
|
2026-01-19 00:01:11 +01:00
|
|
|
Q_PROPERTY(bool walletUploadScheduled READ walletUploadScheduled NOTIFY walletUploadScheduledChanged FINAL)
|
2025-11-12 13:54:22 +01:00
|
|
|
public:
|
|
|
|
|
explicit BackupAccountInfo(QObject *parent = nullptr);
|
|
|
|
|
|
|
|
|
|
AccountInfo *account() const;
|
|
|
|
|
void setAccount(AccountInfo *newAccount);
|
|
|
|
|
|
|
|
|
|
QString lastSaved() const;
|
|
|
|
|
QString address() const;
|
|
|
|
|
|
|
|
|
|
Q_INVOKABLE void startBackup();
|
|
|
|
|
|
2026-01-19 00:01:11 +01:00
|
|
|
bool walletUploadScheduled() const;
|
|
|
|
|
void setWalletUploadScheduled(bool newWalletUploadScheduled);
|
|
|
|
|
|
2025-11-12 13:54:22 +01:00
|
|
|
signals:
|
|
|
|
|
void accountChanged();
|
|
|
|
|
void lastSavedChanged();
|
|
|
|
|
|
2026-01-19 00:01:11 +01:00
|
|
|
void walletUploadScheduledChanged();
|
|
|
|
|
|
2025-11-12 13:54:22 +01:00
|
|
|
private:
|
|
|
|
|
AccountInfo *m_account = nullptr;
|
|
|
|
|
WalletData *m_walletData = nullptr;
|
2026-01-19 00:01:11 +01:00
|
|
|
|
|
|
|
|
// true while the user started an upload, but the wallet is still
|
|
|
|
|
// not at tip.
|
|
|
|
|
bool m_walletUploadScheduled = false;
|
2025-11-12 13:54:22 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|