aboutsummaryrefslogtreecommitdiffstats
path: root/profile-widget/ruleritem.cpp
AgeCommit message (Collapse)Author
2021-01-10profile: pass dive to RulerItemGravatar Berthold Stoeger
Instead of accessing the global displayed_dive variable in RulerItem, pass the dive. This is a step in making the profile reentrant. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-12preferences: create global settingsChanged signalGravatar Berthold Stoeger
So far, the PreferencesDialog emitted a settingsChanged signal. This meant that models that listened to that signal had to conditionally compile out the code for mobile or the connection had to be made in MainWindow. Instead, introduce a global signal that does this and move the connects to the listeners to remove inter-dependencies. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-11-09Profile: change get_plot_pressure to take index instead of pointerGravatar Berthold Stoeger
The goal here is to make it possible to detach the pressure related data from the plot_info structure. Thus, the pressure related data can be allocated independently depending on the number of cylinders per dive. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-11-09Profile: Change RulerItem2 to use index instead of pointerGravatar Berthold Stoeger
To make the pressure data dynamic (size of the arrays depending on the cylinders in the dive), it has to be separated from the standard plot_data structure. To enable this, use indexes instead of pointers to plot_data elements. This commit converts the RulerItem2 to use an index. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-08-28Profile: properly initialize plot_info structuresGravatar Berthold Stoeger
The create_plot_info_new() function releases old plot data. This can only work if the plot_info structure was initialized previously. The ProfileWidget2 did that by a memset, but other parts of the code did not. Therefore, introduce a init_plot_info() function and call that when generating a plot_info struct. Constructors would make this so much easier - but since this is called from C, we can't use them. Fixes #2251 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-03-19Cleanup: pass const-reference to RulerItem2::setPlotInfo()Gravatar Berthold Stoeger
Instead of passing a pointer, pass a cons reference. This is more idiomatic and consistent with RulerNodeItem2::setPlotInfo(). Also make the reference passed to RulerNodeItem2::setPlotInfo() const, to make clear that the argument is copied. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-03-18Profile: pass by reference rather than by value for large structGravatar Robert C. Helling
Addresses LGTM.com suggestion. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-11desktop/profile-widget: update signal from _changed to ChangedGravatar jan Iversen
Update connect calls to use Changed from qPref, due to QML demands Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-15profile-widget: remove SettingsObjectWrapper and update qPref callsGravatar jan Iversen
remove use of SettingsObjectWrapper:: remove include of SettingsObjectWrapper.h use qPrefFoo:: for setters and getters replace prefs.foo with qPrefXYZ::foo() where feasible (this expands to the same code, but gives us more control over the variable). Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-12core: activate qPrefTechnicalDetailsGravatar jan Iversen
remove TechnicalDetails from SettingsObjectWrapper and reference qPrefTechnicalDetails update files using SettingsObjectWrapper/TechnicalDetails to use qPrefTechnicalDetails this activated qPrefTechnicalDetails and removed the similar class from SettingsObjectWrapper. Signed-off-by: Jan Iversen <jani@apache.org>
2017-04-29Add SPDX header to profile widgetsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-24Fix double to int truncation in C++ codeGravatar Jeremie Guichard
Wfloat-conversion enabled for C++ part of the code Fix warnings raised by the flag using lrint Original issue reported on the mailing list: The ascent/descent rates are sometimes not what is expected. E.g. setting the ascent rate to 10m/min results in an actual ascent rate of 9m/min. This is due to truncating the ascent rate preference, then effectively rounding up the time to reach each stop to 2s intervals. The result being that setting the ascent rate to 10m/min results in 20s to ascend 3m (9m/min), when it should be exactly 18s. Reported-by: John Smith <noseygit@hotmail.com> Reported-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
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-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>
2015-11-06Don't connect to the PreferencesDialog in Subsurface-mobileGravatar Dirk Hohndel
Just more untangling from the desktop UI. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06remove some mainwindow.h includesGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-02Preferences: Remove the old dialog and use the new oneGravatar Tomaz Canabrava
The new preferences dialog still needs a bit of fine tuning but should already work. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30Move Profile widget out of desktop-widgetsGravatar Tomaz Canabrava
The reason for that is, even if profile widget is made with qpainter and for that reason it should be a desktop widget, it's being used on the mobile version because of a lack of QML plotting library that is fast and reliable. We discovered that it was faster just to encapsulate our Profile in a QML class and call it directly. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>