Hdy → Adw

This simply changes namespaces. Fortunately, no further widgetry
changes will be necessary - all the widgets and APIs seem to have
an exact match in libadwaita.
This commit is contained in:
Georges Basile Stavracas Neto 2022-07-08 15:11:30 -03:00
parent d142554ed3
commit e322d8cd98
9 changed files with 41 additions and 41 deletions

View File

@ -26,7 +26,7 @@
#include <glib-object.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <libhandy-1/handy.h>
#include <adwaita.h>
#include "restrict-applications-dialog.h"
#include "restrict-applications-selector.h"
@ -54,13 +54,13 @@ struct _MctRestrictApplicationsDialog
GtkDialog parent_instance;
MctRestrictApplicationsSelector *selector;
HdyPreferencesGroup *group;
AdwPreferencesGroup *group;
MctAppFilter *app_filter; /* (owned) (not nullable) */
gchar *user_display_name; /* (owned) (nullable) */
};
G_DEFINE_TYPE (MctRestrictApplicationsDialog, mct_restrict_applications_dialog, HDY_TYPE_PREFERENCES_WINDOW)
G_DEFINE_TYPE (MctRestrictApplicationsDialog, mct_restrict_applications_dialog, ADW_TYPE_PREFERENCES_WINDOW)
typedef enum
{
@ -215,14 +215,14 @@ update_description (MctRestrictApplicationsDialog *self)
if (self->user_display_name == NULL)
{
hdy_preferences_group_set_description (self->group, NULL);
adw_preferences_group_set_description (self->group, NULL);
return;
}
/* Translators: the placeholder is a users full name */
description = g_strdup_printf (_("Restrict %s from using the following installed applications."),
self->user_display_name);
hdy_preferences_group_set_description (self->group, description);
adw_preferences_group_set_description (self->group, description);
}
/**

View File

@ -24,14 +24,14 @@
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <libhandy-1/handy.h>
#include <adwaita.h>
#include <libmalcontent/manager.h>
G_BEGIN_DECLS
#define MCT_TYPE_RESTRICT_APPLICATIONS_DIALOG (mct_restrict_applications_dialog_get_type ())
G_DECLARE_FINAL_TYPE (MctRestrictApplicationsDialog, mct_restrict_applications_dialog, MCT, RESTRICT_APPLICATIONS_DIALOG, HdyPreferencesWindow)
G_DECLARE_FINAL_TYPE (MctRestrictApplicationsDialog, mct_restrict_applications_dialog, MCT, RESTRICT_APPLICATIONS_DIALOG, AdwPreferencesWindow)
MctRestrictApplicationsDialog *mct_restrict_applications_dialog_new (MctAppFilter *app_filter,
const gchar *user_display_name);

View File

@ -2,16 +2,16 @@
<!-- Copyright © 2020 Endless, Inc. -->
<interface domain="malcontent">
<requires lib="gtk+" version="3.12"/>
<template class="MctRestrictApplicationsDialog" parent="HdyPreferencesWindow">
<template class="MctRestrictApplicationsDialog" parent="AdwPreferencesWindow">
<property name="title" translatable="yes">Restrict Applications</property>
<property name="skip-taskbar-hint">True</property>
<property name="default-width">500</property>
<property name="default-height">500</property>
<property name="search-enabled">False</property>
<child>
<object class="HdyPreferencesPage">
<object class="AdwPreferencesPage">
<child>
<object class="HdyPreferencesGroup" id="group">
<object class="AdwPreferencesGroup" id="group">
<!-- Translated dynamically: -->
<property name="description">Restrict {username} from using the following installed applications.</property>
<child>

View File

@ -28,7 +28,7 @@
#include <glib-object.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <libhandy-1/handy.h>
#include <adwaita.h>
#include <libmalcontent/app-filter.h>
#include "restrict-applications-selector.h"
@ -336,16 +336,16 @@ create_row_for_app_cb (gpointer item,
else
g_object_ref (icon);
row = hdy_action_row_new ();
row = adw_action_row_new ();
/* Icon */
w = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_DIALOG);
gtk_icon_size_lookup (GTK_ICON_SIZE_DND, &size, NULL);
gtk_image_set_pixel_size (GTK_IMAGE (w), size);
hdy_action_row_add_prefix (HDY_ACTION_ROW (row), w);
adw_action_row_add_prefix (ADW_ACTION_ROW (row), w);
/* App name label */
hdy_preferences_row_set_title (HDY_PREFERENCES_ROW (row), app_name);
adw_preferences_row_set_title (ADW_PREFERENCES_ROW (row), app_name);
/* Switch */
w = g_object_new (GTK_TYPE_SWITCH,
@ -357,7 +357,7 @@ create_row_for_app_cb (gpointer item,
GTK_STYLE_PROVIDER (self->css_provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION - 1);
gtk_container_add (GTK_CONTAINER (row), w);
hdy_action_row_set_activatable_widget (HDY_ACTION_ROW (row), w);
adw_action_row_set_activatable_widget (ADW_ACTION_ROW (row), w);
gtk_widget_show_all (row);

View File

@ -78,15 +78,15 @@ struct _MctUserControls
GtkLabel *description_label;
GMenu *age_menu;
GtkSwitch *restrict_software_installation_switch;
HdyActionRow *restrict_software_installation_row;
AdwActionRow *restrict_software_installation_row;
GtkSwitch *restrict_web_browsers_switch;
HdyActionRow *restrict_web_browsers_row;
AdwActionRow *restrict_web_browsers_row;
GtkButton *oars_button;
GtkLabel *oars_button_label;
GtkPopover *oars_popover;
MctRestrictApplicationsDialog *restrict_applications_dialog;
GtkLabel *restrict_applications_description;
HdyActionRow *restrict_applications_row;
AdwActionRow *restrict_applications_row;
GSimpleActionGroup *action_group; /* (owned) */
@ -470,17 +470,17 @@ update_labels_from_name (MctUserControls *self)
/* Translators: The placeholder is a users display name. */
l = g_strdup_printf (_("Prevents %s from running web browsers. Limited web content may still be available in other applications."), self->user_display_name);
hdy_action_row_set_subtitle (self->restrict_web_browsers_row, l);
adw_action_row_set_subtitle (self->restrict_web_browsers_row, l);
g_clear_pointer (&l, g_free);
/* Translators: The placeholder is a users display name. */
l = g_strdup_printf (_("Prevents specified applications from being used by %s."), self->user_display_name);
hdy_action_row_set_subtitle (self->restrict_applications_row, l);
adw_action_row_set_subtitle (self->restrict_applications_row, l);
g_clear_pointer (&l, g_free);
/* Translators: The placeholder is a users display name. */
l = g_strdup_printf (_("Prevents %s from installing applications."), self->user_display_name);
hdy_action_row_set_subtitle (self->restrict_software_installation_row, l);
adw_action_row_set_subtitle (self->restrict_software_installation_row, l);
g_clear_pointer (&l, g_free);
}

View File

@ -27,7 +27,7 @@
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <libhandy-1/handy.h>
#include <adwaita.h>
#include <libmalcontent/malcontent.h>

View File

@ -4,9 +4,9 @@
<requires lib="gtk+" version="3.12"/>
<template class="MctUserControls" parent="GtkBin">
<child>
<object class="HdyPreferencesPage">
<object class="AdwPreferencesPage">
<child>
<object class="HdyPreferencesGroup">
<object class="AdwPreferencesGroup">
<child>
<object class="GtkLabel" id="description_label">
<property name="wrap">True</property>
@ -19,10 +19,10 @@
<!-- Application Usage Restrictions -->
<child>
<object class="HdyPreferencesGroup">
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Application Usage Restrictions</property>
<child>
<object class="HdyActionRow" id="restrict_web_browsers_row">
<object class="AdwActionRow" id="restrict_web_browsers_row">
<property name="title" translatable="yes">Restrict _Web Browsers</property>
<property name="use_underline">True</property>
<property name="activatable_widget">restrict_web_browsers_switch</property>
@ -43,7 +43,7 @@
</child>
<child>
<object class="HdyActionRow" id="restrict_applications_row">
<object class="AdwActionRow" id="restrict_applications_row">
<property name="activatable">True</property>
<property name="title" translatable="yes">_Restrict Applications</property>
<property name="use_underline">True</property>
@ -66,10 +66,10 @@
<!-- Software Installation Restrictions -->
<child>
<object class="HdyPreferencesGroup">
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Software Installation Restrictions</property>
<child>
<object class="HdyActionRow" id="restrict_software_installation_row">
<object class="AdwActionRow" id="restrict_software_installation_row">
<property name="visible" bind-source="restrict_software_installation_switch" bind-property="visible" bind-flags="default|sync-create" />
<property name="title" translatable="yes">Restrict Application _Installation</property>
<property name="use_underline">True</property>
@ -91,7 +91,7 @@
</child>
<child>
<object class="HdyActionRow">
<object class="AdwActionRow">
<property name="title" translatable="yes">Application _Suitability</property>
<property name="use_underline">True</property>
<property name="activatable_widget">oars_button</property>

View File

@ -27,7 +27,7 @@
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <libhandy-1/handy.h>
#include <adwaita.h>
#include <libmalcontent-ui/malcontent-ui.h>
#include <polkit/polkit.h>
@ -77,7 +77,7 @@ struct _MctApplication
MctUserSelector *user_selector;
MctUserControls *user_controls;
GtkStack *main_stack;
HdyStatusPage *error_page;
AdwStatusPage *error_page;
GtkLockButton *lock_button;
GtkButton *user_accounts_panel_button;
GtkLabel *help_label;
@ -209,7 +209,7 @@ mct_application_activate (GApplication *application)
self->main_stack = GTK_STACK (gtk_builder_get_object (builder, "main_stack"));
self->user_selector = MCT_USER_SELECTOR (gtk_builder_get_object (builder, "user_selector"));
self->user_controls = MCT_USER_CONTROLS (gtk_builder_get_object (builder, "user_controls"));
self->error_page = HDY_STATUS_PAGE (gtk_builder_get_object (builder, "error_page"));
self->error_page = ADW_STATUS_PAGE (gtk_builder_get_object (builder, "error_page"));
self->lock_button = GTK_LOCK_BUTTON (gtk_builder_get_object (builder, "lock_button"));
self->user_accounts_panel_button = GTK_BUTTON (gtk_builder_get_object (builder, "user_accounts_panel_button"));
@ -248,7 +248,7 @@ mct_application_startup (GApplication *application)
/* Chain up. */
G_APPLICATION_CLASS (mct_application_parent_class)->startup (application);
hdy_init ();
adw_init ();
g_action_map_add_action_entries (G_ACTION_MAP (application), app_entries,
G_N_ELEMENTS (app_entries), application);
@ -371,9 +371,9 @@ update_main_stack (MctApplication *self)
if ((is_user_manager_loaded && act_user_manager_no_service (self->user_manager)) ||
self->permission_error != NULL)
{
hdy_status_page_set_title (self->error_page,
adw_status_page_set_title (self->error_page,
_("Failed to load user data from the system"));
hdy_status_page_set_description (self->error_page,
adw_status_page_set_description (self->error_page,
_("Please make sure that the AccountsService is installed and enabled."));
new_page_name = "error";

View File

@ -2,14 +2,14 @@
<!-- Copyright © 2019, 2020 Endless Mobile, Inc. -->
<interface>
<requires lib="gtk+" version="3.12"/>
<object class="HdyApplicationWindow" id="main_window">
<object class="AdwApplicationWindow" id="main_window">
<property name="default-width">540</property>
<property name="default-height">580</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="HdyHeaderBar" id="header">
<object class="AdwHeaderBar" id="header">
<property name="show-close-button">True</property>
<!-- Translators: This is the title of the main window -->
<property name="title" translatable="yes">Parental Controls</property>
@ -65,7 +65,7 @@
</child>
<child>
<object class="HdyStatusPage">
<object class="AdwStatusPage">
<property name="title" translatable="yes">Permission Required</property>
<property name="description" translatable="yes">Permission is required to view and change user parental controls settings.</property>
<property name="icon-name">org.freedesktop.MalcontentControl</property>
@ -83,7 +83,7 @@
</child>
<child>
<object class="HdyStatusPage">
<object class="AdwStatusPage">
<property name="icon-name">system-users-symbolic</property>
<property name="title" translatable="yes">No Standard User Accounts</property>
<property name="description" translatable="yes">Parental controls can only be applied to standard user
@ -126,7 +126,7 @@
</child>
<child>
<object class="HdyStatusPage" id="error_page">
<object class="AdwStatusPage" id="error_page">
<property name="icon-name">dialog-error-symbolic</property>
</object>
<packing>