Commit graph

10093 commits

Author SHA1 Message Date
Dirk Hohndel
464b88f01f QML UI: yet another attempt to fix the profile scaling
This one appears to work in my testing so far. And reading the code it
seems to make sense. We look at the size that the widget thinks it is. And
we scale the scene to fill that size (including a margin). And then let Qt
and QML deal with the rest of it. Assuming this works it shows that we
have been trying too hard all this time.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-18 12:32:47 -08:00
Dirk Hohndel
38c60e02c7 Fix crash with empty (or very short) dive list
In commit 37c10c8fd6 ("Add dive type to statistics window") not enough
space is reserved for the newly introduced array if the dive list as fewer
than 4 entries.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-18 11:45:25 -08:00
Dirk Hohndel
040d3cd413 build.sh: fix broken logic to pull mobile components
In commit f28f03afe2 ("build.sh: make it easier to build
Subsurface-mobile") I mistakenly broke the logic that decides to run the
mobilecomponents.sh script.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-18 11:20:05 -08:00
Miika Turkia
37c10c8fd6 Add dive type to statistics window
This adds dive type based division to the "yearly statistics" window.
Thus people can see the stats from individually from OC, CCR, PSCR and
freedive.

See #949

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-18 09:34:54 -08:00
Miika Turkia
b9000208fe Hide the time from trip tab
This hides the start time when viewing trip details.

See #964

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-17 10:45:40 -08:00
Miika Turkia
394ddba013 Mark date field readonly on trip edit
The date comes from the first dive in trip, thus no need to allow
editing (especially since the edited date seems to be discarded in any
case).

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-17 10:45:29 -08:00
Dirk Hohndel
f28f03afe2 build.sh: make it easier to build Subsurface-mobile
The script now takes a -mobile argument, or -both and then builds the
mobile version or both versions. To make things more consistent across
different invocations the desktop version is built in the "build"
directory and the mobile version is built in "build-mobile".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-17 10:44:00 -08:00
Willem Ferguson
69eeb2bf5b Make default build for desktop.
Make the default build a DesktopExecutable, with an option to set a variable for doing a mobile build.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-17 08:42:14 -08:00
Dirk Hohndel
df9062bd2e QML UI: next attempt to address the profile scaling
It seems to be much more logical to address the size and scale right
before rendering.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 13:55:42 -08:00
Tomaz Canabrava
ba111ce9a3 Settings QObjectification: implement the unit settings
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:56:43 -08:00
Tomaz Canabrava
455f7bd51b Settings QObjectification: unit system
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:56:28 -08:00
Tomaz Canabrava
8e61c36ca7 Settings QObjectification: dive planner preferences
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:56:14 -08:00
Tomaz Canabrava
7b5656a08b Settings QObjectification: add PlannerSettings
We probably want to change that on the prefs struct too.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:55:51 -08:00
Tomaz Canabrava
93762249fa Settings QObjectification: cloud storage preferences
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:55:39 -08:00
Tomaz Canabrava
f5c69e3a56 Settings QObjectification: finish network preferences
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:55:18 -08:00
Tomaz Canabrava
22da63e839 Settings QObjectification: start Proxy QObject config
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:55:02 -08:00
Tomaz Canabrava
cae6960eac Settings QObjectification: some cleanups
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:54:54 -08:00
Tomaz Canabrava
ab35ee69bd Settings QObjectification: geocoding preferences
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:54:30 -08:00
Tomaz Canabrava
5c62a0aac6 Settings QObjectification: minor cleanups
Rename a few methods wrongly named and place them on the correct place on the file.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:53:59 -08:00
Tomaz Canabrava
9b37c6dfa1 Settings QObjectification: Facebook settings
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:53:28 -08:00
Dirk Hohndel
0dba3c4e4a Don't round up / use minimum duration for profile in Subsurface-mobile
On the desktop we have long had this vision of a minimum length and a
"pleasant" duration of the profile - but on a device this seems to look
like uneven margins. So let's just add space for the labels and not
otherwise mess with the duration.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-13 16:47:52 -08:00
Sebastian Kügler
53024ca76d try to fix profile scaling
Different approach here:

- profile gets a bit higher, this was requested on the mailinglist, and
  seems to behave much better with the painted profile, we'd otherwise
  get it magically clipped on the right hand side.
- Make the scaling dpi aware, this fixes scaling for me on the Nexus7, I
  haven't been able to test it properly on other devices, so this needs
  some more testing. The result is visually quite close to what we can
  do, although I'm still getting a somewhat larger margin on the right.
  To get at the devicePixelRatio without too much custom code, I've
  added a property to the QMLProfile to retrieve it from the theme engine.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-13 16:27:41 -08:00
Sebastian Kügler
8199c13f42 fix misrendered profiles when fast-flicking
- Apparently, QMLProfile doesn't like being painted without being
  visible, when flicking quickly through the dives I would get empty
  rendered profiles. Setting the cachebuffer to zero fixes it, and saves
  some memory.
  It still has some unfortunate timing, the profile gets rendered
  mid-flick, which leads to a delay in the flicking motion, quite
  annoying. We will have to somehow make sure that new profiles are
  rendered after flicking, not during
- Smallish cleanups

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-13 03:08:34 +01:00
krisalpha
7e9648c5cb Be more precise in our language: call it "mean depth"
As pointed by jwhferguson, I changed "show average depth" to "show
mean depth".

I modified file preferences_graph.ui and changed the text. This bug was
reported on fedora 22. i use ubuntu.layout and justification is nicely
displayed.

The patch also removes a no longer necessary include.

See #922

Signed-off-by: krisalpha <choprakrishan61@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-12 10:35:28 -08:00
Sebastian Kügler
9fc19039df Better behavior for dive details flicking
- stop at bounds, this is in line with other flickables. I really
  don't like Flickables floppy default behavior to allow dragging and
  scrolling over the bounds.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-12 07:10:52 -08:00
Dirk Hohndel
877efebaac Merge github.com:sebasje/subsurface 2016-01-11 18:15:35 -08:00
Dirk Hohndel
3c8f7d72a2 Remove excessive debugging output
Now that GPS tracking seems fairly stable, let's quiet down the chatter.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 18:14:14 -08:00
Sebastian Kügler
142c8b218b Fix bugs in edit drawer
- As the list may get reset on save, the dive_id effectively changes
  since currentItem isn't updated. So after editing, we end up with a
  different currentItem than visible. This is very unintuitive, but
  has to do with the model resetting. It would result in the edit view not
  showing the current dive when opened the second time. Let's make sure
  that out currentItem is always the visible one before we're filling
  the data into the edit page.
- Close the drawer when we're navigating away from the dive item, for
  example when hitting the back button.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-12 03:06:09 +01:00
Sebastian Kügler
ae0f680c6e Kill warning
Apparently parent.height is negative sometimes.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-12 03:06:09 +01:00
Sebastian Kügler
6540e95425 dive details navigation
This patch reworks the navigation of the dive details.

- The detailsview is now a list view with page-sized delegates. This
  allows horizontal swiping to the next and previous dive.
- The central button now allows to open the edit mode for the dive.

Original patch was done by Marco Martin, but needed to be reapplied by
hand.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-12 03:06:09 +01:00
Tomaz Canabrava
f767d1d489 Split PartialPressureGasSettings with TechnicalDetailsSettings
It was becomming too big, a smaller class is nicer to work wirh

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:47:07 -08:00
Tomaz Canabrava
752a03eeb1 Finish PartialPressureGasSettings
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:47:07 -08:00
Tomaz Canabrava
0cfd687799 Implement missing signals for PartialPressureGasSettings
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:47:07 -08:00
Tomaz Canabrava
e897d2c463 Implement more reader accessors for PartialPressureGasSettings
Also, the QtHelper.cpp file told me that some propertiies
where also TecDetails, graph related, so I moved them
to the correct preferences.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:47:07 -08:00
Tomaz Canabrava
525fe51f5d Implement the methods for PartialPressureGasSettings
I didn't allowed the build on CMake for those files yet because
there will be tons of breackage, so when I finish, I'll allow.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:47:07 -08:00
Tomaz Canabrava
ec01fcda5b Start the SettingsObjectWrapper - a QSettings helper for QML
This class needs to have all settings in Q_PROPERTIES
so it can be used in QML. I know we will not use all of the
settings in a visible way for the user on the QML app, but
we might increase things in the future and on different
form factors so it's good to be prepared.

Currently I implemented all of the possible properties, but
I still need to hoock up everything.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:47:07 -08:00
Tomaz Canabrava
abd05f0d21 Simplify: remove weigths and cylinders.
This finishes the first round of Simplication patches for the QML
basecode. The second one will be about the preferences.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:47:07 -08:00
Tomaz Canabrava
7a740d25a8 Simplify: return date and time directly
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:47:07 -08:00
Tomaz Canabrava
3a72699bfd Simplify: remove the gas variable
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:47:07 -08:00
Tomaz Canabrava
28f4e12725 Simplify: remove variable tags
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:47:07 -08:00
Tomaz Canabrava
9f4bc61f62 Simplify: remove SAC variable
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:47:07 -08:00
Tomaz Canabrava
04704d02c8 Simplify: remove gps variable
And also use existing helper function to get the GPS string

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:47:07 -08:00
Tomaz Canabrava
e2bc3b0e24 Simplify: remove m_notes variable
I didn't understood the logic of the define & replace,
so maybe we want a few comments there.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:47:07 -08:00
Tomaz Canabrava
6f95242ff1 Simplify: remove Maxcns and OTU variables
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:46:59 -08:00
Tomaz Canabrava
75561ff956 Simplify: remove suit and trip
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:46:20 -08:00
Tomaz Canabrava
8929d6eb1a Simplify: remove waterTemp variable
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:46:12 -08:00
Tomaz Canabrava
8e8c32d26e Simplify: removed buddy and airTemp variable
also fixed a bug on the depth

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:46:12 -08:00
Tomaz Canabrava
a6796d9c80 Simplify: removed divemaster
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:46:11 -08:00
Tomaz Canabrava
0bb661c3e1 Simplify: removed duration and depth variables
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:46:11 -08:00
Tomaz Canabrava
ae222f147c Simplify: removed location variable
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:46:11 -08:00