aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/plugins/facebook/facebook_integration.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-11-08 11:50:04 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-08 09:45:08 -0800
commita1ff14a48f06e15c863f6ef0ba31b15c7bb1696d (patch)
tree66f97460c4369d5f61fa3eb5e02e21b5a9c88760 /desktop-widgets/plugins/facebook/facebook_integration.cpp
parent72b85e315194e5a2f58bad68ecb2fe2657e17bc7 (diff)
downloadsubsurface-a1ff14a48f06e15c863f6ef0ba31b15c7bb1696d.tar.gz
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>
Diffstat (limited to 'desktop-widgets/plugins/facebook/facebook_integration.cpp')
-rw-r--r--desktop-widgets/plugins/facebook/facebook_integration.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/desktop-widgets/plugins/facebook/facebook_integration.cpp b/desktop-widgets/plugins/facebook/facebook_integration.cpp
index 43f74b8f9..f817f9df8 100644
--- a/desktop-widgets/plugins/facebook/facebook_integration.cpp
+++ b/desktop-widgets/plugins/facebook/facebook_integration.cpp
@@ -3,25 +3,26 @@
#include <QDebug>
-FacebookPlugin::FacebookPlugin(QObject* parent): QObject(parent)
+FacebookPlugin::FacebookPlugin(QObject* parent): QObject(parent),
+ fbConnectWidget(new FacebookConnectWidget()),
+ fbUploadDialog(new SocialNetworkDialog())
{
-
}
bool FacebookPlugin::isConnected()
{
- return false;
+ FacebookManager *instance = FacebookManager::instance();
+ return instance->loggedIn();
}
void FacebookPlugin::requestLogin()
{
- FacebookConnectWidget connectDialog;
- connectDialog.exec();
+ fbConnectWidget->exec();
}
void FacebookPlugin::requestLogoff()
{
-
+ FacebookManager::instance()->logout();
}
QString FacebookPlugin::socialNetworkIcon() const
@@ -36,5 +37,7 @@ QString FacebookPlugin::socialNetworkName() const
void FacebookPlugin::requestUpload()
{
- qDebug() << "Upload Requested";
+ FacebookManager *instance = FacebookManager::instance();
+ if (instance->loggedIn())
+ fbUploadDialog->exec();
}