summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-01-07Remove the now obsolete hard coded test_planGravatar Dirk Hohndel
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-07Dive planner: add gas change events & start dive with the correct gasGravatar Dirk Hohndel
When incrementally building dives with gas changes there are still some serious issues and inconsistencies. But at least now the gases in the dive we create appear to be correct. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-07Support relative times in diveplanner input "on the fly" modeGravatar Dirk Hohndel
This had gotten lost when updating the profile on the fly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-07Do pressure-time integral using integer valuesGravatar Linus Torvalds
Now that the pressure_time calculations are done in our "native" integer units (millibar and seconds), we might as well keep using integer variables. We still do floating point calculations at various stages for the conversions (including turning a depth in mm into a pressure in mbar), so it's not like this avoids floating point per se. And the final approximation is still done as a fraction of the pressure-time values, using floating point. So floating point is very much involved, but it's used for conversions, not (for example) to sum up lots of small values. With floating point, I had to think about the dynamic range in order to convince myself that summing up small values will not subtly lose precision. With integers, those kinds of issues do not exist. The "lost precision" case is not subtle, it would be a very obvious overflow, and it's easy to think about. It turns out that for the pressure-time integral to overflow in "just" 31 bits, we'd have to have pressures and times that aren't even close to the range of scuba cylinder air use (eg "spend more than a day at a depth of 200+ m"). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-07Don't bother with "correct" units for the pressure_time calculationGravatar Linus Torvalds
I fixed the pressure-time calculations to use "proper" units, but thinking about it some more, it turns out that units don't really matter. As long as we use the *same* unit for calculating the integral, and then re-calculating the step-wise entries, the units will cancel out. So we can simplify the "pressure_time()" function a bit, and use whatever units are most natural for our internal representation. So instead of using atm, use "mbar". Now, since the units don't matter, this patch doesn't really make much of a difference conceptually. Sure, it's a slightly simpler function, but maybe using more "natural" units for it would be worth it. But it turns out that using milli-bar and seconds has an advantage: we could do all the pressure_time integral using 32-bit integers, and we'd still be able to represent values that would be equivalent to staying at 24 bar for a whole day. This patch doesn't actually change the code to use integers, but with this unit choice, we at least have that possibility. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-06Split up helper functions for interpolating gas pressureGravatar Linus Torvalds
This splits up the function to create the estimated pressures for missing tank pressure information. The code now has a separate pass to create the beginning and ending pressures for segments that lack them, and fill them in to match the overall SAC-rate for that cylinder. In the process, it also fixes the calculation of the interpolated gas pressure: you can see this in test-dive 13, where we switch back to the first tank at the end of the dive. It used to be that the latter segment of that cylinder showed in a different color from the first segment, showing that we had a different SAC-rate. But that makes no sense, since our interpolation is supposed to use a constant SAC-rate for each cylinder. The bug was that the "magic" calculation (which is just the pressure change rate over pressure-time) was incorrect, and used the current cylinder pressure for start-pressure calculation. But that's wrong, since we update the current cylinder pressure as we go along, but we didn't update the total pressure_time. With the separate phase to calculate the segment beginning/ending pressures, the code got simplified and the bug stood out more. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-06Fix pressure_time calculation for SAC-rateGravatar Linus Torvalds
The code was using bar, not atm to calculate the pressure_time multiplier. But SAC-rate is relative to atm. We could do the correction at the end (and keep the pressure_time in "bar-seconds"), but let's just use the expected units during the integration. Especially since this also makes a helper function to do the calculations (with variables to keep the units obvious) instead of having multi-line expressions that have the wrong units. This fixes what I thought were rounding errors for the pressure graphs. They were just unit confusion. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-06Split up and re-organize the plot entry calculationsGravatar Linus Torvalds
This splits up the (very complex) function that calculates all the plot info data, so that the gas pressure logic is in several helper functions, and the deco and partial pressure calculations are in a function of their own. That makes the code almost readable. This also changes the cylinder pressure calculations so that if you have manually set the beginning and end pressures, those are the ones we will show (by making them fake "sensor pressures"). We used to shopw some random pressure that was related to the manually entered ones only distantly (through various rounding phases and the SAC-rate calculations). That does make the rounding errors more obvious in the graph, but we can fix that separately. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-06Display dive profile of the dive we plan, as we plan itGravatar Dirk Hohndel
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-06Remove Linus' plan input UIGravatar Dirk Hohndel
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-06Do a better job at creating plot info entriesGravatar Linus Torvalds
This simplifies - and improves - the code to generate the plot info entries from the samples. We used to generate exactly one plot info entry per sample, and then - because the result doesn't have high enough granularity - we'd generate additional plot info entries at gas change events etc. Which resulted in all kinds of ugly special case logic. Not only for the gas switch, btw: you can see the effects of this in the deco graph (done at plot entry boundaries) and in the gas pressure curves. So this throws that "do special plot entries for gas switch events" code away entirely, and replaces it with a much more straightforward model: we generate plot entries at a minimum of ten-second intervals. If you have samples more often than that, you'll get more frequent plot entries, but you'll never get less than that "every ten seconds". As a result, the code is smaller and simpler (99 insertions, 161 deletions), and actually does a better job too. You can see the difference especially in the test dives that only have a few entries (or if you create a new dive without a dive computer, using the "Add Dive" menu entry). Look at the deco graph of test-dive 20 before and after, for example. You can also see it very subtly in the cylinder pressure curves going from line segments to curves on that same dive. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-06Add the ability to cache our deco stateGravatar Dirk Hohndel
We kept reduing all the deco calculations, including the previous dives (if any) for each segment we add to the dive plan. This simply remembers the last stage and then just adds to that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-06Planner: hook the gas combo box to a "focus-out" event handlerGravatar Lubomir I. Ivanov
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-05Make the dive plan input much more compactGravatar Dirk Hohndel
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-05Add new gases to the combo box in dive plan entryGravatar Dirk Hohndel
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-05Make the 'Add waypoint' button work in the Input Plan dialogGravatar Dirk Hohndel
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-05Different widget to input the planGravatar Dirk Hohndel
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-05Do a minimal hook-up of the dive plan tree view to theGravatar Linus Torvalds
actual planning Yes, you can actually enter your segments now. No, it's not wonderfully user-friendly. If you don't enter enough segments to create a dive plan, it will just silently fail, for example. And the <tab> key that should get you to the next editable segment doesn't. And so on. But it kind of works. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-05Create the infrastructure for a dive plannder based on a tree-modelGravatar Linus Torvalds
This doesn't actually do the real work yet, but it creates all the infrastructure to edit a tree model, and verify the contents for time, depth and gas mix. Now we just need the ability to add entries to the tree model (this adds one fake one, just to test the editing), and then read out the final end result and turn it into a plan. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-05Stub out a few things for a plan input UIGravatar Dirk Hohndel
This is not doing anything (which is why there are so many unused variable warnings). It's just a couple of entries lined up to give a visual impression how some of this could look. I am not a UI designer. And there are good reasons for that... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-05Fix bug in smooth ceiling modeGravatar Dirk Hohndel
The ceiling calculations for the gradient factors still had a 3m increment hardcoded. This is now also conditional on the smooth parameter. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-05Fix profile display for dives with no samplesGravatar Linus Torvalds
For dives with no samples, we crate a fake dive computer with a set of made-up samples and use those to display the profile. However, the actual calculations to do the maximum duration and depth etc were always done with the "real" dive information, which is empty. As a result, the scale of the plot ended up being bogus, and part of the dive would be missing. Trivially fix by just passing the same dive computer information to calculate_max_limits() that we use for everything else. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-04First stab at simplistic dive planningGravatar Dirk Hohndel
This comes with absolutely no gui - so the plan literally needs to be compiled into Subsurface. Not exactly a feature, but this allowed me to focus on the planning part instead of spending time on tedious UI work. A new menu "Planner" with entry "Test Planner" calls into the hard-coded function in planner.c. There a simple dive plan can be constructed with calls to plan_add_segment(&diveplan, duration, depth at the end, fO2, pO2) Calling plan(&diveplan) does the deco calculations and creates deco stops that keep us below the ceiling (with the GFlow/high values currently configured). The stop levels used are defined at the top of planner.c in the stoplevels array - there is no need to do the traditional multiples of 3m or anything like that. The dive including the ascents and deco stops all the way to the surface is completed and then added as simulated dive to the end of the divelist (I guess we could automatically select it later) and can be viewed. This is crude but shows the direction we can go with this. Envision a nice UI that allows you to simply enter the segments and pick the desired stops. What is missing is the ability to give the algorithm additional gases that it can use during the deco phase - right now it simply keeps using the last gas used in the diveplan. All that said, there are clear bugs here - and sadly they seem to be in the deco calculations, as with the example given the ceiling that is calculated makes no sense. When displayed in smooth mode it has very strange jumps up and down that I wouldn't expect. For example with GF 35/75 (the default) the deco ceiling when looking at the simulated dive jumps from 16m back up to 13m around 14:10 into the dive. That seems very odd. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-04Correctly handle air in the deco codeGravatar Dirk Hohndel
We mark air with o2.permille = 0. But it's actually 20.9% O2. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-04Clean up DEBUG codeGravatar Dirk Hohndel
It's still a mess (and the symbols aren't used consistently), but it's a tiny bit more logical... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-04Make sure that the calculated deco ends at 0Gravatar Dirk Hohndel
Without this the cairo_close_path call could do silly looking things (intersecting polygons...). Reported-by: "Robert C. Helling" <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-04Fix deco calculations to correctly use GF values and add CC supportGravatar Dirk Hohndel
The old implementation was broken in several ways. For one thing the GF values are percentages, so they should normally be 0 < GF < 1 (well, some crazy people like to go above that). With this most of the Bühlmann config constants were wrong. Furthermore, after we adjust the pressure tolerance based on the gradient factors, we need to convert this back into a depth (instead of passing back the unmodified depth - oops). Finally, this commit adds closed circuit support to the deco calculations. Major progress and much more useful at this stage. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-04Intercept all events to the GF fields in the property dialogGravatar Dirk Hohndel
This seems like a strange way to capture the FOCUS_CHANGE event, but manually trying to register a callback for it fails. Yet registering a callback for every event and then filtering for FOCUS_CHANGE in the callback works. Go figure. But with this commit you can actually change the GF settings in the preferences dialog and once you tab out of the entry field the change gets immediately applied - nice to play with the effects of changing GF values. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-03Merge branch 'deco2'Gravatar Dirk Hohndel
Bringing in the first attempts to do our own deco calculations
2013-01-03Improvements to select_prev_dive() and select_next_dive()Gravatar Lubomir I. Ivanov
There were some minor problems when moving the selection cursor around: 1) If the selection was larger than 1, it was possible for the selection to get "stuck" in the middle of the list. This patch approaches this by always calling gtk_tree_selection_unselect_all() before gtk_tree_selection_select_iter(), or simply always making sure we have one selected iterator when navigating with the keys. 2) When there was a single top level dive before the first trip it wasn't possible to navigate trough the child dives of said trip in both directions. The patch attempts to fix this by having the hunks/checks: if (idx < 0) { (idx is of a trip) performed regardless of other conditions. *** Note: testing was done by importing all test*.xml dives with auto-group on. [Dirk Hohndel: adjusted the patch to also fix on_key_press to only grab the key if no modifier key is pressed; otherwise this breaks shift-cursor-keys for selecting multiple dives.] Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-03Fix cylinder printout informationGravatar Linus Torvalds
If we print out the pressure difference (because we do not have a cylinder size), we didn't initialize the precision. We should print out pressures without decimals. The attached patch fixes that, and also avoids a NULL pointer printout (which on Linux will just print out "(null)") if there is no cylinder type descriptor string. It also cleans things up a bit and uses the "cyl" pointer instead of repeating the "dive->cylinder[n]" thing. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-03Make GF values configurableGravatar Dirk Hohndel
There are a couple of issues with this commit: GtkEntry should emit the 'changed' signal when it is modified (so that changes in the preferences get applied right away) - but that doesn't appear to be working consistently. Also, this doesn't appear to affect the deco of any dives that I try it with. So my guess is something is wrong with the underlying deco algorithm. That's diappointing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-03Consider previous dives when calculating decoGravatar Dirk Hohndel
This also initializes the N2 tissue saturations to correct numbers (setting them to zero was clearly silly). With this commit we walk back in the dive_table until we find a surface intervall that's longer than 48h. Or a dive that comes after the last one we looked at; that would indicate that this is a divelist that contains dives from multiple divers or dives that for other reasons are not ordered. In a sane environment one would assume that the dives that need to be taken into account when doing deco calculations are organized as one trip in the XML file and so this logic should work. One major downside of the current implementation is that we recalculate everything whenever the plot_info is recreated - which happens quite frequently, for example when resizing the window or even when we go into loup mode. While this isn't all that compute intensive, this is an utter waste and we should at least cache the saturation inherited from previous dives (and clear that number when the selected dive changes). We don't want to cache all of it as the recreation of the plot_info may be triggered by the user changing equipment (and most importantly, gasmix) information. In that case the deco data for this dive does indeed have to be recreated. But without changing the current dive the saturation after the last surface intervall should stay the same. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-03Use gradient factors in deco calculationGravatar Dirk Hohndel
Usually dive computers show the ceiling in terms of the next deco stop - and those are in 3m increments. This commit also adds the ability to chose either the typical 3m increments or the smooth ceiling that the Bühlmann algorithm actually calculates. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-03Add configurable visualization of calculated ceilingGravatar Dirk Hohndel
This is on top of the deco information reported by the dive computer (in a different color - currently ugly green). The user needs to enable this via the Tec page of the preferences. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-03First stab at deco calculationsGravatar Dirk Hohndel
This seems to give us roughly the right data but needs a lot more testing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-03Fix cylinder printout informationGravatar Linus Torvalds
The cylinder information in the printouts was wrong in many ways. As Dirk noted, it didn't work at all for air-integrated computers that had the pressures in the samples, but the math was also confusing and wrong. This should fix it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-03Rewrite the nickname replacement functionGravatar Dirk Hohndel
This function had a couple of bugs. Two different off by one errors and on top of that it was matching only the deviceid instead of model and deviceid. So I simply rewrote it to match against the full pattern and take a much more straight forward approach to replacing the entry for the divecomputer under consideration. If the new nickname is entry this implementation allocates one extra byte - but that didn't seem worth the extra code to fix it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-02Limit to 4 the number of cylinders shown in the data frameGravatar Salvador Cuñat
For dives with more than 4 cylinders, the frame got very crowded and we needed a magnifier to see the numbers. If we used more than four tanks, let's put the info in another frame, if not, print the OTUs, the maxcns and the weight sytem in the new frame. There is still room for two more short data. Changed naming of nitrox and trimix mixes. Changed cylinder description. There are issues with the size of some translations. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-02Use old style (pre gtk-2.22) keysymsGravatar Dirk Hohndel
And include the compatibility header to build on newer versions. Reported-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-02Fix mixed dive/trip tree model groupingGravatar Linus Torvalds
In commit 96db56f89c76 ("Allow overlapping (and disjoint) dive trips") I allowed dives to be part of arbitrary dive trips regardless of date, which meant that the divelist tree model code needed to find the right parent for a dive as it was inserted. That code stupidly assumed that the top level of the dive list tree containted *only* trips, which is not at all the case. It happens to be true if you group all your dives into divetrips (the common case for autogroup=1, which real users do tend to have), but now that Dirk made the autogrouping be a per-xml-file setting, it became much easier to trigger the "mixed trips and non-trip dives" case, and that showed the stupid bug with the test dives. So instead of just blindly iterating to the 'n'th entry, search for the actual entry that is the dive trip we want to associate a dive with. Reported-by: Lubomir Ivanov <neolit123@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-01Treat headings properly when importing Suunto logsGravatar Miika Turkia
This patch will convert a heading bookmark to Subsurface format. Suunto's bookmark uses "Heading: <degrees>°" format and was previously set as the full event name. Now the resulting event will look like: <event name="heading" value="333" time="0:58 min"/> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-01Keep the selected dive visible in the divelistGravatar Linus Torvalds
This patch makes the divelist behave more as you would expect it as you scroll up and down through its entries. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-01Remove autogroup from the preferences and store per file insteadGravatar Dirk Hohndel
Having two spots to toggle autogroup had always been a clear sign of insanity. The inconsistent ludicrous semantic of when we remembered the state of autogroup was even worse. This finally gets rid of that disaster and drops the autogroup setting from the preferences and makes it instead a per file property. When you save a file, it saves the state of the autogroup toggle. This seems much more useful - you may have files where you want to create trips by default. And others, where you don't. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-01Make sure remember_dc has its own copy of the model stringGravatar Dirk Hohndel
When called from the parser the model string is freed right after passing it to remember_dc. So we need to get our own copy. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-01Add ability to remove a divecomputer from our data structuresGravatar Dirk Hohndel
Right now this isn't used but it will be needed for the yet to be written UI to manage our divecomputer database. This commit also fixes an oversight in the remember_dc function. Updates to nicknames weren't committed to the config. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-01Merge branch 'updown'Gravatar Dirk Hohndel
Bring in the keyboard handling change
2013-01-01Use the Left and Right keys to switch between divecomputersGravatar Dirk Hohndel
The existing code had the somewhat retarded Ctrl-C binding for displaying the next divecomputer and no way to go back to the previous one. With this commit we use our keyboard grab to map Left and Right to previous and next divecomputer. Much nicer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-01Clear divecomputer saved status before saving the nicknames to XMLGravatar Dirk Hohndel
In commit c7169bd24f22 "Fix nickname saving in XML file to deal with utf8 characters" I added the helper function to clear the "this divecomputer has already been saved"-flag. But then forgot to call it from save_dives before saving the divecomputer nicknames. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-01First step towards grabbing keys and handling them ourselvesGravatar Dirk Hohndel
This commit steals the cursor up and down keys away from gtk so regardless where gtk thinks the focus may be, we can still use the keys to change between dives. In the current UI design where all editing happens in separate windows this works as expected, as we only grab the keys for the main window. If we manage to re-enable in-place editing then we need to make sure that this doesn't cause problems (as gtk uses up/down for the ability to change drop down selections in combo boxes or values in spin buttons. So we must make sure that we stop stealing these keys once we start editing something (in which case simply switching to the next/prev dive wouldn't be a good thing, anyway). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>