Added option to enable\disable controls autolock
This commit is contained in:
parent
af4c29ecdd
commit
3bb5133ea9
@ -42,6 +42,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
if(!firstrun) echo = settings.value("core/echo").toBool();
|
||||
else echo = false;
|
||||
|
||||
autolock = settings.value("core/lockcontrols").toBool();
|
||||
|
||||
sending = false;
|
||||
paused = false;
|
||||
injectingCommand = false;
|
||||
@ -492,7 +494,7 @@ void MainWindow::on_sendBtn_clicked()
|
||||
ui->sendBtn->setText("Send");
|
||||
ui->pauseBtn->setText("Pause");
|
||||
ui->pauseBtn->setDisabled("true");
|
||||
ui->controlBox->setChecked("true");
|
||||
if(autolock) ui->controlBox->setChecked("true");
|
||||
paused = false;
|
||||
}
|
||||
else if(!sending && !sdprinting)
|
||||
@ -501,7 +503,7 @@ void MainWindow::on_sendBtn_clicked()
|
||||
ui->sendBtn->setText("Stop");
|
||||
ui->pauseBtn->setText("Pause");
|
||||
ui->pauseBtn->setEnabled("true");
|
||||
ui->controlBox->setChecked("false");
|
||||
if(autolock) ui->controlBox->setChecked("false");
|
||||
paused = false;
|
||||
}
|
||||
else if(sdprinting)
|
||||
@ -510,7 +512,7 @@ void MainWindow::on_sendBtn_clicked()
|
||||
sendLine("M24");
|
||||
ui->sendBtn->setText("Send");
|
||||
ui->pauseBtn->setText("Pause");
|
||||
ui->controlBox->setChecked("true");
|
||||
if(autolock) ui->controlBox->setChecked("true");
|
||||
paused = false;
|
||||
}
|
||||
|
||||
@ -558,13 +560,13 @@ void MainWindow::on_pauseBtn_clicked()
|
||||
if(paused && !sdprinting)
|
||||
{
|
||||
paused = false;
|
||||
ui->controlBox->setChecked(false);
|
||||
if(autolock) ui->controlBox->setChecked(false);
|
||||
ui->pauseBtn->setText("Pause");
|
||||
}
|
||||
else if(!paused && !sdprinting)
|
||||
{
|
||||
paused = true;
|
||||
ui->controlBox->setChecked(true);
|
||||
if(autolock) ui->controlBox->setChecked(true);
|
||||
ui->pauseBtn->setText("Resume");
|
||||
}
|
||||
else if(sdprinting)
|
||||
|
||||
@ -59,6 +59,7 @@ private:
|
||||
QSerialPort printer;
|
||||
QSerialPortInfo printerinfo;
|
||||
bool firstrun;
|
||||
bool autolock;
|
||||
bool sending;
|
||||
bool paused;
|
||||
bool checkingTemperature;
|
||||
|
||||
@ -22,6 +22,8 @@ SettingsWindow::SettingsWindow(QWidget *parent) :
|
||||
if(settings.value("printer/bedy").toInt()) ui->bedybox->setValue(settings.value("printer/bedy").toInt());
|
||||
else ui->bedybox->setValue(200);
|
||||
|
||||
ui->lockbox->setChecked(settings.value("core/lockcontrols").toBool());
|
||||
|
||||
}
|
||||
|
||||
SettingsWindow::~SettingsWindow()
|
||||
@ -36,4 +38,5 @@ void SettingsWindow::on_buttonBox_accepted()
|
||||
settings.setValue("printer/bedy", ui->bedybox->value());
|
||||
settings.setValue("printer/bedx", ui->bedxbox->value());
|
||||
settings.setValue("core/echo", ui->echobox->isChecked());
|
||||
settings.setValue("core/lockcontrols", ui->lockbox->isChecked());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user