UT NE A15

- fix for #37
- hide/show FIT tab
This commit is contained in:
Nikolaj Schlej 2015-10-05 10:21:33 +02:00
parent e0750a7b68
commit 49190d04dd
2 changed files with 16 additions and 6 deletions

View File

@ -17,7 +17,7 @@
UEFITool::UEFITool(QWidget *parent) : UEFITool::UEFITool(QWidget *parent) :
QMainWindow(parent), QMainWindow(parent),
ui(new Ui::UEFITool), ui(new Ui::UEFITool),
version(tr("0.30.0_alpha13")) version(tr("0.30.0_alpha15"))
{ {
clipboard = QApplication::clipboard(); clipboard = QApplication::clipboard();
@ -110,6 +110,7 @@ void UEFITool::init()
ui->fitTableWidget->setRowCount(0); ui->fitTableWidget->setRowCount(0);
ui->fitTableWidget->setColumnCount(0); ui->fitTableWidget->setColumnCount(0);
ui->infoEdit->clear(); ui->infoEdit->clear();
ui->messagesTabWidget->setTabEnabled(2, false);
// Set window title // Set window title
this->setWindowTitle(tr("UEFITool %1").arg(version)); this->setWindowTitle(tr("UEFITool %1").arg(version));
@ -673,7 +674,6 @@ void UEFITool::openImageFile(QString path)
showFitTable(); showFitTable();
} }
// Enable search ... // Enable search ...
if (ffsFinder) if (ffsFinder)
delete ffsFinder; delete ffsFinder;
@ -891,8 +891,11 @@ void UEFITool::writeSettings()
void UEFITool::showFitTable() void UEFITool::showFitTable()
{ {
QVector<QVector<QString> > fitTable = fitParser->getFitTable(); QVector<QVector<QString> > fitTable = fitParser->getFitTable();
if (fitTable.isEmpty()) if (fitTable.isEmpty()) {
return; return;
}
// Enable FIT tab
ui->messagesTabWidget->setTabEnabled(2, true);
// Set up the FIT table // Set up the FIT table
ui->fitTableWidget->clear(); ui->fitTableWidget->clear();

View File

@ -267,10 +267,17 @@ STATUS FfsParser::parseIntelImage(const QByteArray & intelImage, const UINT32 pa
return ERR_INVALID_FLASH_DESCRIPTOR; return ERR_INVALID_FLASH_DESCRIPTOR;
} }
biosBegin = meEnd; biosBegin = meEnd;
bios = intelImage.mid(biosBegin, biosEnd);
// biosEnd will point to the end of the image file
// it may be wrong, but it's pretty hard to detect a padding after BIOS region
// with malformed descriptor
}
// Normal descriptor map
else {
bios = intelImage.mid(biosBegin, biosEnd);
// Calculate biosEnd
biosEnd += biosBegin;
} }
bios = intelImage.mid(biosBegin, biosEnd);
biosEnd += biosBegin;
} }
else { else {
msg(tr("parseIntelImage: descriptor parsing failed, BIOS region not found in descriptor")); msg(tr("parseIntelImage: descriptor parsing failed, BIOS region not found in descriptor"));