This one is designed to be fixed size and space efficient, non editable.
It's used in the statistics page for now and looks much better than what
we have elsewhere, so the style should propagate to the rest of them as
well, but this is trickier for the once that are editable - and of
course the fixed width might also not be appropriate in other places.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The code was protecting against the wrong member being NULL.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
So far only DC provided ceiling information was available and visibility
of that was simply inherited via cloud storage from the desktop.
With this the user can set both DC reported and calculated ceilings in
the advanced settings in the mobile app.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This allows us to force a redraw of the dive profile when settings change
that require a refresh of the profile.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This gets us better log messages and better spacing - but it's far from
good and all of this should be squashed into one working version in the
end.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use Q_PROPERTYs of the StatsManager to correctly set
the current index of comboboxes after a state changed.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This doesn't look great, but it's already part of the breeze-icons,
so it's very easy to add - and it's better than no icon.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This has been a thorn in my side for a long time. The old code was
terrible and insanely fragile. The new code is really dumb and quite
fragile. So definitely an improvement?
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds a reasonably flexibile mobile page that tries to do the right
thing for both portrait and landscape mode. In order to get the most out
of a mobile screen, it's implemented in a way that always gives it the
full screen (it does so by emptying out the page stack and being the
only page shown - brutal, but effective).
This commit also contains a bunch of other random cleanups that didn't
really justify being in separate commits.
Parts of this was written by Berthold, hence the double SOB.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
In analogy to "QMLManager", add a "StatsManager" class,
which manages the statistics module on mobile.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This makes it more obvious what we are doing. And won't make any difference
from a performance perspective.
Also converted the last call to connect using the old syntax to the new syntax.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Simply move the initialization of the logging function into its own method and
call that in the QMLManager constructor.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Using the y coordinate of the component directly doesn't work if we use
the component inside other components. Instead we need to grab the
position relative to the flickable.
The comment about needing the function for this to work seemed dubious.
So for now I've removed that function and am setting the position
directly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Doing this check every time we get a 'pressed' signal for the input
field seems excessive. We really only need to check when the input field
gets focus - that's when the OS virtual keyboard might open and hide the
field the user wants to edit.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It's entirely reasonable to use the component in a context where we
don't have a flickable. Simply don't try to reposition things in that
case.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This reuses the logic we implemented in the SsrfTextField.
Eventually we will need to clean up the inconsistent names for these
elements.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
By removing focus from all input fields we can ensure that we have the
correct data reflected when saving an edited dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of always showing info about the location, allow all data to be
captured in a more structured format - but only when the app is in
verbose mode.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There's no point in doing that - we set the correct text and leave that
in the editText and displayText for the combo box. If the user uses the
drop down they can replace that. This works correctly for single people,
and for multiple people the drop down doesn't work at all, anyway.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we start editing a dive the OS will open the virtual keyboard if
any of the input fields have focus (which they might get when we set
their content).
The explicit closing of the keyboard might be overkill, but also doesn't
appear to hurt.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This seems more intuitive. For editable combo boxes you need to tap on
the indicator, but for non-editable (readonly) ones, you can tap
anywhere and the dropdown is shown.
The code feels a bit clumsy, but seems to work in all cases.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
They always have a 10% darker background, and show a border if the combo
box has focus. This seems to look reasonably well in all situation we
use them.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Getting the visual right is really hard. The anchors seem to mostly work,
but it still doesn't look exactly right, IMHO.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I was convinced that I had fixed this while working on this set of patches,
but apparently I didn't. This simply hardcodes good colors.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This never ever worked to trigger a profile update. The code is
nonsensical as we cannot access the QMLProfile in a model delegate this
way from outside the delegate.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The weird 'Component.onCompleted' always felt like the wrong way to do
this. Setting this directly from the model seems like the much cleaner
solution.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This actually created a recursive dependency - I didn't see any negative
visual effect, but lots of annoying warnings.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In reality I should make our TemplateComboBox capable of handling the
modifications needed here without yet another reimplementation. Maybe
I'll do that next. This at least makes things look right.
A couple of odd whitespace changes snuck in at the end.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Again, the fact that you basically need to completely reimplement the
ComboBox in order to change some colors is frustrating.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is needed for the Export page.
And may I say for the record that it's rather surprising that in order
to change the color of one of those elements one ends up having to
completely re-implement them.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While the text name is 'light primary color' it really has to be a dark
blueish color to fit with the theme.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This requires more changes to Kirigami, but with this we get dark
drawers (the menus that slide in from the side) in the dark theme.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We do theming very differently from what Kirigami intended. Mostly
that's because our code predates theirs. But also because Kirigami wants
and app to simply use an OS theme - whereas we want to be able to
provide different looks, independent from the OS theme.
Ideally we'd still use the existing methods to change the colors and
sizes of Kirigami UI elements, but for now this hack helps improve
readability of the title bar.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In the dive list the rendering of the line ended up being subject to
rounding errors. With this change we ensure that the thin line is always
shown.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since switching to the mobile-models and removing grantlee,
DiveObjectHelper was demoted to a thin wrapper around string
formatting functions. The last user was removed in a previous
commit.
It was never a good idea, given QML's strange memory-management.
Let's remove it.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
When editing a dive, a DiveObjectHelper of the unmodified dive
was created to compare the edited with the old values. Since
the DiveObjectHelper is used here only as a pointless wrapper
around the formatting functions, call these functions directly.
However, note that the code is in principle wrong since the
change to the mobile-models, which do not use the DiveObjectHelper.
The real fix would be to reload the data from the model to prevent
going out-of-sync with respect to the formatting routines!
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Having them as commits like this should make it easier to migrate them
as we update the underlying Kirigami version.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With the updates to Kirigami I slightly modified the hack that we use to
implement that, as a result we call pop() directly on the globalDrawer.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Our half-assed manual build of Kirigami was becoming completely unmaintainable.
So let's try to use the build method that the Kirigami team recommends. Which
unfortunately requires us to have access to the KDE extra cmake modules (ECM).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The list of known tank types were kept in a fixed size table.
Instead, use a dynamic table with our horrendous table macros.
This is more flexible and sensible.
While doing this, clean up the TankInfoModel, which was leaking
memory.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Instead of programatically reload the completion models, listen
to the relevant signals in the models. To that goal, derive all
the models from a base class.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
These flags are not dive-related, therefore move their declaration
to the appropriate header file. Likewise, move their definition
from parse-xml.c to subsurfacehelper.c
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Desktop does not use mark_divelist_changed() anymore - all is done
via the undo machinery. Therefore move this function (and its
counterpart unsaved_changes()) to qmlmanager.cpp.
Ultimately, it probably should be removed from there as well, but
currently I don't dare to touch all the cloud-logic!
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
In analogy to the xml-parser add a device-table to git's parser-state.
Currently this is unused. In upcoming commits the git parser will
then be changed to add device nodes in this table instead of the
global device table. The long-term goal being to detach the
parsers from global state and to make dive-import fully undoable.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Add a device_table parameters to Command::importTable() and
add_imported_dives(). The content of this table will be added
to the global device list (respectively removed on undo).
This is currently a no-op, as the parser doesn't yet fill
out the device table, but adds devices directly to the global
device table.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
To include the device code in the undo system, we need functions
to check for the existence of devices and to add or remove them.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
If we want to avoid the parsers to directly modify global data,
we have to provide a device_table to parse into. This adds such
a state and the corresponding function parameters. However,
for now this is unused.
Adding new parameters is very painful and this commit shows that
we urgently need a "struct divelog" collecting all those tables!
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Google play now requires that we show an explicit notification when turning
on background location. This is an attempt to fulfill that requirement - we
won't know if this is 'good enough' until we submit the app, though.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We used a typedef "filter_preset_table_t" for the filter preset table,
because it is a "std::vector<filter_preset>". However, that is in
contrast to all the other global tables (dives, trips, sites) that we
have.
Therefore, turn this into a standard struct, which simply inherits
from "std::vector<filter_preset>". Note that while inheriting from
std::vector<> is generally not recommended, it is not a problem
here, because we don't modify it in any shape or form.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This is mostly copy and paste of other git loading code. Sadly,
it adds a lot of state to the parser-state. I wish we could pass
different parser states to the parser_* functions.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This is a bit painful: since we don't want to modify the filter
presets when the user imports (as opposed to opens) a log,
we have to provide a table where the parser stores the presets.
Calling the parser is getting quite unwieldy, since many tables
are passed. We probably should introduce a structure representing
a full log-book at one point, which collects all the things that
are saved to the log.
Apart from that, this is simply the counterpart to saving to XML.
The interpretation of the string data is performed by core
functions, not the parser itself to avoid code duplication with
the git parser.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Switch the mobile code to use the constraint-based filter. The one
thing that is still commented out is dive-site mode, since mobile
doesn't (yet) have a dive-site edit feature. And even if it had,
the dive list probably wouldn't be shown at the same time.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
If the dive timestamp changes, the dive could move in the dive list. But the
current dive actually doesn't change (it's still the same dive, right?). Yet
we need to update the dive list as well as the shown dive (especially if this
is after adding a dive, which is first inserted with the current time and then
updated with whatever the user enters).
Fixes: #2971
Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The old code wasn't wrong, and likely the compiler turned this into something
that wasn't really terrible... but yeah, 5 unnecessary calls to a helper
function just bugged me. And I think the new code is much easier to read.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A silly copy and paste error caused us to overwrite the gas mixes for
all the tanks with the gas mix in the first tank.
Fixes#2913
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It appears that multi line attributes silently fail. Without this change, the Download
button is enabled if vendor and product are chosen, even if there isn't a connection
selected. With this change (having all three conditions on the same line) the code
works as expected.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This seems like the easiest way to show the state without disrupting the UI
elsewhere. Directly below the email address used for cloud storage.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This allows the mobile UI to reflect the three states that the dive list can be
in:
- changes that haven't been written to local storage
- there potentially are changes in local storage that were not synced with the cloud
- dive list is in sync with cloud storage
The last state could be misleading if the user access the cloud from a
different device and makes changes to the cloud storage from there, but from
the point of view of this device, the states are consistent.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we haven't connected at all to the cloud server we assume that there are
local changes. And whenever we save changes only locally, we also set that
flag.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Having a lot of tags (or more precisely, a tags string that is very long) could
cause the width of the dive details view to extend past the width of the the
page. The txtTags label was missing a maximum width, and to make the result
more useful, I also added correct wrapping and elide to the mix (stupidly, we
had the wrap and width for the fixed name of the field ('Tags'), but not for
the user determined content of that field).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The UI is ugly, and of course this is hidden in the developer options that have
to first be enabled in the advanced settings. As I mentioned in the previous
commit, I believe the actual risk that something gets damaged here is very low,
but still, explaining this so it makes sense to the casual user may be a bit...
difficult.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If you pass in the repo name, it isn't treated as cloud storage, but simply as
local git storage and imported (i.e., added) to the current dive list.
This allows the user to work around failed no-cloud->cloud transitions, merge
different accounts, and most importantly deal with situations were conflicts on
the server caused us to move a cache out of the way and potentially make dives
that were on the mobile device inaccessible to the user.
Once a UI is added, this allows the user to recover those dives (realistically
this is not really all that potentially 'dangerous' to do, but it's definitely
something that would best be done after talking to someone who understands the
cloud storage and can guide the user...).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>