After the previous commits, we now have a preference that nicely
preserves the state of the UI, and we have the well known git_local_only
global, that is used to denote whether we want to use to local repo
only, or we want to interact with the online cloud as well.
This commit gets rid of the now superfluous syncToCloud logic. Instead
we simply set the git_local_only directly.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Hook up the new preference to the UI. So now, an earlier choice
if automatic or manual download to the cloud is preserved in
between sessions. Strictly speaking this fixes issue 1725.
Notice that there is also a higly related syncToCloud thing
present. As factoring out that seemingly duplicate piece
of code is non-trivial, this will be done in a seperate
commit.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
We disabled the drawer menu button to switch between auto/manual
sync when in no cloud mode. Unfortunately, disabeling does not
give a visual cue to the user (like greyed out). Instead, just
make this button invisable in no cloud mode.
In conjunction a question. The manual sync to cloud menu item
takes you to the Cloud Credetials page in case pressed in
no cloud mode. While valid, this seems strange. This is not
changed in this commit.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
The background color was plain white, where we use a slightly different
color in other places. In addition, the background when clicking on a row
did not follow the theme setting. Consistency fix.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Something I only see on mobile-on-desktop, so at this point in time
not very relevant to the device apps. When hovering on the action
button, a toast message shows a hint box. These where empty in some
cases. So, just give the actions a text attribute where it was
missing.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
When starting the mobile app, I noticed a short display of an empty
page with title "Cloud creditials" just before showing the
divelist. Simply a not nice visual effect.
This commit simplifies some logic and resolves this. As the code
in this part is fragile, this is tested for normal and clean
startup of the app, switching credentials, from no cloud to
valid account (which even nicely imports the no cloud dives:
this surprised me as I have never seen this working).
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
We need to delete all related data when forgetting dive computers or we will
have an issue if we connect a DC from the same vendor but of a different model.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Improve the logic when auto selecting a DC for download.
Some USB cables only supply vendor information but we can select the correct
model if we have downloaded from it before.
For BT/BLE our discovery process adds the device name to the address, so we need to keep that in mind when we try to match against what we seen before.
When we have a positive match for a DC we have seen before we deactivate the
corresponding button of our saved DCs.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
A technically trival commit, but one with long story. This commit
basically reverts dd1d90b529 (1.5 year ago). While upgrading
Kirigami after Kirigami commit 26b8bdea24c39, we suddenly have
overlapping divelist and details pages in case they are both
on the pageStack (this occurrs when navigating from divedetails
to the divelist using breadcrumb navigation). At this point, its
not clear (to me) if this the by design of Kirigami, or an unintended
effect of the mentioned Kirigami commit.
This all said. Simply clipping resolves our issue of overlapping
pages, and it does not harm.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Something that I simply overlooked earlier with respect to scaling the
divelist. The trip databox did scale a bit, but it was not nicely
related to the hight of the trip header. So there was a tiny
overflow on the small scale on a small device. Fixed here.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Partially cosmetic and partially a bug fix. 1) the seperator line
between trips and dives that are not in a trip was drawn in the
background color => the line was invisible. 2) When looking very
closely, there was a 1-2 pixel wide error between the seperator line
between trips and dives that are not in a trip. 3) there was a comment
that the trip separator needed to be extra thick. IMHO, this
looks ugly, and is superfluous as there is a nice sidebar along
the dives that belong to the trip. Finally, the line shall not
be displayed when not in a trip.
So, basically, the line (the QML rectangle) is completely rewritten,
to take care of all issues. There is 1 hack: the line color is
taken from the dive separator line. But its fully unclear to me
where that color is defined in Qt/QML or Kirigami, so I hardcoded
the proper color. That just works.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
A small cosmetic change. The delete from divelist button was "glued"
to the top of the line. Not nice, so just center it vertically, and
make the button a tiny bit smaller, so that it fits nicely on the line.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Fully usure why the code was as it was. The trip header had 2
overlapping mouse areas, to expand the trip and vise versa. Simply
remove the smallest one.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
A very unimportant change, but found when looking through the code
for places where size of icons where used. The one changed here
has nothing to do with icon related placement of a string, so
its replaced by a way more logical placement of the affected string.
Simply center the "no dives in the dive list" for an empty logbook
on the screen, instead of at some random place in the upper left
corner. Like I said: very unimportant, but it just looks nicer
in the UI.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
A relatively big change for such a simple page. Most relevant
changes are:
1) Do not use Kirigami.Header anymore. It appears that this header
has word wrapping on (and we cannot override that). This is
annoying on this page, as headings seems randomly be split over
2 lines, even in cases where there is more than enhough room to
display it on one line. And as the Kirigami.Header is just a
trivial wrapper of a Text field, we can simple replace it.
2) A lot of the toplevel GridLayouts had width properties set. These
are not needed (and confused my debugging code), so they are removed
withput any visual change. As a general rule, do not try to set
properties that are not needed. In general, it can only lead to
binding loops or undefined behavior.
3) Add a font size to our Theme. The step from regular to title size
was a little too big.
4) And, obviously, numerous font.pointSize lines are added to actually
resize the font.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
There was a strange big margin at the top of the the dive details
page. Just make it a bit more "normal".
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
There was a significant of not needed whitespace on the download from
DC page. Most importantly, the bottom buttons where not on the bottom,
so we had to truncate the downloaded dives early (to prevent overflowing
the buttons). Further, a tiny bit of padding is removed between the
3 top pull down items.
All this, results in the diplay of more dives without scrolling.
For example, previously, only 1 dive (with 1 stored DC) was shown
on my 5.5" device, and now 3 (scale: regular).
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Changed some hard coded size and positioning of the SsrfCheckBox,
in such a way that is scales nicely to the current setting of the
mobile_scale.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
The select buttons in the downloaded dives delegate overlapped
the dive data. Simple margin change fixes this.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Make the ssrfButton and the pull down menu's on the download page
resizable. Notice that also the contents of the pulldown
menu's is scaled based on the font size.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
A user reported problems with editing the Suit and DiveMaster fields.
Apparently, editing does not change the currentText. Without doing
a deeper analysis, simply use editText (a more proper fix might be
changing the currentIndex on editing).
(Parially?) fixes#1694
Reported-by: Mark Powell <mcpowell123@gmail.com>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Changing the scale, it seems that the header of trips is not rescaled.
The reason for this is simple. That string does not use our manipulated
font but a different one. In fact, this is the only ocurrence on the
divelist that did not scale. However, other screens hardly rescaled at
all. All these will be fixed in seperate commits.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
After the work in the previous commit, it gets very simple to implement
font scaling. Just assign a the new desired font scale to the used
font metrics. The QML engine does all the work.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
By manipulation the used font pointSize property, we can dynamically
scale fonts and derived UI objects. At the same time, we have
some logic to determine the default font, its size, etc, for example
depending on screen properties. The scaling of the UI (and its font)
does not need to interfere with those defaults.
However, when we want to reset the pointSize, we alter the default, so
a backup of the default is needed. Ok, not al full backup, as the only
thing we like to manipulate is the pointSize, to which we want to be
able to return.
All this leads to this commit. A basePointSize property is added, that
is initialized from the default. Due to the binding logic of the QML
engine, it is not a classic initialization, but a binding between the
2 properties. We need to break that binding explicitly, so that
the original PointSize is always preserved.
In addition, a display of the new font property is added to the
developers theme test.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This theme test display created a new local FontMetrics object, that
does not per definition correspond with the "global" font metric
as defined in main.qml. The fix is simple. Display the font theme
data based on the one and only font metric from main.qml
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
It seems the documentation is incorrect - unless you explicitly set the
ApplicationWindow font to the the Application Font (just writing this
down sounds so silly...), it doesn't actually work.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Disable the button for the currently selected DC.
This gives an extra visual hint of which DC is currently selected.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
To prevent stale data in the download DC path we need to clear the entire
qPrefDiveComputer.vendor() object when the user purges the used DCs.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Since we now store the last used DCs in out preferences we can use the information
to pre-populate the DC selector.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
We only store the address part of the connection name, so don't try to find an
exact match, try to find the sub-string.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We need to explicitly refresh the divelist when switching between
metric and imperial unit systems. Or the changes will not be visible until
we restart the app or scroll outside of what's in the current cache.
This will update both the divelist view and the dive profiles to show the new units.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Add the option for the user to set the desired unit system for
Subsurface-mobile regardless of system locale
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Trivial rename of a UI string. The string "Subsurface GPS data webservice"
reminds me too much of the legacy webservice.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Use qPrefLocationService::set_time_threshold and remove from
qmlprefs.cpp and qmlmanager.cpp
Remark: mobile UI shows time in minutes, while it is stored (and calculated)
in seconds. Therefore a /60 when reading and *60 when setting.
Signed-off-by: Jan Iversen <jani@apache.org>
Remove distanceThreshold from qmlprefs and use qPref instead
update qml
no user experience change
Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove developer from qmlprefs and use qPref instead
Update qml
show_developer is saved on disk, and thus remembered between starts.
Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In order to address the C++ object directy in qml, a different
registration is needed.
qmlRegisterType, registers the C++ class, allowing qml code to inherit
from it and make qml objects. This is needed for graphical elemnets
like profile and map
setContentProperty, registers the C++ object, thus allowing signals to be
catched.
Signed-off-by: Jan Iversen <jani@apache.org>
This is the first commit related to the removal of the GPS
webservice. It is nothing more then removing 2 buttons from the
menu to upload and download from the server, so technically
a trivial change.
As with the desktop application: Be very careful here as this
forces our users to use Subsurface-mobile, and a online cloud
account as that is the way to transfer GPS data from a mobile
device to the desktop.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Add the UI components to let the user set the default cylinder and select
the chosen cylinder when adding a new dive.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>