Commit graph

54 commits

Author SHA1 Message Date
Joakim Bygdell
f3b35d175a QML UI: add function to get cylinder pressures
Since we only show the first cylinder we can also only edit the first cylinder.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09 12:10:50 -08:00
Dirk Hohndel
ad7fb80d0a DiveObjectHelper: check if dive has only one weightsystem
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-05 22:53:12 -08:00
Dirk Hohndel
535a6b9b25 Simplify sumWeight function
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05 22:52:30 -08:00
Joakim Bygdell
9342dedb26 Move helper function to DiveObjectsHelper
As per Tomaz recomendation the helper functions from 19588ce and e072596
are moved from qmlmanager to DiveObjectsHelper.

[Dirk Hohndel: merged with the latest code]

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 11:18:44 -08:00
Dirk Hohndel
35e60a7355 QML UI: don't combine multiple trips to the same location into one
The way sectioning of the dive list works is by watching for different strings
in the section.property. In order to be able to tell different trips apart we
combine the address of the dive trip variable with the location (which will
create a new section for a new trip, even if the location text is the same) and
then strip that information out before showing the trip header.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-26 20:06:30 -08:00
Tomaz Canabrava
411f455291 Fix bug on the visibility of the Ruler Graph
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25 13:04:39 -08:00
Tomaz Canabrava
2d96139566 Changed quite a few shorts to bool on the c++ implementtion
The shorts where being used on the preferences since a long
while and we cannot just simply change them to bool since this
could break the preferences files, so work around that by
changing them to booleans, since it's the correct type for a
true / false answer.

Also, move some plot curves to the new settings style

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25 13:04:16 -08:00
Tomaz Canabrava
2c5fad73e8 Start to use the QSettings ObjectWrapper
start of the QSettinsg Object Wrapper usage on the code
this first patch removes two macros that generated around
200 lines in runtime for something like a quarter of it
Basically, whenever we changed anything we called the
PreferencesDialog::settingsChanged and connected everythign
to that signal, now each setting has it's own changed signal
and we can call it directly.

The best thing about this approach is that we don't trigger
repaints for things that are not directly profile related. (
actually we still do, but the plan is to remove them in due time)

this commit breaks correct atualization of the profile (because
everything was connected to PreferencesDialog::settingsChanged)
and now I need to hunt a bit for the correct connections

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25 13:04:01 -08:00
Tomaz Canabrava
fd175e8781 Make it compile
This is not hoocked up on Subsurface code yet, but it's already
being compilled. now I just need to hoock things up.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-24 21:27:05 -08:00
Tomaz Canabrava
b01bca7953 Finalize the Settings
This was the hammer part of the settings, now I need to make it able to compile ;p

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-24 21:26:57 -08:00
Tomaz Canabrava
ac3ba70fdb Remove prefs already implemented.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-24 21:26:52 -08:00
Tomaz Canabrava
c3137cf07c Language Settings Wrapper
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-24 21:26:45 -08:00
Tomaz Canabrava
15fece7da2 Added Display Settings
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-24 21:26:38 -08:00
Tomaz Canabrava
e7412b11b9 Added a GeneralSettingsWrapper
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-24 21:26:35 -08:00
Dirk Hohndel
6faf33047e Return a value when getting SAC rate
Obvious "mass edit" error.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-21 12:41:40 -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
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
Tomaz Canabrava
8ead18a43a Simplify: removed timestamp 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
Tomaz Canabrava
820cd0c28d Simplify: remove uneeded variable, rating.
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
438b5df089 Simplify: remove uneeded variable: id
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:46:00 -08:00
Tomaz Canabrava
ed97f9f315 Simplify: QML code handling series
The connection between the C++ core and the QML code leaves a lot of room
for improvement; the following series will do small but important updates
on the code regarding QML and QtWidget coexistence and behavior.

First: simplify wrapper class, removing uneeded variable.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11 15:44:10 -08:00