aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/simplewidgets.cpp
AgeCommit message (Collapse)Author
2015-08-19Restore selection after renumbering dives.Gravatar Sander Kleijwegt
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-06-21Initialize membersGravatar Dirk Hohndel
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-14Fix renumbering of divesGravatar Dirk Hohndel
The implementation in commit 182fe790c9e8 ("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-05-17Move Locationinformation to its own file.Gravatar Tomaz Canabrava
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-04-24Allow images to be added via the webGravatar Robert C. Helling
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-24Cleaning up variable names in image loadingGravatar Robert C. Helling
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-03-17simplewidgets.cpp: fix a -Wreorder warningGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-15Added warning when not all images can be added.Gravatar Jan Darowski
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-15Refactored image timestamp checking.Gravatar Jan Darowski
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-10Change the diveSiteMessage to show close or accept/rejectGravatar Dirk Hohndel
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-10Clean up the UI when finished editingGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Turn the toolbar back on after editing a dive siteGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Don't call enableEdition() every time a change is madeGravatar Dirk Hohndel
We only need to do this once. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Don't enter dive site edit mode whenever the coordinates are set in the UIGravatar Dirk Hohndel
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-10Clear after accepting / rejecting the LocationEditGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Change color / mark widget as changed correctly on LocationEditGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Clone a bit of code to mark the Location Widget changedGravatar Tomaz Canabrava
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-10Do not show the Edit mode message when entering location management screenGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-28Add ability to undo renumbering of divesGravatar Grace Karanja
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-17simplewidgets.cpp: QLineEdit::setClearButtonEnabled() is from Qt5.2Gravatar Lubomir I. Ivanov
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-14Add ability to undo shifting of dive timeGravatar Grace Karanja
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-13Don't add empty dive sitesGravatar Dirk Hohndel
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-13Make sure there is a dive site if you try to edit itGravatar Dirk Hohndel
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-13Fix crash when adding a diveGravatar Dirk Hohndel
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-13Allow editing of dive sitesGravatar Dirk Hohndel
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-12Switch components for cut/paste dive to dive site logicGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Correctly connect the maintab to dive site managementGravatar Dirk Hohndel
We now have a working uuid - use it. And populate the fields accordingly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Copy the name and the coords when entering the EditDiveSite stateGravatar Tomaz Canabrava
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-11Accept / Cancel location editGravatar Tomaz Canabrava
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-11Create simple class to hold the location management.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Remove the ProfileWidget from mainwindow.uiGravatar Tomaz Canabrava
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-10Remove information panel from mainwindow.uiGravatar Tomaz Canabrava
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-10Remove the DiveList from the mainwindow.uiGravatar Tomaz Canabrava
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-01-17Clean up the header filesGravatar Dirk Hohndel
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>
2014-12-24Changed Facebook stuff to socialnetworks.h/cppGravatar Tomaz Canabrava
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-24Create a Facebook album for SubsurfaceGravatar Tomaz Canabrava
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-18Connect Tagfilter to its parrentGravatar Anton Lundin
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-18Switch to having ui as member in MultiFilterGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-16Removed leftover qDebug()'sGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-16Put manual set-point changes at negative time at start of diveGravatar Robert C. Helling
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-09Make filter for filter criteria case insensitiveGravatar Dirk Hohndel
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-01Context menu entry to change setpointGravatar Robert C. Helling
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-01A widget to add a set-point changeGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17Clarify the meaning of the values in the stats tabGravatar Dirk Hohndel
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-16Improve the filter message and placementGravatar Dirk Hohndel
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-16Addded a min / max layout for the filter, and a filter countGravatar Tomaz Canabrava
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-13When closing the filter window also clear the filterGravatar Dirk Hohndel
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-13Suits Widget created and working.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13Move the filters code to it's own file.Gravatar Tomaz Canabrava
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-11A bit of code cleanup.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>