mirror of
https://github.com/status-im/status-app.git
synced 2026-09-01 01:21:15 +00:00
1. Generate new API 2. Import accounts by PK 3. Import account by seed phrase 4. Add watch only address 5. delete account 6. current account
57 lines
1.7 KiB
C++
57 lines
1.7 KiB
C++
#include "view.h"
|
|
#include "../global/app_sections_config.h"
|
|
|
|
namespace Modules::Main
|
|
{
|
|
View::View(QObject* parent)
|
|
: QObject(parent)
|
|
{
|
|
m_sectionModelPtr = new Shared::Models::SectionModel(this);
|
|
}
|
|
|
|
void View::load()
|
|
{
|
|
// Add Wallet Section to Sections model
|
|
auto walletSectionItem = new Shared::Models::SectionItem(this,
|
|
WALLET_SECTION_ID,
|
|
Shared::Models::SectionType::Wallet,
|
|
WALLET_SECTION_NAME,
|
|
"",
|
|
"",
|
|
WALLET_SECTION_ICON,
|
|
"",
|
|
false,
|
|
true);
|
|
addItem(walletSectionItem);
|
|
setActiveSection(WALLET_SECTION_ID);
|
|
|
|
emit viewLoaded();
|
|
}
|
|
|
|
void View::addItem(Shared::Models::SectionItem* item)
|
|
{
|
|
m_sectionModelPtr->addItem(item);
|
|
emit sectionsModelChanged();
|
|
}
|
|
|
|
Shared::Models::SectionModel* View::getSectionsModel() const
|
|
{
|
|
return m_sectionModelPtr;
|
|
}
|
|
|
|
Shared::Models::SectionItem* View::getActiveSection() const
|
|
{
|
|
return m_sectionModelPtr->getActiveItem();
|
|
}
|
|
|
|
void View::setActiveSection(const QString& Id)
|
|
{
|
|
if(m_sectionModelPtr->getActiveItem().isNull() || (m_sectionModelPtr->getActiveItem()->getId() != Id))
|
|
{
|
|
m_sectionModelPtr->setActiveSection(Id);
|
|
activeSectionChanged();
|
|
}
|
|
}
|
|
|
|
} // namespace Modules::Main
|