diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-09-16 16:43:01 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-09-16 21:16:58 -0700 |
commit | d59e89e569b732661633424fcf19f09e95b936fe (patch) | |
tree | 738d09dfd413ba279ada2a05a88eba5a031efcdf /qt-ui/mainwindow.cpp | |
parent | e945134cc48315dfbe462051d9facd1543779e2c (diff) | |
download | subsurface-d59e89e569b732661633424fcf19f09e95b936fe.tar.gz |
Make Facebook more user friendly
The current way that facebook works is terrible: it's scattered
around tons of files ( at least 4 different files and classes )
this moves things around a bit, add a disconnect button that
was missing, cleans tons of code and fix inconsistencies.
I will also redo this part for 5.0, but it's too late for 4.5
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r-- | qt-ui/mainwindow.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index d26ad2a3b..43bc4d3fb 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -51,6 +51,10 @@ #include <qthelper.h> #include <QtConcurrentRun> +#if defined(FBSUPPORT) +#include "socialnetworks.h" +#endif + QProgressDialog *progressDialog = NULL; bool progressDialogCanceled = false; @@ -235,6 +239,16 @@ MainWindow::MainWindow() : QMainWindow(), find_all_templates(); #endif +#if defined(FBSUPPORT) + FacebookManager *fb = FacebookManager::instance(); + connect(fb, SIGNAL(justLoggedIn(bool)), ui.actionFacebook, SLOT(setEnabled(bool))); + connect(fb, SIGNAL(justLoggedOut(bool)), ui.actionFacebook, SLOT(setEnabled(bool))); + connect(ui.actionFacebook, SIGNAL(triggered(bool)), fb, SLOT(sendDive())); + ui.actionFacebook->setEnabled(fb->loggedIn()); +#else + ui.actionFacebook->setEnabled(false); +#endif + ui.menubar->show(); set_git_update_cb(&updateProgress); } |