Commit graph

3938 commits

Author SHA1 Message Date
Tomaz Canabrava
fdd28fddf2 Start to handle keypresses
Keypress management is one of the main functions of the completer, so we
must create an event filter and hook things up properly.
key esq / enter should close the popup (and not leave us with a popup open
and no way to close it - it breaks X)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 14:15:22 -07:00
Tomaz Canabrava
c4c7e7a7f4 Display the popup in the correct place
The popup should be shown beneath the QLineEdit. this code here
is shamelessy stolen from the QCompleter source code because I
really didn't want to rethink the correct way of doing this.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 14:15:22 -07:00
Tomaz Canabrava
012e8ccb46 Re-add the 'plus' button on the delegate
This was missing in the delegate - now it's prettier.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 14:15:22 -07:00
Tomaz Canabrava
8c9a4ecd4b Stabilize the location model/proxy model
Since I removed the old location edit from the UI, I also need to
remove a bit of code from the UI that was calling it.

fix a few crashes regarding the old location edit.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 14:15:19 -07:00
Tomaz Canabrava
be6e190bd2 Skeleton of the new LocationCombobox
This is the bare minimum skeleton of the new completer for the dive site
management. Nothing works, yet, nothing is hoocked up, yet.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 14:07:07 -07:00
Dirk Hohndel
a30e78140f Hide a couple of debugging messages
They are useful to show when trying to figure out what's going on, so just
move them behind a check for verbose.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 12:20:21 -07:00
Dirk Hohndel
c9f72e510a Show progress bar when loading from cloud storage by default
It turns out that I forgot to make sure that the progress bar is shown if
the user has things set up so that the cloud storage is the default dive
file that they open.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 12:16:45 -07:00
Dirk Hohndel
48e47c9048 Windows XP doesn't contain a valid CA for our cloud certificate
This is the authentication check and cloud server availability check which
are different from the one git does. The mechanism for overriding things
is different from there, but this should work just as well.

We intercept the SslErrors signal and if we get the known good hash for
our certificate, we simply call it good.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 12:11:20 -07:00
Dirk Hohndel
e66f0895c6 Dive merging: make sure that the profile is redrawn
This uses the just introduced refreshProfile() function.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-22 19:59:58 -07:00
Dirk Hohndel
aeac5fcb6d Add refreshProfile member function to MainWindow class
While the whole idea of calling these functions through the MainWindow
instance is atrocious, until we change the architecture of all this
refreshProfile() is a useful function to have.

In order to make this cleaner to implement I allowed an argument to
ProfileWidget's replot() which allows picking a specific dive. By
defaulting this to 0 we get the previous behavior when calling replot()
without an argument.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-22 19:58:14 -07:00
Linus Torvalds
34da4801f4 Be much more careful about merging dives
This patch changes the dive merging to be much more careful about
things, because it turns out that we had several small oddities that
caused big merge issues.

The oddities are:

 - the dive "duration" is actually how long we spend under water.

   But that means that when we do "dive->when + dive.duration.seconds"
   to calculate the end of the dive, that is nonsensical if you came up
   to the surface in the middle of a dive.

   Now, normally you don't see profiles like that, but once you start
   merging dives together, it can go from "small detail" to "dominant
   factor".

 - We have two different cases of merging: the automatic "merge new dive
   computer download if it looks like the same dive" (which always has a
   merge offset of 0, since we merge it as a new dive computer) and the
   "merge two different dives into one longer dive.

   The code assumed that it could look at the "downloaded" flag for the
   dive to check one or the other, but that doesn't really work.
   Reading a dive from an XML file isn't any different from downloading
   it.

   So we need to change the logic to determine what kind of merge it is
   to actually check the passed-in time offset.

With this, Stuart Vernon's test-case of eight dives with short surface
intervals in between end up merging correctly into one dive.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Stuart Vernon <stuartv@force2.net>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-22 19:36:54 -07:00
Robert C. Helling
e644fe5d97 Fix image offset calculation
It seems this has never worked and nobody ever tested it. There was some
confusion with time zones since Qt takes by default local time when
converting from/to epoch while the exif library used UTC.

For my single test dive, this works now. But this needs more testing!!!

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-21 10:26:11 -07:00
Dirk Hohndel
04773705e3 Fix build error on Windows with Qt5.5
I'm not quite sure why this works, but it appears to do the trick.
Apparently you are supposed not to have the meta type declaration in a
shared header file. Also, with Qt5.5 you can't have the declaration for
QBluetoothDeviceInfo, not even on Windows.

This may need more tweaking to make sure it works on all combinations of
OS and Qt version.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-20 15:08:14 -07:00
Dirk Hohndel
06d6ca94f3 When calling save-as with cloud storage as default, pick sane filename
Passing the cloud URL to the file select box leaves "git syntax" in the
filename which makes us look for a directory with a git repository in it
and give non-sensical error messages to the user.

With this we simply use the users email address as local filename with a
.ssrf suffix.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-20 10:15:34 -07:00
Linus Torvalds
e4d2092f33 Uemis downloader: start downloading using the correct dive ID
The logic to pick the initial dive ID for the uemis downloader was very
confused, and did not work at all when restarting a download when the
Uemis filled up, and the "Force download all dives" flag was set.  It
also required a rather odd Uemis-specific callback from the download UI
because of how it picked the initial ID.

This changes the logic to just look at the list of downloaded dives when
restarting, which simplifies the logic a lot, gets rid of the odd
special callback, and also means that the whole "Force download" issue
just goes away.  It seems to work now.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-19 21:30:33 -07:00
Claudiu Olteanu
a319c42310 Rename BTH_ADDR_STR_LEN macro
Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-19 09:43:33 -07:00
Claudiu Olteanu
89540e0fb2 Fix Bluetooth address truncation issues on Windows
On some Windows platforms when we convert a Bth address to a String
it is formatted as "(XX:XX:XX:XX:XX:XX)". Therefore we first try to
remove the round parentheses and finally we truncate the string
to 17 because there are 6 two-digit hex values and 5 colons.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-19 09:43:06 -07:00
Robert C. Helling
562dfa1c5d Spelling corrections
Spell Setpoint without space in user visable strings.

Explain authorized_paired.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-18 10:04:50 -07:00
Miika Turkia
e5caca8f49 Capitalize Bluetooth
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16 21:32:22 -07:00
Dirk Hohndel
54b50392f2 Printing: minor fixes as suggested by Lubomir
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16 21:32:22 -07:00
Gehad elrobey
f800c602d6 Printing: Remove braces around single lines in if/then
Remove useless braces around single line if/then.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16 21:18:00 -07:00
Gehad elrobey
bdedc97036 Printing: make statistics template editable
Now inplace edit is supported, so enable editing the "Default"
statistics template, Also show warning when editing this template.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16 21:17:41 -07:00
Gehad elrobey
d3c75f2c72 Printing: show warning message when editing bundled templates
When editing a bundled template show warning message.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16 21:17:35 -07:00
Gehad elrobey
27bec9bc7b Printing: support in-place editing for templates
Edit the templates into the same file, which is more intuitive as
Custom.html is a bit confusing.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16 21:17:22 -07:00
Tomaz Canabrava
5b77b162a3 Remove the fb preferences page if build without fb
Somehow I broke this.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16 21:16:58 -07:00
Tomaz Canabrava
d59e89e569 Make Facebook more user friendly
The current way that facebook works is terrible: it's scattered
around tons of files ( at least 4 different files and classes )
this moves things around a bit, add a disconnect button that
was missing, cleans tons of code and fix inconsistencies.

I will also redo this part for 5.0, but it's too late for 4.5

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16 21:16:58 -07:00
Salvador Cuñat
9fd7fc8b45 Use Bühlmann in all strings shown to the user
Unify spelling of this name in strings shown to the user, as commented
in mailing list. Internal coding use untouched.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16 21:16:58 -07:00
Anton Lundin
9f629b5e2e Change OSTC 3 config option to current models
Our OSTC 3 config code works for all hwOS devices, so be more clear when
saying that as the chooser option.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-12 14:02:42 -07:00
Anton Lundin
5472036931 Connect up custom serial in dc configuration
This connects up the custom serial code in the configure dive computer
dialogs.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-12 14:02:32 -07:00
Anton Lundin
a42df06dbf Lift dis- and connect out from config operations
When working with ostc's via bluetooth, they will reboot and exit
bluetooth mode when you send the disconnect command. Thats kinda
inconvenient when you would like to read your settings, change something
and write it back, you need to start bluetooth mode on your device
twice.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-12 14:02:12 -07:00
Sander Kleijwegt
6427564d33 Hide current dive site from dive sites with same coordinates.
Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-12 08:28:13 -07:00
Dirk Hohndel
af66ad9b6d CSV import: strip whitespace from column names before matching
In a user provided sample the last column name included "\r\n" which
prevented us from automatically matching that column.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-11 11:10:36 -07:00
Dirk Hohndel
c41810e5a5 When editing a manually added dive, correctly update max depth
The fixup_dive() function assumes that values that are set already in the
divecomputer and dive structures come from a reliable source - sometimes
dive computers are able to track a maximum depth continuously, so that
value can be larger than the deepest sample and we need to honor that.

But in the case of a manually added dive, the samples define the dive. So
in this case we need to reset the values that were calculated when the
dive was first added so that the user can then edit the dive and reduce
the maximum depth reached in the profile and have that reflected in the
dive list.

Fixes #926

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-11 10:54:05 -07:00
Robert C. Helling
654a7be834 Add checkbox to force images to match dives
Give the user the possibility to attach images to a dive even
when the times do not match

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-11 09:18:55 -07:00
Robert C. Helling
5a1c041b78 Don't offer gas selection for the last waypoint in planner
Since the gas selection list on a waypoint refers to a gaschange there
influencing the following segments, there must not be a gas selection
on the last manually entered waypoint since from there the planner
handles the gas selection.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-11 09:15:14 -07:00
Anton Lundin
c0c4b5c4b3 Configure divecomputers: add delegates for setpoint configuration
This adds delegates to simplify configuration of setpoint values in the
OSTC's.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 15:37:13 -07:00
Anton Lundin
444d0d6693 Configure divecomputers: access table data the same way as its set
The table data is set via role, so retrieve the data via role too.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 15:37:05 -07:00
Anton Lundin
e70b33a56b Configure divecomputers: fix spelling of First
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 15:36:54 -07:00
Anton Lundin
865c4aedee Save settings in closeEvent, not destructor
This switches to use the closeEvent to save settings and cleanup instead
of the destructor.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 09:40:04 -07:00
Dirk Hohndel
2025bc1b2b Replace the spinner with a progress dialog for cloud storage access
Since the spinner caused all kinds of problems inside VMs, wasn't shown at
all for some people on Win10 and appeared to get stuck a lot and still
left people with the perception that Subsurface was hung, this patch takes
a more traditional approach and gives the user a progress dialog.

An additional benefit of this is that the user now can cancel a hung
transfer.

The slightly weird passing in of the callback allows for the separation of
UI and core logic code...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 13:02:39 -07:00
Miika Turkia
ce608b7ecf Fix a crash on divelogs.de export
Subsurface crashes when multiple dives are selected on divelogs.de
export. The crash occurs on malloc that is called indirectly from
xmlReadMemory().

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 03:05:54 -07:00
Dirk Hohndel
708fd2fe84 Two small string changes
Reported by Ettore Atalan on Trnasifex.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 02:53:30 -07:00
Anton Lundin
7bbd60a4fd Only use DC_TRANSPORT_* with SSRF_CUSTOM_SERIAL
This if'defs DC_TRANSPORT_* use with SSRF_CUSTOM_SERIAL, because the
enum doesn't exist when building against stock libdivecomputer.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-08 13:27:53 -07:00
Claudiu Olteanu
a0e33bec71 Disable Bluetooth option from GUI if SSRF_CUSTOM_SERIAL is undefined
The Bluetooth implementation doesn't work if SSRF_CUSTOM_SERIAL
is undefined. Therefore it is a good idea to remove it from
the UI if the libdivecomputer version is wrong.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-08 10:15:35 -07:00
Claudiu Olteanu
a05cf2136d Reset the index of the device if the Bth mode is disabled
If the Bluetooth download mode was disabled then remove
the Bth address from the device or mount point section and
reset the index.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-07 07:29:29 -07:00
Claudiu Olteanu
9e97f124c6 Save Bluetooth download mode settings
Save the dive computer download mode flag. In this way,
if the user used Bluetooth mode to download its dives on
his last session he doesn't need to open the Bth selection
dialog if he wants to use the same device.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-07 07:29:15 -07:00
Miika Turkia
12a60cf9e6 Include dive site on divelogs export
Due to the new dive site management, we need to include this information
before transforming the XML to divelogs.de format.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-07 07:24:32 -07:00
Miika Turkia
c87b9645e7 CSV import: validate column count
We need at least 23 columns when reading in Subsurface CSV.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-07 07:23:53 -07:00
Miika Turkia
65267e6e9d CSV import: default formats for Subsurface import
Let's set the configs properly for Subsurface CSV import for better
usability. (Actually the only meaningful configuration is units as
others are discarded, but I could not figure out how to set that to
imperial when needed - what is the variable holding this information?)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-06 07:41:10 -07:00
Miika Turkia
f576c16f75 CSV import: show headers for Subsurface CSV import
Showing the header line improves user experience quite a bit, even
though this configuration is actually discarded in the XSLT transform.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-06 07:40:59 -07:00
Miika Turkia
67aca27501 CSV import: fix import of Sensus and Subsurface
When adding APD2 import, the Sensus and Subsurface indexes should have
been increased by 1. While fixing this, switch to using enum names for
clarity.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-06 07:40:54 -07:00
Miika Turkia
4a72ac2d2b CSV import: improve header parsing
The skipping of header field manipulation for APD was a bit too
aggressive, skipping the header fix up for all logs when on initial
state. Also, addition of APD2 was not taken into account.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-06 07:40:45 -07:00
Salvador Cuñat
e830cb421a Add ON and OFF strings to translation
In btdeviceselectiondialog.cpp ON and OFF strings need to be
translatables to avoid issues in the translation of the resulting
displayed string, as "turn on" and "turn off" translates to a single
word in most languages.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-05 07:43:12 -07:00
Tim Wootton
800cfc50d6 Style & spelling changes to printing
Signed-off-by: Tim Wootton <tim@tee-jay.org.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-05 07:43:11 -07:00
Tim Wootton
6a468b4d39 More style and readability changes
Changes to capitalisation to comply with coding style
Changes to make some blocks of english sound a bit better

Signed-off-by: Tim Wootton <tim@tee-jay.org.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-05 07:42:57 -07:00
Tim Wootton
8f6702d0b3 Style and readability tweaks to btdeviceselectiondialog
Signed-off-by: Tim Wootton <tim@tee-jay.org.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-05 07:08:20 -07:00
Dirk Hohndel
f3f4cf17f4 Fix typo in UI string
Reported-by: Pedro Neves <nevesdiver@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-04 10:30:15 -07:00
Dirk Hohndel
1f81186dde Re-assign numbers for beta versions
After an incorrect upload I can no longer fix the source tar on launchpad.
Oh well, so now Beta 1 is 4.4.96. No big deal.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-03 07:40:14 -07:00
Dirk Hohndel
a5288fb60c Reintroduce the beta version naming hack
The changes in commit 3bcb634e06 were a bit over ambitious. There was a
reason why I had this hack in place and preparing for the beta reminded me
of that. Oops. Oh well. The code is back, adapted for the current release
cylcle.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-03 03:40:23 -07:00
Claudiu Olteanu
d1a4020ad5 Translate strings for Bluetooth download mode
Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-02 15:52:39 -07:00
Anton Lundin
9212458f23 Enable the configuration of more OSTC settings
This enables enables you to configure a couple more settings in the
OSTC devices, roughly corresponding to the new ones that can be
configured in the OSTC3 devices.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-02 15:26:26 -07:00
Anton Lundin
37953d163e Enable the configuration of more OSTC3 settings
This enables enables you to configure a couple of new settings in the
OSTC3 devices.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-02 15:26:20 -07:00
Anton Lundin
c69d5619ce Remove getters and setters in DeviceDetails
The DeviceDetails class is just a storage container for passing values
back and forth between backend and ui code. The different names between
the setters and getters just made it a pain to write nice macros and
keeping the two ends in sync, so this just removes the setters and
getters in favor of having the members public.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-02 15:26:06 -07:00
Tomaz Canabrava
6944084653 Make it possible to use Subsurface in height=768
Small, Small screen. why are you still used today?

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-02 15:25:44 -07:00
Dirk Hohndel
a1c023bee0 Event filters need to tell the caller if they took the event
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-31 19:24:36 -07:00
Dirk Hohndel
5670b5fedd Silly compile fix
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-31 19:24:23 -07:00
Tomaz Canabrava
2da439f34c Correctly refresh dive site list
And also show a warning to the user saying that that
action is non-cancelable.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-31 18:43:52 -07:00
Tomaz Canabrava
1ef20ee5d8 Merge the dive sites selected.
Wee. :)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-31 18:43:43 -07:00
Tomaz Canabrava
e36e4d1faa UI code to merge dive sites
Get the Qt data structures and convert to something
that we can use in our C - core.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-31 18:43:09 -07:00
Tomaz Canabrava
560426bf82 Offer the option to merge dive sites.
Almost finishing. :)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-31 18:42:56 -07:00
Tomaz Canabrava
b52b95f3ec Show the correct data on the Dive Site List
We where showing the UID, wich didn't made sense.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-31 18:42:32 -07:00
Tomaz Canabrava
a3d6098c8c Display dive sites with same gps as the current
So we can merge them later - currently we are showing
only the ID, ugly - fixing next.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-31 18:42:15 -07:00
Tomaz Canabrava
5db6d41598 Widget to show other dive sites at the same coordinates
Add a new widget on the dive site management view to
display all other dive sites at the same coordinates.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-31 18:37:45 -07:00
Anton Lundin
b7038e4bec Remove unneeded includes
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-31 15:12:18 -07:00
Dirk Hohndel
3bcb634e06 Remove about window have for Beta releases
Simply tag the beta versions correctly and none of this is needed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-31 10:36:49 -07:00
Sander Kleijwegt
d22a135343 Fix edit & show of divesites for new and existing dives.
The UI detects when it should refresh the loction after the
user finished editting a divesite. Creating and editting
divesites is now working even when the current dive is not
saved yet.

Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-29 20:10:32 -07:00
Sander Kleijwegt
9770369889 Always show the dive site edit button
Update the tooltip and enable only when there is a divesite selected

Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-28 16:16:05 -07:00
Sander Kleijwegt
67abcd0c2c Fix mouse clicks on divesite completer.
Use clicked instead of activated signal on the completerList to
handle the selection of a divesite.

Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-28 16:15:25 -07:00
Sander Kleijwegt
10d0604297 Fix crash when creating a dive site without any dives in logbook.
A divesite uuid is created using the timestamp of the currently
selected dive. When there is no current_dive, use the current
time to create a uuid.

Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-28 16:13:50 -07:00
Dirk Hohndel
035e08e633 QtBT: avoid crash at exit if no BT device found
If localDevice isn't valid we never initialize the discory agent, so
let's not dereference it in the destructor unless it is valid.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-27 09:23:38 -07:00
Miika Turkia
8e08fdcc85 Clean up CSV import parameters
Continuing the crusade against excessive number of parameters for some
functions. This should be the last of the import functions to be cleaned
up.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-27 08:59:44 -07:00
Sander Kleijwegt
57e15bf789 Explicitly show the menubar after mainwindow initialisation.
At least on Ubuntu with xfce instead of Unity this appears to be necessary
to get a menu bar for the application.

Fixes #833

Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-26 11:01:37 -07:00
Dirk Hohndel
a99839a4f1 Remove a couple of debug messages
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 18:15:24 -07:00
Tomaz Canabrava
b8a09ca520 Keep the dive list disabled if editing a dive
When, in a dive edit mode user entered a dive site
and went to dive site edit mode then finished the ds
edit, the app would lose the disabled property of the
dive list, making it possible to select a new dive
when we where editing another one, complete mess.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 18:00:26 -07:00
Tomaz Canabrava
fc6d819616 Create a new dive site and edit it automatically
If the user clicks on the first or second option of the drop
down list, subsurface will move him to the dive site edit panel
automatically, since it's a new dive site and there's no information
about it yet.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 18:00:15 -07:00
Tomaz Canabrava
0ba832ef12 Move dive site list to its correct position
When we are in display dive mode, and then edit the
location text edit, going to edit dive mode, the location
text edit will be moved a bit below of it's original position
but the Dive Site List would be already opened, and stuck
on it's original position, covering the dive list.
This patch fixes that.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 17:59:25 -07:00
Tomaz Canabrava
32db7e5fb5 Remove edit dive site from the menubar
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 17:59:15 -07:00
Tomaz Canabrava
03702edf87 Get taxonomy from edit dive site widget
Moved the get taxonomy button from the maintab to the edit dive site
widget.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 17:58:59 -07:00
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