Commit graph

28 commits

Author SHA1 Message Date
Benjamin
aa5365eb3f Clean up code to remove false messages about errors in Eclipse
Imported the subsurface project into Eclipse to try and pull apart
how it all works together. Added an include for profile.h and some
brackets around a condition, but didn't make any functional changes
(I hope). These 2 changes should be purely cosmetic.

Signed-off-by: Benjamin Fogel <benjaminfogel@yahoo.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-08-05 16:49:33 +02:00
Dirk Hohndel
f3f7bf51fa Merge branch 'Qt'
After the 3.1 release it is time to shift the focus on the Qt effort - and
the best way to do this is to merge the changes in the Qt branch into
master.

Linus was extremely nice and did a merge for me. I decided to do my own
merge instead (which by accident actually based on a different version of
the Qt branch) and then used his merge to double check what I was doing.

I resolved a few things differently but overall what we did was very much
the same (and I say this with pride since Linus is a professional git
merger)

Here's his merge commit message:

    This is a rough and tumble merge of the Qt branch into 'master',
    trying to sort out the conflicts as best as I could.

    There were two major kinds of conflicts:

     - the Makefile changes, in particular the split of the single
       Makefile into Rules.mk and Configure.mk, along with the obvious Qt
       build changes themselves.

       Those changes conflicted with some of the updates done in mainline
       wrt "release" targets and some helper macros ($(NAME) etc).

       Resolved by largely taking the Qt branch versions, and then editing
       in the most obvious parts of the Makefile updates from mainline.

       NOTE! The script/get_version shell script was made to just fail
       silently on not finding a git repository, which avoided having to
       take some particularly ugly Makefile changes.

     - Various random updates in mainline to support things like dive tags.

       The conflicts were mainly to the gtk GUI parts, which obviously
       looked different afterwards.  I fixed things up to look like the
       newer code, but since the gtk files themselves are actually dead in
       the Qt branch, this is largely irrelevant.

       NOTE! This does *NOT* introduce the equivalent Qt functionality.
       The fields are there in the code now, but there's no Qt UI for the
       whole dive tag stuff etc.

    This seems to compile for me (although I have to force
    "QMAKE=qmake-qt4" on f19), and results in a Linux binary that seems to
    work, but it is otherwise largely untested.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-17 22:01:41 -07:00
Dirk Hohndel
8316564356 Fix yet another selection issue
If we manually deselect dives without changing Gtk's notion of what is
selected and then want to simply recreate the dive list, Gtk re-selects
the unselected dives in the process of clearing out the dive list. How
very strange.

Also, after making changes to the selection we need to make sure that we
update the stats.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-17 08:34:45 -07:00
Tomaz Canabrava
30297ebd4b Correctly set the unselected dive.
The selected dive was being set to zero when the program
started, but zero is actually the first dive. There
were workarounds on the gtk code for that probably

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-16 15:42:20 -03:00
Dirk Hohndel
1ba901fed6 Initialize / reset selected_dive to -1
The value of 0 that we used is actually a valid value and could cause
confusion.

Suggested-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-16 09:10:11 -07:00
Dirk Hohndel
0f389dd1c9 Improve the dialog after successful divelogs.de upload
This is still not really "normal person" readable. But at least somewhat
better than what we had before.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-12 08:09:50 -07:00
Henrik Brautaset Aronsen
f5ef74202b Require libzip, xslt and osm-gps-map in all builds
Conditional inclusion of libzip, xslt and osm-gps-map just
makes testing more cumbersome, since testers might lack
Subsurface features without knowing.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-11 22:02:24 -07:00
Dirk Hohndel
4dfaccccb3 Report error string for libsoup connection to divelogs.de
Just reporting a default string that something went wrong is kind of
pointless...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-11 21:53:29 -07:00
Miika Turkia
1e8a5d6614 Show translated labels for upload and export menu items
The strings were marked for translation on assignment to the variable, but
then the variables were used untranslated.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-11 06:28:57 -07:00
Dirk Hohndel
8677721e85 Remove the majority of the Gtk related code
- rip all Gtk code from qt-gui.cpp
- don't compile Gtk specific files
- don't link against Gtk libraries
- don't compile modules we don't use at all (yet)
- use #if USE_GTK_UI on the remaining files to disable Gtk related parts
- disable the non-functional Cochran support while I'm at it

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-03 11:37:09 -07:00
Dirk Hohndel
63c5080561 Move gas string computation into core logic code
This is now a helper called from the Gtk UI code (and will soon be used by
the Qt UI code).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02 10:39:35 -07:00
Miika Turkia
e9ff76429e Do not display error message on cancel
Do not display error message when user cancels upload to divelogs.de.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02 08:31:03 -07:00
Miika Turkia
172982b860 Display divelogs.de upload status to the user
This shows a dialog indicating the success or failure of divelogs.de
upload. Currently the raw XML returned from the SOAP request is
also displayed.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-27 21:00:11 -07:00
Dirk Hohndel
4587f8a274 Call the get_date functions with timestamp_t instead of struct tm
This is the much more natural way to use this function, now that I look at
it...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-24 21:05:57 -07:00
Dirk Hohndel
92a5a5c35b Split report_dives into UI and logic and move to divelist files
Functionality is unchanged, except we now have a nice process_dives
function that deals with all the logic and that gets called from
report_dives from the Gtk code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-24 16:38:25 -07:00
Dirk Hohndel
d5af4e2ff9 Simplistic filtering by tags
This only allows for a logical "AND" - so only dives that all of the
selected tags are displayed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-21 17:53:24 -07:00
Dirk Hohndel
e4a31e1e41 Move creation of dive and dive trip date string into helper functions
This allows this code to easily be shared by Gtk and Qt UI.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-21 16:27:42 -07:00
Dirk Hohndel
75765be14c Move creation of dive and dive trip date string into helper functions
This allows this code to easily be shared by Gtk and Qt UI.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-18 13:18:09 -07:00
Dirk Hohndel
bfe21343ca Remove second dive_trip_list definition and douplicate helper function
dive_trip_list is simply a global variable, declared in dive.h.

The clear_trip_indexes() helper is purely logic and was moved to
divetrip.c - but then not deleted in divetrip-gtk.c

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-15 07:16:36 -07:00
Dirk Hohndel
db180bf46e Remove second dive_trip_list definition and douplicate helper function
dive_trip_list is simply a global variable, declared in dive.h.

The clear_trip_indexes() helper is purely logic and was moved to
divetrip.c - but then not deleted in divetrip-gtk.c

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-15 07:12:44 -07:00
Dirk Hohndel
0a9ad49f0a Fix selection handling for invalid dives
This is the downside of having to track our own selection state. We now
have a class of dives that potentially isn't known to Gtk as we aren't
adding them to the TreeView. So we need to make sure that their selection
state is consistent by deselecting them (either when they are marked as
invalid OR when we change preferences to no longer show invalid dives).

And because Gtk sends out another set of selection events when clearing
the TreeView (not sure why), we also need to make sure that their
selection state isn't reset to selected by mistake when the divelist is
recreated.

A bit of a pain, but it seems to work now and be consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-10 10:04:50 -07:00
Henrik Brautaset Aronsen
5f03a6f631 Add menu entry for divelogs.de upload
The menu entry for upload to divelogs.de was missing. Also renamed
the divelogs context menu entry to something less generic.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09 13:27:36 -07:00
Dirk Hohndel
9e4f9fad19 Store the tag names instead of an opaque number
And as we need the names for that, simplify the way we show the tags in the
Dive Info tab (and mark them for translation while we are at it).

In the process I renamed the constants to DTAG_ from DTYPE_ (and made
their nature as being just bits more obvious).

Also mark the box on the Info tab "Dive Tags", not "Dive Type".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09 13:06:30 -07:00
Ďoďo
ed3f67bc33 Add dive tags and support invalid dives
This started out as a way to keep dives in the dive list but being able to
mark them as 'invalid' so they wouldn't be visible (with an option to
disable that feature).

Now it supports an (at this point, fixed) set of tags that can be assigned
to a dive with 'invalid' being just one of them (but one that is special
as it gets some additional support for hiding such dive and marking dives
as (in)valid from the divelist).

[Dirk Hohndel: merged with the latest code and minor changes for coding
	       style and consistency. Ensure divelist is marked as
	       modified when changing 'invalid' tag]

Signed-Off-By: Jozef Ivanecký (dodo.sk@gmail.com)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09 10:31:36 -07:00
Dirk Hohndel
07c08eafac Continue to separate Gtk related code from core logic: divelist
Move some more logic out of the divelist-gtk.c file.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-07 17:37:09 +02:00
Dirk Hohndel
983a77780c Separate Gtk related code from core logic: divelist
This is simplistic & brute force: any function that touches Gtk related
data structures is moved to divelist-gtk.c, everything else stays in
divelist.c.

Header files have been adjusted so that this still compiles and appears to
work. More thought is needed to truly abstract this out, but this seems to
be a good point to commit this change.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-07 17:37:09 +02:00
Dirk Hohndel
081000963a Continue to separate Gtk related code from core logic: divelist
Move some more logic out of the divelist-gtk.c file.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-06 21:28:42 -07:00
Dirk Hohndel
1d61955be9 Separate Gtk related code from core logic: divelist
This is simplistic & brute force: any function that touches Gtk related
data structures is moved to divelist-gtk.c, everything else stays in
divelist.c.

Header files have been adjusted so that this still compiles and appears to
work. More thought is needed to truly abstract this out, but this seems to
be a good point to commit this change.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-06 20:49:06 -07:00