Compare commits

...

15 Commits

Author SHA1 Message Date
bed4c66530 修改项目地址 2024-10-13 10:56:58 +08:00
f4f8ffc863 修复无法在系统助手正常显示图标的问题 2024-10-13 10:38:44 +08:00
1bf535577e 屏蔽postinst 2024-10-13 10:27:50 +08:00
738099d572 增加自动构建工程 2024-10-13 10:09:03 +08:00
ac661e4b45 支持在GXDE助手中显示入口 2024-10-13 10:08:26 +08:00
5c99fc9290
update README.md.
Merge pull request  from 麻本法/N/A
2024-07-01 02:41:26 +00:00
b5436b506f
update README.md.
Signed-off-by: 麻本法 <zinface@163.com>
2024-07-01 02:37:49 +00:00
0520a006d0 1.1.1 2024-06-29 08:34:59 +08:00
19392d919c 更新翻译 2024-06-29 08:23:20 +08:00
ebe3473d15 初步实现版本号切割 2024-05-18 15:36:03 +08:00
ee34925def 优化内核详细信息窗口 2024-05-18 11:04:21 +08:00
86759a1bc5 修复在没有安装aptss时安装内核会提示错误1 2024-05-18 09:54:41 +08:00
86f7263b91 新增预览窗口 2024-05-17 19:45:01 +08:00
19e4ec2930 新增窗口 2024-05-16 22:38:53 +08:00
30372e2c32 调整README 2024-05-12 17:15:17 +08:00
29 changed files with 590 additions and 79 deletions

13
.github/workflows/program-builder.yml vendored Normal file

@ -0,0 +1,13 @@
name: Building Program
run-name: Building ${{ GITHUB.REPOSITORY }}
on:
workflow_dispatch:
push:
tags:
- "*"
jobs:
call:
uses: GXDE-OS/GXDE/.github/workflows/building-deb.yml@master
secrets: inherit

2
.gitignore vendored

@ -70,3 +70,5 @@ CMakeLists.txt.user*
*.dll *.dll
*.exe *.exe
# Visual Studio Code
.vscode

@ -1,22 +1,27 @@
<p width=100px align="center"><img width=40% src="icon/icon.svg"></p> <p width=100px align="center"><img width=40% src="icon/gxde-kernel-manager.svg"></p>
<h1 align="center">GXDE 内核管理器 1.1.0</h1> <h1 align="center">GXDE 内核管理器 1.1.1</h1>
<hr> <hr>
<a href='https://gitee.com/GXDE-OS/gxde-kernel-manager/stargazers'><img src='https://gitee.com/GXDE-OS/gxde-kernel-manager/badge/star.svg?theme=dark' alt='star'></img></a> <a href='https://gitee.com/GXDE-OS/gxde-kernel-manager/stargazers'><img src='https://gitee.com/GXDE-OS/gxde-kernel-manager/badge/star.svg?theme=dark' alt='star'></img></a>
<a href='https://gitee.com/GXDE-OS/gxde-kernel-manager/members'><img src='https://gitee.com/GXDE-OS/gxde-kernel-manager/badge/fork.svg?theme=dark' alt='fork'></img></a> <a href='https://gitee.com/GXDE-OS/gxde-kernel-manager/members'><img src='https://gitee.com/GXDE-OS/gxde-kernel-manager/badge/fork.svg?theme=dark' alt='fork'></img></a>
## 国产的 arm CPU如飞腾、鲲鹏、麒麟 不要随意更换内核,否则会因为更换内核导致兼容性问题甚至无法启动
## 介绍 ## 介绍
GXDE 内核管理器是一个帮助用户更方便获取、安装、移除内核的工具。 GXDE 内核管理器是一个帮助用户更方便获取、安装、移除内核的工具。
目前支持 amd64、arm64、mips64 和 loong64 四个架构 目前支持 amd64、arm64、mips64 和 loong64 四个架构
***警告:请不要随意操作内核除非你知道你在做什么!*** ***警告:请不要随意操作内核除非你知道你在做什么!***
QQ 群881201853
GXDE Kernel Manager is a kernel manager allows users to install or remove kernels easily. GXDE Kernel Manager is a kernel manager allows users to install or remove kernels easily.
Support architectures: amd64, arm64, mips64, loong64 Support architectures: amd64, arm64, mips64, loong64
**Warning: You may damage your system unless you know what you will do!** **Warning: You may damage your system unless you know what you will do!**
![image.png](https://storage.deepin.org/thread/202405120819335429_image.png) ![image.png](https://storage.deepin.org/thread/202405120819335429_image.png)
![image.png](https://storage.deepin.org/thread/202405120820175356_image.png) ![image.png](https://storage.deepin.org/thread/202405120820175356_image.png)
## GXDE 系统如何安装 GXDE 内核管理器? ## GXDE 系统如何安装 GXDE 内核管理器?
只适用于 GXDEdeepin/UOS 等需要下载 deb 手动安装 只适用于 GXDEdeepin/UOS 等需要下载 deb 手动安装
```bash ```bash
@ -25,6 +30,13 @@ sudo apt install gxde-kernel-manager
``` ```
## 更新内容 ## 更新内容
### 1.1.12024.06.29
**※1、新增内核详细信息窗口**
**※2、修复在部分机器上安装内核直接提示错误 1 的问题**
**※1. Add an information window about the Kernel**
**※2. Fix the issue with the installed Kernel causing exit code 1**
### 1.1.02024.05.12 ### 1.1.02024.05.12
**※1、支持从 apt 源读取内核数据并显示安装** **※1、支持从 apt 源读取内核数据并显示安装**
**※2、支持只显示与当前系统相同架构的内核** **※2、支持只显示与当前系统相同架构的内核**
@ -78,7 +90,7 @@ sudo apt install fakeroot
dpkg-buildpackage -b -us dpkg-buildpackage -b -us
``` ```
## 请作者喝杯茶 ## 请作者喝杯茶
如果您觉得 Wine 运行器对你有帮助,可以请作者喝杯茶 如果您觉得 GXDE 内核管理器对你有帮助,可以请作者喝杯茶
<img src="Donate/Wechat.png" width="250" /> <img src="Donate/Wechat.png" width="250" />
<img src="Donate/Alipay.jpg" width="250" /> <img src="Donate/Alipay.jpg" width="250" />
<img src="Donate/QQ.png" width="250" > <img src="Donate/QQ.png" width="250" >
@ -87,4 +99,4 @@ dpkg-buildpackage -b -us
支付宝官方活动,扫描获得支付红包! 支付宝官方活动,扫描获得支付红包!
<p><img src="Donate/advertisement0.jpg" width="250" ></p> <p><img src="Donate/advertisement0.jpg" width="250" ></p>
# ©2023Now gfdgd xi # ©2023Now gfdgd xi

@ -9,7 +9,7 @@
<file>icon/dialog-ok.svg</file> <file>icon/dialog-ok.svg</file>
<file>icon/dialog-question.svg</file> <file>icon/dialog-question.svg</file>
<file>icon/dialog-warning.svg</file> <file>icon/dialog-warning.svg</file>
<file>icon/icon.svg</file> <file>icon/gxde-kernel-manager.svg</file>
<file>shell/kernel-installer-remove-template.sh</file> <file>shell/kernel-installer-remove-template.sh</file>
<file>translation/gxde-kernel-manager_zh_CN.qm</file> <file>translation/gxde-kernel-manager_zh_CN.qm</file>
<file>shell/kernel-installer-reconfigure-template.sh</file> <file>shell/kernel-installer-reconfigure-template.sh</file>
@ -23,5 +23,6 @@
<file>Donate/Alipay.jpg</file> <file>Donate/Alipay.jpg</file>
<file>Donate/QQ.png</file> <file>Donate/QQ.png</file>
<file>Donate/Wechat.png</file> <file>Donate/Wechat.png</file>
<file>icon/tux.png</file>
</qresource> </qresource>
</RCC> </RCC>

@ -27,7 +27,7 @@ AboutWindow::AboutWindow(QWidget *parent) :
info += "<p>Gitee: <a href='https://gitee.com/GXDE-OS/gxde-kernel-manager'>https://gitee.com/GXDE-OS/gxde-kernel-manager</a></p>"; info += "<p>Gitee: <a href='https://gitee.com/GXDE-OS/gxde-kernel-manager'>https://gitee.com/GXDE-OS/gxde-kernel-manager</a></p>";
info += "<p>Github: <a href='https://github.com/GXDE-OS/gxde-kernel-manager'>https://github.com/GXDE-OS/gxde-kernel-manager</a></p>"; info += "<p>Github: <a href='https://github.com/GXDE-OS/gxde-kernel-manager'>https://github.com/GXDE-OS/gxde-kernel-manager</a></p>";
info += "<p>Sourceforge: <a href='https://sourceforge.net/projects/gxde-kernel-manager/'>https://sourceforge.net/projects/gxde-kernel-manager/</a></p>"; info += "<p>Sourceforge: <a href='https://sourceforge.net/projects/gxde-kernel-manager/'>https://sourceforge.net/projects/gxde-kernel-manager/</a></p>";
info += "<p>GXDE Homepage: <a href='https://gxde.gfdgdxi.top'>https://gxde.gfdgdxi.top</a></p>"; info += "<p>GXDE Homepage: <a href='https://www.gxde.org'>https://www.gxde.org</a></p>";
info += "<hr/>\n"; info += "<hr/>\n";
info += "<h1>©2023" + QDateTime::currentDateTime().toString("yyyy") + " gfdgd xi</h1>\n"; info += "<h1>©2023" + QDateTime::currentDateTime().toString("yyyy") + " gfdgd xi</h1>\n";
ui->textBrowser->setHtml(info); ui->textBrowser->setHtml(info);
@ -46,6 +46,6 @@ void AboutWindow::on_m_closeButton_clicked()
void AboutWindow::on_m_logoShower_linkActivated(const QString &link) void AboutWindow::on_m_logoShower_linkActivated(const QString &link)
{ {
ui->m_logoShower->setText("<html><head/><body><p><a href='https://gxde.gfdgdxi.top'><img width=128 src=\":/icon/icon1.png\"/></a></p></body></html>"); ui->m_logoShower->setText("<html><head/><body><p><a href='https://www.gxde.org'><img width=128 src=\":/icon/icon1.png\"/></a></p></body></html>");
} }

@ -15,14 +15,14 @@
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="Resource.qrc"> <iconset resource="Resource.qrc">
<normaloff>:/icon/icon.svg</normaloff>:/icon/icon.svg</iconset> <normaloff>:/icon/gxde-kernel-manager.svg</normaloff>:/icon/gxde-kernel-manager.svg</iconset>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QLabel" name="m_logoShower"> <widget class="QLabel" name="m_logoShower">
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href='https://gxde.gfdgdxi.top'&gt;&lt;img width=128 src=&quot;:/icon/icon.svg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href='https://www.gxde.org'&gt;&lt;img width=128 src=&quot;:/icon/gxde-kernel-manager.svg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>

@ -11,6 +11,63 @@ AptPkgInfo::AptPkgInfo(QString pkgName, PkgSearchOption option)
ReadAptData(); ReadAptData();
} }
QStringList AptPkgInfo::SplitVersion(QString version) const
{
SplitVersionStatus status = SplitVersionStatus::Checking;
QStringList versionList;
QString versionNumberTemp = "";
QString versionLetterTemp = "";
for(QString i: version) {
if(symbolList.contains(i)) {
// 如果是特殊字符
switch(status) {
case SplitVersionStatus::Checking:
versionList.append(versionNumberTemp);
break;
case SplitVersionStatus::MeetedEnglishLetter:
versionList.append(versionLetterTemp);
break;
}
versionList.append(i);
versionNumberTemp = "";
versionLetterTemp = "";
status = SplitVersionStatus::MeetSymbol;
continue;
}
if(i[0].isLetter()) {
switch(status) {
case SplitVersionStatus::Checking:
versionList.append(versionNumberTemp);
break;
}
versionLetterTemp += i;
versionNumberTemp = "";
status = SplitVersionStatus::MeetedEnglishLetter;
continue;
}
switch(status) {
case SplitVersionStatus::MeetedEnglishLetter:
versionList.append(versionLetterTemp);
break;
}
versionNumberTemp += i;
status = SplitVersionStatus::Checking;
versionLetterTemp = "";
}
if(status == SplitVersionStatus::Checking) {
versionList.append(versionNumberTemp);
}
return versionList;
}
bool AptPkgInfo::CompareVersion(QString version1, QString version2) const
{
return true;
}
void AptPkgInfo::ReadAptData() void AptPkgInfo::ReadAptData()
{ {
this->aptData = QJsonObject(); this->aptData = QJsonObject();
@ -36,7 +93,19 @@ void AptPkgInfo::ReadAptData()
if(strTemp.replace(" ", "").replace("\n", "") == "") { if(strTemp.replace(" ", "").replace("\n", "") == "") {
// 空行 // 空行
if(status == pkgDataStatus::IsContain) { if(status == pkgDataStatus::IsContain) {
aptData.insert(pkgData.value("Package").toString(), pkgData); QString addPkgName = pkgData.value("Package").toString();
// 如果已经存在表中
if(pkgData.contains(addPkgName)) {
// 新增数据
QJsonObject allDataObject = aptData.value(addPkgName).toObject();
// 判断版本大小,如果新于表内版本则更新
QString dataVersion = allDataObject.value("Version").toString();
}
else {
aptData.insert(addPkgName, pkgData);
}
} }
status = pkgDataStatus::EmptyLine; status = pkgDataStatus::EmptyLine;
pkgData = QJsonObject(); // 清空 pkgData = QJsonObject(); // 清空
@ -149,3 +218,8 @@ QByteArray AptPkgInfo::GetCommandResult(QString command, QStringList argv, QProc
process.close(); process.close();
return result; return result;
} }
QJsonObject AptPkgInfo::get_data() const
{
return aptData;
}

@ -28,6 +28,9 @@ public:
QString get_description(QString pkgName) const; QString get_description(QString pkgName) const;
QString get_architecture(QString pkgName) const; QString get_architecture(QString pkgName) const;
QJsonObject get_data() const;
bool CompareVersion(QString version1, QString version2) const;
private: private:
@ -35,6 +38,15 @@ private:
QString pkgInfo; QString pkgInfo;
QJsonObject aptData; QJsonObject aptData;
PkgSearchOption pkgSearchOption = PkgSearchOption::Equal; PkgSearchOption pkgSearchOption = PkgSearchOption::Equal;
QStringList symbolList = {"-", "~", "+"};
enum SplitVersionStatus {
Checking,
MeetedEnglishLetter,
MeetSymbol,
Other
};
QStringList SplitVersion(QString version) const;
enum pkgDataStatus { enum pkgDataStatus {
EmptyLine = 0, EmptyLine = 0,
@ -43,7 +55,10 @@ private:
Readed = 3, Readed = 3,
None = 4, None = 4,
UnContain = 5, UnContain = 5,
IsContain = 6 IsContain = 6,
IsContainOldVersion = 7,
IsContainNewVersion = 8,
IsContainSameVersion = 9
}; };
void ReadAptData(); void ReadAptData();

@ -1,10 +1,6 @@
<h1>What's new?</h1> <h1>What's new?</h1>
<pre> <pre>
<b>※1. Support getting kernel data from apt database. <b>※1. Add an information window about the Kernel
※2. Support showing only kernels that are the same as the local system architecture. ※2. Fix the issue with the installed Kernel causing exit code 1
※3. Support using aptss to download packages faster.
※4. Show a warning message box when removing all kernels.
</b> </b>
5. Optimize the effect of the kernels table.
6. Support showing kernel descriptions and versions.
</pre> </pre>

@ -1,10 +1,6 @@
<h1>1.1.0 更新内容</h1> <h1>1.1.0 更新内容</h1>
<pre> <pre>
<b>※1、支持从 apt 源读取内核数据并显示安装 <b>※1、新增内核详细信息窗口
※2、支持只显示与当前系统相同架构的内核 ※2、修复在部分机器上安装内核直接提示错误 1 的问题
※3、下载/更新内核时支持调用 aptss 提升下载速度
※4、新增卸载所有内核时的窗口警告
</b> </b>
5、优化表格显示效果
6、支持显示内核描述和版本
</pre> </pre>

@ -1 +1 @@
1.1.0 1.1.1

4
debian/changelog vendored

@ -1,4 +1,4 @@
gxde-kernel-manager (1.1.0) UNRELEASED; urgency=medium gxde-kernel-manager (1.2.2) UNRELEASED; urgency=medium
* ※1、支持从 apt 源读取内核数据并显示安装 * ※1、支持从 apt 源读取内核数据并显示安装
* ※2、支持只显示与当前系统相同架构的内核 * ※2、支持只显示与当前系统相同架构的内核
@ -14,4 +14,4 @@ gxde-kernel-manager (1.1.0) UNRELEASED; urgency=medium
* 5. Optimize the effect of the kernels table. * 5. Optimize the effect of the kernels table.
* 6. Support showing kernel descriptions and versions. * 6. Support showing kernel descriptions and versions.
-- gfdgd_xi <3025613752@qq.com> Sun, 12 May 2024 16:26:29 +0800 -- gfdgd_xi <3025613752@qq.com> Sun, 13 Oct 2024 10:56:49 +0800

2
debian/postinst vendored

@ -1,2 +1,2 @@
#!/bin/bash #!/bin/bash
apt update | true #apt update | true

@ -5,6 +5,6 @@ Name[zh_CN]=GXDE 内核管理器
Comment=GXDE Kernel Manager Comment=GXDE Kernel Manager
Comment[zh_CN]=GXDE Comment[zh_CN]=GXDE
Type=Application Type=Application
Exec=bash /opt/apps/gxde-kernel-manager/gxde-kernel-manager-runner.sh Exec=gxde-kernel-manager
Icon=/opt/apps/gxde-kernel-manager/icon.svg Icon=gxde-kernel-manager
Categories=System Categories=System

@ -12,6 +12,7 @@ SOURCES += \
aboutwindow.cpp \ aboutwindow.cpp \
aptpkginfo.cpp \ aptpkginfo.cpp \
kernelinformation.cpp \ kernelinformation.cpp \
kernelinformationdialog.cpp \
kernelinstaller.cpp \ kernelinstaller.cpp \
main.cpp \ main.cpp \
mainwindow.cpp \ mainwindow.cpp \
@ -21,12 +22,14 @@ HEADERS += \
aboutwindow.h \ aboutwindow.h \
aptpkginfo.h \ aptpkginfo.h \
kernelinformation.h \ kernelinformation.h \
kernelinformationdialog.h \
kernelinstaller.h \ kernelinstaller.h \
mainwindow.h \ mainwindow.h \
programinfo.h programinfo.h
FORMS += \ FORMS += \
aboutwindow.ui \ aboutwindow.ui \
kernelinformationdialog.ui \
kernelinstaller.ui \ kernelinstaller.ui \
mainwindow.ui mainwindow.ui
@ -39,8 +42,9 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target !isEmpty(target.path): INSTALLS += target
unix:!macx: LIBS += -lqtermwidget5 unix:!macx: LIBS += -lqtermwidget5
aptsource.path = /etc/apt/sources.list.d/ # 使用 GXDE 系统源里含有的内核
aptsource.files = $$PWD/AptSources/gxde-kernel-manager.list #aptsource.path = /etc/apt/sources.list.d/
#aptsource.files = $$PWD/AptSources/gxde-kernel-manager.list
aptsourcegpg.path = /etc/apt/trusted.gpg.d/ aptsourcegpg.path = /etc/apt/trusted.gpg.d/
aptsourcegpg.files = $$PWD/AptSources/gxde-kernel-manager.gpg aptsourcegpg.files = $$PWD/AptSources/gxde-kernel-manager.gpg
@ -48,23 +52,29 @@ aptsourcegpg.files = $$PWD/AptSources/gxde-kernel-manager.gpg
debiandesktop.path = /usr/share/applications/ debiandesktop.path = /usr/share/applications/
debiandesktop.files = $$PWD/gxde-kernel-manager.desktop debiandesktop.files = $$PWD/gxde-kernel-manager.desktop
uosdesktop.path = /opt/apps/gxde-kernel-manager/entries/applications #uosdesktop.path = /opt/apps/gxde-kernel-manager/entries/applications
uosdesktop.files = $$PWD/gxde-kernel-manager.desktop #uosdesktop.files = $$PWD/gxde-kernel-manager.desktop
icon.path = /opt/apps/gxde-kernel-manager/ icon.path = /usr/share/icons/
icon.files = $$PWD/icon/icon.svg icon.files = $$PWD/icon/gxde-kernel-manager.svg
#icon.path = /opt/apps/gxde-kernel-manager/
#icon.files = $$PWD/icon/icon.svg
targetrunner.path = /opt/apps/gxde-kernel-manager/ # GXDE 下不需要该脚本
targetrunner.files = $$PWD/gxde-kernel-manager-runner.sh #targetrunner.path = /opt/apps/gxde-kernel-manager/
#targetrunner.files = $$PWD/gxde-kernel-manager-runner.sh
#libinclude.path = /opt/apps/gxde-kernel-manager/ #libinclude.path = /opt/apps/gxde-kernel-manager/
#libinclude.files = $$PWD/lib #libinclude.files = $$PWD/lib
target.path = /opt/apps/gxde-kernel-manager/ #target.path = /opt/apps/gxde-kernel-manager/
target.path = /usr/bin
sysbro.path = /usr/share/GXDE/gxde-system-assistant/tool-extensions
sysbro.files = $$PWD/gxde-kernel-manager.desktop
#INSTALLS += aptsourcegpg aptsource target debiandesktop uosdesktop icon targetrunner
INSTALLS += aptsourcegpg aptsource target debiandesktop uosdesktop icon targetrunner INSTALLS += target icon sysbro
TRANSLATIONS += translation/gxde-kernel-manager_zh_CN.ts TRANSLATIONS += translation/gxde-kernel-manager_zh_CN.ts

Before

(image error) Size: 32 KiB

After

(image error) Size: 32 KiB

BIN
icon/tux.png Normal file

Binary file not shown.

After

(image error) Size: 7.5 KiB

@ -14,6 +14,7 @@ void KernelInformation::LoadInfo()
QJsonArray array; QJsonArray array;
AptPkgInfo kernelManagerinfo = AptPkgInfo("gxde-kernel-manager", AptPkgInfo::PkgSearchOption::Equal); AptPkgInfo kernelManagerinfo = AptPkgInfo("gxde-kernel-manager", AptPkgInfo::PkgSearchOption::Equal);
QStringList list = kernelManagerinfo.GetAptPackageList(); QStringList list = kernelManagerinfo.GetAptPackageList();
qDebug() << kernelManagerinfo.get_data();
for(QString i: list) { for(QString i: list) {
QJsonObject object; QJsonObject object;
kernelManagerinfo.SetPkgName(i); kernelManagerinfo.SetPkgName(i);

@ -0,0 +1,64 @@
#include "kernelinformationdialog.h"
#include "ui_kernelinformationdialog.h"
#include "kernelinstaller.h"
#include <QJsonArray>
KernelInformationDialog::KernelInformationDialog(QJsonObject data, QWidget *parent) :
QDialog(parent),
ui(new Ui::KernelInformationDialog)
{
ui->setupUi(this);
// 解析数据
ui->m_kernelName->setText(tr("Kernel Name:") + " " + data.value("Name").toString());
ui->m_kernelVersion->setText(tr("Kernel Version:") + " " + data.value("Ver").toString());
ui->m_kernelAuthor->setText(tr("Author:") + " " + data.value("Author").toString());
QJsonArray array = data.value("PkgName").toArray();
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());
ui->m_des->setText(data.value("Des").toString());
}
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();
}

37
kernelinformationdialog.h Normal file

@ -0,0 +1,37 @@
#ifndef KERNELINFORMATIONDIALOG_H
#define KERNELINFORMATIONDIALOG_H
#include <QDialog>
#include <QJsonObject>
namespace Ui {
class KernelInformationDialog;
}
class KernelInformationDialog : public QDialog
{
Q_OBJECT
public:
explicit KernelInformationDialog(QJsonObject data, QWidget *parent = nullptr);
~KernelInformationDialog();
signals:
void InstallFinished(int status);
void RemoveFinished(int status);
private slots:
void on_m_refreshButton_clicked();
void on_m_reconfigureButton_clicked();
void on_m_installButton_clicked();
void on_m_removeButton_clicked();
private:
Ui::KernelInformationDialog *ui;
QStringList pkgList;
};
#endif // KERNELINFORMATIONDIALOG_H

153
kernelinformationdialog.ui Normal file

@ -0,0 +1,153 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>KernelInformationDialog</class>
<widget class="QDialog" name="KernelInformationDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>650</width>
<height>412</height>
</rect>
</property>
<property name="windowTitle">
<string>Information</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="linuxIconShower">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/icon/tux.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="m_kernelName">
<property name="text">
<string>Kernel Name:</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="m_kernelVersion">
<property name="text">
<string>Kernel Version:</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="m_kernelAuthor">
<property name="text">
<string>Author:</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="m_kernelArch">
<property name="text">
<string>Kernel Architecture:</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="m_PkgName">
<property name="text">
<string>Package Name:</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="m_desTip">
<property name="text">
<string>Description:</string>
</property>
</widget>
</item>
<item>
<widget class="QTextBrowser" name="m_des"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="m_reconfigureButton">
<property name="text">
<string>Reconfigure</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="m_installButton">
<property name="text">
<string>Install</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="m_removeButton">
<property name="text">
<string>Remove</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

@ -15,7 +15,7 @@
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="Resource.qrc"> <iconset resource="Resource.qrc">
<normaloff>:/icon/icon.svg</normaloff>:/icon/icon.svg</iconset> <normaloff>:/icon/gxde-kernel-manager.svg</normaloff>:/icon/gxde-kernel-manager.svg</iconset>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">

@ -8,6 +8,8 @@
#include <QStandardItemModel> #include <QStandardItemModel>
#include <qdesktopservices.h> #include <qdesktopservices.h>
#include "kernelinformationdialog.h"
MainWindow::MainWindow(QWidget *parent) MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent) : QMainWindow(parent)
, ui(new Ui::MainWindow) , ui(new Ui::MainWindow)
@ -129,6 +131,13 @@ void MainWindow::on_actionGithub_triggered()
} }
void MainWindow::on_actionSourceforge_triggered()
{
QDesktopServices::openUrl(QUrl("https://sourceforge.net/projects/gxde-kernel-manager/"));
}
void MainWindow::on_m_removeButton_clicked() void MainWindow::on_m_removeButton_clicked()
{ {
QModelIndex list = ui->m_kernelShow->selectionModel()->currentIndex(); QModelIndex list = ui->m_kernelShow->selectionModel()->currentIndex();
@ -210,3 +219,32 @@ void MainWindow::on_actionDonate_triggered()
QDesktopServices::openUrl(QUrl("https://gitee.com/GXDE-OS#%E8%AF%B7%E4%BD%9C%E8%80%85%E5%96%9D%E6%9D%AF%E8%8C%B6")); QDesktopServices::openUrl(QUrl("https://gitee.com/GXDE-OS#%E8%AF%B7%E4%BD%9C%E8%80%85%E5%96%9D%E6%9D%AF%E8%8C%B6"));
} }
void MainWindow::on_m_kernelShow_doubleClicked(const QModelIndex &index)
{
// 显示具体信息
QModelIndex list = index;
int row = list.row();
if(row < 0) {
// 未选中任何内容
QMessageBox::critical(this, tr("Error"), tr("Nothing to choose"));
return;
}
// 获取 ID
QModelIndex chooseIndex = ui->m_kernelShow->model()->index(row, 0);
int id = ui->m_kernelShow->model()->data(chooseIndex).toUInt();
// 获取选中行
KernelInformationDialog *dialog = new KernelInformationDialog(kernelInformation->get_kernelData(id));
connect(dialog, &KernelInformationDialog::InstallFinished, this, [this](){
// 刷新列表
this->RefreshKernelListView(this->kernelInformation, ui->m_showLocalArchOnly->isChecked());
});
connect(dialog, &KernelInformationDialog::RemoveFinished, this, [this](){
// 刷新列表
this->RefreshKernelListView(this->kernelInformation, ui->m_showLocalArchOnly->isChecked());
});
dialog->show();
}

@ -45,6 +45,10 @@ private slots:
void on_actionDonate_triggered(); void on_actionDonate_triggered();
void on_m_kernelShow_doubleClicked(const QModelIndex &index);
void on_actionSourceforge_triggered();
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;
KernelInformation *kernelInformation; KernelInformation *kernelInformation;

@ -15,7 +15,7 @@
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="Resource.qrc"> <iconset resource="Resource.qrc">
<normaloff>:/icon/icon.svg</normaloff>:/icon/icon.svg</iconset> <normaloff>:/icon/gxde-kernel-manager.svg</normaloff>:/icon/gxde-kernel-manager.svg</iconset>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
@ -126,6 +126,7 @@
</property> </property>
<addaction name="actionGitee"/> <addaction name="actionGitee"/>
<addaction name="actionGithub"/> <addaction name="actionGithub"/>
<addaction name="actionSourceforge"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionDonate"/> <addaction name="actionDonate"/>
<addaction name="separator"/> <addaction name="separator"/>
@ -140,8 +141,15 @@
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionUpgrade"/> <addaction name="actionUpgrade"/>
</widget> </widget>
<widget class="QMenu" name="menuGrub">
<property name="title">
<string>Grub</string>
</property>
<addaction name="actionUpdate_Grub"/>
</widget>
<addaction name="menuProgram"/> <addaction name="menuProgram"/>
<addaction name="menuApt"/> <addaction name="menuApt"/>
<addaction name="menuGrub"/>
<addaction name="menuHelp"/> <addaction name="menuHelp"/>
</widget> </widget>
<widget class="QStatusBar" name="statusbar"/> <widget class="QStatusBar" name="statusbar"/>
@ -185,6 +193,16 @@
<string>Donate</string> <string>Donate</string>
</property> </property>
</action> </action>
<action name="actionSourceforge">
<property name="text">
<string>Sourceforge</string>
</property>
</action>
<action name="actionUpdate_Grub">
<property name="text">
<string>Update Grub</string>
</property>
</action>
</widget> </widget>
<resources> <resources>
<include location="Resource.qrc"/> <include location="Resource.qrc"/>

@ -2,11 +2,10 @@
set -e set -e
rm /tmp/gxde-kernel-manager-installer-status -f rm /tmp/gxde-kernel-manager-installer-status -f
aptPath="apt" aptPath="apt"
which aptss > /dev/null if [[ -f "/usr/bin/aptss" ]]; then
if [[ $? == 0 ]]; then
# 如果 aptss 存在,则使用 aptss # 如果 aptss 存在,则使用 aptss
aptPath="aptss" aptPath="aptss"
fi fi
$aptPath update $aptPath update
$aptPath install ${KernelList} -y $aptPath install ${KernelList} -y
rm -f "${kernelInstallerShellTempPath}" rm -f "${kernelInstallerShellTempPath}"

@ -2,8 +2,7 @@
set -e set -e
rm /tmp/gxde-kernel-manager-installer-status -f rm /tmp/gxde-kernel-manager-installer-status -f
aptPath="apt" aptPath="apt"
which aptss > /dev/null if [[ -f "/usr/bin/aptss" ]]; then
if [[ $? == 0 ]]; then
# 如果 aptss 存在,则使用 aptss # 如果 aptss 存在,则使用 aptss
aptPath="aptss" aptPath="aptss"
fi fi

@ -2,8 +2,7 @@
set -e set -e
rm /tmp/gxde-kernel-manager-installer-status -f rm /tmp/gxde-kernel-manager-installer-status -f
aptPath="apt" aptPath="apt"
which aptss > /dev/null if [[ -f "/usr/bin/aptss" ]]; then
if [[ $? == 0 ]]; then
# 如果 aptss 存在,则使用 aptss # 如果 aptss 存在,则使用 aptss
aptPath="aptss" aptPath="aptss"
fi fi

@ -10,8 +10,8 @@
</message> </message>
<message> <message>
<location filename="../aboutwindow.ui" line="25"/> <location filename="../aboutwindow.ui" line="25"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&apos;https://gxde.gfdgdxi.top&apos;&gt;&lt;img width=128 src=&quot;:/icon/icon.svg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&apos;https://www.gxde.org&apos;&gt;&lt;img width=128 src=&quot;:/icon/gxde-kernel-manager.svg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../aboutwindow.ui" line="62"/> <location filename="../aboutwindow.ui" line="62"/>
@ -44,6 +44,69 @@
<translation></translation> <translation></translation>
</message> </message>
</context> </context>
<context>
<name>KernelInformationDialog</name>
<message>
<location filename="../kernelinformationdialog.ui" line="14"/>
<source>Information</source>
<translation></translation>
</message>
<message>
<location filename="../kernelinformationdialog.ui" line="28"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/icon/tux.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation></translation>
</message>
<message>
<location filename="../kernelinformationdialog.ui" line="40"/>
<location filename="../kernelinformationdialog.cpp" line="14"/>
<source>Kernel Name:</source>
<translation></translation>
</message>
<message>
<location filename="../kernelinformationdialog.ui" line="50"/>
<location filename="../kernelinformationdialog.cpp" line="15"/>
<source>Kernel Version:</source>
<translation></translation>
</message>
<message>
<location filename="../kernelinformationdialog.ui" line="60"/>
<location filename="../kernelinformationdialog.cpp" line="16"/>
<source>Author:</source>
<translation></translation>
</message>
<message>
<location filename="../kernelinformationdialog.ui" line="70"/>
<location filename="../kernelinformationdialog.cpp" line="24"/>
<source>Kernel Architecture:</source>
<translation></translation>
</message>
<message>
<location filename="../kernelinformationdialog.ui" line="94"/>
<location filename="../kernelinformationdialog.cpp" line="23"/>
<source>Package Name:</source>
<translation></translation>
</message>
<message>
<location filename="../kernelinformationdialog.ui" line="104"/>
<source>Description:</source>
<translation></translation>
</message>
<message>
<location filename="../kernelinformationdialog.ui" line="129"/>
<source>Reconfigure</source>
<translation></translation>
</message>
<message>
<location filename="../kernelinformationdialog.ui" line="136"/>
<source>Install</source>
<translation></translation>
</message>
<message>
<location filename="../kernelinformationdialog.ui" line="143"/>
<source>Remove</source>
<translation></translation>
</message>
</context>
<context> <context>
<name>KernelInstaller</name> <name>KernelInstaller</name>
<message> <message>
@ -148,126 +211,143 @@
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="137"/> <location filename="../mainwindow.ui" line="138"/>
<source>Apt</source> <source>Apt</source>
<translation>Apt</translation> <translation>Apt</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="150"/> <location filename="../mainwindow.ui" line="146"/>
<source>Grub</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="158"/>
<source>Exit</source> <source>Exit</source>
<translation>退</translation> <translation>退</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="155"/> <location filename="../mainwindow.ui" line="163"/>
<source>About</source> <source>About</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="160"/> <location filename="../mainwindow.ui" line="168"/>
<source>Gitee</source> <source>Gitee</source>
<translation>Gitee</translation> <translation>Gitee</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="165"/> <location filename="../mainwindow.ui" line="173"/>
<source>Github</source> <source>Github</source>
<translation>Github</translation> <translation>Github</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="170"/> <location filename="../mainwindow.ui" line="178"/>
<source>Update apt cache</source> <source>Update apt cache</source>
<translation> apt </translation> <translation> apt </translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="175"/> <location filename="../mainwindow.ui" line="183"/>
<source>About QT</source> <source>About QT</source>
<translation> QT</translation> <translation> QT</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="180"/> <location filename="../mainwindow.ui" line="188"/>
<source>Upgrade</source> <source>Upgrade</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="185"/> <location filename="../mainwindow.ui" line="193"/>
<source>Donate</source> <source>Donate</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="23"/> <location filename="../mainwindow.ui" line="198"/>
<source>Sourceforge</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="203"/>
<source>Update Grub</source>
<translation> Grub</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="25"/>
<source>Kernel: </source> <source>Kernel: </source>
<translation> </translation> <translation> </translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="23"/> <location filename="../mainwindow.cpp" line="25"/>
<source>Arch: </source> <source>Arch: </source>
<translation> </translation> <translation> </translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="35"/> <location filename="../mainwindow.cpp" line="37"/>
<source>ID</source> <source>ID</source>
<translation>ID</translation> <translation>ID</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="35"/> <location filename="../mainwindow.cpp" line="37"/>
<source>Kernel Name</source> <source>Kernel Name</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="35"/> <location filename="../mainwindow.cpp" line="37"/>
<source>Author</source> <source>Author</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="35"/> <location filename="../mainwindow.cpp" line="37"/>
<source>Arch</source> <source>Arch</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="35"/> <location filename="../mainwindow.cpp" line="37"/>
<source>Installed</source> <source>Installed</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="35"/> <location filename="../mainwindow.cpp" line="37"/>
<source>Description</source> <source>Description</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="35"/> <location filename="../mainwindow.cpp" line="37"/>
<source>Version</source> <source>Version</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="91"/> <location filename="../mainwindow.cpp" line="93"/>
<location filename="../mainwindow.cpp" line="138"/> <location filename="../mainwindow.cpp" line="147"/>
<location filename="../mainwindow.cpp" line="173"/> <location filename="../mainwindow.cpp" line="182"/>
<location filename="../mainwindow.cpp" line="230"/>
<source>Error</source> <source>Error</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="91"/> <location filename="../mainwindow.cpp" line="93"/>
<location filename="../mainwindow.cpp" line="138"/> <location filename="../mainwindow.cpp" line="147"/>
<location filename="../mainwindow.cpp" line="173"/> <location filename="../mainwindow.cpp" line="182"/>
<location filename="../mainwindow.cpp" line="230"/>
<source>Nothing to choose</source> <source>Nothing to choose</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="147"/> <location filename="../mainwindow.cpp" line="156"/>
<source>Warning</source> <source>Warning</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="148"/> <location filename="../mainwindow.cpp" line="157"/>
<source>Are you sure you want to remove all installed kernel versions? Please note that this may render your system unstable or unbootable.</source> <source>Are you sure you want to remove all installed kernel versions? Please note that this may render your system unstable or unbootable.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="149"/> <location filename="../mainwindow.cpp" line="158"/>
<source>Confirm</source> <source>Confirm</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="150"/> <location filename="../mainwindow.cpp" line="159"/>
<source>Cancel</source> <source>Cancel</source>
<translation></translation> <translation></translation>
</message> </message>