diff --git a/Donate/Alipay.jpg b/Donate/Alipay.jpg new file mode 100644 index 0000000..64308b8 Binary files /dev/null and b/Donate/Alipay.jpg differ diff --git a/Donate/QQ.png b/Donate/QQ.png new file mode 100644 index 0000000..00f8e15 Binary files /dev/null and b/Donate/QQ.png differ diff --git a/Donate/Wechat.png b/Donate/Wechat.png new file mode 100644 index 0000000..854388e Binary files /dev/null and b/Donate/Wechat.png differ diff --git a/Donate/advertisement0.jpg b/Donate/advertisement0.jpg new file mode 100644 index 0000000..2449c04 Binary files /dev/null and b/Donate/advertisement0.jpg differ diff --git a/Resource.qrc b/Resource.qrc index 4b48c5d..669f148 100644 --- a/Resource.qrc +++ b/Resource.qrc @@ -18,5 +18,10 @@ <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> </qresource> </RCC> diff --git a/aboutwindow.cpp b/aboutwindow.cpp index 456ac1b..0fb3aa9 100644 --- a/aboutwindow.cpp +++ b/aboutwindow.cpp @@ -17,7 +17,8 @@ AboutWindow::AboutWindow(QWidget *parent) : info += "<pre>"; 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 += tr("Built Time: ") + QString(__DATE__) + " " + __TIME__; + info += tr("Built Time: ") + QString(__DATE__) + " " + __TIME__ + "\n"; + info += tr("QQ Group: 881201853") + "\n"; info += "</pre>"; info += "<hr/>"; info += ProgramInfo::updateInfo(); @@ -25,6 +26,8 @@ AboutWindow::AboutWindow(QWidget *parent) : 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>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>GXDE Homepage: <a href='https://gxde.gfdgdxi.top'>https://gxde.gfdgdxi.top</a></p>"; info += "<hr/>\n"; info += "<h1>©2023~" + QDateTime::currentDateTime().toString("yyyy") + " gfdgd xi</h1>\n"; ui->textBrowser->setHtml(info); @@ -40,3 +43,9 @@ void AboutWindow::on_m_closeButton_clicked() this->close(); } + +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>"); +} + diff --git a/aboutwindow.h b/aboutwindow.h index 0e0927a..0da59e1 100644 --- a/aboutwindow.h +++ b/aboutwindow.h @@ -18,6 +18,8 @@ public: private slots: void on_m_closeButton_clicked(); + void on_m_logoShower_linkActivated(const QString &link); + private: Ui::AboutWindow *ui; }; diff --git a/aboutwindow.ui b/aboutwindow.ui index ddbe961..6451f06 100644 --- a/aboutwindow.ui +++ b/aboutwindow.ui @@ -22,7 +22,7 @@ <item> <widget class="QLabel" name="m_logoShower"> <property name="text"> - <string><html><head/><body><p><img width=128 src=":/icon/icon.svg"/></p></body></html></string> + <string><html><head/><body><p><a href='https://gxde.gfdgdxi.top'><img width=128 src=":/icon/icon.svg"/></a></p></body></html></string> </property> <property name="alignment"> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> diff --git a/data/new/zh_CN.html b/data/new/zh_CN.html index 75ab83c..5a0332b 100644 --- a/data/new/zh_CN.html +++ b/data/new/zh_CN.html @@ -5,5 +5,5 @@ ※3、下载/更新内核时支持调用 aptss 提升下载速度 </b> 4、优化表格显示效果 -5、支持显示内核描述 +5、支持显示内核描述和版本 </pre> \ No newline at end of file diff --git a/icon/icon1.png b/icon/icon1.png new file mode 100644 index 0000000..07756a2 Binary files /dev/null and b/icon/icon1.png differ diff --git a/kernelinformation.cpp b/kernelinformation.cpp index f222a5b..cbcf034 100644 --- a/kernelinformation.cpp +++ b/kernelinformation.cpp @@ -20,6 +20,7 @@ void KernelInformation::LoadInfo() object.insert("Name", i); object.insert("Author", kernelManagerinfo.get_maintainer(i)); object.insert("Des", kernelManagerinfo.get_description(i)); + object.insert("Ver", kernelManagerinfo.get_version(i)); object.insert("Arch", QJsonArray::fromStringList(QStringList() << arch())); object.insert("PkgName", QJsonArray::fromStringList(QStringList() << i)); array.append(object); @@ -76,6 +77,7 @@ void KernelInformation::LoadInfo() 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()); diff --git a/mainwindow.cpp b/mainwindow.cpp index bf58886..7304348 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -32,9 +32,10 @@ void MainWindow::RefreshKernelListView(KernelInformation *info, bool showLocalAr // 更新列表 int count = info->get_count(); QStandardItemModel *model = new QStandardItemModel(); - model->setHorizontalHeaderLabels(QStringList() << tr("ID") << tr("Kernel Name") << tr("Author") << tr("Arch") << tr("Installed") << tr("Description")); + 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++) { // 显示所有架构 QString kernelArch = ""; @@ -56,8 +57,13 @@ void MainWindow::RefreshKernelListView(KernelInformation *info, bool showLocalAr 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((QStringList() << "" << "Y").at(info->get_installedAlready(i)))); - model->setItem(line, 5, new QStandardItem(info->get_des(i))); + 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); @@ -135,6 +141,17 @@ void MainWindow::on_m_removeButton_clicked() // 获取 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(); diff --git a/mainwindow.h b/mainwindow.h index d96255a..41830a7 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -48,5 +48,7 @@ private: KernelInformation *kernelInformation; void RefreshKernelList(); void RefreshKernelListView(KernelInformation *info, bool showLocalArchOnly = true); + + int kernelNumber = 0; }; #endif // MAINWINDOW_H