mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-27 18:12:21 -04:00
- added help dialog to plugins
- added svn revision number checking to plugin system. If svn revision is > 0 and matches the compiled revision number, the plugin is always accepted. - improved version number scripts to add the missing revision number as a int git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5512 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f7da165b86
commit
6782671951
9 changed files with 66 additions and 22 deletions
|
@ -37,6 +37,7 @@ PluginItem::PluginItem(const QString& pluginVersion, int id, const QString& plug
|
|||
|
||||
QObject::connect(_enabled_CB,SIGNAL(toggled(bool)),this,SLOT(togglePlugin(bool))) ;
|
||||
QObject::connect(_configure_PB,SIGNAL(clicked()),this,SLOT(configurePlugin())) ;
|
||||
QObject::connect(_about_PB,SIGNAL(clicked()),this,SLOT(aboutPlugin())) ;
|
||||
|
||||
expandFrame->hide();
|
||||
}
|
||||
|
@ -46,6 +47,11 @@ void PluginItem::togglePlugin(bool b)
|
|||
emit( pluginEnabled(b,_hashLabel->text()) ) ;
|
||||
}
|
||||
|
||||
void PluginItem::aboutPlugin()
|
||||
{
|
||||
emit( pluginAbout(_id) ) ;
|
||||
}
|
||||
|
||||
void PluginItem::configurePlugin()
|
||||
{
|
||||
emit( pluginConfigure(_id) ) ;
|
||||
|
|
|
@ -33,10 +33,12 @@ class PluginItem: public QWidget, public Ui::PluginItem
|
|||
protected slots:
|
||||
void togglePlugin(bool) ;
|
||||
void configurePlugin() ;
|
||||
void aboutPlugin() ;
|
||||
|
||||
signals:
|
||||
void pluginEnabled(bool,const QString&) ;
|
||||
void pluginConfigure(int) ;
|
||||
void pluginAbout(int) ;
|
||||
|
||||
private slots:
|
||||
void on_moreinfo_label_linkActivated(QString link);
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>416</width>
|
||||
<height>157</height>
|
||||
<width>788</width>
|
||||
<height>174</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
|
@ -163,6 +163,13 @@ p, li { white-space: pre-wrap; }
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="_about_PB">
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include "PluginsPage.h"
|
||||
#include "PluginItem.h"
|
||||
#include "rshare.h"
|
||||
|
@ -47,14 +49,15 @@ PluginsPage::PluginsPage(QWidget * parent, Qt::WFlags flags)
|
|||
|
||||
std::string file_name, file_hash, error_string ;
|
||||
uint32_t status ;
|
||||
uint32_t svn_revision ;
|
||||
|
||||
rsPlugins->getPluginStatus(i,status,file_name,file_hash,error_string) ;
|
||||
rsPlugins->getPluginStatus(i,status,file_name,file_hash,svn_revision,error_string) ;
|
||||
|
||||
QString status_string ;
|
||||
|
||||
switch(status)
|
||||
{
|
||||
case PLUGIN_STATUS_UNKNOWN_HASH: status_string = tr("Hash rejected. Add to white list.") ;
|
||||
case PLUGIN_STATUS_UNKNOWN_HASH: status_string = tr("SVN revision number ")+QString::number(svn_revision)+tr(" does not match current. Please manually enable the plugin at your own risk.") ;
|
||||
break ;
|
||||
case PLUGIN_STATUS_DLOPEN_ERROR: status_string = tr("Loading error.") ;
|
||||
break ;
|
||||
|
@ -107,6 +110,7 @@ PluginsPage::PluginsPage(QWidget * parent, Qt::WFlags flags)
|
|||
|
||||
QObject::connect(item,SIGNAL(pluginEnabled(bool,const QString&)),this,SLOT(togglePlugin(bool,const QString&))) ;
|
||||
QObject::connect(item,SIGNAL(pluginConfigure(int)),this,SLOT(configurePlugin(int))) ;
|
||||
QObject::connect(item,SIGNAL(pluginAbout(int)),this,SLOT(aboutPlugin(int))) ;
|
||||
}
|
||||
ui._pluginsLayout->update() ;
|
||||
|
||||
|
@ -129,6 +133,13 @@ void PluginsPage::toggleEnableAll(bool b)
|
|||
{
|
||||
rsPlugins->allowAllPlugins(b) ;
|
||||
}
|
||||
void PluginsPage::aboutPlugin(int i)
|
||||
{
|
||||
std::cerr << "Launching about window for plugin " << i << std::endl;
|
||||
|
||||
if(rsPlugins->plugin(i) != NULL && rsPlugins->plugin(i)->qt_about_page() != NULL)
|
||||
rsPlugins->plugin(i)->qt_about_page()->exec() ;
|
||||
}
|
||||
void PluginsPage::configurePlugin(int i)
|
||||
{
|
||||
std::cerr << "Launching configuration window for plugin " << i << std::endl;
|
||||
|
|
|
@ -44,6 +44,7 @@ class PluginsPage : public ConfigPage
|
|||
public slots:
|
||||
void togglePlugin(bool b,const QString&) ;
|
||||
void configurePlugin(int i) ;
|
||||
void aboutPlugin(int i) ;
|
||||
void toggleEnableAll(bool) ;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue