2015-10-29 23:47:08 +00:00
|
|
|
#include "facebook_integration.h"
|
2015-11-08 12:51:50 +00:00
|
|
|
#include "facebookconnectwidget.h"
|
|
|
|
|
|
|
|
#include <QDebug>
|
2015-10-29 23:47:08 +00:00
|
|
|
|
2015-11-08 13:50:04 +00:00
|
|
|
FacebookPlugin::FacebookPlugin(QObject* parent): QObject(parent),
|
|
|
|
fbConnectWidget(new FacebookConnectWidget()),
|
|
|
|
fbUploadDialog(new SocialNetworkDialog())
|
2015-10-29 23:47:08 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool FacebookPlugin::isConnected()
|
|
|
|
{
|
2015-11-08 13:50:04 +00:00
|
|
|
FacebookManager *instance = FacebookManager::instance();
|
|
|
|
return instance->loggedIn();
|
2015-10-29 23:47:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void FacebookPlugin::requestLogin()
|
|
|
|
{
|
2015-11-08 13:50:04 +00:00
|
|
|
fbConnectWidget->exec();
|
2015-10-29 23:47:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void FacebookPlugin::requestLogoff()
|
|
|
|
{
|
2015-11-08 13:50:04 +00:00
|
|
|
FacebookManager::instance()->logout();
|
2015-10-29 23:47:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QString FacebookPlugin::socialNetworkIcon() const
|
|
|
|
{
|
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString FacebookPlugin::socialNetworkName() const
|
|
|
|
{
|
|
|
|
return tr("Facebook");
|
|
|
|
}
|
|
|
|
|
2015-11-08 12:58:59 +00:00
|
|
|
void FacebookPlugin::requestUpload()
|
2015-10-29 23:47:08 +00:00
|
|
|
{
|
2015-11-08 13:50:04 +00:00
|
|
|
FacebookManager *instance = FacebookManager::instance();
|
|
|
|
if (instance->loggedIn())
|
|
|
|
fbUploadDialog->exec();
|
2015-10-29 23:47:08 +00:00
|
|
|
}
|