837bad6a13
This section type means that the module will have it's icon shown in the 'Explore' tab always, it can not be disabled by users and as such it just becomes an overflow of the main app avoiding worry about a module not being found.
54 lines
2.0 KiB
C++
54 lines
2.0 KiB
C++
/*
|
|
* This file is part of the Flowee project
|
|
* Copyright (C) 2023 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/>.
|
|
*/
|
|
#include "SendSweepModuleInfo.h"
|
|
#include "QMLSweepHandler.h"
|
|
|
|
#include <QQmlEngine> // for the qmlRegisterType
|
|
|
|
ModuleInfo * SendSweepModuleInfo::build()
|
|
{
|
|
qmlRegisterType<QMLSweepHandler>("Flowee.org.pay.SendSweep", 1, 0, "SweepHandler");
|
|
return new SendSweepModuleInfo();
|
|
}
|
|
|
|
SendSweepModuleInfo::SendSweepModuleInfo()
|
|
: m_actionTabItem(new ModuleSection(ModuleSection::OtherSectionTypeDefault, this))
|
|
{
|
|
setId("sendSweepModule");
|
|
setTitle(tr("Sweep & Send"));
|
|
setDescription(tr("Allows sweeping a paper-wallet, moving the contents to your own wallet"));
|
|
|
|
m_actionTabItem->setText(tr("Sweep Paper Wallet"));
|
|
m_actionTabItem->setStartQMLFile("qrc:/send-sweep/StartScan.qml");
|
|
addSection(m_actionTabItem);
|
|
|
|
// this one is used to have a full screen page at application start,
|
|
// but we only enable this when the 'bch-wif' scheme was used to start Flowee Pay
|
|
auto introScreenSection = new ModuleSection(ModuleSection::CustomSectionType, this);
|
|
introScreenSection->setStartQMLFile("qrc:/send-sweep/SendPage.qml");
|
|
introScreenSection->setSectionId("main");
|
|
addSection(introScreenSection);
|
|
}
|
|
|
|
void SendSweepModuleInfo::setEnabled(bool on)
|
|
{
|
|
m_enabled = on;
|
|
m_actionTabItem->setEnabled(on);
|
|
emit enabledChanged();
|
|
}
|