mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
* Include only what is used * Use forward declaration when possible * Sorted includes refs #598
70 lines
2.1 KiB
C++
70 lines
2.1 KiB
C++
/* Copyright (C) 2015
|
|
* swift project Community / Contributors
|
|
*
|
|
* This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level
|
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
|
* contained in the LICENSE file.
|
|
*/
|
|
|
|
//! \file
|
|
|
|
#ifndef BLACKGUI_PLUGINSELECTOR_H
|
|
#define BLACKGUI_PLUGINSELECTOR_H
|
|
|
|
#include "blackgui/blackguiexport.h"
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
#include <QWidget>
|
|
|
|
class QSignalMapper;
|
|
|
|
namespace BlackGui
|
|
{
|
|
|
|
/*!
|
|
* Shows all available plugins in nice list and lets user enable, disable and configure
|
|
* each of them.
|
|
*/
|
|
class BLACKGUI_EXPORT CPluginSelector : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
signals:
|
|
//! Emitted when user enables/disables the particular plugin
|
|
void pluginStateChanged(const QString &identifier, bool enabled);
|
|
|
|
//! Emitted when user clicks the "Details" button
|
|
void pluginDetailsRequested(const QString &identifier);
|
|
|
|
//! Emitted when user clicks the "Settings" button
|
|
void pluginConfigRequested(const QString &identifier);
|
|
|
|
public:
|
|
//! Constructor
|
|
explicit CPluginSelector(QWidget *parent = 0);
|
|
|
|
//! Adds the new plugin to the list.
|
|
//! \param identifier Identifier of the plugin
|
|
//! \param name Name of the plugin
|
|
//! \param hasConfig Defines whether the plugin has the corresponding config plugin or not
|
|
//! \param enabled Defines whether the plugin is initially enabled or not
|
|
void addPlugin(const QString &identifier, const QString &name, bool hasConfig = false, bool enabled = true);
|
|
|
|
//! Enables/disabled the given plugin.
|
|
void setEnabled(const QString &identifier, bool enabled);
|
|
|
|
private slots:
|
|
void ps_handlePluginStateChange();
|
|
|
|
private:
|
|
QSignalMapper *m_detailsButtonMapper;
|
|
QSignalMapper *m_configButtonMapper;
|
|
|
|
};
|
|
|
|
} // namespace BlackGui
|
|
|
|
#endif // BLACKGUI_PLUGINSELECTOR_H
|