RetroShare/retroshare-gui/src/gui/PluginsPage.cpp
beardog_uk b94e6f6386 ccc
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1031 b45a01b8-16f6-495d-af2f-9b41ad6348cc
2009-02-09 21:01:41 +00:00

80 lines
1.9 KiB
C++

#include <QGroupBox>
#include <QFrame>
#include <QVBoxLayout>
#include <QTabWidget>
#include <QLabel>
#include <QSizePolicy>
#include <QTextEdit>
//#include <QtPlugin>
//#include <QPluginLoader>
//#include <QDir>
#include <QDebug>
#include <QStringList>
#include <QRegExp>
//#include <QApplication> // for qApp->....
//#include <QFile>
#include <QMessageBox>
#include <QGroupBox>
#include "PluginsPage.h"
#include "PluginManager.h"
//==============================================================================
PluginsPage::PluginsPage(QWidget *parent )
// :QGroupBox(parent) // this is for toy applications, do not remove
:MainPage(parent) // this for real retroshare app
{
//===
pluginManager = new PluginManager();
connect( pluginManager, SIGNAL( newPluginRegistered(QString) ),
this , SLOT( pluginRegistered(QString) ) );
//=== create some gui elements =====
pluginPageLayout = new QVBoxLayout(this);
// this->setTitle("RetroShare plugins");
pluginTabs = new QTabWidget(this) ;
pluginPageLayout->addWidget(pluginTabs);
pmFrame = new QFrame(this);
pmLay = new QVBoxLayout(pmFrame);
QWidget* tw = pluginManager->getViewWidget();
pmLay->addWidget( tw );
pmSpacer = new QSpacerItem(283, 20,
QSizePolicy::Expanding, QSizePolicy::Minimum);
pmLay->addItem(pmSpacer);
pluginTabs->addTab( pmFrame, "Manager" ) ;
pluginManager->defaultLoad( ) ;
}
//==============================================================================
PluginsPage::~PluginsPage()
{
delete pluginManager;
}
//=============================================================================
void
PluginsPage::pluginRegistered(QString pluginName)
{
//
QWidget* pw = pluginManager->pluginWidget( pluginName);
pluginTabs->addTab( pw , pluginName );
}
//==============================================================================