优化内核详细信息窗口

This commit is contained in:
2024-05-18 11:04:21 +08:00
parent 86759a1bc5
commit ee34925def
5 changed files with 118 additions and 16 deletions

View File

@@ -1,6 +1,8 @@
#include "kernelinformationdialog.h"
#include "ui_kernelinformationdialog.h"
#include "kernelinstaller.h"
#include <QJsonArray>
KernelInformationDialog::KernelInformationDialog(QJsonObject data, QWidget *parent) :
@@ -16,6 +18,7 @@ KernelInformationDialog::KernelInformationDialog(QJsonObject data, QWidget *pare
QString kernelText = "";
for(QJsonValue i: array) {
kernelText += i.toString() + " ";
pkgList.append(i.toString());
}
ui->m_PkgName->setText(tr("Package Name:") + " " + kernelText);
ui->m_kernelArch->setText(tr("Kernel Architecture:") + " " + data.value("Arch").toArray().at(0).toString());
@@ -26,3 +29,36 @@ KernelInformationDialog::~KernelInformationDialog()
{
delete ui;
}
void KernelInformationDialog::on_m_refreshButton_clicked()
{
}
void KernelInformationDialog::on_m_reconfigureButton_clicked()
{
KernelInstaller *installer = new KernelInstaller(KernelInstaller::Option::Reconfigure, pkgList);
installer->show();
}
void KernelInformationDialog::on_m_installButton_clicked()
{
KernelInstaller *installer = new KernelInstaller(KernelInstaller::Option::Install, pkgList);
connect(installer, &KernelInstaller::InstallFinished, this, [this](int status){
emit InstallFinished(status);
});
installer->show();
}
void KernelInformationDialog::on_m_removeButton_clicked()
{
KernelInstaller *installer = new KernelInstaller(KernelInstaller::Option::Remove, pkgList);
connect(installer, &KernelInstaller::InstallFinished, this, [this](int status){
emit RemoveFinished(status);
});
installer->show();
}