Commit graph

8514 commits

Author SHA1 Message Date
Gehad elrobey
d41d79b549 Printing: add the "Shades of blue" color theme
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:39:19 +03:00
Gehad elrobey
6319f0efba Printing: add a "Flow" layout
Print dives successively and fit as many as we can in the smallest
number of pages. Some dives may be broken between pages.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:39:12 +03:00
Gehad elrobey
858796af09 Printing: clear all templates before insterting the new templates
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:39:07 +03:00
Gehad elrobey
1dd2518624 Printing: support importing/exporting of templates
Implement 'import/export' features, so it's easier to share
customized printing templates. Also support deleting existing templates.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:38:59 +03:00
Gehad elrobey
fc9cba692e Printing: add "Import", "Export" and "Delete" buttons for templates
Use the button group to import, export or delete a template from the
printing_templates directory.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:37:51 +03:00
Gehad elrobey
b37498d355 Printing: add member function to print options
Get the currently selected template.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:37:49 +03:00
Gehad elrobey
61a8ac09b0 Printing: fix TemplateEdit layout
Make the TemplateEdit dialog resizable.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:37:40 +03:00
Gehad elrobey
e8ad4b0c97 Printing: remove "Table" option from print options radio group
"Table" print is now a template, so remove the radio button.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:37:38 +03:00
Gehad elrobey
7f8d20c09d Printing: fix issue with old QSettings group
As I am using the same old QSettings group name, some variables may not
be correctly initialized, so we need to check for incorrect values
before we start.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:37:35 +03:00
Gehad elrobey
2a85be91b1 Printing: save/load selected template by QSettings
We save the selected template name on closing the printDialog, We also
load the last selected template from QSettings when initializing the
dialog.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:37:33 +03:00
Gehad elrobey
2b2c506cb7 Printing: use grantlee templates from the current existing template list
We use templates from the grantlee templates list created and
dynamically. So we don't need static templates anymore.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:37:30 +03:00
Gehad elrobey
c95358c4b9 Printing: remove existing values in print template combobox
We don't need static template names anymore.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:37:28 +03:00
Gehad elrobey
f76ebe3b9d Printing: search for grantlee templates in the templates directory
We need to dynamically look up for all the existing templates in the
template directory. A grantlee template can be named any name but we
ignore files ending with '~'.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:37:23 +03:00
Gehad elrobey
0b085f79b1 Printing: set the default tab to the correct one
The first tab is the default tab.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:37:15 +03:00
Gehad elrobey
9fd5221666 Printing: get the number of pages from the full resolution
When we calculate the number of pages to print we need to check if the
template doesn't define the number of dives per one page, then render as
much dives as we can fit in one page. A dive can be broken into many
pages.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:37:12 +03:00
Gehad elrobey
c6116b0269 Printing: add a "Table" template
The "Table" template shows a simple table of user dives. The fields
shown are:
Dive number, Date, Time, Depth, Duration, Master and Location.
Other fields can be added by the user.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:37:05 +03:00
Salvador Cuñat
75e736a66b User Manual: Slight changes on OSTCTools import
Don't give sensation that OSTCTools is a H&W software, which it isn't.
Little adds on supported DCs and other considerations.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 06:37:34 -07:00
Miika Turkia
80fe9f8c0d Test case: HUDC import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 06:35:19 -07:00
Miika Turkia
ffa45b9d24 Test dive for Seabear HUDC import comparison
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 06:35:10 -07:00
Miika Turkia
9898e02ae6 Add debug print on CSV import
If we are running Subsurface in verbose mode, print the xsltproc command
line to test the XSLT manually.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 06:35:00 -07:00
Miika Turkia
6953824bd6 CSV import: add support for DC hw info
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 06:34:43 -07:00
Miika Turkia
3ef5dbaacb Add hw info to Seabear import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 06:34:18 -07:00
Miika Turkia
02488ba9df CSV import: add XSLT support for DC hw info
Include the DC's hardware name if it was given as parameter on CSV
import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 06:34:04 -07:00
Miika Turkia
615f45e58b CSV import: create o2 and diluent cylinders for CCR
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 06:33:57 -07:00
Rick Walsh
87c35e19e2 Planner: Add comments to document the code
The purpose of parts of the planner code is not not always obvious.  This is
especially true of the conditional statements in the add_plan_to_notes function.
Annotate the code with comments to explain the logic.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 06:31:30 -07:00
Robert C. Helling
0ca42ea4a4 Adjusted spacing
and a typo in comment

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 06:30:08 -07:00
Miika Turkia
5d4f81206d Test DM4 import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26 09:14:12 -07:00
Miika Turkia
3f0fb84fc2 Test dive for DM4 import comparison
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26 09:14:06 -07:00
Dirk Hohndel
72e6c52b06 Remove bogus fix
In commit 156ad42a3c ("snprintf is happier if it has an explicit string
literal format argument") I got a little too aggressive making sure there
are string literal format strings...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26 09:14:06 -07:00
Rick Walsh
4d3cefc70b Planner: Add parentheses to output condition
Aids reading the code, doesn't alter the logic.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26 09:14:06 -07:00
Rick Walsh
90d15c20c4 Planner: Count the minimum stop time towards o2time
When doing backgas breaks, count the minimum stop time towards o2time.
Previously, the initial minimum stop wasn't counted, so the time of the first
segment on oxygen was min_switch_duration + 12 minutes.

E.g. with 1 minute minimum switch duration.

Previously:
depth   duration        runtime gas
40m     1min    1min    air
40m     34min   35min
21m     2min    37min
21m     1min    38min   EAN50
18m     1min    39min
15m     3min    42min
12m     4min    46min
9m      5min    51min
6m      13min   64min   oxygen	<--13 minutes on O2
6m      6min    70min   air
6m      2min    72min   oxygen
0m      1min    73min

Now:
depth	duration	runtime	gas
40m	1min	1min	air
40m	34min	35min	 
21m	2min	37min	 
21m	1min	38min	EAN50
18m	1min	39min	 
15m	3min	42min	 
12m	4min	46min	 
9m	5min	51min	 
6m	12min	63min	oxygen
6m	6min	69min	air
6m	2min	71min	oxygen
0m	1min	72min	 

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26 09:14:06 -07:00
Rick Walsh
4f05622846 Planner: Hide unwanted transition between deco stops
If display transitions in deco isn't selected, then we shouldn't show the
transition segment between two deco stops, even if there is a gas change.  We
should still show the ascent segment up to the first deco stop.  The
(gaschange_after && !isascent) condition is necessary to pick up backgas breaks.
An example plan is shown below.

Previously:
depth	duration	runtime	gas
40m	1min	1min	air
40m	34min	35min	 
21m	2min	37min	 	<--meaningful ascent segment
21m	1min	38min	EAN50
18m	1min	39min	 
15m	3min	42min	 
12m	4min	46min	 
9m	5min	51min	 
6m	0min	51min	 	<--unnecessary ascent segment
6m	13min	64min	oxygen
6m	6min	70min	air
6m	2min	72min	oxygen
0m	1min	73min	 

depth	duration	runtime	gas
40m	1min	1min	air
40m	34min	35min	 
21m	2min	37min	 	<--meaningful ascent segment
21m	1min	38min	EAN50
18m	1min	39min	 
15m	3min	42min	 
12m	4min	46min	 
9m	5min	51min	 
6m	13min	64min	oxygen
6m	6min	70min	air
6m	2min	72min	oxygen
0m	1min	73min	 

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26 09:14:06 -07:00
Rick Walsh
1885eccc49 Planner: use pointer to deco stop level array instead of memcpy
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26 09:14:06 -07:00
Rick Walsh
036e992d14 Planner: Change 3m stop to zero if last stop is 6m
When the last stop at 6m/20ft option is selected, replace the 3m/10ft stop with
zero depth, rather than doubling up on the 6m/20ft stop.  This removes the need
to differentiate between 6m (=6000mm) and 20ft (=6096mm) and saves calling a
helper function.  It does not alter the calculated profile at all.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26 09:14:05 -07:00
Joakim Bygdell
3d5232a622 QML UI: add style to the menu button
Add some style to the menu button so that it fits the theme.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26 06:19:53 -07:00
Joakim Bygdell
7be21b1d41 QML UI: add Subsurface mobile to top of app
We have space over so lets add the name to the top.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26 06:19:50 -07:00
Joakim Bygdell
64601672a8 QML UI: make the app blue
White is boring, so lets change the color of the android app to
a more pleasing subsurface blue.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26 06:19:47 -07:00
Joakim Bygdell
f1f13ed407 QML UI: create menu to house the buttons
Runing the android version on a phone the screen must be tilted
sideways to accommodate all buttons.
This creates a single button that triggers a popup menu that houses the buttons.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26 06:19:43 -07:00
Dirk Hohndel
83c2addfef Move initialization of preferences to helper function
This way we can read the preferences without instantiating the
PreferencesDialog class.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-25 22:08:25 -07:00
Dirk Hohndel
c679ed550e Don't show the survey for the mobile app
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-25 20:49:16 -07:00
Tomaz Canabrava
d50e767fb5 We do not change the displayed_dive_site - don't reset it
It seemed correct when we changed the dive_site that we could be
editing, but we don't do that anymore. (I actually think this
should be self-contained, no global that a lot of widgets can
change)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-25 13:53:57 -07:00
Tomaz Canabrava
71a23c5295 Break long lines
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-25 13:53:45 -07:00
Tomaz Canabrava
7c770f0790 Show dive_site info on the labels
Correctly show the dive_site information on the labels.
still crashes on accept / reject.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-25 13:53:20 -07:00
Tomaz Canabrava
f4c31f110f Clean code from the dive site edit
This is an edit dialog, not a create dialog.
This makes Subsurface crash but it's a step in the right direction.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-25 13:52:53 -07:00
Tomaz Canabrava
68053a1150 Close the dive site edit when accepting/rejecting it
Return to the default mainwindow state when the user accepts
or rejects the dive site edit.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-25 13:52:33 -07:00
Tomaz Canabrava
1aaa37e511 Re-enable the dive site edit
Since now we found the perfect way to deal with dive site handling on the
dive, we can reenable this widget.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-25 13:51:44 -07:00
Dirk Hohndel
156ad42a3c snprintf is happier if it has an explicit string literal format argument
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-25 13:43:44 -07:00
Grace Karanja
ea574b6b11 QML UI: Show profile on Android
This is a better way for showing the profile. The show() and hide()
statements are replaced by a QTransform statement.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-25 19:39:05 +03:00
Miika Turkia
c19f4869af Create test case for DivingLog SQLite import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-24 13:21:19 -07:00
Miika Turkia
76fe262a0f Allow creating new dive site with specific uuid
Test cases require deterministic results and thus we should allow uuid
to be specified when needed.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-24 13:20:57 -07:00