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

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