Commit graph

311 commits

Author SHA1 Message Date
Miika Turkia
cbc818ddfe Include SDE files on file selector
Include SDE files on the file selectors if zip support is enabled.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-12 08:42:46 -08:00
Lubomir I. Ivanov
30466b9abb Use GDK methods to retrieve the actual screen DPI
gtk-gui.c:
+ added the method get_screen_dpi() that uses a simple
formula to retrieve the actual screen DPI
display.h:
+ use get_screen_dpi() in the SCALE_PRINT macro

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-07 18:19:28 +11:00
Henrik Brautaset Aronsen
ce87c26c00 Move about icon to include file
Getting the about icon to display in various scenarios on MacOSX
was a pain.  Moving the icon to an include file solved the problem.

This commit also fixes the problem Dirk was having when converting
satellite.svg to a png in commit cf3c0266c2.  I couldn't
quite get ImageMagick to preserve transparency and color when
converting subsurface-icon.svg, though, so I used Gimp instead.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
2013-02-02 21:27:19 +01:00
Dirk Hohndel
b709dff23d Clear yearly statistics when closing data file
Another oversight of what needed to be done when cleaning up the UI after
closing the data file.

Reported-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-01 00:19:03 +11:00
Dirk Hohndel
0f2fac265f Clear the list of events when closing data file
When the data file is closed we should reset the events that we offer for
filtering.

Reported-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-01 00:07:04 +11:00
Dirk Hohndel
6f66781b1f Turn off tooltips if no dives are selected
We already clear the widgets but forgot to turn off the tooltips as well.

Reported-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-01 00:00:29 +11:00
Dirk Hohndel
5fd901591c Add tooltip that tells user how to edit dive information
This adds the tooltip just to the Dive Notes page of the notebook area -
that's where people are tempted to try to do "edit in-place" which we
currently don't support.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-31 17:11:25 +11:00
Linus Torvalds
7024930530 Properly destroy the cairo context when we're done with it
Henrik reports that on OSX, not destroying the cairo context results in
a corrupted profile display.  It seems to just leak memory on Linux.

For gtk3, the cairo context is embedded in the GtkDrawable, for gtk2 we
need to create and destroy it appropriately.  Although maybe we could
just make it static instead of creating/destroying it all the time.

Anyway, this goes back to the old cairo destroy logic for gtk2.

Reported-and-analyzed-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-30 12:07:13 +11:00
Dirk Hohndel
e3a8ed5183 Massive cleanup
Mostly coding style and whitespace changes plus making lots of functions
static that have no need to be extern. This also helped find a bit of code
that is actually no longer used.

This should have absolutely no functional impact - all changes should be
purely cosmetic. But it removes a bunch of lines of code and makes the
rest easier to read.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-30 08:31:53 +11:00
Dirk Hohndel
3ab3e4e892 Show Gradient Factors in plot when showing calculated ceilings
This adds the GFlow/high values used to calculate the ceiling (if any).
Right now it shows those numbers even if at no point of the dive there was
an actual ceiling (but only if showing the ceiling itself is enabled).

This should make it easier to for the user to make sense of the calculated
ceiling, especially if posting screen shots.

As an aside - for some dive computers like the OSTC and the Shearwaters we
should be able to also plot the GF used by its calculation which might be
interesting for comparison purposes, as both of them also give us the
ceiling (lowest deco stop) calculated during the dive..

See #13

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-30 06:22:35 +11:00
Dirk Hohndel
a61877d1d4 Add missing strings for translations
Mostly in new code, but some of them are strings in older code that have
been missed in the past.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-29 20:32:56 +11:00
Linus Torvalds
0323cb3741 Prepare to compile with gtk-3
To actually compile with gtk-3 you currently need to disable the use of
OSM (compatible with gtk2 only for now).  And obviously figure out the
headers and libraries by using pkg-config on gtk-3 instead of gtk-2.
But now it should be only a Makefile change.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-28 13:17:48 -08:00
Linus Torvalds
77ece3fccb Clean up gtk combo box handling
This cleans up our handling of combo boxes and all the duplicated
completion logic, and simplifies the code.

In particular, we get rid of the deprecated GtkComboBoxEntry.  While it
made some things easier, it made other things harder.  Just using
GtkComboBox and setting that up correctly ends up being simpler, and
also makes the logic work with gtk-3.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-28 13:17:44 -08:00
Linus Torvalds
41027c2843 Make subsurface compile with -DGSEAL_ENABLE
This forces us to use the proper gtk accessor functions.  It may not be
worth it if people actually do the Qt conversion, but if we want to try
gtk3 at some point, this might help.

This all came about because I was trying to explain on G+ what an
immense pain this all was to even figure out, if you don't actually know
gtk at all.  Google and the gtk migration guide are almost useless, and
the gtk2 documentation itself actually uses the fields directly without
any accessor functions in several places.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-28 07:54:55 -08:00
Dirk Hohndel
3f261f56f3 Remove some unnecessary variable initializations
Not really bugs, just wasted. They clutter up the output of static
analysis with cppcheck.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-25 16:28:37 -08:00
Dirk Hohndel
39a79e0c46 Fix memory leak in set_dc_nickname
remember_dc() already does a strdup of the nickname.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-25 15:58:09 -08:00
Henrik Brautaset Aronsen
b696c61389 Move get_units() to prefs.c
get_units() returns the current unit preference, thus it
belongs in prefs.c rather than gtk-gui.c

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-25 07:30:37 -08:00
Dirk Hohndel
87798b328e Add 2013 to the copyright line
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-24 15:11:13 -08:00
Linus Torvalds
b8efe709a8 Remove saving of dive computer nicnames in system config
We save the (more complete) dive computer information in the XML file
with serial numbers and firmware version if we know about them, so using
a complicated string in the system config was redundant and confusing.

So remove that code.

NOTE! Since the dive computer nicknames are now only saved if the XML
file is saved, we also mark the dive list "changed" when we edit the
nicknames.  That way we'll be prompted to save things before exiting,
even if we don't actually edit any actual dive data.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-24 12:59:36 -08:00
Linus Torvalds
52050fdc92 Save all dive computer nicknames - whether used or not
We used to save dive computer information only if that dive computer was
actually used in any of the dives we saved.  But we can simplify the
code if we just always save any dive computers we know about.  And it
does allow for some usage cases where you have nicknames for other
peoples computers that you may not actively use, but you want to see if
you end up loading multiple XML files in one go.

So there's just no compelling reason to not just save all the info we
have.  And this will make it less painful to remove the "use system
config for dive computer nicknames", because you can also use this to
continue to gather dive computer info in a separate XML file if you want
to.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-24 12:59:31 -08:00
Linus Torvalds
4982389ca7 Fix setting of the dive_table.preexisting logic
The 'preexisting' value is used for downloading dives: we want to add
new dives but, but then compare those new dives against the
preexisting ones before we start sorting things and possibly merging
them.

However, the value was only updated sporadically, resulting in it
having stale information in it.  Which would cause problems
particularly if you deleted dives, so that the preexisting value would
point past the actual existing values!

So just update it unconditionally in dive_list_update_dives(), which
anything that changes the dive list is supposed to call in order to
display the changes anyway.

Also, just for safety, when removing a dive, put NULL in the last dive
table location.  Nobody should ever access past the end anyway (this
is enforced by 'get_dive()') but there are places that access the dive
list table directly, and the libdivecomputer download was one of
those.  No reason to leave stale dive pointers possibly around for
uses like that.

Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-23 13:37:02 -08:00
Amit Chaudhuri
c149921df4 Fix crash when applying a non-edit of nicknames
As reported by Henrik, there was a crash lurking in edit_dc_nickname code.
Invoking the dialog and selecting apply without changes exposed it neatly.

This is a one line fix.

Signed off by Amit Chaudhuri <amit.k.chaudhuri@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-23 03:50:42 -08:00
Dirk Hohndel
713c845e5a Add GPS icon to the location column for dive sites where we have GPS data
This replaces the really lame "italics text" from commit abe810ca1a29
("Mark locations that have GPS location data attached") with a marginally
less lame GPS icon.There's a reason why I am not making a living as
graphics artist. But I think this is a huge step forward from what we had
before...

The satellite.svg file is very loosely based on a different icon that I
found as public domain here http://www.clker.com/clipart-30400.html.
From that I created the PNG and then that was converted into the
GdkPixdata via gdk-pixbuf-csource; a rule for that was added to
the Makefile but commented out as I don't know if this tool will always be
available in the path. Having this icon included in the sources avoids
locating yet another icon file.

Better icons are certainly welcome!

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-22 20:11:13 -08:00
Dirk Hohndel
0a8038dba4 Consistently use uint32_t for deviceid
There were a handful of places that incorrectly used signed values for the
deviceid.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-18 12:58:45 -08:00
Amit Chaudhuri
334e51988d Add facility to edit nicknames / remove nickname entry
This allows users to edit one or more nick name entries in a single
session. Entries can also be removed individually.

Based on mock up by Lubomir Ivanov and various conversations from Dirk.
Thanks to both.

[Dirk Hohndel: quite a bit of editing for coding style and whitespace]

Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-18 07:32:39 -08:00
Lubomir I. Ivanov
a5ee2b66e1 Added client side communication to the Subsurface Web Service
A couple of new files webservice.c and webservice.h are added.

webservice.h exposes two methods at the moment:
- webservice_download_dialog():
this function creates the user interface for the download dialog
from the web service.
- webservice_request_user_xml()
this function is a direct call to retrieve XML for a specific
user identifier. the actual data, data length and error codes
are stored in passed pointers.

A menu entry is added in the Log menu:
"Download From Web Service"

The used backend for communication at the moment is provided
by libsoup.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-17 22:29:24 -08:00
Dirk Hohndel
d0d4bbece7 Hack Makefile, gtk-gui.c and divelist.c to allow building w/o osm-gps-map
While we are waiting for an autotools generated Makefile, this should allow
people to build that don't have osm-gps-map.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-17 11:17:48 -08:00
Lubomir I. Ivanov
2fb7aa1172 Attempt to override the URI handler in the about dialog
The previous patch in this series adds the function
subsurface_launch_for_uri(), which has to be called from the about
dialog instead of the default function for the URI calls to work
on Windows - i.e. opening links from the dialog.

gtk_about_dialog_set_url_hook() is a deprecated method, but seems
to be the only reasonable way to make the override between GTK 2.20 -
2.24 possible. The "activate-link" signal is recomended instead,
but is not portable for GTK bellow 2.24.

An alternative would be to somehow hack into the GtkAboutDialog
and override the callback for each clickable link.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-15 08:52:18 -08:00
Jan Schubert
90d3c5614a Centralising and redefining values as integers
This patch centralizes the definition for surface pressure, oxygen in
air, (re)defines all such values as plain integers and adapts calculations.

It eliminates 11 (!) occurrences of definitions for surface pressure and
also a few for oxygen in air.

It also rewrites the calculation for EAD, END and EADD using the new
definitons, harmonizing it for OC and CC and fixes a bug for EADD OC
calculation.

And finally it removes the unneeded variable entry_ead in gtk-gui.c.

Jan

Signed-off-by: Jan Schubert <Jan.Schubert@GMX.li>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-14 20:12:40 -08:00
Dirk Hohndel
23ce727e62 Add support for MOD, EAD, AND and EADD in the mouse over display
- MOD: Maximum Operation Depth based on a configurable limit
- EAD: Equivalent Air Depth considering N2 and (!) O2 narcotic
- END: Equivalent Nitrogen (Narcotic) Depth considering just N2 narcotic
       (ignoring O2)
- EADD: Equivalent Air Density Depth

Please note that some people and even diving organisations have opposite
definitions for EAD and END. Considering A stands for Air, lets choose the
above. And considering N for Nitrogen it also fits in this scheme.

This patch moves N2_IN_AIR from deco.c to dive.h as this is already used
in several places and might be useful for future use also. It also
respecifies N2_IN_AIR to a more correct value of 78,084%, the former one
also included all other gases than oxygen appearing in air. If someone
needs to use the former value it would be more correct to use 1-O2_IN_AIR
instead.

Signed-off-by: Jan Schubert / Jan.Schubert@GMX.li
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-13 16:26:35 -08:00
Pierre-Yves Chibon
8ff350387d Work on a dive localisation tool using GPS coordinates
For each dive recorded, place their GPS coordinates onto a map using the
OSM-GPS-MAP library.

This map is accessible via the "log" menu or the shortcut ctrl+M (M as map).

We check for the GPS coordinates "0, 0" which are the default when we do not
have real GPS coordinates set.

[Dirk Hohndel: fixed int/float math confusion, fixed some whitespace and
               coding style issues, cleaned up some comments, added a
	       missing cast to prevent a compiler warning]

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Signed-Off-By: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-13 10:08:07 -08:00
Linus Torvalds
6a10700ca5 Add default filename and divelist font to prefs structure
.. and add the usual logic to not save the default values.

This also simplifies the initial system-specific setup of both of these:
since we have defaults for all the preferences that get set up at
startup, we can just initialize those defaults to the system-specific
fonts then and there.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-11 17:46:00 -08:00
Linus Torvalds
c44755878c Fix SIGSEGV if no pre-existing nickname information
Loading an xml file with dive computer information without any
preexisting nickname data would try to "remember" that NULL nickname.
Causing a SIGSEGV if there was no nickname information.

The bug was introduced by commit ec38d3708d ("Move device_info handling
into a new 'device.c' file") when I inadvertently removed a bit too much
code. It actually wants to remember a missing DC nickname as an empty one.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-11 12:19:50 -08:00
Linus Torvalds
e8a896b64d Update preference saving for numeric values
This does the "don't save defaults" for numeric values too.

Also, move the preferences loading/saving to a new "prefs.c" file.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-11 12:19:34 -08:00
Lubomir I. Ivanov
c4ae58d589 gtk-gui.c: Move the download dialog related code to a new file
A new file download-dialog.c now contains all code related
to the download dialog, which was previously defined in gtk-gui.c.

Also, a new file callbacks-gtk.h now has two macros
OPTIONCALLBACK, UNITCALLBACK shared only between
download-dialog.c and gtk-gui.c.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-11 05:54:35 -08:00
Linus Torvalds
8dea49ffe2 Clean up preference saving code
The old code (on purpose) didn't try to differentiate "nonexisting
boolean configuration" with "existing boolean configuration set to
false", which is problematic if we optimize the saving to not save
default preferences at all.

Which this does.

So in addition to the logic to know about default preferences, this has
to change the interfaces for the PREF_BOOL reading code so that you can
tell the difference between "no value" and "false".

And since the previous calling convention was an abomination of doing
pointer casting and having case-statements for the config types, change
that while at it.  Both from a usage perspective *and* from a back-end
perspective it is actually much simpler to just have different functions
for the string vs boolean config read/write versions.  The OSX versions
in particular end up being one-liners.

(The GConf library is a nightmare, and doesn't seem to have any way to
know whether a boolean value exists or not, so you have to read it as a
GConfVal and then turn it into a gboolean rather than just get the "oh,
it didn't exist" as an error value).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-10 20:30:54 -08:00
Linus Torvalds
21f38190d3 Make the default preferences explicit
This makes it explicit what the default preferences are, so that we can
more easily avoid unnecessarily saving default settings.  It also makes
imperial metrics the default for the US (Burma and Liberia always get
forgotten!)

Right now we tend to be somewhat confused about defaults.  We do have
them, but then even if something has a default value, we tend to write
it out to the config file.  Which is not just unnecessary, but makes it
really hard to see after-the-fact whether the user actually wanted that
*specific* value, or whether they just wanted the default behavior.

So this prepares for having explicit configuration for when we want
something different than the defaults.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-10 20:30:45 -08:00
Linus Torvalds
868a2cc090 Split up preference data structure definition into 'pref.h'
.. and rename the badly named 'output_units/input_units' variables.

We used to have this confusing thing where we had two different units
(input vs output) that *look* like they are mirror images, but in fact
"output_units" was the user units, and "input_units" are the XML parsing
units.

So this renames them to be clearer.  "output_units" is now just "units"
(it's the units a user would ever see), and "input_units" is now
"xml_parsing_units" and set by the XML file parsers to reflect the units
of the parsed file.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-10 20:30:32 -08:00
Linus Torvalds
ec38d3708d Move device_info handling into a new 'device.c' file
The legacy nickname wrappers (that use the device_info structure) are
left in gtk-gui.c.  We can slowly start moving away from them, we don't
want to start exporting that thing as some kind of generic interface.

This isn't a pure code movement - because we leave the legacy interfaces
alone, there are a few new interfaces in device.c (like "create a new
device_info entry") that were embedded into the legacy "create nickname"
code, and needed to be abstracted out.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-09 16:19:38 -08:00
Linus Torvalds
33c67cc619 Rename 'dcnicknamelist' struct as 'device_info'
We'll start recording more than just nicknames in it, like serial
numbers and firmware version etc.  Start off just renaming it, and
re-ordering the members to reflect how the nickname is not the primary
issue.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-09 16:19:32 -08:00
Dirk Hohndel
d3570508b1 Move planner UI into planner.c
There should be NO other changes in this commit - just moving the code and
adjusting the includes (and adding the entry point to display-gtk.h).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-07 11:23:14 -08:00
Dirk Hohndel
989cf37fcf Remove the now obsolete hard coded test_plan
This was just a crutch to get something out there for people to play with.
With the ability to input a plan in place this is now obsolete.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-07 08:51:26 -08:00
Dirk Hohndel
85ed689dc0 Support relative times in diveplanner input "on the fly" mode
This had gotten lost when updating the profile on the fly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-07 08:13:23 -08:00
Dirk Hohndel
be9be189f7 Display dive profile of the dive we plan, as we plan it
As the user enters data into the entry fields, that data is validated and
as soon as there is enough data we start constructing a dive profile,
including the final ascent to the surface, including required deco stops,
etc.

This commit still has some serious issues.

- when data is input that doesn't validate, we just print a warning to
  stdout - instead we need to change the backgroundcolor of the input
  field or something.
- when we switch to the last dive in order to show the profile we don't
  actually search for the last dive - we just show the first one in the
  tree. This works for the default sort order but is of course wrong
  otherwise

I'm sure there are many other bugs, but I want to push it out where it is
right now for others to be able to take a look.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-06 22:15:03 -08:00
Dirk Hohndel
fb99c9a163 Remove Linus' plan input UI
This was added in commit 594da00612ab "Do a minimal hook-up of the dive
plan tree view to the actual planning" and has been replaced by a
different UI in subsequent commits. No point in keeping it around.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-06 15:10:39 -08:00
Lubomir I. Ivanov
c607f09f40 Planner: hook the gas combo box to a "focus-out" event handler
GTK's logic might be a bit flawed (or complicated) in terms of
"focus-out-event" and GtkComboBoxEntry objects as it does not work
by attaching said signal type directly to the GtkComboBoxEntry.
Perhaps it only makes sense for text input.

Since "focus-out-event" works for GtkEntry, we can retrieve the child
GtkEntry from the combo using gtk_bin_get_child(GTK_BIN(combo)
and attach the event handler to that.

This change should make it possible to update gas_model (GtkListStore)
when changing the widget focus with both the keyboard and mouse clicks.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-06 09:55:34 -08:00
Dirk Hohndel
6d10aab049 Make the dive plan input much more compact
Have the frames just for the top row and get rid of all of the extra space
in the layout.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-05 23:35:41 -08:00
Dirk Hohndel
b08f51cfc6 Add new gases to the combo box in dive plan entry
Once again Gtk does everything it can to make our lives miserable. It
requires major hackery to be able to add new gases to the drop down lists
"on the fly". Right now this only works if you edit the gas and then use
Tab to move to the next field.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-05 23:14:42 -08:00
Dirk Hohndel
b1dc9bf26d Make the 'Add waypoint' button work in the Input Plan dialog
Just after pushing out the last set of changes I had one more idea what I
could try. And of course that was it. Don't queue up a redraw. Simply run
gtk_widget_show_all on the dialog! That does the trick.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-05 22:19:21 -08:00
Dirk Hohndel
3ac1cdf9e4 Different widget to input the plan
Linus' treeview for the plan input is just too ugly for words. And doesn't
work, either.

So let's go with plan C: a table of waypoint entries. Depth, duration (or
absolute time), and gas used. The gas is a combobox that does completion.
I am reusing Linus' validation functions / parsers.

This works if you can fit your dive into the four waypoints that are there
by default. The add waypoint button is hooked up but even though it does
what I think should modify the dialog that is currently displayed that
clearly doesn't work.

But at least it "mostly" works and isn't as horrifyingly uggly as the
first two attempts.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-05 21:56:13 -08:00