diff options
Diffstat (limited to 'gui/mapping-dialog.cpp')
-rw-r--r-- | gui/mapping-dialog.cpp | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/gui/mapping-dialog.cpp b/gui/mapping-dialog.cpp index e57cead2..6dc6d15f 100644 --- a/gui/mapping-dialog.cpp +++ b/gui/mapping-dialog.cpp @@ -94,20 +94,18 @@ void mapping_dialog::load() { nullptr, Yaw, nullptr, false } }; - ui.max_pitch_output->setItemData(0, int(axis_opts::o_r180)); - ui.max_pitch_output->setItemData(1, int(axis_opts::o_r90)); - using a = axis_opts::max_clamp; + ui.max_pitch_output->setItemData(0, int(a::o_r180)); + ui.max_pitch_output->setItemData(1, int(a::o_r90)); + for (QComboBox* x : { ui.max_yaw_rotation, ui.max_pitch_rotation, ui.max_roll_rotation }) for (a y : { a::r180, a::r90, a::r60, a::r45, a::r30, a::r25, a::r20, a::r15, a::r10 }) x->addItem(tr("%1°").arg(y), y); for (QComboBox* x : { ui.max_x_translation, ui.max_y_translation, ui.max_z_translation }) for (a y : { a::t30, a::t20, a::t15, a::t10, a::t100 }) - x->addItem(QStringLiteral("%1 cm").arg(int(y)), y); - - // XXX TODO add tie_setting overload for spline_widget!!! -sh 20171020 + x->addItem(tr("%1 cm").arg(int(y)), y); for (int i = 0; qfcs[i].qfc; i++) { @@ -121,20 +119,16 @@ void mapping_dialog::load() { connect(&axis.opts.altp, value_::value_changed<bool>(), - this, - [&](bool f) {qfc.setEnabled(f); qfc.force_redraw();}); + this, [&](bool f) { qfc.setEnabled(f); }); qfc.setEnabled(axis.opts.altp); - qfc.force_redraw(); } - using c = axis_opts::max_clamp; - auto update_xstep = [&qfc](int clamp_x) { int value; - if (clamp_x <= c::r20) + if (clamp_x <= a::r30) value = 1; - else if (clamp_x <= c::r30) + else if (clamp_x <= a::r45) value = 5; else value = 10; @@ -147,11 +141,11 @@ void mapping_dialog::load() switch (clamp_y) { default: - case c::o_r180: - value = 15; break; - case c::o_r90: + case a::o_r180: + value = 20; break; + case a::o_r90: value = 10; break; - case c::o_t75: + case a::o_t75: value = 5; break; } qfc.set_y_step(value); @@ -163,7 +157,7 @@ void mapping_dialog::load() connect(&axis.opts.clamp_y_, value_::value_changed<int>(), &qfc, update_ystep); // force signal to avoid duplicating the slot's logic - qfc.setConfig(&conf); + qfc.set_config(&conf); update_xstep(axis.opts.clamp_x_); update_ystep(axis.opts.clamp_y_); |