1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#include "recent.h"
6#include "base/abstractmenu.h"
7#include "base/abstractaction.h"
8#include "base/abstractcentral.h"
9#include "base/abstractwidget.h"
10#include "services/window/windowservice.h"
11#include "mainframe/recentdisplay.h"
12#include "transceiver/recentreceiver.h"
13
14#include <QAction>
15#include <QLabel>
16
17using namespace dpfservice;
18
19void Recent::initialize()
20{
21
22}
23
24bool Recent::start()
25{
26 qInfo() << __FUNCTION__;
27 auto &ctx = dpfInstance.serviceContext();
28 WindowService *windowService = ctx.service<WindowService>(WindowService::name());
29
30 if (windowService) {
31 QObject::connect(RecentProxy::instance(), &RecentProxy::saveOpenedProject,
32 RecentDisplay::instance(), &RecentDisplay::addProject);
33 QObject::connect(RecentProxy::instance(), &RecentProxy::saveOpenedFile,
34 RecentDisplay::instance(), &RecentDisplay::addDocument);
35 auto recentWidgetImpl = new AbstractCentral(RecentDisplay::instance());
36 if (windowService->addCentralNavigation) {
37 windowService->addCentralNavigation(MWNA_RECENT, recentWidgetImpl);
38 }
39 }
40 return true;
41}
42
43dpf::Plugin::ShutdownFlag Recent::stop()
44{
45 return Sync;
46}
47