Skip to content

Commit

Permalink
Some tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ic005k committed Oct 8, 2024
1 parent ae9a810 commit 0455999
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 8 deletions.
17 changes: 11 additions & 6 deletions src/Method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void Method::getAllFiles(const QString& foldPath, QStringList& folds,
while (it.hasNext()) {
it.next();
QFileInfo fileInfo = it.fileInfo();
if (formats.contains(fileInfo.suffix())) { //检测格式,按需保存
if (formats.contains(fileInfo.suffix())) { // 检测格式,按需保存
folds << fileInfo.absoluteFilePath();
}
}
Expand Down Expand Up @@ -320,7 +320,7 @@ void Method::kextUpdate() {
}
}
} // end for j=0
} // end !isDev
} // end !isDev
else {
QString strName = name;
strName = strName.replace(".kext", 0);
Expand Down Expand Up @@ -444,7 +444,7 @@ void Method::startDownload(QString strUrl) {

myfile->setFileName(file);
bool ret =
myfile->open(QIODevice::WriteOnly | QIODevice::Truncate); //创建文件
myfile->open(QIODevice::WriteOnly | QIODevice::Truncate); // 创建文件
if (!ret) {
mw_one->dlgSyncOC->ui->btnStop->click();
QMessageBox::warning(this, tr("Warning"),
Expand Down Expand Up @@ -712,7 +712,7 @@ void Method::updateOpenCore() {
}

void Method::doProcessDownloadProgress(qint64 recv_total,
qint64 all_total) //显示
qint64 all_total) // 显示
{
if (blBreak) return;

Expand Down Expand Up @@ -1054,7 +1054,7 @@ void Method::set_nv_key(QString key, QString dataType) {
mw_one->ui->table_nv_add->setItem(mw_one->ui->table_nv_add->rowCount() - 1,
1, newItem1);

//保存数据
// 保存数据
mw_one->write_ini(mw_one->ui->table_nv_add0, mw_one->ui->table_nv_add,
mw_one->ui->table_nv_add0->currentRow());
}
Expand Down Expand Up @@ -1213,6 +1213,11 @@ void Method::goTable(QTableWidget* table) {
mw_one->ui->listMain->setCurrentRow(7);
mw_one->ui->listSub->setCurrentRow(8);
}

if (table == mw_one->ui->table_uefi_Unload) {
mw_one->ui->listMain->setCurrentRow(7);
mw_one->ui->listSub->setCurrentRow(9);
}
}

QString Method::copyDrivers(QString pathSource, QString pathTarget) {
Expand Down Expand Up @@ -2510,7 +2515,7 @@ void Method::set_TableData(QTableWidget* t, QVariantList mapList) {
}
}

if (map.count() == 0) { //代表列,从0开始
if (map.count() == 0) { // 代表列,从0开始
QTableWidgetItem* newItem1 =
new QTableWidgetItem(mapList.at(i).toString());
t->setItem(i + rowTotal, 0, newItem1);
Expand Down
11 changes: 11 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1657,6 +1657,10 @@ void MainWindow::ParserUEFI(QVariantMap map) {
// 9. ReservedMemory
QVariantList mapRM = map["ReservedMemory"].toList();
Method::set_TableData(ui->table_uefi_ReservedMemory, mapRM);

// 10. Unload
QVariantList mapUnload = map["Unload"].toList();
Method::set_TableData(ui->table_uefi_Unload, mapUnload);
}

void MainWindow::on_btnSave() { SavePlist(SaveFileName); }
Expand Down Expand Up @@ -2150,6 +2154,9 @@ QVariantMap MainWindow::SaveUEFI() {
subMap["ReservedMemory"] =
Method::get_TableData(ui->table_uefi_ReservedMemory);

// 10. Unload
subMap["Unload"] = Method::get_TableData(ui->table_uefi_Unload);

return subMap;
}

Expand Down Expand Up @@ -10228,6 +10235,10 @@ void MainWindow::smart_UpdateKeyField() {
ui->table_uefi_ReservedMemory,
Method::get_HorizontalHeaderList("UEFI", "ReservedMemory"));

// Unload
Method::init_Table(ui->table_uefi_Unload,
Method::get_HorizontalHeaderList("UEFI", "Unload"));

if (!loading) {
for (int i = 0; i < listOCATWidgetDelList.count(); i++) {
QWidget* w0 = listOCATWidgetDelList.at(i);
Expand Down
68 changes: 66 additions & 2 deletions src/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
<enum>QTabWidget::TabShape::Rounded</enum>
</property>
<property name="currentIndex">
<number>6</number>
<number>7</number>
</property>
<property name="iconSize">
<size>
Expand All @@ -291,7 +291,7 @@
<enum>QTabWidget::TabShape::Rounded</enum>
</property>
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<property name="documentMode">
<bool>true</bool>
Expand Down Expand Up @@ -11596,6 +11596,70 @@ Note: The reason this quirk cannot replace the kernel driver is because it canno
</item>
</layout>
</widget>
<widget class="QWidget" name="tabUEFI10">
<attribute name="title">
<string>Unload</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_108">
<item>
<widget class="QTableWidget" name="table_uefi_Unload">
<property name="columnCount">
<number>5</number>
</property>
<column/>
<column/>
<column/>
<column/>
<column/>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_76">
<item>
<widget class="QToolButton" name="btnUEFIUnload_Add">
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>+</string>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnUEFIUnload_Del">
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>-</string>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="shortcut">
<string>Del</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
<item row="1" column="0">
Expand Down

0 comments on commit 0455999

Please sign in to comment.