This hides the calendar widget when the user press esc
when it's running.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds a event filter to hide the calendar
widget when it loses focus
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Also fix the setWindowFlags calls - those are not incremental, so you need
to call the method once and combine the flags.
I would also like ESC to close the calendar widget, but haven't figured
out how to do that...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Also adjust the minimum size, given I changed this in commit
26855234ac ("Make date widget easier to read").
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch makes tha calendar stay on top at all times.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch makes the click on pic == open picture browser works
also on the profile instead of only on the list view..
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Too much noise on the headers, this commit remove uneeded
headers when they are uneeded.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This small patch listens to EnabledChange to gray out the
date picker when the widget is in disabled mode, and to
paint the widget colored when it's on enabled state.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Also, clean a few calls, this should make the widget a tiny
bit faster. This patch also moves the grayImage function from
the star widget to the global scope, so I can use it on the
Calendar widget.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added focus handling for the date picker, this way the user
can use the keyboard to change the date. ( still not implemented )
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added a popup widget to change the calendar date, just like
the old QDateTimeEdit.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This widget shows a date in a better way that it was done
in the old widget, much more elegantly.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit breaks the loading of images that were done in the divelist
into smaller bits. A bit of code refactor was done in order to correct the
placement of a few methods.
ShiftTimesDialog::EpochFromExiv got moved to Exif::epoch dive_add_picture
is now used instead of add_event picture_load_exif_data got implemented
using the old listview code. dive_set_geodata_from_picture got
implemented using the old listview code.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add new methods to the MinMaxAvgWidget class to allow us to override the
default tooltips of its min and max icons, and then uses these methods to
make the tooltips for the Stats tab Depth instance more descriptive.
See #521
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
No attempt is made to ensure that what the user does is sane. So this can
result in duplicate numbers, non-consecutive numbers, non-monotonous
numbers, whatever floats the users boat.
You can renumber a single dive or all selected dives (with a starting
number given that is applied to the oldest selected dive and then for each
newer selected dive that number is incremented by one).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
DateTimeOriginal should be used as first option when loading images.
When images are modified, the original time should be retained, but the
DateTime will change to the edit time.
See #495
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fixing the Hotkeys inconsistencies in subsurface, All the popups should
react to 'esc' and 'ctrl-w'/'cmd-w' as 'cancel'. also 'ctrl-q'/'cmd-q'
should quit subsurface.
Fixes#489
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Adding the ability to close the shift times window, also Quit subsurface
with this window in front.
See #489
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This marks a lot of todo's where I think there's core stuff being mangled
on the interface - we should remove this from the interface to make
testing and maintenability easier.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds the current dive time and the adjusted time to the time
shift window. I added a function to dive.c to get the timestamp of the
first selected dive.
This will view the time of the first selected dive only even when multi
dives are selected but it does change the times for multiple dives
properly.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I know everyone will hate it.
Go ahead. Complain. Call me names.
At least now things are consistent and reproducible.
If you want changes, have your complaint come with a patch to
scripts/whitespace.pl so that we can automate it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In Qt5, Qt doesn't define TRUE/FALSE anymore, so we need to stick to
stdbools to have Qt5 builds working.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Some digital cameras do not set the DateTime exif field bat use
DateTimeOriginal. If the first option is not found, use the second one
to try to detect the moment when the image was shot.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I get compile errors from these lines. Removing the class name from the
calls allow me to compile the current master.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
C++ style of accessing single instance class object.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds an entry to the dive list context menu to load images. The user
can select image files and set a time offset to align camera and dive
computer clocks.
Using the exif time stamp the images are tried to match to the times of
the selected dives (with a grace period of an hour before and after the
dive). Upon success an event of type 123 is created per image with the
string value being the path to the image. Those images are displayed as
thumbnails in the profile. If the matching dive does not yet have a geo
location specified but the image provides one it is copied to the dive
(making the camera a poor man's companion app).
This patch includes easyexif https://code.google.com/p/easyexif/ which is
originally under a New BSD License to parse the image meta data.
This commit includes a new test dive dives/test31.xml with a matching
image wreck.jpg to try out the functionallity.
Obvious to do's:
Have images on the map
Have the images clickable
Have a proper picture viewer
Give visual reference for image time shifting.
Use the new profile
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Another futile attempt to cleanup the code and make coding style and
whitespace consistent. I tried to add a file that describes the key points
of our coding style. I have no illusions that this will help the least
bit...
This commit should ONLY change whitespace
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Subsurface creates a lot of singleton instances on demand, but nothing
ever deleted them. Since they are singletons, these memory allocations
are technically not leaks. However, they clutter the output in valgrind
and other memory analysers, hiding the real issues.
The solution is to delete these items at exit. For the models and for
gettextFromC, the solution is to use a QScopedPointer, which will delete
its payload when it gets destroyed. For the dialogs and other widgets,
we can't do that: they need to be deleted before QApplication exits, so
we just set the parent in all of them to the main window.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In commit 85fab31c71fc ("Shift times of selected dives") we added a dialog
that didn't align its content very well. This change improves the layout
(I hope) and makes the labels in the layout clearer (earlier and later seem
easier to correlate with the direction of the shift).
The original commit also forgets to deal with the consequences of shifting
the dives. The dive list needs to be re-sorted (as the relative order of
dives could have changed) and be marked as changed. And we should try to
maintain the selection across these operations.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds the possibility to shift the times of all selected dives
by a fixed amount to correct for time zone problems or mis-set dive
computer clocks.
Select the dives and right click in the dive list.
[Dirk Hohndel: added .ui file to FORMS and fixed some whitespace damage]
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I just went thru all of subsurface code removing
some whitespaces issues and trying to make the
code prettyer, I also removed a few QString issues.d
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This means we don't have to new/delete them, which is a waste of
overhead.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This means we can also remove the forward declarations.
This is the first step in removing the memory allocation for the ui
sub-classes. Without the second step, this commit is just making the
compilation time increase for no good reason :-)
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The Gtk+ style on the Gnome shell is somewhat broken on Qt for
some reason. This hack pokes the system, checks if it's running
gnome-shell, and if the current style is gtk+ ( I couldn't just
check for gtk+ since it worked on XFCE and other Gtk based enviro
ments. so a double check is needed. ) then I changed the Pallete
of the affected widgets by hand.
not a pretty hack but worked.
[Dirk Hohndel: redid the patch to be simpler and more consistent]
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This code adds a Renumber Dialog, that's most a copy & paste
of the GTK visual, I didn't tried to do anything fance with it,
but I still dont like how it looks like. a better management
form is needed. :)
( Well, actually my dislike is mostly because it's on a menu
and it's on a popup, I think a 'toolbox' should exist to hold
all of those widgets that don't belong to the menu - will try
that later )
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>