Commit graph

30 commits

Author SHA1 Message Date
Dirk Hohndel
5ba573240f Gratuitous whitespace changes
I keep trying to get to consistenct.
Completely hopeless.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22 11:40:22 -07:00
Dirk Hohndel
b303f217a9 Dive list: add context menu function to renumber dive(s)
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>
2014-05-20 06:11:32 +09:00
Robert C. Helling
7e43a45293 Correct check for existence of DateTimeOriginal exif tag
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05 08:16:16 -07:00
Miika Turkia
cd98e4f6db Use original time if available on image loading
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>
2014-04-26 17:24:12 -07:00
Gehad
1306c0fecb Fixing Hotkeys inconsistency for divecomputer/pref/numbering windows
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>
2014-04-25 13:24:39 -07:00
Gehad elrobey
b4a04074c2 Closing shortcuts for shift times windows
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>
2014-04-25 10:52:09 -07:00
Tomaz Canabrava
f14c14c383 Mark a lot of TODO's where I think it should be moved to C code.
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>
2014-04-17 08:33:51 -07:00
Gehad
8ca4437624 Add current time and adjusted time to gui when adjusting dive's timestamp
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>
2014-03-21 21:26:09 -07:00
Dirk Hohndel
76e6420f6b Massive automated whitespace cleanup
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>
2014-02-27 20:09:57 -08:00
Anton Lundin
43997d3b36 Convert more TRUE/FALSE to stdbools true/false
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>
2014-02-19 07:13:56 -08:00
Robert C. Helling
226b55893d Make lastUsedImageDir static to prevent a crash
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-18 15:30:59 -08:00
Miika Turkia
28454889d9 Use DateTimeOriginal on image import
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>
2014-02-18 08:46:22 -08:00
Miika Turkia
1328b44d44 Fix compile error
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>
2014-02-18 08:46:08 -08:00
Robert C. Helling
bbb071f1e8 Compute dive computer/camera time offset from sample picture
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-17 10:59:30 -08:00
Robert C. Helling
fe2a264db3 Store camera time offset in preferences
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-17 10:56:43 -08:00
Boris Barbulovski
c86822c2f4 Replace mainWindow() with MainWindow::instance()
C++ style of accessing single instance class object.

Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12 11:42:59 -08:00
Boris Barbulovski
aeaa050306 ShiftImageTimesDialog class cleanup.
* Remove static ShiftImageTimesDialog::instance() method
* Add ShiftImageTimesDialog::amount() member

Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09 08:19:38 -08:00
Robert C. Helling
5c1abde2a5 Include images in profile
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>
2014-02-06 11:29:23 -08:00
Dirk Hohndel
a27f67c026 Whitespace and coding style updates
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>
2014-01-16 11:50:56 +07:00
Anton Lundin
7e9582631d Convert to TRUE/FALSE to stdbools true/false
I had problems with this one on Qt5.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-15 15:52:31 +07:00
Thiago Macieira
b22f1da59e Fix all leak-at-exit from singletons in Subsurface
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>
2013-11-30 09:28:42 -08:00
Thiago Macieira
ba88a3358d Fix memory leak of the MinMaxAvgWidgetPrivate
Found by Dr. Memory, run by Lubomir:
Error #63: LEAK 24 direct bytes 0x344f42e8-0x344f4300 + 0 indirect bytes
 # 0 replace_operator_new                             [d:\drmemory_package\common\alloc_replace.c:2421]
 # 1 MinMaxAvgWidget::MinMaxAvgWidget()               [qt-ui/simplewidgets.cpp:64]

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 09:25:11 -08:00
Dirk Hohndel
7d0cc6b337 Improve shift time functionality
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>
2013-11-18 10:03:55 -08:00
Robert Helling
4966336e1d Shift times of selected dives
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>
2013-11-18 10:03:45 -08:00
Tomaz Canabrava
1b9a4f2bf8 Good deal of whitespace fixes and code cleanup.
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>
2013-10-11 10:21:04 -03:00
Thiago Macieira
8e81d3f100 Make the classes generated by uic be real members of our classes
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>
2013-10-03 12:13:48 -07:00
Thiago Macieira
f0f76056ac Include the ui_*.h headers in the main headers.
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>
2013-10-03 12:13:15 -07:00
Tomaz Canabrava
e81bbc1dab Hack to make the subsurface work on Gnome3 shell
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>
2013-09-27 09:22:19 -07:00
Tomaz Canabrava
272338875d Addes a simple 'Renumber Dialog', very similar to the GTK one.
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>
2013-06-17 13:41:00 -03:00
Tomaz Canabrava
48dda4192f Added a new widget 'MinMaxAvgWidget'
Added a new widget, MinMaxAvgWidget, a simple widget
that displays values in 'min, max, avg' fashion.
it has a setMaximum, setAverage and setMinimum
methods, that is userful for setting the minimum,
maximum and average of stuff. Ah, it also shows
the minimum, maximum and average of things.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-04 18:51:27 -03:00