subsurface/desktop-widgets/plugins/facebook/facebook_integration.cpp
Tomaz Canabrava a1ff14a48f Facebook Plugin is aware of it's connection status
This patch makes facebook plugin aware of it's connection status
enabling uploads only when connected, and hooking some things up.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 09:45:08 -08:00

43 lines
832 B
C++

#include "facebook_integration.h"
#include "facebookconnectwidget.h"
#include <QDebug>
FacebookPlugin::FacebookPlugin(QObject* parent): QObject(parent),
fbConnectWidget(new FacebookConnectWidget()),
fbUploadDialog(new SocialNetworkDialog())
{
}
bool FacebookPlugin::isConnected()
{
FacebookManager *instance = FacebookManager::instance();
return instance->loggedIn();
}
void FacebookPlugin::requestLogin()
{
fbConnectWidget->exec();
}
void FacebookPlugin::requestLogoff()
{
FacebookManager::instance()->logout();
}
QString FacebookPlugin::socialNetworkIcon() const
{
return QString();
}
QString FacebookPlugin::socialNetworkName() const
{
return tr("Facebook");
}
void FacebookPlugin::requestUpload()
{
FacebookManager *instance = FacebookManager::instance();
if (instance->loggedIn())
fbUploadDialog->exec();
}