1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-01 21:39:15 +02:00

Compare commits

...

20 Commits
8.0 ... 8.1

Author SHA1 Message Date
4cb369d2f3 Merge branch 'origin/master' into Weblate. 2021-01-01 12:52:00 +01:00
f7b44b64b0 Fixed broken graph info layout 2021-01-01 12:51:39 +01:00
895b2219c5 Merge branch 'origin/master' into Weblate. 2020-12-31 15:45:18 +01:00
0ec265e4ea Version++ 2020-12-31 15:45:03 +01:00
d9e5fc6a74 Merge branch 'origin/master' into Weblate. 2020-12-31 14:03:55 +01:00
c3f345c7f9 Added support for ZIPed DEM files 2020-12-31 14:03:30 +01:00
1f9bff6a9b Merge branch 'origin/master' into Weblate. 2020-12-30 09:26:41 +01:00
7e39a34d0e Fixed typo 2020-12-30 09:26:26 +01:00
a941a7315e Merge branch 'origin/master' into Weblate. 2020-12-29 18:36:59 +01:00
cf4f9b6f98 Fixed digital zoom on OS X 2020-12-29 18:36:23 +01:00
3d89d0d7da Merge branch 'origin/master' into Weblate. 2020-12-29 15:17:54 +01:00
9b3ed7ef1d Fixed Qt6 Release build 2020-12-29 15:17:31 +01:00
796107b1ab Merge branch 'origin/master' into Weblate. 2020-12-29 01:05:40 +01:00
a7e9c95ba2 Updated minimal required Qt version
Luckily for wretches using Debian systems, the minimal Qt version is 5.11, not 5.12
2020-12-29 01:05:36 +01:00
cd54d2d952 Merge branch 'origin/master' into Weblate. 2020-12-28 16:09:15 +01:00
031ed4907c Merge branch 'origin/master' into Weblate. 2020-12-28 14:45:51 +01:00
7cdbad3e79 Translated using Weblate (Hungarian)
Currently translated at 100.0% (388 of 388 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/hu/
2020-12-28 14:45:51 +01:00
b62ec2429a Translated using Weblate (Turkish)
Currently translated at 100.0% (388 of 388 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/tr/
2020-12-28 14:45:50 +01:00
10032000b1 Translated using Weblate (Russian)
Currently translated at 100.0% (388 of 388 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ru/
2020-12-28 14:45:50 +01:00
fd19d9c5a4 Translated using Weblate (Finnish)
Currently translated at 100.0% (388 of 388 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/fi/
2020-12-28 14:45:50 +01:00
15 changed files with 84 additions and 48 deletions

View File

@ -1,4 +1,4 @@
version: 8.0.{build}
version: 8.1.{build}
configuration:
- Release

View File

@ -18,7 +18,7 @@ GPXSee is a Qt-based GPS log file viewer and analyzer that supports all common G
## Build
Build requirements:
* Qt5 >= 5.12 or Qt 6.x
* Qt5 >= 5.11 or Qt 6.x
* C++11 or newer compiler (tested: msvc2017, gcc 7.5.0, clang/Apple LLVM version 10.0.0)
Build steps:

View File

@ -3,7 +3,7 @@ unix:!macx {
} else {
TARGET = GPXSee
}
VERSION = 8.0
VERSION = 8.1
QT += core \
gui \

View File

@ -1143,12 +1143,12 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="118"/>
<source>Input</source>
<translation type="unfinished"></translation>
<translation>Syöte</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="120"/>
<source>Output</source>
<translation type="unfinished"></translation>
<translation>Tuloste</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="127"/>

View File

@ -811,6 +811,7 @@
<source>%n files</source>
<translation>
<numerusform>%n fájl</numerusform>
<numerusform>%n fájl</numerusform>
</translation>
</message>
</context>
@ -1055,17 +1056,17 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="84"/>
<source>Select the proper projection of JNX and KMZ maps. Both EPSG:3857 and EPSG:4326 projected maps exist and there is no projection info in the map file.</source>
<translation type="unfinished">Válaszd ki a JNX és a KMZ térképek megfelelő vetületét. Mind az EPSG: 3857, mind az EPSG: 4326 vetületi térképek rendelkezésre állnak, a térkép fájlban nincsenek vetületi információk.</translation>
<translation>Válaszd ki a JNX és a KMZ térképek megfelelő vetületét. Mind az EPSG: 3857, mind az EPSG: 4326 vetületi térképek rendelkezésre állnak, a térkép fájlban nincsenek vetületi információk.</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="118"/>
<source>Input</source>
<translation type="unfinished"></translation>
<translation>Bemenet</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="120"/>
<source>Output</source>
<translation type="unfinished"></translation>
<translation>Kimenet</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="152"/>

View File

@ -1144,22 +1144,22 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="118"/>
<source>Input</source>
<translation type="unfinished"></translation>
<translation>Ввод</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="120"/>
<source>Output</source>
<translation type="unfinished"></translation>
<translation>Вывод</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="127"/>
<source>Input:</source>
<translation>Вход:</translation>
<translation>Ввод:</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="130"/>
<source>Output:</source>
<translation>Выход:</translation>
<translation>Вывод:</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="151"/>

View File

@ -811,6 +811,7 @@
<source>%n files</source>
<translation>
<numerusform>%n dosya</numerusform>
<numerusform>%n dosya</numerusform>
</translation>
</message>
</context>
@ -1075,12 +1076,12 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="118"/>
<source>Input</source>
<translation type="unfinished"></translation>
<translation>Girdi</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="120"/>
<source>Output</source>
<translation type="unfinished"></translation>
<translation>Çıktı</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="168"/>

View File

@ -7,7 +7,7 @@
; The name of the installer
Name "GPXSee"
; Program version
!define VERSION "8.0"
!define VERSION "8.1"
; The file to write
OutFile "GPXSee-${VERSION}.exe"

View File

@ -7,7 +7,7 @@
; The name of the installer
Name "GPXSee"
; Program version
!define VERSION "8.0"
!define VERSION "8.1"
; The file to write
OutFile "GPXSee-${VERSION}_x64.exe"

View File

@ -18,9 +18,9 @@ void InfoItem::updateBoundingRect()
for (QList<KV<QString, QString> >::const_iterator i = _list.constBegin();
i != _list.constEnd(); i++) {
width += fm.boundingRect(i->key() + ": ").width();
width += fm.boundingRect(i->value()).width()
+ ((i == _list.constEnd() - 1) ? 0 : PADDING);
width += fm.horizontalAdvance(i->key() + ": " + i->value());
if (i != _list.constEnd() - 1)
width += PADDING;
}
_boundingRect = QRectF(0, 0, width, _list.isEmpty() ? 0 : fm.height());
@ -39,12 +39,11 @@ void InfoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
for (QList<KV<QString, QString> >::const_iterator i = _list.constBegin();
i != _list.constEnd(); i++) {
painter->drawText(width, fm.height() - fm.descent(), i->key() + ": ");
width += fm.boundingRect(i->key() + ": ").width();
painter->drawText(width, fm.height() - fm.descent(), i->value());
width += fm.boundingRect(i->value()).width()
+ ((i == _list.constEnd() - 1) ? 0 : PADDING);
QString text(i->key() + ": " + i->value());
painter->drawText(width, fm.height() - fm.descent(), text);
width += fm.horizontalAdvance(text);
if (i != _list.constEnd() - 1) {
width += PADDING;
painter->save();
painter->setPen(Qt::gray);
painter->drawLine(width - PADDING/2, fm.descent(),

View File

@ -515,10 +515,8 @@ void MapView::digitalZoom(int zoom)
_coordinates->setDigitalZoom(_digitalZoom);
}
void MapView::zoom(int zoom, const QPoint &pos)
void MapView::zoom(int zoom, const QPoint &pos, bool shift)
{
bool shift = QApplication::keyboardModifiers() & Qt::ShiftModifier;
if (_digitalZoom) {
if (((_digitalZoom > 0 && zoom > 0) && (!shift || _digitalZoom
>= MAX_DIGITAL_ZOOM)) || ((_digitalZoom < 0 && zoom < 0) && (!shift
@ -544,21 +542,28 @@ void MapView::zoom(int zoom, const QPoint &pos)
void MapView::wheelEvent(QWheelEvent *event)
{
static int deg = 0;
bool shift = (event->modifiers() & MODIFIER) ? true : false;
// Shift inverts the wheel axis on OS X, so use scrolling in both axes for
// the zoom.
int delta = event->angleDelta().y()
? event->angleDelta().y() : event->angleDelta().x();
deg += event->angleDelta().y() / 8;
deg += delta / 8;
if (qAbs(deg) < 15)
return;
deg = 0;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
zoom((event->angleDelta().y() > 0) ? 1 : -1, event->pos());
zoom((delta > 0) ? 1 : -1, event->pos(), shift);
#else // QT 5.15
zoom((event->angleDelta().y() > 0) ? 1 : -1, event->position().toPoint());
zoom((delta > 0) ? 1 : -1, event->position().toPoint(), shift);
#endif // QT 5.15
}
void MapView::mouseDoubleClickEvent(QMouseEvent *event)
{
bool shift = (event->modifiers() & MODIFIER) ? true : false;
QGraphicsView::mouseDoubleClickEvent(event);
if (event->isAccepted())
return;
@ -566,13 +571,13 @@ void MapView::mouseDoubleClickEvent(QMouseEvent *event)
if (event->button() != Qt::LeftButton && event->button() != Qt::RightButton)
return;
zoom((event->button() == Qt::LeftButton) ? 1 : -1, event->pos());
zoom((event->button() == Qt::LeftButton) ? 1 : -1, event->pos(), shift);
}
void MapView::keyPressEvent(QKeyEvent *event)
{
int z;
bool shift = (event->modifiers() & MODIFIER) ? true : false;
QPoint pos = viewport()->rect().center();
if (event->key() == ZOOM_IN)
@ -592,7 +597,7 @@ void MapView::keyPressEvent(QKeyEvent *event)
return;
}
zoom(z, pos);
zoom(z, pos, shift);
}
void MapView::keyReleaseEvent(QKeyEvent *event)

View File

@ -123,7 +123,7 @@ private:
QPointF contentCenter() const;
void rescale();
void centerOn(const QPointF &pos);
void zoom(int zoom, const QPoint &pos);
void zoom(int zoom, const QPoint &pos, bool shift);
void digitalZoom(int zoom);
void updatePOIVisibility();
void skipColor() {_palette.nextColor();}

View File

@ -68,13 +68,12 @@ inline QDataStream &operator>>(QDataStream &in, TimeZoneInfo &info)
return in;
}
#ifndef QT_NO_DEBUG
// Required in Qt6 even in release builds
inline QDebug operator<<(QDebug dbg, const TimeZoneInfo &info)
{
dbg.nospace() << "TimeZoneInfo(" << static_cast<int>(info._type)
<< ", " << info._customZone << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG
#endif // TIMEZONEINFO_H

View File

@ -1,7 +1,21 @@
/*
WARNING: This code uses internal Qt API - the QZipReader class for reading
ZIP files - and things may break if Qt changes the API. For Qt5 this is not
a problem as we can "see the future" now and there are no changes in all
the supported Qt5 versions up to the last one (5.15). In Qt6 the class
might change or even disappear in the future, but this is very unlikely
as there were no changes for several years and The Qt Company's policy
is: "do not invest any resources into any desktop related stuff unless
absolutely necessary". There is an issue (QTBUG-3897) since the year 2009 to
include the ZIP reader into the public API, which aptly illustrates the
effort The Qt Company is willing to make about anything desktop related...
*/
#include <QtEndian>
#include <QtMath>
#include <QDir>
#include <QFile>
#include <private/qzipreader_p.h>
#include "common/coordinates.h"
#include "dem.h"
@ -55,15 +69,19 @@ static qreal height(const Coordinates &c, const QByteArray *data)
QString DEM::_dir;
QCache<DEM::Key, QByteArray> DEM::_data;
QString DEM::fileName(const Key &key)
QString DEM::baseName(const Key &key)
{
const char ns = (key.lat() >= 0) ? 'N' : 'S';
const char ew = (key.lon() >= 0) ? 'E' : 'W';
QString basename = QString("%1%2%3%4.hgt").arg(ns)
return QString("%1%2%3%4.hgt").arg(ns)
.arg(qAbs(key.lat()), 2, 10, QChar('0')).arg(ew)
.arg(qAbs(key.lon()), 3, 10, QChar('0'));
return QDir(_dir).absoluteFilePath(basename);
}
QString DEM::fileName(const QString &baseName)
{
return QDir(_dir).absoluteFilePath(baseName);
}
void DEM::setDir(const QString &path)
@ -80,17 +98,29 @@ qreal DEM::elevation(const Coordinates &c)
QByteArray *ba = _data[k];
if (!ba) {
QFile file(fileName(k));
if (!file.open(QIODevice::ReadOnly)) {
qWarning("%s: %s", qPrintable(file.fileName()),
qPrintable(file.errorString()));
_data.insert(k, new QByteArray());
return NAN;
} else {
ba = new QByteArray(file.readAll());
QString bn(baseName(k));
QString fn(fileName(bn));
QString zn(fn + ".zip");
if (QFileInfo::exists(zn)) {
QZipReader zip(zn, QIODevice::ReadOnly);
ba = new QByteArray(zip.fileData(bn));
qreal ele = height(c, ba);
_data.insert(k, ba);
return ele;
} else {
QFile file(fn);
if (!file.open(QIODevice::ReadOnly)) {
qWarning("%s: %s", qPrintable(file.fileName()),
qPrintable(file.errorString()));
_data.insert(k, new QByteArray());
return NAN;
} else {
ba = new QByteArray(file.readAll());
qreal ele = height(c, ba);
_data.insert(k, ba);
return ele;
}
}
} else
return height(c, ba);

View File

@ -27,7 +27,8 @@ private:
int _lon, _lat;
};
static QString fileName(const Key &key);
static QString baseName(const Key &key);
static QString fileName(const QString &baseName);
static QString _dir;
static QCache<Key, QByteArray> _data;