Show radio button for single cert
Resolves: RHEL-111480
This commit is contained in:
parent
8916912cef
commit
00f6dafbf3
117
papers-48.7-single-signature-selection.patch
Normal file
117
papers-48.7-single-signature-selection.patch
Normal file
@ -0,0 +1,117 @@
|
||||
From 66dd2a1d2c327916cc0be4aa184e4388762f73f6 Mon Sep 17 00:00:00 2001
|
||||
From: Marek Kasik <mkasik@redhat.com>
|
||||
Date: Fri, 12 Dec 2025 12:02:13 +0100
|
||||
Subject: [PATCH 1/3] shell: Show radio button for single cert
|
||||
|
||||
Show radio button instead of check button when there is only 1 signing
|
||||
certificate. Make it insensitive so it can not be unselected.
|
||||
---
|
||||
shell/src/document_view/io.rs | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/shell/src/document_view/io.rs b/shell/src/document_view/io.rs
|
||||
index 422da4879..75eaefa5c 100644
|
||||
--- a/shell/src/document_view/io.rs
|
||||
+++ b/shell/src/document_view/io.rs
|
||||
@@ -538,7 +538,10 @@ impl imp::PpsDocumentView {
|
||||
.css_classes(["content"])
|
||||
.build();
|
||||
|
||||
- let mut check_button_group = None;
|
||||
+ // Create dummy button to group with
|
||||
+ let check_button_group = Some(gtk::CheckButton::new());
|
||||
+ let multi_certs = certs.len() > 1;
|
||||
+ let mut first_cert = true;
|
||||
|
||||
for cert in certs {
|
||||
let row = adw::ActionRow::builder()
|
||||
@@ -547,6 +550,7 @@ impl imp::PpsDocumentView {
|
||||
.build();
|
||||
|
||||
let check_button = gtk::CheckButton::builder()
|
||||
+ .sensitive(multi_certs)
|
||||
.valign(gtk::Align::Center)
|
||||
.build();
|
||||
|
||||
@@ -577,12 +581,12 @@ impl imp::PpsDocumentView {
|
||||
|
||||
check_button.set_group(check_button_group.as_ref());
|
||||
|
||||
- if check_button_group.is_none() {
|
||||
+ if first_cert {
|
||||
check_button.set_active(true);
|
||||
- check_button_group = Some(check_button);
|
||||
}
|
||||
|
||||
list_box.insert(&row, -1);
|
||||
+ first_cert = false;
|
||||
}
|
||||
|
||||
list_box.select_row(list_box.row_at_index(0).as_ref());
|
||||
--
|
||||
2.52.0
|
||||
|
||||
From f7d74779003c84bec3c0ccca5cb8fa9c88365725 Mon Sep 17 00:00:00 2001
|
||||
From: Lucas Baudin <lbaudin@gnome.org>
|
||||
Date: Thu, 18 Dec 2025 14:35:47 +0000
|
||||
Subject: [PATCH 2/3] shell: Keep a reference to check_button_group
|
||||
|
||||
Keep a strong reference to check_button_group to avoid it being freed.
|
||||
---
|
||||
shell/src/document_view/io.rs | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/shell/src/document_view/io.rs b/shell/src/document_view/io.rs
|
||||
index 75eaefa5c..4a768d7b2 100644
|
||||
--- a/shell/src/document_view/io.rs
|
||||
+++ b/shell/src/document_view/io.rs
|
||||
@@ -550,7 +550,6 @@ impl imp::PpsDocumentView {
|
||||
.build();
|
||||
|
||||
let check_button = gtk::CheckButton::builder()
|
||||
- .sensitive(multi_certs)
|
||||
.valign(gtk::Align::Center)
|
||||
.build();
|
||||
|
||||
@@ -558,9 +557,14 @@ impl imp::PpsDocumentView {
|
||||
row.set_activatable_widget(Some(&check_button));
|
||||
|
||||
check_button.connect_toggled(glib::clone!(
|
||||
+ /* Keep a strong reference to check_button_group to avoid it being freed */
|
||||
+ #[strong(rename_to = group)]
|
||||
+ check_button_group,
|
||||
#[weak(rename_to = obj)]
|
||||
self,
|
||||
move |button| {
|
||||
+ /* make sure the strong reference to group is not disposed */
|
||||
+ let _ = group.as_ref().unwrap();
|
||||
if button.is_active() {
|
||||
let row = button
|
||||
.ancestor(adw::ActionRow::static_type())
|
||||
--
|
||||
2.52.0
|
||||
|
||||
From e15ab6f70de98b1e1692e9998b2cffef8189b3a9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Marek=20Ka=C5=A1=C3=ADk?= <mkasik@redhat.com>
|
||||
Date: Thu, 18 Dec 2025 14:36:56 +0000
|
||||
Subject: [PATCH 3/3] shell: Remove redundant variable
|
||||
|
||||
---
|
||||
shell/src/document_view/io.rs | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/shell/src/document_view/io.rs b/shell/src/document_view/io.rs
|
||||
index 4a768d7b2..ec9863c75 100644
|
||||
--- a/shell/src/document_view/io.rs
|
||||
+++ b/shell/src/document_view/io.rs
|
||||
@@ -540,7 +540,6 @@ impl imp::PpsDocumentView {
|
||||
|
||||
// Create dummy button to group with
|
||||
let check_button_group = Some(gtk::CheckButton::new());
|
||||
- let multi_certs = certs.len() > 1;
|
||||
let mut first_cert = true;
|
||||
|
||||
for cert in certs {
|
||||
--
|
||||
2.52.0
|
||||
|
||||
@ -44,6 +44,7 @@ Patch: papers-48.7-lower-requirements.patch
|
||||
|
||||
Patch: papers-48.7-implement-accessible-text-for-pps-view.patch
|
||||
Patch: papers-48.7-use-correct-role-for-pps-view.patch
|
||||
Patch: papers-48.7-single-signature-selection.patch
|
||||
|
||||
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
|
||||
ExcludeArch: %{ix86}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user