2022-01-06 19:29:19 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "interfaces/module_view_delegate_interface.h"
|
|
|
|
#include "model.h"
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace Modules
|
|
|
|
{
|
|
|
|
namespace Startup
|
|
|
|
{
|
|
|
|
namespace Onboarding
|
|
|
|
{
|
|
|
|
|
|
|
|
class View : public QObject
|
|
|
|
{
|
2022-02-21 18:03:38 +00:00
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(Model* accountsModel READ getModel NOTIFY modelChanged)
|
|
|
|
Q_PROPERTY(QString importedAccountIdenticon READ getImportedAccountIdenticon NOTIFY importedAccountChanged)
|
|
|
|
Q_PROPERTY(QString importedAccountAlias READ getImportedAccountAlias NOTIFY importedAccountChanged)
|
|
|
|
Q_PROPERTY(QString importedAccountAddress READ getImportedAccountAddress NOTIFY importedAccountChanged)
|
2022-01-06 19:29:19 +00:00
|
|
|
|
|
|
|
public:
|
2022-02-21 18:03:38 +00:00
|
|
|
explicit View(ModuleViewDelegateInterface* delegate, QObject* parent = nullptr);
|
|
|
|
~View();
|
|
|
|
void load();
|
2022-01-06 19:29:19 +00:00
|
|
|
|
|
|
|
signals:
|
2022-02-21 18:03:38 +00:00
|
|
|
void modelChanged();
|
|
|
|
void importedAccountChanged();
|
|
|
|
void accountSetupError();
|
|
|
|
void accountImportError();
|
2022-01-06 19:29:19 +00:00
|
|
|
|
|
|
|
private:
|
2022-02-21 18:03:38 +00:00
|
|
|
ModuleViewDelegateInterface* m_delegate;
|
|
|
|
Model* m_model;
|
2022-01-06 19:29:19 +00:00
|
|
|
|
|
|
|
public slots:
|
2022-02-21 18:03:38 +00:00
|
|
|
Model* getModel();
|
|
|
|
void setAccountList(QVector<Item> accounts);
|
|
|
|
QString getImportedAccountIdenticon();
|
|
|
|
QString getImportedAccountAlias();
|
|
|
|
QString getImportedAccountAddress();
|
|
|
|
void setSelectedAccountByIndex(int index);
|
|
|
|
void storeSelectedAccountAndLogin(QString password);
|
|
|
|
QString validateMnemonic(QString mnemonic);
|
|
|
|
void importMnemonic(QString mnemonic);
|
|
|
|
void importAccountError();
|
|
|
|
void setupAccountError();
|
|
|
|
void importAccountSuccess();
|
2022-01-06 19:29:19 +00:00
|
|
|
};
|
|
|
|
} // namespace Onboarding
|
|
|
|
} // namespace Startup
|
2022-02-21 18:03:38 +00:00
|
|
|
} // namespace Modules
|