Commit graph

19 commits

Author SHA1 Message Date
Dirk Hohndel
682135838f Separate out the UI from the program logic
The following are UI toolkit specific:
gtk-gui.c   - overall layout, main window of the UI
divelist.c  - list of dives subsurface maintains
equipment.c - equipment / tank information for each dive
info.c      - detailed dive info
print.c     - printing

The rest is independent of the UI:
main.c i    - program frame
dive.c i    - creates and maintaines the internal dive list structure
libdivecomputer.c
uemis.c
parse-xml.c
save-xml.c  - interface with dive computers and the XML files
profile.c   - creates the data for the profile and draws it using cairo

This commit should contain NO functional changes, just moving code around
and a couple of minor abstractions.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-20 12:48:56 -07:00
Linus Torvalds
6ea5132463 Make the divelist font configurable
Instead of the hardcoding to "Sans 8", allow people to set it in the
preferences.

Also, make the unit choice be a frame in the preferences dialog instead.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-20 11:24:15 -07:00
Linus Torvalds
a0096f3a6b Make the printout look different
Not *better* mint you. Just different.

I suck at graphs.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-13 19:49:48 -07:00
Linus Torvalds
ce86289eed Add the capability to print a dive profile
Ok, this is the ugliest f*&$ing printout I have ever seen in my life,
but think of it as a "the concept of printing works" commit, and you'll
be able to hold your lunch down and not gouge out your eyeballs with a
spoon.  Maybe.

I'm just doing the cairo display as-is for the printout, which is a
seriously bad idea.  I need to not try to do colors etc, and instead of
having white lines on a black background I just need to make thelines be
black on white paper.

But that would involve actually changing the current "plot()" routine,
which is against the point of the exercise right now.  This really is
just a demonstration of how to add printing capabilities.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-13 16:02:42 -07:00
Linus Torvalds
425649a278 Make 'report_error()' usable from outside of main.c
The dive computer import code will want to show errors too..

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-12 09:49:54 -07:00
Linus Torvalds
9cb60c9106 Start some very initial libdivecomputer integration
Ok, so this is quite broken right now: it doesn't actually really *do*
anything, and it now requires that you have libdivecomputer all set up
and installed.

That is fairly easy:

	mkdir ../src
	cd ../src
	git clone git://libdivecomputer.git.sourceforge.net/gitroot/libdivecomputer/libdivecomputer
	cd libdivecomputer
	autoreconf --install
	./configure
	make
	sudo make install

but you may feel that this is not exactly useful considering that
nothing actually *works* yet.

Some day.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-12 09:27:01 -07:00
Linus Torvalds
8f12eed9e0 First (broken) try at actually tracking cylinder types
This doesn't actually change the cylinder type info in the dive, because
it's too broken for that.  Instead it prints out what it would change
things to.

The gtk2 notion of text input focus is *really* odd.  Why is the
cylinder type sometimes selected, and sometimes not?

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-09 19:46:53 -07:00
Linus Torvalds
067506038a Rename 'cylinder.c' as 'equipment.c'
Make it about general equipment management, and start hooking up
functions to show new equipment information when changing dives (and to
flush changes to equipment information for the previously active dive).

Nothing is hooked up yet, and it's now showing just one (really big)
cylinder choice, so this is all broken.  But it should make it possible
to at least get somewhere some day.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-09 17:10:17 -07:00
Linus Torvalds
9437a6512a Add a notebook for cylinder information
Ok, so it's not connected to anything yet, and the tank choices (that
don't do anything) are some random hardcoded collection, but maybe it
will do something some day.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-09 10:31:51 -07:00
Nathan Samson
21204926df Open File works. I refactored the code and introduced a new type. I never used it as a pointer (their was no real reason), but I'm not really satisfied.
Signed-off-by: Nathan Samson <nathansamson@gmail.com>
2011-09-05 21:12:58 +02:00
Nathan Samson
6138d151e9 Remove the redundant frames in the notebook. Closes #9
Signed-off-by: Nathan Samson <nathansamson@gmail.com>
2011-09-04 19:01:30 +02:00
Linus Torvalds
23c6a42b08 Make the main display saner
This tweaks:
 - packing to be what you'd kind of expect
 - makes the "summary info" always visible
 - the "extended info" is now on a notebook page of its own
 - dive profile the first notebook page, since the summary
   information is visible regardless.
which all just seems a lot more logical.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-31 18:30:42 -07:00
Linus Torvalds
00d798854a Start cleaning up dive accessors
I'm going to add a menu to import (and eventually export) dives, and so
we'd like to be able to start out with no dives at all.  Right now we
croak if that happens - it's not like the code has been written with
actual end users in mind.

So start cleaning things up.  First make the 'current_dive' macro work
right even for invalid dives.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-31 16:33:20 -07:00
Linus Torvalds
a39b2ee220 Add some more dive info - and actually update it
It's still the ugliest application ever, but now it at least gives you
some basic dive info.

I'd love to add a way to edit the dives to add new data (name, buddies,
location etc), but that would also require the ability to save the end
result.  Maybe some day.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-31 15:35:28 -07:00
Linus Torvalds
a11dbbdb18 Add fake 'info' frame contents
It should have depth, time, place etc information, but right now it only
has a fake depth that doesn't even get updated.  Just to show the idea
of the table usage.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-31 12:09:19 -07:00
Linus Torvalds
6cc122f491 Add 'repaint_dive()' prototype, and fix dependencies
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-31 11:10:17 -07:00
Linus Torvalds
2044dabc81 Teach the thing to actually track the currently selected dive
.. and repaint the profile when the selection changes.

Now, if it just wasn't so ugly, it might even be useful.  Except it
obviously needs to also show all the other dive information.  And allow
the user to fill in details.  And save the end results.

So no, it's not useful.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-31 11:07:31 -07:00
Linus Torvalds
77cfe07c52 Split up divelist scroll window generation into its own file
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-31 10:27:58 -07:00
Linus Torvalds
8e95ded57b Split up profile frame generation into its own file.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-31 10:20:46 -07:00