Krita Source Code Documentation
Loading...
Searching...
No Matches
resourcemanager.cpp
Go to the documentation of this file.
1/*
2 * resourcemanager.cc -- Part of Krita
3 *
4 * SPDX-FileCopyrightText: 2004 Boudewijn Rempt (boud@valdyas.org)
5 * SPDX-FileCopyrightText: 2021 L. E. Segovia <amy@amyspark.me>
6 *
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
9
10#include "resourcemanager.h"
11
12#include <klocalizedstring.h>
13#include <kpluginfactory.h>
14
15#include <kis_action.h>
16#include <KisViewManager.h>
17#include <KisPart.h>
18
19#include "dlg_bundle_manager.h"
20#include "dlg_create_bundle.h"
21#include "DlgResourceManager.h"
22
23#ifdef Q_OS_ANDROID
25#endif
26
28public:
29
31 {
32 }
33};
34
35K_PLUGIN_FACTORY_WITH_JSON(ResourceManagerFactory, "kritaresourcemanager.json", registerPlugin<ResourceManager>();)
36
37ResourceManager::ResourceManager(QObject *parent, const QVariantList &)
38 : KisActionPlugin(parent)
39 , d(new Private())
40{
41 KisAction *action = new KisAction(i18n("Manage Resource Libraries..."), this);
42 addAction("manage_bundles", action);
43 connect(action, SIGNAL(triggered()), this, SLOT(slotManageBundles()));
44
45 action = new KisAction(i18n("Manage Resources..."), this);
46 addAction("manage_resources", action);
47 connect(action, SIGNAL(triggered()), this, SLOT(slotManageResources()));
48
49#ifdef Q_OS_ANDROID
50 action = new KisAction(i18n("Get More Resources..."), this);
51 addAction("manage_supporter_bundles", action);
52 connect(action, &QAction::triggered, this, &ResourceManager::slotManageSupporterBundles);
53#endif
54}
55
59
61{
62 QPointer<DlgBundleManager> dlg = new DlgBundleManager(qApp->activeWindow());
63 dlg->exec();
64}
65
67{
68 DlgResourceManager dlg(viewManager()->actionManager());
69 dlg.exec();
70}
71
72
73#ifdef Q_OS_ANDROID
74void ResourceManager::slotManageSupporterBundles()
75{
76 // Gotta summon it like this, doing it with exec() causes kinetic scrolling
77 // to not work properly, requiring two fingers instead of one. No clue why.
78 KisSupporterBundlesDialog *dlg = new KisSupporterBundlesDialog(qApp->activeWindow());
79 dlg->setAttribute(Qt::WA_DeleteOnClose);
80 dlg->show();
81}
82#endif
83
84#include "resourcemanager.moc"
QPointer< KisViewManager > viewManager() const
ResourceManager(QObject *parent, const QVariantList &)
~ResourceManager() override
K_PLUGIN_FACTORY_WITH_JSON(KritaASCCDLFactory, "kritaasccdl.json", registerPlugin< KritaASCCDL >();) KritaASCCDL