Oops, this is bad as it will lead to a certain buffer overrun.
The other change is more cosmetic - nested open comment '/*'.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We already had code to deal with this in the Save As case, but similar
handling is needed in the Open case.
This commit also makes the regular expression handling a bit stricter and
identical between the two cases.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Change the timestep used to calculate tissue pressures and ascents from 3
seconds to 2 seconds. But whats wrong with using 3 seconds?
Deco stops are at 3 m (10') intervals, and our ascent rate is usually
9 m/min (30'/min), or at least multiples of 3 m/min (10'/min). Hence time
to ascend from one stop to the next stop is 20s (or any factor of 60).
Using 3s increments, we round our ascent interval up to 21 s, which leads
to messy durations and runtimes.
But what about me? I like SI units and whole decimals. Don't worry, 2s
timesteps fit nicely when using 10 m/min ascent rate (18 s between stops).
[Dirk Hohndel: edited the commit message to fix minute/second confusion]
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Designer is such a pain to work with. Once I ended up editing the .ui file
by hand for the hard stuff and then just use designer to get it
consistently formated. Such a disappointment.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Simply looking at the filename in the picture structure isn't enough (now,
arguably one might say that it should be and that that data structure
should be updated, but that's not how other parts of Subsurface have
implemented things so I don't want to break that assumption here).
So instead we look up where the pictures actually was loaded from and then
copy that file into the right location.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The interesting challenge here is what to do with the picture data stored
in the git repository. If the pictures are already in the file system (for
example because Subsurface is runnin on the same machine that this data
file was saved on) it would be silly to extract them again every time the
dive log is opened.
So instead we try to figure out if the pictures can be located and only
create local copies of them if that isn't the case.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In order to be able to see pictures when using cloud storage from
different machines, we really need to store the pictures with the dive
data.
This could be made optional with a preference, but for now I'll just
enable it by default.
Loading the pictures from git still needs to be implemented.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I found another place where we had colons in file names...
This fixes a small cut and paste error in an error message as well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
--20cf303ddd3893b1500518e9204e
Content-Type: text/plain; charset=UTF-8
Use an adjusted timestep to calculate length of deco stops, so that they
always end at whole minutes of runtime. This makes for a cleaner ascent
profile.
<div dir="ltr">Use an adjusted timestep to calculate length of deco stops, so that they always end at whole minutes of runtime. This makes for a cleaner ascent profile.<br></div>
From 15e08450252f304fc7d46931e2aca5c991c2f3de Mon Sep 17 00:00:00 2001
From: Rick Walsh <rickmwalsh@gmail.com>
Date: Sat, 20 Jun 2015 11:36:07 +1000
Subject: [PATCH 2/2] Planner - end deco stops at whole minutes of runtime
Use an adjusted timestep to calculate length of deco stops, so that they always end at whole minutes of runtime. This makes for a cleaner ascent profile.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Rename the Dive class in divelistmodel.h to a void a conflict with
the Dive class in templatelayout.h
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Show more dive info in the extended view of the dive.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
On the QML page, dives are repeated. Adding process_dives to
QMLManager after calling parse_file solves this.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Group dives according to the allocated dive trips.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When a dive is clicked, show the dive details on the QML page.
This contains basic details, and will be expanded further.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This file contains a styled button for use in QML
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add the dive notes field into the DiveListModel class.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Set a rounded blue rectangle on the selected item.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This model will be used to show the dives in QML. This commit adds
the model, and the means to link it to QML.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In qt-gui.cpp, move the Qt Quick includes so that they will only
be used when on cmake SUBSURFACE_MOBILE is True.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a link between the C++ and QML parts of the app using the
qmlRegisterType function.
[Dirk Hohndel: changed the name to org.subsurfacedivelog.mobile]
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Build the QMLManager class when compiling for mobile.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a QMLManager class. This class will be used as a link between
the C++ and QML aspects of the mobile application.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a dialog to select dive files in the QML interface, and also
add a menu entry to open the dialog.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When compiling the mobile version, hide the Qt MainWindow.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When cmake is run with -DSUBSURFACE_MOBILE=True, the initial window
will be main.qml, instead of the MainWindow used when cmake is run
with -DSUBSURFACE_MOBILE=False
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a subsurface-mobile entry to the CMakeLists.txt file. When cmake
is run with -DSUBSURFACE_MOBILE=True, the compiled app will be named
subsurface-mobile, and the initial page (main.qml) will automatically
be loaded.
This will
ensure that the mobile app will be linked to QtQuick.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a menu with an Exit submenu in the main.qml file. This closes
the application when clicked.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a resource file to hold any QML files that will be used in the
mobile port.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Create a qt-mobile directory, with a blank main.qml file. This file
will be built up-on to come up with a usable mobile interface.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In earlier versions we didn't simply create a link but actually copied the
directory and its contents. So for this to work smoothly for people who
have built earlier versions of Subsurface with cmake we need to no just
remove the link but be willing to recursively remove that directory.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add infrastructure and helper functions to track minimum datafile version.
To make this information useful we need to keep the XML and git data
format versions in track moving forward.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We used to use [[yyyy-]mm-]nn-ddd-hh:mm:ss[~hex] in our git storage format
for directory that contained dives. Problem with the is that on Windows
the colon ':' is an illegal character in a filename. So libgit2 refuses to
clone such a repository on Windows.
So instead we now always write dive directories in git repositories as
[[yyyy-]mm-]nn-ddd-hh=mm=ss[~hex] which replaces the ':' with an '='.
Of course we load / parse both formats so that older formats still work.
The next time they are written all the names change which causes rather
huge commits, but that's the only way I see for cloud storage to work on
Windows.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make page size and orientation customizable. The user can select
any page size and orientation and then the rendering resolution will
be calculated based on the selected preferences and the printer DPI.
The HTML templates must be responsive, also the font-size must be based
on the viewport width so that we don't lose quality.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Change the name of the template "base" to "two_dives" as this name
describes it better.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>