status-desktop/src-cpp/app/modules/startup/onboarding/view.h

55 lines
1.4 KiB
C
Raw Normal View History

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
{
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)
public:
2022-01-20 15:50:10 +00:00
explicit View(ModuleViewDelegateInterface* delegate, QObject* parent = nullptr);
2022-01-06 19:29:19 +00:00
~View();
void load();
signals:
void modelChanged();
void importedAccountChanged();
void accountSetupError();
void accountImportError();
private:
ModuleViewDelegateInterface* m_delegate;
Model* m_model;
public slots:
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();
};
} // namespace Onboarding
} // namespace Startup
} // namespace Modules