Splitting the bottomlayout in two leads to columns in the grid not lining up.
It was a workaround that hopefully isn't needed any longer.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The QML manual advises against setting width property of gridLayout children
directly, and recommends setting preferred, min and/or max width instead,
letting QML do the work to determine the optimum width. But we've found
letting QML determine gridLayout widths leads to infinite loops in too many
situations, so we're forcing a width. It's better to force a width by setting
it directly, rather than setting minimum = maximum.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I did this semi-automatically: I used the script from
the previous patch and then did some manual corrections.
This marks only title: and text: tags, there might be others
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The ApplicationWindow has the backRequested signal and if we don't accept
that event, Kirigami will exit the app which is never what we want.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While this seemed to work fine on iOS and when compiling the QML UI on
a desktop, on Android the nocloud button wasn't shown at app start.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This will parse the date and time information on CSV import if the file
name matches the one used by APD log viewer (date and time are available
in the file name). Hard coding the year to 20?? is a bit unfortunate,
but as there is only 2 digits in the year, we have to invent something.
And it would be quite optimistic to assume this will bite us back any
time soon :D
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The grid layout had each column fixed to a width
taken as a portion of the grid width, but since
the grid has a columnSpacing defined as well,
the computation doesn't add up, helping in causing
an infinite recursion problem in the attempt of
sizing and positioning all the children of the layout
[Dirk Hohndel: heavily modified, but the basic idea remains]
Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Printed command line can be used to manually test the import function,
allowing faster testing of XSLT changes, and showing debug prints that
are discarded by Subsurface.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This will convert cylinder size when importing from imperial units. I am
using default working pressure of 3000 PSI that is not precisely
correct, but should be close enough for the most common aluminium
cylinders.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
if the text in every column can wrap anywhre,
we don't have a stable way to know how large the columns
themselves may be. This can cause an infinite recursion
while trying to figure out the width of the items, as
the sizeHint(Qt::ImplicitSize) of those labels
(Buddy, Cylinder etc) will not be stable as it will once
return the size of the text wrapped and once the size of
the text not wrapped.
Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
No point in having it defined in each main program's .cpp. Especially
since the unit tests don't define them.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since the big layout causes an infinite recursion in the Qt/QML layout
engine.
Also remove a no longer accurate comment.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Otherwise we keep downloading the same image multiple times instead
of new images.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With offline the default now, we need to force a connection at least once
so that the repos are in sync. And then of course we need to return to the
correct state, regardless on whether this connection succeeded or failed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Not sure why we claimed that this was successful when clearly it wasn't.
There's a risk that this could break something on the desktop, but it
makes no sense to me why that would be the right thing to do.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since saving checks if there are changes, we have to always mark the dive
list as changed before asking for the changes to be saved.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is rather simplistic, it just imports the local data into the remote
repository and therefore loses the git history of the local data - but I
wasn't able to make the git merge without shared base commit work, so I
went this much easier to implement route instead.
One thing we need to be careful about is that contacting the remote server
could fail. If we don't manage to merge the dives from cloud server and
local storage, we need to revery to no cloud status in order not to lose
the local data.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a feature that many people have asked for. This implementation is
somewhat simplistic because we simply use a different name for the
program settings - but interestingly enough this appears to be enough to
capture a lot of the core functionality that people are looking for in
multi-user support.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Otherwise we step on our own feet when downloading several images,
like after import from divelogs.de with many linked images.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the value for "use" is negative or larger than the number of
elements in "enum cylinderuse", later CylindersModel::data() can
request a string in the lines of cylinderuse_text[cyl->cylinder_use],
which can SIGSEGV.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This seems to work around the crazy QDateTime::fromTime_t() problem in Qt.
It is *very* lightly tested. In fact, the only test is that "test0.xml"
change that is part of this patch.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It turns out that we are starting to have users that have logs that go
back that far. It won't be common, but let's get it right anyway.
NOTE! With us now supporting dates earlier in 1900, this also makes
"utc_mktime()" always add the "1900" to the year field. That way we
avoid ever using the fairly ambiguous two-digit shorthand.
It didn't use to be all that ambiguous when we knew that any two-digit
number less than 70 had to be 2000+. Now that we support going back to
earlier in the last centiry, that certainty is eroding.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>