summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/divelistview.cpp7
-rw-r--r--desktop-widgets/divepicturewidget.cpp2
-rw-r--r--desktop-widgets/modeldelegates.cpp1
-rw-r--r--desktop-widgets/preferences/preferences_units.cpp4
-rw-r--r--desktop-widgets/preferences/preferences_units.ui37
-rw-r--r--desktop-widgets/simplewidgets.cpp8
-rw-r--r--desktop-widgets/subsurfacewebservices.cpp3
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp2
8 files changed, 58 insertions, 6 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp
index 9c7c30578..a92afadbd 100644
--- a/desktop-widgets/divelistview.cpp
+++ b/desktop-widgets/divelistview.cpp
@@ -917,7 +917,12 @@ void DiveListView::shiftTimes()
void DiveListView::loadImages()
{
- QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Open image files"), lastUsedImageDir(), tr("Image files (*.jpg *.jpeg *.pnm *.tif *.tiff)"));
+ QStringList filters = imageExtensionFilters();
+ QStringList fileNames = QFileDialog::getOpenFileNames(this,
+ tr("Open image files"),
+ lastUsedImageDir(),
+ tr("Image files (%1)").arg(filters.join(" ")));
+
if (fileNames.isEmpty())
return;
updateLastUsedImageDir(QFileInfo(fileNames[0]).dir().path());
diff --git a/desktop-widgets/divepicturewidget.cpp b/desktop-widgets/divepicturewidget.cpp
index 92a61cba7..fcdd010da 100644
--- a/desktop-widgets/divepicturewidget.cpp
+++ b/desktop-widgets/divepicturewidget.cpp
@@ -31,7 +31,7 @@ void DivePictureWidget::doubleClicked(const QModelIndex &index)
void DivePictureWidget::mousePressEvent(QMouseEvent *event)
{
- ulong doubleClickInterval = static_cast<ulong>(qApp->styleHints()->mouseDoubleClickInterval());
+ int doubleClickInterval = qApp->styleHints()->mouseDoubleClickInterval();
static qint64 lasttime = 0L;
qint64 timestamp = QDateTime::currentDateTime().toMSecsSinceEpoch();
diff --git a/desktop-widgets/modeldelegates.cpp b/desktop-widgets/modeldelegates.cpp
index 9ab02cd88..d22e7cbb5 100644
--- a/desktop-widgets/modeldelegates.cpp
+++ b/desktop-widgets/modeldelegates.cpp
@@ -113,7 +113,6 @@ struct CurrSelected {
QWidget *ComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
Q_UNUSED(option)
- MainWindow *m = MainWindow::instance();
QComboBox *comboDelegate = new QComboBox(parent);
comboDelegate->setModel(model);
comboDelegate->setEditable(true);
diff --git a/desktop-widgets/preferences/preferences_units.cpp b/desktop-widgets/preferences/preferences_units.cpp
index 2717688a6..9ff6eb0af 100644
--- a/desktop-widgets/preferences/preferences_units.cpp
+++ b/desktop-widgets/preferences/preferences_units.cpp
@@ -40,6 +40,9 @@ void PreferencesUnits::refreshSettings()
ui->vertical_speed_minutes->setChecked(prefs.units.vertical_speed_time == units::MINUTES);
ui->vertical_speed_seconds->setChecked(prefs.units.vertical_speed_time == units::SECONDS);
+ ui->duration_mixed->setChecked(prefs.units.duration_units == units::MIXED);
+ ui->duration_no_hours->setChecked(prefs.units.duration_units == units::MINUTES_ONLY);
+ ui->duration_show_hours->setChecked(prefs.units.duration_units == units::ALWAYS_HOURS);
}
void PreferencesUnits::syncSettings()
@@ -56,4 +59,5 @@ void PreferencesUnits::syncSettings()
units->setWeight(ui->lbs->isChecked() ? units::LBS : units::KG);
units->setVerticalSpeedTime(ui->vertical_speed_minutes->isChecked() ? units::MINUTES : units::SECONDS);
units->setCoordinatesTraditional(ui->gpsTraditional->isChecked());
+ units->setDurationUnits(ui->duration_mixed->isChecked() ? units::MIXED : (ui->duration_no_hours->isChecked() ? units::MINUTES_ONLY : units::ALWAYS_HOURS));
}
diff --git a/desktop-widgets/preferences/preferences_units.ui b/desktop-widgets/preferences/preferences_units.ui
index 4093181d4..49ef80a22 100644
--- a/desktop-widgets/preferences/preferences_units.ui
+++ b/desktop-widgets/preferences/preferences_units.ui
@@ -232,6 +232,43 @@
</widget>
</item>
<item>
+ <widget class="QGroupBox">
+ <property name="title">
+ <string>Duration units</string>
+ </property>
+ <layout class="QGridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" >
+ <property name="text">
+ <string>Show hours in duration</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QRadioButton" name="duration_show_hours">
+ <property name="text">
+ <string>hh:mm (always)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QRadioButton" name="duration_no_hours">
+ <property name="text">
+ <string>mm (always)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QRadioButton" name="duration_mixed">
+ <property name="text">
+ <string>mm (for dives shorter than 1 hour), hh:mm (otherwise)</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
<widget class="QGroupBox" name="groupBox_11">
<property name="title">
<string>GPS coordinates</string>
diff --git a/desktop-widgets/simplewidgets.cpp b/desktop-widgets/simplewidgets.cpp
index 8d3b94e8f..e6bbe87d9 100644
--- a/desktop-widgets/simplewidgets.cpp
+++ b/desktop-widgets/simplewidgets.cpp
@@ -19,6 +19,7 @@
#include "core/display.h"
#include "profile-widget/profilewidget2.h"
#include "desktop-widgets/undocommands.h"
+#include "core/qthelper.h"
class MinMaxAvgWidgetPrivate {
public:
@@ -309,7 +310,7 @@ void ShiftImageTimesDialog::syncCameraClicked()
QStringList fileNames = QFileDialog::getOpenFileNames(this,
tr("Open image file"),
DiveListView::lastUsedImageDir(),
- tr("Image files (*.jpg *.jpeg *.pnm *.tif *.tiff)"));
+ tr("Image files (*.jpg *.jpeg)"));
if (fileNames.isEmpty())
return;
@@ -401,7 +402,10 @@ void ShiftImageTimesDialog::updateInvalid()
// We've found invalid image
timestamp = picture_get_timestamp(fileName.toUtf8().data());
time_first.setTime_t(timestamp + m_amount);
- ui.invalidFilesText->append(fileName + " " + time_first.toString());
+ if (timestamp == 0)
+ ui.invalidFilesText->append(fileName + " - " + tr("No Exif date/time found"));
+ else
+ ui.invalidFilesText->append(fileName + " - " + time_first.toString());
allValid = false;
}
diff --git a/desktop-widgets/subsurfacewebservices.cpp b/desktop-widgets/subsurfacewebservices.cpp
index 2d8681a8a..1182af097 100644
--- a/desktop-widgets/subsurfacewebservices.cpp
+++ b/desktop-widgets/subsurfacewebservices.cpp
@@ -398,7 +398,8 @@ SubsurfaceWebServices::SubsurfaceWebServices(QWidget *parent, Qt::WindowFlags f)
if (userid.isEmpty() &&
!same_string(prefs.cloud_storage_email, "") &&
- !same_string(prefs.cloud_storage_password, ""))
+ !same_string(prefs.cloud_storage_password, "") &&
+ GpsLocation::hasInstance())
userid = GpsLocation::instance()->getUserid(prefs.cloud_storage_email, prefs.cloud_storage_password);
ui.userID->setText(userid);
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index 31b269b9b..14b5f2b7f 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -777,6 +777,8 @@ void MainTab::acceptChanges()
MainWindow::instance()->dive_list()->unselectDives();
selected_dive = get_divenr(added_dive);
amount_selected = 1;
+ // finally, make sure we get the tags
+ saveTags();
} else if (MainWindow::instance() && MainWindow::instance()->dive_list()->selectedTrips().count() == 1) {
/* now figure out if things have changed */
if (displayedTrip.notes && !same_string(displayedTrip.notes, currentTrip->notes)) {