Frontend to the famous GRBL.

millingoptionsdialog.cpp 1.7KB

    /* Part of x2grbl * * Copyright Johann Wilhelm <johann.wilhelm@9mal6.de> 2015 * * see Readme.md for detailed license and usage information! */ #include "millingoptionsdialog.h" #include "ui_millingoptionsdialog.h" #include <QSettings> MillingOptionsDialog::MillingOptionsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::MillingOptionsDialog) { ui->setupUi(this); QSettings settings(QSettings::IniFormat, QSettings::UserScope, QString("2.5d Grbl-Commander")); settings.beginGroup("Milling"); if (settings.contains(QString("MillingDepth"))) ui->MillingDepth->setValue(settings.value("MillingDepth").toDouble()); if (settings.contains(QString("RapidMotionSpeed"))) ui->RapidMotionSpeed->setValue(settings.value("RapidMotionSpeed").toDouble()); if (settings.contains(QString("MillingSpeed"))) ui->MillingSpeed->setValue(settings.value("MillingSpeed").toDouble()); if (settings.contains(QString("ChangeNonMillingToRapid"))) ui->ChangeNonMillingToRapid->setChecked(settings.value("ChangeNonMillingToRapid").toBool()); settings.endGroup(); } MillingOptionsDialog::~MillingOptionsDialog() { delete ui; } void MillingOptionsDialog::accept() { QSettings settings(QSettings::IniFormat, QSettings::UserScope, QString("2.5d Grbl-Commander")); settings.beginGroup("Milling"); settings.setValue("MillingDepth", ui->MillingDepth->value()); settings.setValue("RapidMotionSpeed", ui->RapidMotionSpeed->value()); settings.setValue("MillingSpeed", ui->MillingSpeed->value()); settings.setValue("ChangeNonMillingToRapid", ui->ChangeNonMillingToRapid->isChecked()); settings.endGroup(); QDialog::accept(); }