aboutsummaryrefslogtreecommitdiffstats
path: root/subsurface-core/subsurface-qt
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-03-07Silence warnings in SettingsObjectWrapper.cppGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03Avoid dangling else warningsGravatar Dirk Hohndel
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-25Don't use "get_volume_string()" for cylinder size stringGravatar Linus Torvalds
We had two totally different usage cases for "get_volume_string()": one that did the obvious "show this volume as a string", and one that tried to show a cylinder size. The function used a magic third argument (the working pressure of the cylinder) to distinguish between the two cases, but it still got it wrong. A metric cylinder doesn't necessarily have a working pressure at all, and the size is a wet size in liters. We'd pass in zero as the working pressure, and if the volume units were set to cubic feet, the logic in "get_volume_string()" would happily convert the metric wet size into the wet size in cubic feet. But that's completely wrong. An imperial cylinder size simply isn't a wet size. If you don't have a working pressure, you cannot convert the cylinder size to cubic feet. End of story. So instead of having "get_volume_string()" have magical behavior depending on working pressure, and getting it wrong anyway, just make get_volume_string do a pure volume conversion, and create a whole new function for showing the size of a cylinder. Now, if the cylinder doesn't have a working pressure, we just show the metric size, even if the user had asked for cubic feet. [Dirk Hohndel: added call to translation functions for the units] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> 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-14Grab pressures from samples if requiredGravatar Miika Turkia
If cylinder does not have start and end pressures assigned, attempt to grab them from the samples instead. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-14Test cylinder usage properlyGravatar Miika Turkia
It is better to use the proper function to test if cylinder is in use than just checking the description. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> 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-02-05Simplify sumWeight functionGravatar Dirk Hohndel
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-25Fix bug on the visibility of the Ruler GraphGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25Changed quite a few shorts to bool on the c++ implementtionGravatar Tomaz Canabrava
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-25Start to use the QSettings ObjectWrapperGravatar Tomaz Canabrava
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-24Make it compileGravatar Tomaz Canabrava
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-24Finalize the SettingsGravatar Tomaz Canabrava
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-24Remove prefs already implemented.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-24Language Settings WrapperGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-24Added Display SettingsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-24Added a GeneralSettingsWrapperGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-21Return a value when getting SAC rateGravatar Dirk Hohndel
Obvious "mass edit" error. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: implement the unit settingsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: unit systemGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: dive planner preferencesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: add PlannerSettingsGravatar Tomaz Canabrava
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-15Settings QObjectification: cloud storage preferencesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: finish network preferencesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: start Proxy QObject configGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: some cleanupsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: geocoding preferencesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: minor cleanupsGravatar Tomaz Canabrava
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-15Settings QObjectification: Facebook settingsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Split PartialPressureGasSettings with TechnicalDetailsSettingsGravatar Tomaz Canabrava
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-11Finish PartialPressureGasSettingsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Implement missing signals for PartialPressureGasSettingsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Implement more reader accessors for PartialPressureGasSettingsGravatar Tomaz Canabrava
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-11Implement the methods for PartialPressureGasSettingsGravatar Tomaz Canabrava
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-11Start the SettingsObjectWrapper - a QSettings helper for QMLGravatar Tomaz Canabrava
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-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>