Files
pay/modules/send-sweep/SendSweepModuleInfo.cpp
T
tomFlowee 7e60f1fdea Refactor Intent: disconnect from app lifetime
The idea of using Flowee Pay to open a payment screen, or a sweep
screen, was so far married to the executable lifetime due to it being
passed as a command line argument.
This does not reflect reality, on neither desktop nor on mobile as
multi-tasking is possible and we should allow that.

As a result the new object "Intent" has been introduced with the
usecase specific properties. Setting those properties at any time
during the lifetime of the app now pushes the correct page to the
stack on mobile. Desktop is in need of more love in this department.
2024-10-27 21:54:48 +01:00

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::ActionTabItem, 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/SendPage.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(m_actionTabItem->startQMLFile());
introScreenSection->setSectionId("main");
addSection(introScreenSection);
}
void SendSweepModuleInfo::setEnabled(bool on)
{
m_enabled = on;
m_actionTabItem->setEnabled(on);
emit enabledChanged();
}