From 571f86485d6063f86901487bca62e79b6383db45 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sun, 28 Dec 2014 20:24:02 -0200 Subject: Move the Facebook send profile button Move from the Dive List context menu to the Dive Info tab, it will only appear when connected to Facebook. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/divelistview.cpp | 8 -- qt-ui/divelistview.h | 1 - qt-ui/maintab.cpp | 6 + qt-ui/maintab.ui | 351 +++++++++++++++++++++++++------------------------ 4 files changed, 183 insertions(+), 183 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index cbbf35152..d6f52c646 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -826,9 +826,6 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event) popup.addAction(tr("Shift times"), this, SLOT(shiftTimes())); popup.addAction(tr("Load images"), this, SLOT(loadImages())); } - if (prefs.facebook.user_id) { - popup.addAction(tr("Publish on Facebook"), this, SLOT(publishFacebook())); - } // "collapse all" really closes all trips, // "collapse" keeps the trip with the selected dive open @@ -842,11 +839,6 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event) event->accept(); } -void DiveListView::publishFacebook() -{ - FacebookManager *fb = FacebookManager::instance(); - fb->sendDive(1); -} void DiveListView::shiftTimes() { diff --git a/qt-ui/divelistview.h b/qt-ui/divelistview.h index c7f1ef775..a6522fa9a 100644 --- a/qt-ui/divelistview.h +++ b/qt-ui/divelistview.h @@ -51,7 +51,6 @@ slots: void renumberDives(); void shiftTimes(); void loadImages(); - void publishFacebook(); static QString lastUsedImageDir(); signals: diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index cd85418a8..6edc5fa8e 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -16,6 +16,7 @@ #include "qthelper.h" #include "display.h" #include "divepicturewidget.h" +#include "socialnetworks.h" #include #include @@ -185,6 +186,11 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent), ui.photosView->addAction(deletePhoto); ui.photosView->setSelectionMode(QAbstractItemView::SingleSelection); connect(deletePhoto, SIGNAL(triggered(bool)), this, SLOT(removeSelectedPhotos())); + + FacebookManager *fb = FacebookManager::instance(); + connect(fb, &FacebookManager::justLoggedIn, ui.facebookPublish, &QPushButton::show); + connect(fb, &FacebookManager::justLoggedOut, ui.facebookPublish, &QPushButton::hide); + ui.facebookPublish->setVisible(fb->loggedIn()); } MainTab::~MainTab() diff --git a/qt-ui/maintab.ui b/qt-ui/maintab.ui index 3450224ac..9551ed511 100644 --- a/qt-ui/maintab.ui +++ b/qt-ui/maintab.ui @@ -6,8 +6,8 @@ 0 0 - 690 - 720 + 443 + 815 @@ -37,34 +37,26 @@ 0 0 - 670 - 649 + 421 + 751 - - 2 - - - 1 - - - 2 - - - 0 - - - 2 - - - + + - Coordinates + Date - + + + + Time + + + + @@ -82,14 +74,30 @@ - - - - Notes + + + + true + + + Qt::UTC - + + + + + 0 + 0 + + + + Qt::UTC + + + + @@ -107,109 +115,49 @@ - - - - false - - - - - - - false - - - - - - - Suit - - - - + Location - - - - false - - - - - + + - Buddy - - - - - - - false + Coordinates - + Divemaster - - - - false - - - - - + + - Tags + Buddy - - - - - 0 - 0 - - - - - 0 - 0 - - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - QPlainTextEdit::NoWrap + + + + false - - + + false - + @@ -239,7 +187,35 @@ - + + + + Suit + + + + + + + false + + + + + + + Tags + + + + + + + Notes + + + + @@ -269,43 +245,104 @@ - - - - Time - - - - - + + - + 0 0 - - Qt::UTC + + + 0 + 0 + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + QPlainTextEdit::NoWrap - - - - true - - - Qt::UTC + + + + false - - - - Date + + + + false + + + + 0 + + + + + false + + + + + + + + 0 + + + 0 + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + :/facebook:/facebook + + + + 32 + 32 + + + + true + + + + + + + + @@ -336,21 +373,12 @@ 0 0 - 100 - 30 + 421 + 751 - - 0 - - - 0 - - - 0 - - + 0 @@ -362,16 +390,7 @@ 0 - - 0 - - - 0 - - - 0 - - + 0 @@ -416,21 +435,12 @@ 0 0 - 316 - 330 + 421 + 751 - - 0 - - - 0 - - - 0 - - + 0 @@ -745,21 +755,12 @@ 0 0 - 319 - 188 + 421 + 751 - - 0 - - - 0 - - - 0 - - + 0 @@ -1024,6 +1025,8 @@ tagWidget notes - + + + -- cgit v1.2.3-70-g09d2