支持选择内核安装

This commit is contained in:
2024-04-24 21:14:47 +08:00
parent 28aa22e293
commit 70e0e04e4c
2 changed files with 10 additions and 1 deletions

View File

@@ -55,7 +55,15 @@ void MainWindow::on_m_refreshButton_clicked()
void MainWindow::on_m_installButton_clicked() void MainWindow::on_m_installButton_clicked()
{ {
KernelInstaller *installer = new KernelInstaller(kernelInformation->get_pkgName(0)); QModelIndex list = ui->m_kernelShow->selectionModel()->currentIndex();
int row = list.row();
if(row <= 0) {
// 未选中任何内容
QMessageBox::critical(this, tr("Error"), tr("Nothing to choose"));
return;
}
// 获取选中行
KernelInstaller *installer = new KernelInstaller(kernelInformation->get_pkgName(row));
installer->show(); installer->show();
} }

View File

@@ -2,6 +2,7 @@
#define MAINWINDOW_H #define MAINWINDOW_H
#include <QMainWindow> #include <QMainWindow>
#include <QMessageBox>
#include "kernelinformation.h" #include "kernelinformation.h"
#include "kernelinstaller.h" #include "kernelinstaller.h"