This commit is contained in:
Ward from fusion-voyager-3 2024-06-24 02:49:31 +03:00
parent 077dce8501
commit 462dbf693f
6 changed files with 61 additions and 7 deletions

32
Cargo.lock generated
View File

@ -351,7 +351,7 @@ checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a"
[[package]] [[package]]
name = "fedora-kernel-manager" name = "fedora-kernel-manager"
version = "0.1.0" version = "0.1.1"
dependencies = [ dependencies = [
"async-channel", "async-channel",
"duct", "duct",
@ -365,6 +365,7 @@ dependencies = [
"reqwest", "reqwest",
"rust-i18n", "rust-i18n",
"serde_json", "serde_json",
"textwrap",
"version-compare", "version-compare",
] ]
@ -1816,6 +1817,12 @@ version = "1.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
[[package]]
name = "smawk"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c"
[[package]] [[package]]
name = "socket2" name = "socket2"
version = "0.5.7" version = "0.5.7"
@ -1912,6 +1919,17 @@ dependencies = [
"windows-sys 0.52.0", "windows-sys 0.52.0",
] ]
[[package]]
name = "textwrap"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9"
dependencies = [
"smawk",
"unicode-linebreak",
"unicode-width",
]
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.61" version = "1.0.61"
@ -2098,6 +2116,18 @@ version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
[[package]]
name = "unicode-linebreak"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f"
[[package]]
name = "unicode-width"
version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d"
[[package]] [[package]]
name = "url" name = "url"
version = "2.5.1" version = "2.5.1"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "fedora-kernel-manager" name = "fedora-kernel-manager"
version = "0.1.0" version = "0.1.1"
edition = "2021" edition = "2021"
@ -19,6 +19,7 @@ reqwest = { version = "0.11", features = ["blocking"] }
serde_json = "1.0.117" serde_json = "1.0.117"
version-compare = "0.2.0" version-compare = "0.2.0"
rust-i18n = "3.0.1" rust-i18n = "3.0.1"
textwrap = "0.16.1"
[build-dependencies] [build-dependencies]
glib-build-tools = "0.19.0" glib-build-tools = "0.19.0"

View File

@ -5,6 +5,10 @@ build:
cargo fetch cargo fetch
cargo build --release cargo build --release
build_debug:
cargo fetch
cargo build --debug
install_no_build: install_no_build:
mkdir -p $(DESTDIR)/usr/bin/ mkdir -p $(DESTDIR)/usr/bin/
cp -vf target/release/fedora-kernel-manager $(DESTDIR)/usr/bin/ cp -vf target/release/fedora-kernel-manager $(DESTDIR)/usr/bin/
@ -21,6 +25,22 @@ install_no_build:
cp -vf data/com.github.cosmicfusion.fedora-kernel-manager.desktop $(DESTDIR)/usr/share/applications/ cp -vf data/com.github.cosmicfusion.fedora-kernel-manager.desktop $(DESTDIR)/usr/share/applications/
cp -rvf data/polkit-1 $(DESTDIR)/usr/share/ cp -rvf data/polkit-1 $(DESTDIR)/usr/share/
install_no_build_debug:
mkdir -p $(DESTDIR)/usr/bin/
cp -vf target/debug/fedora-kernel-manager $(DESTDIR)/usr/bin/
chmod 755 $(DESTDIR)/usr/bin/fedora-kernel-manager
mkdir -p $(DESTDIR)/usr/lib/fedora-kernel-manager/
cp -rvf data/scripts $(DESTDIR)/usr/lib/fedora-kernel-manager/
chmod 755 $(DESTDIR)/usr/lib/fedora-kernel-manager/scripts/*.sh
cp -rvf data/locales $(DESTDIR)/usr/lib/fedora-kernel-manager/
cp -rvf data/kernel_branches $(DESTDIR)/usr/lib/fedora-kernel-manager/
cp -vf data/scx_scheds.json $(DESTDIR)/usr/lib/fedora-kernel-manager/
mkdir -p $(DESTDIR)/usr/share/applications
mkdir -p $(DESTDIR)/usr/share/icons/hicolor/scalable/apps
cp -vf data/com.github.cosmicfusion.fedora-kernel-manager.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/
cp -vf data/com.github.cosmicfusion.fedora-kernel-manager.desktop $(DESTDIR)/usr/share/applications/
cp -rvf data/polkit-1 $(DESTDIR)/usr/share/
install: install:
mkdir -p $(DESTDIR)/usr/bin/ mkdir -p $(DESTDIR)/usr/bin/
cargo fetch cargo fetch

View File

@ -1,9 +1,9 @@
%define pkg_release 0.1.0 %define pkg_release 0.1.1
Name: fedora-kernel-manager Name: fedora-kernel-manager
Version: %{pkg_release} Version: %{pkg_release}
Release: 5%{?dist} Release: 1%{?dist}
License: GPLv2 License: GPLv2
Group: System Environment/Libraries Group: System Environment/Libraries
Summary: A Libadwaita rust based application for managing and installing kernels. Summary: A Libadwaita rust based application for managing and installing kernels.

View File

@ -134,8 +134,8 @@ pub fn content(
browse_kernels_button.connect_clicked( browse_kernels_button.connect_clicked(
clone!(@weak window, @weak content_stack, @strong selected_kernel_branch => move |_| { clone!(@weak window, @weak content_stack, @strong selected_kernel_branch => move |_| {
match content_stack.child_by_name("kernel_pkg_page") { match content_stack.child_by_name("kernel_pkg_page") {
Some(_) => , Some(_) => {},
None() => kernel_pkg::kernel_pkg_page(&content_stack, &window, &selected_kernel_branch) None => kernel_pkg::kernel_pkg_page(&content_stack, &window, &selected_kernel_branch)
}; };
content_stack.set_visible_child_name("kernel_pkg_page") content_stack.set_visible_child_name("kernel_pkg_page")
}), }),

View File

@ -96,6 +96,7 @@ pub fn kernel_pkg_page(
.build(); .build();
packages_boxedlist.add_css_class("boxed-list"); packages_boxedlist.add_css_class("boxed-list");
let rows_size_group = gtk::SizeGroup::new(SizeGroupMode::Both); let rows_size_group = gtk::SizeGroup::new(SizeGroupMode::Both);
add_package_rows( add_package_rows(
&packages_boxedlist, &packages_boxedlist,
selected_kernel_branch_clone0.db, selected_kernel_branch_clone0.db,
@ -228,7 +229,7 @@ fn add_package_rows(
let kernel_packages = kernel_pkg_status.packages; let kernel_packages = kernel_pkg_status.packages;
let kernel_min_x86_march = kernel_pkg_status.min_x86_march; let kernel_min_x86_march = kernel_pkg_status.min_x86_march;
let kernel_package_version = kernel_pkg_status.package_version; let kernel_package_version = kernel_pkg_status.package_version;
let kernel_description = kernel_pkg_status.description; let kernel_description = textwrap::fill(&kernel_pkg_status.description, 40);
let (log_loop_sender, log_loop_receiver) = async_channel::unbounded(); let (log_loop_sender, log_loop_receiver) = async_channel::unbounded();
let log_loop_sender: async_channel::Sender<String> = log_loop_sender.clone(); let log_loop_sender: async_channel::Sender<String> = log_loop_sender.clone();
@ -299,6 +300,8 @@ fn add_package_rows(
kernel_expander_row.add_suffix(&kernel_status_icon); kernel_expander_row.add_suffix(&kernel_status_icon);
kernel_expander_row.set_title(&kernel_name); kernel_expander_row.set_title(&kernel_name);
kernel_expander_row.set_subtitle(&kernel_package_version); kernel_expander_row.set_subtitle(&kernel_package_version);
kernel_expander_row.set_title_lines(2);
kernel_expander_row.set_subtitle_lines(2);
kernel_content_row.add_prefix(&kernel_description_label); kernel_content_row.add_prefix(&kernel_description_label);
kernel_action_box.append(&kernel_remove_button); kernel_action_box.append(&kernel_remove_button);
kernel_action_box.append(&kernel_install_button); kernel_action_box.append(&kernel_install_button);