Changeset f2d8861 in subsurface


Ignore:
Timestamp:
Apr 16, 2017, 7:43:23 AM (2 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
03b2b854
Parents:
a5d54b0
git-author:
Jan Mulder <jlmulder@…> (04/16/17 02:41:29)
git-committer:
Dirk Hohndel <dirk@…> (04/16/17 07:43:23)
Message:

Restore FB grayed out when disconnected

See https://github.com/Subsurface-divelog/subsurface/issues/253. The original
behaviour (greyed out when disconnected) is restored. Not sure where and when
got lost, but this simple change fixes it.

Fixes #253

Signed-off-by: Jan Mulder <jlmulder@…>

Location:
desktop-widgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • desktop-widgets/mainwindow.cpp

    r1fc4fba rf2d8861  
    341341        connect(fb, &FacebookManager::justLoggedIn, this, &MainWindow::facebookLoggedIn);
    342342        connect(fb, &FacebookManager::justLoggedOut, this, &MainWindow::facebookLoggedOut);
    343         QAction *share_on = new QAction(this);
    344         share_on->setText(facebookPlugin->socialNetworkName());
    345         share_on->setIcon(QIcon(facebookPlugin->socialNetworkIcon()));
    346         share_on->setData(QVariant::fromValue(obj));
    347         ui.menuShare_on->addAction(share_on);
     343        share_on_fb = new QAction(this);
     344        share_on_fb->setText(facebookPlugin->socialNetworkName());
     345        share_on_fb->setIcon(QIcon(facebookPlugin->socialNetworkIcon()));
     346        share_on_fb->setData(QVariant::fromValue(obj));
     347        share_on_fb->setEnabled(false);
     348        ui.menuShare_on->addAction(share_on_fb);
    348349        connections->addAction(toggle_connection);
    349         connect(share_on, SIGNAL(triggered()), this, SLOT(socialNetworkRequestUpload()));
     350        connect(share_on_fb, SIGNAL(triggered()), this, SLOT(socialNetworkRequestUpload()));
    350351        ui.menuShare_on->addSeparator();
    351352        ui.menuShare_on->addMenu(connections);
     
    357358{
    358359        connections->setTitle(tr("Disconnect from"));
     360        share_on_fb->setEnabled(true);
    359361}
    360362
     
    362364{
    363365        connections->setTitle(tr("Connect to"));
     366        share_on_fb->setEnabled(false);
    364367}
    365368
  • desktop-widgets/mainwindow.h

    rb2cc840 rf2d8861  
    246246        GpsLocation *locationProvider;
    247247        QMenu *connections;
     248        QAction *share_on_fb;
    248249};
    249250
Note: See TracChangeset for help on using the changeset viewer.