From 9a05b542e20af2f0838e5d172e2acf50ea77beb2 Mon Sep 17 00:00:00 2001 From: Felipe Borges Date: Thu, 21 Mar 2024 11:03:52 +0100 Subject: [PATCH] system, secure-shell: Rename internal name from RemoteLogin As the user facing name of this setting changed to "Secure Shell", let's change its internal name to match it. This avoids confusion with the Remote Desktop "Remote Session" setting, which is now named "Remote Login" in the UI and should get its code renamed to follow that consistently. --- panels/system/cc-system-panel.c | 6 +-- panels/system/meson.build | 8 ++-- .../cc-secure-shell-page.c} | 46 +++++++++---------- .../cc-secure-shell-page.h} | 4 +- .../cc-secure-shell-page.ui} | 6 +-- .../cc-secure-shell.c} | 8 ++-- .../cc-secure-shell.h} | 4 +- .../cc-systemd-service.c | 0 .../cc-systemd-service.h | 0 .../meson.build | 0 ...rolcenter.remote-login-helper.policy.in.in | 0 panels/system/system.gresource.xml | 2 +- 12 files changed, 42 insertions(+), 42 deletions(-) rename panels/system/{remote-login/cc-remote-login-page.c => secure-shell/cc-secure-shell-page.c} (62%) rename panels/system/{remote-login/cc-remote-login-page.h => secure-shell/cc-secure-shell-page.h} (82%) rename panels/system/{remote-login/cc-remote-login-page.ui => secure-shell/cc-secure-shell-page.ui} (94%) rename panels/system/{remote-login/cc-remote-login.c => secure-shell/cc-secure-shell.c} (95%) rename panels/system/{remote-login/cc-remote-login.h => secure-shell/cc-secure-shell.h} (88%) rename panels/system/{remote-login => secure-shell}/cc-systemd-service.c (100%) rename panels/system/{remote-login => secure-shell}/cc-systemd-service.h (100%) rename panels/system/{remote-login => secure-shell}/meson.build (100%) rename panels/system/{remote-login => secure-shell}/org.gnome.controlcenter.remote-login-helper.policy.in.in (100%) diff --git a/panels/system/cc-system-panel.c b/panels/system/cc-system-panel.c index 36f1b8190..248a472f9 100644 --- a/panels/system/cc-system-panel.c +++ b/panels/system/cc-system-panel.c @@ -31,7 +31,7 @@ #include "datetime/cc-datetime-page.h" #include "region/cc-region-page.h" #include "remote-desktop/cc-remote-desktop-page.h" -#include "remote-login/cc-remote-login-page.h" +#include "secure-shell/cc-secure-shell-page.h" #include "users/cc-users-page.h" struct _CcSystemPanel @@ -125,7 +125,7 @@ on_secure_shell_row_clicked (CcSystemPanel *self) if (self->remote_login_dialog == NULL) { GtkWidget *parent = cc_shell_get_toplevel (cc_panel_get_shell (CC_PANEL (self))); - self->remote_login_dialog = g_object_new (CC_TYPE_REMOTE_LOGIN_PAGE, NULL); + self->remote_login_dialog = g_object_new (CC_TYPE_SECURE_SHELL_PAGE, NULL); gtk_window_set_transient_for (GTK_WINDOW (self->remote_login_dialog), GTK_WINDOW (parent)); @@ -211,7 +211,7 @@ cc_system_panel_class_init (CcSystemPanelClass *klass) g_type_ensure (CC_TYPE_DATE_TIME_PAGE); g_type_ensure (CC_TYPE_REGION_PAGE); g_type_ensure (CC_TYPE_REMOTE_DESKTOP_PAGE); - g_type_ensure (CC_TYPE_REMOTE_LOGIN_PAGE); + g_type_ensure (CC_TYPE_SECURE_SHELL_PAGE); g_type_ensure (CC_TYPE_USERS_PAGE); } diff --git a/panels/system/meson.build b/panels/system/meson.build index 4fee82210..17042ae59 100644 --- a/panels/system/meson.build +++ b/panels/system/meson.build @@ -46,9 +46,9 @@ sources = files( 'remote-desktop/cc-remote-session-page.c', 'remote-desktop/cc-tls-certificate.c', 'remote-desktop/cc-systemd-service.c', - 'remote-login/cc-remote-login.c', - 'remote-login/cc-remote-login-page.c', - 'remote-login/cc-systemd-service.c', + 'secure-shell/cc-secure-shell.c', + 'secure-shell/cc-secure-shell-page.c', + 'secure-shell/cc-systemd-service.c', 'users/cc-add-user-dialog.c', 'users/cc-avatar-chooser.c', 'users/cc-crop-area.c', @@ -151,7 +151,7 @@ subdir('about') subdir('datetime') subdir('region') subdir('remote-desktop') -subdir('remote-login') +subdir('secure-shell') subdir('users') panels_libs += static_library( diff --git a/panels/system/remote-login/cc-remote-login-page.c b/panels/system/secure-shell/cc-secure-shell-page.c similarity index 62% rename from panels/system/remote-login/cc-remote-login-page.c rename to panels/system/secure-shell/cc-secure-shell-page.c index 76d0f1f6f..0b6c4297f 100644 --- a/panels/system/remote-login/cc-remote-login-page.c +++ b/panels/system/secure-shell/cc-secure-shell-page.c @@ -18,34 +18,34 @@ */ #undef G_LOG_DOMAIN -#define G_LOG_DOMAIN "cc-remote-login-page" +#define G_LOG_DOMAIN "cc-secure-shell-page" #include #include "cc-hostname.h" #include "cc-list-row.h" -#include "cc-remote-login.h" -#include "cc-remote-login-page.h" +#include "cc-secure-shell.h" +#include "cc-secure-shell-page.h" #include "cc-systemd-service.h" #ifdef HAVE_CONFIG_H # include "config.h" #endif -struct _CcRemoteLoginPage { +struct _CcSecureShellPage { AdwWindow parent_instance; AdwActionRow *hostname_row; - AdwSwitchRow *remote_login_row; + AdwSwitchRow *secure_shell_row; AdwToastOverlay *toast_overlay; GCancellable *cancellable; }; -G_DEFINE_TYPE (CcRemoteLoginPage, cc_remote_login_page, ADW_TYPE_WINDOW) +G_DEFINE_TYPE (CcSecureShellPage, cc_secure_shell_page, ADW_TYPE_WINDOW) static void -on_copy_ssh_command_button_clicked (CcRemoteLoginPage *self) +on_copy_ssh_command_button_clicked (CcSecureShellPage *self) { gdk_clipboard_set_text (gtk_widget_get_clipboard (GTK_WIDGET (self)), adw_action_row_get_subtitle (ADW_ACTION_ROW (self->hostname_row))); @@ -54,42 +54,42 @@ on_copy_ssh_command_button_clicked (CcRemoteLoginPage *self) } static void -remote_login_row_activate (CcRemoteLoginPage *self) +secure_shell_row_activate (CcSecureShellPage *self) { - cc_remote_login_set_enabled (self->cancellable, self->remote_login_row); + cc_secure_shell_set_enabled (self->cancellable, self->secure_shell_row); } static void -cc_remote_login_page_dispose (GObject *object) +cc_secure_shell_page_dispose (GObject *object) { - CcRemoteLoginPage *self = (CcRemoteLoginPage *) object; + CcSecureShellPage *self = (CcSecureShellPage *) object; g_cancellable_cancel (self->cancellable); g_clear_object (&self->cancellable); - G_OBJECT_CLASS (cc_remote_login_page_parent_class)->dispose (object); + G_OBJECT_CLASS (cc_secure_shell_page_parent_class)->dispose (object); } static void -cc_remote_login_page_class_init (CcRemoteLoginPageClass * klass) +cc_secure_shell_page_class_init (CcSecureShellPageClass * klass) { GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass); - object_class->dispose = cc_remote_login_page_dispose; + object_class->dispose = cc_secure_shell_page_dispose; - gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/system/remote-login/cc-remote-login-page.ui"); + gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/system/secure-shell/cc-secure-shell-page.ui"); - gtk_widget_class_bind_template_child (widget_class, CcRemoteLoginPage, hostname_row); - gtk_widget_class_bind_template_child (widget_class, CcRemoteLoginPage, remote_login_row); - gtk_widget_class_bind_template_child (widget_class, CcRemoteLoginPage, toast_overlay); + gtk_widget_class_bind_template_child (widget_class, CcSecureShellPage, hostname_row); + gtk_widget_class_bind_template_child (widget_class, CcSecureShellPage, secure_shell_row); + gtk_widget_class_bind_template_child (widget_class, CcSecureShellPage, toast_overlay); gtk_widget_class_bind_template_callback (widget_class, on_copy_ssh_command_button_clicked); - gtk_widget_class_bind_template_callback (widget_class, remote_login_row_activate); + gtk_widget_class_bind_template_callback (widget_class, secure_shell_row_activate); } static void -cc_remote_login_page_init (CcRemoteLoginPage *self) +cc_secure_shell_page_init (CcSecureShellPage *self) { g_autofree gchar *hostname = NULL; g_autofree gchar *command = NULL; @@ -98,10 +98,10 @@ cc_remote_login_page_init (CcRemoteLoginPage *self) self->cancellable = g_cancellable_new (); - cc_remote_login_get_enabled (self->remote_login_row); - g_signal_connect_object (self->remote_login_row, + cc_secure_shell_get_enabled (self->secure_shell_row); + g_signal_connect_object (self->secure_shell_row, "notify::active", - G_CALLBACK (remote_login_row_activate), + G_CALLBACK (secure_shell_row_activate), self, G_CONNECT_SWAPPED); diff --git a/panels/system/remote-login/cc-remote-login-page.h b/panels/system/secure-shell/cc-secure-shell-page.h similarity index 82% rename from panels/system/remote-login/cc-remote-login-page.h rename to panels/system/secure-shell/cc-secure-shell-page.h index c00219de3..d599b039d 100644 --- a/panels/system/remote-login/cc-remote-login-page.h +++ b/panels/system/secure-shell/cc-secure-shell-page.h @@ -23,8 +23,8 @@ G_BEGIN_DECLS -#define CC_TYPE_REMOTE_LOGIN_PAGE (cc_remote_login_page_get_type ()) +#define CC_TYPE_SECURE_SHELL_PAGE (cc_secure_shell_page_get_type ()) -G_DECLARE_FINAL_TYPE (CcRemoteLoginPage, cc_remote_login_page, CC, CC_TYPE_REMOTE_LOGIN_PAGE, AdwWindow) +G_DECLARE_FINAL_TYPE (CcSecureShellPage, cc_secure_shell_page, CC, CC_TYPE_SECURE_SHELL_PAGE, AdwWindow) G_END_DECLS diff --git a/panels/system/remote-login/cc-remote-login-page.ui b/panels/system/secure-shell/cc-secure-shell-page.ui similarity index 94% rename from panels/system/remote-login/cc-remote-login-page.ui rename to panels/system/secure-shell/cc-secure-shell-page.ui index 23f8a8053..cdb91b508 100644 --- a/panels/system/remote-login/cc-remote-login-page.ui +++ b/panels/system/secure-shell/cc-secure-shell-page.ui @@ -1,6 +1,6 @@ -