diff options
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 526a71a17..fa30188c2 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -59,6 +59,7 @@ #if defined(FBSUPPORT) #include "plugins/facebook/facebook_integration.h" +#include "plugins/facebook/facebookconnectwidget.h" #endif QProgressDialog *progressDialog = NULL; @@ -336,7 +337,9 @@ void MainWindow::setupSocialNetworkMenu() toggle_connection->setIcon(QIcon(facebookPlugin->socialNetworkIcon())); toggle_connection->setData(QVariant::fromValue(obj)); connect(toggle_connection, SIGNAL(triggered()), this, SLOT(socialNetworkRequestConnect())); - + FacebookManager *fb = FacebookManager::instance(); + connect(fb, &FacebookManager::justLoggedIn, this, &MainWindow::facebookLoggedIn); + connect(fb, &FacebookManager::justLoggedOut, this, &MainWindow::facebookLoggedOut); QAction *share_on = new QAction(this); share_on->setText(facebookPlugin->socialNetworkName()); share_on->setIcon(QIcon(facebookPlugin->socialNetworkIcon())); @@ -350,6 +353,16 @@ void MainWindow::setupSocialNetworkMenu() #endif } +void MainWindow::facebookLoggedIn() +{ + connections->setTitle(tr("Disconnect from")); +} + +void MainWindow::facebookLoggedOut() +{ + connections->setTitle(tr("Connect to")); +} + void MainWindow::socialNetworkRequestConnect() { QAction *action = qobject_cast<QAction*>(sender()); |