Skip to content

Commit 0455999

Browse files
committed
Some tests.
1 parent ae9a810 commit 0455999

3 files changed

Lines changed: 88 additions & 8 deletions

File tree

‎src/Method.cpp‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void Method::getAllFiles(const QString& foldPath, QStringList& folds,
183183
while (it.hasNext()) {
184184
it.next();
185185
QFileInfo fileInfo = it.fileInfo();
186-
if (formats.contains(fileInfo.suffix())) { //检测格式,按需保存
186+
if (formats.contains(fileInfo.suffix())) { // 检测格式,按需保存
187187
folds << fileInfo.absoluteFilePath();
188188
}
189189
}
@@ -320,7 +320,7 @@ void Method::kextUpdate() {
320320
}
321321
}
322322
} // end for j=0
323-
} // end !isDev
323+
} // end !isDev
324324
else {
325325
QString strName = name;
326326
strName = strName.replace(".kext", 0);
@@ -444,7 +444,7 @@ void Method::startDownload(QString strUrl) {
444444

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

714714
void Method::doProcessDownloadProgress(qint64 recv_total,
715-
qint64 all_total) //显示
715+
qint64 all_total) // 显示
716716
{
717717
if (blBreak) return;
718718

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

1057-
//保存数据
1057+
// 保存数据
10581058
mw_one->write_ini(mw_one->ui->table_nv_add0, mw_one->ui->table_nv_add,
10591059
mw_one->ui->table_nv_add0->currentRow());
10601060
}
@@ -1213,6 +1213,11 @@ void Method::goTable(QTableWidget* table) {
12131213
mw_one->ui->listMain->setCurrentRow(7);
12141214
mw_one->ui->listSub->setCurrentRow(8);
12151215
}
1216+
1217+
if (table == mw_one->ui->table_uefi_Unload) {
1218+
mw_one->ui->listMain->setCurrentRow(7);
1219+
mw_one->ui->listSub->setCurrentRow(9);
1220+
}
12161221
}
12171222

12181223
QString Method::copyDrivers(QString pathSource, QString pathTarget) {
@@ -2510,7 +2515,7 @@ void Method::set_TableData(QTableWidget* t, QVariantList mapList) {
25102515
}
25112516
}
25122517

2513-
if (map.count() == 0) { //代表列,从0开始
2518+
if (map.count() == 0) { // 代表列,从0开始
25142519
QTableWidgetItem* newItem1 =
25152520
new QTableWidgetItem(mapList.at(i).toString());
25162521
t->setItem(i + rowTotal, 0, newItem1);

‎src/mainwindow.cpp‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,6 +1657,10 @@ void MainWindow::ParserUEFI(QVariantMap map) {
16571657
// 9. ReservedMemory
16581658
QVariantList mapRM = map["ReservedMemory"].toList();
16591659
Method::set_TableData(ui->table_uefi_ReservedMemory, mapRM);
1660+
1661+
// 10. Unload
1662+
QVariantList mapUnload = map["Unload"].toList();
1663+
Method::set_TableData(ui->table_uefi_Unload, mapUnload);
16601664
}
16611665

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

2157+
// 10. Unload
2158+
subMap["Unload"] = Method::get_TableData(ui->table_uefi_Unload);
2159+
21532160
return subMap;
21542161
}
21552162

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

10238+
// Unload
10239+
Method::init_Table(ui->table_uefi_Unload,
10240+
Method::get_HorizontalHeaderList("UEFI", "Unload"));
10241+
1023110242
if (!loading) {
1023210243
for (int i = 0; i < listOCATWidgetDelList.count(); i++) {
1023310244
QWidget* w0 = listOCATWidgetDelList.at(i);

‎src/mainwindow.ui‎

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
<enum>QTabWidget::TabShape::Rounded</enum>
267267
</property>
268268
<property name="currentIndex">
269-
<number>6</number>
269+
<number>7</number>
270270
</property>
271271
<property name="iconSize">
272272
<size>
@@ -291,7 +291,7 @@
291291
<enum>QTabWidget::TabShape::Rounded</enum>
292292
</property>
293293
<property name="currentIndex">
294-
<number>3</number>
294+
<number>0</number>
295295
</property>
296296
<property name="documentMode">
297297
<bool>true</bool>
@@ -11596,6 +11596,70 @@ Note: The reason this quirk cannot replace the kernel driver is because it canno
1159611596
</item>
1159711597
</layout>
1159811598
</widget>
11599+
<widget class="QWidget" name="tabUEFI10">
11600+
<attribute name="title">
11601+
<string>Unload</string>
11602+
</attribute>
11603+
<layout class="QHBoxLayout" name="horizontalLayout_108">
11604+
<item>
11605+
<widget class="QTableWidget" name="table_uefi_Unload">
11606+
<property name="columnCount">
11607+
<number>5</number>
11608+
</property>
11609+
<column/>
11610+
<column/>
11611+
<column/>
11612+
<column/>
11613+
<column/>
11614+
</widget>
11615+
</item>
11616+
<item>
11617+
<layout class="QVBoxLayout" name="verticalLayout_76">
11618+
<item>
11619+
<widget class="QToolButton" name="btnUEFIUnload_Add">
11620+
<property name="maximumSize">
11621+
<size>
11622+
<width>20</width>
11623+
<height>16777215</height>
11624+
</size>
11625+
</property>
11626+
<property name="text">
11627+
<string>+</string>
11628+
</property>
11629+
<property name="iconSize">
11630+
<size>
11631+
<width>20</width>
11632+
<height>20</height>
11633+
</size>
11634+
</property>
11635+
</widget>
11636+
</item>
11637+
<item>
11638+
<widget class="QToolButton" name="btnUEFIUnload_Del">
11639+
<property name="maximumSize">
11640+
<size>
11641+
<width>20</width>
11642+
<height>16777215</height>
11643+
</size>
11644+
</property>
11645+
<property name="text">
11646+
<string>-</string>
11647+
</property>
11648+
<property name="iconSize">
11649+
<size>
11650+
<width>20</width>
11651+
<height>20</height>
11652+
</size>
11653+
</property>
11654+
<property name="shortcut">
11655+
<string>Del</string>
11656+
</property>
11657+
</widget>
11658+
</item>
11659+
</layout>
11660+
</item>
11661+
</layout>
11662+
</widget>
1159911663
</widget>
1160011664
</item>
1160111665
<item row="1" column="0">

0 commit comments

Comments
 (0)