From 2eccd41897d6794a80b3ed2fcaaded85c453d46d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 29 Jun 2016 13:01:23 +0200 Subject: gui/mapping: reload mapping on profile change --- gui/curve-config.cpp | 32 ++++++++++++++++++-------------- gui/curve-config.h | 1 + 2 files changed, 19 insertions(+), 14 deletions(-) (limited to 'gui') diff --git a/gui/curve-config.cpp b/gui/curve-config.cpp index 3b56dbb8..19237c3c 100644 --- a/gui/curve-config.cpp +++ b/gui/curve-config.cpp @@ -13,9 +13,26 @@ MapWidget::MapWidget(Mappings& m) : { ui.setupUi( this ); - // rest of mapping settings taken care of by options::value m.load_mappings(); + reload(); + + setFont(qApp->font()); + connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); + connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); + + main_settings s; + + tie_setting(s.a_x.altp, ui.tx_altp); + tie_setting(s.a_y.altp, ui.ty_altp); + tie_setting(s.a_z.altp, ui.tz_altp); + tie_setting(s.a_yaw.altp, ui.rx_altp); + tie_setting(s.a_pitch.altp, ui.ry_altp); + tie_setting(s.a_roll.altp, ui.rz_altp); +} + +void MapWidget::reload() +{ { struct { QFunctionConfigurator* qfc; @@ -63,19 +80,6 @@ MapWidget::MapWidget(Mappings& m) : qfcs[i].qfc->setConfig(conf, name); } } - - setFont(qApp->font()); - connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); - connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); - - main_settings s; - - tie_setting(s.a_x.altp, ui.tx_altp); - tie_setting(s.a_y.altp, ui.ty_altp); - tie_setting(s.a_z.altp, ui.tz_altp); - tie_setting(s.a_yaw.altp, ui.rx_altp); - tie_setting(s.a_pitch.altp, ui.ry_altp); - tie_setting(s.a_roll.altp, ui.rz_altp); } void MapWidget::doOK() { diff --git a/gui/curve-config.h b/gui/curve-config.h index 04a25ab4..33ce90fd 100644 --- a/gui/curve-config.h +++ b/gui/curve-config.h @@ -8,6 +8,7 @@ class MapWidget: public QWidget Q_OBJECT public: MapWidget(Mappings &m); + void reload(); private: Ui::UICCurveConfigurationDialog ui; Mappings& m; -- cgit v1.2.3