In order to make it easier to see the changes, the code hasn't been re-indented.
This will be in the next commit.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way it will render in the same font as the location of a dive.
This will look like crap until the next commit adds a rectangle with
color around it, but this way it's much easier to see the individual
changes.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Based on Davide's ideas, but with a few tweaks:
I really like the dive number on the far right; that gives a clean
consistent look. I tried it with date on the left and depth/duration in
the middle and liked the result.
This doesn't change the font, just addresses the layout and bold heading
vs smaller sub-heading.
See #427
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The old system of cloud access updates with fake percentages just wasn't
helpful. Even worse, it hid a lot important information from the user.
This should be more useful (but it will require that we localize the
messages sent from the git progress notifications and make them more
'user ready').
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When you start a new session with Download from DC, clear out the table
from the last attempt before adding the page.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Major functional change in this commit is the addition of found static BT devices
to the internal administration (on Android), in a way that is equivalent to
mobile-on-desktop. So, in both cases, the list of devices in the app are
as in the list of devices on the host OS (Linux or Android). To minimize code
duplication, the btDeviceDiscovered slot is split in two parts, the part to
act as slot for the Qt BT discovery agent (Linux, so mobile-on-desktop), and
the part only needed for Android.
Remaining to be fixed: the correct handling of the QML UI selection of
vendor/product. The first default dive computer is correctly detected,
all paired devices from the virtual vendow can be selected, but clicking
through vendors results in non logical selections. It is obvious why
this is, but a fix is not straigforward at this point.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds a central function to convert a BT name to a vendor/product pair
known to Subsurface. This allows interfacing from a paired BT dive
computer, without actively selecting its type, but by selecting it
from the list of paired BT devices. So, after this, downloading from
multiple (paired) DCs is also possible.
And not the niced piece of code ...
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added a list of paired BT devices for the "Paired BT Devices" vendor. The
devices under this vendor represent all BT devces that can be found
from the local BT interface. Some special processing is required, as
the BT provided data is (obviously) missing the specific data needed
to open a BT device using libdc code. This processing is not in
this commit, but will follow. This commit is preparation for that.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
After the recent refactoring of QMLManager to btdiscovery, the
manager.getBtAddress() got superseeded by
downloadThread.data().getDetectedDeviceAddress(). Corrected this
here.
Futher some debug output is modified, so that it report the proper
function names.
This corrects the download from an automatically detected OSTC 3.
Manul selection of the same device from the fake vendor "Paired
BT Devices" does not work, however. Still work to be done in
that area.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This shouldn't be part of the UI (qmlmanager), but part of our
overall handling of dive computers and BT devices.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
all qDebug / qCDebug and friends now will be properly
logged into developer -> log, on QML.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
QML and C++ model don't interact too much, a new Rule
should be created and used on the QML
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we detected a BT dive computer, we can already set up the vendor and
product for it (as well as the new BT checkbox).
Oddly, in my tests this doesn't set up the product correctly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A delegate to display the dives in a better way,
based on the code from DiveList.qml
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This already takes into account which of those dives were selected.
Right now all we have is select all or none - this needs actual support
in the UI, but once that's there, it will just work (famous last words).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Still to do:
- select the dives to save
- record the downloaded dives
but download is already working. :)
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For this I had to also make the DCDeviceData accessible,
and for that it needed to be a pointer.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a new action on the drawer to display the
Download from Dive Computer options. Nothing works yet.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Trying to close the non-existing context drawer caused the function
to abort (and consequently not to delete the dive).
Fixes#309
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There was an extra BasicListItem inside the SwipeListItem.
This commit just removes 5 lines, the rest is indentation change.
Fixes#312
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Prior to Qt Quick Components 2.1 there was no onPressed signal for a
TextField; in order to be able to build against Qt 5.7 (which comes with
Qt Quick Components 2.0) we need to work around the lack of this signal.
This code seems to do a pretty good job at simulating it.
My attempt in commit 73c66e1d7d ("QML UI: make run with Qt 5.7 again")
didn't work so well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Assigning actions in an imperative way on component complete,
seems to cause a crash on some devices, assign declaratively
the whole list instead, hiding the gps related actions on
iOS as they are not supported on that platform.
Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a different take that seems to deal much better with different
width and font size combinations.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The editText property is not there anymore, we need text
Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fixes scrolling of the cloud credentials and simplifies code
Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Completely adapt to the api changes of OverlaySheet in Kirigami2
in order to achieve the same look and behavior for the dive
edits that had with kirigami1
Port most components to QtQuickContrls2, except comboboxes
in the dive edit sheet that will need a new control type
Signed-off-by: Marco Martin <notmart@gmail.com>
Sending nicely readable formatted coordinates to Google Maps does not
result in a correctly positioned map. Google likes unreadable
decimal format.
Little hacky solution. Added a gps_decimal attribute, populate that
with the standard function for format a coordinate to string, but
reset the preferences value temporarly so that it always converts it
to decimal style.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This fix seems to fix the enumerate problem: the problem that on a
seemingly non-determinstic way, all the profiles get enumerated
and rendered, causing freeze of the app, or even crash due
to out of memory.
Only 3 lines of code change, but this fix did not come easy. The
enumerate problem seems some kind of race condition between QML,
Kiragami and most definitely, the Subsurface QML code itself.
The breakthrough in my debugging was the setting of
highlightRangeMode: ListView.StrictlyEnforceRange based on
the QML documentation on snapMode: enumeration.
This fix deserves proper testing in multiple environments. As
could be seen on the developpers mailing list, I was (easily)
able to reproduce the enumerate problem, but Rick was not. So
I definitely do not claim to understand why this fix solves
the issue for me.
And as a sidenote: fixes#263 for me as well.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
It's unclear why this code was added in the first place - removing it
makes the highlight of the selected dive in the dive list work.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This allows the user to enter multiple buddies as a comma separated list,
the "Multiple Buddies" entry is still a special case as we can only populate
the combobox with a single name for each entry.
fixes#168
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
The JS string function search returns the position of the string you
search for and -1 if that string isn't found. Also, search allows
regular expression, indexOf does just a string match. So let's use
that as it is much faster.
See issue #168
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
"Multiple Buddies" is magic in that it means "do not change the buddies
set for this dive". Allowing the user to edit that magic phrase defeats
the purpose.
This deals with part of issue #168 - but of course that magic phrase
shouldn't be fixed as English text.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When editing adive in Subsurface-mobile we can only handle one buddy
due to the limitations of the combobox. To prevent loss of data when editing
a dive with more than one buddy we display "Multiple Buddies" in the buddy
field. This creates a special case where no changes are written to the buddy field
unless the user changes buddy for that dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds the option to select a cylinder when adding or editing a dive.
Due to limited screen size we restrict the editing to the first cylinder only.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Now kirigami needs to be built with a C++ plugin.
In cases of mobile operating systems such as iOS (and in a lesser measuse,
Android) having a proper plugin loaded at runtime may be difficult, so
statically link it together with all of its qml files compiled as a
qresource inside the static library.
Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
since the contentItem is the default property of
ScrollablePage, putting another Item after it will change
contentItem with that one, in this case the Label
Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There was a column of whitespace in the divelist that looked strange.
It was there so a trash can icon can appear. Now the trashcan overlaps
with the item.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>