Files
pay/modules/send-sweep/SendSweepModuleInfo.cpp
T

54 lines
2.0 KiB
C++
Raw Permalink Normal View History

2024-10-01 21:26:01 +02:00
/*
* 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"
2024-10-02 23:04:38 +02:00
#include "QMLSweepHandler.h"
#include <QQmlEngine> // for the qmlRegisterType
2024-10-01 21:26:01 +02:00
ModuleInfo * SendSweepModuleInfo::build()
{
2024-10-02 23:04:38 +02:00
qmlRegisterType<QMLSweepHandler>("Flowee.org.pay.SendSweep", 1, 0, "SweepHandler");
return new SendSweepModuleInfo();
}
2024-10-02 23:04:38 +02:00
SendSweepModuleInfo::SendSweepModuleInfo()
2024-12-30 15:59:01 +01:00
: 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);
2024-10-25 11:33:11 +02:00
// 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");
2024-10-25 11:33:11 +02:00
addSection(introScreenSection);
}
void SendSweepModuleInfo::setEnabled(bool on)
{
m_enabled = on;
m_actionTabItem->setEnabled(on);
emit enabledChanged();
2024-10-01 21:26:01 +02:00
}