aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2016-02-09QML UI: load from cache first when changing cloud credentialsGravatar Dirk Hohndel
We need to execute the same sequence of steps both when starting the app and when switching cloud credentials. This way things will work correctly when the device is offline and the user wants to switch accounts. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09QML UI: draw edit/back button next to context menu button if it's shownGravatar Dirk Hohndel
Without this they were all anchored to parent.right and would be rendered on top of each other. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08QML UI: DiveDetailsView - calculate better width and set everywhereGravatar Dirk Hohndel
Even setting things up in the first row isn't enough. Every field in the grid needs an explicit width. How dumb is that. To make this more manageable calculate the correct widths at the beginning and then just reference those properties. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08QML UI: DiveDetailsView - set fixed column widthsGravatar Dirk Hohndel
In order for wrapping to work, the Text and TextEdit elements need to have a defined width. Normally the GridLayout is supposed to be able to figure out optimal widths for the different colums if you tell it which ones should stretch, but that has repeatedly caused infinite loops and crashes in the layout engine. For now, in order to get both wrapping (and therefore no clipping of the content) and avoid crashes, we hard code the width of the four columns by setting Layout.maxWidth for each element in the first row of the grid. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08QML UI: DiveDetailsView - reorder the gridGravatar Dirk Hohndel
Let's put the three likely rather narrow items above each other in the right column and the others (especially the three that could run long: suit, buddy, dive master) in the left one. Also, make the individual entries more consistent in which attributes are set in which order - easier to read. Finally, make sure that all grid elements enable wrapping. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08Sync load from cloud status when changing cloud storage accountsGravatar Dirk Hohndel
Since this variable is specific to the cloud credentials in use, we need to reset it when we change credentials. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08Always sync with cloud server when updating backend dataGravatar Dirk Hohndel
It makes no sense to only do this the very first time we connect to a cloud storage account. The existing code only happened to work because we incorrectly tried to maintain the loadFromCloud status across restarts of the application. So one bug hid another bug. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08Remember status of specific cloud account in settingsGravatar Dirk Hohndel
What matters is that the cloud storage for a specific email address has successfully been synced - and we need to remember this across restarts of the app. This way Subsurface-mobile can work with different accounts, even if offline. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08QML UI: correctly handle back key on editsGravatar Dirk Hohndel
This requires mobile components that include commit 03c868fc57e5 from earlier today. With this a single press on the back key cancels the edit and a second press on the back key brings you up one level in the page stack (usually back to the dive list). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08Short first attempt at a user manual for Subsurface-mobileGravatar Willem Ferguson
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08Move preferences under GPS menuGravatar Miika Turkia
Since we currently only have preferences that affect the GPS functionality, it might be more logical to have the preferences under GPS menu. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07Avoid QtCreator warning about ==Gravatar Henrik Brautaset Aronsen
Warning M126: == and != may perform type coercion, use === or !== to avoid it Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07Move endEditMode() to DiveDetails.qmlGravatar Henrik Brautaset Aronsen
Having endEditMode() in main.qml seemed wrong somehow. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07Add top-right edit and back buttons for mobileGravatar Henrik Brautaset Aronsen
Adds a back button in edit mode, and an edit button for view mode. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07QML UI: another attempt to fix the random crashesGravatar Dirk Hohndel
I finally was able to reproduce the crashes with the infinite recursion when computing a GridLayout. This seems to be triggered by competing Layout.fillWidth settings that the layout engine couldn't figure out how to accomodate. I did three things to make this work better: - explicitly grab the columnWidth for the width of the DiveDetailsView. - split the GridLayout in two so the area above and below the profile are no longer forced to fit in the same column widths. - remove most of the Layout.fillWidth settings and only leave a couple that seem sufficient to get reasonable on screen layout in my experiments. Here's hoping that this one is finally resolved. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07QML UI: disable download from divecomputer button on start pageGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07Revert "QML UI: end edit mode when leaving the edit page"Gravatar Dirk Hohndel
This reverts commit d2928a137cabab30973a96a71beee9fd840db516. The presence of this Action causes crashes for one of the testers. Which is utterly ridiculous.
2016-02-07Don't run time consuming gas interpolation without any dataGravatar Dirk Hohndel
If the user hasn't set any pressures at all there is no point in trying to interpolate all these data. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-06Profile: don't compile code that isn't needed on mobileGravatar Dirk Hohndel
We were creating a couple dozen objects that we never needed and because of that triggered several dozen callbacks whenever the model data changed. All for UI elements of the profile that are either not used in the mobile app (like the calculated ceiling or the partial pressure / tissue saturation graphs), or are only useful when using the profile interactively (which we also don't do on mobile). I don't know if this will make a significant impact on performance, but it seems like the right thing to do either way. A positive side effect is that the odd blue line on top of the rendered profile is gone as well. Fixes #1007 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-06QML UI: end edit mode when leaving the edit pageGravatar Dirk Hohndel
This should fix the problem when using the back key to exit the edit page. Requires a patch to the mobile components that isn't upstream, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-06QML UI: make time parsing more lenientGravatar Dirk Hohndel
White space between numbers and units should be ignored. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-06Mobile: always show divecomputer reported ceiling in redGravatar Jan Mulder
We do not not want to do decompress model calculations in the mobile app (see 130f4cd7ac5b), but we do want to see the divecomputer reported ceiling (in red). The latter is fixed here. Ticket #1006 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05QML UI: enable editing of weightGravatar Dirk Hohndel
But only if there is only one weight system defined in the dive. Otherwise display a read only text that explains that this cannot be edited. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05DiveObjectHelper: check if dive has only one weightsystemGravatar Dirk Hohndel
The mobile app should only allow editing the weight entry if there is no second weight defined. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05Simplify sumWeight functionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05Add helper function to parse weight stringsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05profile-widget: use smaller event icons on Subsurface-mobileGravatar Rick Walsh
Smaller event icons fit the mobile display much nicer Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05Do not run the deco calculations in the mobile appGravatar Dirk Hohndel
We don't show the calculated ceilings and calculating them is compute intensive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05QML UI: explicitly hide the keyboard when exiting dive editGravatar Dirk Hohndel
If you save or cancel the dive edit, the keyboard should be closed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05QML UI: disable download from divecomputerGravatar Dirk Hohndel
This is not hooked up, yet, and would likely only confuse potential testers. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-04Allow merging of dives with zero depth/durationGravatar Miika Turkia
Fixes #1003 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-03Mobile. Modify DownloadFromDiveComputer.qmlGravatar Willem Ferguson
1) Create space for sillybutton at bottom of screen 2) Reformat columns in tableview 3) General cleanup and simplification of code. Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-03Fix Liquivision import crashGravatar Miika Turkia
When we detect a redundant DC we free the memory reserved for the model. Thus we need to malloc that memory here. Fixes #1002 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-02Update copyright for 2016Gravatar Jan Mulder
Trival string update. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-02Simplify building of Android build from one source treeGravatar Jan Mulder
Currently, when running the packaging/android/build.sh from a source tree that has been used for desktop builds, libdivecomputer wants a make distclean. This is inconvinient, and is caused by building libdivecomputer in source. Now, configure and build libdivecomputer in a new subdirectory, allowing to run the android build script from the same source tree as the desktop (both desktop and mobile) builds. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-02Build Android mobile app against latest OpenSSLGravatar Jan Mulder
No reasons not to upgrade to the latest OpenSSL lib. The currently used 1.0.1 branch is ending end of 2016, so a switch to 1.0.2 is useful anyway. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-01Silence compiler warningsGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-01QML UI: Another attempt to shift dive number to top rowGravatar Rick Walsh
Commit 1030cb265a46436a1903cdf66d88a7dd3351d3aa 'QML UI DiveDetailsView: shift dive number to right of top row' was reverted because it caused mysterious crashes for some testers, inferred to be related to sizing items in a gridLayout. This patch brings the dive number back up to the right of the top row, so the page width doesn't exceed the screen width. Using text wrapping should prevent the date text and dive number items from increasing in width, and hopefully avoids the mysterious crashes. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-31Mark CCR dive's divetype properlyGravatar Miika Turkia
We used to mark CCR dives by having "SP change" event at time 0:00. As we nowadays mark CCR dives by setting dc->divemode appropriately, better to convert the old dives to this format as well. This way we do not have to take the special old format into account on multiple places in the source. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-31Revert "QML UI DiveDetailsView: shift dive number to right of top row"Gravatar Dirk Hohndel
This reverts commit 1030cb265a46436a1903cdf66d88a7dd3351d3aa. Simply trying to find out if this is the cause for the odd crashes one tester is seeing.
2016-01-31Attempt to detect time format on CSV importGravatar Miika Turkia
This attempts to detect the time format when initially importing a CSV file. Well, only the minutes:seconds notation is detected currently. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-31Attempt to detect date format on CSV importGravatar Miika Turkia
This tries to detect the date format when initially reading a CSV file for importing. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29QML UI: pick new highest dive number when manually adding diveGravatar Dirk Hohndel
It's possible that this will create an out of order dive list, but it seems the most consistent way to do things and to avoid more than one dive with the same dive number (which could have happened if you add several dives manually that are not the newest dives in the dive list). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29Minor cleanupsGravatar Dirk Hohndel
Improve readability of the code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29QML UI: introduce "add" state and correctly clean up when canceledGravatar Dirk Hohndel
Adding a dive is just like editing it, except that canceling the operation has different consequences. Instead of trying to figure this out by some inference on other state, let's just make it explicit and then clean up after ourselves if the user canceled a manual dive add. This also switches to use the properties that we defined in order for the main menu to be able to setup these values. Makes the code easier to read and is more consistent. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29Add helper to remove dive from modelGravatar Dirk Hohndel
I tried various things to do this from QML but it just doesn't seem to work at all. So I gave up and instead added a trivial helper function. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29QML UI: remove apparently obsolete codeGravatar Dirk Hohndel
I couldn't make sense of either the code nor the comment, so I tried what broke when I removed it. Nothing that I could find. So maybe we don't need this after all? Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28QML UI: better way to determine dive details edit widthGravatar Dirk Hohndel
Instead of passing magic values around, calculate the columnWidth as part of the SubsurfaceTheme object. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28QML UI: make manually added dives more like those added on desktopGravatar Dirk Hohndel
By giving them a fake profile we can actually edit the dive profile in the desktop app. Fixes #998 Fixes #1000 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28QML UI: once again hide "--" as section headerGravatar Dirk Hohndel
The fix for correctly showing multiple trips with the same location text inadvertantly broke the detection of empty location text. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>