summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2017-02-21 14:37:18 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-02-21 07:28:15 -0800
commit5c89115efe3bf542b3885ce4a1c6dfc03e755b95 (patch)
tree39e685bf144c3399c008d5a07acdcf8bc7e63f6f /desktop-widgets/diveplanner.cpp
parent74b1f7ac5ee0f72513eb7e9021e4ec4c8cda76d5 (diff)
downloadsubsurface-5c89115efe3bf542b3885ce4a1c6dfc03e755b95.tar.gz
Fixes cylinder table headers not translated
The cylinder table was constructed very ealy from the contructor of the planner, so early that the tr() functions are not registered. This fix instantiates the cylinderModel from the maintab (as it is done with, for example, the weightsModel) and lets the planner user this instantiated (and proper translating) cylinderModel. Fixes: #206 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'desktop-widgets/diveplanner.cpp')
-rw-r--r--desktop-widgets/diveplanner.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp
index fddc5bb19..375f23208 100644
--- a/desktop-widgets/diveplanner.cpp
+++ b/desktop-widgets/diveplanner.cpp
@@ -23,7 +23,6 @@
#define UNIT_FACTOR ((prefs.units.length == units::METERS) ? 1000.0 / 60.0 : feet_to_mm(1.0) / 60.0)
static DivePlannerPointsModel* plannerModel = DivePlannerPointsModel::instance();
-static CylindersModel* cylinderModel = CylindersModel::instance();
DiveHandler::DiveHandler() : QGraphicsEllipseItem()
{
@@ -354,8 +353,8 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
connect(ui.min_switch_duration, SIGNAL(valueChanged(int)), plannerModel, SLOT(setMinSwitchDuration(int)));
connect(ui.rebreathermode, SIGNAL(currentIndexChanged(int)), plannerModel, SLOT(setRebreatherMode(int)));
- connect(ui.bottompo2, SIGNAL(valueChanged(double)), cylinderModel, SLOT(updateBestMixes()));
- connect(ui.bestmixEND, SIGNAL(valueChanged(int)), cylinderModel, SLOT(updateBestMixes()));
+ connect(ui.bottompo2, SIGNAL(valueChanged(double)), CylindersModel::instance(), SLOT(updateBestMixes()));
+ connect(ui.bestmixEND, SIGNAL(valueChanged(int)), CylindersModel::instance(), SLOT(updateBestMixes()));
connect(modeMapper, SIGNAL(mapped(int)), this, SLOT(disableDecoElements(int)));
connect(ui.ascRate75, SIGNAL(valueChanged(int)), this, SLOT(setAscRate75(int)));