Bugfixes in EEPROM editor

This commit is contained in:
NeoTheFox 2015-03-07 20:20:16 +03:00
parent a89153adc8
commit e904d4499e
2 changed files with 8 additions and 8 deletions

View File

@ -12,10 +12,9 @@ EEPROMWindow::EEPROMWindow(QStringList eepromLines, QWidget *parent) :
int j = 0; int j = 0;
foreach (QString str, eepromLines) foreach (QString str, eepromLines)
{ {
j++; str.remove("EPR:"); // Clear the unneeded part
str.remove("EPR:");
repetierEEPROMline currentLine; repetierEEPROMline currentLine; //Storage for EEPROM values
QStringList tmp = str.split(' '); QStringList tmp = str.split(' ');
@ -26,7 +25,7 @@ EEPROMWindow::EEPROMWindow(QStringList eepromLines, QWidget *parent) :
lines.append(currentLine); lines.append(currentLine);
QString msg; QString msg;
for(int i = 3; i < tmp.size(); i++) msg+=(tmp.at(i) + " "); for(int i = 3; i < tmp.size(); i++) msg+=(tmp.at(i) + " "); //Rejoin the rest
QLayout *line = new QGridLayout(); QLayout *line = new QGridLayout();
@ -60,17 +59,16 @@ EEPROMWindow::EEPROMWindow(QStringList eepromLines, QWidget *parent) :
break; break;
} }
//connect(edit, SIGNAL(returnPressed()), changebox, SLOT(toggle()));
connect(edit, SIGNAL(textChanged(QString)), this, SLOT(lineChanged(QString))); connect(edit, SIGNAL(textChanged(QString)), this, SLOT(lineChanged(QString)));
//connect(changebox, SIGNAL(toggled(bool)), this, SLOT(lineChanged()));
line->addWidget(label); line->addWidget(label);
line->addWidget(edit); line->addWidget(edit);
//line->addWidget(changebox);
line->setMargin(2); line->setMargin(2);
layout->addItem(line); layout->addItem(line);
j++; // increase counter
} }
for(int i = 0; i < lines.size(); i++) changed.append(false); for(int i = 0; i < lines.size(); i++) changed.append(false);
ui->eepromWidgets->setLayout(layout); ui->eepromWidgets->setLayout(layout);

View File

@ -934,6 +934,7 @@ void MainWindow::openEEPROMeditor()
{ {
EEPROMWindow eepromwindow(EEPROMSettings, this); EEPROMWindow eepromwindow(EEPROMSettings, this);
eepromwindow.setWindowModality(Qt::NonModal);
connect(&eepromwindow, SIGNAL(changesComplete(QStringList)), this, SLOT(sendEEPROMsettings(QStringList))); connect(&eepromwindow, SIGNAL(changesComplete(QStringList)), this, SLOT(sendEEPROMsettings(QStringList)));
eepromwindow.exec(); eepromwindow.exec();
@ -943,6 +944,7 @@ void MainWindow::sendEEPROMsettings(QStringList changes)
{ {
userCommands.clear(); userCommands.clear();
foreach (QString str, changes) { foreach (QString str, changes) {
injectCommand(str); sendLine(str);
//printMsg(str);
} }
} }