summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-02-20Fix divide-by-zero bug in statistics.cGravatar Linus Torvalds
GET_LOCAL_SAC did not check if the two entries had different time stamps and could therefore cause a divide-by-zero. x86 doesn't fault on that - it's still wrong. This now calls a function that does proper checking of all the values involved in the calculation. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Display the filename on error messageGravatar Miika Turkia
Display the filename in error message instead of just text 'ZIP file' Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Divelogs.de import empty value fixGravatar Miika Turkia
This checks that weight and dive durantion are defined before importing. (Empty value concatenated with unit gives an error on import.) Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20parse-xml.c: fixed a small memory leak related to xmlGetProp()Gravatar Lubomir I. Ivanov
test_xslt_transforms(): xmlGetProp uses strdup(), so we have to clear the memory if a pointer is returned. xmlFree() doesn't seem very portable (strangly enought), so we use free(..) directly. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20gps.c: Fixed a small memory leakGravatar Lubomir I. Ivanov
osm_gps_map_get_default_cache_directory() uses stdc:strdup to allocate memory for the returned string. Lets try to free the memory pointed by 'cachebasedir'. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20info.c: add a method to clear all GtkListStore allocationsGravatar Lubomir I. Ivanov
Add a new method in info.c called info_widget_destroy(), which clears all GtkListStore instances. The method is exposed via display-gtk.h and called from gtk-gui.c:on_destroy(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Unref the two GtkTreeStore instances when destroying the divelistGravatar Lubomir I. Ivanov
Even if these exists for the heap lifespan, we can call: g_object_unref(dive_list.treemodel); g_object_unref(dive_list.listmodel); in divelist.c:dive_list_destroy() Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Fixed a memory leak in the divelist when moving with the keyboardGravatar Lubomir I. Ivanov
There were some small leaks before here, related to gtk_tree_iter_copy(), but there is another one in select_next_dive(): nextiter = gtk_tree_iter_copy(iter); This now requires a SJ near the epilog where we do the memory cleanup. Lets call this similar label consistently "free_iter" between select_prev_dive and select_next_dive. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Fixed an incorrect by context translation in bg_BGGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Documentation: Consistent spelling of "Buhlmann"Gravatar Reinout Hoornweg
Replaced "Bühlmann" with "Buhlmann". Signed-off-by: Reinout Hoornweg <reinout@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Release notes: small fixesGravatar Reinout Hoornweg
- Fixed a typo. - Changed "Buehlmann" to "Buhlmann". - Added "Experimental" to the announcement of deco calculation. - Since most of the text seemed to be written for 76 chars width, I did the same for the last few lines that exceeded that. Signed-off-by: Reinout Hoornweg <reinout@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Update user documentation with divelogs.de suffix changeGravatar Henrik Brautaset Aronsen
divelogs.de use DLD as suffix, not ZIP Suggested-by: Rainer Mohr <mail@divelogs.de> Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Change divelogs.de export file suffix from .ZIP to .DLDGravatar Henrik Brautaset Aronsen
As Rainer finished up the export function on divelogs.de, he used DLD as a suffix instead. Suggested-by: Rainer Mohr <mail@divelogs.de> Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Documentation: Formatting "Setting up Preferences"Gravatar Reinout Hoornweg
- Reformatted a few lists-used-as-tables in "setting up Preferences" to be real tables. Signed-off-by: Reinout Hoornweg <reinout@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Turn the Release Notes into an actual announcementGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20It seems that asciidoc doesn't allow dots in BlockIDsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Add divelogs.de export info to the manualGravatar Henrik Brautaset Aronsen
Replaces the FIXME's in Miiko's patch Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Replace "SDE file" with "ZIP file" in translationsGravatar Henrik Brautaset Aronsen
Generic naming after adding divelogs.de import. It needs unzipping the exact same was as SDE files does. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Add unzip support to divelogs.de exportsGravatar Henrik Brautaset Aronsen
Finalize divelog.de import, used with Miiko's divelog.de xslt transform Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Add info on importing divelogs.de to user manualGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Import divelogs.deGravatar Miika Turkia
This XSLT converts divelogs.de logs into Subsurface format. Data that is discarded: weather, water visibility, boat name. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Indicate to the user a default divelist sorting orderGravatar Lubomir I. Ivanov
Each time subsurface starts there is supposedly no sorting order (or divelist column) specified by the UI, yet the actual column is '#' (or dive number column), since its the *only* column which allows trips to be visible. If the user selects a different sorting order then he has no idea which column was the one who had the trips visible. "Where did all those 'trip' things go?" This can be a bit confusing... Lets provide indication by calling gtk_tree_view_column_set_sort_indicator(). Also call gtk_tree_view_column_set_sort_order() to specify a descending order. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Preserve keyboard focus when changing sorting order in the divelistGravatar Lubomir I. Ivanov
When the user changes the dive list sorting order via clicking on different column titles, using gtk_widget_grab_focus() gives keyboard focus back to the list itself (not staying on the column titles), which gives a hint that the list itself has focus index of 0 and is reset each time the widget receives this type of "initial" focus. Acked-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Fix tracking of selected dives across sort column changesGravatar Dirk Hohndel
With commit 800b0482f39e ("When switching sort order, scroll the dive list to the current dive") we introduced an unwanted new behavior. When changing sort columns we could lose all selections except for the main "selected_dive". This was caused by the call to gtk_tree_view_set_cursor on the selected_dive which unselected all other dives. As a side-effect this also fixed another bug that was introduced by the same change: shift-cursor-up and -down now works again to select multiple dives with the keyboard. But fixing that bug unearthed a different issue. Our code that restored the selection state of the tree model oddly decided to mark a divetrip as selected if its first child was selected. The bug above masked that by immediately unselecting the trip again, but now that this was fixed the problem was immediately obvious: we would start with both the first trip and the first dive in that trip selected (well, since we are in reverse order it's actually the chronologically last trip and last dive...). Instead we now use the remembered state of the trip to determine whether it should be expanded or selected. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Documentation: more tables in "View Info & Stats"Gravatar Reinout Hoornweg
- Even more tables. - Renamed the chapter to "View Dive Info & Stats" because one of the tabs being described is named "Dive Info" and not "Info". Signed-off-by: Reinout Hoornweg <reinout@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Makefile quorks :( Yes we want a 'doc' target for itself...Gravatar Cristian Ionescu-Idbohrn
...to avoid generating the HTMLDOC target even if it needs not to. Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Documentation: Updated "Edit Equipment Info"Gravatar Reinout Hoornweg
- More lists converted into tables. - Minor changes to text. Signed-off-by: Reinout Hoornweg <reinout@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Planner: fix incorrect gas change eventGravatar Dirk Hohndel
We stored the He permille instead of the He percentage. But for most casual testing this was hidden by the previous bug. Reported-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Planner: Start calculations with gas 0 instead of airGravatar Dirk Hohndel
The planner had a fatal flaw in that it ALWAYS started with AIR, even when clearly claiming to use the correct gas. We only picked up correct gases from events, but not at the beginning of the dive (where there is no event). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Obviate the need for explicit 'remember_tree_state/restore_tree_state' callsGravatar Linus Torvalds
Instead, just keep track of the expanded state of trips as we get the gtk callbacks for the state changes (which we need to track anyway for the selection logic), and automatically restore the state whenever we re-create the divelist. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Remember pre-existing trip expansion state when autogroupingGravatar Linus Torvalds
This just adds the "remember_tree_state()" and "restore_tree_state()" calls around the divelist update when autogrouping is turned on: that way existing expanded groups aren't blindly collapsed. It makes it much easier to see what autogrouping does if it only groups a few dives, because the overall state of the divelist isn't radically changed. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Documentation: update main windows imageGravatar Miika Turkia
Sent to the list by Miika for inclusion in the user manual... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Documentation: updated section "Edit the Dive Info"Gravatar Reinout Hoornweg
- Made tables of semi-formatted texts. - Rewrote some of text because the screenshot and table are both about the same thing. The screenshot is more important now, the table is explanation of screenshot. Signed-off-by: Reinout Hoornweg <reinout@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Remember non-expanded state in 'remember_tree_state()' tooGravatar Linus Torvalds
The 'remember_tree_state()' thing is meant to remember if a dive trip is expanded or not, but it missed the "or not" part. IOW, it never cleared the expanded flag, it only ever set it. As a result, if you were doing multiple operations on the divelist tree (testing all the recent gtk-model removal, for example) the dive trips would end up expanding more and more, even if you collapsed things by hand in between operations. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Tiny update to Norwegian translation of dive context menuGravatar Henrik Brautaset Aronsen
It just sounds better this way Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Rewrite "merge_dive_into_trip_above()" using our own data structuresGravatar Linus Torvalds
This does the moving of dives into the trip above without the complexity of the gtk data structures, and instead just recreates the whole divelist afterwards. As usual, this simplifies things a lot, and the less gtk-specific code we have, the better. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Don't do "insert_trip_before" using the gtk data structuresGravatar Linus Torvalds
.. use our own data structures instead, and regenerate the gtk ones after having successfully created the new trip. This simplifies the code enormously, and also makes it much more generic. You can now create a new trip from any arbitrary set of selected dives (it used to be that the "multiple selected dives" case worked, but only for some very specific special cases of selected dives). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Fix find_trip_by_idx() over-zealous cleanupGravatar Linus Torvalds
Commit bcf1f8c4feb9 ("Don't do "remove_from_trip" by walking the gtk data structures") made find_trip_by_idx() only work for negative indexes (positive indexes are dives), but when it removed the unnecessary test for negativity, the statement inside it should have been kept as unconditional, rather than removed with the test. Oops. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Don't do "remove_from_trip" by walking the gtk data structuresGravatar Linus Torvalds
They are complicated and confusing. Just use our own data structures and re-generate the gtk ones from them. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Don't do "remove_trip()" by walking the gtk data structuresGravatar Linus Torvalds
They are complicated and confusing. Just use our own data structures and re-generate the gtk ones from them. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Screenshot for preferencesGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Added information about yearly statisticsGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Removing chapter Adding Equipment infoGravatar Miika Turkia
All this can nowadays be done from the dive editing popup so a separate chapter describing the editing on info tab is not necessary. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19A couple of screenshots addedGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Screenshots are in images dir thus unignore itGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Use the divetrip index to look up divelist trip entriesGravatar Linus Torvalds
We used to look up dive trips by their date, but these days we always create a dynamic index for a dive trip when we insert it into the divelist model, so we can use that to unambiguously match up dive trips with the dive model entries. That means that we don't get confused if we have two trips with the exact same time, which happens when you load all the test-dives, for example. Reported-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19[PATCH] Adding screen captures of dive planningGravatar Miika Turkia
[Dirk Hohndel: removed the images folder from the Documentation directory Makefile clean target] Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Cleanup more and rearrange targets.Gravatar Cristian Ionescu-Idbohrn
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Improved maitainability.Gravatar Cristian Ionescu-Idbohrn
Cleans up more files. Got even an 'all' target :) Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-19Ignoring more stuff.Gravatar Cristian Ionescu-Idbohrn
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>