2009-02-05 10:29:43 -05:00
|
|
|
#ifndef _PLUGIN_MANAGER_WIDGET_
|
|
|
|
#define _PLUGIN_MANAGER_WIDGET_
|
|
|
|
|
|
|
|
#include <QFrame>
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
class QWidget;
|
|
|
|
class QLabel;
|
|
|
|
class QHBoxLayout;
|
|
|
|
class QVBoxLayout;
|
|
|
|
class QPushButton;
|
|
|
|
class QSpacerItem;
|
2009-02-09 16:01:41 -05:00
|
|
|
class QTextEdit;
|
2009-02-05 10:29:43 -05:00
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
class PluginFrame : public QFrame
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2009-02-09 16:01:41 -05:00
|
|
|
PluginFrame( QString pluginName, QWidget* parent =0 );
|
2009-02-05 10:29:43 -05:00
|
|
|
virtual ~PluginFrame();
|
|
|
|
|
2009-02-09 16:01:41 -05:00
|
|
|
QString getPluginName();
|
|
|
|
|
2009-02-05 10:29:43 -05:00
|
|
|
signals:
|
|
|
|
void needToRemove(QString pluginName);
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
void removeButtonClicked();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
QString plgName;
|
|
|
|
|
|
|
|
QPushButton* removeBtn;
|
|
|
|
QVBoxLayout* buttonsLay;
|
|
|
|
|
|
|
|
QHBoxLayout* mainLay; // main layout for the frame
|
|
|
|
|
|
|
|
QVBoxLayout* labelsLay;
|
|
|
|
QLabel* nameLabel;
|
|
|
|
QLabel* descrLabel;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
2009-02-09 16:01:41 -05:00
|
|
|
//! GUI representation of the PluginManager class
|
|
|
|
|
|
|
|
//! This is something like GUI for PluginManager class. Or you can think
|
|
|
|
//! about PluginManagerWidget as a view, and a PluginManager as a model.
|
|
|
|
//! Instances should be created only by PluginManager class; maybe later i'll
|
|
|
|
//! hide constructor in some way. Parent (or somebody else) can delete it.
|
|
|
|
//! Widget itself can be used anywere, in some 'settings' dialogs.
|
2009-02-05 10:29:43 -05:00
|
|
|
class PluginManagerWidget: public QFrame
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2009-02-09 16:01:41 -05:00
|
|
|
PluginManagerWidget(QWidget* parent =0);
|
2009-02-05 10:29:43 -05:00
|
|
|
virtual ~PluginManagerWidget();
|
|
|
|
|
2009-02-09 16:01:41 -05:00
|
|
|
void registerNewPlugin(QString pluginName);
|
|
|
|
void removePluginFrame(QString pluginName);
|
2009-02-05 10:29:43 -05:00
|
|
|
|
|
|
|
signals:
|
2009-02-09 16:01:41 -05:00
|
|
|
void removeRequested(QString pluginName);
|
|
|
|
void installPluginRequested(QString fileName) ;
|
2009-02-05 10:29:43 -05:00
|
|
|
|
2009-02-09 16:01:41 -05:00
|
|
|
public slots:
|
|
|
|
void acceptErrorMessage(QString errorMessage);
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
|
2009-02-05 10:29:43 -05:00
|
|
|
protected:
|
2009-02-09 16:01:41 -05:00
|
|
|
QVBoxLayout* mainLayout;
|
|
|
|
QFrame* pluginFramesContainer;
|
|
|
|
QVBoxLayout* pluginFramesLayout;
|
|
|
|
|
|
|
|
QPushButton* installPluginButton;
|
|
|
|
QHBoxLayout* installPluginLayout;
|
|
|
|
QSpacerItem* installPluginSpacer;
|
2009-02-05 10:29:43 -05:00
|
|
|
|
2009-02-09 16:01:41 -05:00
|
|
|
QTextEdit* errorsConsole;
|
2009-02-05 10:29:43 -05:00
|
|
|
|
|
|
|
protected slots:
|
2009-02-09 16:01:41 -05:00
|
|
|
void installPluginButtonClicked();
|
2009-02-05 10:29:43 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|