DiveCalculatedCeiling is the last class the references
MainWindow in the profile-widget stack.
In modelDataChanged() it looks for the information()
widget and sets a slot for the dateTimeChanged() signal that
information() emits.
To solve the issue we make DiveCalculatedCeiling recieve
a ProfileWidget2 reference and make ProfileWidget2 emit
the dateTimeChangedItems() signal.
ProfileWidget2 itself listens for the dateTimeChanged()
signal that information() emits and emits dateTimeChangedItems()
to notify any possible children/item listeners in the
ProfileWidget2::dateTimeChanged() slot.
The connection between ProfileWidget2 and information()
is set in MainWindow. This makes DiveCalculatedCeiling
unaware of MainWindow and which class originally emits
the dateTimeChanged() signal to ProfileWidget2.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
--
Think delegation.
Tomaz, please take a look at this one, to double check
if i messed up.
also i have zero idea how the mobile app is setting these
connections, if it does so even.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
things like:
potentially, for every item interested in 'printMode'
can clutter the profile-widget stack a lot.
instead the items should be aware of the profile widget
instance and not MainWindow.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
DiveCartesianAxis and derivatives can recieve
ProfileWidget2 as an instance in their constructor.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we don't support printing in subsurface-mobile this solves the
problem at hand - but it doesn't do what we really want which is to
untangle the Profile from the MainWindow.
Partial credit.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
And action can't not just trigger a slot, it can also send a signal.
With this there is no reference to the MainWindow left in the profile.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Ummm. What? That one was awesome. This seems easier :-)
MainWindow::instance()->graphics() is a way to retrieve a pointer to the
profile widget...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I don't quite know why these were parented to the MainWindow - I bet
there's a very clever reason that I'm missing...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of directly calling into the MainWindow, redirect this via a
signal so Subsurface mobile can hook it up as needed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I'm not sure we can ever run into this issue anymore since we stop
calculating TTS / NDL past 2 hours, but I guess on a fairly slow CPU this
still could take too long.
But instead of calling into MainWindow let's just change the setting right
here and add a signal to show the notification - that way we can use the
appropriate way to make such notifications on the mobile app.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
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>