From 35fe77e08c12e5e5629a6ce96732166915fa1f30 Mon Sep 17 00:00:00 2001 From: NeoTheFox Date: Tue, 3 Mar 2015 16:40:45 +0300 Subject: [PATCH] Settings tweak for SD printing --- mainwindow.cpp | 3 +++ mainwindow.h | 1 + settingswindow.cpp | 5 +++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 7ccb6a9..ba00fd7 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -29,6 +29,8 @@ MainWindow::MainWindow(QWidget *parent) : ui->extruderlcd->setPalette(Qt::red); ui->bedlcd->setPalette(Qt::red); + if(!settings.value("core/firstrun").toBool()) firstrun = true; + checkingTemperature = settings.value("core/checktemperature").toBool(); ui->checktemp->setChecked(checkingTemperature); @@ -76,6 +78,7 @@ MainWindow::~MainWindow() settings.setValue("printer/baudrateIndex", ui->baudbox->currentIndex()); settings.setValue("core/checktemperature", ui->checktemp->isChecked()); + if(firstrun) settings.setValue("core/firstrun", true); settings.beginWriteArray("user/recentfiles"); for(int i = 0; i < recentFiles.size(); i++) diff --git a/mainwindow.h b/mainwindow.h index ad7a9cf..bd2a420 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -55,6 +55,7 @@ private: void parseFile(QFile &file); QSerialPort printer; QSerialPortInfo printerinfo; + bool firstrun; bool sending; bool paused; bool commandDone; diff --git a/settingswindow.cpp b/settingswindow.cpp index 8a5c333..71ae4e6 100644 --- a/settingswindow.cpp +++ b/settingswindow.cpp @@ -7,10 +7,11 @@ SettingsWindow::SettingsWindow(QWidget *parent) : { ui->setupUi(this); - ui->senderbox->setValue(settings.value("core/senderinterval").toFloat()); + if(!settings.value("core/firstrun").toBool()) ui->senderbox->setValue(2); + else ui->senderbox->setValue(settings.value("core/senderinterval").toFloat()); if(settings.value("core/statusinterval").toInt()) ui->statusbox->setValue(settings.value("core/statusinterval").toInt()); - else ui->senderbox->setValue(3000); + else ui->statusbox->setValue(1500); if(settings.value("printer/bedx").toInt()) ui->bedxbox->setValue(settings.value("printer/bedx").toInt()); else ui->bedxbox->setValue(200);