mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Make the skeleton Facebook plugin and make sure it is loaded
Currently we need to copy manually the plugin dynamic library to the /plugins folder. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
391172240a
commit
8dad3457ef
6 changed files with 78 additions and 14 deletions
|
|
@ -256,15 +256,17 @@ MainWindow::MainWindow() : QMainWindow(),
|
|||
#endif
|
||||
|
||||
if(PluginManager::instance().socialNetworkIntegrationPlugins().count()) {
|
||||
QMenu *connections = new QMenu();
|
||||
QMenu *connections = new QMenu(tr("Connect to"));
|
||||
for(ISocialNetworkIntegration *plugin : PluginManager::instance().socialNetworkIntegrationPlugins()){
|
||||
QAction *toggle_connection = new QAction(this);
|
||||
toggle_connection->setText(plugin->socialNetworkName());
|
||||
toggle_connection->setIcon(QIcon(plugin->socialNetworkIcon()));
|
||||
toggle_connection->setData(QVariant::fromValue(plugin));
|
||||
|
||||
QAction *share_on = new QAction(this);
|
||||
share_on->setText(plugin->socialNetworkName());
|
||||
share_on->setIcon(QIcon(plugin->socialNetworkIcon()));
|
||||
share_on->setData(QVariant::fromValue(plugin));
|
||||
ui.menuShare_on->addAction(share_on);
|
||||
connections->addAction(toggle_connection);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
set(FACEBOOK_PLUGIN_SRCS facebook_integration.cpp)
|
||||
|
||||
add_library(facebook_integration ${FACEBOOK_PLUGIN_SRCS})
|
||||
add_library(facebook_integration SHARED ${FACEBOOK_PLUGIN_SRCS})
|
||||
|
||||
target_link_libraries(facebook_integration subsurface_core ${QT_LIBRARIES})
|
||||
target_link_libraries(facebook_integration subsurface_corelib ${QT_LIBRARIES})
|
||||
add_dependencies(facebook_integration subsurface_corelib)
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
#include "facebook_integration.h"
|
||||
|
||||
FacebookPlugin::FacebookPlugin(QObject* parent): QObject(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool FacebookPlugin::isConnected()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void FacebookPlugin::requestLogin()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void FacebookPlugin::requestLogoff()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QString FacebookPlugin::socialNetworkIcon() const
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
|
||||
QString FacebookPlugin::socialNetworkName() const
|
||||
{
|
||||
return tr("Facebook");
|
||||
}
|
||||
|
||||
void FacebookPlugin::uploadCurrentDive()
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef FACEBOOK_INTEGRATION_H
|
||||
#define FACEBOOK_INTEGRATION_H
|
||||
|
||||
#include "subsurface-core/isocialnetworkintegration.h"
|
||||
#include <QString>
|
||||
|
||||
class FacebookPlugin : public QObject, public ISocialNetworkIntegration {
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.subsurface.plugins.ISocialNetworkIntegration")
|
||||
Q_INTERFACES(ISocialNetworkIntegration)
|
||||
public:
|
||||
explicit FacebookPlugin(QObject* parent = 0);
|
||||
virtual bool isConnected();
|
||||
virtual void requestLogin();
|
||||
virtual void requestLogoff();
|
||||
virtual QString socialNetworkIcon() const;
|
||||
virtual QString socialNetworkName() const;
|
||||
virtual void uploadCurrentDive();
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue