mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Use unit functions to get column headers, add unit function for pressure
Finally getting more consistent overall in how we convert between the different units and how we decide which units to display. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a487f6c931
commit
b26ca781b8
4 changed files with 34 additions and 39 deletions
21
divelist.c
21
divelist.c
|
@ -420,27 +420,10 @@ void update_dive_list_units(void)
|
|||
const char *unit;
|
||||
GtkTreeModel *model = GTK_TREE_MODEL(dive_list.model);
|
||||
|
||||
switch (output_units.length) {
|
||||
case METERS:
|
||||
unit = "m";
|
||||
break;
|
||||
case FEET:
|
||||
unit = "ft";
|
||||
break;
|
||||
}
|
||||
(void) get_depth_units(0, NULL, &unit);
|
||||
gtk_tree_view_column_set_title(dive_list.depth, unit);
|
||||
|
||||
switch (output_units.temperature) {
|
||||
case CELSIUS:
|
||||
unit = UTF8_DEGREE "C";
|
||||
break;
|
||||
case FAHRENHEIT:
|
||||
unit = UTF8_DEGREE "F";
|
||||
break;
|
||||
case KELVIN:
|
||||
unit = "Kelvin";
|
||||
break;
|
||||
}
|
||||
(void) get_temp_units(0, &unit);
|
||||
gtk_tree_view_column_set_title(dive_list.temperature, unit);
|
||||
|
||||
gtk_tree_model_foreach(model, set_one_dive, NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue