From a1ff14a48f06e15c863f6ef0ba31b15c7bb1696d Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sun, 8 Nov 2015 11:50:04 -0200 Subject: 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 Signed-off-by: Dirk Hohndel --- .../plugins/facebook/facebook_integration.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'desktop-widgets/plugins/facebook/facebook_integration.cpp') 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 -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(); } -- cgit v1.2.3-70-g09d2