Debian Codegraph @

avogadro/qtplugins/packageinstaller/packageinstaller.h

raw
1 /******************************************************************************
2 This source file is part of the Avogadro project.
3 This source code is released under the 3-Clause BSD License, (see "LICENSE").
4 ******************************************************************************/
5
6 #ifndef AVOGADRO_QTPLUGINS_PACKAGEINSTALLER_H
7 #define AVOGADRO_QTPLUGINS_PACKAGEINSTALLER_H
8
9 #include <avogadro/qtgui/extensionplugin.h>
10
11 #include <QtCore/QPointer>
12
13 class QAction;
14
15 namespace Avogadro {
16 namespace QtPlugins {
17
18 class PackageManagerDialog;
19
20 /**
21 * @brief Extension plugin that provides the "Manage Packages…" dialog,
22 * allowing users to browse, install, update, and remove Avogadro packages.
23 */
24 class PackageInstaller : public QtGui::ExtensionPlugin
25 {
26 Q_OBJECT
27
28 public:
29 explicit PackageInstaller(QObject* parent = nullptr);
30 ~PackageInstaller() override;
31
32 QString name() const override { return tr("Package Installer"); }
33
34 QString description() const override
35 {
36 return tr("Install, update, and remove Avogadro packages.");
37 }
38
39 QList<QAction*> actions() const override;
40 QStringList menuPath(QAction*) const override;
41 void setMolecule(QtGui::Molecule*) override {}
42
43 private slots:
44 void showDialog();
45
46 private:
47 QAction* m_action = nullptr;
48 QPointer<PackageManagerDialog> m_dialog;
49 };
50
51 } // namespace QtPlugins
52 } // namespace Avogadro
53
54 #endif // AVOGADRO_QTPLUGINS_PACKAGEINSTALLER_H