mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-27 20:58:47 +00:00
1ecd5065a0
This allows Subsurface to obtain the coordinates of a dive directly from a GPS track. It parses a GPX file (GPX V1.0 or V1.1) from a GPS to locate the trackpoint immediatedly after the start of a dive. There is an additional "Use GPS file" button in the Edit Dive Site panel that is selected from the Notes tab. Image: This allows one to select a GPX file, bringing up the Import GPS dialog. There is extensive provision for cross-checking that the dive track synchronises with the dive start and end. If the Save button in the dialog is pressed the dive coordinates are copied into the Dive Coordinates text box in the Edit Dive Site panel. The map moves to indicate the location of the dive site. The bulk of the work is done in importgps.cpp. The code is pretty intergrated: I tried to break it up in smaller commits but that was not feasible. The code includes responses to the comments by @neolit123 and @bstoeger. The C-based file input was replaced with Qt-based code using QChar, QString and QFile. [Dirk Hohndel: fixed several small issues in the .ui file, removed various headers includes that weren't needed and fixed printing of minutes as zero padded] Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
224 lines
5.9 KiB
XML
224 lines
5.9 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<ui version="4.0">
|
|
<class>LocationInformation</class>
|
|
<widget class="QGroupBox" name="LocationInformation">
|
|
<property name="geometry">
|
|
<rect>
|
|
<x>0</x>
|
|
<y>0</y>
|
|
<width>556</width>
|
|
<height>707</height>
|
|
</rect>
|
|
</property>
|
|
<property name="windowTitle">
|
|
<string>GroupBox</string>
|
|
</property>
|
|
<property name="title">
|
|
<string/>
|
|
</property>
|
|
<layout class="QGridLayout" name="gridLayout">
|
|
<property name="horizontalSpacing">
|
|
<number>6</number>
|
|
</property>
|
|
<property name="verticalSpacing">
|
|
<number>4</number>
|
|
</property>
|
|
<item row="1" column="0">
|
|
<widget class="QLabel" name="label">
|
|
<property name="text">
|
|
<string>Name</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="5" column="0">
|
|
<widget class="QLabel" name="label_3">
|
|
<property name="text">
|
|
<string>Description</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="7" column="0">
|
|
<widget class="QLabel" name="label_4">
|
|
<property name="text">
|
|
<string>Notes</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
|
|
<item row="7" column="2" rowspan="2" colspan="3">
|
|
<widget class="TextEdit" name="diveSiteNotes">
|
|
<property name="focusPolicy">
|
|
<enum>Qt::ClickFocus</enum>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
|
|
<item row="1" column="2" colspan="3">
|
|
<widget class="QLineEdit" name="diveSiteName"/>
|
|
</item>
|
|
|
|
<item row="5" column="2" colspan="3">
|
|
<widget class="QLineEdit" name="diveSiteDescription"/>
|
|
</item>
|
|
|
|
<item row="3" column="0">
|
|
<widget class="QLabel" name="label_2">
|
|
<property name="text">
|
|
<string>Coordinates</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="3" column="2">
|
|
<widget class="QLineEdit" name="diveSiteCoordinates"/>
|
|
</item>
|
|
|
|
<item row="3" column="3">
|
|
<widget class="QPushButton" name="GPSbutton">
|
|
<property name="toolTip">
|
|
<string>Load dive coordinates from GPS file</string>
|
|
</property>
|
|
<property name="text">
|
|
<string>Use GPS file</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
|
|
<item row="3" column="4">
|
|
<widget class="QToolButton" name="geoCodeButton">
|
|
<property name="toolTip">
|
|
<string>Reverse geo lookup</string>
|
|
</property>
|
|
<property name="text">
|
|
<string>...</string>
|
|
</property>
|
|
<property name="icon">
|
|
<iconset>
|
|
<normaloff>:satellite-icon</normaloff>:satellite-icon</iconset>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
|
|
<item row="0" column="0" colspan="5">
|
|
<widget class="KMessageWidget" name="diveSiteMessage">
|
|
<property name="sizePolicy">
|
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
|
<horstretch>0</horstretch>
|
|
<verstretch>0</verstretch>
|
|
</sizepolicy>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="9" column="0" colspan="5">
|
|
<widget class="QGroupBox" name="diveSiteGroupBox">
|
|
<property name="title">
|
|
<string>Near dive sites</string>
|
|
</property>
|
|
<layout class="QVBoxLayout" name="verticalLayout">
|
|
<item>
|
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
<item>
|
|
<widget class="QLabel" name="label_8">
|
|
<property name="text">
|
|
<string>Show dive sites in the range of:</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QLineEdit" name="diveSiteDistance"/>
|
|
</item>
|
|
<item>
|
|
<widget class="QLabel" name="diveSiteDistanceUnits">
|
|
<property name="text">
|
|
<string></string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</item>
|
|
<item>
|
|
<widget class="QListView" name="diveSiteListView">
|
|
<property name="sizePolicy">
|
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
|
<horstretch>0</horstretch>
|
|
<verstretch>0</verstretch>
|
|
</sizepolicy>
|
|
</property>
|
|
<property name="focusPolicy">
|
|
<enum>Qt::ClickFocus</enum>
|
|
</property>
|
|
<property name="selectionMode">
|
|
<enum>QAbstractItemView::MultiSelection</enum>
|
|
</property>
|
|
<property name="modelColumn">
|
|
<number>0</number>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</widget>
|
|
</item>
|
|
<item row="8" column="0">
|
|
<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 row="4" column="0">
|
|
<widget class="QLabel" name="label_5">
|
|
<property name="text">
|
|
<string>Tags</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="4" column="2" colspan="3">
|
|
<widget class="QLabel" name="locationTags">
|
|
<property name="text">
|
|
<string/>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="2" column="0">
|
|
<widget class="QLabel" name="label_6">
|
|
<property name="text">
|
|
<string>Country</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="2" column="2" colspan="3">
|
|
<widget class="QLineEdit" name="diveSiteCountry"/>
|
|
</item>
|
|
</layout>
|
|
</widget>
|
|
<customwidgets>
|
|
<customwidget>
|
|
<class>KMessageWidget</class>
|
|
<extends>QFrame</extends>
|
|
<header>desktop-widgets/kmessagewidget.h</header>
|
|
<container>1</container>
|
|
</customwidget>
|
|
<customwidget>
|
|
<class>TextEdit</class>
|
|
<header>desktop-widgets/textedit.h</header>
|
|
</customwidget>
|
|
</customwidgets>
|
|
<tabstops>
|
|
<tabstop>diveSiteName</tabstop>
|
|
<tabstop>diveSiteCountry</tabstop>
|
|
<tabstop>diveSiteCoordinates</tabstop>
|
|
<tabstop>geoCodeButton</tabstop>
|
|
<tabstop>diveSiteDescription</tabstop>
|
|
<tabstop>diveSiteNotes</tabstop>
|
|
<tabstop>diveSiteListView</tabstop>
|
|
</tabstops>
|
|
<resources>
|
|
<include location="../subsurface.qrc"/>
|
|
</resources>
|
|
<connections/>
|
|
</ui>
|