Every time I edit main.qml, QtCreator fixes this for me. And then I filter it
from the commit to not mix white space and actual changes. So let's just get
this fixed and move on.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a partial revert of commit 99438121c4 ("mobile/dive-edit: use template
components and theme colors")
Clearly the information given in the Qt documentation on how to theme ComboBox
is flat out broken. The trade-off between 'better dark theme' and 'broken user
experience' is fairly easy to make.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I could have sworn that I have fixed this several times in various places,
but apparently (as shown by todays support emails) it's still possible to
setup a mixed case email address. So let's try to solve this problem at
the very top.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In analogy to the timestamp -> QDateTime conversion, create a
common function.
1) For symmetry with the opposite conversion.
2) To remove numerous inconsistencies.
3) To remove use of the deprecated QDateTime::toTime_t() function.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Another small step to make the dark theme at least marginally useful.
We now use our template components and add the necessary elements to have
consistent text color.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I noticed that the download from dive computer page looked especially bad
in the dark theme (a user sent us some screenshots for a different reason)
and a quick look at the sources showed that we weren't using our template
label. Switching to that gives us the correct size by default so we can
drop all those explicit font size parameters. And we get the correct color
as used in the theme.
One random whitespace cleanup snuck into this commit. Oh well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
So far the user can't edit them, but at least they are now shown as
part of the dive details. Usage of tags varries widely, I've seen
people who use a LOT of tags to classify their dives, so I'm giving
this a complete row by itself.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes better use of the screen real estate, without (IMHO) seeming
too crowded. This is a tough balance to strike.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Our labels all seem to have a lot of empty vertical space around them.
Try to be a bit more conservative with space.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
By default single line text has too much white space around it. This
smaller, denser label works well to more efficiently use screen real
estate, I think.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
To reset the core data structures, the mobile and desktop UIs
were calling into the dive-list models, which then reset the
core data structures, themselves and the unrelated
locationinformation model. The UI code then reset various other
things, such as the TankInformation model or the map. . This was
unsatisfying from a control-flow perspective, as the models should
display the core data, not act on it. Moreover, this meant lots
of intricate intermodule-dependencies.
Thus, straighten up the control flow: give the C core the
possibility to send a "all data reset" event. And do that
in those functions that reset the core data structures.
Let each module react to this event by itself. This removes
inter-module dependencies. For example, the MainWindow now
doesn't have to reset the TankInfoModel or the MapWidget.
Then, to reset the core data structures, let the UI code
simply directly call the respective core functions.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
It appears that some misguided compiler / library combinations crash
on &vector[0] for empty vectors. Even though very unfriendly, they are
technically correct, so let's remove these constructs.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Calling qApp->processEvents() in QMLManager::setNotificationText()
caused crashes, because it could lead to the context-menu that
initialized the call being deleted. Something that QML apparently
doesn't like.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
On startup, we showed progress of the population of the fulltext
and listmodels for every 100th dive. This worked by overwriting
the last line if the new line started with '\r'. Since we don't
do that anymore, we can remove this special case.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
If the user switches away from Subsurface-mobile and back while we are
in our initialization phase, that code might run more than once leading
to undesirable results.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The strange enum casts (that apparently we needed in order to have strongly typed
enums in QML) are really ugly and confusing in the code. Since we had this three
times it seemed worth to create a little helper that hides this nonsense.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We know that we have valid credentials, so calling openLocalThenRemote()
makes no sense, worse, it doesn't respect the special case of
transitioning between accounts. That's the whole point of having a
separate loadDivesWithValidCredentials() call.
Once we have transitioned state, we need to record the now current state
as the old state so that future transitions will work.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The noCloud variable contains our desired state, we need to test for the
previous state for this to make sense.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We haven't supported the GPS web service for a long time.
Also, add another message for the log to be able to more easily trace
one error case.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we're using the undo stack for determining the whether there are
unsaved changes, we have to mark the undo stack as clean after save.
This duplicates code from desktop. It is planned to unify this in
the near future.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
In analogy to desktop, also consider the state of the undo-stack when
testing for unsaved changes. This prevents us from missing changes.
This adds duplicate code, which will be unified in the near future.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
These appear to be the only cases where we forgot to ensure data is
saved. And pastDiveData is currently not called as the UI to use it has
been removed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The code was using the pre-editing dive site name, which appears
weird. Not sure if that was on purpose.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
QMLManager::checkLocation() would only return true if the
dive-site itself was changed, not if the dive-site was set
to a different site.
Thus, in some cases edit events could be lost.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Calling saveChangesLocal() seems like the right thing to do, but it
doesn't do anything useful if the dive list hasn't been marked as
changed. The correct helper function to call is changesNeedSaving()
which makes sure we save the changes and update all UI information.
[Berthold: since this removes the last QML caller of saveChangesLocal()
we can make that function private.]
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This way the launch screen is shown significantly shorter on a device,
and instead the user sees our progress notifications.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This test makes no sense on other platforms (and the log file text is
frankly confusing when not running on Android).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We have convinced ourselves that only the main thread will ever trigger
a save operation, therefore the locking is not needed (and it has
recently started to cause user problems where local changes aren't saved
to storage and get lost).
Fixes#2718
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
QML documentation recommends against using the cacheBuffer for longer
lists and doing more testing shows that this really doesn't help at all.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Small optimization that reduces the number of accesses to the underlying
model. Instead of evaluating the isInvalid member eight times per
delegate, we only check it once.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Without this check we'll show the 'Please tap the plus botton...'
notification during app initialization as we are showing the initial set
of messages - which makes no sense.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of not showing a notification until after we are done loading
the data into our models, tell the user that we are about to do that.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Until the app is initialized, we have problems getting the 'floating'
passive notifications to show up and be useful. Instead update the user
by filling a text block on the otherwise empty initial page of the app.
Delay the switch to the dive list until the app is initialized and then
use the passive notifications again. While we are initializing also show
a busy spinner so the user doesn't think the app is hung.
As a side effect of this change, the dive list isn't shown until our
models are initialized. And strangely this causes every single possible
delegate to be instantiated. We can prevent that by not setting the dive
list model until after we are done setting up the model.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This simply passes the text to the existing notification text mechanism.
The call to processEvents() ensures that Qt processes the UI events
after we updated the notification and that the user gets timely updates;
otherwise the UI might look like the app is hanging.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When editing the dive site of a dive, the dive-table of the
corresponding dive site was not properly updated by the undo
commands. Try to get this right.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This was triggered by a change in enabled, but what is really changing is
the visible property. This should work better.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Especially on smaller screens we had issues fitting this on the screen.
And it looks fine on larger screens as well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This was using the myData alias that exists in the dive list but not on
the dive details. This might work (because the models both use the same
underlying base model), but given that we are using the currentItem of
this ListView, I'm guessing that this would just silently fail (maybe
with a warning in the log).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A second tap on the back button will then end add/edit or close the dive
details and get us back to the dive list.
This fixes an issue where tapping on back with the context menu open
would bring you back to the dive list with the context menu still open,
and because then change the text in the context menu as those are
designed differently.
Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The
- mergeLocalRepo()
- openLocalThenRemote()
functions were not invoked from outside QMLManager.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
QMLManager::changesNeedSaving() behaves differently on iOS:
it only saves locally with saveChangesLocal(), whereas all
other OS save to cloud with saveChangesCloud(). Nevertheless,
even for other OS saveChangesLocal() is called even though
that will be called in saveChancesCloud anyway. Therefore,
compile the saveChangesLocal() call in changesNeedSaving
conditionally.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
At least in 4.9.3.1258/3.0.1 I was able to reproduce a situation where I
edit one dive, go back to the dive list, then tap on a different dive
and then the keyboard pops up, obscuring a big chunk of the screen.
This tries to make sure the keyboard isn't shown in dive view mode.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There are two places where we try to prevemt unintended app exits.
Once, in the onBackRequested signal handler on the dive list. This was
missing special handling for the situation where one of the drawers was
open.
The second place is the onClosing signal handler in main.qml. Naively I
thought that this was enough to catch all cases where we were about to
exit the app, but apparently an explicit manager.quit() is a bit too
forceful and doesn't get to that signal handler.
With this commit we check for open drawers in both places. Belts and
suspenders, I guess.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
You can already get to the map by either clicking on the location text
or on the left action button. This third way to get there reduces the
available space for the location text, and can cause positioning issues
with very long location texts creating three or more lines of text,
which then overwrites the dateRow below.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The compiler complained that we were passing a float to the
QFont::setPointSize() function, which expects an integer.
Solve this by using the QFont::setPointSizeF() function.
This might introduce a user-visible change, albeit very unlikely:
We now may set the point-size to a non-integer number.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The compiler complains that members were initialized out-of-order.
Even though this is not an issue here it is correct to emit a
warning, since only then it is guaranteed that the objects are
destructed in reverse-order with respect to construction.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Some slots in QMLManager were not called from the outside, some
only directly from C++-code. Make the former private and the latter
public member functions.
The idea here is to document which functions are actually called
from the outside and which are called from QML or connected to
signals.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
There appears to be no reason for two-phase initialization.
Let's keep things simple: let the constructor produce a
functioning object.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
According to the Qt-docs you *may* send the new values in the
NOTIFY signal of Q_PROPERTYs. However, since changes will lead
to a reevaluation of a whole expression, this argument will be
unused. All it does is make the code more verbose and brittle:
What happens if you send the wrong value?
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
We have a singleton class ThemeInterface, which means that it
is global and exists only once. It's members are static, i.e.
also global. A message from the department of redundancy department?
In any case, that makes no sense. Let's just make these members
local to the class.
I would even rip out the whole singleton thing, since the object
is not accessed anywhere outside from QML. Let's keep it for now.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
An Android user might reasonably assume that they can use the back button to
close the global or context drawers. So act accordingly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This should deal with the rather confusing 'No dive in dive list' shown
while loading and processing the dive list.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since apparently the header property of the ListView isn't reliably
making sure that our filter input line is visible, let's move the filter
header to be it's own visual element and manually manage the
relationship between that and the ListView.
The obvious idea was to anchor the ListView to the bottom of the
filterHeader, but that didn't work in my tests. So instead we are using
the topMargin to make sure that there is space to show the header.
Because this re-indents the whole filterHeader, 'git show -w' gives a
much better idea what this commit actually changes.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of the crude and error prone bool, let's just use the right tool
for this job.
In order to avoid issues with a goto across a mutex boundary, this
slightly restructures the code in one place - 'git show -w' makes it
clear that this is really rather simple in its changes.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I'm suspicious that an issue that some people have seen around changes
not being saved is caused by our handling of alreadySaving.
When starting with Subsurface-mobile in no-autosync mode, we were able
to end in a scenario where alreadySaving was true, even though there
were no unsaved changes. And in that case no changes made during such a
session were saved unless the user forced a manual sync with the server.
This commit radically changes our approach to handling the flag. It
moves it right next to the actual calls into code that could modify git
storage, and ensures that the flag can never stay set.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This was disabled in the past because it was deemed to slow. A lot
of time has passed, since. Maybe on current phones / iPads this is
acceptable again?
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds a context menu entry for top level dives that allows the user
to create a trip for that dive.
Unfortunately this creates a new string to translate right before a
release...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we start adding a dive, we actually create a diveAdd undo command
so we have a dive that the user can edit. Which means we need to undo
this action if we cancel.
Also, for a more consistent UI, we should pop the dive details page that
we used to edit this dive and bring the user back to the dive list.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We still used pageStack.push() all over the place.
Also, in showPage, disable the map hack if the user actively picks a
different page.
This should fix an issue where the user picked the map and then tried to
add a dive to the dive list - and instead of the dive edit was shown the
map again.
Reported-by: Hartley Horwitz <hhrwtz@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It's possible for our code to think that the user wants to pan the
profile before realizing that the user actually is making a pinch
gesture. In that case the profile could get stuck in semi-transparent
mode. This prevents that from happening by explicitly resetting the
opacity to 1.0 when we start a pinch.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
And allow touchpad gestures to be recognized as well. This has no
negative impact on the mobile platforms, but makes it much easier to
test profile scaling / panning on the desktop.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way someone trying to swipe from dive to dive won't inadvertantly
pan the profile instead. And panning it really only makes sense when
zoomed in in the first place.
This could leave us in a situation where we zoom in, pan, zoom out and
now the profile is out of whack and we cannot correct it. A simple click
on the profile fixes that.
The real solution would be some constraining / adjusting as we zoom and
pan to ensure we keep things correctly positioned. Maybe I'll figure out
the correct way to do this later...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I would love to figure out a way how to bundle the user manual and load
it from the device file system, but in the meantime this should continue
to work.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The hardcoded widths with fixed values was just flat our broken and
created all kinds of strange artifacts.
But even with this somewhat more idiomatic approach this still isn't
perfect - on wider screens it doesn't shrink back to the minimum column
width. But that seems like a bit of a corner case. Overall this feels
like a huge improvement.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The number of possible sequences of events when the user is connecting a
USB device is rather surprising. These changes try to ensure that in
every case we get USB connection information we do in fact show the
correct (or best guess) connection.
See #2686
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The location information model is updated automatically by the
divelist-model and the undo commands. Therefore remove the
QMLManager::updateSiteList() function. We do have to keep
the locationListChanged() signal though, because the list
of dive sites is not exported via model/view but rather via
a Q_PROPERTY. We really should change that.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The git parser loads into the global dive table, even if it
is called indirectly via parse_file(). However, parse_file()
may be given a different table. Fix this by extending the
git parser state.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
While I remember some of the thinking that went into doing things this way,
the more I read the code, the less it makes sense to me.
This is a rather drastic step, but in reasonably extensive testing it seems
to work in every case that I tried.
That's rather embarrassing, actually.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When editing a dive on mobile we might have to create a new
dive site. That site is added to the global dive site table
in the undo command. However, the code in QMLManager created
the dive site with create_dive_site*() functions, which already
adds it to the table. The undo command then added the dive
site again leading to a hang of the application.
To solve this problem, create new alloc_dive_site*()
functions that do the same as create_dive_site*()
but do not add it to the table.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This seems to make more sense than to not select anything (which was the
previous behavior).
If the same connection is still available, select it again. Otherwise
pick the top connection (which is the right thing to do if the user has
just plugged in a USB device and refreshes the list -- that device will
show up as top entry).
Based on a suggestion by Christof Arnosti <charno@charno.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes sense because USB devices will only show up when connected,
while BT/BLE will get listed once they are paired, even if not currently
connected. So the higher likelihood of being the device a user is looking
for is for any USB devices that show up, so those should go first.
Suggested-by: Christof Arnosti <charno@charno.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of relying on the std::vector staying unchanged and not freeing
its members, instead keep a copy of the object in our DCDeviceData class.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the user tries to download from a device that he hasn't given the app
permission to read from, Android will pop up a dialogue asking for that
permission. With this after giving the permission we continue (well,
technically, restart) the download which is likely the expected behavior.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The usbRescan() code is smart enough not to duplicate entries that might
already be there. And with this the user doesn't have to manually tap
rescan if they didn't open Subsurface-mobile via the intent after a
device was plugged in.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way even if a USB device wasn't added through an Android intent, we
still have a way to scan for it and select it. This is especially
important in case a user has a cable that we haven't seen yet (i.e. with
a VID/PID that we haven't added to Subsurface-mobile), but that
nevertheless works with the android usb serial drivers.
This also makes the flow a little more logical / consistent when
deciding which connections to show.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This finally allows us to download from not just the first device, but specifically
the device that the user picks.
Passing the object through a void pointer is not nice - but since this traverses
C code other solutions (like passing an index into the list) seemed even worse.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This vastly simplifies our handling of devive information as we simply use
what is already in the descriptor. This way we do not duplicate information
about USB devices in the QMLManager.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we explicitly open the download page after the use plugged in a USB
device, don't try to use guesses from the BT/BLE pairings to populate
the device/connection dropdowns.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This just removes broken code. That file select dialog is still just a very
strange idea and should be revisited at some point.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This was a merge error in the dive list rewrite and brought in a code block that
had moved, which caused issues with correctly switching to the dive list.
Calling setupActions() moves to the diveListView (where it really belongs).
Instead of messing with the visibility of components of the same page, we now
simply switch out the shown page.
Fixes#2667
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A number of our messages were misleading in the no cloud case. This should help
to reduce confusion.
Adding the save_dives() call after creation of the repo appears to help us have
a valid repo in place.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Grammar-nazi ran
git grep -l 'indexes' | xargs sed -i '' -e 's/indexes/indices/g'
to prevent future wincing when reading the source code.
Unfortunatly, Qt itself is infected as in
QModelIndexList QItemSelection::indexes() const
Signed-off-by: Robert C. Helling <helling@atdotde.de>
The HID devices and the Atomics Aquatics Cobalt cannot work on Android
right now. We should claim to support them.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I will (mis)use these for moving dives out of trips and to the trip above or
below and of course for undo/redo. And the weirdest one is the 'local offer'
icon that seemed a reasonably good fit to edit trip details.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The logic when we show the save button is a little fragile (and visually I'm not
sure I love the disabled button), but hey, this works.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This creates up to two undo events. This seems like such a small issue that
it's not worth creating yet another undo command for this.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For now this only shows the trip details. They can be edited on the page, but
there is no way to save those edits, yet.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While this has worked fine for a long time, it now suddenly seems to trigger
crashes. So let's not do that (there are a number of discussions online that
talk about how this could indeed lead to BadThings(tm) happening.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way one can execute dive list manipulations without the detour
to the dive details screen. For example you can long-press on a dive and then
add it to a trip or remove it from a trip.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The default policy closes the context drawer if there is a button release
outside the context drawer area. That messes with the intended UI. For us a
much more useful behavior is to have the next click outside of the drawer close
the drawer.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This one exposes undo/redo as well as some basic trip manipulations, very similar
to what's already available on the dive details page. Except that here it also
makes sense to add a selected dive to a trip above or below (if those exist and
the dive isn't already in a trip).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Right now this is only available on the DiveDetails screen. The menu entries
are only enabled if there is such a trip to add the dive to (and if the dive
isn't already part of a trip).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we remove the newest dive from its trip, it becomes inaccessible in the app,
but the dive data saved to disk appears to be correct.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In add and edit mode this is confusing and wrong.
There is a bug in Kirigami that creates lots of bogus error message about
missing mainFlickable. That needs to be patched out.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In some situations we ended up with the wrong location name. One way to
reproduce the problem was to edit an existing dive location to be a substring
of an existing location name. Save the dive, then immediately edit it again.
The wrong location would be filled in.
The code here looks strange and unnecessary, but it seems to fix the issue.
The aliases don't seem to make the code any easier to understand. This replaces
them in the case of the location combo box with direct accesses to the data on
the DiveDetailsEdit page. It may be worth removing all of them. The
locationModel alias was unused.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we are using the existing command infrastructure, this isn't specific to
undoing a delete.
This commit renames the function and removes its use in the UI, the next commit
will then add the generic undo to the UI.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since the divelist model is now placed on top of the common
models, we can directly reset the filter.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Command that just swaps two dives. This is rather complex,
as for example a dive site might be created.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This still has an odd bug. When we swipe the dive details to change the
selected dive and that action causes a trip to expand or collapse, then
the color change / highlight in the dive list isn't updated correctly,
even though the log file indicates that we made the necessary changes.
This also changes the coloring of the selected dive; having the same coloring
as a trip was very confusing. This is a bit stark, but it clearly communicates
the distinction.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The whole load from cloud thing will have to be audited. It appears
to me that there are way too many model resets...?
The only thing that is left is dive editing. Let's do that next.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Instead of using the model, copy the code we have in the desktop version
which manually creates a 15m/40min dive and passes that to the addDive
undo command.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
After swiping through the dive list, select the currently visible dive.
Thus, the dive is highlighted in the overview pane.
The connection with the QMLManager feels atrocious, but I would prefer to have
as little logic in QML as possible.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The currently shown dive is now controlled by the core.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
MobileSwipeModel is probably not an ideal name, but all I could come up with.
One of the main complications here is that our list is reversed with respect to
the source model. We should change that one day. Probably by moving the
sorting down to the core-model.
Since looking up the source row is somewhat expensive, the lookup is cached for
a single entry because accesses come in bursts for a single dive. This should
be a good compromise and avoids keeping track of a full row-to-dive array.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we want to add a second model, but not have to manage two models
everywhere, create a class MobileModels that contains both of the models. When
calling reset() on that class, it will reset both of the models, etc.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
To unify mobile and desktop, let's use the current_dive variable
of the core to indicate the current dive.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a small step in unifying mobile and desktop.
I'm unsure whether it is correct to play this via the QMLManager or whether we
should call form QML directly into the model?
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This obviously breaks everything, but now we can start fixing
things.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The goal is to send the signal for the correct dives / divesites
and thus not having to reload the whole model.
Right now the mobile UI does not yet catch the diveSiteChanged signals.
[Dirk Hohndel: small fix to ensure that we trigger a save to storage]
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Still buggy: Removing a dive followed by undo shows the wrong dive
in the list. But clicking on it gives the correct dive.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This isn't perfect yet, but it looks fairly reasonable.
This commit was mainly written by Dirk, but includes a few fixes from Berthold
which where squashed into this commit as they really should have been part of
the initial version.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Don't just pop the top page off the stack, but pop the download page.
Also explicitly switch to the dive list afterwards.
Additionally, fix a typo in the code that attempts to deal with the
shortcut buttons. I believe that right now this code is completely
broken, but while I contemplate how this should work, let's at least fix
the stupid typo.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The macro NOCLOUD_LOCALSTORAGE creates the path to the local git
repository as a C-string. None of the users were freeing the string
and thus leaking memory.
Replace the macro by an inline function that creates a QString
and pass down to C-functions using the qPrintable() macro.
Note that every qPrintable() invocation does a UTF16->UTF8
conversion. This could be avoided by either using a std::string
or a QByteArray. However, we are talking about microseconds of
CPU time in operations that typically take seconds. Not worth
it.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
If we detect any of the known PID/VID combinations, use 'usb-serial' instead of
'FTDI'. Also add the now supported additional PID/VID combinations.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
At least in those cases where we are sending a divesChanged signal we can
easily check if the cache was properly invalidated. Of course this won't help
in cases where we don't notify the dive list about changes, either.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We no longer have a dive role - on the plus side, we also don't use this
variable, so I guess this isn't a big deal.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a quick hack to reduce the noise in the log file when chasing other
bugs. Maybe this should not be enabled on release builds, but right now I don't
think the harm that having this in would do.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While this is disabled and is unlikely to be completed, the typo caused
confusion with translators.
This shows one of the weaknesses of the way we set up our translations, in that
always both desktop and mobile are translated together, and disabled code is
also included in those translations, causing unnecessary work for the
translators.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The number of dives was updated when the model of the list was
changed. Since we removed the multi-threading, the model is
not disconnected/connected anymore and therefore we don't get
the appropriate signal. Instead of introducing a different
signal, make the shown-value a Q_PROPERTY. Thus, we can easily
send a changed signal if we have to.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
I experienced weird crashes that seemed timing-related when
using the filter. Therefore, remove the multi-threading thing.
So far no more crashes, but keep a close eye on that.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Add a combo-box where the user can switch between "fulltext",
"people" and "tags" filtering. Connect the combobox to the
already existing filter-code.
Dirk: make combo-box smaller by using a smaller font and restricting
the width. Setting both maximum and preferred widths gives more
consistent results.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use the TemplateRadioButton to get the default styling - and by switching to the
RadioButton from Controls.2 we also get exclusivity by default.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When running mobile on desktop there are some odd jumps in the mouse position while in
drag mode (press and hold, then move). They make the user interface seem jerky.
But I haven't observed the same behavior on the mobile device when testing. So
I'm not sure what to do with that.
Using opacity to indicate that the user is able to pan the profile seems reasonably
obvious; not sure if it's the best possible way to do this.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This should never have been merged as it was. The UI was atrocious and the
functionality was by and large untested.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There is no native file dialog, access to the file system is highly restricted
and will be much more so in Android 11. Let's not even start with this.
This should never have been merged as it was.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A tablet or phone is not a computer. What would you do with a CSV or TeX/LaTeX
file on a phone. Yeah, I get it, feature parity.
This should never have been merged.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This changes the 'GPS' entry to be called 'Location', moves the 'Map' entry
below that, and reuses the map icon for both the map inside this submenu and
for the main menu item.
It moves the 'About' entry under 'Help' and both 'Export' and 'Dive summary'
under 'Dive management'.
This way we have only five (or with 'Developer' enabled, six) entries in the
main menu making it much more appropriate for really tiny screens.
Additionally, the entrieis moved into sub-menus are ones that are not all that
commonly used.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Buttons ignore the width of the enclosed label and base their width on the
illogically named implicitWidth instead.
Also translate the button text.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Creating more space for the header column and a little visual separation for
the different sections.
The commit is much smaller than it looks - try 'git show -w'.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The pointSize() of a font can return -1 if the font was originally specificied
with a pixelSize. Work around this by using QFontInfo to calculate the correct
value.
Additionally, don't use the pointSize() of a font when we can instead use the
calculated size.
This fixes the problem with the missing star ratings on Android.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The 'Map it' button could overlap with the dive number below, depending on font
size. This fixes the issue.
Reported-by: Peter Reinold <mcc.nash@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Corrected typo of the word celsius in three files:
core/import-csv.c
core/divefileter.h
mobile-widgets/qml/Settings.qml
These were spelled as celcius but corrected these to celsius.
The 'core files were just comments but the mobile-widgets file would be
'active' code.
Reported by: tormento <turment@gmail.com>
Signed-off-by: Jason Bramwell <jb2cool@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
exportFunc was a collections of functions for exporting dive data.
It had no state, therefore there is no reason for it to ever be
instantiated.
Simply remove the class. Rename the saveProfile function to
exportProfile so that all export functions start with "export".
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This also deals with a bug we had before where we didn't re-start the calculation
for the various sizes from the assumption of 'at least 21 grid units'. Now you can
rotate the device and the right thing will happen.
Small warning - this checks the orientation of the screen, which is exactly what
you want it to do on your device. When running mobile on desktop this may not be
what you expect. Even if the window has a portrait aspect ratio, your screen is
likely still landscape... so testing this feature in mobile on desktop mode is a
bit harder...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
No one will ask you about your dives in the last seven months (and the
existing code actually provided the past 210 days in that case). Instead
do more intuitive periods. Last month, quarter, half year, year.
Use Qt's ability to make sane date calculations easy.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use more idiomatic ways to indent the rows, replace the TemplateLabel with a
simple Label since drawing the extra rectangle for the background of the
TemplateLabel is obviously redundant and using it doesn't change the number
of properties we need to set.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I keep forgetting that the verticalAlignment is only within the current object,
which means that in a single line label it has no meaning at all.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
On tablet devices, the summary page stays open and therefore
the summary is not refreshed. For now, add a button. Later, this
should be connected to signals when dives are edited, added or
deleted.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add section headers to the dive summaries on mobile by adding
a section-property. Of course, this will not work on desktop.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we now use a model to calculate the dive summary, there
is no need to export recalculation of the dive summary via
QMLInterface.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Implements the ListView and its delegate to use the dynamic data
provided by the DiveSummaryModel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Recalcluate not only the statistics for the given period, but also
the global first and last dive date.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Instead of transporting the global first and last dive date
in the dive summary, calculate it in an external function.
Since we already have time and date functions in qthelper.cpp
implement those functions there. Provide a stub in QMLInterface
so that QML can access these standalone functions.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
When the cylinders became a dynamic data structure, a get_cylinder() call
suddenly could return a NULL pointer. So use get_or_create_cylinder() for the
first call when parsing the user's data.
Also, deal with an oddity where the string lists look different because an
empty list technically isn't the same as a list with one empty string.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This seems to work much more reliably as it specifically compares the cursor
position to the visible bottom and top of the screen.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The GridLayout isn't part of a Layout, so set its width and
have the combo box fill it's part of the grid.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This still is way to fragile. Ordering of object completion doesn't appear
consistent. Hopefully bringing the properties all into one (now reasonably
named) object will help.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I don't expect this to be complieted. I'll keep it in the tree
for the moment, but expect to remove all of the related code
eventually.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With the columnSpan 3 (in a grid with only two columns) they were drawn
on top of the drop down for the theme.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In a color swatch the color of the body of the swatch is the one that
matters. And we need to ensure readability. So for each pair of colors,
use the combination in the regular order (color/textcolor) for the
background swatch, and inverted for the text swatch.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The TemplateLabel comes with a set background color which creates a very odd
effect and makes the text generally unreadable in the color swatches.
Fix this by matching the color of the parent rectangle.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
These are not color swatches like the rest, these are the column titles, so
don't draw them the same way as the color swatches.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
move initialWidth/initialHeight out of subsurfaceTheme to placeHolder,
this secures no change in behaviour.
Signed-off-by: jan Iversen <jan@casacondor.com>
Show all colors in a theme, allowing user to change theme.
This is preparation for allowing users to click on the individual
colors and change them.
Signed-off-by: jan Iversen <jan@casacondor.com>
Make variables and functions static where possible, this is done
to prevent different versions of theme with different values.
Signed-off-by: jan Iversen <jan@casacondor.com>
Use the TemplatePage and TemplateButton in the converted pages.
In order to avoid a bigger search/replace all other pages are left
untouched (for now).
Signed-off-by: jan Iversen <jan@casacondor.com>
Do "git mv SsrfButton TemplateButton", and search/replace
all uses.
The general idea of the templates are to secure common layout,
but also to isolate the Kirigami parts (slowly) in the templates.
Signed-off-by: Jan Iversen <jani@apache.org>
Usually, we use PascalCase (i.e. camelCase with a capital
letter at the start) for class names. For consistency, let's
do it here as well.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
QMLInterface::instance() is only used in one single place. This
makes the whole notion of having a global instance of the object
moot, isn't it?
Simply make the object static to the function that uses it, which
guarantees that the object will be created when the function is
called. I.e. the same behavior is retained with less complexity.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
It appears weird to connect the QMLInterface signal/slot combination
in a static helper function. This generates a bunch of lambdas that
call the instance() function.
Instead, simply do the connections in the constructor as we do it
in numerous other places.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
When either length or volume unit is changed, the text needs to be
changed.
Let signal lengthChanged and volumeChanged cause a recalcation and therefore
new text.
Signed-off-by: jan Iversen <jan@casacondor.com>
Emit signals for each standard color when theme changes.
The iconStyle property was changed from being a constant, because it can
change, and thus a signal was added.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove extra empty lines in themeinterface.cpp just a cleanup, no functionality
change.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
fontMetrics is no longer used in production code, but still in the theme test
page.
Isolate fontMetrics in ThemeTest page.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In order to remove fontMetrics from QML, replace references (height)
in DownloadFromDiveComputer and Settings
Add include kirigami as needed
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Move setting of font properties used throughout to themeInterface.
Add new settings "currentScale".
The properties are kept in main (subsurfaceTheme) in order not to do
a big search/replace.
Update settings to use currectScale and signal changes in themeinterface.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Check defaultfont and calculate basepointsize in themeinterface instead
of in QML.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There were quite a few issues with the code - clearly a complete failure of
code review.
- all values were '??' if a period contained no dives
- imperial units were not calculated at all
- significant truncation and data loss in the way totals were added as meters
and minutes instead of the higher precision data that is available
- several issues in striing conversion methodology, e.g. missing zero padding
for minutes
- missing maxSac
- incorrectly calculated avgSac
- incorrectly claculated number of EANx dives
- hard to read code with most variables named 'temp'
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Solve kirigami error:
INFO: qrc:/org/kde/kirigami/ScrollablePage.qml:187: TypeError: Cannot assign to read-only property "parent".
Kirigami.scrollPage does not allow a ListModel be defined, even though it is allowed in QtQuick.
Signed-off-by: jan Iversen <jan@casacondor.com>
Add dive_move variable to qmlinterface, to make it aviable to QML.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Replace subsurfaceTheme with ThemeNew, since there are still 2 objects
subsurfaceTheme in main.qml and ThemeNew in themeinterface.*
Replace theme color references with ThemeNew, as they are no longer available
in main.qml (subsurfaceTheme).
Signed-off-by: jan Iversen <jan@casacondor.com>
Move setup call and registration from subsurface-helper
to themeInterface, in order to keep the registration where the code
are.
Signed-off-by: jan Iversen <jan@casacondor.com>
Add DivePlannerSummary, a page to show in dive centers.
Allow user to select period for the 2 colums in DiveSummary.
Default is "Total" and "3 month", but allowing the user to change
these, make it a very simple tool to view how the user progresses.
Variables are taken from Backend.
[Dirk Hohndel: adjusted text strings as these aren't really months]
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Create DiveSummary class in backend-shared and make the DiveSummary calculation
results available to QML.
This adds a loop over all dives (could have been done with a model, but the
models available to mobile are very limited, so use the basic way).
[Dirk Hohndel: renamed the results variable and combined a couple of commits]
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add property "colorBackground" to allow instances of templateLabel to have
background color overwritten.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A lot of whitespace issues have snuck in recently, this just cleans those up so
that I don't need to hand-edit patches every time I touch this file (since
QtCreator automatically fixes whitespace when I make changes).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Simply replace it with QLatin1String. There is a tiny performance penalty,
but none of that code would care.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Update Settings to use ThemeNew (for theme change)
Reduce subsurfaceTheme in main
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Currently subsurfaceTheme resides in main.qml, where it does not naturally
belong.
Add C++ class that will replace subsurfaceTheme in main.qml in a 1-1 manner.
This opens future posibilities
- on top of the 3 themes, allow users to select colors/fonts
- add stylesheets to Template* components
- make day/night shift automatically.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Update size and colors.
Changing the TemplateSection, automatically changes all sections
in the system, converted to the new layout.
The styling would be better in a style/theme class, but
subsurfaceTheme is in main.qml and not in a C++ class, so for now
use primitive styling.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The standard SpinBox uses far too much real estate.
The new SpinBox have a smaller footprint, and more visual effect.
Changing the TemplateSpinBox, automatically changes all spinboxes
in the system, converted to the new layout.
The styling would be better in a style/theme class, but
subsurfaceTheme is in main.qml and not in a C++ class, so for now
use primitive styling.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add property pressureUnit to use as BAR/PSI text.
Added slot to catch when user changes BAR <-> PSI.
Add Backend variables to Planning section.
Signed-off-by: jan Iversen <jan@casacondor.com>