| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | #include "qg_roundoptions.h" |
| | #include "rs_actionmodifyround.h" |
| | #include "ui_qg_roundoptions.h" |
| |
|
| |
|
| | |
| | |
| | |
| | |
| | QG_RoundOptions::QG_RoundOptions() |
| | : LC_ActionOptionsWidgetBase(RS2::ActionModifyRound, "Modify", "Round") |
| | , ui(new Ui::Ui_RoundOptions{}) { |
| | ui->setupUi(this); |
| | connect(ui->leRadius, &QLineEdit::editingFinished, this, &QG_RoundOptions::onRadiusEditingFinished); |
| | connect(ui->cbTrim, &QCheckBox::toggled, this, &QG_RoundOptions::onTrimToggled); |
| | pickDistanceSetup("radius", ui->tbPickRadius, ui->leRadius); |
| | } |
| |
|
| | |
| | |
| | |
| | QG_RoundOptions::~QG_RoundOptions() = default; |
| |
|
| | |
| | |
| | |
| | |
| | void QG_RoundOptions::languageChange(){ |
| | ui->retranslateUi(this); |
| | } |
| |
|
| | void QG_RoundOptions::doSaveSettings(){ |
| | save("Radius", ui->leRadius->text()); |
| | save("Trim", ui->cbTrim->isChecked()); |
| | } |
| |
|
| | void QG_RoundOptions::doSetAction(RS_ActionInterface *a, bool update) { |
| | m_action = dynamic_cast<RS_ActionModifyRound *>(a); |
| |
|
| | QString radius; |
| | bool trim; |
| | if (update){ |
| | radius = fromDouble(m_action->getRadius()); |
| | trim = m_action->isTrimOn(); |
| | } else { |
| | radius = load("Radius", "1.0"); |
| | trim = loadBool("Trim", true); |
| | } |
| | setTrimToActionAndView(trim); |
| | setRadiusToActionAndView(radius); |
| | } |
| |
|
| | void QG_RoundOptions::onRadiusEditingFinished(){ |
| | setRadiusToActionAndView(ui->leRadius->text()); |
| | } |
| |
|
| | void QG_RoundOptions::onTrimToggled(bool checked){ |
| | setTrimToActionAndView(checked); |
| | } |
| |
|
| | void QG_RoundOptions::setTrimToActionAndView(bool checked){ |
| | ui->cbTrim->setChecked(checked); |
| | m_action->setTrim(checked); |
| | } |
| |
|
| | void QG_RoundOptions::setRadiusToActionAndView(const QString &strValue){ |
| | bool okay = false; |
| | double radius = RS_Math::eval(strValue, &okay); |
| | if (!okay) { |
| | radius = 1.; |
| | } |
| |
|
| | m_action->setRadius(radius); |
| | ui->leRadius->setText(fromDouble(radius)); |
| | } |
| |
|