summaryrefslogtreecommitdiffstats
path: root/qt-ui/socialnetworks.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-29 11:14:34 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-29 11:14:34 -0800
commitcab320201bc76f8ab5ca4cea5a5876ac31e79ee2 (patch)
tree3633f4f919c70c9282e0660c0dc8c50252c39161 /qt-ui/socialnetworks.cpp
parentadb5cc5d306f11f8b3749259623ce6aae616f532 (diff)
downloadsubsurface-cab320201bc76f8ab5ca4cea5a5876ac31e79ee2.tar.gz
Facebook integration: improve the confirmation UI experience
Date and time needs to be a string, not a time_t. Duration should be called that (and not time) and wasn't hooked up. Also added a helper to get the duration string. Finally reordered the components of the text that is shown to make it more natural (or I should say, more in line with the order we use elsewhere). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/socialnetworks.cpp')
-rw-r--r--qt-ui/socialnetworks.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/qt-ui/socialnetworks.cpp b/qt-ui/socialnetworks.cpp
index 2be2c8671..04c28df79 100644
--- a/qt-ui/socialnetworks.cpp
+++ b/qt-ui/socialnetworks.cpp
@@ -18,6 +18,7 @@
#include "mainwindow.h"
#include "profile/profilewidget2.h"
#include "pref.h"
+#include "helpers.h"
#include "ui_socialnetworksdialog.h"
#define GET_TXT(name, field) \
@@ -259,6 +260,7 @@ SocialNetworkDialog::SocialNetworkDialog(QWidget *parent) : QDialog(parent)
{
ui->setupUi(this);
connect(ui->date, SIGNAL(clicked()), this, SLOT(selectionChanged()));
+ connect(ui->duration, SIGNAL(clicked()), this, SLOT(selectionChanged()));
connect(ui->Buddy, SIGNAL(clicked()), this, SLOT(selectionChanged()));
connect(ui->Divemaster, SIGNAL(clicked()), this, SLOT(selectionChanged()));
connect(ui->Location, SIGNAL(clicked()), this, SLOT(selectionChanged()));
@@ -269,7 +271,15 @@ void SocialNetworkDialog::selectionChanged() {
struct dive *d = current_dive;
QString fullText;
if (ui->date->isChecked()) {
- fullText += tr("Dive Date: %1 \n").arg(d->when);
+ fullText += tr("Dive Date: %1 \n").arg(get_short_dive_date_string(d->when));
+ }
+ if (ui->duration->isChecked()) {
+ fullText += tr("Duration: %1 \n").arg(get_dive_duration_string(d->duration.seconds,
+ tr("h:", "abbreviation for hours plus separator"),
+ tr("min", "abbreviation for minutes")));
+ }
+ if (ui->Location->isChecked()) {
+ fullText += tr("Dive Location: %1 \n").arg(d->location);
}
if (ui->Buddy->isChecked()) {
fullText += tr("Buddy: %1 \n").arg(d->buddy);
@@ -277,9 +287,6 @@ void SocialNetworkDialog::selectionChanged() {
if (ui->Divemaster->isChecked()) {
fullText += tr("Divemaster: %1 \n").arg(d->divemaster);
}
- if (ui->Location->isChecked()) {
- fullText += tr("Dive Location: %1 \n").arg(d->location);
- }
if (ui->Notes->isChecked()) {
fullText += tr("\n %1").arg(d->notes);
}