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 <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-12-28 20:24:02 -02:00 committed by Dirk Hohndel
parent db0c1b834a
commit 571f86485d
6 changed files with 186 additions and 185 deletions

BIN
icons/facebook.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View file

@ -826,9 +826,6 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event)
popup.addAction(tr("Shift times"), this, SLOT(shiftTimes())); popup.addAction(tr("Shift times"), this, SLOT(shiftTimes()));
popup.addAction(tr("Load images"), this, SLOT(loadImages())); 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 all" really closes all trips,
// "collapse" keeps the trip with the selected dive open // "collapse" keeps the trip with the selected dive open
@ -842,11 +839,6 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event)
event->accept(); event->accept();
} }
void DiveListView::publishFacebook()
{
FacebookManager *fb = FacebookManager::instance();
fb->sendDive(1);
}
void DiveListView::shiftTimes() void DiveListView::shiftTimes()
{ {

View file

@ -51,7 +51,6 @@ slots:
void renumberDives(); void renumberDives();
void shiftTimes(); void shiftTimes();
void loadImages(); void loadImages();
void publishFacebook();
static QString lastUsedImageDir(); static QString lastUsedImageDir();
signals: signals:

View file

@ -16,6 +16,7 @@
#include "qthelper.h" #include "qthelper.h"
#include "display.h" #include "display.h"
#include "divepicturewidget.h" #include "divepicturewidget.h"
#include "socialnetworks.h"
#include <QLabel> #include <QLabel>
#include <QCompleter> #include <QCompleter>
@ -185,6 +186,11 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
ui.photosView->addAction(deletePhoto); ui.photosView->addAction(deletePhoto);
ui.photosView->setSelectionMode(QAbstractItemView::SingleSelection); ui.photosView->setSelectionMode(QAbstractItemView::SingleSelection);
connect(deletePhoto, SIGNAL(triggered(bool)), this, SLOT(removeSelectedPhotos())); 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() MainTab::~MainTab()

View file

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>690</width> <width>443</width>
<height>720</height> <height>815</height>
</rect> </rect>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
@ -37,34 +37,26 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>670</width> <width>421</width>
<height>649</height> <height>751</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin"> <item row="0" column="0">
<number>2</number> <widget class="QLabel" name="label_2">
</property>
<property name="topMargin">
<number>1</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>2</number>
</property>
<item row="5" column="0">
<widget class="QLabel" name="CoordinatedLabel">
<property name="text"> <property name="text">
<string>Coordinates</string> <string>Date</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="0" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Time</string>
</property>
</widget>
</item>
<item row="0" column="2">
<layout class="QHBoxLayout" name="temperatureLabels"> <layout class="QHBoxLayout" name="temperatureLabels">
<item> <item>
<widget class="QLabel" name="airTempLabel"> <widget class="QLabel" name="airTempLabel">
@ -82,14 +74,30 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="13" column="0"> <item row="1" column="0">
<widget class="QLabel" name="NotesLabel"> <widget class="QDateEdit" name="dateEdit">
<property name="text"> <property name="calendarPopup">
<string>Notes</string> <bool>true</bool>
</property>
<property name="timeSpec">
<enum>Qt::UTC</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="2"> <item row="1" column="1">
<widget class="QTimeEdit" name="timeEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="timeSpec">
<enum>Qt::UTC</enum>
</property>
</widget>
</item>
<item row="1" column="2">
<layout class="QHBoxLayout" name="airWaterTempLayout"> <layout class="QHBoxLayout" name="airWaterTempLayout">
<item> <item>
<widget class="QLineEdit" name="airtemp"> <widget class="QLineEdit" name="airtemp">
@ -107,109 +115,49 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="4" column="0" colspan="3"> <item row="2" column="0">
<widget class="QLineEdit" name="location">
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item row="14" column="0" colspan="3">
<widget class="QTextEdit" name="notes">
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QLabel" name="SuitLabel">
<property name="text">
<string>Suit</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="LocationLabel"> <widget class="QLabel" name="LocationLabel">
<property name="text"> <property name="text">
<string>Location</string> <string>Location</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="2"> <item row="4" column="0">
<widget class="TagWidget" name="buddy"> <widget class="QLabel" name="CoordinatedLabel">
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QLabel" name="BuddyLabel">
<property name="text"> <property name="text">
<string>Buddy</string> <string>Coordinates</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0" colspan="3"> <item row="6" column="0">
<widget class="QLineEdit" name="coordinates">
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="DivemasterLabel"> <widget class="QLabel" name="DivemasterLabel">
<property name="text"> <property name="text">
<string>Divemaster</string> <string>Divemaster</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="2"> <item row="6" column="2">
<widget class="QLineEdit" name="suit"> <widget class="QLabel" name="BuddyLabel">
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="TagLabel">
<property name="text"> <property name="text">
<string>Tags</string> <string>Buddy</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="12" column="0" colspan="3"> <item row="7" column="0" colspan="2">
<widget class="TagWidget" name="tagWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
</property>
</widget>
</item>
<item row="8" column="0" colspan="2">
<widget class="TagWidget" name="divemaster"> <widget class="TagWidget" name="divemaster">
<property name="readOnly"> <property name="readOnly">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="0" colspan="2"> <item row="7" column="2">
<widget class="TagWidget" name="buddy">
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item row="8" column="0" colspan="2">
<layout class="QHBoxLayout" name="ratingVisibilityLabels"> <layout class="QHBoxLayout" name="ratingVisibilityLabels">
<item> <item>
<widget class="QLabel" name="RatingLabel"> <widget class="QLabel" name="RatingLabel">
@ -239,7 +187,35 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="10" column="0" colspan="2"> <item row="8" column="2">
<widget class="QLabel" name="SuitLabel">
<property name="text">
<string>Suit</string>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QLineEdit" name="suit">
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="TagLabel">
<property name="text">
<string>Tags</string>
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="NotesLabel">
<property name="text">
<string>Notes</string>
</property>
</widget>
</item>
<item row="9" column="0" colspan="2">
<layout class="QHBoxLayout" name="ratingVisibilityWidgets"> <layout class="QHBoxLayout" name="ratingVisibilityWidgets">
<item> <item>
<widget class="StarWidget" name="rating" native="true"> <widget class="StarWidget" name="rating" native="true">
@ -269,43 +245,104 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="1"> <item row="11" column="0" colspan="3">
<widget class="QLabel" name="label"> <widget class="TagWidget" name="tagWidget">
<property name="text">
<string>Time</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QTimeEdit" name="timeEdit">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="timeSpec"> <property name="minimumSize">
<enum>Qt::UTC</enum> <size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="3" column="0" colspan="3">
<widget class="QDateEdit" name="dateEdit"> <widget class="QLineEdit" name="location">
<property name="calendarPopup"> <property name="readOnly">
<bool>true</bool> <bool>false</bool>
</property>
<property name="timeSpec">
<enum>Qt::UTC</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="5" column="0" colspan="3">
<widget class="QLabel" name="label_2"> <widget class="QLineEdit" name="coordinates">
<property name="text"> <property name="readOnly">
<string>Date</string> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="13" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_16">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QTextEdit" name="notes">
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="socialNetworks" native="true">
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="facebookPublish">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../subsurface.qrc">
<normaloff>:/facebook</normaloff>:/facebook</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
@ -336,21 +373,12 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>100</width> <width>421</width>
<height>30</height> <height>751</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_5"> <layout class="QGridLayout" name="gridLayout_5">
<property name="leftMargin"> <property name="margin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing"> <property name="spacing">
@ -362,16 +390,7 @@
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="leftMargin"> <property name="margin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
@ -416,21 +435,12 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>316</width> <width>421</width>
<height>330</height> <height>751</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_6"> <layout class="QGridLayout" name="gridLayout_6">
<property name="leftMargin"> <property name="margin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing"> <property name="spacing">
@ -745,21 +755,12 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>319</width> <width>421</width>
<height>188</height> <height>751</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_7"> <layout class="QGridLayout" name="gridLayout_7">
<property name="leftMargin"> <property name="margin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing"> <property name="spacing">
@ -1024,6 +1025,8 @@
<tabstop>tagWidget</tabstop> <tabstop>tagWidget</tabstop>
<tabstop>notes</tabstop> <tabstop>notes</tabstop>
</tabstops> </tabstops>
<resources/> <resources>
<include location="../subsurface.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View file

@ -70,5 +70,6 @@
<file>icons/ostc2n.png</file> <file>icons/ostc2n.png</file>
<file>icons/ostc3.png</file> <file>icons/ostc3.png</file>
<file>icons/suunto_vyper.png</file> <file>icons/suunto_vyper.png</file>
<file alias="facebook">icons/facebook.png</file>
</qresource> </qresource>
</RCC> </RCC>