From 462dbf693f9235db607889df82fab7231c75f224 Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Mon, 24 Jun 2024 02:49:31 +0300 Subject: [PATCH] 0.1.1 --- Cargo.lock | 32 +++++++++++++++++++++++++++++++- Cargo.toml | 3 ++- Makefile | 20 ++++++++++++++++++++ fedora-kernel-manager.spec | 4 ++-- src/content/mod.rs | 4 ++-- src/kernel_pkg/mod.rs | 5 ++++- 6 files changed, 61 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34f5379..fbf0eaa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -351,7 +351,7 @@ checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fedora-kernel-manager" -version = "0.1.0" +version = "0.1.1" dependencies = [ "async-channel", "duct", @@ -365,6 +365,7 @@ dependencies = [ "reqwest", "rust-i18n", "serde_json", + "textwrap", "version-compare", ] @@ -1816,6 +1817,12 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "smawk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" + [[package]] name = "socket2" version = "0.5.7" @@ -1912,6 +1919,17 @@ dependencies = [ "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]] name = "thiserror" version = "1.0.61" @@ -2098,6 +2116,18 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" 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]] name = "url" version = "2.5.1" diff --git a/Cargo.toml b/Cargo.toml index d1df5c3..ef61fd8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fedora-kernel-manager" -version = "0.1.0" +version = "0.1.1" edition = "2021" @@ -19,6 +19,7 @@ reqwest = { version = "0.11", features = ["blocking"] } serde_json = "1.0.117" version-compare = "0.2.0" rust-i18n = "3.0.1" +textwrap = "0.16.1" [build-dependencies] glib-build-tools = "0.19.0" diff --git a/Makefile b/Makefile index 1d3557f..c308d2a 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,10 @@ build: cargo fetch cargo build --release +build_debug: + cargo fetch + cargo build --debug + install_no_build: mkdir -p $(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 -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: mkdir -p $(DESTDIR)/usr/bin/ cargo fetch diff --git a/fedora-kernel-manager.spec b/fedora-kernel-manager.spec index 04bb908..3b2f922 100644 --- a/fedora-kernel-manager.spec +++ b/fedora-kernel-manager.spec @@ -1,9 +1,9 @@ -%define pkg_release 0.1.0 +%define pkg_release 0.1.1 Name: fedora-kernel-manager Version: %{pkg_release} -Release: 5%{?dist} +Release: 1%{?dist} License: GPLv2 Group: System Environment/Libraries Summary: A Libadwaita rust based application for managing and installing kernels. diff --git a/src/content/mod.rs b/src/content/mod.rs index 3360433..a221f74 100644 --- a/src/content/mod.rs +++ b/src/content/mod.rs @@ -134,8 +134,8 @@ pub fn content( browse_kernels_button.connect_clicked( clone!(@weak window, @weak content_stack, @strong selected_kernel_branch => move |_| { match content_stack.child_by_name("kernel_pkg_page") { - Some(_) => , - None() => kernel_pkg::kernel_pkg_page(&content_stack, &window, &selected_kernel_branch) + Some(_) => {}, + None => kernel_pkg::kernel_pkg_page(&content_stack, &window, &selected_kernel_branch) }; content_stack.set_visible_child_name("kernel_pkg_page") }), diff --git a/src/kernel_pkg/mod.rs b/src/kernel_pkg/mod.rs index 20be1ef..001e827 100644 --- a/src/kernel_pkg/mod.rs +++ b/src/kernel_pkg/mod.rs @@ -96,6 +96,7 @@ pub fn kernel_pkg_page( .build(); packages_boxedlist.add_css_class("boxed-list"); let rows_size_group = gtk::SizeGroup::new(SizeGroupMode::Both); + add_package_rows( &packages_boxedlist, selected_kernel_branch_clone0.db, @@ -228,7 +229,7 @@ fn add_package_rows( let kernel_packages = kernel_pkg_status.packages; let kernel_min_x86_march = kernel_pkg_status.min_x86_march; 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: async_channel::Sender = log_loop_sender.clone(); @@ -299,6 +300,8 @@ fn add_package_rows( kernel_expander_row.add_suffix(&kernel_status_icon); kernel_expander_row.set_title(&kernel_name); 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_action_box.append(&kernel_remove_button); kernel_action_box.append(&kernel_install_button);