Commit graph

3800 commits

Author SHA1 Message Date
Tomaz Canabrava
aaa70ff56e Turn the get taxonomy button into a manage dive site button
The get taxonomy button will be inside the manage dive site interface.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 17:58:46 -07:00
Tomaz Canabrava
028f0401f6 Disable profile when in dive site edit mode
I didn't have time to create / finish the photos widget, so
I'm adding back the profile view while in dive site edit mode,
but disabling it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 17:58:30 -07:00
Dirk Hohndel
c22adebebe Merge branch 'gitMerge' 2015-08-25 13:57:12 -07:00
Dirk Hohndel
0db80103ca Add spinner while opening or saving cloud storage
Right now this is quite ugly. And at least in my VM the transparency
doesn't seem to work correctly. But at least we now have some visual
indication that we are doing something while opening or saving cloud
storage.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 13:07:20 -07:00
Miika Turkia
bde2e93f8f Seabear import: remove excessive amount of parameters
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:59:38 -07:00
Miika Turkia
5bda148020 Remove excessive amount of parameters
This removes the excessive amount of parameters on manual CSV import. We
just use appropriate string array than can be directly fed to XSLT
parsing.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:59:15 -07:00
Dirk Hohndel
e03b553e80 Make created dive site uuid deterministic
Having random uuids seemed like a good idea, but there are several
situations where they really cause problems. One is merging dive file
imports from V2 logfiles. Another is testing such imports.

Instead of making the uuid random we now hash the name and add the
timestamp of the first dive associated with this dive site to the hash
(first in this context is "first encountered" with no guarantee that it is
the chronologically first). This way V2 imports create deterministic uuids
but uuid conflicts are still extremely unlikely, even if the user has
multiple dive sites with the same name.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:43:48 -07:00
Dirk Hohndel
2f540b56a8 Merge branch 'custom-print' of github.com:neolit123/subsurface 2015-08-23 07:38:11 -07:00
Joakim Bygdell
898ea6acb5 Recmode: Disable gas switch options
Gas switch is not part of recreational mode, so disable the switch options.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-23 07:20:48 -07:00
Joakim Bygdell
d969cacfe2 Indent "Conservatism level"
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-23 07:20:39 -07:00
Gehad elrobey
f45fdc8660 Printing: disable template editing for statistics templates
Editing statistics templates is not supported now, as there is no
custom template for statistics printing, so disable the template
edit area.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:37:48 +03:00
Gehad elrobey
b6d3735204 Printing: enable UI elements that now can be used
The new statistics code, enable the editing of colors, font, and other
template options.

This patch enables the UI elements for these features.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:36:58 +03:00
Gehad elrobey
69f2921ffa Printing: use the same code for both statistics and divelist print
- use the same generic code for both types of templates
- check for the printing type before generating the template
- remove unused printStatistics() method

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:36:19 +03:00
Gehad elrobey
6a692495c0 Printing: add statistics templates to the dialog
Show the existing templates based on the print type selected
by the user.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:34:34 +03:00
Gehad elrobey
90852e114c Printing: fix typo in template name
Template names was capitalized, so change the file name to
"Custom.html" instead of "custom.html"

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:32:28 +03:00
Dirk Hohndel
ccd2cb2502 Continue to separate logic code from UI code
We don't want to call into the MainWindow from C code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-22 07:05:13 -07:00
Robert C. Helling
3437666010 Display error messages in planner
After a replot, check if there is an error message to display.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-21 10:16:06 -07:00
Tomaz Canabrava
0f096d0e53 Save Properties for each State of the mainWindow
Each state can have the same widgets but with different
properties - currently I'm using "enabled" : true and false
for the DiveSiteEdit, it looks like a big amount of code
for such a small thing but it was the cleaner way that
I tougth of doing.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-21 07:37:15 -07:00
Claudiu Olteanu
55353bda40 Add implementation for device discovery agent initialization (Windows)
Register the metatypes needed for Windows platforms and initialize
our custom device discovery agent.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:45:58 -07:00
Claudiu Olteanu
7a7d492525 Get a pretty print message when a device discovery error occured
Try to get a pretty print message when a device discovery error
is raised and it is unknown.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:45:55 -07:00
Claudiu Olteanu
baa45472a2 Add implementation for BTH device item selection on Windows platforms
When a Bluetooth device is selected from the discovered list
display information about its address and enable the save button.
On Windows we don't need to check if the devices are paired because
the pairing process is done automatically on the connection step.
If the devices are not paired Windows will ask for user's permission
to continue the process.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:45:51 -07:00
Claudiu Olteanu
5f60a688c6 Use the address of the BTH device if its name is empty
There are moments when the name of the device is not collected
properly and it is unavailable. Instead of showing an empty string
then print the address of the device.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:45:45 -07:00
Claudiu Olteanu
13083fb524 Add implementation for add remote Bluetooth device handler
On Windows we cannot determine the pairing status of the
device. Therefore we print only information about its name
and about its BTH address.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:45:42 -07:00
Claudiu Olteanu
c0b169e0a3 Wait for BTH device discovery thread to finish on stop call
We should wait for the WinBluetoothDeviceDiscoveryAgent completion
when the stop method was called.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:45:39 -07:00
Claudiu Olteanu
74187657e5 Initialize WinSock and hide the information about the local device
On Windows we cannot select a device or show information about the
local device. Therefore we disable the UI section related to local
device details.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:45:37 -07:00
Claudiu Olteanu
2af14ba445 Add implementation for our custom BTH device discovery service
Implement a custom lookup service for remote Bluetooth devices
discovery. This will be used on Windows platforms to collect
information about the name and the address of a remote Bluetooth
device.

In the beginning we initialize the queryset with the necessary
flags and we start the lookup service. When a device is discovered
we collect information about its name and its address and we
raise a signal with it using the same signature as the one emitted
by QtBluetoothDeviceDiscoveryAgent implementation.

Finally we end the lookup service and we reset the internal flags.

This code was written with the help of the sample code documenting the
relevant APIs provided by Microsoft Corporation at
https://code.msdn.microsoft.com/windowsdesktop/Bluetooth-Connection-e3263296
which is under the MS-LPL. No code from the samples was copied and the
code in this commit is covered by the GPL and not the MS-LPL.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:45:34 -07:00
Claudiu Olteanu
7488f5500e Add skeleton for Bluetooth custom serial implementation on Windows platforms
Add a skeleton which will be used to develop the Bluetooth custom
serial implementation for Windows platforms.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:45:20 -07:00
Claudiu Olteanu
69c81ed8e4 Reimplement pairingFinished method
The old implementation didn't use the correct deviceLabel pattern.
When the pairing status of a device was changed the name of the device
was missing from the new label. With the new implementation when the
pairing status is changed we replace the old state with the new one and
maintain the device information from the old label.
Also we set the same pairing background colors used in the
addRemoteDevice callback. In this way the label's state is consistent
and the UX is improved.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:45:13 -07:00
Claudiu Olteanu
a83f59ff09 Clear the BTH discovered devices list on each search
Clear the Bluetooth discovered devices list on each search.
In this way we will show only the devices that are in range
and active during the last scannning. Also if we clear the
list before each call we don't need to check anymore if the
discovered device is already in the list.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:45:11 -07:00
Claudiu Olteanu
14ca6a4e77 Check the last error when the BTH device scanning is finished
If there is no error reported when the device scanning is finished
then report to the dialog status that the scanning finished
successfully. Otherwise report the last error.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:45:07 -07:00
Claudiu Olteanu
9f043f4a93 Cleanup Bluetooth local device and the discovery agent on exit
Do some extra cleanup when the BtDeviceSelectionDialog is
destroyed.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:45:04 -07:00
Sander Kleijwegt
dbf2868dee Restore selection after renumbering dives.
After renumbering any number of selected dives, the selected
dives would still be selected, but this was not visible from
the divelist view. Clicking on subsequent dives would deselect
them while the GUI shows them as selected, any further action
like delete would not be done on the visible selection, but
on the invisible dive->selected state, leading to apparently
very weird behaviour.

Fixes #917

Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-19 10:11:38 -07:00
Robert C. Helling
72806e42bc Replace global in_planner variable by helper function
as promised earlier

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-18 06:42:01 -07:00
Dirk Hohndel
d93984448c Merge branch 'boyle-ready' of https://github.com/Slagvi/subsurface
Fixed merge conflicts in
	deco.c
	dive.h
	planner.c

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-17 21:45:51 -07:00
Robert C. Helling
a8ce8c3ef1 Some unification between Buehlmann and VPM-B
This patch makes deco_allowed_depth() work both for Buehlmann as well as
VPM-B (as long as the VPM-B internal variable total_gradient[] is valid).
As a bonus, in VPM-B mode, in the planner, the ceilings are VPM-B ceilings
and not Buehlmann GF.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-15 09:10:29 -07:00
Jan Darowski
6856e87689 VPM-B: Add conservatism levels to the ui. Fix planner settings disabling.
Conservatism level can now be changed from gui, is saved in settings.
Also way of disabling the planner settings in the ui was improved
to support more deco models and be called at the widget creation.

Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-08-15 15:16:51 +02:00
Dirk Hohndel
2455a5dec7 Merge branch 'custom-print' of github.com:neolit123/subsurface 2015-08-15 05:22:07 -07:00
Gehad elrobey
31df69c401 Printing: disable ui elements on statistics print
Disable all the UI elements for "dive list print", disable
all the template settings as well, Template Edit button
will be enabled after statistics print supports color palettes.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:04:34 +03:00
Gehad elrobey
59eddc6259 Printing: export border to templates
As there is a problem with sizing the borders in QWebView, "vw" sizing is not
working as supposed with border-width, As a workaround we export border-width
dynamically, so that border-width is relatively the same for all page sizes.

The border-width is equal to the page width / 1000 which gives a nice range
for borders for A0 - A5 papers, Also prevent drawing zero pixel borders
and use 1 px borders as the minimum border.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:04:11 +03:00
Gehad elrobey
de889b90ad Printing: rename "Table cells" to "Table cells 1"
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:03:01 +03:00
Gehad elrobey
5194401112 Printing: make default borders black
Make all borders black by default.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:02:46 +03:00
Gehad elrobey
0fadfae754 Printing: replace dark and light colors
Make dark colors for headers while lighter colors for data fields, this
is more intuitive, and makes the palettes more appealing.

Make dark color default for cells2

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:02:37 +03:00
Gehad elrobey
1dbe10fe27 Printing: add another color in color palettes
Add another color 'Table cells 2' to the color palette, make all the
backgrounds solid white by default.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:02:30 +03:00
Gehad elrobey
1a2f154cf4 Printing: add statistics print
Add statistics table print option.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:02:28 +03:00
Gehad elrobey
88c19adc78 Printing: hide warnings in dive profile while printing
While printing only draw headings, SP changes, gas events or bookmark
events, otherwise don't show anything.

Many warning logos can hide the useful information especially in
templates with small dive profile area.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:02:10 +03:00
Tomaz Canabrava
0aafa2556e Remove title of the dive site tab edit
There's no need to show the 'dive site' name on the group box

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-15 05:02:07 -07:00
Gehad elrobey
1d22bdc08c Printing: fix TemplateEdit color selection bug
When choosing a color from the QColorDialog, the TemplateEdit trigger to
change the current selected template to be custom, and then changes the
selected color. When the selected template is changed old template
values are copied to the current template which results in incorrect
behaviour.

This is fixed by checking for the current editting state before setting
the saved palettes as the current used palette.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:02:04 +03:00
Gehad elrobey
dd7bae378e Printing: fix wrong custom palette index
The custom palette index is defined by the CUSTOM directive, and it
should be used.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:02:01 +03:00
Gehad elrobey
55f09f0106 Printing: don't save invalid colors
When QColorDialog is closed with 'Cancel' button, it returns invalid color
that must be discarded. So check if color is valid to prevent replacing
the current color with black.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:01:58 +03:00
Tomaz Canabrava
86f61a6664 Minor code cleanup.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-15 05:01:33 -07:00
Tomaz Canabrava
b62cf45d59 Change colors of stars if widget has focus
Some widgets on the main tab don't show any kind of focus indicator on
some systems (like Mac), so it's a good thing to provide another way to
show that they indeed have focus.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-15 05:00:30 -07:00
Tomaz Canabrava
25273a3912 Remove obsolete comment
We don't allow building against Qt4 anymore.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-15 04:59:23 -07:00
Tomaz Canabrava
ed30059183 Add DiveSitePicturesModel
This model should be used inside the Edit Dive Site mode.
It should display all photos from all dives that are part
of this dive site, ignoring trips.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-15 04:59:01 -07:00
Miika Turkia
7e50711bd3 Set proper mode for file open dialog
Fixes #913

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-09 23:55:53 -07:00
Miika Turkia
1f4267d093 Update the text if DC changes
When switching from one DC to the next, the text of DC name is not updated due
to commit 487ddce353. This patch re-inserts the
call to updateText() for the specific function to get the DC name updated
properly.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-09 23:55:27 -07:00
Robert C. Helling
260ea879e5 Make debugging cleaner
Don't try to connect the globe when NOMARBLE is active.

Check exisistance before trying to open an image file.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-03 22:19:36 -07:00
Dirk Hohndel
faa1c28100 Another fix to build with NO_MARBLE
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31 11:15:35 -07:00
Dirk Hohndel
3efafd1fde Enable building with NO_MARBLE again
This was broken in commit 7efa924067 ("Transform GlobeGPS in a static
instance() class").

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31 11:01:57 -07:00
Tomaz Canabrava
5c1acca212 Fixed layout spacing issues.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31 10:32:09 -07:00
Tomaz Canabrava
e8720c2918 Repopulate the labels on the globe after an edit
Strangely, it still doesn't show the flag where it should be
(but it shows just after a reselect, so it's mostly a cache
issue somewhere)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31 10:31:19 -07:00
Tomaz Canabrava
fa6e1d5506 Paint the coords-widget yellow after clicking on the globe
When we clicked in the globe and changed programatically
the text on the coordinates edit widget, the background
was still white instead of the bright yellow that it should
have to show that it was modified.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31 10:31:00 -07:00
Tomaz Canabrava
c13e5d069c Save the gps edit into the current dive_site
The accept method didn't save the gps edit even if we
put correct text on it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31 10:29:33 -07:00
Tomaz Canabrava
f8b64da136 Change the coordinates via globe.
Now when the user selects the dive site edit, the globe
will enter in edit mode too.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31 10:29:17 -07:00
Tomaz Canabrava
2faff7ceae Add a button to pick the coordinates via globe on the dive site edit
It's a placeholder for now, but next commit will make it work.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31 10:28:28 -07:00
Tomaz Canabrava
7efa924067 Transform GlobeGPS in a static instance() class
This is needed to start easing the transition from the completely
wrong and bogus MainWindow::instance()->globe() calls. this is still
wrong, but with it I removed one level of indirection.
I did that now because I wanted to not taint the location management
when I use it to deal with the globe.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31 10:28:17 -07:00
Tomaz Canabrava
9130ff8a97 Correctly update the dive when the user edits dive_site
We didn't correctly update the dive site as soon as the
dive_site edit finished, and this time we are actually
correctly updating things using signals instead of calling
the mainwindow for everything.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31 10:27:16 -07:00
Tomaz Canabrava
7834341562 Remove unused signal
And move things around, informationManagementEnded was a good name
but endEditDiveSite is better.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31 10:27:01 -07:00
Tomaz Canabrava
9cf31a4d73 Remove unused action on the mainwindow.
The Manage dive sites action should be in the View menu because it makes
more sense to "view dive site edit"

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31 10:26:08 -07:00
Dirk Hohndel
64aace63f0 Don't connect to the MainWindow
We really shouldn't need to connect to the MainWindow in order to get the
right scale for the fonts when printing. While printing likely will remain
a desktop only function, this is just bad design. And making calls like
this from the paint() function is a bad plan, anyway.

So instead we make sure that every DiveTextItem knows what the printScale
was when it was created (or actually, when the text was first set as they
frequently get created before we have a scene which we use to get to the
profile), and gets updated whenever that scale changes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-29 12:21:27 -07:00
Dirk Hohndel
487ddce353 Profile: make sure text is scaled correctly when drawn
We had all this wonderful code to scale the text correctly, except we went
out of our way to make sure the code wouldn't be called unless something
changed on this specific text item. But that's bogus because the scaling
depends on external factors like the fontPrintScale.

So instead of calling updateText() when attributes of this DiveTextItem
change simply call it right before the DiveTextItem gets painted.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-29 10:59:28 -07:00
Dirk Hohndel
ccaff3a06d Make gradient factor text an independent item on the profile
Having it as part of the DiveCalculatedCeiling class caused us to manage
this text 17 times (and plotting it 17 times) which is rather silly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-29 10:31:34 -07:00
Dirk Hohndel
be47ce6241 Printing: add new default color scheme
This is based on the Subusrface logo colors, keeping the hue and modifying
the saturation and value in order to get what to me looks like a fairly
pleasant color setup.

This is an attempt to come up with a good default. By all means, this is
supposed to be a starting point to make it better, not a decision on what
the colors should be. I would however claim that they are better than the
previously available options :-)

I like the idea of basing this on our existing colors - but even that is
up for modification if someone has a better proposal.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-28 10:48:29 -07:00
Miika Turkia
921041163b Seabear import: fix detection of empty lines
The old code trusted in Windows new lines with length of 3. The new code
strips out spaces and line ending chars resulting in empty line being
of length 0.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-28 09:32:53 -07:00
Lubomir I. Ivanov
01645d64b9 Printing: safer Template->Import|Export handling
Check if the file string is empty and return, else process it.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:39:49 +03:00
Gehad elrobey
39ec9f8a52 Printing: select current template upon importing
When importing a template, make it the user currently selected template.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:39:35 +03:00
Gehad elrobey
f8378927b5 Printing: choose first template if selected template is not found
If user selected template is not found, we choose the first template as
a default choice.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:39:30 +03:00
Gehad elrobey
ed5afc510e Printing: don't name color templates with confusing numbers
Use the color_palette enum instead.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:39:25 +03:00
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
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
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
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
a05e37188b QML UI: make sure the dive list is empty before loading dives
When testing subsurface-mobile on the desktop from an account that had a
default file set up in the Subsurface preferences that file would already
be loaded creating rather confusing output.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-24 13:18:30 -07:00