UEFITool 0.18.5

- solved compilation problems with strict C99 mode for C files
- solved a bug in insert/replace applied to raw files introduced in 0.18.0
- added "Copy All" action for messages
This commit is contained in:
Nikolaj Schlej 2014-07-27 09:54:38 +02:00
parent 534f01fcd5
commit 41243f6d25
5 changed files with 39 additions and 12 deletions

View File

@ -132,10 +132,11 @@ VOID* CopyMem(VOID* dst, CONST VOID* src, size_t size) {
}
VOID* AllocateZeroPool(size_t size) {
VOID* pool;
if (!size)
return NULL;
VOID* pool = malloc(size);
pool = malloc(size);
memset(pool, 0x00, size);
return pool;
}
@ -1457,16 +1458,16 @@ IN OUT UINT64 *DstSize
UINT8 EfiCompress(CONST VOID* SrcBuffer, CONST UINT64 SrcSize, VOID* DstBuffer, UINT64* DstSize)
{
mPBit = 4;
VOID* buffer = (VOID*)SrcBuffer;
UINT64 size = SrcSize;
mPBit = 4;
return Compress(buffer, size, DstBuffer, DstSize);
}
UINT8 TianoCompress(CONST VOID* SrcBuffer, CONST UINT64 SrcSize, VOID* DstBuffer, UINT64* DstSize)
{
mPBit = 5;
VOID* buffer = (VOID*)SrcBuffer;
UINT64 size = SrcSize;
mPBit = 5;
return Compress(buffer, size, DstBuffer, DstSize);
}

View File

@ -1490,7 +1490,7 @@ UINT8 FfsEngine::create(const QModelIndex & index, const UINT8 type, const QByte
return ERR_NOT_IMPLEMENTED;
}
if (result)
if (result && result != ERR_VOLUMES_NOT_FOUND)
return result;
// Set action
@ -1548,7 +1548,7 @@ UINT8 FfsEngine::create(const QModelIndex & index, const UINT8 type, const QByte
// Parse file
result = parseFile(created, fileIndex, erasePolarity ? ERASE_POLARITY_TRUE : ERASE_POLARITY_FALSE, index, mode);
if (result)
if (result && result != ERR_VOLUMES_NOT_FOUND)
return result;
// Set action
@ -1599,7 +1599,7 @@ UINT8 FfsEngine::create(const QModelIndex & index, const UINT8 type, const QByte
// Parse section
QModelIndex sectionIndex;
result = parseSection(created, sectionIndex, index, mode);
if (result)
if (result && result != ERR_VOLUMES_NOT_FOUND)
return result;
// Set create action
@ -1625,7 +1625,7 @@ UINT8 FfsEngine::create(const QModelIndex & index, const UINT8 type, const QByte
// Parse section
QModelIndex sectionIndex;
result = parseSection(created, sectionIndex, index, mode);
if (result)
if (result && result != ERR_VOLUMES_NOT_FOUND)
return result;
// Set create action
@ -1645,7 +1645,7 @@ UINT8 FfsEngine::create(const QModelIndex & index, const UINT8 type, const QByte
// Parse section
QModelIndex sectionIndex;
result = parseSection(created, sectionIndex, index, mode);
if (result)
if (result && result != ERR_VOLUMES_NOT_FOUND)
return result;
// Set create action

View File

@ -39,6 +39,7 @@ ui(new Ui::UEFITool)
connect(ui->actionRemove, SIGNAL(triggered()), this, SLOT(remove()));
connect(ui->actionRebuild, SIGNAL(triggered()), this, SLOT(rebuild()));
connect(ui->actionMessagesCopy, SIGNAL(triggered()), this, SLOT(copyMessage()));
connect(ui->actionMessagesCopyAll, SIGNAL(triggered()), this, SLOT(copyAllMessages()));
connect(ui->actionMessagesClear, SIGNAL(triggered()), this, SLOT(clearMessages()));
connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(about()));
connect(ui->actionAboutQt, SIGNAL(triggered()), this, SLOT(aboutQt()));
@ -80,6 +81,7 @@ void UEFITool::init()
ui->menuFileActions->setDisabled(true);
ui->menuSectionActions->setDisabled(true);
ui->actionMessagesCopy->setDisabled(true);
ui->actionMessagesCopyAll->setDisabled(true);
// Make new ffsEngine
if (ffsEngine)
@ -91,7 +93,7 @@ void UEFITool::init()
connect(ui->structureTreeView->selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
this, SLOT(populateUi(const QModelIndex &)));
connect(ui->messageListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(scrollTreeView(QListWidgetItem*)));
connect(ui->messageListWidget, SIGNAL(itemEntered(QListWidgetItem*)), this, SLOT(enableMessagesCopyAction(QListWidgetItem*)));
connect(ui->messageListWidget, SIGNAL(itemEntered(QListWidgetItem*)), this, SLOT(enableMessagesCopyActions(QListWidgetItem*)));
}
void UEFITool::populateUi(const QModelIndex &current)
@ -562,9 +564,21 @@ void UEFITool::copyMessage()
clipboard->setText(ui->messageListWidget->currentItem()->text());
}
void UEFITool::enableMessagesCopyAction(QListWidgetItem* item)
void UEFITool::copyAllMessages()
{
QString text;
clipboard->clear();
for(INT32 i = 0; i < ui->messageListWidget->count(); i++)
text.append(ui->messageListWidget->item(i)->text()).append("\n");
clipboard->clear();
clipboard->setText(text);
}
void UEFITool::enableMessagesCopyActions(QListWidgetItem* item)
{
ui->actionMessagesCopy->setEnabled(item != NULL);
ui->actionMessagesCopyAll->setEnabled(item != NULL);
}
void UEFITool::clearMessages()
@ -573,6 +587,7 @@ void UEFITool::clearMessages()
messageItems.clear();
ui->messageListWidget->clear();
ui->actionMessagesCopy->setEnabled(false);
ui->actionMessagesCopyAll->setEnabled(false);
}
void UEFITool::dragEnterEvent(QDragEnterEvent* event)

View File

@ -79,7 +79,8 @@ public:
void remove();
void copyMessage();
void enableMessagesCopyAction(QListWidgetItem* item);
void copyAllMessages();
void enableMessagesCopyActions(QListWidgetItem* item);
void clearMessages();
void about();

View File

@ -20,7 +20,7 @@
<bool>true</bool>
</property>
<property name="windowTitle">
<string>UEFITool 0.18.4</string>
<string>UEFITool 0.18.5</string>
</property>
<widget class="QWidget" name="centralWidget">
<property name="sizePolicy">
@ -269,6 +269,8 @@
<string>&amp;Messages</string>
</property>
<addaction name="actionMessagesCopy"/>
<addaction name="actionMessagesCopyAll"/>
<addaction name="separator"/>
<addaction name="actionMessagesClear"/>
</widget>
<addaction name="menuCapsuleActions"/>
@ -493,6 +495,14 @@
<string>Ctrl+Shift+C</string>
</property>
</action>
<action name="actionMessagesCopyAll">
<property name="text">
<string>C&amp;opy All</string>
</property>
<property name="shortcut">
<string>Ctrl+Alt+C</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>