Changeset View
Changeset View
Standalone View
Standalone View
src/dialogs/profilesdialog.cpp
Show All 28 Lines | 26 | ProfilesDialog::ProfilesDialog(QWidget *parent) : | |||
---|---|---|---|---|---|
29 | , m_modified(false) | 29 | , m_modified(false) | ||
30 | { | 30 | { | ||
31 | ui->setupUi(this); | 31 | ui->setupUi(this); | ||
32 | ui->firmwareCB->addItem(QStringLiteral("Auto-Detect")); | 32 | ui->firmwareCB->addItem(QStringLiteral("Auto-Detect")); | ||
33 | ui->firmwareCB->addItems(detectFWPlugins()); | 33 | ui->firmwareCB->addItems(detectFWPlugins()); | ||
34 | ui->baudCB->addItems(SERIAL::BAUDS); | 34 | ui->baudCB->addItems(SERIAL::BAUDS); | ||
35 | ui->baudCB->setCurrentText(QLatin1String("115200")); | 35 | ui->baudCB->setCurrentText(QLatin1String("115200")); | ||
36 | ui->profileCB->setAutoCompletion(true); | 36 | ui->profileCB->setAutoCompletion(true); | ||
37 | connect(ui->profileCB, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this] { | 37 | connect(ui->profileCB, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this](const int newIndex) { | ||
38 | blockSignals(true); | ||||
39 | ui->profileCB->setCurrentIndex(m_prevIndex); | ||||
40 | blockSignals(false); | ||||
38 | askToSave(); | 41 | askToSave(); | ||
42 | blockSignals(true); | ||||
43 | m_prevIndex = newIndex; | ||||
44 | ui->profileCB->setCurrentIndex(m_prevIndex); | ||||
45 | blockSignals(false); | ||||
39 | loadSettings(); | 46 | loadSettings(); | ||
40 | }); | 47 | }); | ||
41 | updateCBProfiles(); | 48 | updateCBProfiles(); | ||
42 | 49 | | |||
43 | connect(ui->buttonBox, &QDialogButtonBox::clicked, this, &ProfilesDialog::buttonBoxClicked); | 50 | connect(ui->buttonBox, &QDialogButtonBox::clicked, this, &ProfilesDialog::buttonBoxClicked); | ||
44 | connect(ui->heatedBedCK, &QCheckBox::clicked, this, [this](const bool & status) { | 51 | connect(ui->heatedBedCK, &QCheckBox::clicked, this, [this](const bool & status) { | ||
45 | ui->bedTempSB->setEnabled(status); | 52 | ui->bedTempSB->setEnabled(status); | ||
46 | }); | 53 | }); | ||
▲ Show 20 Lines • Show All 236 Lines • Show Last 20 Lines |