Files
pay/modules/example/ExampleModuleInfo.cpp
T

53 lines
2.3 KiB
C++
Raw Permalink Normal View History

/*
* This file is part of the Flowee project
* Copyright (C) 2023-2024 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/>.
*/
2023-06-11 19:06:16 +02:00
#include "ExampleModuleInfo.h"
2023-06-12 17:11:29 +02:00
ModuleInfo * ExampleModuleInfo::build()
2023-06-11 19:06:16 +02:00
{
2023-06-12 17:11:29 +02:00
ModuleInfo *info = new ModuleInfo();
2023-06-11 19:06:16 +02:00
info->setId("exampleModule");
2023-06-12 23:43:22 +02:00
info->setTitle(tr("Example Module"));
info->setDescription(tr("The example module is helpful in order to show the concept of a module "
"and what it can do in Flowee Pay. This text is shown in the module explorer UI."));
info->setIconSource("qrc:/example/example.svg");
// A section is a definition on where in the application this module is able
// to be plugged-in.
2025-10-12 23:10:59 +02:00
auto *sendButtonExample = new ModuleSection(ModuleSection::SendMethod, info);
2023-06-12 23:43:22 +02:00
sendButtonExample->setText(tr("Example Module"));
sendButtonExample->setSubtext(tr("This is some helptext"));
// notice that the directory it is in, is registered in the example-data.qrc file
2023-06-12 23:43:22 +02:00
sendButtonExample->setStartQMLFile("qrc:/example/ExamplePage.qml");
info->addSection(sendButtonExample);
2025-10-12 23:10:59 +02:00
auto *menuExample = new ModuleSection(ModuleSection::MainMenuItem, info);
menuExample->setText(tr("Example Module"));
menuExample->setSubtext(tr("This is some helptext"));
// notice that the directory it is in, is registered in the example-data.qrc file
menuExample->setStartQMLFile("qrc:/example/ExamplePage.qml");
info->addSection(menuExample);
2025-10-12 23:10:59 +02:00
auto *last = new ModuleSection(ModuleSection::OtherSectionType, info);
last->setText(menuExample->text());
last->setSubtext(menuExample->subtext());
last->setStartQMLFile(menuExample->startQMLFile());
info->addSection(last);
2023-06-12 17:11:29 +02:00
return info;
2023-06-11 19:06:16 +02:00
}