Update settings on change
This commit is contained in:
parent
2e24c28bbf
commit
ec902e01b6
@ -553,6 +553,8 @@ void MainWindow::on_actionSettings_triggered()
|
|||||||
{
|
{
|
||||||
SettingsWindow settingswindow(this);
|
SettingsWindow settingswindow(this);
|
||||||
|
|
||||||
|
connect(&settingswindow, &SettingsWindow::updatesettings, this, &MainWindow::updatesettings);
|
||||||
|
|
||||||
settingswindow.exec();
|
settingswindow.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -882,6 +884,17 @@ void MainWindow::baudrateSetFailed(int b)
|
|||||||
errorwindow.show();
|
errorwindow.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::updatesettings()
|
||||||
|
{
|
||||||
|
echo = settings.value("core/echo", 0).toBool();
|
||||||
|
autolock = settings.value("core/lockcontrols", 0).toBool();
|
||||||
|
chekingSDStatus = settings.value("core/checksdstatus", 1).toBool();
|
||||||
|
firmware = settings.value("printer/firmware", OtherFirmware).toInt();
|
||||||
|
statusTimer->setInterval(settings.value("core/statusinterval", 3000).toInt());
|
||||||
|
feedrate = settings.value("feedrate", 1500).toInt();
|
||||||
|
extruderFeedrate = settings.value("extruderfeedrate", 200).toInt();
|
||||||
|
}
|
||||||
|
|
||||||
//Needed for keypress handling
|
//Needed for keypress handling
|
||||||
bool MainWindow::eventFilter(QObject *obj, QEvent *event)
|
bool MainWindow::eventFilter(QObject *obj, QEvent *event)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -82,6 +82,7 @@ private slots:
|
|||||||
void open();
|
void open();
|
||||||
void serialconnect();
|
void serialconnect();
|
||||||
void serialupdate();
|
void serialupdate();
|
||||||
|
void updatesettings();
|
||||||
void readSerial(QByteArray data);
|
void readSerial(QByteArray data);
|
||||||
void printMsg(QString text);
|
void printMsg(QString text);
|
||||||
void checkStatus();
|
void checkStatus();
|
||||||
|
|||||||
@ -59,4 +59,6 @@ void SettingsWindow::on_buttonBox_accepted()
|
|||||||
settings.setValue("core/checksdstatus", ui->sdbox->isChecked());
|
settings.setValue("core/checksdstatus", ui->sdbox->isChecked());
|
||||||
settings.setValue("core/dtr", ui->dtrbox->isChecked());
|
settings.setValue("core/dtr", ui->dtrbox->isChecked());
|
||||||
settings.setValue("printer/firmware", ui->firmwarecombo->currentIndex());
|
settings.setValue("printer/firmware", ui->firmwarecombo->currentIndex());
|
||||||
|
|
||||||
|
emit updatesettings();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,10 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::SettingsWindow *ui;
|
Ui::SettingsWindow *ui;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void updatesettings();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SETTINGSWINDOW_H
|
#endif // SETTINGSWINDOW_H
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user