aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmanager.cpp
AgeCommit message (Collapse)Author
2017-06-01Android BT: do not force BT onGravatar Jan Mulder
It is very impolite to force BT on at start of the mobile app. We cannot know if the user is going to import dives over BT. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-01Android BT: pull the pairing data from a deviceGravatar Jan Mulder
As Qt is not able to pull the pairing data from a device, a lengthy discovery process is needed to see what devices are paired. On https://forum.qt.io/topic/46075/solved-bluetooth-list-paired-devices user s.frings74 does, however, present a solution to this using JNI. Currently, this code is taken "as is". Currently, only for Android (so not mobile-on-desktop, or even desktop). And only generating logging data in the logcat. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-01Use #if defined() instead of #ifGravatar Jan Mulder
qtcreator (4.3.0) got confused whether BT_SUPPORT was defined. Using work as expected. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-05-31QML UI: try to also detect OSTC BT dive computersGravatar Dirk Hohndel
The naming scheme of OSTC dive computers doesn't match their product names, but they all behave the same from a download perspective, so we assume that any BT device that has a name starting with OSTC is an OSTC 3. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31Android: connect to BT via uuid instead of portGravatar Dirk Hohndel
We remember the offered service uuids as we detect the device and then try the first one - likely this needs to be fixed / tuned to pick the right one if multiple uuids are offered. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31QML UI: add getBtAddress functionGravatar Dirk Hohndel
This allows us to get the BT address of the first dive computer that we found. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-29QML UI: detect BT dive computersGravatar Dirk Hohndel
If we find something that looks like a known BT dive computer, set things up so that we can use it later. If multiple dive computers are found, simply use the first. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-29QML UI: try to match BT names to known dive computersGravatar Dirk Hohndel
So far this just adds data to the log. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-29QML UI: start BT discoveryGravatar Dirk Hohndel
So far all this does is list all the BT devices that it finds (and I worry if this will have negative battery implications on a mobile device), but this should allow us to connect to a standard BT dive computer (but that will of course require more code to pick the right device). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27QML UI: Fill the product listGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-29Add SPDX header to mobile widgets and QML filesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-16QML UI: correctly update dive list after editing timestampGravatar Dirk Hohndel
Once we re-inserted the dive in the list we aren't done, quite the contrary - we now need to make sure that we handle any other changes and mark the dive list as updated. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-16QML UI: correctly parse manually edited dateGravatar Dirk Hohndel
We need to set the timeSpec after the QDateTime was parsed, otherwise it gets converted to localtime again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14QML UI: create completion list for cylinders as wellGravatar Dirk Hohndel
We already have that for the other three fields where we offer auto completion (buddy, divemaster, suit). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-04QML UI: better handling of device pixel ratioGravatar Dirk Hohndel
In order to make sure we don't render the initial profiles with the wrong scale on devices, we need to seed the device pixel ratio with the device default and then update it once the window has been created. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-26MOBILE: Display pO2 and Setpoint for CCR divesGravatar Joakim Bygdell
For CCR dives we want to display the setpoint and pO2 information, due to the limited screensize we have to remove the temperature graph or the view will be to cluttered. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-03-11Sync unit system to Subsurface-mobile (part 2)Gravatar Dirk Hohndel
Missed a spot. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-11Correctly sync unit system to Subsurface-mobileGravatar Dirk Hohndel
We were doing the right thing switching from metric to imperial, but in order to swtich back you had to restart. Now it works both ways. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-05Merge informational_prefs into git_prefsGravatar Joakim Bygdell
There is no need to have two variables for the same purpose. [Dirk Hohndel: changed to keep the two separate functions as otherwise we no longer parse existing repos successfully] Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-05MOBILE: Read profile settings from gitGravatar Joakim Bygdell
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-01-29QML UI: Parse multiple buddies when editing a diveGravatar jbygdell
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>
2017-01-22QML UI: allow magic phrase for multiple buddies to be localizedGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-17QML UI: deal with multiple buddies correctlyGravatar Joakim Bygdell
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>
2016-09-04Fix some warningsGravatar Dirk Hohndel
At least the warnings about size potentially being uninitialized seem correct and valid. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04QML UI: Enable cylinder editGravatar Joakim Bygdell
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>
2016-08-27Settings update: Simplify code by using the SettingsObjectHelperGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-10Unify handling of QDateTime time zone informationGravatar Robert C. Helling
Subsurface uses "local time" which in particular means we never display time zone information to the user. The user (and our file format) only sees times like 5pm or 17:00. A better name than local time (which could mean "local at the dive spot) would be "watch time", the time displayed by the diver's watch when she entered the water. Internally, we store times as time_t, seconds since Jan 1 1970 0:00 UTC. Our convention for conversion between 5pm and time_t as always been to treat 5pm as if it were UTC. Then confusion arose since Qt's QDateTime (which is tied to UI elements like QTimeEdit and similar) is time zone aware and by default assumes the system time zone. So when we set a QDateTime to 5pm and then later convert it to time_t we have to take care about the difference between UTC and the system time zone. This patch unifies our solution to this problem: With it, we set all QDateTime's time zone to UTC. This means we don't have to correct for a time zone anymore when converting to time_t (note, however, the signedness issue: Qt's idea of time_t is broken since it assumes it to be unsigned thus not allowing for dates before 1970. Better use the millisecont variants). We only need to be careful about time zones when using the current time. With this convention, when assigning the current time to a QDateTime, we need to shift for the time zone since its value in UTC should actually be the watch time of the user who is most likely used to the system time zone. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-17QML UI: correctly check cloud verification statusGravatar Dirk Hohndel
Oops. That's embarrassing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-13QML UI: allow entering the cloud PIN on the mobile UIGravatar Dirk Hohndel
Now the user doesn't need to do this on the desktop app anymore. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-13QML UI: prepare to enter the cloud PIN on mobile UIGravatar Dirk Hohndel
This just creates the properties to connect QML and C++ code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-13QML UI: serialize checking credentialsGravatar Dirk Hohndel
If we run the backend to verify credentials without waiting for it to finish, the redirect might happen before we know if the credentials are invalid, unverified or verified - which will cause us to give the wrong information to the user. Yes, this additional wait is annoying, but I can't come up with a better way to do this and avoid incorrect information. At least the UI isn't hung while we wait. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-12QML UI: don't proceed unless cloud credentials are verifiedGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-12QML UI: disable GPS functionality on iOSGravatar Dirk Hohndel
I still haven't figured out how to make GPS work on iOS. So let's not pretend this works. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-21Add init function to qmlmanagerGravatar Joakim Bygdell
In order to get autocomplete to work on manual dive add we apparently need a separate init function. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-30QML UI: when first entering cloud credentials, force cloud connectionGravatar Dirk Hohndel
With offline the default now, we need to force a connection at least once so that the repos are in sync. And then of course we need to return to the correct state, regardless on whether this connection succeeded or failed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-30Connect to the reply, not the managerGravatar Dirk Hohndel
This way if there are other pending connections we don't get triggered by the wrong completion. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-30QML UI: forceRemoteSync means connect even without unsaved changesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-30QML UI: better diagnostics when cloud connection failsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-30Only create the path to no cloud local storage onceGravatar Dirk Hohndel
This required a small change to the helper function, but this seemed totally worth it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-30Fix logic for when to mark dive list as changedGravatar Dirk Hohndel
Since saving checks if there are changes, we have to always mark the dive list as changed before asking for the changes to be saved. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-29QML UI: when switching from no cloud to cloud usage, don't drop local dataGravatar Dirk Hohndel
This is rather simplistic, it just imports the local data into the remote repository and therefore loses the git history of the local data - but I wasn't able to make the git merge without shared base commit work, so I went this much easier to implement route instead. One thing we need to be careful about is that contacting the remote server could fail. If we don't manage to merge the dives from cloud server and local storage, we need to revery to no cloud status in order not to lose the local data. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-29QML UI: fix order of tests when saving changesGravatar Dirk Hohndel
Only check for previous cloud connection when actually trying to save to cloud Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-29QML UI: make sure nothing is lost when changing cloud credentialsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-27QML UI: handle failure to read local dive dataGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-27only set index if we have specific targetGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-27QML UI: with a local default file setup, open that at startGravatar Dirk Hohndel
And set no cloud mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-27Add helper function for the consumption of loaded dive dataGravatar Dirk Hohndel
This allows us to call that part of the process from multiple places in the future. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-27QML UI: in no cloud mode, save to a default local repoGravatar Dirk Hohndel
And set that up as the default file to load at start. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-19QML UI: correctly show if we are accessing remote or local storageGravatar Dirk Hohndel
This makes sure that if the user switches to offline mode they don't get incorrect notifications that tell them that they are accessing cloud storage. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-19QML UI: always show the time stamp when logging dataGravatar Dirk Hohndel
This should help understand some of the issues with git storage and GPS fixes better. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>