diff --git a/.appveyor.yml b/.appveyor.yml
index 0447e3b5..d062ec65 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -1,4 +1,4 @@
-version: 13.34.{build}
+version: 13.35.{build}
configuration:
- Release
diff --git a/gpxsee.pro b/gpxsee.pro
index c4bfd6d3..9c512cca 100644
--- a/gpxsee.pro
+++ b/gpxsee.pro
@@ -3,7 +3,7 @@ unix:!macx:!android {
} else {
TARGET = GPXSee
}
-VERSION = 13.34
+VERSION = 13.35
QT += core \
diff --git a/pkg/linux/gpxsee.desktop b/pkg/linux/gpxsee.desktop
index 5a054997..31300673 100644
--- a/pkg/linux/gpxsee.desktop
+++ b/pkg/linux/gpxsee.desktop
@@ -16,4 +16,4 @@ Icon=gpxsee
Terminal=false
Type=Application
Categories=Graphics;Viewer;Education;Geography;Maps;Sports;Qt
-MimeType=application/gpx+xml;application/vnd.garmin.tcx+xml;application/vnd.ant.fit;application/vnd.google-earth.kml+xml;application/vnd.fai.igc;application/vnd.nmea.nmea;application/vnd.oziexplorer.plt;application/vnd.oziexplorer.rte;application/vnd.oziexplorer.wpt;application/vnd.groundspeak.loc+xml;application/vnd.sigma.slf+xml;application/geo+json;application/vnd.naviter.seeyou.cup;application/vnd.garmin.gpi;application/vnd.suunto.sml+xml;image/jpeg;text/csv;application/vnd.garmin.img;application/vnd.garmin.jnx;application/vnd.garmin.gmap+xml;image/vnd.maptech.kap;application/vnd.oziexplorer.map;application/vnd.mapbox.mbtiles;application/vnd.twonav.rmap;application/vnd.trekbuddy.tba;application/vnd.gpxsee.map+xml;application/x-tar;image/tiff;application/vnd.google-earth.kmz;application/vnd.alpinequest.aqm;application/vnd.cgtk.gemf;application/vnd.rmaps.sqlite;application/vnd.osmdroid.sqlite;application/vnd.mapsforge.map;application/vnd.tomtom.ov2;application/vnd.tomtom.itn;application/vnd.esri.wld;application/vnd.onmove.omd;application/vnd.onmove.ghp;application/vnd.memory-map.qct;application/vnd.twonav.trk;application/vnd.twonav.rte;application/vnd.twonav.wpt;application/vnd.orux.map+xml;application/vnd.iho.s57-data;application/vnd.iho.s57-catalogue;application/vnd.gpsdump.wpt;application/vnd.gpstuner.gmi
+MimeType=x-scheme-handler/geo;application/gpx+xml;application/vnd.garmin.tcx+xml;application/vnd.ant.fit;application/vnd.google-earth.kml+xml;application/vnd.fai.igc;application/vnd.nmea.nmea;application/vnd.oziexplorer.plt;application/vnd.oziexplorer.rte;application/vnd.oziexplorer.wpt;application/vnd.groundspeak.loc+xml;application/vnd.sigma.slf+xml;application/geo+json;application/vnd.naviter.seeyou.cup;application/vnd.garmin.gpi;application/vnd.suunto.sml+xml;image/jpeg;text/csv;application/vnd.garmin.img;application/vnd.garmin.jnx;application/vnd.garmin.gmap+xml;image/vnd.maptech.kap;application/vnd.oziexplorer.map;application/vnd.mapbox.mbtiles;application/vnd.twonav.rmap;application/vnd.trekbuddy.tba;application/vnd.gpxsee.map+xml;application/x-tar;image/tiff;application/vnd.google-earth.kmz;application/vnd.alpinequest.aqm;application/vnd.cgtk.gemf;application/vnd.rmaps.sqlite;application/vnd.osmdroid.sqlite;application/vnd.mapsforge.map;application/vnd.tomtom.ov2;application/vnd.tomtom.itn;application/vnd.esri.wld;application/vnd.onmove.omd;application/vnd.onmove.ghp;application/vnd.memory-map.qct;application/vnd.twonav.trk;application/vnd.twonav.rte;application/vnd.twonav.wpt;application/vnd.orux.map+xml;application/vnd.iho.s57-data;application/vnd.iho.s57-catalogue;application/vnd.gpsdump.wpt;application/vnd.gpstuner.gmi
diff --git a/pkg/mac/Info.plist b/pkg/mac/Info.plist
index 802b934a..6b25c4a1 100644
--- a/pkg/mac/Info.plist
+++ b/pkg/mac/Info.plist
@@ -738,6 +738,20 @@
+ CFBundleURLTypes
+
+
+ CFBundleURLSchemes
+
+ geo
+
+ CFBundleURLName
+ org.geouri.geo
+ CFBundleTypeRole
+ Viewer
+
+
+
UTImportedTypeDeclarations
diff --git a/pkg/windows/gpxsee64.nsi b/pkg/windows/gpxsee64.nsi
index 494559e6..38b9e872 100644
--- a/pkg/windows/gpxsee64.nsi
+++ b/pkg/windows/gpxsee64.nsi
@@ -18,6 +18,18 @@
DeleteRegKey HKCR ".${EXT}"
!macroend
+; URI association
+!macro URI_ASSOCIATION_ADD PROTO
+ WriteRegStr HKCR "${PROTO}" "" "URL:${PROTO}"
+ WriteRegStr HKCR "${PROTO}" "URL Protocol" ""
+ WriteRegStr HKCR "${PROTO}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,0"
+ WriteRegStr HKCR "${PROTO}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
+!macroend
+
+!macro URI_ASSOCIATION_REMOVE PROTO
+ DeleteRegKey HKCR "${PROTO}"
+!macroend
+
; Translations
!macro LOCALIZATION LANG CODE
Section "${LANG}"
@@ -37,7 +49,7 @@ Unicode true
; The name of the installer
Name "GPXSee"
; Program version
-!define VERSION "13.34"
+!define VERSION "13.35"
; The file to write
OutFile "GPXSee-${VERSION}_x64.exe"
@@ -200,6 +212,8 @@ Section "GPXSee" SEC_APP
!insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track File" 33
!insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 34
+ !insertmacro URI_ASSOCIATION_ADD "geo"
+
WriteRegStr HKCR "Applications\GPXSee.exe\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".gpx\OpenWithList" "GPXSee.exe" ""
WriteRegStr HKCR ".tcx\OpenWithList" "GPXSee.exe" ""
@@ -426,6 +440,8 @@ Section "Uninstall"
!insertmacro FILE_ASSOCIATION_REMOVE "000"
!insertmacro FILE_ASSOCIATION_REMOVE "031"
+ !insertmacro URI_ASSOCIATION_REMOVE "geo"
+
DeleteRegValue HKCR ".gpx\OpenWithList" "GPXSee.exe"
DeleteRegValue HKCR ".tcx\OpenWithList" "GPXSee.exe"
DeleteRegValue HKCR ".kml\OpenWithList" "GPXSee.exe"
diff --git a/src/GUI/gui.cpp b/src/GUI/gui.cpp
index 5102305e..627a0484 100644
--- a/src/GUI/gui.cpp
+++ b/src/GUI/gui.cpp
@@ -1069,6 +1069,16 @@ void GUI::openDir()
bool GUI::openFile(const QString &fileName, bool tryUnknown, int &showError)
{
+ QUrl url(fileName);
+ if (url.scheme() == "geo") {
+ if (loadURL(url, showError)) {
+ _fileActionGroup->setEnabled(true);
+ _reloadFileAction->setEnabled(false);
+ return true;
+ } else if (showError)
+ return false;
+ }
+
QFileInfo fi(fileName);
QString canonicalFileName(fi.canonicalFilePath());
@@ -1099,6 +1109,36 @@ bool GUI::openFile(const QString &fileName, bool tryUnknown, int &showError)
return true;
}
+bool GUI::loadURL(const QUrl &url, int &showError)
+{
+ Data data(url);
+
+ if (data.isValid()) {
+ loadData(data);
+ return true;
+ } else {
+ if (showError) {
+ QString error = tr("Error loading geo URI:") + "\n" + url.toString()
+ + ": " + data.errorString();
+
+ if (showError > 1) {
+ QMessageBox message(QMessageBox::Critical, APP_NAME, error,
+ QMessageBox::Ok, this);
+ QCheckBox checkBox(tr("Don't show again"));
+ message.setCheckBox(&checkBox);
+ message.exec();
+ if (checkBox.isChecked())
+ showError = 0;
+ } else
+ QMessageBox::critical(this, APP_NAME, error);
+ } else
+ qWarning("%s: %s", qUtf8Printable(url.toString()),
+ qUtf8Printable(data.errorString()));
+
+ return false;
+ }
+}
+
bool GUI::loadFile(const QString &fileName, bool tryUnknown, int &showError)
{
Data data(fileName, tryUnknown);
diff --git a/src/GUI/gui.h b/src/GUI/gui.h
index 3b3dd7cc..f8020de7 100644
--- a/src/GUI/gui.h
+++ b/src/GUI/gui.h
@@ -158,6 +158,7 @@ private:
#endif // Q_OS_ANDROID
bool openPOIFile(const QString &fileName);
bool loadFile(const QString &fileName, bool tryUnknown, int &showError);
+ bool loadURL(const QUrl &url, int &showError);
void loadData(const Data &data);
bool loadMapNode(const TreeNode