mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-22 07:58:22 +08:00
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:
parent
534f01fcd5
commit
41243f6d25
@ -132,10 +132,11 @@ VOID* CopyMem(VOID* dst, CONST VOID* src, size_t size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
VOID* AllocateZeroPool(size_t size) {
|
VOID* AllocateZeroPool(size_t size) {
|
||||||
|
VOID* pool;
|
||||||
if (!size)
|
if (!size)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
VOID* pool = malloc(size);
|
pool = malloc(size);
|
||||||
memset(pool, 0x00, size);
|
memset(pool, 0x00, size);
|
||||||
return pool;
|
return pool;
|
||||||
}
|
}
|
||||||
@ -1457,16 +1458,16 @@ IN OUT UINT64 *DstSize
|
|||||||
|
|
||||||
UINT8 EfiCompress(CONST VOID* SrcBuffer, CONST UINT64 SrcSize, VOID* DstBuffer, UINT64* DstSize)
|
UINT8 EfiCompress(CONST VOID* SrcBuffer, CONST UINT64 SrcSize, VOID* DstBuffer, UINT64* DstSize)
|
||||||
{
|
{
|
||||||
mPBit = 4;
|
|
||||||
VOID* buffer = (VOID*)SrcBuffer;
|
VOID* buffer = (VOID*)SrcBuffer;
|
||||||
UINT64 size = SrcSize;
|
UINT64 size = SrcSize;
|
||||||
|
mPBit = 4;
|
||||||
return Compress(buffer, size, DstBuffer, DstSize);
|
return Compress(buffer, size, DstBuffer, DstSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 TianoCompress(CONST VOID* SrcBuffer, CONST UINT64 SrcSize, VOID* DstBuffer, UINT64* DstSize)
|
UINT8 TianoCompress(CONST VOID* SrcBuffer, CONST UINT64 SrcSize, VOID* DstBuffer, UINT64* DstSize)
|
||||||
{
|
{
|
||||||
mPBit = 5;
|
|
||||||
VOID* buffer = (VOID*)SrcBuffer;
|
VOID* buffer = (VOID*)SrcBuffer;
|
||||||
UINT64 size = SrcSize;
|
UINT64 size = SrcSize;
|
||||||
|
mPBit = 5;
|
||||||
return Compress(buffer, size, DstBuffer, DstSize);
|
return Compress(buffer, size, DstBuffer, DstSize);
|
||||||
}
|
}
|
@ -1490,7 +1490,7 @@ UINT8 FfsEngine::create(const QModelIndex & index, const UINT8 type, const QByte
|
|||||||
return ERR_NOT_IMPLEMENTED;
|
return ERR_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result)
|
if (result && result != ERR_VOLUMES_NOT_FOUND)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
// Set action
|
// Set action
|
||||||
@ -1548,7 +1548,7 @@ UINT8 FfsEngine::create(const QModelIndex & index, const UINT8 type, const QByte
|
|||||||
|
|
||||||
// Parse file
|
// Parse file
|
||||||
result = parseFile(created, fileIndex, erasePolarity ? ERASE_POLARITY_TRUE : ERASE_POLARITY_FALSE, index, mode);
|
result = parseFile(created, fileIndex, erasePolarity ? ERASE_POLARITY_TRUE : ERASE_POLARITY_FALSE, index, mode);
|
||||||
if (result)
|
if (result && result != ERR_VOLUMES_NOT_FOUND)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
// Set action
|
// Set action
|
||||||
@ -1599,7 +1599,7 @@ UINT8 FfsEngine::create(const QModelIndex & index, const UINT8 type, const QByte
|
|||||||
// Parse section
|
// Parse section
|
||||||
QModelIndex sectionIndex;
|
QModelIndex sectionIndex;
|
||||||
result = parseSection(created, sectionIndex, index, mode);
|
result = parseSection(created, sectionIndex, index, mode);
|
||||||
if (result)
|
if (result && result != ERR_VOLUMES_NOT_FOUND)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
// Set create action
|
// Set create action
|
||||||
@ -1625,7 +1625,7 @@ UINT8 FfsEngine::create(const QModelIndex & index, const UINT8 type, const QByte
|
|||||||
// Parse section
|
// Parse section
|
||||||
QModelIndex sectionIndex;
|
QModelIndex sectionIndex;
|
||||||
result = parseSection(created, sectionIndex, index, mode);
|
result = parseSection(created, sectionIndex, index, mode);
|
||||||
if (result)
|
if (result && result != ERR_VOLUMES_NOT_FOUND)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
// Set create action
|
// Set create action
|
||||||
@ -1645,7 +1645,7 @@ UINT8 FfsEngine::create(const QModelIndex & index, const UINT8 type, const QByte
|
|||||||
// Parse section
|
// Parse section
|
||||||
QModelIndex sectionIndex;
|
QModelIndex sectionIndex;
|
||||||
result = parseSection(created, sectionIndex, index, mode);
|
result = parseSection(created, sectionIndex, index, mode);
|
||||||
if (result)
|
if (result && result != ERR_VOLUMES_NOT_FOUND)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
// Set create action
|
// Set create action
|
||||||
|
19
uefitool.cpp
19
uefitool.cpp
@ -39,6 +39,7 @@ ui(new Ui::UEFITool)
|
|||||||
connect(ui->actionRemove, SIGNAL(triggered()), this, SLOT(remove()));
|
connect(ui->actionRemove, SIGNAL(triggered()), this, SLOT(remove()));
|
||||||
connect(ui->actionRebuild, SIGNAL(triggered()), this, SLOT(rebuild()));
|
connect(ui->actionRebuild, SIGNAL(triggered()), this, SLOT(rebuild()));
|
||||||
connect(ui->actionMessagesCopy, SIGNAL(triggered()), this, SLOT(copyMessage()));
|
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->actionMessagesClear, SIGNAL(triggered()), this, SLOT(clearMessages()));
|
||||||
connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(about()));
|
connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(about()));
|
||||||
connect(ui->actionAboutQt, SIGNAL(triggered()), this, SLOT(aboutQt()));
|
connect(ui->actionAboutQt, SIGNAL(triggered()), this, SLOT(aboutQt()));
|
||||||
@ -80,6 +81,7 @@ void UEFITool::init()
|
|||||||
ui->menuFileActions->setDisabled(true);
|
ui->menuFileActions->setDisabled(true);
|
||||||
ui->menuSectionActions->setDisabled(true);
|
ui->menuSectionActions->setDisabled(true);
|
||||||
ui->actionMessagesCopy->setDisabled(true);
|
ui->actionMessagesCopy->setDisabled(true);
|
||||||
|
ui->actionMessagesCopyAll->setDisabled(true);
|
||||||
|
|
||||||
// Make new ffsEngine
|
// Make new ffsEngine
|
||||||
if (ffsEngine)
|
if (ffsEngine)
|
||||||
@ -91,7 +93,7 @@ void UEFITool::init()
|
|||||||
connect(ui->structureTreeView->selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
|
connect(ui->structureTreeView->selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
|
||||||
this, SLOT(populateUi(const QModelIndex &)));
|
this, SLOT(populateUi(const QModelIndex &)));
|
||||||
connect(ui->messageListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(scrollTreeView(QListWidgetItem*)));
|
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 ¤t)
|
void UEFITool::populateUi(const QModelIndex ¤t)
|
||||||
@ -562,9 +564,21 @@ void UEFITool::copyMessage()
|
|||||||
clipboard->setText(ui->messageListWidget->currentItem()->text());
|
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->actionMessagesCopy->setEnabled(item != NULL);
|
||||||
|
ui->actionMessagesCopyAll->setEnabled(item != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UEFITool::clearMessages()
|
void UEFITool::clearMessages()
|
||||||
@ -573,6 +587,7 @@ void UEFITool::clearMessages()
|
|||||||
messageItems.clear();
|
messageItems.clear();
|
||||||
ui->messageListWidget->clear();
|
ui->messageListWidget->clear();
|
||||||
ui->actionMessagesCopy->setEnabled(false);
|
ui->actionMessagesCopy->setEnabled(false);
|
||||||
|
ui->actionMessagesCopyAll->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UEFITool::dragEnterEvent(QDragEnterEvent* event)
|
void UEFITool::dragEnterEvent(QDragEnterEvent* event)
|
||||||
|
@ -79,7 +79,8 @@ public:
|
|||||||
void remove();
|
void remove();
|
||||||
|
|
||||||
void copyMessage();
|
void copyMessage();
|
||||||
void enableMessagesCopyAction(QListWidgetItem* item);
|
void copyAllMessages();
|
||||||
|
void enableMessagesCopyActions(QListWidgetItem* item);
|
||||||
void clearMessages();
|
void clearMessages();
|
||||||
|
|
||||||
void about();
|
void about();
|
||||||
|
12
uefitool.ui
12
uefitool.ui
@ -20,7 +20,7 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>UEFITool 0.18.4</string>
|
<string>UEFITool 0.18.5</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralWidget">
|
<widget class="QWidget" name="centralWidget">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -269,6 +269,8 @@
|
|||||||
<string>&Messages</string>
|
<string>&Messages</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actionMessagesCopy"/>
|
<addaction name="actionMessagesCopy"/>
|
||||||
|
<addaction name="actionMessagesCopyAll"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
<addaction name="actionMessagesClear"/>
|
<addaction name="actionMessagesClear"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="menuCapsuleActions"/>
|
<addaction name="menuCapsuleActions"/>
|
||||||
@ -493,6 +495,14 @@
|
|||||||
<string>Ctrl+Shift+C</string>
|
<string>Ctrl+Shift+C</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionMessagesCopyAll">
|
||||||
|
<property name="text">
|
||||||
|
<string>C&opy All</string>
|
||||||
|
</property>
|
||||||
|
<property name="shortcut">
|
||||||
|
<string>Ctrl+Alt+C</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
Loading…
Reference in New Issue
Block a user