Allow changing "Device Name" by pressing "Enter"
Resolves rhbz#2061182
This commit is contained in:
parent
b11cf86824
commit
3849bd86ba
81
change-device-name-with-enter-key.patch
Normal file
81
change-device-name-with-enter-key.patch
Normal file
@ -0,0 +1,81 @@
|
||||
From 8eab500540c1631dbdc760bca617a581e2969ed6 Mon Sep 17 00:00:00 2001
|
||||
From: Felipe Borges <felipeborges@gnome.org>
|
||||
Date: Mon, 1 Aug 2022 10:57:07 +0200
|
||||
Subject: [PATCH] info-overview: Allow changing "Device Name" by pressing
|
||||
"Enter"
|
||||
|
||||
The hostname/device name dialog has only a GtkEntry. So a user
|
||||
navigating with only a keyboard should be able to apply their
|
||||
changes by pressing "Enter".
|
||||
---
|
||||
panels/info-overview/cc-info-overview-panel.c | 34 +++++++++++++++++++
|
||||
.../info-overview/cc-info-overview-panel.ui | 1 +
|
||||
2 files changed, 35 insertions(+)
|
||||
|
||||
diff --git a/panels/info-overview/cc-info-overview-panel.c b/panels/info-overview/cc-info-overview-panel.c
|
||||
index a2cb70755..e8881d70d 100644
|
||||
--- a/panels/info-overview/cc-info-overview-panel.c
|
||||
+++ b/panels/info-overview/cc-info-overview-panel.c
|
||||
@@ -818,6 +818,38 @@ on_device_name_entry_changed (CcInfoOverviewPanel *self)
|
||||
g_strcmp0 (current_hostname, new_hostname) != 0);
|
||||
}
|
||||
|
||||
+static void
|
||||
+update_device_name (CcInfoOverviewPanel *self)
|
||||
+{
|
||||
+ const gchar *hostname;
|
||||
+
|
||||
+ /* We simply change the CcHostnameEntry text. CcHostnameEntry
|
||||
+ * listens to changes and updates hostname on change.
|
||||
+ */
|
||||
+ hostname = gtk_entry_get_text (GTK_ENTRY (self->device_name_entry));
|
||||
+ gtk_entry_set_text (GTK_ENTRY (self->hostname_entry), hostname);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+on_hostname_editor_dialog_response_cb (GtkDialog *dialog,
|
||||
+ gint response,
|
||||
+ CcInfoOverviewPanel *self)
|
||||
+{
|
||||
+ if (response == GTK_RESPONSE_APPLY)
|
||||
+ {
|
||||
+ update_device_name (self);
|
||||
+ }
|
||||
+
|
||||
+ gtk_window_close (GTK_WINDOW (dialog));
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+on_device_name_entry_activated_cb (CcInfoOverviewPanel *self)
|
||||
+{
|
||||
+ update_device_name (self);
|
||||
+ gtk_window_close (GTK_WINDOW (self->hostname_editor));
|
||||
+}
|
||||
+
|
||||
static void
|
||||
open_hostname_edit_dialog (CcInfoOverviewPanel *self)
|
||||
{
|
||||
@@ -906,6 +938,8 @@ cc_info_overview_panel_class_init (CcInfoOverviewPanelClass *klass)
|
||||
|
||||
gtk_widget_class_bind_template_callback (widget_class, cc_info_panel_row_activated_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, on_device_name_entry_changed);
|
||||
+ gtk_widget_class_bind_template_callback (widget_class, on_device_name_entry_activated_cb);
|
||||
+ gtk_widget_class_bind_template_callback (widget_class, on_hostname_editor_dialog_response_cb);
|
||||
|
||||
g_type_ensure (CC_TYPE_LIST_ROW);
|
||||
g_type_ensure (CC_TYPE_HOSTNAME_ENTRY);
|
||||
diff --git a/panels/info-overview/cc-info-overview-panel.ui b/panels/info-overview/cc-info-overview-panel.ui
|
||||
index 2f5d3cf8b..adf3b5409 100644
|
||||
--- a/panels/info-overview/cc-info-overview-panel.ui
|
||||
+++ b/panels/info-overview/cc-info-overview-panel.ui
|
||||
@@ -219,6 +219,7 @@
|
||||
<object class="GtkEntry" id="device_name_entry">
|
||||
<property name="visible">True</property>
|
||||
<signal name="changed" handler="on_device_name_entry_changed" swapped="yes"/>
|
||||
+ <signal name="activate" handler="on_device_name_entry_activated_cb" swapped="yes" />
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
--
|
||||
2.34.1
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
Name: gnome-control-center
|
||||
Version: 40.0
|
||||
Release: 25%{?dist}
|
||||
Release: 26%{?dist}
|
||||
Summary: Utilities to configure the GNOME desktop
|
||||
|
||||
License: GPLv2+ and CC-BY-SA
|
||||
@ -43,6 +43,8 @@ Patch9: 0001-network-Fix-OWE-settings.patch
|
||||
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=2097838
|
||||
Patch10: gnome-control-center-timezones.patch
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=2061182
|
||||
Patch11: change-device-name-with-enter-key.patch
|
||||
|
||||
BuildRequires: chrpath
|
||||
BuildRequires: cups-devel
|
||||
@ -233,6 +235,10 @@ chrpath --delete $RPM_BUILD_ROOT%{_bindir}/gnome-control-center
|
||||
%dir %{_datadir}/gnome/wm-properties
|
||||
|
||||
%changelog
|
||||
* Mon Aug 01 2022 Felipe Borges <feborges@redhat.com> - 40.0-26
|
||||
- Allow changing "Device Name" by pressing "Enter"
|
||||
Resolves: rhbz#2061182
|
||||
|
||||
* Fri Jul 09 2022 Felipe Borges <feborges@redhat.com> - 40.0-25
|
||||
- Backport translations for Multitasking panel
|
||||
- Make Multitasking panel capable of handling Right-to-Left locales
|
||||
|
Loading…
Reference in New Issue
Block a user