Commit graph

479 commits

Author SHA1 Message Date
Dirk Hohndel
bd11988f74 Cloud storage: warn the user if we are not online
This isn't perfect, but at least tells the user if we weren't able to
connect and are working just off the local cache.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16 14:09:37 -07:00
Dirk Hohndel
3b018204f2 When done reverse geocoding, hide the notification
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10 12:30:02 -07:00
Gehad elrobey
d88da53586 Fix building with NO_MARBLE issue
We can't build with -DNO_MARBLE after some previous commit broke
globe.cpp

- centerOnCurrentDive() is still existing in the code while removed from
header in 6b81fb49d0.

- Some referenced to MainWindow::instance()->globe() even if we are
building with no marble.

- include stdint.h

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-09 11:22:41 -07:00
Tomaz Canabrava
d9801b67b4 Select the correct dive in EditAddedDive mode
If we added two dives, and then tried to edit
the first added one, the current 'added dive'
set on main_tab would be the second one, so when
we got to the accept() part of the call, it would
reselect the last added_dive that we had.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-07 08:04:37 -07:00
Tomaz Canabrava
6b81fb49d0 Always send the UUID of the coordinates to the globe
We were relying in the current_dive to display the
globe coordinates correctly - but this is not always
the case: you can be inserting a new dive site and it
isn't yet inside of the dive until the user presses
accept. So always pass the uuid of the dive site that
we want to display.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-07 08:04:32 -07:00
Tomaz Canabrava
d29d2a43ec Connect the signals
Connect the signals and slots so we can use the stuff I programmed.

Sorry for the noise on the patch - most of this is whitespace
fixes done by the QtCreator.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03 21:48:09 -07:00
Tomaz Canabrava
ddc7717ab8 Remove broken method
This method was written a long time ago, now we need to use the new
versions of it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03 21:46:50 -07:00
Tomaz Canabrava
7507c96dcd Do not trigger a dive site change when setting a dive
When setting a dive, we fire the dive site change a few times after the
index of the QComboBox is changed; we don't need that - fire just once.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03 21:31:51 -07:00
Tomaz Canabrava
a0c396f5cf Don't clear the underline model of the combobox
Clear was the right method to call when we used a line edit, and the line
edit didn't had a model to provide data. Calling clear() on a QComboBox
will delete all itens inside of it, and what we wanted was to choose an
invalid index - and that's -1

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03 21:31:10 -07:00
Tomaz Canabrava
744ab4bc48 Remove commented out code
This code was commented out when I started to port the locations to new
code, and it's harmless to remove it now.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03 21:30:12 -07:00
Tomaz Canabrava
1ee96f4ad6 Don't rely on current_dive to get the dive site id
Since we are modifying the dive site inside of the dive, we can't ask the
dive for the new one, and we also can't use the name of the dive site, as
there's the possibility that two or more could have the same name, so rely
only on the index of it to get the uuid. The index is variable since we
will sort the dive_site_table alphabetically, but this doesn't matter
since we are using it only temporarely to get the uuid, and this one never
changes.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03 21:28:04 -07:00
Tomaz Canabrava
ef10490e03 Update KMessageWidget to KF5
The KMessageWidget that we used was from an ancient version of KDE4, KF5
is out for quite a while, so it's good that we also update our software
that uses parts of KDE.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03 21:26:31 -07:00
Tomaz Canabrava
6cd85d9b73 Simplify model handling and crashes fixes
So, there's only one crash left (that I put a big TODO: on the maintab.cpp
about) and I'll fix it tomorrow as it's quite late here and I'm almost
sleeping at the keyboard.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-01 21:36:48 -07:00
Tomaz Canabrava
b8092c07a4 Create a new DiveSite when user clicks on add
Also reorganized a bit of the code, and renamed a few misleading methods.

[Dirk Hohndel: remove some C++11 code]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-01 13:24:37 -07:00
Dirk Hohndel
96cffe88e7 Fix crash
With no dive sites we dereference a NULL pointer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-31 16:12:56 -07:00
Tomaz Canabrava
ad9d1a81a2 Don't ask for a GeoCoordinate when editing a dive
This should be asked when we are in dive_site_edit mode.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-31 16:03:07 -07:00
Tomaz Canabrava
636aac83f8 We are not using a completer for location anymore
So, remove it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-31 16:00:16 -07:00
Tomaz Canabrava
80fe3f88f9 Correctly set the dive site id on the dive
When changing the index of the combobox we were discarting the
dive_site_id. This fixes it.

Now I need to understand what's happening to the globe.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 20:59:47 -07:00
Tomaz Canabrava
b0d7d0f3b9 Fix the connections for the Location Edit
The LocationEdit now correctly connects to the QComboBox signals, not the
QLineEdit signals.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 20:59:30 -07:00
Tomaz Canabrava
ac6a7ab24e Update DiveLocationModel when thread finishes
This patch updates the DiveLocationModel when the
GeoLoockupInformationThread finishes, and also selects
the correct index for the displayed dive.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 20:59:11 -07:00
Tomaz Canabrava
88549d1874 Change the Location from a LineEdit to a ComboBox
And hook up every method that was changed.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 20:58:38 -07:00
Tomaz Canabrava
ffc0c8ee99 Move DivePictureModel to qt-models
This class will surely be used on the mobile version, and it was very
tangled inside divepicturewidget.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:14:27 -07:00
Tomaz Canabrava
37bd82f623 Fewer rebuilds triggered by changes in models.h
Models.h now is quite minimal, I'll keep it like that for now, until it
grows huge again. I've also cleaned a bit the headers that are using it so
only the ones that actually need the stuff that I've left behind will
actually include this file.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:13:44 -07:00
Tomaz Canabrava
257f8063c4 Move ExtraDataModel to qt-models
Another attempt to make it easyer to create the mobile version.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:11:26 -07:00
Tomaz Canabrava
d84ffa8fc3 Move WeightModel to qt-models
One more step to make it easyer to port the app to Mobile.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:11:12 -07:00
Tomaz Canabrava
f432b764e7 Move DivePlannerModel and CylinderModel to qt-models
Still trying to make it easier for the Mobile Port:
This patch is a bit bigger than I hopped, but it was the smallest that I
could get.

A lot of TODO items where added where I broke the code because the current
implementation would break the QML implementtion on the designer. I'll
most probably fix those myself when I finish the transition to the models
to the new folder.

I only moved both models at once because there's an interdependency
between them (seems inevitable, tough, but I'll take a better look at it
later).

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:09:13 -07:00
Salvador Cuñat
64ba7f8683 Correctly save dive rating after changing it
Corrects typo in ebaa7d1fd which impeded that changes in dive rating
were saved after editing.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 16:12:37 -07:00
Paul-Erik Törrönen
cfa5403192 Fix typo
Loockup -> Lookup

Signed-off-by: Paul-Erik Törrönen <poltsi@777-team.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-21 16:05:09 -07:00
Tomaz Canabrava
253d9ff300 Use the QtWaitingSpinner instead of blocking the MainTab
We shouldn't allow the user to change the location when we are probing
the web for the correct places if we are updating an old file from
Subsurface. This makes use of a pleasant spinner that works beautifully.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 15:02:57 -07:00
Tomaz Canabrava
c2f77353ee Better name for the disable/enable geolocation edit
'enable' and 'disable' is too generic, and we are only
blocking the geolocation edit.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 15:00:45 -07:00
Tomaz Canabrava
96850b9931 Don't enable the widgets before finishing the thread
The maintab should be disabled when the geolocation thread is
running - but if you changed the dive, it would reenabled it.
(actually this should be only on the location widget, I'll send
another path later)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 13:42:53 -07:00
Tomaz Canabrava
2b99ae5781 Fix signal connections
I don't know what happened to me, I connected to some signals that didn't
exist at all.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 13:42:09 -07:00
Dirk Hohndel
ebaa7d1fd0 Multi dive edit: treat buddy and divemaster as tag lists
So just like tags do "differential editing". Figure out what (or in this
case, who) was added / removed from the displayed dive and do the same for
all other selected dives.

This does seem a bit over top for divemaster, but this is more consistent
and therefore should make more sense to the user - assuming we ever have
one who runs into this.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-11 10:40:20 -07:00
Dirk Hohndel
4c588c1f00 Improve multi dive tag list edits
The old behavior was kind of crude. Just smack the tags that were on the
displayed dive on all selected dives.

This seems to make more sense. We figure out which tags were added to the
displayed dive and add them to all selected dives. And we remove all tags
that were removed from the displayed dive from all selected dives.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-02 12:18:12 -07:00
Dirk Hohndel
415abeea66 When deleting a cylinder, adapt gas changes
When we delete a cylinder the gas changes in that dive may have to be
adjusted. We didn't do this at all in the past. With this commit we should
be doing this right for a single dive that is being edited.

This does NOT handle multiple dives being edited at the same time (or more
specifically - if you have multiple dives selected and delete a cylinder,
the dives that had the same set of cylinders (other than the displayed
dive) will get that particular cylinder deleted, but won't have their gas
change events (and sensor data in the samples) adapted.

Possibly we should simply prohibit deleting cylinders when more than one
dive are selected.

See #834

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-23 15:27:21 -07:00
Dirk Hohndel
ab24c1df87 When editing the location, make sure it gets applied to the dives
Oops, that was embarrassing. Just setting it on displayed_dive doesn't
gain us anything if it isn't transferred to the selected dives.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-22 09:35:58 -07:00
Lubomir I. Ivanov
bc44dd8db1 maintab.cpp: fix editing dive profiles from trips
Once a manually added dive is part of a trip and this trip
is edited, applying the modifications leaves the dive profile
in edit mode (e.g. points can be dragged and gas swapping can
be applied).

The issue can be viewed from another angle. Why enable
profile edits of a manually added dive which is in a trip,
while the trip is being edited in the first place?

If there are more than one manually added dives in said trip
we are enabled to edit one of the dive but probably
it's not intended to modify all manually added dives after the
changes are applied for the trip.

This patch disables the functionality in question and it also...

Fixes #864

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-30 12:54:36 -07:00
Dirk Hohndel
84aab5ffed Correctly create a dive site with the name entered on the Notes tab
The char pointer was out of scope by the time we created the dive site.
Also remove the misleading comment above - it really makes sense to do
nothing in that function.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-16 10:51:41 -07:00
Tomaz Canabrava
6fbf5b33cc Remove redundant code
Another snippet that shouldn't exist.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 07:47:00 -07:00
Tomaz Canabrava
a5448ef729 Remove dead code.
This code used to trigger the edit mode a long time ago
since now I'm re-reading the code to implement the
same stuff on the Location edit mode, I realized that
this is not needed anymore.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 07:46:50 -07:00
Henrik Brautaset Aronsen
961bac9233 Rename the tab "Dive info" to "Info", and "Dive notes" to "Notes"
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-14 11:18:53 -08:00
Dirk Hohndel
f81e2c111d When updating the dive site name, show this on the maintab
If we accept a change on the dive site management screen, it needs to be
reflected on the Dive notes tab right away.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13 23:50:31 -08:00
Dirk Hohndel
be1b6c67c1 maintab change for get_dive_site_uuid_by_name
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13 14:27:34 -08:00
Dirk Hohndel
4e95beabc2 Remove coordinates from main tab
It seems to make sense to only have them on the dive site screen. For the
main UI they were redundant (we have the map) and not all that useful. The
only time people would want them is if they wanted to manually add GPS
coordinates for a dive, but that should now be done via the dive site UI.

There are a couple of FIXMEs in the code and a few code blocks that have
been commented out as they will be needed in one form or another once this
GPS handling is done on the dive site UI, which right now it is NOT.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 22:45:47 -08:00
Dirk Hohndel
32da12664d Switch components for cut/paste dive to dive site logic
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 21:11:51 -08:00
Dirk Hohndel
0e6345f65b Correctly connect the maintab to dive site management
We now have a working uuid - use it. And populate the fields accordingly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 11:19:27 -08:00
Dirk Hohndel
5c4d266060 Make editing a location work with dive sites
Not sure if this is the final implementation, but at least for simple
cases it works now.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 11:19:27 -08:00
Dirk Hohndel
ccf833b45c Clear the location if we have no dive site
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 11:19:27 -08:00
Dirk Hohndel
9ef81d3ed3 Show GPS coordinates based on dive site on MainTab
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 11:19:27 -08:00
Dirk Hohndel
6a812c6b6d Show location based on dive site on MainTab
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 11:19:27 -08:00
Tomaz Canabrava
42afb4972a Pass a fake dive site UUID to the callback.
This is the start of the preparations to edit the dive site,
passing a uuid so we can retrieve it later.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
68691c9d6d Accept / Cancel location edit
Make it possible to cancel or accept the location edit and
get back to the mainwindow default state.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
7d66dcd12d Enable the location edit widget on mainwindow
Clicking on the 'Manage' button now brings you to the widget to manage it.
Nothing has been added on it yet.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
194dd8bd97 Finish the cleanup of mainwindow.ui
This is the last patch in the series of clearing up the
mainwindo.ui. Now to bugfixing.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:46 -08:00
Tomaz Canabrava
6b038c2a9a Remove the ProfileWidget from mainwindow.ui
It is now in mainwindo.cpp

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
c30aee1ae5 Remove the Globe from the mainwindow.ui
Now it's started from mainwindo.cpp and it's part of the
new states

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
cf4d55c470 Remove the DiveList from the mainwindow.ui
It's now set up from the mainwindow.cpp file.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Dirk Hohndel
585d6a004b Only update tags in the selected dives if they were changed
If current_dive and displayed_dive still have the same tags then we
shouldn't touch the tags of other selected dives.

Fixes #826

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 06:31:37 -08:00
Miika Turkia
414b9807e6 Do not go to edit mode if nothing changed
Fixes #804

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-02 07:06:56 -08:00
Robert C. Helling
1e45858ee6 Update ceiling when changing dive mode
Without this patch, the user effectively cannot change the dive mode as
any change is overwritten by replot copying current_dive over
displayed_dive. The way out is not to call replot but only update the deco
ceiling directly.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-31 14:09:50 -08:00
Gehad elrobey
f16f4e2f6e Don't go to edit mode if the dive notes field didn't change.
The maintab view should be consistent; some fields just go to edit mode
whenever they acquire focus and most of them wait till their values are
changed.

Change the dive notes field to be consistent with the other fields and
only enter edit mode if its value is changed.

[Dirk Hohndel: changed to use same_string()]

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-30 17:03:03 -08:00
Anton Lundin
991531d847 Let notes expand to full with fbsupport off
This hides the whole QWidget with the share-to-fb button in it. This
lets the Notes field expand to the full width.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-28 07:36:34 -08:00
Dirk Hohndel
1b3c776358 While editing the coordinates we need to compare to the displayed_dive
Comparing to the master dive only made sense when we immediately modified
a dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-19 21:03:42 +12:00
Dirk Hohndel
df46b85ee1 Don't just change the location when double clicking on the globe
Instead be consistent with other parts of the code and put us in editing
mode so the user can accept / reject the change.

See #800
Fixes #801

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-19 17:38:17 +12:00
Dirk Hohndel
83018619d6 Always updated the coordinates from the displayed_dive
That's why it's called the displayed dive...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-19 17:17:01 +12:00
Dirk Hohndel
f9ceff009b Clean up the header files
Lots and lots and lots of header files were being included without being
needed. This attempts to clean some of that crud up.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-18 21:25:59 +12:00
Dirk Hohndel
abddb3ecb9 Make Facebook support a config option
By default it is turned off, turn on by calling qmake with
CONFIG+=FBSUPPORT.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 08:43:49 +13:00
Robert C. Helling
f2939dd991 Minor PSCR fixes
Update O2 metabolsim rate and adopt default gas switch depths to
pSCR oxygen drop.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 08:17:29 +13:00
Dirk Hohndel
bccbdf8264 Don't use current_dc unless you know there's a current_dive
This will crash if for some reason current_dive is invalid.

And in general, when displaying information, we want to use the correct dc
in the displayed_dive, not the current_dc, which references the
current_dive...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-11 07:29:29 -08:00
Robert C. Helling
e219bc70f8 Refactor dctype -> divemode
... and repair a failed rebase (sorry).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10 17:27:25 -08:00
Robert C. Helling
bfe05b4340 Replot after changing divetype
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10 17:27:24 -08:00
Robert C. Helling
0f7f2195d5 Add setpoint events according to divetype
When changing to a CCR dive, add a setpoint change to the default setpoint
at the beginning of the dive. Otherwise add an explicit setpoint change to 0
.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10 17:27:24 -08:00
Robert C. Helling
a478eb5711 Maintab combobox to set dive type
still needs some work

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10 17:27:24 -08:00
Miika Turkia
9e2e62ec4f Initialize edit hack variable
The accepting mode variable must be initialized to false to allow
editing of dive data.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04 23:19:52 -08:00
Miika Turkia
fdd152af71 Make sure we do not fall back to edit mode on accept
On Ubuntu 14.04 the edit mode does not exit successfully when applying
the changes. It instead jumps back to edit mode (even though hiding the
option to apply/discard changes again). So let's just have a flag to
prevent faulty behavior.

Fixes #786

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04 10:53:10 -08:00
Dirk Hohndel
71f3a29819 Trip editing: zero out potential previous edits
This was silly; if we rely on this to be zero to indicate no change then
we better zero it out when we start editing.

Fixes #805

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04 06:43:36 -08:00
Dirk Hohndel
ccfea0872d When editing trip data, only copy actual changes
We zero out the displayedTrip and only copy changed data into it; so a
NULL value is not deleted text, it means there was no change.

Fixes #805

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-03 16:06:00 -08:00
Dirk Hohndel
57b49a7833 Fine tune some spacing
Now that we set the margins everywhere, the manual corrections here aren't
needed. At the same time, the spacing for the labels looks better if it is
a tiny bit more generous.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02 22:24:50 -08:00
Tomaz Canabrava
ed903c42b9 Facebook integration: Always ask for a folder before sending the photo
This way we are sure that the upload was made in the correct folder.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 09:05:53 -08:00
Tomaz Canabrava
571f86485d Move the Facebook send profile button
Move from the Dive List context menu to the Dive Info tab, it will only
appear when connected to Facebook.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 09:05:08 -08:00
Dirk Hohndel
87febd33be Carefully create some forced margins
We don't want to waste space, but we don't want things to be too crammed
together, either. Especially not having horizontal margins for text can
look very awkward.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-23 10:16:11 -08:00
Tim Wootton
93d59c22d7 Match agreed captalisation style
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25 07:57:33 -08:00
Dirk Hohndel
bf14d31804 Make the button labels for apply / cancel of edits more consistent
Before you could 'Cancel' the edit and then would be asked if you wanted
to 'Discard' your changes or 'Cancel'. So clicking 'Cancel' cancelled the
action of having clicked 'Cancel'. That's so confusing, it's even hard to
explain. Yes, it uses "typical" language for user interaction and kind of
makes sense, but it's not easy to understand for the non-technical user.

With the new labels the user is asked to whether they want to 'Apply' the
changes or 'Discard' them. And when they choose 'Discard' the verification
question is still 'Discard' or 'Cancel'. That seems much more consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-23 07:45:17 -08:00
Dirk Hohndel
3ddbab6847 Clarify the meaning of the values in the stats tab
Extend the tooltips to be shown both on the labels and the values and add
tooltips for all min/avg/max elements.

To avoid confusion when only one dive is selected, no longer show min SAC
or max SAC or min duration or max duration.

Fixes #694

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 18:44:51 +00:00
Dirk Hohndel
0c3f13d128 Add the ability to modify the cylinder use in the UI
Thanks to Tomaz for writing a first draft of the delegate.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 14:03:37 +00:00
Dirk Hohndel
44a154f7da When editing cylinders, copy all relevant data
Maybe it would be better to just copy the whole structure and then clear
the things we don't want to copy? This seems fragile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 10:45:14 +00:00
Dirk Hohndel
7196176fa0 Correctly copy weight systems on edit
We copied the string pointers instead of copying the strings. Once those
got freed, things went downhill.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 10:41:02 +00:00
Tomaz Canabrava
82a946152b 727 fixed
--047d7b8737f87ede8e050803e6b2
Content-Type: text/plain; charset=UTF-8

<div dir="ltr"><br></div>

From 3db4a422485374801ca2f6233ec23b8671a8656d Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <tomaz.canabrava@intel.com>
Date: Sun, 16 Nov 2014 23:22:58 -0200
Subject: [PATCH] fix 727 - position correctly the popup.

When the user entered a tag and that made the message box display
the popup with the possible choices was still in the old position
hidding the line edit.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 06:02:21 +00:00
Lubomir I. Ivanov
200699706e maintab.cpp: use copy_string() instead of strdup()
The .location and .notes fields can end up being NULL,
in which case copy_string() is safer.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 11:59:35 -08:00
Anton Lundin
0b0e5d834f Reorder initializers to be more c++-strict
c++ have some idea about in what order things should be initialized.
This makes us comply with that order.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-08 11:17:11 -08:00
Dirk Hohndel
45251ec724 Show extra data in separate tab on MainTab
This way any extra data probided by the dive computer is visible to the
user (without other processing). This data cannot be edited by the user as
it reflects the information given by the dive computer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:00:58 -08:00
Dirk Hohndel
d643bde61a Always copy data in copy and paste mode
While in a multi dive edit we want to apply our usual semantics (only edit
things that are the same as in the current dive), when doing an explicit
copy and paste that doesn't seem to make sense. So we manually override
that behavior.

Fixes #753

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-05 07:13:20 -08:00
Dirk Hohndel
c9e7528370 Change tank editing behavior for multi dive edit
Previously we only applied the type of tank (description, volume, working
pressure) to all selected dives where the tank description matched.

With this patch we also copy the gas mix into all matching cylinders.

Additionally this addresses the issue that we should have a separate copy
of the cylinder description string for each dive.

Fixes #754

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-04 15:05:16 -08:00
Dirk Hohndel
dfc7ee0b29 Delay replot of dive so changes aren't overwritten too early
When changing tanks we triggered a replot - but that overwrote the
displayed_dive with the current_dive before the remaining data from the
displayed_dive was used to edit the current_dive.

So now we delay this until later in the function, this way copy of paste
of both tanks and weights works.

Fixes #753

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-03 09:47:24 -08:00
Dirk Hohndel
6ce0afb99c Don't call strdup on NULL by mistake
Hunting down a different issue I managed to cause a crash here when trying
to copy a string that ended up being NULL.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-01 22:36:42 -07:00
Dirk Hohndel
fa5c713f73 After editing tags, get the right tags into the displayed dive
We forgot to clear out the pre-existing tags. We did this for the actual
selected dives that were being edited, but not for the displayed_dive, so
deleted tags showed up again on screen (even though they were correctly
deleted from the selected dives in the dive list).

Fixes #732

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30 13:03:50 -07:00
Dirk Hohndel
71d21c375c Recalculate the decompression if the date / time of a dive changes
The pre-existing tissue load going into a dive can change if the start
time of a dive changes. Therefore we need to recalculate the ceiling when
editing start time (or date) of a dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 17:40:11 -07:00
Dirk Hohndel
e1db94ea0c Correctly edit dive date/time when editing manually entered dives
While the existing code worked fine for editing that start date or time of
dives downloaded from a dive computer or imported from some other source,
for manually entered dives this did not work and the date or time was
always reset to the original time once the changes were saved.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 17:34:53 -07:00
Gaetan Bisson
ae6b0468b1 Report CNS in dive info tab
This adds a maxcnsText widget under infoTab and populates it.

Note that I manually edited maintab.ui to display CNS and OTU
next to each other and right after gas data.

Signed-off-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:16:44 -07:00
Tomaz Canabrava
214bd0ed6e Re-enable the edition of the Date after editing a trip.
Since we can't edit the trip date, we need to remember to
re-enable it after we disable it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-23 08:10:47 -07:00