aboutsummaryrefslogtreecommitdiffstats
path: root/subsurface-core/subsurface-qt/DiveObjectHelper.h
AgeCommit message (Collapse)Author
2016-04-04Move subsurface-core to core and qt-mobile to mobile-widgetsGravatar Dirk Hohndel
Having subsurface-core as a directory name really messes with autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an autocomplete conflict and also was inconsistent with the desktop-widget name for the directory containing the "other" UI. And while cleaning up the resulting change in the path name for include files, I decided to clean up those even more to make them consistent overall. This could have been handled in more commits, but since this requires a make clean before the build, it seemed more sensible to do it all in one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-29DiveHelperObject: add the weightList and cylinderList propertiesGravatar Lubomir I. Ivanov
"weights" and "cylinders" are QStringList Q_PROPERTIES, and Grantlee should be able to render them, but it doesn't. To be able to print the whole list of weights and cylinders we introduce two new QString properties "weightList" and "cylinderList". The variable replacement in the previous patch deals with the conversation of the user side HTML, e.g.: USER -> INTERNAL "{{ dive.weights }} -> {{ dive.weightList }}" "{{ dive.cylinders }} -> {{ dive.cylinderList }}" Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-14Add dive property to easily test if there isn't an actual diveGravatar Dirk Hohndel
Right now this just tests for zero duration, but maybe this should also return true for positive duration and max depth of 0. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-13Add helper function to retrieve first gasGravatar Joakim Bygdell
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09QML UI: add function to get cylinder pressuresGravatar Joakim Bygdell
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-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-01-27Move helper function to DiveObjectsHelperGravatar Joakim Bygdell
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-26QML UI: don't combine multiple trips to the same location into oneGravatar Dirk Hohndel
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-11Simplify: remove weigths and cylinders.Gravatar Tomaz Canabrava
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-11Simplify: return date and time directlyGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Simplify: remove the gas variableGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Simplify: remove variable tagsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Simplify: remove SAC variableGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Simplify: remove gps variableGravatar Tomaz Canabrava
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-11Simplify: remove m_notes variableGravatar Tomaz Canabrava
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-11Simplify: remove Maxcns and OTU variablesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Simplify: remove suit and tripGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Simplify: remove waterTemp variableGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Simplify: removed buddy and airTemp variableGravatar Tomaz Canabrava
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-11Simplify: removed divemasterGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Simplify: removed duration and depth variablesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Simplify: removed location variableGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Simplify: removed timestamp variableGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Simplify: remove uneeded variable, rating.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Simplify: remove uneeded variable: idGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Simplify: QML code handling seriesGravatar Tomaz Canabrava
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-11Random whitespace cleanupGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Fix potential compile errorGravatar Dirk Hohndel
This compiled just fine for me but apparently the QStringList needs to be explicitly included on Ubuntu 15.10. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08Move Dive class from qthelper.h/cpp to it's own fileGravatar Tomaz Canabrava
and rename it to DiveObjectHelper, since it should be an QObject based class to make it easier on the QML, grantlee and widgets side to display the dive's internal data. each Q_PROPERTY defined in the DiveObjectHelper.h file can be acessed directly via it's name. So, if you are on a model that returns a dive, acess it's name by dive.name Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>