Make it possible to connect to facebook again

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-11-08 10:51:50 -02:00 committed by Dirk Hohndel
parent 70e6840d51
commit 486857f2b4
4 changed files with 10 additions and 2 deletions

View file

@ -260,6 +260,7 @@ MainWindow::MainWindow() : QMainWindow(),
toggle_connection->setText(plugin->socialNetworkName());
toggle_connection->setIcon(QIcon(plugin->socialNetworkIcon()));
toggle_connection->setData(QVariant::fromValue(plugin));
connect(toggle_connection, &QAction::triggered, [plugin](bool triggered){ plugin->requestLogin(); });
QAction *share_on = new QAction(this);
share_on->setText(plugin->socialNetworkName());

View file

@ -1,4 +1,7 @@
#include "facebook_integration.h"
#include "facebookconnectwidget.h"
#include <QDebug>
FacebookPlugin::FacebookPlugin(QObject* parent): QObject(parent)
{
@ -12,7 +15,8 @@ bool FacebookPlugin::isConnected()
void FacebookPlugin::requestLogin()
{
FacebookConnectWidget connectDialog;
connectDialog.exec();
}
void FacebookPlugin::requestLogoff()

View file

@ -275,6 +275,7 @@ void FacebookManager::sendDive()
}
FacebookConnectWidget::FacebookConnectWidget(QWidget *parent) : QDialog(parent), ui(new Ui::FacebookConnectWidget) {
ui->setupUi(this);
FacebookManager *fb = FacebookManager::instance();
facebookWebView = new QWebView(this);
ui->fbWebviewContainer->layout()->addWidget(facebookWebView);

View file

@ -40,8 +40,10 @@ void PluginManager::loadPlugins()
if(!plugin)
continue;
if (ISocialNetworkIntegration *social = qobject_cast<ISocialNetworkIntegration*>(plugin))
if (ISocialNetworkIntegration *social = qobject_cast<ISocialNetworkIntegration*>(plugin)) {
qDebug() << "Adding the plugin: " << social->socialNetworkName();
_socialNetworks.push_back(social);
}
}
}