Commit graph

122 commits

Author SHA1 Message Date
Dirk Hohndel
a6e9db196f Initialize members
Globe: initialize doubleClick member
ShiftTimesDialog: initialize when (not sure this could be a problem)
SetpointDialog: dc could be uninitialized or could be 0 and dereferenced

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21 22:31:03 -07:00
Dirk Hohndel
8d05c71ca2 Fix renumbering of dives
The implementation in commit 182fe790c9 ("Add ability to undo
renumbering of dives") looks perfectly reasonable, but it depends on an
implementation detail: it assumes that the keys of the QMap are returned
in the same order in which they were placed there. Which apparently isn't
the case for some version of Qt.

With this commit we simply remember both the old and the new number for
each dive and therefore the order in which they are processed doesn't
matter.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-14 21:49:34 -07:00
Tomaz Canabrava
5eb572b9c6 Move Locationinformation to its own file.
The SimpleWidgets file was getting too big, and location information will
also need a new model - a good way to do not mix everything is to put
things in a new file.

[Dirk Hohndel: added missing include of stdint.h]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 13:51:13 -07:00
Robert C. Helling
757c4aab20 Allow images to be added via the web
This adds a new divelist context menu entry which asks for a URL. The file
is retrieved and if it is an image it is added to the cache and the url
is associated to dives as with local files.

NB this currently only works with URLs pointing directly to images. But it
should not be too hard to add the possibility to add a direction via an html
file and its image tags.

To test: open dives/test43.xml and delete the image and then add the URL
http://euve10195.vserver.de/~robert/wreck.jpg

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-24 09:36:21 -07:00
Robert C. Helling
a0a3c6ec15 Cleaning up variable names in image loading
Use more explicit variabel names and make the get timestamp function actually
return the timestamp rather than getting a pointer argument

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-24 09:35:35 -07:00
Lubomir I. Ivanov
d2b8fb31eb simplewidgets.cpp: fix a -Wreorder warning
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-17 09:28:47 -07:00
Jan Darowski
0d77b921eb Added warning when not all images can be added.
Added label in the ShiftImageTimesDialog which appears when
not all of the selected images have timestamp in the checked range.

Made cancel button in this widget actually work.

Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-15 15:47:37 -07:00
Jan Darowski
7d37a3f5a6 Refactored image timestamp checking.
Seperated getting image timestamp from picture_load_exif_data() and
ShiftImageTimesDialog::syncCameraClicked() into picture_get_timestamp()
and seperated checking timestamp from dive_create_picture() to
dive_check_picture_time().

Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-15 15:47:23 -07:00
Dirk Hohndel
b81647bd8a Change the diveSiteMessage to show close or accept/reject
This gives us consistent behavior and allows closing the dive site
management screen without editing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 11:35:05 -07:00
Dirk Hohndel
ca64f8a782 Clean up the UI when finished editing
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 11:09:25 -07:00
Dirk Hohndel
043ae4af27 Turn the toolbar back on after editing a dive site
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 10:50:56 -07:00
Dirk Hohndel
4796ee0c39 Don't call enableEdition() every time a change is made
We only need to do this once.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 10:50:18 -07:00
Dirk Hohndel
2c2adacb90 Don't enter dive site edit mode whenever the coordinates are set in the UI
This function was missing the check if setting that field actually changes
what's already in the data structure.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 10:49:21 -07:00
Tomaz Canabrava
500c4c2772 Clear after accepting / rejecting the LocationEdit
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 07:47:30 -07:00
Tomaz Canabrava
986b6c509a Change color / mark widget as changed correctly on LocationEdit
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 07:47:21 -07:00
Tomaz Canabrava
30c5a027ca Clone a bit of code to mark the Location Widget changed
This code is the same that is used on the MainTab, but
since they are different objects, I can't just call it.
so I'm duplicating them for the time being.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 07:47:05 -07:00
Tomaz Canabrava
53d20f5b8a Do not show the Edit mode message when entering location management screen
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 07:46:30 -07:00
Grace Karanja
182fe790c9 Add ability to undo renumbering of dives
Expand the undo feature by storing a list of renumbered dives' ids
and numbers so that the original numbers can be restored if needed.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-28 12:44:14 +01:00
Lubomir I. Ivanov
8053a61442 simplewidgets.cpp: QLineEdit::setClearButtonEnabled() is from Qt5.2
This could cause problems if the user tries to compile with
Qt versions between 5.0 and 5.2.

Reported-by: Michele Fabi <fabiemme@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-17 14:08:36 -08:00
Grace Karanja
87ee8e8aef Add ability to undo shifting of dive time
Adds the ability to undo shifting of dive times. The change is captured
at simplewidgets.cpp and an undo command is created.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-14 15:46:37 -08:00
Dirk Hohndel
3ea2e15bd2 Don't add empty dive sites
It makes no sense to keep them around, it makes no sense to have dives
refer to them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13 23:08:33 -08:00
Dirk Hohndel
cd77e2e700 Make sure there is a dive site if you try to edit it
If the user clicks on manage (or double clicks on the globe) and the
displayed_dive doesn't actually have a dive site associated with it (e.g.
because we are adding a dive or because it was imported or downloaded
without dive site information, then we need to make sure that there is an
empty dive site that we can make changes to.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13 22:45:31 -08:00
Dirk Hohndel
b60b4ef69d Fix crash when adding a dive
If a dive has no dive_site_uuid we would dereference a NULL pointer and
crash. Oops.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13 22:08:08 -08:00
Dirk Hohndel
32ad046f56 Allow editing of dive sites
And hook things up when double clicking the globe.

The user experience isn't consistent with what we do on the main tab
(i.e., no coloring of fields that are changed), but it seems to work.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13 14:27:35 -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
Tomaz Canabrava
d769c6016f Copy the name and the coords when entering the EditDiveSite state
Name and coords of the current dive are copied to the edit dive site
screen.

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
3516ff2ab2 Create simple class to hold the location management.
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
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
238c0573da Remove information panel from mainwindow.ui
Now it's created in the mainwindow.cpp as part of the new
way to configure the interface.

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
02d8dd5d13 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-17 23:00:43 +13:00
Tomaz Canabrava
ee5d93e155 Changed Facebook stuff to socialnetworks.h/cpp
All Facebook related stuff now is on SocialNetworks.h/cpp
this makes it much easier to implement things and looking
for bugs.

working:
- logging in
- getting user id
- getting album id ( or creating it )

*much* more testing is needed, of course.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 15:54:28 -08:00
Tomaz Canabrava
a76fdd8d54 Create a Facebook album for Subsurface
We still need to do a lot of stuff on that part.
Currently when asking for sending a profile, it will just
create a private album.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 07:32:36 -08:00
Anton Lundin
85d3817bd2 Connect Tagfilter to its parrent
This plugs another leak found by valgrind.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-18 08:34:00 -08:00
Anton Lundin
4599172a19 Switch to having ui as member in MultiFilter
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-18 08:33:35 -08:00
Robert C. Helling
a6fdd6220b Removed leftover qDebug()'s
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-16 07:08:21 -08:00
Robert C. Helling
9ad3e83c77 Put manual set-point changes at negative time at start of dive
Manually inserting set-point changes at negative times (left
of the profile) caused the setpoint to end up at stupid values
(probably some signed/unsigned confusion). This patch aligns
them with the start of the dive.

Fixes #774

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-16 07:07:49 -08:00
Dirk Hohndel
3f34af4bed Make filter for filter criteria case insensitive
When opening the filter dialog we allow the user to filter the choices
that are shown. The text that they enter in that filter for filter
criteria should be treated as case insensitive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-09 21:23:12 -07:00
Robert C. Helling
fb265c2929 Context menu entry to change setpoint
This patch adds a context menu entry to add a setpoint change
event. In particular, this can be used to turn a logged dive into
a CCR dive.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-01 14:23:45 -08:00
Robert C. Helling
96a94f1a19 A widget to add a set-point change
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-01 14:19:03 -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
ad603b6e9f Improve the filter message and placement
This makes the text easier to translate (and more meaningful).
Also modifies its position to be centereed in order to look less "squeezed
into the corner".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-16 18:36:42 +00:00
Tomaz Canabrava
7c5c38b154 Addded a min / max layout for the filter, and a filter count
But the filter count seems to be broken for some reason and
I really don't know why. It seems to work for tags, but
not for everything else.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-16 18:34:47 +00:00
Dirk Hohndel
2cd31a30f2 When closing the filter window also clear the filter
The tooltip already pretended that that's what it did...

Also make the tooltip wording consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 13:46:19 -08:00
Tomaz Canabrava
dee20906e3 Suits Widget created and working.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:09:58 -08:00
Tomaz Canabrava
10fecefddd Move the filters code to it's own file.
We already have a bunch of filters, let's pack them together

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:01:00 -08:00
Tomaz Canabrava
819d358f8c A bit of code cleanup.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:09:03 -08:00
Tomaz Canabrava
1841eb98b9 Make the close button work
clicking on the close button will close the widget.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:08:01 -08:00