summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r--desktop-widgets/mainwindow.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 14ba96772..32f0d8d07 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -250,7 +250,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(); });
+ connect(toggle_connection, SIGNAL(triggered()), this, SLOT(socialNetworkRequestConnect()));
QAction *share_on = new QAction(this);
share_on->setText(plugin->socialNetworkName());
@@ -258,7 +258,7 @@ MainWindow::MainWindow() : QMainWindow(),
share_on->setData(QVariant::fromValue(plugin));
ui.menuShare_on->addAction(share_on);
connections->addAction(toggle_connection);
- connect(share_on, &QAction::triggered, [plugin](bool triggered) { plugin->requestUpload(); });
+ connect(share_on, SIGNAL(triggered()), this, SLOT(socialNetworkRequestUpload()));
}
ui.menuShare_on->addSeparator();
ui.menuShare_on->addMenu(connections);
@@ -276,6 +276,23 @@ MainWindow::~MainWindow()
m_Instance = NULL;
}
+void MainWindow::socialNetworkRequestConnect()
+{
+ QAction *action = qobject_cast<QAction*>(sender());
+ ISocialNetworkIntegration *plugin = action->data().value<ISocialNetworkIntegration*>();
+ if (plugin->isConnected())
+ plugin->requestLogoff();
+ else
+ plugin->requestLogin();
+}
+
+void MainWindow::socialNetworkRequestUpload()
+{
+ QAction *action = qobject_cast<QAction*>(sender());
+ ISocialNetworkIntegration *plugin = action->data().value<ISocialNetworkIntegration*>();
+ plugin->requestUpload();
+}
+
void MainWindow::setStateProperties(const QByteArray& state, const PropertyList& tl, const PropertyList& tr, const PropertyList& bl, const PropertyList& br)
{
stateProperties[state] = PropertiesForQuadrant(tl, tr, bl, br);