Commit graph

3524 commits

Author SHA1 Message Date
Anton Lundin
c3f6fcb0bf Fix NO_PRINTING when printing is disabled in Qt
Qt for android doesn't have any printing support, so this fixes
NO_PRINTING so we can build against a Qt without any printing support at
all.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-01 09:00:13 -07:00
Dirk Hohndel
48c79d19b8 Building without Marble: don't try to connect a signal to the globe
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-29 09:41:33 -07:00
Dirk Hohndel
65babff6bc Dive site rewrite: be smarter when dealing with auto created sites
If we download dive site locations from the companion app we can be
slightly smarter if the user overwrite the location feel on the Notes tab.
We can be pretty sure that they wanted to keep the GPS location and just
correct the dive site name (or possibly assign that location to an
existing dive site).

This tries to accomplish that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27 23:19:49 -07:00
Dirk Hohndel
fbc3b5242d Globe: use lighter and darker flags to mark the current dive site
This may be too subtle... the current dive site now has a brighter flag
than the others. I may need to make it an even bigger difference or maybe
make the flag a little bigger or something... but it's a start.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27 22:53:39 -07:00
Dirk Hohndel
ee8f7de4e7 Add missing return statement
We act on the event but don't consume it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27 16:05:24 -07:00
Anton Lundin
f04b3bc166 Add support for importing O2 sensors from CSV file
This adds support for importing individual O2 sensors from a CSV file,
e.g. an APD log viewer file.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27 14:42:05 -07:00
Dirk Hohndel
1f0c9eec96 Preferences dialog: yet another attempt to make it fit
Designer is such an utter piece of crap I am at a lack for words.
After a few hours with a real UI tool (i.e., vim) I have the preferences
dialog reasonably close to where I want it. It's still not perfect, but at
least it no longer contains tons of unused space, it fits fine on a
1024x768 screen and it is visually consistent across the different pages.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27 14:37:43 -07:00
Dirk Hohndel
485df96cf6 Dive site rewrite: mark location field as soon as editing starts
Don't wait until the user switches focus to a different part of the tab to
mark the location field.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27 06:53:11 -07:00
Dirk Hohndel
65aab8199f Globe: change the logic to remember the current zoom value
We start out with our default. If we zoom out because of no GPS data, we
remember the now current zoom value, but only if we aren't in the middle
of a "flight". If we are in the middle of a flight we simply keep the last
value we remembered - that means we might forget a user made change, but
at least we won't suddenly remember a random number as our zoom value.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 20:29:13 -07:00
Dirk Hohndel
a5e3a6fd5e Globe: only remember the last zoom if we are not flying
No point in remembering the "current" zoom while we are flying to a new
position. Also make sure you remember things before we start a new flight.

Finally, set the radius to 1000 which is what Marble recommends for a zoom
that shows the whole globe.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 20:28:42 -07:00
Dirk Hohndel
5fc31f6afc Globe: reset the view when called with no divesite
Returning here was simply wrong; we need to zoom out.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 20:23:33 -07:00
Dirk Hohndel
0afe07d021 Dive site rewrite: make trip location edit work
Don't erase the trip information after the user started editing it.

Don't act as if a dive was edited - it's trip information we are
modifying.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:23 -07:00
Dirk Hohndel
89599b81ac Dive site rewrite: clearing the location field means no dive site
If the user wants to remove the dive site from a dive they need to be able
to do that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:23 -07:00
Tomaz Canabrava
dee59e5334 Dive site rewrite: fix adding a new dive and chaning notes / description
I had to create an event filter to deal with the missing callbacks from
QPlainTextEdit (it doesn't support editingFinished()).

Also we need to manually create a dive site on a newly added dive if the
user entered one.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:23 -07:00
Dirk Hohndel
c2f7702805 Dive site rewrite: add short explanation to quick dive site edit widget
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:23 -07:00
Dirk Hohndel
ae5b965b60 Dive site rewrite: remove superfluous connect
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:23 -07:00
Tomaz Canabrava
fd31e7792e Dive site rewrite: change the default sizes of the dialog
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:23 -07:00
Tomaz Canabrava
4426cf706f Dive site rewrite: do not use Qt Model Match
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:23 -07:00
Tomaz Canabrava
7763b95e5f Dive site rewrite: fix potential crash
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:23 -07:00
Tomaz Canabrava
0592771005 Dive site rewrite: add forgotten file
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:22 -07:00
Tomaz Canabrava
1fd4e55240 Dive site rewrite: copy the changed dive site to the original
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:22 -07:00
Tomaz Canabrava
78293f5078 Dive site rewrite: create a dive site if string doesn't exist
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:22 -07:00
Tomaz Canabrava
50bd467723 Dive site rewrite: mark location as changed when a dive site changes
Not sure this is the best approach.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:22 -07:00
Tomaz Canabrava
73eceacaed Dive site rewrite: better member name
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:22 -07:00
Tomaz Canabrava
05c5bf0919 Dive site rewrite: try to fix a crash
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:22 -07:00
Tomaz Canabrava
2fec1a88de Dive site rewrite: copy the current dive to the displayed dive
This way we can actually edit something.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:22 -07:00
Tomaz Canabrava
09f2d3b35d Dive site rewrite: fill and change the current dive site
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:22 -07:00
Tomaz Canabrava
6afd9161e8 Dive site rewrite: correctly position the edit site widget
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:22 -07:00
Tomaz Canabrava
32928b3880 Dive site rewrite: create a dive site edit dialog without borders
Plan is to make it pretty later.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:22 -07:00
Tomaz Canabrava
266e754d08 Dive site rewrite: remove a ton of code from the LocationManagement
The way I was doing the old location management was very dull: everything
was tangled on the mainwindow. Now I think I've found the correct way to
create this, and thus, this code can die.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:22 -07:00
Tomaz Canabrava
4c7ce4aa1d Dive site rewrite: change add icon to edit
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:22 -07:00
Tomaz Canabrava
3435d13509 Dive site rewrite: add the taxonomy labels for the dive sites
This doesn't work yet because we don't get the taxonomy from the geo
referencing services yet - but it's ready to be populated.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:50:14 -07:00
Tomaz Canabrava
e28af7c639 Dive site rewrite: use a QCompleter to show the list of dive sites
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:49:59 -07:00
Tomaz Canabrava
8bd9fb161a Dive site rewrite: location edit on notes tab is again a LineEdit
Hopefully we now have the UI semantics figured out.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 18:49:46 -07:00
Rick Walsh
425020d2de Add only switch at required stop option
Add the option to only switch at required stop to the planner UI.  This is not actually used yet.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26 06:14:24 -07:00
Dirk Hohndel
ea1f75d8d6 Don't show datafile version warning if no file was opened
Also remove most of the hard new lines in the text so it flows better
depending on the font size used.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-25 10:55:40 -07:00
Dirk Hohndel
e5f4697f91 Rewrite GPS fix matching code for imports from our webservice
The longer I stared at the existing code the less it made sense.
So instead I rewrote it in a way that seems logical to me. And added a
boatload of debugging output (which needs to be removed, of course).

I tested this against more than a hundred dives and it seemed to always
pick the right fix.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-24 22:38:44 -07:00
Dirk Hohndel
4bdead6ad6 Avoid possible use of uninitialized variable
Errorcode doesn't get set if duppedfd is negative. So let's just issue an
error and bail.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 22:23:04 -07:00
Tomaz Canabrava
21c46b8c2d Preferences infrastructure for GeoManagement
Simple preferences infrastructure with default prefs, prefs and hooks for
the Qt Settings system and our preferences ui.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 17:11:51 -07:00
Tomaz Canabrava
ce4333e8fd Defaults for the Preferences dialog for GeoCoding
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 17:11:30 -07:00
Tomaz Canabrava
a19bbcc715 Add configuration options for geo coding
Just the interface changes for configuration options for geo coding.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 17:10:33 -07:00
Tomaz Canabrava
e27f9ab0a6 Show warning if user loads an old datafile
Show the user a warning if he opens an old version of the divelog
file, the warning tries to explain some things that are different
on the new version.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 17:09:48 -07:00
Tomaz Canabrava
7071bf0e23 Do not mess with dive location automatically
This might be what the user wanted, but also might not
be it. So wait for the user to request it manually.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 17:01:52 -07:00
Tomaz Canabrava
35a4ef88be Create layout on parent, not on items around it
Correctly handles resizing of interface items by
creating the layout on the parent instead of selecting the
items and applying the layout around them.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 17:01:24 -07:00
Tomaz Canabrava
5d236d6475 do not set default sizes for expanders
This was creating a lot of empty spaces on the preferences
dialog and making Dirk unhappy.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 16:59:59 -07:00
Dirk Hohndel
979eb464b3 Cloud storage: update File menu options once PIN is verified
The code didn't trigger the update routine after PIN verification, only if
just email/password were shown. A simple oversight. This is fixed now and
so the visibility of cloud open and cloud save options should refelect
whether verified credentials are in the preferences or not.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 14:04:31 -07:00
Dirk Hohndel
90f20f4c76 Better error handling
Most of these will likely have no big impact, but it's better not to just
ignore them as they could lead to crashes.

Uemis downloader: if lseek fails, return 0
Uemis downloader: consistently check for failure to open req.txt
Zip file handling: dup could fail

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 10:57:56 -07:00
Dirk Hohndel
64c7202e2d Address of array is always non-NULL
We want to test the string instead.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 10:57:56 -07:00
Dirk Hohndel
1ecc9b0cc0 Address uninitialized member warnings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 10:57:51 -07:00
Dirk Hohndel
a4168ed591 Preferences: don't show error when resetting cloud email / password
Empty values won't work, of course, but they aren't an error, either.

Fixes #887

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 06:42:35 -07:00