mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
4df81487fe
commit
8cca540444
2 changed files with 105 additions and 22 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue