From 04559996f4586b030df1014510cf6ed1f284038e Mon Sep 17 00:00:00 2001 From: ic005k Date: Tue, 8 Oct 2024 15:54:13 +0800 Subject: [PATCH] Some tests. --- src/Method.cpp | 17 ++++++++---- src/mainwindow.cpp | 11 ++++++++ src/mainwindow.ui | 68 ++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 88 insertions(+), 8 deletions(-) diff --git a/src/Method.cpp b/src/Method.cpp index cb6c9b8ede2..b56151f1805 100644 --- a/src/Method.cpp +++ b/src/Method.cpp @@ -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(); } } @@ -320,7 +320,7 @@ void Method::kextUpdate() { } } } // end for j=0 - } // end !isDev + } // end !isDev else { QString strName = name; strName = strName.replace(".kext", 0); @@ -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"), @@ -712,7 +712,7 @@ void Method::updateOpenCore() { } void Method::doProcessDownloadProgress(qint64 recv_total, - qint64 all_total) //显示 + qint64 all_total) // 显示 { if (blBreak) return; @@ -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()); } @@ -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) { @@ -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); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e86144feee4..2806cffc209 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -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); } @@ -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; } @@ -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); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index d609dd1f4c1..83d31bce6b0 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -266,7 +266,7 @@ QTabWidget::TabShape::Rounded - 6 + 7 @@ -291,7 +291,7 @@ QTabWidget::TabShape::Rounded - 3 + 0 true @@ -11596,6 +11596,70 @@ Note: The reason this quirk cannot replace the kernel driver is because it canno + + + Unload + + + + + + 5 + + + + + + + + + + + + + + + 20 + 16777215 + + + + + + + + + 20 + 20 + + + + + + + + + 20 + 16777215 + + + + - + + + + 20 + 20 + + + + Del + + + + + + +