diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-07-03 13:40:59 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-07-03 13:40:59 +0200 |
commit | 5100661c2d7c820638fa49a8e27dceb6685e39b7 (patch) | |
tree | 53312f1e0a0d350cceefd68262672b7d3a5d272b /gui | |
parent | 41f9ea3045f21f1d1cea74b3b551c26ce57f2fd0 (diff) |
gui/mapping: fix axis asymmetry checkboxes
value<t> needs to persist over the checkbox's lifetime, otherwise the
slot gets disconnected.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/curve-config.cpp | 11 | ||||
-rw-r--r-- | gui/curve-config.h | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/gui/curve-config.cpp b/gui/curve-config.cpp index 19237c3c..257675b5 100644 --- a/gui/curve-config.cpp +++ b/gui/curve-config.cpp @@ -11,7 +11,7 @@ MapWidget::MapWidget(Mappings& m) : m(m) { - ui.setupUi( this ); + ui.setupUi(this); m.load_mappings(); @@ -21,8 +21,6 @@ MapWidget::MapWidget(Mappings& m) : 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); @@ -67,6 +65,7 @@ void MapWidget::reload() { QFunctionConfigurator& qfc = *qfcs[i].qfc; connect(qfcs[i].checkbox, &QCheckBox::toggled, + this, [&](bool f) -> void {qfc.setEnabled(f); qfc.force_redraw();}); qfc.setEnabled(qfcs[i].checkbox->isChecked()); qfc.force_redraw(); @@ -82,12 +81,14 @@ void MapWidget::reload() } } -void MapWidget::doOK() { +void MapWidget::doOK() +{ m.save_mappings(); close(); } -void MapWidget::doCancel() { +void MapWidget::doCancel() +{ m.invalidate_unsaved(); close(); } diff --git a/gui/curve-config.h b/gui/curve-config.h index 33ce90fd..f13e5501 100644 --- a/gui/curve-config.h +++ b/gui/curve-config.h @@ -12,6 +12,8 @@ public: private: Ui::UICCurveConfigurationDialog ui; Mappings& m; + main_settings s; + void closeEvent(QCloseEvent *) override { doCancel(); } private slots: void doOK(); |