2009-08-11 17:59:40 -04:00
|
|
|
/****************************************************************
|
|
|
|
* RetroShare is distributed under the following license:
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 - 2009 RetroShare Team
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
****************************************************************/
|
|
|
|
|
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
|
|
|
|
|