mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-21 23:48:22 +08:00
Version 0.9.1
- added "Uncompressed" to possible compression methonds
This commit is contained in:
parent
bfd8edcdf9
commit
a6fc781306
22
uefitool.cpp
22
uefitool.cpp
@ -33,6 +33,7 @@ UEFITool::UEFITool(QWidget *parent) :
|
|||||||
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->actionSaveImageFile, SIGNAL(triggered()), this, SLOT(saveImageFile()));
|
connect(ui->actionSaveImageFile, SIGNAL(triggered()), this, SLOT(saveImageFile()));
|
||||||
|
connect(ui->actionChangeToNone, SIGNAL(triggered()), this, SLOT(changeToNone()));
|
||||||
connect(ui->actionChangeToEfi11, SIGNAL(triggered()), this, SLOT(changeToEfi11()));
|
connect(ui->actionChangeToEfi11, SIGNAL(triggered()), this, SLOT(changeToEfi11()));
|
||||||
connect(ui->actionChangeToTiano, SIGNAL(triggered()), this, SLOT(changeToTiano()));
|
connect(ui->actionChangeToTiano, SIGNAL(triggered()), this, SLOT(changeToTiano()));
|
||||||
connect(ui->actionChangeToLzma, SIGNAL(triggered()), this, SLOT(changeToLzma()));
|
connect(ui->actionChangeToLzma, SIGNAL(triggered()), this, SLOT(changeToLzma()));
|
||||||
@ -107,14 +108,8 @@ void UEFITool::populateUi(const QModelIndex ¤t)
|
|||||||
ui->actionInsertBefore->setEnabled(type == TreeItem::File || type == TreeItem::Section);
|
ui->actionInsertBefore->setEnabled(type == TreeItem::File || type == TreeItem::Section);
|
||||||
ui->actionInsertAfter->setEnabled(type == TreeItem::File || type == TreeItem::Section);
|
ui->actionInsertAfter->setEnabled(type == TreeItem::File || type == TreeItem::Section);
|
||||||
//ui->actionReplace->setEnabled(ffsEngine->isOfType(TreeItem::File, current));
|
//ui->actionReplace->setEnabled(ffsEngine->isOfType(TreeItem::File, current));
|
||||||
ui->actionChangeToEfi11->setEnabled(type == TreeItem::Section && subtype == EFI_SECTION_COMPRESSION &&
|
ui->menuChangeCompressionTo->setEnabled(type == TreeItem::Section && subtype == EFI_SECTION_COMPRESSION &&
|
||||||
(algorithm == COMPRESSION_ALGORITHM_NONE || algorithm == COMPRESSION_ALGORITHM_TIANO || algorithm == COMPRESSION_ALGORITHM_LZMA));
|
(algorithm == COMPRESSION_ALGORITHM_NONE || COMPRESSION_ALGORITHM_EFI11 || algorithm == COMPRESSION_ALGORITHM_TIANO || algorithm == COMPRESSION_ALGORITHM_LZMA));
|
||||||
ui->actionChangeToTiano->setEnabled(type == TreeItem::Section && subtype == EFI_SECTION_COMPRESSION &&
|
|
||||||
(algorithm == COMPRESSION_ALGORITHM_NONE || algorithm == COMPRESSION_ALGORITHM_EFI11 || algorithm == COMPRESSION_ALGORITHM_LZMA));
|
|
||||||
ui->actionChangeToLzma->setEnabled(type == TreeItem::Section && subtype == EFI_SECTION_COMPRESSION &&
|
|
||||||
(algorithm == COMPRESSION_ALGORITHM_NONE || algorithm == COMPRESSION_ALGORITHM_EFI11 || algorithm == COMPRESSION_ALGORITHM_TIANO));
|
|
||||||
ui->menuChangeCompressionTo->setEnabled(ui->actionChangeToEfi11->isEnabled() ||
|
|
||||||
ui->actionChangeToTiano->isEnabled() || ui->actionChangeToLzma->isEnabled());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UEFITool::rebuild()
|
void UEFITool::rebuild()
|
||||||
@ -251,6 +246,17 @@ void UEFITool::changeToLzma()
|
|||||||
ui->actionSaveImageFile->setEnabled(true);
|
ui->actionSaveImageFile->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UEFITool::changeToNone()
|
||||||
|
{
|
||||||
|
QModelIndex index = ui->structureTreeView->selectionModel()->currentIndex();
|
||||||
|
if (!index.isValid())
|
||||||
|
return;
|
||||||
|
|
||||||
|
UINT8 result = ffsEngine->changeCompression(index, COMPRESSION_ALGORITHM_NONE);
|
||||||
|
if (result == ERR_SUCCESS)
|
||||||
|
ui->actionSaveImageFile->setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
void UEFITool::about()
|
void UEFITool::about()
|
||||||
{
|
{
|
||||||
QMessageBox::about(this, tr("About UEFITool"), tr(
|
QMessageBox::about(this, tr("About UEFITool"), tr(
|
||||||
|
@ -61,6 +61,7 @@ private slots:
|
|||||||
void replace();
|
void replace();
|
||||||
void remove();
|
void remove();
|
||||||
void rebuild();
|
void rebuild();
|
||||||
|
void changeToNone();
|
||||||
void changeToEfi11();
|
void changeToEfi11();
|
||||||
void changeToTiano();
|
void changeToTiano();
|
||||||
void changeToLzma();
|
void changeToLzma();
|
||||||
|
13
uefitool.ui
13
uefitool.ui
@ -20,7 +20,7 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>UEFITool 0.9.0</string>
|
<string>UEFITool 0.9.1</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralWidget">
|
<widget class="QWidget" name="centralWidget">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -221,11 +221,12 @@
|
|||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuChangeCompressionTo">
|
<widget class="QMenu" name="menuChangeCompressionTo">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Change &compression to</string>
|
<string>Change &compression to</string>
|
||||||
</property>
|
</property>
|
||||||
|
<addaction name="actionChangeToNone"/>
|
||||||
<addaction name="actionChangeToTiano"/>
|
<addaction name="actionChangeToTiano"/>
|
||||||
<addaction name="actionChangeToEfi11"/>
|
<addaction name="actionChangeToEfi11"/>
|
||||||
<addaction name="actionChangeToLzma"/>
|
<addaction name="actionChangeToLzma"/>
|
||||||
@ -459,6 +460,14 @@
|
|||||||
<enum>QAction::QuitRole</enum>
|
<enum>QAction::QuitRole</enum>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionChangeToNone">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Uncompressed</string>
|
||||||
|
</property>
|
||||||
|
<property name="shortcut">
|
||||||
|
<string>Ctrl+U</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