Changeset b2cc840 in subsurface


Ignore:
Timestamp:
Jan 1, 2017, 10:24:48 PM (5 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
346f4d4f
Parents:
a63505dd
git-author:
Dirk Hohndel <dirk@…> (01/01/17 22:23:39)
git-committer:
Dirk Hohndel <dirk@…> (01/01/17 22:24:48)
Message:

Facebook integration: change the menu entry to disconnect

This way the menu entry becomes the togglee it appears it was designed to be in
the first place.

This closes #129

Signed-off-by: Dirk Hohndel <dirk@…>

Location:
desktop-widgets
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • desktop-widgets/mainwindow.cpp

    rc39fbea rb2cc840  
    6060#if defined(FBSUPPORT)
    6161#include "plugins/facebook/facebook_integration.h"
     62#include "plugins/facebook/facebookconnectwidget.h"
    6263#endif
    6364
     
    337338        toggle_connection->setData(QVariant::fromValue(obj));
    338339        connect(toggle_connection, SIGNAL(triggered()), this, SLOT(socialNetworkRequestConnect()));
    339 
     340        FacebookManager *fb = FacebookManager::instance();
     341        connect(fb, &FacebookManager::justLoggedIn, this, &MainWindow::facebookLoggedIn);
     342        connect(fb, &FacebookManager::justLoggedOut, this, &MainWindow::facebookLoggedOut);
    340343        QAction *share_on = new QAction(this);
    341344        share_on->setText(facebookPlugin->socialNetworkName());
     
    349352        ui.menubar->show();
    350353#endif
     354}
     355
     356void MainWindow::facebookLoggedIn()
     357{
     358        connections->setTitle(tr("Disconnect from"));
     359}
     360
     361void MainWindow::facebookLoggedOut()
     362{
     363        connections->setTitle(tr("Connect to"));
    351364}
    352365
  • desktop-widgets/mainwindow.h

    rc39fbea rb2cc840  
    184184        void socialNetworkRequestConnect();
    185185        void socialNetworkRequestUpload();
     186        void facebookLoggedIn();
     187        void facebookLoggedOut();
     188
    186189private:
    187190        Ui::MainWindow ui;
  • desktop-widgets/plugins/facebook/facebookconnectwidget.cpp

    ra63505dd rb2cc840  
    252252        ui->fbWebviewContainer->hide();
    253253        ui->fbWebviewContainer->setEnabled(false);
    254         ui->FBLabel->setText(tr("To disconnect Subsurface from your Facebook account, use the button below"));
     254        ui->FBLabel->setText(tr("To disconnect Subsurface from your Facebook account, use the 'Share on' menu entry."));
    255255}
    256256
Note: See TracChangeset for help on using the changeset viewer.