1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#include "corereceiver.h"
6#include "mainframe/windowkeeper.h"
7#include "common/common.h"
8
9#include <QGridLayout>
10#include <QActionGroup>
11
12CoreReceiver::CoreReceiver(QObject *parent)
13 : dpf::EventHandler (parent)
14{
15
16}
17
18dpf::EventHandler::Type CoreReceiver::type()
19{
20 return dpf::EventHandler::Type::Sync;
21}
22
23QStringList CoreReceiver::topics()
24{
25 return {navigation.topic};
26}
27
28void CoreReceiver::eventProcess(const dpf::Event &event)
29{
30 if(event.data() == navigation.doSwitch.name) {
31 QString actionTextKey = navigation.doSwitch.pKeys[0];
32 QString actionText = event.property(actionTextKey).toString();
33 WindowKeeper::instace()->switchWidgetNavigation(actionText);
34 }
35}
36