Compare commits

..

41 Commits

Author SHA1 Message Date
3c37842468 修复翻译缺失的问题
Signed-off-by: gfdgd_xi <3025613752@qq.com>
2025-08-29 18:11:46 +08:00
86a34ba98d 修复翻译文件缺失的问题
Signed-off-by: gfdgd_xi <3025613752@qq.com>
2025-08-29 13:06:58 +08:00
459c68bad2 添加编译依赖 cmake
Signed-off-by: gfdgd_xi <3025613752@qq.com>
2025-08-29 12:48:50 +08:00
32f983e2cc 使用 qt6 进行构建
Signed-off-by: gfdgd_xi <3025613752@qq.com>
2025-08-29 12:38:44 +08:00
e0b30c6af7 新增qt6适配 2025-05-24 19:47:59 +08:00
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
bd275486a6 修复debian10编译问题 2024-05-12 16:48:17 +08:00
9cd85d98cf 尝试修复debian10编译问题 2024-05-12 16:43:10 +08:00
4c320183d1 添加依赖 2024-05-12 16:30:58 +08:00
5080fed7a9 调整debian/change 2024-05-12 16:30:27 +08:00
b92e5c6c32 更新README 2024-05-12 16:22:14 +08:00
30f6169dd0 1.1.0 2024-05-12 16:18:05 +08:00
89d14e7e96 支持显示版本号 2024-05-12 15:39:01 +08:00
a569f6b63c 跟进翻译 2024-05-12 12:24:07 +08:00
c4ebe15b79 支持显示本体 2024-05-12 10:53:52 +08:00
6661048433 界面调整 2024-05-12 09:45:52 +08:00
20130363fb 表格支持自动调整行宽 2024-05-12 09:09:02 +08:00
90c04767ad 支持重新配置内核 2024-05-11 21:20:48 +08:00
3c88cc03f8 实现从apt源读取数据并分类功能的功能 2024-05-11 19:46:01 +08:00
bd51419f52 分类? 2024-05-11 18:38:03 +08:00
a3c5b9fc87 支持显示本地apt源内容(但速度过慢) 2024-05-09 22:59:48 +08:00
1bd4bad1cd 完善一点从apt源文件获取数据的库(暂不可用) 2024-05-08 23:03:27 +08:00
3c1b2ae424 初步支持从apt源获取数据(暂不可用) 2024-05-08 22:30:41 +08:00
fed4a8edef 新增.h文件 2024-05-06 22:56:17 +08:00
cbb7510d99 支持从apt源获取包名 2024-05-06 22:49:59 +08:00
aee6385e10 修复无法安装列表第一个内核的问题 2024-05-05 14:09:47 +08:00
27bd1114cd 支持筛选当前架构的内核包 2024-05-03 22:25:31 +08:00
47 changed files with 1645 additions and 358 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

4
.gitignore vendored

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

@ -1,2 +1,3 @@
deb [trusted=true] https://master.dl.sourceforge.net/project/gxde-kernel-manager/kernel/ ./ deb [trusted=true] https://master.dl.sourceforge.net/project/gxde-kernel-manager/kernel/ ./
deb [trusted=true] https://kernel.gxde.gfdgdxi.top/ ./ # CN Mirror
#deb [trusted=true] http://gfdgdxi.v5.idcfengye.com/gxde-linux-kernel/ ./

91
CMakeLists.txt Normal file

@ -0,0 +1,91 @@
cmake_minimum_required(VERSION 3.16)
project(gxde-kernel-manager VERSION 1.0 LANGUAGES C CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Set up AUTOMOC and some sensible defaults for runtime execution
# When using Qt 6.3, you can replace the code block below with
# qt_standard_project_setup()
set(CMAKE_AUTOMOC ON)
include(GNUInstallDirs)
set(CMAKE_AUTOUIC ON)
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Gui Network)
find_package(Qt${QT_VERSION_MAJOR} OPTIONAL_COMPONENTS Widgets)
qt_add_executable(gxde-kernel-manager WIN32 MACOSX_BUNDLE
aboutwindow.cpp aboutwindow.h aboutwindow.ui
aptpkginfo.cpp aptpkginfo.h
kernelinformation.cpp kernelinformation.h
kernelinformationdialog.cpp kernelinformationdialog.h kernelinformationdialog.ui
kernelinstaller.cpp kernelinstaller.h kernelinstaller.ui
main.cpp
mainwindow.cpp mainwindow.h mainwindow.ui
programinfo.cpp programinfo.h
)
target_link_libraries(gxde-kernel-manager PRIVATE
Qt::Core
Qt::Gui
Qt::Network
)
# generate qm
execute_process(COMMAND bash "translate_generation.sh"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
# Resources:
set(Resource_resource_files
"Donate/Alipay.jpg"
"Donate/QQ.png"
"Donate/Wechat.png"
"Donate/advertisement0.jpg"
"data/new/en_US.html"
"data/new/zh_CN.html"
"data/version"
"icon/dialog-apply.svg"
"icon/dialog-cancel.svg"
"icon/dialog-error.svg"
"icon/dialog-information.svg"
"icon/dialog-ok.svg"
"icon/dialog-question.svg"
"icon/dialog-warning.svg"
"icon/gxde-kernel-manager.svg"
"icon/icon1.png"
"icon/tux.png"
"shell/kernel-installer-reconfigure-template.sh"
"shell/kernel-installer-remove-template.sh"
"shell/kernel-installer-root-loader-template.sh"
"shell/kernel-installer-template.sh"
"shell/kernel-installer-update-template.sh"
"shell/kernel-installer-upgrade-template.sh"
"translations/gxde-kernel-manager_zh_CN.qm"
)
qt_add_resources(gxde-kernel-manager "Resource"
PREFIX
"/"
FILES
${Resource_resource_files}
)
if((QT_VERSION_MAJOR GREATER 4))
target_link_libraries(gxde-kernel-manager PRIVATE
Qt::Widgets
)
endif()
if(UNIX AND NOT MACOS)
target_link_libraries(gxde-kernel-manager PRIVATE
qtermwidget6
)
endif()
install(TARGETS gxde-kernel-manager
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
# Consider using qt_generate_deploy_app_script() for app deployment if
# the project can use Qt 6.3. In that case rerun qmake2cmake with
# --min-qt-version=6.3.

BIN
Donate/Alipay.jpg Normal file

Binary file not shown.

After

(image error) Size: 270 KiB

BIN
Donate/QQ.png Normal file

Binary file not shown.

After

(image error) Size: 66 KiB

BIN
Donate/Wechat.png Normal file

Binary file not shown.

After

(image error) Size: 76 KiB

BIN
Donate/advertisement0.jpg Normal file

Binary file not shown.

After

(image error) Size: 338 KiB

@ -1,25 +1,67 @@
<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.0.1</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
![截图_deepin-terminal_20240502212456.png](https://storage.deepin.org/thread/20240502134212362_截图_deepin-terminal_20240502212456.png) GXDE Kernel Manager is a kernel manager allows users to install or remove kernels easily.
![截图_gxde-kernel-manager_20240502212431.png](https://storage.deepin.org/thread/202405021342123825_截图_gxde-kernel-manager_20240502212431.png) Support architectures: amd64, arm64, mips64, loong64
![截图_gxde-kernel-manager_20240502212321.png](https://storage.deepin.org/thread/202405021342122641_截图_gxde-kernel-manager_20240502212321.png) **Warning: You may damage your system unless you know what you will do!**
![截图_gxde-kernel-manager_20240502211723.png](https://storage.deepin.org/thread/202405021342116834_截图_gxde-kernel-manager_20240502211723.png)
![image.png](https://storage.deepin.org/thread/202405120819335429_image.png)
![image.png](https://storage.deepin.org/thread/202405120820175356_image.png)
## GXDE 系统如何安装 GXDE 内核管理器?
只适用于 GXDEdeepin/UOS 等需要下载 deb 手动安装
```bash
sudo apt update
sudo apt install gxde-kernel-manager
```
## 更新内容 ## 更新内容
### 1.0.12024年05月03日 ### 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、支持从 apt 源读取内核数据并显示安装**
**※2、支持只显示与当前系统相同架构的内核**
**※3、下载/更新内核时支持调用 aptss 提升下载速度**
**※4、新增卸载所有内核时的窗口警告**
5、优化表格显示效果
6、支持显示内核描述和版本
**※1. Support getting kernel data from apt database.**
**※2. Support showing only kernels that are the same as the local system architecture.**
**※3. Support using aptss to download packages faster.**
**※4. Show a warning message box when removing all kernels.**
5. Optimize the effect of the kernels table.
6. Support showing kernel descriptions and versions.
![image.png](https://storage.deepin.org/thread/202405120819335429_image.png)
![image.png](https://storage.deepin.org/thread/202405120820175356_image.png)
### 1.0.12024.05.03
**1、修复部分系统无法打开管理器的问题** **1、修复部分系统无法打开管理器的问题**
**2、新增 Sourceforge 源以准备支持大内核文件** **2、新增 Sourceforge 源以准备支持大内核文件**
### 1.0.02024年05月02日 ### 1.0.02024.05.02
![截图_deepin-terminal_20240502212456.png](https://storage.deepin.org/thread/20240502134212362_截图_deepin-terminal_20240502212456.png) ![截图_deepin-terminal_20240502212456.png](https://storage.deepin.org/thread/20240502134212362_截图_deepin-terminal_20240502212456.png)
![截图_gxde-kernel-manager_20240502212431.png](https://storage.deepin.org/thread/202405021342123825_截图_gxde-kernel-manager_20240502212431.png) ![截图_gxde-kernel-manager_20240502212431.png](https://storage.deepin.org/thread/202405021342123825_截图_gxde-kernel-manager_20240502212431.png)
@ -47,5 +89,14 @@ sudo apt build-dep .
sudo apt install fakeroot sudo apt install fakeroot
dpkg-buildpackage -b -us dpkg-buildpackage -b -us
``` ```
## 请作者喝杯茶
如果您觉得 GXDE 内核管理器对你有帮助,可以请作者喝杯茶
<img src="Donate/Wechat.png" width="250" />
<img src="Donate/Alipay.jpg" width="250" />
<img src="Donate/QQ.png" width="250" >
# ©2023Now gfdgd xi ### 广告
支付宝官方活动,扫描获得支付红包!
<p><img src="Donate/advertisement0.jpg" width="250" ></p>
# ©2023Now gfdgd xi

@ -9,8 +9,20 @@
<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-update-template.sh</file>
<file>data/new/en_US.html</file>
<file>data/new/zh_CN.html</file>
<file>data/version</file>
<file>shell/kernel-installer-upgrade-template.sh</file>
<file>icon/icon1.png</file>
<file>Donate/advertisement0.jpg</file>
<file>Donate/Alipay.jpg</file>
<file>Donate/QQ.png</file>
<file>Donate/Wechat.png</file>
<file>icon/tux.png</file>
</qresource> </qresource>
</RCC> </RCC>

@ -1,22 +1,32 @@
#include "aboutwindow.h" #include "aboutwindow.h"
#include "ui_aboutwindow.h" #include "ui_aboutwindow.h"
#include "programinfo.h"
#include <QDateTime> #include <QDateTime>
#include <QProcessEnvironment>
#include <QFile>
AboutWindow::AboutWindow(QWidget *parent) : AboutWindow::AboutWindow(QWidget *parent) :
QMainWindow(parent), QMainWindow(parent),
ui(new Ui::AboutWindow) ui(new Ui::AboutWindow)
{ {
ui->setupUi(this); ui->setupUi(this);
QString info = ""; QString info = "";
info += "<pre>"; info += "<pre>";
info += tr("A kernel manager allows users to install or remove kernels easily.") + "\n\n"; info += tr("A kernel manager allows users to install or remove kernels easily.") + "\n\n";
info += "<b>" + tr("Warning: You may damage your system unless you know what you will do!") + "</b>\n"; info += "<b>" + tr("Warning: You may damage your system unless you know what you will do!") + "</b>\n";
info += tr("Built Time: ") + QString(__DATE__) + " " + __TIME__ + "\n";
info += tr("QQ Group: 881201853") + "\n";
info += "</pre>"; info += "</pre>";
info += "<hr/>"; /*info += "<hr/>";
info += ProgramInfo::updateInfo();
info += "<hr/>";*/
info += "<h3>" + tr("Website") + "</h3>"; info += "<h3>" + tr("Website") + "</h3>";
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>GXDE Homepage: <a href='https://www.gxde.top'>https://www.gxde.top</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);
@ -32,3 +42,9 @@ void AboutWindow::on_m_closeButton_clicked()
this->close(); this->close();
} }
void AboutWindow::on_m_logoShower_linkActivated(const QString &link)
{
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>");
}

@ -18,6 +18,8 @@ public:
private slots: private slots:
void on_m_closeButton_clicked(); void on_m_closeButton_clicked();
void on_m_logoShower_linkActivated(const QString &link);
private: private:
Ui::AboutWindow *ui; Ui::AboutWindow *ui;
}; };

@ -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;img width=128 src=&quot;:/icon/icon.svg&quot;/&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>

225
aptpkginfo.cpp Normal file

@ -0,0 +1,225 @@
#include "aptpkginfo.h"
#include <QFile>
#include <QDir>
#include <QDebug>
#include <QJsonObject>
AptPkgInfo::AptPkgInfo(QString pkgName, PkgSearchOption option)
{
this->pkgSearchOption = option;
SetPkgName(pkgName);
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()
{
this->aptData = QJsonObject();
QDir dir("/var/lib/apt/lists/");
QStringList list = dir.entryList();
for(QString i: list) {
// 除去 . 和 ..
if(i == "." || i == "..") {
continue;
}
if(i.mid(i.indexOf("_Packages")) != "_Packages") {
continue;
}
QFile file(dir.path() + "/" + i);
file.open(QFile::ReadOnly);
// 分析
QJsonObject pkgData;
pkgDataStatus status = pkgDataStatus::None;
QString strTemp; // 因为直接 replace 会改变原来的值
while(!file.atEnd()) {
QByteArray line = file.readLine();
strTemp = line;
if(strTemp.replace(" ", "").replace("\n", "") == "") {
// 空行
if(status == pkgDataStatus::IsContain) {
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;
pkgData = QJsonObject(); // 清空
continue;
}
// 如果已经被检测为非要寻找的包名,则
if(status == pkgDataStatus::UnContain) {
continue; // 忽略该行
}
// 分析行
if(line.contains("Package: ")) {
// 如果为包名行,则进行分析
// 是否含有要求关键字
strTemp = line;
QString pkgName = strTemp.replace("Package: ", "").replace(" ", "").replace("\n", "");
switch(this->pkgSearchOption) {
case PkgSearchOption::Equal:
if(pkgName == this->pkgName) {
status = pkgDataStatus::IsContain;
}
else {
status = pkgDataStatus::UnContain;
}
break;
case PkgSearchOption::Include:
if(pkgName.contains(this->pkgName)) {
status = pkgDataStatus::IsContain;
}
else {
status = pkgDataStatus::UnContain;
}
break;
case PkgSearchOption::HeadInclude:
if(pkgName.mid(0, this->pkgName.length()) == this->pkgName) {
status = pkgDataStatus::IsContain;
}
else {
status = pkgDataStatus::UnContain;
}
break;
}
// 解析为 QJsonObject
pkgData.insert("Package", pkgName);
continue;
}
// 处理
int index = line.indexOf(":");
strTemp = line;
strTemp.replace("\n", "");
pkgData.insert(QString(strTemp.mid(0, index)), QString(strTemp.mid(index + 2)));
}
file.close();
}
}
void AptPkgInfo::SetPkgName(QString pkgName)
{
this->pkgName = pkgName;
//pkgInfo = GetPkgInfo(pkgName);
}
QString AptPkgInfo::GetPkgInfo(QString pkgName) const
{
if(pkgName == "") {
pkgName = this->pkgName;
}
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("LANG", "en");
return this->GetCommandResult("apt", QStringList() << "list" << pkgName, env);
}
QString AptPkgInfo::get_package(QString pkgName) const
{
return this->aptData.value(pkgName).toObject().value("Package").toString();
}
QString AptPkgInfo::get_version(QString pkgName) const
{
return this->aptData.value(pkgName).toObject().value("Version").toString();
}
QString AptPkgInfo::get_maintainer(QString pkgName) const
{
return this->aptData.value(pkgName).toObject().value("Maintainer").toString();
}
QString AptPkgInfo::get_description(QString pkgName) const
{
return this->aptData.value(pkgName).toObject().value("Description").toString();
}
QString AptPkgInfo::get_architecture(QString pkgName) const
{
return this->aptData.value(pkgName).toObject().value("Architecture").toString();
}
QStringList AptPkgInfo::GetAptPackageList() const
{
return this->aptData.keys();
}
QByteArray AptPkgInfo::GetCommandResult(QString command, QStringList argv, QProcessEnvironment env) const
{
QProcess process;
process.setProcessEnvironment(env);
process.start(command, argv);
process.waitForStarted();
process.waitForFinished();
QByteArray result = process.readAllStandardOutput();
process.close();
return result;
}
QJsonObject AptPkgInfo::get_data() const
{
return aptData;
}

67
aptpkginfo.h Normal file

@ -0,0 +1,67 @@
#ifndef APTPKGINFO_H
#define APTPKGINFO_H
#include <QObject>
#include <QProcess>
#include <QJsonObject>
class AptPkgInfo
{
public:
enum PkgSearchOption {
Include = 0,
Equal = 1,
HeadInclude = 2
};
explicit AptPkgInfo(QString pkgName, PkgSearchOption option = PkgSearchOption::Equal);
void SetPkgName(QString pkgName);
QStringList GetAptPackageList() const;
QByteArray GetCommandResult(QString command, QStringList argv, QProcessEnvironment env = QProcessEnvironment::systemEnvironment()) const;
QString GetPkgInfo(QString pkgName=NULL) const;
QString get_package(QString pkgName) const;
QString get_version(QString pkgName) const;
QString get_maintainer(QString pkgName) const;
QString get_description(QString pkgName) const;
QString get_architecture(QString pkgName) const;
QJsonObject get_data() const;
bool CompareVersion(QString version1, QString version2) const;
private:
QString pkgName;
QString pkgInfo;
QJsonObject aptData;
PkgSearchOption pkgSearchOption = PkgSearchOption::Equal;
QStringList symbolList = {"-", "~", "+"};
enum SplitVersionStatus {
Checking,
MeetedEnglishLetter,
MeetSymbol,
Other
};
QStringList SplitVersion(QString version) const;
enum pkgDataStatus {
EmptyLine = 0,
EmptyLineAgain = 1,
Reading = 2,
Readed = 3,
None = 4,
UnContain = 5,
IsContain = 6,
IsContainOldVersion = 7,
IsContainNewVersion = 8,
IsContainSameVersion = 9
};
void ReadAptData();
};
#endif // APTPKGINFO_H

6
data/new/en_US.html Normal file

@ -0,0 +1,6 @@
<h1>What's new?</h1>
<pre>
<b>※1. Add an information window about the Kernel
※2. Fix the issue with the installed Kernel causing exit code 1
</b>
</pre>

6
data/new/zh_CN.html Normal file

@ -0,0 +1,6 @@
<h1>1.1.0 更新内容</h1>
<pre>
<b>※1、新增内核详细信息窗口
※2、修复在部分机器上安装内核直接提示错误 1 的问题
</b>
</pre>

1
data/version Normal file

@ -0,0 +1 @@
1.3.0

8
debian/changelog vendored

@ -1,6 +1,6 @@
gxde-kernel-manager (1.0.1) UNRELEASED; urgency=medium gxde-kernel-manager (1.3.1) UNRELEASED; urgency=medium
* Initial release. (Closes: #nnnn) <nnnn is the bug number of your ITP> * 使用 qt6 进行构建
* * 修复翻译缺失的问题
-- gfdgd_xi <3025613752@qq.com> Fri, 03 May 2024 18:57:33 +0800 -- gfdgd_xi <3025613752@qq.com> Fri, 29 Aug 2025 18:11:26 +0800

19
debian/control vendored

@ -5,20 +5,23 @@ Maintainer: gfdgd_xi <3025613752@qq.com>
Rules-Requires-Root: no Rules-Requires-Root: no
Build-Depends: Build-Depends:
debhelper-compat (= 10), debhelper-compat (= 10),
qtbase5-dev, qt6-base-dev,
qtbase5-dev-tools, qt6-base-dev-tools,
qtbase5-private-dev, qt6-base-private-dev,
libqtermwidget5-1-dev | libqtermwidget5-0-dev, qt6-tools-dev-tools,
qttools5-dev-tools qt6-5compat-dev,
cmake,
libqtermwidget-dev | libqtermwidget5-1-dev | libqtermwidget5-0-dev,
Standards-Version: 4.6.2 Standards-Version: 4.6.2
Homepage: https://gitee.com/GXDE-OS/gxde-kernel-manager Homepage: https://gitee.com/GXDE-OS/gxde-kernel-manager
#Vcs-Browser: https://salsa.debian.org/debian/gxde-kernel-manager Vcs-Git: https://gitee.com/GXDE-OS/gxde-kernel-manager.git
#Vcs-Git: https://salsa.debian.org/debian/gxde-kernel-manager.git
Package: gxde-kernel-manager Package: gxde-kernel-manager
Architecture: any Architecture: any
Depends: Depends:
${shlibs:Depends}, ${shlibs:Depends},
${misc:Depends}, ${misc:Depends},
Description: GXDE 内核管理器 apt
Description: GXDE 内核管理器是一个帮助用户更方便获取、安装、移除内核的工具。
GXDE Kernel Manager is a kernel manager allows users to install or remove kernels easily.

2
debian/postinst vendored Normal file

@ -0,0 +1,2 @@
#!/bin/bash
#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

@ -1,68 +0,0 @@
QT += core gui network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++17
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
aboutwindow.cpp \
kernelinformation.cpp \
kernelinstaller.cpp \
main.cpp \
mainwindow.cpp
HEADERS += \
aboutwindow.h \
kernelinformation.h \
kernelinstaller.h \
mainwindow.h
FORMS += \
aboutwindow.ui \
kernelinstaller.ui \
mainwindow.ui
# 更新翻译
system(lrelease translation/gxde-kernel-manager_zh_CN.ts translation/gxde-kernel-manager_zh_CN.qm)
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
unix:!macx: LIBS += -lqtermwidget5
aptsource.path = /etc/apt/sources.list.d/
aptsource.files = $$PWD/AptSources/gxde-kernel-manager.list
aptsourcegpg.path = /etc/apt/trusted.gpg.d/
aptsourcegpg.files = $$PWD/AptSources/gxde-kernel-manager.gpg
debiandesktop.path = /usr/share/applications/
debiandesktop.files = $$PWD/gxde-kernel-manager.desktop
uosdesktop.path = /opt/apps/gxde-kernel-manager/entries/applications
uosdesktop.files = $$PWD/gxde-kernel-manager.desktop
icon.path = /opt/apps/gxde-kernel-manager/
icon.files = $$PWD/icon/icon.svg
targetrunner.path = /opt/apps/gxde-kernel-manager/
targetrunner.files = $$PWD/gxde-kernel-manager-runner.sh
#libinclude.path = /opt/apps/gxde-kernel-manager/
#libinclude.files = $$PWD/lib
target.path = /opt/apps/gxde-kernel-manager/
INSTALLS += aptsourcegpg aptsource target debiandesktop uosdesktop icon targetrunner
TRANSLATIONS += translation/gxde-kernel-manager_zh_CN.ts
RESOURCES += \
Resource.qrc

Before

(image error) Size: 32 KiB

After

(image error) Size: 32 KiB

BIN
icon/icon1.png Normal file

Binary file not shown.

After

(image error) Size: 257 KiB

BIN
icon/tux.png Normal file

Binary file not shown.

After

(image error) Size: 7.5 KiB

@ -1,4 +1,7 @@
#include "kernelinformation.h" #include "kernelinformation.h"
#include "aptpkginfo.h"
#include <QProcess>
KernelInformation::KernelInformation() KernelInformation::KernelInformation()
{ {
@ -7,22 +10,84 @@ KernelInformation::KernelInformation()
void KernelInformation::LoadInfo() void KernelInformation::LoadInfo()
{ {
QUrl url(this->url); // 添加 GXDE Kernel Manager
QUrlQuery query; QJsonArray array;
query.addQueryItem("format", "j1"); AptPkgInfo kernelManagerinfo = AptPkgInfo("gxde-kernel-manager", AptPkgInfo::PkgSearchOption::Equal);
url.setQuery(query.toString(QUrl::FullyEncoded)); QStringList list = kernelManagerinfo.GetAptPackageList();
qDebug() << url; qDebug() << kernelManagerinfo.get_data();
QNetworkRequest request(url); for(QString i: list) {
QNetworkAccessManager *m_http = new QNetworkAccessManager(this); QJsonObject object;
QNetworkReply *reply = m_http->get(request); kernelManagerinfo.SetPkgName(i);
connect(reply, &QNetworkReply::finished, this, [this, m_http](){ object.insert("Name", i);
QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender()); object.insert("Author", kernelManagerinfo.get_maintainer(i));
QByteArray data = reply->readAll(); object.insert("Des", kernelManagerinfo.get_description(i));
qDebug() << data; object.insert("Ver", kernelManagerinfo.get_version(i));
qDebug() << reply->error(); object.insert("Arch", QJsonArray::fromStringList(QStringList() << arch()));
this->listData = QJsonDocument::fromJson(data).array(); object.insert("PkgName", QJsonArray::fromStringList(QStringList() << i));
emit loadFinished(reply); array.append(object);
}); }
AptPkgInfo info = AptPkgInfo("linux-", AptPkgInfo::PkgSearchOption::HeadInclude);
list = info.GetAptPackageList();
indexMap = {};
for(QString i: list) {
QJsonObject object;
bool isContinue = false;
for(QString j: unShowMap) {
if(i.contains(j)) {
isContinue = true;
break;
}
}
// 跳过此次循环
if(isContinue) {
continue;
}
isContinue = true;
for(QString j: showMap) {
if(i.contains(j)) {
isContinue = false;
break;
}
}
// 跳过此次循环
if(isContinue) {
continue;
}
QString strTemp = i;
strTemp.replace("-image", "");
strTemp.replace("-headers", "");
int alreadyIndex = -1;
if(indexMap.contains(strTemp)) {
// 如果已经存在
alreadyIndex = indexMap.value(strTemp);
QJsonArray pkgArray = array.at(alreadyIndex).toObject().value("PkgName").toArray();
QJsonArray archArray = array.at(alreadyIndex).toObject().value("Arch").toArray();
pkgArray.append(i);
QString pkgArch = info.get_architecture(i);
if(!archArray.contains(pkgArch)) {
archArray.append(pkgArch);
}
QJsonObject pkgObject = array.at(alreadyIndex).toObject();
pkgObject["PkgName"] = pkgArray;
pkgObject["Arch"] = archArray;
array.replace(alreadyIndex, pkgObject);
continue;
}
info.SetPkgName(strTemp);
object.insert("Name", strTemp);
object.insert("Author", info.get_maintainer(i));
object.insert("Des", info.get_description(i));
object.insert("Ver", info.get_version(i));
object.insert("Arch", QJsonArray::fromStringList(QStringList() << info.get_architecture(i)));
object.insert("PkgName", QJsonArray::fromStringList(QStringList() << i));
indexMap.insert(strTemp, array.count());
array.append(object);
}
this->listData = array;
emit loadFinished(NULL);
} }
QJsonArray KernelInformation::get_listData() const QJsonArray KernelInformation::get_listData() const

@ -15,6 +15,7 @@
#include <QProcess> #include <QProcess>
#include <QFile> #include <QFile>
#include <QMap>
class KernelInformation : public QObject class KernelInformation : public QObject
{ {
@ -42,9 +43,24 @@ signals:
void loadFinished(QNetworkReply *reply); void loadFinished(QNetworkReply *reply);
private: private:
QString url = "http://info.kernel.gxde.gfdgdxi.top/information.json"; QString url = "http://info.kernel.gxde.gfdgdxi.top/information.json";
QJsonArray listData; QJsonArray listData;
QStringList unShowMap = {
"-dbg"
};
QStringList showMap = {
"linux-headers",
"linux-image",
"linux-kernel"
};
QMap<QString, int> indexMap;
}; };
#endif // KERNELINFORMATION_H #endif // KERNELINFORMATION_H

@ -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>

@ -23,12 +23,21 @@ KernelInstaller::KernelInstaller(Option option, QStringList kernelList, QWidget
} }
switch(runOption) { switch(runOption) {
case Option::Install: case Option::Install:
ui->m_status->setText(tr("Try to install ") + kernel); ui->m_status->setText(tr("Try to install ") + kernel);
break; break;
case Option::Remove: case Option::Remove:
ui->m_status->setText(tr("Try to remove ") + kernel); ui->m_status->setText(tr("Try to remove ") + kernel);
break; break;
case Option::Reconfigure:
ui->m_status->setText(tr("Try to reconfigure ") + kernel);
break;
case Option::Update:
ui->m_status->setText(tr("Try to update apt cache"));
break;
case Option::Upgrade:
ui->m_status->setText(tr("Try to upgrade ") + kernel);
break;
} }
@ -60,7 +69,7 @@ void KernelInstaller::StartInstaller()
terminal->startShellProgram(); terminal->startShellProgram();
processID = terminal->getShellPID(); processID = terminal->getShellPID();
// 使用 QTimer 用于判断内核是否安装完成 // 使用 QTimer 用于判断内核是否安装完成
QTimer *runStatusTimer = new QTimer(); runStatusTimer = new QTimer();
runStatusTimer->setInterval(100); runStatusTimer->setInterval(100);
connect(runStatusTimer, &QTimer::timeout, this, &KernelInstaller::CheckInstallerStatusTimer); connect(runStatusTimer, &QTimer::timeout, this, &KernelInstaller::CheckInstallerStatusTimer);
runStatusTimer->start(); runStatusTimer->start();
@ -75,12 +84,21 @@ QString KernelInstaller::BuildKernelInstallerBash(QStringList kernelList, QStrin
} }
QString filePath = ":/shell/kernel-installer-template.sh"; QString filePath = ":/shell/kernel-installer-template.sh";
switch(runOption) { switch(runOption) {
case Option::Install: case Option::Install:
filePath = ":/shell/kernel-installer-template.sh"; filePath = ":/shell/kernel-installer-template.sh";
break; break;
case Option::Remove: case Option::Remove:
filePath = ":/shell/kernel-installer-remove-template.sh"; filePath = ":/shell/kernel-installer-remove-template.sh";
break; break;
case Option::Reconfigure:
filePath = ":/shell/kernel-installer-reconfigure-template.sh";
break;
case Option::Update:
filePath = ":/shell/kernel-installer-update-template.sh";
break;
case Option::Upgrade:
filePath = ":/shell/kernel-installer-upgrade-template.sh";
break;
} }
QFile file(filePath); QFile file(filePath);
@ -130,6 +148,9 @@ void KernelInstaller::CheckInstallerStatusTimer()
if(status == -1) { if(status == -1) {
return; return;
} }
// 关闭 Timer 防止一直发送错误的信号
runStatusTimer->stop();
emit InstallFinished(status);
// 安装完成 // 安装完成
if(status == 0) { if(status == 0) {
ui->m_status->setText(tr("Done")); ui->m_status->setText(tr("Done"));

@ -3,7 +3,8 @@
#include <QMainWindow> #include <QMainWindow>
#include <qtermwidget5/qtermwidget.h> //#include <qtermwidget5/qtermwidget.h>
#include <qtermwidget6/qtermwidget.h>
namespace Ui { namespace Ui {
class KernelInstaller; class KernelInstaller;
@ -16,7 +17,10 @@ class KernelInstaller : public QMainWindow
public: public:
enum Option { enum Option {
Install, Install,
Remove Remove,
Reconfigure,
Update,
Upgrade
}; };
explicit KernelInstaller(Option option, QStringList kernelList, QWidget *parent = nullptr); explicit KernelInstaller(Option option, QStringList kernelList, QWidget *parent = nullptr);
@ -27,6 +31,7 @@ signals:
void InstallFinished(int status); void InstallFinished(int status);
private: private:
QTimer *runStatusTimer;
Option runOption; Option runOption;
Ui::KernelInstaller *ui; Ui::KernelInstaller *ui;
QTermWidget *terminal; QTermWidget *terminal;

@ -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">

@ -1,5 +1,7 @@
#include "mainwindow.h" #include "mainwindow.h"
#include "programinfo.h"
#include <QApplication> #include <QApplication>
#include <QFile> #include <QFile>
@ -11,10 +13,8 @@ int main(int argc, char *argv[])
{ {
QApplication a(argc, argv); QApplication a(argc, argv);
QTranslator translator; QTranslator translator;
// 检查系统语言以加载翻译 if(ProgramInfo::systemLANG() == ProgramInfo::LANG::zh_CN) {
if(QProcessEnvironment::systemEnvironment().value("LANG").contains("zh")) { translator.load(":/translations/gxde-kernel-manager_zh_CN.qm");
// 中文,加载中文翻译
translator.load(":/translation/gxde-kernel-manager_zh_CN.qm");
} }
a.installTranslator(&translator); a.installTranslator(&translator);
#ifdef __linux__ #ifdef __linux__

@ -1,17 +1,21 @@
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "aboutwindow.h" #include "aboutwindow.h"
#include "programinfo.h"
#include "kernelinformation.h" #include "kernelinformation.h"
#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)
{ {
ui->setupUi(this); ui->setupUi(this);
this->setWindowTitle(this->windowTitle() + " " + ProgramInfo::version());
kernelInformation = new KernelInformation(); kernelInformation = new KernelInformation();
RefreshKernelList(); RefreshKernelList();
} }
@ -20,26 +24,52 @@ void MainWindow::RefreshKernelList()
{ {
ui->m_nowKernel->setText(tr("Kernel: ") + kernelInformation->localKernelName() + " " + tr("Arch: ") + kernelInformation->arch()); ui->m_nowKernel->setText(tr("Kernel: ") + kernelInformation->localKernelName() + " " + tr("Arch: ") + kernelInformation->arch());
connect(kernelInformation, &KernelInformation::loadFinished, this, [this](){ connect(kernelInformation, &KernelInformation::loadFinished, this, [this](){
qDebug() << this->kernelInformation->get_listData(); RefreshKernelListView(kernelInformation, ui->m_showLocalArchOnly->isChecked());
RefreshKernelListView(kernelInformation);
}); });
kernelInformation->LoadInfo(); kernelInformation->LoadInfo();
} }
void MainWindow::RefreshKernelListView(KernelInformation *info) void MainWindow::RefreshKernelListView(KernelInformation *info, bool showLocalArchOnly)
{ {
// 更新列表 // 更新列表
int count = info->get_count(); int count = info->get_count();
QStandardItemModel *model = new QStandardItemModel(); QStandardItemModel *model = new QStandardItemModel();
model->setHorizontalHeaderLabels(QStringList() << tr("ID") << tr("Kernel Name") << tr("Author") << tr("Arch") << tr("Installed")); model->setHorizontalHeaderLabels(QStringList() << tr("ID") << tr("Kernel Name") << tr("Author") << tr("Arch") << tr("Version") << tr("Installed") << tr("Description"));
const QString arch = info->arch();
int line = 0;
kernelNumber = 0;
for(int i = 0; i < count; i++) { for(int i = 0; i < count; i++) {
model->setItem(i, 0, new QStandardItem(QString::number(i))); // 显示所有架构
model->setItem(i, 1, new QStandardItem(info->get_name(i))); QString kernelArch = "";
model->setItem(i, 2, new QStandardItem(info->get_author(i))); bool isLocalArch = false;
model->setItem(i, 3, new QStandardItem(info->get_arch(i).at(0)));
model->setItem(i, 4, new QStandardItem((QStringList() << "" << "Y").at(info->get_installedAlready(i)))); for(QString i: info->get_arch(i)) {
if(i == arch) {
isLocalArch = true;
}
if(i == "all") {
isLocalArch = true;
}
kernelArch += i + " ";
}
if(showLocalArchOnly && !isLocalArch) {
continue;
}
model->setItem(line, 0, new QStandardItem(QString::number(i)));
model->setItem(line, 1, new QStandardItem(info->get_name(i)));
model->setItem(line, 2, new QStandardItem(info->get_author(i)));
model->setItem(line, 3, new QStandardItem(kernelArch));
model->setItem(line, 4, new QStandardItem(info->get_ver(i)));
bool installed = info->get_installedAlready(i);
model->setItem(line, 5, new QStandardItem((QStringList() << "" << "Y").at(installed)));
if (installed) {
kernelNumber++;
}
model->setItem(line, 6, new QStandardItem(info->get_des(i)));
line++;
} }
ui->m_kernelShow->setModel(model); ui->m_kernelShow->setModel(model);
ui->m_kernelShow->resizeColumnsToContents();
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
@ -58,7 +88,7 @@ void MainWindow::on_m_installButton_clicked()
{ {
QModelIndex list = ui->m_kernelShow->selectionModel()->currentIndex(); QModelIndex list = ui->m_kernelShow->selectionModel()->currentIndex();
int row = list.row(); int row = list.row();
if(row <= 0) { if(row < 0) {
// 未选中任何内容 // 未选中任何内容
QMessageBox::critical(this, tr("Error"), tr("Nothing to choose")); QMessageBox::critical(this, tr("Error"), tr("Nothing to choose"));
return; return;
@ -68,6 +98,10 @@ void MainWindow::on_m_installButton_clicked()
int id = ui->m_kernelShow->model()->data(index).toUInt(); int id = ui->m_kernelShow->model()->data(index).toUInt();
// 获取选中行 // 获取选中行
KernelInstaller *installer = new KernelInstaller(KernelInstaller::Option::Install, kernelInformation->get_pkgName(id)); KernelInstaller *installer = new KernelInstaller(KernelInstaller::Option::Install, kernelInformation->get_pkgName(id));
connect(installer, &KernelInstaller::InstallFinished, this, [this](){
// 刷新列表
this->RefreshKernelListView(this->kernelInformation, ui->m_showLocalArchOnly->isChecked());
});
installer->show(); installer->show();
} }
@ -97,11 +131,53 @@ 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();
int row = list.row(); int row = list.row();
if(row <= 0) { if(row < 0) {
// 未选中任何内容
QMessageBox::critical(this, tr("Error"), tr("Nothing to choose"));
return;
}
// 获取 ID
QModelIndex index = ui->m_kernelShow->model()->index(row, 0);
int id = ui->m_kernelShow->model()->data(index).toUInt();
if(kernelNumber <= 1) {
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Warning);
msgBox.setWindowTitle(tr("Warning"));
msgBox.setInformativeText(tr("Are you sure you want to remove all installed kernel versions? Please note that this may render your system unstable or unbootable."));
msgBox.addButton(tr("Confirm"), QMessageBox::AcceptRole);
msgBox.addButton(tr("Cancel"), QMessageBox::RejectRole);
if(msgBox.exec() == QMessageBox::RejectRole) {
return;
}
}
// 获取选中行
KernelInstaller *installer = new KernelInstaller(KernelInstaller::Option::Remove, kernelInformation->get_pkgName(id));
installer->show();
}
void MainWindow::on_m_showLocalArchOnly_stateChanged(int arg1)
{
RefreshKernelListView(this->kernelInformation, ui->m_showLocalArchOnly->isChecked());
}
void MainWindow::on_m_reconfigureButton_clicked()
{
QModelIndex list = ui->m_kernelShow->selectionModel()->currentIndex();
int row = list.row();
if(row < 0) {
// 未选中任何内容 // 未选中任何内容
QMessageBox::critical(this, tr("Error"), tr("Nothing to choose")); QMessageBox::critical(this, tr("Error"), tr("Nothing to choose"));
return; return;
@ -110,7 +186,65 @@ void MainWindow::on_m_removeButton_clicked()
QModelIndex index = ui->m_kernelShow->model()->index(row, 0); QModelIndex index = ui->m_kernelShow->model()->index(row, 0);
int id = ui->m_kernelShow->model()->data(index).toUInt(); int id = ui->m_kernelShow->model()->data(index).toUInt();
// 获取选中行 // 获取选中行
KernelInstaller *installer = new KernelInstaller(KernelInstaller::Option::Remove, kernelInformation->get_pkgName(id)); KernelInstaller *installer = new KernelInstaller(KernelInstaller::Option::Reconfigure, kernelInformation->get_pkgName(id));
installer->show(); installer->show();
} }
void MainWindow::on_actionUpdate_apt_cache_triggered()
{
KernelInstaller *installer = new KernelInstaller(KernelInstaller::Option::Update, QStringList());
connect(installer, &KernelInstaller::InstallFinished, this, [this, installer](){
RefreshKernelList();
});
installer->show();
}
void MainWindow::on_actionAbout_QT_triggered()
{
QMessageBox::aboutQt(this);
}
void MainWindow::on_actionUpgrade_triggered()
{
KernelInstaller *installer = new KernelInstaller(KernelInstaller::Option::Upgrade, QStringList());
installer->show();
}
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"));
}
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();
}

@ -33,10 +33,28 @@ private slots:
void on_m_removeButton_clicked(); void on_m_removeButton_clicked();
void on_m_showLocalArchOnly_stateChanged(int arg1);
void on_m_reconfigureButton_clicked();
void on_actionUpdate_apt_cache_triggered();
void on_actionAbout_QT_triggered();
void on_actionUpgrade_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;
void RefreshKernelList(); void RefreshKernelList();
void RefreshKernelListView(KernelInformation *info); void RefreshKernelListView(KernelInformation *info, bool showLocalArchOnly = true);
int kernelNumber = 0;
}; };
#endif // MAINWINDOW_H #endif // MAINWINDOW_H

@ -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">
@ -27,9 +27,15 @@
<property name="selectionBehavior"> <property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum> <enum>QAbstractItemView::SelectRows</enum>
</property> </property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderVisible"> <attribute name="verticalHeaderVisible">
<bool>false</bool> <bool>false</bool>
</attribute> </attribute>
@ -57,6 +63,16 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QCheckBox" name="m_showLocalArchOnly">
<property name="text">
<string>Show local PC architecture only</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="m_refreshButton"> <widget class="QPushButton" name="m_refreshButton">
<property name="text"> <property name="text">
@ -64,6 +80,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="m_reconfigureButton">
<property name="text">
<string>Reconfigure</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="m_installButton"> <widget class="QPushButton" name="m_installButton">
<property name="text"> <property name="text">
@ -103,10 +126,30 @@
</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="separator"/>
<addaction name="actionAbout_QT"/>
<addaction name="actionAbout"/> <addaction name="actionAbout"/>
</widget> </widget>
<widget class="QMenu" name="menuApt">
<property name="title">
<string>Apt</string>
</property>
<addaction name="actionUpdate_apt_cache"/>
<addaction name="separator"/>
<addaction name="actionUpgrade"/>
</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="menuGrub"/>
<addaction name="menuHelp"/> <addaction name="menuHelp"/>
</widget> </widget>
<widget class="QStatusBar" name="statusbar"/> <widget class="QStatusBar" name="statusbar"/>
@ -130,6 +173,36 @@
<string>Github</string> <string>Github</string>
</property> </property>
</action> </action>
<action name="actionUpdate_apt_cache">
<property name="text">
<string>Update apt cache</string>
</property>
</action>
<action name="actionAbout_QT">
<property name="text">
<string>About QT</string>
</property>
</action>
<action name="actionUpgrade">
<property name="text">
<string>Upgrade</string>
</property>
</action>
<action name="actionDonate">
<property name="text">
<string>Donate</string>
</property>
</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"/>

38
programinfo.cpp Normal file

@ -0,0 +1,38 @@
#include "programinfo.h"
#include <QFile>
#include <QProcessEnvironment>
ProgramInfo::LANG ProgramInfo::systemLANG()
{
if(QProcessEnvironment::systemEnvironment().value("LANG").contains("zh")) {
return LANG::zh_CN;
}
return LANG::en_US;
}
QString ProgramInfo::updateInfo()
{
// 读取更新日志
// 检查系统语言以加载对应语言的更新日志
QString updateInfoPath = ":/data/new/en_US.html";
if(QProcessEnvironment::systemEnvironment().value("LANG").contains("zh")) {
// 中文,加载中文更新日志
updateInfoPath = ":/data/new/zh_CN.html";
}
QFile file(updateInfoPath);
file.open(QFile::ReadOnly);
QString data = file.readAll();
file.close();
return data;
}
QString ProgramInfo::version()
{
QFile file(":/data/version");
file.open(QFile::ReadOnly);
QString data = file.readAll();
file.close();
return data;
}

18
programinfo.h Normal file

@ -0,0 +1,18 @@
#ifndef PROGRAMINFO_H
#define PROGRAMINFO_H
#include <QString>
namespace ProgramInfo
{
enum LANG {
zh_CN = 0,
en_US = 1,
other = en_US
};
LANG systemLANG() ;
QString updateInfo();
QString version();
};
#endif // PROGRAMINFO_H

@ -0,0 +1,5 @@
#!/bin/bash
set -e
rm /tmp/gxde-kernel-manager-installer-status -f
dpkg-reconfigure ${KernelList}
rm -f "${kernelInstallerShellTempPath}"

@ -1,6 +1,11 @@
#!/bin/bash #!/bin/bash
set -e set -e
rm /tmp/gxde-kernel-manager-installer-status -f rm /tmp/gxde-kernel-manager-installer-status -f
apt update aptPath="apt"
apt install ${KernelList} -y if [[ -f "/usr/bin/aptss" ]]; then
rm -f "${kernelInstallerShellTempPath}" # 如果 aptss 存在,则使用 aptss
aptPath="aptss"
fi
$aptPath update
$aptPath install ${KernelList} -y
rm -f "${kernelInstallerShellTempPath}"

@ -0,0 +1,10 @@
#!/bin/bash
set -e
rm /tmp/gxde-kernel-manager-installer-status -f
aptPath="apt"
if [[ -f "/usr/bin/aptss" ]]; then
# 如果 aptss 存在,则使用 aptss
aptPath="aptss"
fi
$aptPath update
rm -f "${kernelInstallerShellTempPath}"

@ -0,0 +1,11 @@
#!/bin/bash
set -e
rm /tmp/gxde-kernel-manager-installer-status -f
aptPath="apt"
if [[ -f "/usr/bin/aptss" ]]; then
# 如果 aptss 存在,则使用 aptss
aptPath="aptss"
fi
$aptPath update
$aptPath full-upgrade ${KernelList} -y
rm -f "${kernelInstallerShellTempPath}"

11
translate_generation.sh Executable file

@ -0,0 +1,11 @@
#!/bin/bash
# this file is used to auto-generate .qm file from .ts file.
# author: shibowen at linuxdeepin.com
ts_list=(`ls translations/*.ts`)
for ts in "${ts_list[@]}"
do
printf "\nprocess ${ts}\n"
/usr/lib/qt6/bin/lrelease "${ts}"
done

@ -1,209 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_CN">
<context>
<name>AboutWindow</name>
<message>
<location filename="../aboutwindow.ui" line="14"/>
<source>About</source>
<translation></translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="25"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img width=128 src=&quot;:/icon/icon.svg&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="62"/>
<source>OK</source>
<translation></translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="13"/>
<source>A kernel manager allows users to install or remove kernels easily.</source>
<translation>GXDE 便</translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="14"/>
<source>Warning: You may damage your system unless you know what you will do!</source>
<translation></translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="17"/>
<source>Website</source>
<translation></translation>
</message>
</context>
<context>
<name>KernelInstaller</name>
<message>
<source>Kernel Installer</source>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../kernelinstaller.ui" line="14"/>
<source>Config Kernel</source>
<translation></translation>
</message>
<message>
<location filename="../kernelinstaller.ui" line="33"/>
<location filename="../kernelinstaller.ui" line="46"/>
<source>TextLabel</source>
<translation></translation>
</message>
<message>
<location filename="../kernelinstaller.cpp" line="27"/>
<source>Try to install </source>
<translation> </translation>
</message>
<message>
<location filename="../kernelinstaller.cpp" line="30"/>
<source>Try to remove </source>
<translation> </translation>
</message>
<message>
<location filename="../kernelinstaller.cpp" line="135"/>
<source>Done</source>
<translation></translation>
</message>
<message>
<location filename="../kernelinstaller.cpp" line="140"/>
<source>Something error, exit code: </source>
<translation>退 </translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<source>Kerne Manager</source>
<translation type="vanished">GXDE </translation>
</message>
<message>
<location filename="../mainwindow.ui" line="14"/>
<source>GXDE Kerne Manager</source>
<translation>GXDE </translation>
</message>
<message>
<location filename="../mainwindow.ui" line="43"/>
<source>TextLabel</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="63"/>
<source>Refresh</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="70"/>
<source>Install</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="77"/>
<source>Remove</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="96"/>
<source>Program</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="102"/>
<source>Help</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="115"/>
<source>Exit</source>
<translation>退</translation>
</message>
<message>
<location filename="../mainwindow.ui" line="120"/>
<source>About</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="125"/>
<source>Gitee</source>
<translation>Gitee</translation>
</message>
<message>
<location filename="../mainwindow.ui" line="130"/>
<source>Github</source>
<translation>Github</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="21"/>
<source>Kernel: </source>
<translation> </translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="21"/>
<source>Arch: </source>
<translation> </translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="34"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="34"/>
<source>Kernel Name</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="34"/>
<source>Author</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="34"/>
<source>Arch</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="34"/>
<source>Installed</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="63"/>
<location filename="../mainwindow.cpp" line="106"/>
<source>Error</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="63"/>
<location filename="../mainwindow.cpp" line="106"/>
<source>Nothing to choose</source>
<translation></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../main.cpp" line="23"/>
<source>Waring</source>
<translation></translation>
</message>
<message>
<location filename="../main.cpp" line="23"/>
<source>It is danger because it may make your system unboot.
Press &apos;OK&apos; to countinue</source>
<translation>
OK</translation>
</message>
<message>
<location filename="../main.cpp" line="30"/>
<source>Error</source>
<translation></translation>
</message>
<message>
<location filename="../main.cpp" line="30"/>
<source>It unsupport Windows</source>
<translation> Windows</translation>
</message>
</context>
</TS>

@ -0,0 +1,380 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_CN">
<context>
<name>AboutWindow</name>
<message>
<location filename="../aboutwindow.ui" line="14"/>
<source>About</source>
<translation></translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="25"/>
<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></translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="62"/>
<source>OK</source>
<translation></translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="18"/>
<source>A kernel manager allows users to install or remove kernels easily.</source>
<translation>GXDE 便</translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="19"/>
<source>Warning: You may damage your system unless you know what you will do!</source>
<translation></translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="20"/>
<source>Built Time: </source>
<translation> </translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="21"/>
<source>QQ Group: 881201853</source>
<translation>QQ 881201853</translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="26"/>
<source>Website</source>
<translation></translation>
</message>
</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>
<name>KernelInstaller</name>
<message>
<source>Kernel Installer</source>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../kernelinstaller.ui" line="14"/>
<source>Config Kernel</source>
<translation></translation>
</message>
<message>
<location filename="../kernelinstaller.ui" line="46"/>
<source>TextLabel</source>
<translation></translation>
</message>
<message>
<location filename="../kernelinstaller.cpp" line="27"/>
<source>Try to install </source>
<translation> </translation>
</message>
<message>
<location filename="../kernelinstaller.cpp" line="30"/>
<source>Try to remove </source>
<translation> </translation>
</message>
<message>
<location filename="../kernelinstaller.cpp" line="33"/>
<source>Try to reconfigure </source>
<translation> </translation>
</message>
<message>
<location filename="../kernelinstaller.cpp" line="36"/>
<source>Try to update apt cache</source>
<translation> apt </translation>
</message>
<message>
<location filename="../kernelinstaller.cpp" line="39"/>
<source>Try to upgrade </source>
<translation> </translation>
</message>
<message>
<location filename="../kernelinstaller.cpp" line="156"/>
<source>Done</source>
<translation></translation>
</message>
<message>
<location filename="../kernelinstaller.cpp" line="161"/>
<source>Something error, exit code: </source>
<translation>退 </translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<source>Kerne Manager</source>
<translation type="vanished">GXDE </translation>
</message>
<message>
<location filename="../mainwindow.ui" line="14"/>
<source>GXDE Kerne Manager</source>
<translation>GXDE </translation>
</message>
<message>
<location filename="../mainwindow.ui" line="49"/>
<source>TextLabel</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="69"/>
<source>Show local PC architecture only</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="79"/>
<source>Refresh</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="86"/>
<source>Reconfigure</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="93"/>
<source>Install</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="100"/>
<source>Remove</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="119"/>
<source>Program</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="125"/>
<source>Help</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="138"/>
<source>Apt</source>
<translation>Apt</translation>
</message>
<message>
<location filename="../mainwindow.ui" line="146"/>
<source>Grub</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="158"/>
<source>Exit</source>
<translation>退</translation>
</message>
<message>
<location filename="../mainwindow.ui" line="163"/>
<source>About</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="168"/>
<source>Gitee</source>
<translation>Gitee</translation>
</message>
<message>
<location filename="../mainwindow.ui" line="173"/>
<source>Github</source>
<translation>Github</translation>
</message>
<message>
<location filename="../mainwindow.ui" line="178"/>
<source>Update apt cache</source>
<translation> apt </translation>
</message>
<message>
<location filename="../mainwindow.ui" line="183"/>
<source>About QT</source>
<translation> QT</translation>
</message>
<message>
<location filename="../mainwindow.ui" line="188"/>
<source>Upgrade</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="193"/>
<source>Donate</source>
<translation></translation>
</message>
<message>
<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>
<translation> </translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="25"/>
<source>Arch: </source>
<translation> </translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="37"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="37"/>
<source>Kernel Name</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="37"/>
<source>Author</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="37"/>
<source>Arch</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="37"/>
<source>Installed</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="37"/>
<source>Description</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="37"/>
<source>Version</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="93"/>
<location filename="../mainwindow.cpp" line="147"/>
<location filename="../mainwindow.cpp" line="182"/>
<location filename="../mainwindow.cpp" line="230"/>
<source>Error</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="93"/>
<location filename="../mainwindow.cpp" line="147"/>
<location filename="../mainwindow.cpp" line="182"/>
<location filename="../mainwindow.cpp" line="230"/>
<source>Nothing to choose</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="156"/>
<source>Warning</source>
<translation></translation>
</message>
<message>
<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>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="158"/>
<source>Confirm</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="159"/>
<source>Cancel</source>
<translation></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../main.cpp" line="23"/>
<source>Waring</source>
<translation></translation>
</message>
<message>
<location filename="../main.cpp" line="23"/>
<source>It is danger because it may make your system unboot.
Press &apos;OK&apos; to countinue</source>
<translation>
OK</translation>
</message>
<message>
<location filename="../main.cpp" line="30"/>
<source>Error</source>
<translation></translation>
</message>
<message>
<location filename="../main.cpp" line="30"/>
<source>It unsupport Windows</source>
<translation> Windows</translation>
</message>
</context>
</TS>