summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-06-29 13:01:23 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-06-29 13:18:30 +0200
commit2eccd41897d6794a80b3ed2fcaaded85c453d46d (patch)
treee18781bc267899dc093594e1915d17a0fa05db9d /gui
parent3657d2c0d9807d6f88378981513a944cce4a1a16 (diff)
gui/mapping: reload mapping on profile change
Diffstat (limited to 'gui')
-rw-r--r--gui/curve-config.cpp32
-rw-r--r--gui/curve-config.h1
2 files changed, 19 insertions, 14 deletions
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<t>
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;