-
Notifications
You must be signed in to change notification settings - Fork 1
/
ExportImportPlugin.cpp
97 lines (82 loc) · 2.71 KB
/
ExportImportPlugin.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include "ExportImportPlugin.h"
#include "ExportImportPage.h"
#include <QMessageBox>
//static void *inited = new ExportToolsPlugin() ;
extern "C" {
#ifdef WIN32
__declspec(dllexport)
#endif
RsPlugin *RETROSHARE_PLUGIN_provide()
{
return new ExportImportPlugin();
}
// This symbol contains the svn revision number grabbed from the executable.
// It will be tested by RS to load the plugin automatically, since it is safe to load plugins
// with same revision numbers, assuming that the revision numbers are up-to-date.
//
#ifdef WIN32
__declspec(dllexport)
#endif
uint32_t RETROSHARE_PLUGIN_revision = RS_REVISION_NUMBER;
// This symbol contains the svn revision number grabbed from the executable.
// It will be tested by RS to load the plugin automatically, since it is safe to load plugins
// with same revision numbers, assuming that the revision numbers are up-to-date.
//
#ifdef WIN32
__declspec(dllexport)
#endif
uint32_t RETROSHARE_PLUGIN_api = RS_PLUGIN_API_VERSION ;
}
ExportImportPlugin::ExportImportPlugin()
{
Q_INIT_RESOURCE(ExportImport_images);
mIcon = new QIcon(":/images/icon.png");
}
MainPage* ExportImportPlugin::qt_page() const{
ExportImportPage* ep = new ExportImportPage(mPeers);
return ep;
}
ConfigPage* ExportImportPlugin::qt_config_page() const{
return NULL;
}
QDialog* ExportImportPlugin::qt_about_page() const
{
static QMessageBox *about_dialog = NULL ;
if(about_dialog == NULL)
{
about_dialog = new QMessageBox() ;
QString text ;
text += QObject::tr("<h3>RetroShare ExportImport plugin</h3><br/> * Contributors: Nyfor<br/>") ;
text += QObject::tr("<br/><br/>This is an experimental feature.") ;
about_dialog->setText(text) ;
about_dialog->setStandardButtons(QMessageBox::Ok) ;
}
return about_dialog ;
}
QIcon* ExportImportPlugin::qt_icon() const
{
return mIcon;
}
std::string ExportImportPlugin::getShortPluginDescription() const{
return "This plugin exports and imports your friends' keys.";
}
std::string ExportImportPlugin::getPluginName() const {
return "ExportImport";
}
void ExportImportPlugin::getPluginVersion(int& major, int& minor, int &build, int& svn_rev) const{
major = RS_MAJOR_VERSION;
minor = RS_MINOR_VERSION;
build = RS_BUILD_NUMBER;
svn_rev = RS_REVISION_NUMBER;
}
//
//========================== Plugin Interface ================================//
//
// Use these methods to access main objects from RetroShare.
//
void ExportImportPlugin::setInterfaces(RsPlugInInterfaces& interfaces){
mPeers = interfaces.mPeers;
}
void ExportImportPlugin::setPlugInHandler(RsPluginHandler* pgHandler){
mPlugInHandler = pgHandler;
}