Cosmetics

This commit is contained in:
bsongis
2014-03-27 10:05:26 +01:00
parent e10305a4e6
commit a1a82ad137
2 changed files with 25 additions and 21 deletions
+14 -13
View File
@@ -51,18 +51,20 @@ avrOutputDialog::avrOutputDialog(QWidget *parent, QString prog, QStringList arg,
ui->progressBar->setMaximum(127); ui->progressBar->setMaximum(127);
QTimer::singleShot(500, this, SLOT(doCopy())); QTimer::singleShot(500, this, SLOT(doCopy()));
} }
} else { }
if(wTitle.isEmpty()) else {
setWindowTitle(getProgrammer() + " " + tr("result")); if (wTitle.isEmpty())
setWindowTitle(getProgrammer() + " " + tr("result"));
else else
setWindowTitle(getProgrammer() + " - " + wTitle); setWindowTitle(getProgrammer() + " - " + wTitle);
QFile exec; QFile exec;
winTitle=wTitle; winTitle=wTitle;
if (!(exec.exists(prog))) { if (!(exec.exists(prog))) {
QMessageBox::critical(this, "Companion", getProgrammer() + " " + tr("executable not found")); QMessageBox::critical(this, "Companion", getProgrammer() + " " + tr("executable not found"));
closeOpt = AVR_DIALOG_FORCE_CLOSE; closeOpt = AVR_DIALOG_FORCE_CLOSE;
QTimer::singleShot(0, this, SLOT(forceClose())); QTimer::singleShot(0, this, SLOT(forceClose()));
} else { }
else {
foreach(QString str, arg) cmdLine.append(" " + str); foreach(QString str, arg) cmdLine.append(" " + str);
lfuse = 0; lfuse = 0;
hfuse = 0; hfuse = 0;
@@ -70,10 +72,11 @@ avrOutputDialog::avrOutputDialog(QWidget *parent, QString prog, QStringList arg,
phase=0; phase=0;
currLine.clear(); currLine.clear();
if (!displayDetails) { if (!displayDetails) {
ui->plainTextEdit->hide(); ui->plainTextEdit->hide();
QTimer::singleShot(0, this, SLOT(shrink())); QTimer::singleShot(0, this, SLOT(shrink()));
} else { }
ui->checkBox->setChecked(true); else {
ui->checkBox->setChecked(true);
} }
process = new QProcess(this); process = new QProcess(this);
connect(process,SIGNAL(readyReadStandardError()), this, SLOT(doAddTextStdErr())); connect(process,SIGNAL(readyReadStandardError()), this, SLOT(doAddTextStdErr()));
@@ -241,10 +244,8 @@ void avrOutputDialog::doAddTextStdOut()
if (text.contains("Complete ")) { if (text.contains("Complete ")) {
#if !__GNUC__ #if !__GNUC__
if (kill_timer) { delete kill_timer;
delete kill_timer; kill_timer = NULL;
kill_timer = NULL;
}
#endif #endif
int start = text.indexOf("Complete "); int start = text.indexOf("Complete ");
int end = text.indexOf("%"); int end = text.indexOf("%");
+11 -8
View File
@@ -20,11 +20,11 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
ui->setupUi(this); ui->setupUi(this);
setWindowIcon(CompanionIcon("write_flash.png")); setWindowIcon(CompanionIcon("write_flash.png"));
if(!g.profile[g.id()].splashFile().isEmpty()){ if (!g.profile[g.id()].splashFile().isEmpty()){
imageSource=PROFILE; imageSource=PROFILE;
imageFile=g.profile[g.id()].splashFile(); imageFile=g.profile[g.id()].splashFile();
} }
else{ else {
ui->useProfileImageCB->setDisabled(true); ui->useProfileImageCB->setDisabled(true);
imageSource=FIRMWARE; imageSource=FIRMWARE;
imageFile=""; imageFile="";
@@ -306,7 +306,7 @@ void burnDialog::displaySplash()
FlashInterface flash(ui->FWFileName->text()); FlashInterface flash(ui->FWFileName->text());
image = flash.getSplash(); image = flash.getSplash();
} }
else{ else {
image.load(imageFile); image.load(imageFile);
} }
if (image.isNull()) { if (image.isNull()) {
@@ -426,15 +426,18 @@ void burnDialog::on_BurnFlashButton_clicked()
hexfileName->clear(); hexfileName->clear();
QMessageBox::critical(this, tr("Warning"), tr("Cannot save customized firmware")); QMessageBox::critical(this, tr("Warning"), tr("Cannot save customized firmware"));
} }
} else { }
else {
hexfileName->clear(); hexfileName->clear();
QMessageBox::critical(this, tr("Warning"), tr("Custom image not found")); QMessageBox::critical(this, tr("Warning"), tr("Custom image not found"));
} }
} else {
hexfileName->clear();
hexfileName->append(fileName);
} }
} else { else {
hexfileName->clear();
hexfileName->append(fileName);
}
}
else {
QMessageBox::critical(this, tr("Warning"), tr("No firmware selected")); QMessageBox::critical(this, tr("Warning"), tr("No firmware selected"));
hexfileName->clear(); hexfileName->clear();
} }