Commit graph

63 commits

Author SHA1 Message Date
Linus Torvalds
da47ee401d Add a GtkEntry to allow editing of the device name
Ok, so some file chooser widget with a popup dialog would have been more
professional, but I'm lazy.  Plus I suspect the popup would look
horrible when populated with /dev entries, and I don't think there is
any sane filter function.

So this works, and means that you don't *have* to recompile the whole
program just because you have your dive computer on something else than
a USB serial line.

I suspect I should save the default name as a config variable too.
Maybe a setting in the preferences dialog.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-26 09:44:27 -07:00
Linus Torvalds
acca9b1804 Add a "Dive Computer" frame around the dive computer choice in import
I'll add a widget to allow the user to select the device too, so let's
name things to make them more obvious.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-26 09:19:30 -07:00
Linus Torvalds
c3a4844197 Add a xml file filter to the file open dialog
My home directory is a mess.  Don't show all the crap, just the stuff
that might be relevant.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-26 09:18:23 -07:00
Linus Torvalds
d81553e151 Add an 'About' dialog
It's really just about the logo, but whatever.  Dirk tells me I need one
of these in order to call it 1.0.  And I'm not going to fall into the
trap of thinking that 1.0 needs to be something polished, it just needs
to be working well enough..

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-24 15:48:13 -07:00
Linus Torvalds
f12684dcd7 Use 'gtk_dialog_get_content_area()' instead of accessing dialog directly
I'm reading gtk docs, and trying to clean things up a bit.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-24 15:26:37 -07:00
Linus Torvalds
c0adfdc41b Fix progress bar during libdivecomputer imports
As reported by Mauro Dreissig, the progress bar doesn't work and causes
a SIGSEGV due to a missing allocation.  The code broke when Dirk
separated out the GUI from the core code, and I hadn't tried
divecomputer downloads since.

Reported-by: Mauro Dreissig <mukadr@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22 16:38:24 -07:00
Dirk Hohndel
a817f4b547 Use the last (or only) filename on command line as default for saving
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-21 11:35:20 -07:00
Dirk Hohndel
8a8ad3f997 Show the "save changes" dialog before the main window is destroyed
By using the delete-event callback instead of the destroy callback we are
able to display our dialog (and the file-save dialog) while the program
window is still being displayed. Much nicer this way.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-21 11:29:13 -07:00
Dirk Hohndel
740e7119cd Check for changes at regular 'quit' events as well
Also make the dialog box less offensively ugly

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-21 11:29:13 -07:00
Dirk Hohndel
7a8fe91690 Catch changes to the info of the current dive when quitting
As the application shuts down we do one more check to see if the dive that
is currently being displayed has been modified (we previously just checked
as we switch dives)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-21 11:29:13 -07:00
Dirk Hohndel
f459c2ec22 Simplistic first attempt to get changes saved when quitting subsurface
Track whether things changed in the global dive_list

So far this actually works if changing dive info (but only if dive
selected was changed after the dive info was changed).

We are not tracking changes to the cylinder information, yet.

also remove the duplicate static dive_list

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-21 11:28:36 -07:00
Linus Torvalds
0bf2cfa66d Fix preferences dialog
Dirk took some old code when he did the merge of the newly split gui
code. Fix it up.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-20 14:05:46 -07:00
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