summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--equipment.c11
-rw-r--r--qt-ui/mainwindow.cpp1
2 files changed, 11 insertions, 1 deletions
diff --git a/equipment.c b/equipment.c
index 240e92681..133bef2b2 100644
--- a/equipment.c
+++ b/equipment.c
@@ -13,11 +13,20 @@
void add_cylinder_description(cylinder_type_t *type)
{
const char *desc;
+ int i;
desc = type->description;
if (!desc)
return;
- /* now do something with it... */
+ for (i = 0; i < 100 && tank_info[i].name != NULL; i++) {
+ if (strcmp(tank_info[i].name, desc) == 0)
+ return;
+ }
+ if (i < 100) {
+ tank_info[i].name = desc;
+ tank_info[i].ml = type->size.mliter;
+ tank_info[i].bar = type->workingpressure.mbar / 1000;
+ }
}
void add_weightsystem_description(weightsystem_t *weightsystem)
{
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 5f410ff3c..ad52c7d7f 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -75,6 +75,7 @@ MainWindow::MainWindow() : helpView(0)
void MainWindow::refreshDisplay(bool recreateDiveList)
{
ui.InfoWidget->reload();
+ TankInfoModel::instance()->update();
ui.ProfileWidget->refresh();
ui.globe->reload();
if (recreateDiveList)