diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-12-11 14:38:58 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-12-11 14:38:58 -0800 |
commit | 8cca5404440960ba14ed870e77c6eb6537f4aa2e (patch) | |
tree | 3b42f4488c72c971dc8c10a5f5b74c9ecf2bb129 /display-gtk.h | |
parent | 4df81487fefc6eb6b2a1a1de6a48e2f2f534b18a (diff) | |
download | subsurface-8cca5404440960ba14ed870e77c6eb6537f4aa2e.tar.gz |
Add capability of custom sorts to divelist columns
.. and use this for the nitrox column, which can now be more complex
than just a single number.
The rule for the "nitrox" column is now:
- we look up the highest Oxygen and Helium mix for the dive
(Note: we look them up independently, so if you have a EAN50 deco
bottle, and a 20% Helium low-oxygen bottle for the deep portion, then
we'll consider the dive to be a "50% Oxygen, 20% Helium" dive, even
though you obviously never used that combination at the same time)
- we sort by Helium first, Oxygen second. So a dive with a 10% Helium
mix is considered to be "stronger" than a 50% Nitrox mix.
- If Helium is non-zero, we show "O2/He", otherwise we show just "O2"
(or "air"). So "21/20" means "21% oxygen, 20% Helium", while "40"
means "Ean 40".
- I got rid of the decimals. We save them, and you can see them in the
dive equipment details, but for the dive list we just use rounded
percentages.
Let's see how many bugs I introduced. I don't actually have any trimix
dives, but I edited a few for (very limited) testing.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'display-gtk.h')
-rw-r--r-- | display-gtk.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/display-gtk.h b/display-gtk.h index d5ffcb246..8ca5a450e 100644 --- a/display-gtk.h +++ b/display-gtk.h @@ -57,6 +57,11 @@ typedef void (*data_func_t)(GtkTreeViewColumn *col, GtkTreeIter *iter, gpointer data); +typedef gint (*sort_func_t)(GtkTreeModel *model, + GtkTreeIter *a, + GtkTreeIter *b, + gpointer user_data); + #define ALIGN_LEFT 1 #define ALIGN_RIGHT 2 #define INVISIBLE 4 |