mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-09 17:45:15 -04:00
Improvement of the plugin system:
- Added configuration saving for plugin manager and serialization methods - added a list of accepted plugin hashes - added plugin widget for each plugin in settings, to allow enabling/disabling plugins - updated LinkCloud plugin to new rsPlugin class - put the addconfiguration for plugin manager in rsinit.cc a bit earlier to allow to load the list of accepted hashes early enough - added icon for disabled plugins git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4393 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
de87a89437
commit
ccfbfa9984
21 changed files with 965 additions and 103 deletions
|
@ -37,22 +37,36 @@ class p3Service ;
|
|||
class p3ConnectMgr ;
|
||||
class MainPage ;
|
||||
class QIcon ;
|
||||
class QString ;
|
||||
class QWidget ;
|
||||
class RsCacheService ;
|
||||
class ftServer ;
|
||||
class pqiService ;
|
||||
|
||||
// Used for the status of plugins.
|
||||
//
|
||||
#define PLUGIN_STATUS_NO_STATUS 0x0000
|
||||
#define PLUGIN_STATUS_UNKNOWN_HASH 0x0001
|
||||
#define PLUGIN_STATUS_DLOPEN_ERROR 0x0002
|
||||
#define PLUGIN_STATUS_MISSING_SYMBOL 0x0003
|
||||
#define PLUGIN_STATUS_NULL_PLUGIN 0x0004
|
||||
#define PLUGIN_STATUS_LOADED 0x0005
|
||||
|
||||
class RsPlugin
|
||||
{
|
||||
public:
|
||||
virtual RsCacheService *rs_cache_service() const { return NULL ; }
|
||||
virtual pqiService *rs_pqi_service() const { return NULL ; }
|
||||
virtual uint16_t rs_service_id() const { return 0 ; }
|
||||
|
||||
virtual MainPage *qt_page() const { return NULL ; }
|
||||
virtual QWidget *qt_config_panel() const { return NULL ; }
|
||||
virtual QIcon *qt_icon() const { return NULL ; }
|
||||
|
||||
virtual std::string configurationFileName() const { return std::string() ; }
|
||||
virtual std::string getShortPluginDescription() const = 0 ;
|
||||
virtual std::string getPluginName() const = 0 ;
|
||||
virtual void getPluginVersion(int& major,int& minor,int& svn_rev) const = 0 ;
|
||||
};
|
||||
|
||||
class RsPluginHandler
|
||||
|
@ -63,6 +77,9 @@ class RsPluginHandler
|
|||
virtual int nbPlugins() const = 0 ;
|
||||
virtual RsPlugin *plugin(int i) = 0 ;
|
||||
virtual const std::vector<std::string>& getPluginDirectories() const = 0;
|
||||
virtual void getPluginStatus(int i,uint32_t& status,std::string& file_name,std::string& file_hash,std::string& error_string) const = 0 ;
|
||||
virtual void enablePlugin(const std::string& hash) = 0;
|
||||
virtual void disablePlugin(const std::string& hash) = 0;
|
||||
|
||||
virtual void slowTickPlugins(time_t sec) = 0 ;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue