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");
|
2024-10-24 22:39:31 +02:00
|
|
|
return new SendSweepModuleInfo();
|
|
|
|
|
}
|
2024-10-02 23:04:38 +02:00
|
|
|
|
2024-10-24 22:39:31 +02:00
|
|
|
SendSweepModuleInfo::SendSweepModuleInfo()
|
2024-12-30 15:59:01 +01:00
|
|
|
: m_actionTabItem(new ModuleSection(ModuleSection::OtherSectionTypeDefault, this))
|
2024-10-24 22:39:31 +02:00
|
|
|
{
|
|
|
|
|
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"));
|
2024-12-22 22:44:38 +01:00
|
|
|
m_actionTabItem->setStartQMLFile("qrc:/send-sweep/StartScan.qml");
|
2024-10-24 22:39:31 +02:00
|
|
|
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
|
2024-10-27 21:06:21 +01:00
|
|
|
auto introScreenSection = new ModuleSection(ModuleSection::CustomSectionType, this);
|
2024-12-22 22:44:38 +01:00
|
|
|
introScreenSection->setStartQMLFile("qrc:/send-sweep/SendPage.qml");
|
2024-10-27 21:06:21 +01:00
|
|
|
introScreenSection->setSectionId("main");
|
2024-10-25 11:33:11 +02:00
|
|
|
addSection(introScreenSection);
|
2024-10-24 22:39:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SendSweepModuleInfo::setEnabled(bool on)
|
|
|
|
|
{
|
|
|
|
|
m_enabled = on;
|
|
|
|
|
m_actionTabItem->setEnabled(on);
|
|
|
|
|
emit enabledChanged();
|
2024-10-01 21:26:01 +02:00
|
|
|
}
|