1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#include "collaborators.h"
6#include "services/window/windowservice.h"
7#include "mainframe/cvskeeper.h"
8#include "base/abstractaction.h"
9#include "base/abstractcentral.h"
10#include <QAction>
11
12using namespace dpfservice;
13void Collaborators::initialize()
14{
15
16}
17
18bool Collaborators::start()
19{
20 auto &ctx = dpfInstance.serviceContext();
21 WindowService *windowService = ctx.service<WindowService>(WindowService::name());
22 if (windowService) {
23 if (windowService->addActionNavigation) {
24 windowService->addActionNavigation("Git", new AbstractAction(new QAction(QIcon(":/core/images/git.png"), QAction::tr("Git"))));
25 windowService->addActionNavigation("Svn", new AbstractAction(new QAction(QIcon(":/core/images/subversion.png"), QAction::tr("Svn"))));
26 }
27 if (windowService->addCentralNavigation) {
28 windowService->addCentralNavigation("Git",
29 new AbstractCentral(CVSkeeper::instance()->gitMainWidget()));
30 windowService->addCentralNavigation("Svn",
31 new AbstractCentral(CVSkeeper::instance()->svnMainWidget()));
32 }
33 }
34 return true;
35}
36
37dpf::Plugin::ShutdownFlag Collaborators::stop()
38{
39 return Sync;
40}
41