优化内核详细信息窗口
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user