aboutsummaryrefslogtreecommitdiffstats
path: root/qt-mobile
AgeCommit message (Collapse)Author
2016-03-13QML UI: show cloud access notification when refreshing from menuGravatar Dirk Hohndel
If the user requests a refresh we always try to access the cloud and need to show the notification accordingly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-11QML UI: don't allow negative gas consumptionGravatar Dirk Hohndel
If end pressure is higher than start pressure, simply use the same start and end pressure. Fixes #1024 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-11QML UI: try to clean up UI before showing notificationGravatar Dirk Hohndel
This way we shouldn't have a drawer or other changes to the UI prevent the user from seeing / interacting with the notification. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10QML UI: don't claim to be accessing the cloud when you are notGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10Red error messages in QMLGravatar Tomaz Canabrava
[Dirk Hohndel: slightly changed to make it easier for translation plus added one missing string that needed to be marked] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10QML UI: correctly validate the gasmix enteredGravatar Dirk Hohndel
We parsed it correctly, but then compared the permille values against percent thresholds. What a stupid bug. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10QML UI: if the date entered doesn't match the format, try harderGravatar Dirk Hohndel
This implements a bunch of standard date and time formats, hoping that what the user entered matches one of them. I guess in the end we need to find decent calendar/clock based widgets to enter the time and avoid the whole parsing hassle. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10QML UI: hide some profile scaling debug messagesGravatar Dirk Hohndel
Simply make things less verbose Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10QML UI: keep cloud access notification until doneGravatar Dirk Hohndel
Instead of having the notification disappear after five seconds, keep it visible until we are done accessing the cloud. That seems to be more intuitive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10correctly build on androidGravatar Marco Martin
2016-03-08QMLProfile: account for device pixel ratio when transforming the profileGravatar Dirk Hohndel
This is turning into the never ending story. The documentation is not helpful, so this is the result of a ton of trial and error - and I worry that the next device I try this on will once again break things. I think the scaling may finally be correct. Take the viewport rectangles of the profile and the painter, create their ratio, multiply in the device pixel ratio and the scene size with a little margin added around it. But the other magic (especially the shifting of the profile on the painter) makes absolutely no sense to me. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08QMLProfile: correctly track the device pixel ratioGravatar Dirk Hohndel
And set the font size accordingly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08QMLManager: helper function for devivePixelRatioGravatar Dirk Hohndel
This allows us to use the single manager object to keep track of the dpr of the screen and to pass it on if it changes (or when it first becomes known). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08QMLManager: fix order of initializationGravatar Dirk Hohndel
Just avoids warnings. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08QML UI: remove incorrect calculation of devicePixelRatioGravatar Dirk Hohndel
That's just bogus. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08port to Kirigami imports and new apiGravatar Marco Martin
first quick and dirty port of the imports to Kirigami 1.0 (using system installed for now) adapt to api changes and try out some of the proposed ui changes from the HIG Signed-off-by: Marco Martin <notmart@gmail.com>
2016-03-05Introduce separate version number for Subsurface-mobileGravatar Dirk Hohndel
This is hard coded in version.cmake for now. The intent is to go to 1.0 in the first release version and to increment from there whenever we create an update. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-05QML UI: small modification to About screenGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03QML UI: make sure the drawer is closed after going back to dive listGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03QML UI: brute force around Qt 5.6.0 bugGravatar Dirk Hohndel
With the current release candidate of Qt 5.6.0 we get into an infinite recursion of the grid layout engine. This had happened before (prior to the 5.6 beta) and it appeared that setting the maximum width of the columns was sufficient to fix this. But with the RC even that isn't sufficient, so now we give up on having QML figure out the best possible column width and hard code both preferred and maximum width to the same, predefined values. That's a total shame, but at least now we can build against Qt 5.6 without infinite recursions and crashes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03QML UI: remove commented out / unused codeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03QML UI: try to avoid binding loopGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03use the global showPassiveNotification functionGravatar Marco Martin
don't create a local PassiveNotification copy, use the global show/hidePassiveNotification from ApplicationWindow, now that it works Signed-off-by: Marco Martin <notmart@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03QML UI: remove incorrect statementGravatar Dirk Hohndel
Not sure what this was even supposed to do... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03QML UI: show notification for saving dives to cloud as wellGravatar Dirk Hohndel
Fixes #1014 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03QML UI: ensure that cloud notification is always clearedGravatar Dirk Hohndel
All error cases need to reset it as well. And it's easier to reset it right after we come back from parse_file() instead of trying to track all the exit cases after that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02QML UI: show notification when cloud is accessedGravatar Dirk Hohndel
And hide the notification either after 5 seconds or once we are done. This requires an extension to the Kirigami components that isn't upstream, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02QML UI: new property to tell the UI that we are accessing cloud storageGravatar Dirk Hohndel
This can then be used to give the user visual feedback (instead of them just thinking the app is hung). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02QML UI: resolve confusion about dive list model orderingGravatar Dirk Hohndel
Oops, I forgot to take the sort model on top of the model into account. Now everything should stay consistent - ListView order when accessed from QML, but internal order when accessing the underlying array. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02QML UI: update profile when editing duration of manually added diveGravatar Dirk Hohndel
We need to make sure that a new fake DC is created after the duration was changed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02QML UI: update the correct dive in the model when committing a changeGravatar Dirk Hohndel
When manually adding a dive and moving it in the dive list (by editing it's start time) we could create a situation where the dive list internally was correct, but the dive list model on screen showed an incorrect dive list with the new dive in two different spots. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02QML UI: after adding a dive, jump to it in the listGravatar Dirk Hohndel
Don't do the slow motion scrolling through the list if we previously showed a different dive in the list. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02Add helper functions to identify the position of a dive in the dive listGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-29QML UI: implement undeleteGravatar Dirk Hohndel
This code is very similar to the undo code in the desktop UI, but untangling that from the desktop seemed massive overkill; we don't have lists of dives to delete and undelete here - so this is actually much simpler and easier to maintain (I hope). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-29QML UI: present an undo dialog after deleteGravatar Dirk Hohndel
The dialog gives the user 3 seconds to undo the delete and then disappears without any user interaction. This isn't hooked up, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-28QML UI: small adjustment to DiveDetailsViewGravatar Dirk Hohndel
This reduces the margin to use more of the available space and also makes the first column slightly wider so the word "Cylinder" isn't broken on a Nexus 6p. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-28QML UI: ensure that after a dive edit the profile is redrawnGravatar Dirk Hohndel
Normally this is triggered when the DiveDetailsView component is completed, but since QML isn't recreating this component unless we switch to a dive a couple of spots in the dive list away from this one, we wouldn't get any changes in the data reflected in the profile. But since this now redraws the same dive that potentially was drawn last, we need to make sure we call plotDive() with force=true. I also suspect that this could help with the strange bug that sometimes we show a blank profile after certain edits. See #1013 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-28QML UI: we no longer use the return value of commitChanges()Gravatar Dirk Hohndel
So make it a void function. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-23QML UI: add context menu to delete diveGravatar Dirk Hohndel
This allows the user to delete the currently shown dive. This action takes effect right away, no confirmation, it gets right away written to the local git cache. One idea for an undo operation here could be to simply reset the git tree to HEAD^ and reload. Not elegant, but would work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-23Add helper to delete dive from QMLGravatar Dirk Hohndel
Once again we make this save the changes to the local cache without being prompted. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-20QML UI: further validation in the C++ codeGravatar Dirk Hohndel
Don't allow negative depth or depth beyond 500m. Additional checks that the gas mix is possible (even thought QML code SHOULD only allow valid combinations). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-20QML UI: only allow valid gas mixesGravatar Dirk Hohndel
The input is restricted to EAN100 EANxx (with 'x' one of 0..9) AIR xx/xx (with 'x' one of 0..9) xxx (with 'x' one of 0..9 and the number <= 100) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-20QML UI: don't allow negative duration or depthGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-20Add option to allocate the samples in fake_dc()Gravatar Dirk Hohndel
We (ab)use fake_dc() to create a pleasing profile for a manually added dive. Based on it's intended use, fake_dc() simply handed back a dc structure that pointed at staticly allocated samples - that's obviously (now that I think about it) going to blow up in my face if I edit a manually added dive more than once. So now we have an option for fake_dc() to actually allocate the samples - this way the rest of the code can treat these samples as we would treat samples created any other way. We can free them and replace them with a new set. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-20After freeing the samples, clear the pointerGravatar Dirk Hohndel
Otherwise we might end up trying to free them a second time. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-20QML UI: fix recreation of profile after dive editGravatar Dirk Hohndel
We only need to deal with this if the dive changed. And in that case, if we calculate a new fake DC, we need to clear out the meandepth as otherwise the algorithm will try to match both max and mean depth. Since the user potentially changed the max depth that could have very odd consequences. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-15QML UI: no longer change unit preferences when parsing editsGravatar Dirk Hohndel
When the user explicitly sets the units when editing or adding dives, we used to change the display preferences. This was changed for some but not all fields in commit 6252d0cd3bda ("While parsing weight and pressure we should not change the users settings") Now we do this consistently for all inputs. Also, when editing the depth of a manually added dive, we now throw away the samples (as those are certain to be inconsistent). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-15QML UI: better text when no profile is shown for a diveGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-14QML UI: don't show an odd profile for zero duration diveGravatar Dirk Hohndel
A dive with zero duration creates an odd profile that is 2min 30seconds long and looks just weird. Instead, simply show a text that there is on profile shown for such a dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-14Remove debug outputGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>